import type { DiscoveredContribution, InstructionInjector } from "../contracts.js"; import type { ContributionRegistries } from "../contributions.js"; import type { PermissionPolicy, TrustPolicy } from "../security.js"; export interface LoadInstructionInjectorOptions { /** Host-owned module loader for declarations with a `module` field. Core never * auto-`import()`s (matches Phase 29's tools/context stance); when a module * injector is discovered but no loader is supplied, it is skipped. */ readonly moduleLoader?: (module: string, exportName?: string) => Promise; /** Optional escape hatch for instruction resources outside the contribution dir. */ readonly resourceTrust?: TrustPolicy; readonly permission?: PermissionPolicy; } /** * Turn a discovered `kind: "instructions"` contribution into a live * {@link InstructionInjector}. Markdown-only contributions (no `module`) * load as a static `{ instructions, when: "every_turn" }` injector; module * contributions load through the host-supplied `moduleLoader` (or skipped when * absent). Core performs no `import()`; fs reads happen only via this Node * adapter, never on plain SDK in-memory use. * * ponytail: reuses Phase 29's scanner output (DiscoveredContribution); this is * only the per-kind adapter, mirroring how skills are realized in core. */ export declare function loadInstructionInjector(contribution: DiscoveredContribution, options?: LoadInstructionInjectorOptions): Promise; /** Load every discovered `instructions` contribution into injectors. * Same-name merge order (workspace over global) is already resolved by the * Phase 29 scanner (`discoverContributions` dedupes on `(kind, name)`); this * adapter only turns the deduped list into injectors. */ export declare function loadInstructionInjectors(contributions: readonly DiscoveredContribution[], options?: LoadInstructionInjectorOptions): Promise; /** Load discovered instruction injectors and register them into * `registries.instructionInjectors`. Host-owned entry point — never invoked by * plain SDK in-memory use (which leaves the registry empty). */ export declare function registerDiscoveredInstructionInjectors(registries: ContributionRegistries, contributions: readonly DiscoveredContribution[], options?: LoadInstructionInjectorOptions): Promise;