var e=`irsp.runtimeProfile.currentBoot.v1`;function t(e){if(typeof e!=`string`)return`unknown`;let t=e.trim().toLowerCase();return t?t===`carlmalartre-agent@minibiz.com`?`agent`:`normal`:`unknown`}async function n(e){try{return t((await e())?.email)}catch{return`unknown`}}function r(e){return e===`agent`?`Agent`:e===`normal`?`Normal`:`Unknown`}function i(e,t){return`${e} · Profile: ${r(t.profile)}`}function a(e){let t=e.workerBootId??crypto.randomUUID(),n=e.startedAt??new Date().toISOString(),r=`resolving`,i=`unknown`,a=0,o=async()=>{let a;try{a=await e.readCurrentBootId()}catch{a=void 0}return Object.freeze({schemaVersion:1,profile:i,status:r,isCurrent:a===t,workerBootId:t,startedAt:n,extensionVersion:e.extensionVersion,buildChannel:e.buildChannel,runtimeId:e.runtimeId})},s=async()=>{let t=++a;r=`resolving`;let n=await e.resolveProfile().catch(()=>`unknown`);return t===a&&(i=n,r=`ready`),o()};return{async initialize(){try{await e.writeCurrentBootId(t)}catch{}return s()},refreshProfile:s,getMarker:o,async reloadAgentWorker(){let t=await o();return t.status===`ready`?t.profile===`agent`?t.isCurrent?(e.scheduleReload(e.reloadRuntime),{ok:!0,scheduled:!0,marker:t}):{ok:!1,scheduled:!1,reason:`worker-not-current`,marker:t}:{ok:!1,scheduled:!1,reason:`profile-not-agent`,marker:t}:{ok:!1,scheduled:!1,reason:`profile-resolving`,marker:t}}}}function o(e,t=globalThis){Object.defineProperties(t,{__IRSP_GET_WORKER_MARKER__:{configurable:!1,enumerable:!1,writable:!1,value:()=>e.getMarker()},__IRSP_RELOAD_AGENT_WORKER__:{configurable:!1,enumerable:!1,writable:!1,value:()=>e.reloadAgentWorker()}})}export{i as a,n as i,a as n,r as o,o as r,e as t};