/** * Skills event factories. * * Single source of truth for constructing every `sdk.skill.*` event the * skills layer emits. Call sites import the matching factory rather than * hand-building the discriminated-union object literal, so the wire shape * stays consistent across the codebase and a new field on an event lands * in exactly one place. * * Each factory mirrors the discriminator key on the closed `SkillEvent` * union in `types.ts`; the return type narrows to the matching variant so * downstream consumers see the precise event shape they expect. * * Doc table: `knowledge/doc/skills.md` ยง9 cross-references each event to * its emission point in the codebase. */ import type { ParsedSkill, SkillEvent, SkillEventSeverity, SkillSource, SkillTrustTier } from './types.js'; export declare function skillSourceScanned(args: { source: SkillSource; durationMs: number; count: number; errors: number; }): Extract; export declare function skillDiscovered(args: { fqn: string; source: SkillSource; version: string; trustTier: SkillTrustTier; }): Extract; export declare function skillShadowed(args: { fqn: string; winner: { source: SkillSource; version: string; }; loser: { source: SkillSource; version: string; }; }): Extract; export declare function skillError(args: { source?: SkillSource; path?: string; severity: SkillEventSeverity; message: string; }): Extract; export declare function skillUnknownField(args: { path: string; field: string; }): Extract; export declare function skillIndexed(args: { catalogSize: number; includedCount: number; source: 'all' | 'truncated' | 'embedding'; charsUsed: number; }): Extract; export declare function skillIndexTruncated(args: { reason: 'no_embedder' | 'embedder_failed' | 'over_budget'; omittedCount: number; }): Extract; export declare function skillIndexFiltered(args: { catalogSize: number; includedCount: number; scoreFloor: number; scoreCeiling: number; embedderId: string; }): Extract; export declare function skillIndexOverflowPinned(args: { skill: string; charsRequired: number; budget: number; }): Extract; export declare function skillPinOmitted(args: { skill: string; reason: 'budget_hard_cap_exceeded'; charsUsed: number; hardCap: number; }): Extract; export declare function skillActivated(args: { skill: string; source: 'caller' | 'llm'; tier: SkillTrustTier; }): Extract; export declare function skillLoaded(args: { skill: string; bytes: number; cached: boolean; }): Extract; export declare function skillFileLoaded(args: { skill: string; path: string; bytes: number; cached: boolean; }): Extract; export declare function skillFileRejected(args: { skill: string; path: string; reason: string; }): Extract; export declare function skillInvocationDenied(args: { skill: string; reason: Extract['reason']; }): Extract; export declare function skillTierAssigned(args: { skill: string; tier: SkillTrustTier; }): Extract; export declare function skillAllowedToolsApplied(args: { skill: string; tools: readonly string[]; }): Extract; export declare function skillAllowedToolsAdvisory(args: { skill: string; tools: readonly string[]; }): Extract; export declare function skillAllowedToolsUnmatched(args: { skill: string; missing: readonly string[]; }): Extract; export declare function skillHooksIgnored(args: { skill: string; }): Extract; export declare function skillDisableModelInvocationOverridden(args: { skill: string; source: 'caller'; }): Extract; export declare function skillRequiresTrustDenied(args: { parent: string; child: string; reason: string; }): Extract; export declare function skillRequiresCapExceeded(args: { parent: string; kind_breach: 'depth' | 'breadth' | 'token_budget'; limit: number; actual: number; }): Extract; export declare function skillSubstitutionWarn(args: { skill: string; reference: string; reason: 'out_of_bounds' | 'unknown_named' | 'malformed'; }): Extract; export declare function skillLockDrift(args: { fqn: string; expectedSha256: string; actualSha256: string; }): Extract; export declare function skillLockUnreachable(args: { fqn: string; source: SkillSource; }): Extract; export declare function skillPreprocessExecuted(args: { skill: string; command: string; mode: Extract['mode']; durationMs: number; exitCode: number | null; outputBytes: number; truncated: boolean; timedOut: boolean; }): Extract; export declare function skillPreprocessBlocked(args: { skill: string; command: string; reason: Extract['reason']; }): Extract; export declare function skillForkDeclined(args: { skill: string; agent?: string; reason: 'no_multi_agent'; }): Extract; export declare function skillRemoved(args: { fqn: string; source: SkillSource; }): Extract; export declare function skillCatalogEpochBumped(args: { from: number; to: number; reason: 'initial_discover' | 'watcher_event'; }): Extract; export declare const SKILL_EVENT_KINDS: readonly ["sdk.skill.source_scanned", "sdk.skill.discovered", "sdk.skill.shadowed", "sdk.skill.error", "sdk.skill.unknown_field", "sdk.skill.indexed", "sdk.skill.index_truncated", "sdk.skill.index_filtered", "sdk.skill.index_overflow_pinned", "sdk.skill.pin_omitted", "sdk.skill.loaded", "sdk.skill.file_loaded", "sdk.skill.file_rejected", "sdk.skill.invocation_denied", "sdk.skill.activated", "sdk.skill.disable_model_invocation_overridden", "sdk.skill.allowed_tools_applied", "sdk.skill.allowed_tools_advisory", "sdk.skill.allowed_tools_unmatched", "sdk.skill.hooks_ignored", "sdk.skill.tier_assigned", "sdk.skill.requires_trust_denied", "sdk.skill.requires_cap_exceeded", "sdk.skill.substitution_warn", "sdk.skill.lock_drift", "sdk.skill.lock_unreachable", "sdk.skill.preprocess_executed", "sdk.skill.preprocess_blocked", "sdk.skill.fork_declined", "sdk.skill.removed", "sdk.skill.catalog_epoch_bumped"]; export declare function eventSubjectFqn(event: SkillEvent): string | null; /** Type-narrowing helper exporting the skill associated with a ParsedSkill payload. */ export declare function tierAssignedFor(skill: ParsedSkill): Extract; //# sourceMappingURL=events.d.ts.map