/** * 无副作用端口缺省实现。成本、审计、结算是会计链路,不提供 no-op。 * * 纯函数 / 零副作用 / 零依赖。`llm.js` 在装配时用这些填补缺省端口, * 使得包内其余代码无需到处写 `if (billingPort)` 守卫。 */ /** @typedef {import('../index.js').NotifyPort} NotifyPort */ /** @typedef {import('../index.js').TracePort} TracePort */ /** @typedef {import('../index.js').Span} Span */ /** @type {NotifyPort} */ export const noopNotifyPort = { async notify() {}, } /** @type {Span} */ const noopSpan = { setAttr() {}, addEvent() {}, end() {}, } /** @type {TracePort} */ export const noopTracePort = { startSpan() { return noopSpan }, }