InferenceAuditEvent
@totemsdk/edge / InferenceAuditEvent
Type Alias: InferenceAuditEvent
InferenceAuditEvent = {
agentId?:string;context?:Record<string,unknown>;event:"started";principal?:string;proposalId?:string;providerId:string;requestId:string;runId?:string;startedAt:number;workflow: {domain:string;op:string; }; } | {context?:Record<string,unknown>;errorCode?:string;errorMessage?:string;event:"finished";finishedAt:number;outcome:"completed"|"failed"|"outcome-unknown";requestId:string;usage?:InferenceRecordedUsage; }
Journaled inference usage/execution event.
Two events per dispatched call, joined by requestId. The journal is
append-only: outcomes are never mutated in place, a finished event is
appended when the outcome is known (or deliberately recorded unknown).
Union Members
Type Literal
{ agentId?: string; context?: Record<string, unknown>; event: "started"; principal?: string; proposalId?: string; providerId: string; requestId: string; runId?: string; startedAt: number; workflow: { domain: string; op: string; }; }
agentId?
readonlyoptionalagentId?:string
context?
readonlyoptionalcontext?:Record<string,unknown>
Verbatim invocation context (governance linkage for reconciliation).
event
readonlyevent:"started"
principal?
readonlyoptionalprincipal?:string
proposalId?
readonlyoptionalproposalId?:string
providerId
readonlyproviderId:string
requestId
readonlyrequestId:string
runId?
readonlyoptionalrunId?:string
startedAt
readonlystartedAt:number
workflow
readonlyworkflow:object
workflow.domain
readonlydomain:string
workflow.op
readonlyop:string
Type Literal
{ context?: Record<string, unknown>; errorCode?: string; errorMessage?: string; event: "finished"; finishedAt: number; outcome: "completed" | "failed" | "outcome-unknown"; requestId: string; usage?: InferenceRecordedUsage; }
context?
readonlyoptionalcontext?:Record<string,unknown>
Verbatim invocation context, mirrored from the paired started event.
errorCode?
readonlyoptionalerrorCode?:string
errorMessage?
readonlyoptionalerrorMessage?:string
event
readonlyevent:"finished"
finishedAt
readonlyfinishedAt:number
outcome
readonlyoutcome:"completed"|"failed"|"outcome-unknown"
requestId
readonlyrequestId:string
usage?
readonlyoptionalusage?:InferenceRecordedUsage