Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

14 lines
461 B
TypeScript

import type { AfterToolCallContext, AfterToolCallResult } from '@earendil-works/pi-agent-core';
/** Budget source — v0 stub; wire to the credit/quota system later. */
export interface QuotaSource {
remaining(): number;
}
export function makeQuotaHook(source: QuotaSource) {
return async (_ctx: AfterToolCallContext): Promise<AfterToolCallResult | undefined> => {
if (source.remaining() <= 0) return { terminate: true };
return undefined;
};
}