* Apply a host's configured path + tool rewrites. Extracted so both SKILL.md * (via processExternalHost) and section files (via processSectionTemplate) get * identical per-host treatment — a section's cross-references must rewrite the * same way the parent skill's do, or external hosts get wrong
(content: string, hostConfig: HostConfig)
| 646 | * same way the parent skill's do, or external hosts get wrong paths. |
| 647 | */ |
| 648 | function applyHostRewrites(content: string, hostConfig: HostConfig): string { |
| 649 | let result = content; |
| 650 | for (const rewrite of hostConfig.pathRewrites) { |
| 651 | result = result.replaceAll(rewrite.from, rewrite.to); |
| 652 | } |
| 653 | if (hostConfig.toolRewrites) { |
| 654 | for (const [from, to] of Object.entries(hostConfig.toolRewrites)) { |
| 655 | result = result.replaceAll(from, to); |
| 656 | } |
| 657 | } |
| 658 | return result; |
| 659 | } |
| 660 | |
| 661 | /** |
| 662 | * Resolve {{PLACEHOLDER}} / {{NAME:arg}} tokens against the RESOLVERS registry, |
no outgoing calls
no test coverage detected