openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 976 B
JavaScript
import{n as e}from"./rolldown-runtime-8BhlS34s.js";function t(e){let t=-e,n=t>=0?`+`:`-`,r=Math.abs(t),i=Math.floor(r/60),a=r%60;return a===0?`UTC${n}${i}`:`UTC${n}${i}:${a.toString().padStart(2,`0`)}`}function n(e){return e===`utc`?{mode:`utc`}:{mode:`specific`,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,utcOffset:t(new Date().getTimezoneOffset())}}function r(e,t,r){let i=r?.key,a={startDate:t.startDate,endDate:t.endDate,...t.agentId?{agentId:t.agentId}:i?{}:{agentScope:`all`},...n(t.timeZone),...t.creatorKey?{creatorKey:t.creatorKey}:{},groupBy:t.scope,...i?{key:i,limit:1}:{limit:1e3},includeContextWeight:r?.includeContextWeight===!0};return r?.signal?e.request(`sessions.usage`,a,{signal:r.signal}):e.request(`sessions.usage`,a)}function i(e,t){return e.request(`sessions.usage.timeseries`,t).then(e=>e??null)}function a(e,t){return e.request(`sessions.usage.logs`,{...t,limit:1e3})}function o(){return(o=e((()=>{})))()}export{i,r as n,a as r,o as t};