🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
feat(ruflo-federation): function-hook mod (secret guard, /federation-mod, status file)
ruv7f07fae49fcc
diff --git a/plugins/ruflo-federation/.claude-plugin/plugin.json b/plugins/ruflo-federation/.claude-plugin/plugin.jsonindex e5e0346e1c..4c6025a39c 100644--- a/plugins/ruflo-federation/.claude-plugin/plugin.json+++ b/plugins/ruflo-federation/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "ruflo-federation","description": "Cross-installation agent federation with zero-trust security, peer discovery, consensus-based task routing, and per-call budget circuit breaker (ADR-097)",- "version": "0.2.1",+ "version": "0.3.0","author": {"name": "ruvnet","url": "https://github.com/ruvnet"@@ -21,6 +21,22 @@"token-quota","mcp","pii-pipeline",- "audit-log"- ]+ "audit-log",+ "mod",+ "function-hooks",+ "guard"+ ],+ "userConfig": {+ "guard": {+ "type": "string",+ "title": "Secret guard",+ "description": "Refuse outbound federation messages (secrets and obvious PII) that hold a key, token or password. On by default; it only ever tightens.",+ "required": false,+ "default": "on",+ "options": [+ "on",+ "off"+ ]+ }+ }}diff --git a/plugins/ruflo-federation/README.md b/plugins/ruflo-federation/README.mdindex 90769b4e7a..e5a9778bfd 100644--- a/plugins/ruflo-federation/README.md+++ b/plugins/ruflo-federation/README.md@@ -103,3 +103,14 @@ bash plugins/ruflo-federation/scripts/smoke.sh## Architecture Decisions- [`ADR-0001` — ruflo-federation plugin contract (3-gate alignment, ADR-097 budget integration, namespace coordination, smoke as contract)](./docs/adrs/0001-federation-contract.md)++## As a mod++Since this version the plugin is also a function-hook mod (ADR-445 pattern; needs Claude Code 2.1.287 or later). It never calls the network or spawns a process, and it only tightens: it can refuse a call, never allow one.++- **Guard** (default on): refuses outbound federation calls (`x_federation_publish`, `x_federation_channel_publish`, `x_federation_sync`, `federation_bbs_publish`, `federation_bbs_sync`, and `federation`-namespace memory writes) that hold a key, token or password or personal data (an SSN or a Luhn-valid card number). The reason names the kind of secret, never the value.+- **`/federation-mod`**: answered locally, no model turn: `status`, `scan <text>` (would the guard refuse this?), and `tools` (the connected federation tools).+- **Status file**: `.claude-flow/federation-mod/status.json` (`{version, updatedMs, guard, blocked}`), written at session start and when a call is blocked.+- **Option**: `guard` (`on` | `off`, default `on`) in the plugin's `userConfig`.++Test it: `claude plugin test plugins/ruflo-federation` and `bash plugins/ruflo-federation/scripts/smoke.sh`.diff --git a/plugins/ruflo-federation/hooks/command.ts b/plugins/ruflo-federation/hooks/command.tsnew file mode 100644index 0000000000..713689193e--- /dev/null+++ b/plugins/ruflo-federation/hooks/command.ts@@ -0,0 +1,36 @@+import type { FsEntry } from 'claude-code'++import { secretNames } from './screen'+import type { Stats } from './status'++/** `/federation-mod` is answered locally and takes no model turn. Everything it reads is already connected; nothing is written. */+export type CommandDeps = {+ readonly guard: boolean+ readonly stats: Stats+ readonly tools: () => Promise<readonly string[]>+ readonly list: (path: string) => Promise<readonly FsEntry[]>+}++const HELP = ['/federation-mod status', '/federation-mod scan <text>', '/federation-mod tools'].join('\n')++export async function answer(args: string, deps: CommandDeps): Promise<string> {+ const [verb = '', ...rest] = args.trim().split(/\s+/)+ const arg = rest.join(' ')++ if (verb === '' || verb === 'help') return HELP++ if (verb === 'status') return `guard ${deps.guard ? 'on' : 'off'} · calls blocked ${deps.stats.blocked}`++ if (verb === 'scan') {+ if (arg === '') return 'usage: /federation-mod scan <text>'+ const found = secretNames(arg)+ return found.length ? `The guard would refuse that (${found.join(', ')}).` : 'Nothing found: the guard would let that through.'+ }++ if (verb === 'tools') {+ const names = (await deps.tools()).filter(n => /__(?:x_)?federation_[a-z_]+$/.test(n)).map(n => n.slice(n.lastIndexOf('__') + 2)).sort()+ return names.length ? `${names.length} federation tools connected:\n${names.map(n => `- ${n}`).join('\n')}` : 'No federation tool is connected. Connect the ruflo MCP server and try again.'+ }++ return `Unknown: ${verb}\n${HELP}`+}diff --git a/plugins/ruflo-federation/hooks/guard.ts b/plugins/ruflo-federation/hooks/guard.tsnew file mode 100644index 0000000000..f4d0f0cfa1--- /dev/null+++ b/plugins/ruflo-federation/hooks/guard.ts@@ -0,0 +1,38 @@+import { hasSecret, textsOf } from './screen'++/** The tool name without its `mcp__<server>__` prefix. */+const tail = (name: string) => (name.startsWith('mcp__') ? name.slice(name.lastIndexOf('__') + 2) : name)++/** Federation tools that put content in front of another installation, plus a federation-namespaced memory write. */+const OUTBOUND = /^(?:x_federation_(?:publish|channel_publish|sync)|federation_bbs_(?:publish|sync))$/++/** US SSN, and a 13-16 digit run that passes the Luhn check (a card number). */+const SSN = /\b\d{3}-\d{2}-\d{4}\b/+const CARD = /\b(?:\d[ -]?){12,15}\d\b/g++function luhn(digits: string): boolean {+ let sum = 0+ for (let i = 0; i < digits.length; i++) {+ let d = Number(digits[digits.length - 1 - i])+ if (i % 2 === 1) d = d > 4 ? d * 2 - 9 : d * 2+ sum += d+ }+ return sum % 10 === 0+}++const hasPii = (text: string) => SSN.test(text) || (text.match(CARD) ?? []).some(m => luhn(m.replace(/\D/g, '')))++const isFederationMemory = (input: unknown) => {+ const o = (typeof input === 'object' && input !== null ? input : {}) as Record<string, unknown>+ return o.namespace === 'federation'+}++/** The reason an outbound federation call is refused, or undefined when it may go. Names the category, never the value. */+export function verdict(tool: string, input: unknown): string | undefined {+ const t = tail(tool)+ if (!(OUTBOUND.test(t) || (t === 'memory_store' && isFederationMemory(input)))) return undefined+ const texts = textsOf(input)+ if (texts.some(hasSecret)) return 'ruflo-federation: this message holds what looks like a secret (a key, token or password). It would leave this installation: remove it.'+ if (texts.some(hasPii)) return 'ruflo-federation: this message holds what looks like personal data (an SSN or card number). It would leave this installation: remove it or route it through the PII pipeline.'+ return undefined+}diff --git a/plugins/ruflo-federation/hooks/hooks.json b/plugins/ruflo-federation/hooks/hooks.jsonnew file mode 100644index 0000000000..75ff6ec2cf--- /dev/null+++ b/plugins/ruflo-federation/hooks/hooks.json@@ -0,0 +1,4 @@+{+ "description": "Federation as a mod: a guard that keeps secrets and obvious PII out of federation publishes and sends, /federation-mod, and a status file.",+ "modules": ["./register.ts"]+}diff --git a/plugins/ruflo-federation/hooks/options.ts b/plugins/ruflo-federation/hooks/options.tsnew file mode 100644index 0000000000..e18352b921--- /dev/null+++ b/plugins/ruflo-federation/hooks/options.ts@@ -0,0 +1,9 @@+import type { PluginOptions } from 'claude-code'++/** The plugin's `userConfig`, validated: a bad value is the default (guard on). */+export type ModOptions = { readonly guard: boolean }++const flag = (value: unknown, fallback: boolean) =>+ value === true || value === 'true' || value === 'on' ? true : value === false || value === 'false' || value === 'off' ? false : fallback++export const readOptions = (options: PluginOptions | undefined): ModOptions => ({ guard: flag((options ?? {}).guard, true) })diff --git a/plugins/ruflo-federation/hooks/register.ts b/plugins/ruflo-federation/hooks/register.tsnew file mode 100644index 0000000000..4260230a55--- /dev/null+++ b/plugins/ruflo-federation/hooks/register.ts@@ -0,0 +1,62 @@+import type { Hook, Register } from 'claude-code'++import { answer } from './command'+import { verdict } from './guard'+import { readOptions, type ModOptions } from './options'+import { newStats, STATUS_PATH, statusText, type Stats } from './status'++type Dollar = Parameters<Hook<'session.start'>>[0]++/** Everything one session of the mod keeps: its settings, counters and the project root. */+type Session = { readonly opts: ModOptions; readonly stats: Stats; root?: string }++async function flush($: Dollar, s: Session): Promise<void> {+ if (s.root === undefined) return+ try {+ await $.fs.write(`${s.root}/${STATUS_PATH}`, statusText(s.stats, s.opts.guard, await $.clock.now()))+ } catch {+ /* the status file is a courtesy */+ }+}++/**+ * ruflo-federation as a mod (ADR-445 pattern): a tighten-only guard on this plugin's own tools, `/federation-mod` and a status file. No network, no process+ * spawning: only tools already connected.+ */+export const register: Register = (on, options) => {+ const s: Session = { opts: readOptions(options), stats: newStats() }++ on('session.start', async ($, e, next) => {+ const result = await next(e)+ s.root = (await $.session.root()) as string | undefined+ try {+ await $.command.register({ name: 'federation-mod', description: 'ruflo-federation mod: status, scan <text>, plus a read-only listing' })+ } catch {+ /* a name taken by another plugin must not stop the mod */+ }+ await flush($, s)+ return result+ })++ if (s.opts.guard) {+ on('tool.call', async ($, e, next) => {+ const reason = verdict(e.tool, e)+ if (reason === undefined) return next(e)+ s.stats.blocked+++ await flush($, s)+ return { deny: reason }+ })+ }++ /** `/federation-mod` is answered locally and takes no model turn. */+ on('command.run', { command: 'federation-mod' }, async ($, e) => {+ const args = typeof e.args === 'string' ? e.args : ''+ const text = await answer(args, {+ guard: s.opts.guard,+ stats: s.stats,+ tools: async () => (await $.tool.list()).map(t => t.name),+ list: path => $.fs.list(path),+ })+ return { text }+ })+}diff --git a/plugins/ruflo-federation/hooks/screen.ts b/plugins/ruflo-federation/hooks/screen.tsnew file mode 100644index 0000000000..14e017efed--- /dev/null+++ b/plugins/ruflo-federation/hooks/screen.ts@@ -0,0 +1,41 @@+/**+ * Pure secret screening for this mod (copied from ruflo-agentdb's ADR-445 screen.ts, injection rules dropped). Findings are NAMES only: the+ * matched text is never returned, logged or counted by value.+ */++const SECRETS: readonly (readonly [string, RegExp])[] = [+ ['private key', /-----BEGIN [A-Z ]*PRIVATE KEY-----/],+ ['aws access key', /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/],+ ['github token', /\b(?:gh[pousr]_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{40,})\b/],+ ['slack token', /\bxox[abprs]-[A-Za-z0-9-]{10,}/],+ ['google api key', /\bAIza[0-9A-Za-z_-]{35}\b/],+ ['anthropic or openai key', /\bsk-(?:ant-|proj-)?[A-Za-z0-9_-]{24,}/],+ ['jwt', /\beyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/],+ ['bearer token', /\bBearer\s+[A-Za-z0-9._~+/=-]{24,}/],+ ['key assignment', /\b(?:api[_-]?key|secret|token|passw(?:or)?d|credential)s?["']?\s*[:=]\s*["']?[A-Za-z0-9/+=_.-]{16,}/i],+]++// C0/C1 controls (keeping tab and newline), DEL, zero-width and bidi override characters; built with escapes, never raw.+const INVISIBLE = new RegExp('[\\u0000-\\u0008\\u000b-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2064\\ufeff]', 'g')++const bare = (text: string) => (text.length > 20_000 ? text.slice(0, 20_000) : text).replace(INVISIBLE, '')++/** Names of every secret shape found in `text`. Cost is linear in the capped input. */+export const secretNames = (text: string): string[] => {+ const bounded = bare(text)+ return SECRETS.filter(([, re]) => re.test(bounded)).map(([name]) => name)+}++export const hasSecret = (text: string) => secretNames(text).length > 0++/** Every string in a tool's input, to a bounded depth and size: what a guard reads. */+export function textsOf(input: unknown, budget = { left: 20_000 }, depth = 0): string[] {+ if (budget.left <= 0 || depth > 6) return []+ if (typeof input === 'string') {+ budget.left -= input.length+ return [input]+ }+ if (Array.isArray(input)) return input.slice(0, 200).flatMap(v => textsOf(v, budget, depth + 1))+ if (typeof input === 'object' && input !== null) return Object.values(input).slice(0, 200).flatMap(v => textsOf(v, budget, depth + 1))+ return []+}diff --git a/plugins/ruflo-federation/hooks/status.ts b/plugins/ruflo-federation/hooks/status.tsnew file mode 100644index 0000000000..e3f2e5a550--- /dev/null+++ b/plugins/ruflo-federation/hooks/status.ts@@ -0,0 +1,10 @@+/** Counters the mod keeps for the session and writes to `.claude-flow/federation-mod/status.json`. */+export type Stats = { blocked: number }++export const newStats = (): Stats => ({ blocked: 0 })++export const STATUS_PATH = '.claude-flow/federation-mod/status.json'++/** The file's text; `version` lets a reader refuse a shape it does not know. */+export const statusText = (stats: Stats, guard: boolean, nowMs: number): string =>+ `${JSON.stringify({ version: 1, updatedMs: nowMs, guard, ...stats }, null, 2)}\n`diff --git a/plugins/ruflo-federation/scripts/smoke.sh b/plugins/ruflo-federation/scripts/smoke.shindex 4474eba81d..84c5cd04b8 100755--- a/plugins/ruflo-federation/scripts/smoke.sh+++ b/plugins/ruflo-federation/scripts/smoke.sh@@ -7,9 +7,9 @@ step() { printf "→ %s ... " "$1"; }ok() { printf "PASS\n"; PASS=$((PASS+1)); }bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }-step "1. plugin.json declares 0.2.1 with new keywords"+step "1. plugin.json declares 0.3.0 with new keywords"v=$(grep -E '"version"' "$ROOT/.claude-plugin/plugin.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)-if [[ "$v" != "0.2.1" ]]; then bad "expected 0.2.1, got '$v'"; else+if [[ "$v" != "0.3.0" ]]; then bad "expected 0.3.0, got '$v'"; elsemiss=""for k in mcp pii-pipeline audit-log; dogrep -q "\"$k\"" "$ROOT/.claude-plugin/plugin.json" || miss="$miss $k"@@ -82,5 +82,24 @@ for f in "$ROOT"/skills/*/SKILL.md; dodone[[ -z "$bad_skills" ]] && ok || bad "wildcard:$bad_skills"+# M1. The mod (ADR-445 pattern): hooks module registered, files within the 500-line rule, no network or process access in the hooks+step "M1. mod: hooks.json names register.ts, every hook file is present and under 500 lines"+mod_ok=1+grep -q '"./register.ts"' "$ROOT/hooks/hooks.json" || mod_ok=0+for f in options screen guard command status register; do+ [[ -f "$ROOT/hooks/$f.ts" ]] || mod_ok=0+ [[ $(wc -l < "$ROOT/hooks/$f.ts" 2>/dev/null || echo 9999) -le 500 ]] || mod_ok=0+done+[[ $mod_ok -eq 1 ]] && ok || bad "mod hooks incomplete or too long"++step "M2. mod: guard defaults on, and it is the only userConfig option"+node -e '+const c = require(process.argv[1]).userConfig || {}+process.exit(c.guard && c.guard.default === "on" && Object.keys(c).length === 1 ? 0 : 1)+' "$ROOT/.claude-plugin/plugin.json" && ok || bad "userConfig defaults wrong"++step "M3. mod: hooks never touch the network or spawn a process"+if grep -nE '\$\.(http|process)\.|child_process|fetch\(' "$ROOT"/hooks/*.ts >/dev/null; then bad "network or process call in hooks"; else ok; fi+printf "\n%s passed, %s failed\n" "$PASS" "$FAIL"[[ $FAIL -eq 0 ]] || exit 1diff --git a/plugins/ruflo-federation/tests/mod.test.ts b/plugins/ruflo-federation/tests/mod.test.tsnew file mode 100644index 0000000000..0e8370ca52--- /dev/null+++ b/plugins/ruflo-federation/tests/mod.test.ts@@ -0,0 +1,123 @@+import type { On } from 'claude-code'+import { describe, expect, test, tier } from 'claude-code/testing'++tier('user')++const ROOT = '/work'+const START = { surface: 'terminal', isInteractive: true, cwd: ROOT } as const+const slash = (args: string) => ({ command: 'federation-mod', args, origin: { kind: 'composer' }, presentation: { isFullscreen: false, columns: 100 } }) as const+const STATUS = `${ROOT}/.claude-flow/federation-mod/status.json`+const SECRET = `ghp_${'a1B2'.repeat(10)}`++/** The world beneath the mod: a project root, a file map, a tool list and a directory map. */+function world(on: On, tools: readonly string[] = [], dirs: Record<string, { name: string; kind: 'file' | 'dir'; mtimeMs?: number }[]> = {}) {+ const files = new Map<string, string>()+ on('session.start', ($, e) => ({ cwd: e.cwd }))+ on('session.root', () => ({ value: ROOT }))+ on('command.register', ($, e) => ({ value: { command: e.name } }))+ on('fs.write', ($, e) => (files.set(e.path, e.text), { value: undefined }))+ on('fs.list', ($, e) => {+ const key = Object.keys(dirs).find(k => e.path === k || e.path.endsWith(`/${k}`))+ const entries = key === undefined ? undefined : dirs[key]+ if (!entries) throw new Error('ENOENT')+ return { value: entries.map(x => ({ size: 0, mtimeMs: 0, isLink: false, ...x })) }+ })+ on('tool.list', () => ({ value: tools.map(name => ({ name, description: '', mcp: true })) }))+ on('clock.now', () => ({ value: 1_700_000_000_000 }))+ return { files }+}++const call = (input: Record<string, unknown>) => input as never+const denied = (r: unknown) => JSON.stringify(r)++describe('guard', () => {+ test('refuses a secret, never echoes it, and counts the block in the status file', async ($, on) => {+ const w = world(on)+ on('tool.call', () => ({ result: 'went through' }))+ await $.session.start(START)+ const r = await $.tool.call(call(((s: string) => ({ tool: 'mcp__plugin_ruflo-core_ruflo__x_federation_publish', body: `token ${s}` }))(SECRET))).then(+ x => x,+ (e: unknown) => ({ text: String(e) }),+ )+ expect(denied(r)).toContain('ruflo-')+ expect(denied(r)).not.toContain('went through')+ expect(denied(r)).not.toContain('ghp_')+ expect(JSON.parse(w.files.get(STATUS) ?? '{}')).toMatchObject({ version: 1, guard: true, blocked: 1 })+ })++ test('passes clean input and tools the plugin does not own', async ($, on) => {+ world(on)+ on('tool.call', () => ({ result: 'went through' }))+ await $.session.start(START)+ expect(denied(await $.tool.call(call({ tool: 'mcp__plugin_ruflo-core_ruflo__x_federation_publish', body: 'release 3.1 is out' })))).toContain('went through')+ expect(denied(await $.tool.call(call({ tool: 'Read', file_path: `/tmp/${SECRET}` })))).toContain('went through')+ })++ test('guard: off lets the call through', { options: { guard: 'off' } }, async ($, on) => {+ world(on)+ on('tool.call', () => ({ result: 'went through' }))+ await $.session.start(START)+ expect(denied(await $.tool.call(call(((s: string) => ({ tool: 'mcp__plugin_ruflo-core_ruflo__x_federation_publish', body: `token ${s}` }))(SECRET))))).toContain('went through')+ })+})++describe('guard PII', () => {+ const publish = (body: string) => call({ tool: 'mcp__plugin_ruflo-core_ruflo__x_federation_publish', body })++ test('an SSN or a Luhn-valid card number is refused, an order id is not, and the value is never echoed', async ($, on) => {+ world(on)+ on('tool.call', () => ({ result: 'went through' }))+ await $.session.start(START)+ for (const bad of ['ssn 123-45-6789', 'card 4111 1111 1111 1111']) {+ const r = await $.tool.call(publish(bad)).then(+ x => x,+ (e: unknown) => ({ text: String(e) }),+ )+ expect(denied(r)).toContain('personal data')+ expect(denied(r)).not.toContain('6789')+ expect(denied(r)).not.toContain('4111')+ }+ expect(denied(await $.tool.call(publish('order 4111 1111 1111 1112')))).toContain('went through')+ })++ test('a federation-namespaced memory write is screened, other namespaces are not', async ($, on) => {+ world(on)+ on('tool.call', () => ({ result: 'went through' }))+ await $.session.start(START)+ const r = await $.tool.call(call({ tool: 'mcp__plugin_ruflo-core_ruflo__memory_store', namespace: 'federation', key: 'peer', value: `key ${SECRET}` })).then(+ x => x,+ (e: unknown) => ({ text: String(e) }),+ )+ expect(denied(r)).not.toContain('went through')+ expect(denied(await $.tool.call(call({ tool: 'mcp__plugin_ruflo-core_ruflo__memory_store', namespace: 'tasks', key: 'peer', value: `key ${SECRET}` })))).toContain('went through')+ })+})++describe('status file', () => {+ test('is written at session start with the defaults', async ($, on) => {+ const w = world(on)+ await $.session.start(START)+ expect(JSON.parse(w.files.get(STATUS) ?? '{}')).toEqual({ version: 1, updatedMs: 1_700_000_000_000, guard: true, blocked: 0 })+ })+})++describe('/federation-mod', () => {+ test('status and scan answer locally, and help is the fallback', async ($, on) => {+ world(on)+ await $.session.start(START)+ expect((await $.command.run(slash('status'))).text).toBe('guard on · calls blocked 0')+ expect((await $.command.run(slash(`scan key ${SECRET}`))).text).toContain('github token')+ expect((await $.command.run(slash(`scan key ${SECRET}`))).text).not.toContain('ghp_')+ expect((await $.command.run(slash('scan plain words'))).text).toContain('Nothing found')+ expect((await $.command.run(slash(''))).text).toContain('/federation-mod scan <text>')+ expect((await $.command.run(slash('what is this'))).text).toContain('Unknown: what')+ })++ test('tools lists the connected federation tools only', async ($, on) => {+ world(on, ['mcp__plugin_ruflo-core_ruflo__x_federation_publish', 'mcp__plugin_ruflo-core_ruflo__federation_bbs_peers', 'mcp__plugin_ruflo-core_ruflo__memory_store'])+ await $.session.start(START)+ const text = (await $.command.run(slash('tools'))).text ?? ''+ expect(text).toContain('2 federation tools connected')+ expect(text).not.toContain('memory_store')+ })+})diff --git a/plugins/ruflo-federation/tsconfig.json b/plugins/ruflo-federation/tsconfig.jsonnew file mode 100644index 0000000000..e4ba54993e--- /dev/null+++ b/plugins/ruflo-federation/tsconfig.json@@ -0,0 +1,19 @@+{+ "//": "Self-contained on purpose: bundlers (vite/esbuild in the root CI vitest) load this file for every module they transform, so it must not extend a file that only exists after Claude Code (>= 2.1.287) has loaded the plugin. Claude Code writes its declarations to .claude-plugin/types/ (gitignored) on load or validate; tsc -p . then reads them through typeRoots.",+ "compilerOptions": {+ "target": "es2023",+ "lib": ["es2023"],+ "module": "esnext",+ "moduleResolution": "bundler",+ "strict": true,+ "noUncheckedIndexedAccess": true,+ "noEmit": true,+ "skipLibCheck": true,+ "jsx": "react",+ "jsxFactory": "h",+ "jsxFragmentFactory": "Fragment",+ "typeRoots": ["./.claude-plugin/types"],+ "types": ["claude-code", "claude-code-tools", "claude-code-mcp"]+ },+ "include": ["hooks", "tests"]+}