UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

17 lines • 735 B
/** The epoch-ms `[start, end)` a {@link GovernanceRange} or a {@link TimestampRange} covers. */ export function rangeBounds(range) { if ('fromDay' in range) { return { start: Date.parse(`${range.fromDay}T00:00:00.000Z`), end: Date.parse(`${range.toDay}T23:59:59.999Z`) + 1, }; } const instant = (value) => value instanceof Date ? value.getTime() : Date.parse(value); const start = instant(range.from); const end = instant(range.to); if (!Number.isFinite(start) || !Number.isFinite(end)) { throw new TypeError('usageBreakdown: from and to must be instants (ISO strings or Dates)'); } return { start, end }; } //# sourceMappingURL=governance-queries.js.map