Files
Kazuki Yamada e58488fd70 feat(core): Support custom file processors with external commands
intent(file-processors): run an external command per glob to transform file content before packing — JSON→TOON token reduction, SVG minify, notebook→script (#933)
decision(config-shape): input.processors array of { pattern, command, timeout?, onError? }, first-match-wins — mirrors output.patterns and leaves room for per-entry options
rejected(config-shape): issue's top-level fileProcessors map — would need a string|object union once per-entry timeout/onError were added
decision(trust-model): default-deny gate enableFileProcessors, auto-on only for the real CLI entry (commanderActionEndpoint); library pack()/runCli(), MCP, and website stay OFF; remote requires --remote-trust-config
decision(failure-mode): fail-loud by default with per-entry onError:"skip" fallback — silent fallback could ship un-sanitized/un-transformed content
decision(pipeline): apply per root right after collectFiles, before the display-path rewrite, so processor globs match the include/ignore basis and the security scan + token metrics see the transformed content
constraint(exec): command must contain {file}; run via shell with only our quoted temp path substituted (no path injection); 60s default timeout (npx cold start), 64MB maxBuffer, concurrency capped at 8
learned(token-cache): the token-count cache is keyed by content hash, so transformed content is counted correctly with no stale-cache risk
constraint(docs): user-facing option, so configuration.md updated in all 15 locales; generated JSON schema left for the post-merge CI chore PR

Co-authored-by: Samsen879 <Samsen879@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 15:18:14 +09:00
..