CreateAccountedIntelligencePortOptions
@totemsdk/edge / CreateAccountedIntelligencePortOptions
Interface: CreateAccountedIntelligencePortOptions
Properties
afterCompleted?
optionalafterCompleted?: (completed) =>Promise<void>
Optional live-accounting hook invoked after a dispatch finishes
completed (the journal write already appended). The commerce accounting
fold (@totemsdk/edge/commerce-accounting) attaches here. Best-effort:
a failure is reported to onAfterCompletedError and does NOT fail the
already-completed dispatch — the authoritative fold pass is
foldUsageStatements on restart (idempotent by messageId).
Parameters
completed
context
Record<string, unknown> | undefined
requestId
string
usage
InferenceRecordedUsage | undefined
Returns
Promise<void>
journal
journal:
Journal<InferenceAuditEvent>
Append-only accounting journal (durably-acknowledged in production).
now?
optionalnow?: () =>number
Injectable clock (defaults to Date.now).
Returns
number
onAfterCompletedError?
optionalonAfterCompletedError?: (error) =>void
Reports a best-effort afterCompleted failure (never throws upward).
Parameters
error
unknown
Returns
void
port
port:
EdgeIntelligencePort
Underlying provider-neutral port.
requestId?
optionalrequestId?: () =>string
Request-id generator used when the caller omits one (defaults to UUID).
Returns
string