UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

19 lines (18 loc) • 1.29 kB
/** * A call-bound facade over typedEmit. Permission and credential producers * supply their own facts; this owner stamps the invocation those facts * belong to. No policy, buffering, joins or scope reads. */ import type { AgentfootprintEventMap } from '../../events/registry.js'; import type { ToolCallEventIdentity } from '../../events/types.js'; import { type EmitableScope } from '../../recorders/core/typedEmit.js'; type ToolSecurityEvent = 'agentfootprint.permission.check' | 'agentfootprint.permission.halt' | 'agentfootprint.credential.requested' | 'agentfootprint.credential.acquired' | 'agentfootprint.credential.authorization_required' | 'agentfootprint.credential.failed'; /** Internal emitter: callers cannot supply or forget the captured identity. */ export type ToolSecurityEmitter = <K extends ToolSecurityEvent>(type: K, payload: Omit<AgentfootprintEventMap[K]['payload'], keyof ToolCallEventIdentity>) => void; /** * Bind at dispatch, including resumed and nested dispatch. Copy the two * primitives now: a provider may finish later, after another call started. * Never read "current call" from mutable state at delivery time. */ export declare function bindToolSecurityEvents(scope: EmitableScope, call: ToolCallEventIdentity): ToolSecurityEmitter; export {};