@coreframe/vite 0.2.59 → 0.2.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -184,12 +184,12 @@ let n=f(({className:n,...r},i)=>d(L,{ref:i,iconNode:t,className:j(`lucide-${M(P(
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
186
  */
187
- ;function xe(){return import.meta.hot}const Se={connect:`vite:ws:connect`,disconnect:`vite:ws:disconnect`};function Ce(){return import.meta.hot}const we=`GPT-6 Luna (High)`,V=[{description:`Nothing actionable: neither the drawer nor its indicator renders.`,id:`idle`,label:`Settled — overlay hidden`,status:{mode:`managed`,warnings:[]}},{description:`A scrollable mix of tracked and untracked files, including renamed and long paths.`,id:`local-changes`,label:`Review local changes`,status:{draft:{fingerprint:`debug-local-changes`,tracked:!0,trackedFiles:[{path:`src/web/app.tsx`,status:` M`},{path:`src/web/old-feature.tsx`,status:` D`},{path:`src/web/components/navigation.tsx`,status:`M `},{path:`src/web/components/search.tsx`,status:`A `},{path:`src/web/features/settings/preferences.tsx`,status:`R `,originalPath:`src/web/settings.tsx`},{path:`src/web/features/projects/components/project-activity-history-panel.tsx`,status:` M`},{path:`src/server/routes/projects.ts`,status:` M`},{path:`src/server/services/notifications.ts`,status:`A `},{path:`src/shared/project-types.ts`,status:` M`},{path:`src/web/components/legacy-sidebar.tsx`,status:` D`}],artifactFiles:[`dist/bundle.js`,`tsconfig.tsbuildinfo`],untracked:[`dist/bundle.js`,`tsconfig.tsbuildinfo`,`src/web/new-feature.tsx`,`src/web/new-feature.style.ts`,`src/web/features/projects/components/project-activity-filter.tsx`,`src/web/features/projects/components/project-activity-empty-state.tsx`,`src/server/services/project-activity.ts`,`src/shared/activity-types.ts`]},mode:`managed`,warnings:[]}},{description:`Local changes with a proposed Conventional Commit message.`,id:`confirm-commit`,label:`Confirm commit`,status:{draft:{fingerprint:`debug-confirm-commit`,tracked:!0,trackedFiles:[{path:`src/web/app.tsx`,status:` M`},{path:`src/web/old-feature.tsx`,status:` D`}],untracked:[`src/web/new-feature.tsx`]},mode:`managed`,proposal:`feat: add the new feature`,warnings:[]}},{description:`A newer commit is available from the local dev branch.`,id:`dev-update`,label:`Local dev update`,status:{mode:`managed`,target:{commit:`1234567890abcdef`,commits:[{commit:`fedcba0987654321`,shortCommit:`fedcba098765`,subject:`feat: add managed preview foundations`},{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: update the managed preview`}],shortCommit:`1234567890ab`,source:`dev`,subject:`feat: update the managed preview`},warnings:[]}},{description:`A newer upstream main commit is ready to refresh.`,id:`upstream-update`,label:`Upstream update`,status:{mode:`managed`,target:{commit:`abcdef1234567890`,commits:[{commit:`0123456789abcdef`,shortCommit:`0123456789ab`,subject:`chore: refresh shared dependencies`},{commit:`abcdef1234567890`,shortCommit:`abcdef123456`,subject:`fix: update shared project defaults`}],shortCommit:`abcdef123456`,source:`upstream`,subject:`fix: update shared project defaults`},warnings:[]}},{description:`The accepted update is currently being integrated.`,id:`busy`,label:`Busy integration`,status:{busy:`Integrating accepted update`,mode:`managed`,warnings:[]}},{description:`Managed development is paused until the checkout returns to main.`,id:`paused`,label:`Paused checkout`,status:{message:`Managed synchronization is paused until the primary checkout is back on local main.`,mode:`waiting`,warnings:[]}},{description:`Managed development cannot run from the current checkout.`,id:`unavailable`,label:`Unavailable checkout`,status:{message:`Managed development only runs from the primary checkout.`,mode:`unmanaged`,warnings:[]}},{description:`A managed-development warning requiring attention.`,id:`warning`,label:`Warning`,status:{mode:`managed`,warnings:[`The remote update could not be checked. The last known project state is shown.`]}},{description:`Typechecking failed after synchronization.`,id:`failed-check`,label:`Failed check`,status:{checks:{commit:`1234567890abcdef`,commands:[{command:`pnpm typecheck`,failureId:`debug-typecheck-failure`,output:`src/web/feature.tsx(12,4): error TS2322: Type mismatch.`,status:`failed`},{command:`pnpm test`,status:`passed`}],trigger:`synchronization`},mode:`managed`,warnings:[]}},{description:`Dependency installation failed after synchronization.`,id:`dependency-failure`,label:`Dependency failure`,status:{mode:`managed`,setupFailure:{command:`pnpm install --frozen-lockfile`,commit:`1234567890abcdef`,message:`The project was synchronized, but dependency installation failed. Fix the package or lockfile issue, then retry the install.`,output:`ERR_PNPM_OUTDATED_LOCKFILE Cannot install with a frozen lockfile.`,restartRequired:!0,stage:`dependencies`},warnings:[]}},{description:`Database migration failed and can be reset.`,id:`migration-failure`,label:`Database failure`,status:{mode:`managed`,setupFailure:{command:`pnpm db migrate-local`,commit:`1234567890abcdef`,message:`The project was synchronized, but its database migration failed. The previous database was restored.`,output:`Migration 0012_add_project_state failed: duplicate column name.`,restartRequired:!1,stage:`migration`},warnings:[]}},{codex:{commits:[{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: add managed development`}],messages:[{kind:`user`,text:`Resolve the current Git rebase conflicts in src/web/root.tsx.`},{kind:`thought`,text:`Inspecting the conflicting layout changes.`},{kind:`thought`,text:`Preserving the behavior introduced on both branches.`}],phase:`running`,requestId:`debug-codex-running`,stage:`resolve`,totalCommits:4},description:`Codex is resolving conflicts with previous thoughts collapsed.`,id:`codex-running`,label:`Codex reasoning`,status:{busy:`Integrating accepted update`,mode:`managed`,warnings:[]}},{codex:{commits:[{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: add managed development`}],messages:[{kind:`user`,text:`Resolve the current Git rebase conflicts in src/web/root.tsx.`},{kind:`thought`,text:`Preserving the behavior introduced on both branches.`},{author:we,kind:`agent`,text:`Resolved root.tsx while preserving both the command layer and overlay mounting.`}],phase:`complete`,requestId:`debug-codex-message`,stage:`verify`,totalCommits:1},description:`Codex has produced its final message while synchronization finishes.`,id:`codex-message`,label:`Codex response`,status:{busy:`Integrating accepted update`,mode:`managed`,warnings:[]}},{codex:{commits:[],messages:[{kind:`user`,text:`Resolve the current Git merge conflicts in src/web/root.tsx.`},{kind:`thought`,text:`The conflict could not be resolved safely.`}],phase:`error`,requestId:`debug-codex-error`,stage:`resolve`},description:`The Codex-assisted conflict resolution failed.`,error:`Codex could not resolve the merge conflicts.`,id:`codex-error`,label:`Codex failure`,status:{mode:`managed`,warnings:[]}},{description:`A durable Codex completion waiting for acknowledgment.`,id:`codex-finished`,label:`Codex finished`,status:{codexCompletion:{commits:[{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: add managed development`}],finalMessage:`Resolved root.tsx while preserving both the command layer and overlay mounting.`,id:`debug-completion`,messages:[{kind:`user`,text:`Resolve the current Git rebase conflicts in src/web/root.tsx.`},{kind:`thought`,text:`Inspecting the conflicting layout changes.`},{author:we,kind:`agent`,text:`Resolved root.tsx while preserving both the command layer and overlay mounting.`}],totalCommits:1},mode:`managed`,warnings:[]}},{description:`A successful synchronization result before it auto-dismisses.`,id:`success`,label:`Refresh success`,status:{mode:`managed`,warnings:[]},success:{heading:`Refresh complete`,message:`Your project is up to date.`}}],H=V.find(e=>e.id===`codex-running`),Te=V.find(e=>e.id===`upstream-update`).status.target,U={mode:`managed`,warnings:[]},W=Date.now()-12e3;V.push({id:`starting`,label:`Starting supervisor`,description:`Waiting for the first managed status.`,status:{mode:`waiting`,warnings:[]}},{id:`error`,label:`Session failure`,description:`Managed development stopped with an actionable error.`,status:{mode:`error`,message:`Managed development could not acquire its checkout lock.`,warnings:[]}},{id:`pending-rebase`,label:`Rebase awaiting approval`,description:`A partial replay stopped at a conflict; original commits remain pinned.`,status:{...U,pendingRebase:{applied:2,commits:[{commit:`cafebabe12345678`,shortCommit:`cafebabe1234`,subject:`feat: retain local navigation`}],files:[`src/web/root.tsx`],target:Te}}},{...H,id:`merge-running`,label:`Merge resolution`,description:`AI resolving a merge conflict without a rebase commit count.`,codex:{...H.codex,commits:[],totalCommits:void 0,messages:[{kind:`user`,text:`Resolve the current Git merge conflicts in src/web/root.tsx.`},{kind:`agent`,text:`Preserving navigation changes from both branches.`}]}},{...H,id:`verification`,label:`Verification tools`,description:`Verification with concurrent tools and expandable output.`,codex:{...H.codex,stage:`verify`,messages:[{kind:`user`,text:`Verify the prepared rebase result.`},{kind:`agent`,text:`The conflicts are resolved. Running typecheck and tests.`}]},status:{...U,busy:`Verifying prepared update`,activities:[{id:`typecheck`,label:`Typecheck`,command:`pnpm typecheck`,source:`codex`,stage:`verify`,status:`running`,startedAt:W},{id:`tests`,label:`Tests`,command:`pnpm test`,source:`codex`,stage:`verify`,status:`running`,startedAt:W},{id:`install`,label:`Dependencies`,command:`pnpm install --frozen-lockfile`,source:`supervisor`,stage:`verify`,status:`succeeded`,startedAt:W-4e3,finishedAt:W,output:`Lockfile is up to date`}]}},{id:`activity-failure`,label:`Failed and interrupted tools`,description:`Failed output alongside interrupted and cancelled activities.`,status:{...U,activities:[{id:`check`,label:`Typecheck`,command:`pnpm typecheck`,source:`codex`,status:`failed`,startedAt:W,finishedAt:W+1e3,exitCode:1,output:`src/web/root.tsx: Type mismatch`},{id:`build`,label:`Build`,command:`pnpm build`,source:`codex`,status:`interrupted`,startedAt:W,finishedAt:W+2e3},{id:`test`,label:`Tests`,command:`pnpm test`,source:`supervisor`,status:`cancelled`,startedAt:W,finishedAt:W+2e3}]}},{id:`codegen-failure`,label:`Codegen failure`,description:`Synchronized changes require a codegen retry.`,status:{...U,setupFailure:{command:`pnpm codegen`,commit:Te.commit,message:`Code generation failed. Fix the configuration and retry.`,output:`Invalid Panda configuration`,restartRequired:!1,stage:`codegen`}}},{id:`checks-running`,label:`Checks in progress`,description:`Post-synchronization checks running and pending.`,status:{...U,checks:{commit:Te.commit,trigger:`synchronization`,commands:[{command:`pnpm typecheck`,status:`running`},{command:`pnpm test`,status:`pending`}]}}},{id:`checks-passed`,label:`Checks passed`,description:`Both post-synchronization checks passed.`,status:{...U,checks:{commit:Te.commit,trigger:`synchronization`,commands:[{command:`pnpm typecheck`,status:`passed`},{command:`pnpm test`,status:`passed`}]}}},{id:`supervisor-recovering`,label:`Supervisor reconnecting`,description:`Automatic supervisor recovery is in progress.`,status:{mode:`waiting`,message:`Managed development supervisor is reconnecting.`,warnings:[]}},{id:`supervisor-failed`,label:`Supervisor recovery exhausted`,description:`Automatic recovery failed; manual retry remains available.`,status:{mode:`error`,message:`Managed development supervisor recovery failed after 4 attempts.`,warnings:[]}},{id:`cancelled`,label:`Update cancelled`,description:`Simulated cancellation has settled; no work is running.`,status:{...U,message:`The update integration was cancelled.`}}),V.push({...H,id:`cancelling`,label:`Cancellation requested`,description:`Cancel request pending while the operation is still active.`,pendingAction:{type:`cancel-codex`}},{id:`verification-setup`,label:`Verification setup`,description:`Supervisor preparing isolated verification dependencies before AI starts.`,status:{...U,busy:`Preparing verification`,activities:[{id:`install`,label:`Installing verification dependencies`,command:`pnpm install --frozen-lockfile`,source:`supervisor`,stage:`verify`,status:`running`,startedAt:W}]}},{id:`request-error`,label:`Action request failed`,description:`An action failed while the managed checkout remains available.`,status:U,error:`The working tree changed. Review the current changes before retrying.`},{id:`controls-running`,label:`Vite restart pending`,description:`Development controls waiting for a restart acknowledgment.`,status:U,controls:{pending:!0}},{id:`controls-failure`,label:`Vite restart failed`,description:`Development controls have a recoverable error.`,status:U,controls:{error:`Vite restart failed. Try again.`}},{id:`controls-success`,label:`Vite restart acknowledged`,description:`Development controls report a successful restart request.`,status:U,controls:{success:`Vite restart requested.`}});const Ee={id:`debug-operation-52e3`,requestIds:[`debug-resolve`],revision:8,sessionId:`debug-session`,source:`upstream`,target:Te.commit,kind:`rebase`,state:`running`,phase:`resolving`,startedAt:W,updatedAt:Date.now(),cancellation:`available`,published:!1,progress:{applied:1,total:4,skipped:0,remaining:3,current:H.codex.commits[0],files:[`src/web/root.tsx`,`src/web/navigation.tsx`]},turns:[{id:`first-stop`,stage:`resolve`,startedAt:W,finishedAt:W+1e3,status:`complete`,messages:[{kind:`agent`,author:we,text:`Resolved the first conflict while retaining local navigation.`}]},{id:`second-stop`,stage:`resolve`,startedAt:W+1e3,status:`running`,messages:H.codex.messages}],steps:[{id:`prepare`,label:`Prepare integration`,phase:`preparing`,status:`succeeded`,startedAt:W,finishedAt:W+1e3},{id:`replay`,label:`Replay commits`,phase:`replaying`,status:`failed`,startedAt:W+1e3,finishedAt:W+2e3},{id:`resolve`,label:`AI conflict resolution`,phase:`resolving`,status:`running`,startedAt:W+2e3}],activities:[]},De=V.find(({id:e})=>e===`verification`),G={...Ee,phase:`verifying`,progress:{applied:4,skipped:0,total:4,remaining:0},turns:[...Ee.turns.map(e=>({...e,status:`complete`,finishedAt:W+3e3})),{id:`verify-turn`,stage:`verify`,startedAt:W+3e3,status:`running`,messages:De.codex.messages}],activities:De.status.activities};for(let e of[{id:`operation-resolving`,label:`Recoverable rebase`,description:`Server-owned progress, grouped AI turns and cancellation.`,operation:Ee},{id:`operation-verifying`,label:`Recoverable verification`,description:`Concurrent tools and a Cancel control recover from status alone.`,operation:G},{id:`operation-cancelling`,label:`Waiting for cancellation`,description:`Cancellation requested; cleanup and subprocess exit have not settled.`,operation:{...G,state:`cancelling`,cancellation:`requested`}},{id:`operation-publication-cancel`,label:`Finishing publication before stopping`,description:`A cancellation request waits for coherent Git publication.`,operation:{...Ee,phase:`publishing`,state:`cancelling`,cancellation:`requested`,cancellationDeferred:!0}},{id:`operation-offline`,label:`Disconnected operation`,description:`The last snapshot stays visible; network actions are disabled.`,connected:!1,operation:G},{id:`operation-interrupted`,label:`Interrupted supervisor`,description:`An interrupted owner leaves a persistent, truthful recovery outcome.`,operation:{...G,phase:`finished`,state:`interrupted`,cancellation:`unavailable`,published:!0,finishedAt:Date.now(),message:`Changes were applied before the supervisor stopped. Review setup and checks before continuing.`,activities:[]}},{id:`operation-ready`,label:`Update complete`,description:`Full operation completion, including setup and checks.`,operation:{...G,phase:`finished`,state:`succeeded`,cancellation:`unavailable`,published:!0,startedAt:Date.now()-12e4,finishedAt:Date.now(),message:`Update complete.`,steps:[...G.steps.map((e,t)=>({...e,startedAt:Date.now()-12e4+t*1e3,status:e.status===`running`?`succeeded`:e.status,finishedAt:e.status===`running`?Date.now()-36e3:Date.now()-119e3+t*1e3})),{id:`setup-complete`,label:`Project setup`,phase:`setup`,status:`succeeded`,startedAt:Date.now()-36e3,finishedAt:Date.now()-24e3},{id:`checks-complete`,label:`Typecheck and tests`,phase:`checks`,status:`succeeded`,startedAt:Date.now()-24e3,finishedAt:Date.now()}],turns:G.turns.map(e=>({...e,status:`complete`,finishedAt:Date.now(),...e.stage===`verify`?{messages:[{kind:`agent`,text:`Update applied. Typecheck and tests passed.`}],finalMessage:`Update applied. Typecheck and tests passed.`}:{}})),activities:[]}}])V.push({id:e.id,label:e.label,description:e.description,connected:`connected`in e?e.connected:!0,status:{...U,operation:e.operation,...e.id===`operation-ready`?{currentCommit:`fedcba9876543210`,checks:{commit:`fedcba9876543210`,trigger:`synchronization`,commands:[{command:`pnpm typecheck`,status:`passed`},{command:`pnpm test`,status:`passed`}]}}:{},activities:e.operation.activities}});var K={actionError:`actionError`,actions:`actions`,actionSuccess:`actionSuccess`,activityCommand:`activityCommand`,activityDisclosure:`activityDisclosure`,activityList:`activityList`,activityMeta:`activityMeta`,activityOutput:`activityOutput`,activityRow:`activityRow`,activityState:`activityState`,activityStatus:`activityStatus`,activitySummary:`activitySummary`,button:`button`,"button-spin":`button-spin`,buttonContainer:`buttonContainer`,buttonSpinner:`buttonSpinner`,changeList:`changeList`,checkbox:`checkbox`,checkCommand:`checkCommand`,checkFailure:`checkFailure`,checkGuidance:`checkGuidance`,checkMessage:`checkMessage`,codexHistoryList:`codexHistoryList`,codexHistorySummary:`codexHistorySummary`,codexMessage:`codexMessage`,codexMessageAge:`codexMessageAge`,codexMessageHeader:`codexMessageHeader`,codexMessageLabel:`codexMessageLabel`,codexMessageText:`codexMessageText`,codexOptionSelect:`codexOptionSelect`,codexOutput:`codexOutput`,codexSettings:`codexSettings`,codexSettingsPopover:`codexSettingsPopover`,codexTranscript:`codexTranscript`,codexWaiting:`codexWaiting`,codexWorking:`codexWorking`,completionDetailBody:`completionDetailBody`,completionDetails:`completionDetails`,completionDialog:`completionDialog`,completionMetadata:`completionMetadata`,completionNote:`completionNote`,completionReceipt:`completionReceipt`,completionSteps:`completionSteps`,content:`content`,copyButton:`copyButton`,copyFooter:`copyFooter`,debugFooter:`debugFooter`,developmentControls:`developmentControls`,developmentControlsDropdown:`developmentControlsDropdown`,dialog:`dialog`,disabledTooltip:`disabledTooltip`,drawerBody:`drawerBody`,effortControl:`effortControl`,effortEndpoints:`effortEndpoints`,errorIcon:`errorIcon`,errorMessage:`errorMessage`,fileGroup:`fileGroup`,filePath:`filePath`,files:`files`,fileStatus:`fileStatus`,header:`header`,headerActions:`headerActions`,iconButton:`iconButton`,iconOnly:`iconOnly`,indicatorButton:`indicatorButton`,indicatorDot:`indicatorDot`,message:`message`,modelToggle:`modelToggle`,notificationActions:`notificationActions`,paragraph:`paragraph`,pendingCommits:`pendingCommits`,primary:`primary`,rebaseProgress:`rebaseProgress`,rebaseProgressFill:`rebaseProgressFill`,rebaseProgressLabel:`rebaseProgressLabel`,rebaseProgressTrack:`rebaseProgressTrack`,scenarioButton:`scenarioButton`,scenarioDescription:`scenarioDescription`,scenarioLabel:`scenarioLabel`,scenarioList:`scenarioList`,section:`section`,sectionDescription:`sectionDescription`,sectionHeading:`sectionHeading`,sectionLink:`sectionLink`,sectionTitle:`sectionTitle`,setupFailure:`setupFailure`,srOnly:`srOnly`,successIcon:`successIcon`,surface:`surface`,title:`title`,titleIcon:`titleIcon`,trackedFile:`trackedFile`,warning:`warning`};const q={userSelect:`text`,WebkitUserSelect:`text`},Oe={effort:`high`,model:`gpt-6-luna`},ke=u(!0);let J;function Ae(){if(J)return J;try{J=sessionStorage.getItem(`coreframe:managed-dev:client`)??void 0}catch{}if(!J){J=globalThis.crypto.getRandomValues(new Uint32Array(4)).join(`-`);try{sessionStorage.setItem(`coreframe:managed-dev:client`,J)}catch{}}return J}let je=!1;const Me=new Set,Ne=1600,Pe=[`codex-running`,`codex-finished`,`codex-message`,`codex-error`,`migration-failure`,`dependency-failure`,`failed-check`,`confirm-commit`,`local-changes`,`upstream-update`,`dev-update`,`busy`,`warning`,`paused`,`unavailable`,`success`,`idle`],Fe=[...Pe.slice(0,-2),...V.map(({id:e})=>e).filter(e=>!Pe.includes(e)),...Pe.slice(-2)].map(e=>{let t=V.find(t=>t.id===e);if(!t)throw Error(`Missing managed dev debug scenario: ${e}`);return t}).filter(e=>St(e));function Ie(){Y(!je)}function Y(e){if(je!==e){je=e;for(let e of Me)e()}}function Le({bottomOffset:e,debug:t=!1,indicator:n,rightOffset:r}){return w(t?Be:Re,{bottomOffset:e,indicator:n,rightOffset:r})}function Re({bottomOffset:e,indicator:r,rightOffset:i}){let{act:a,checkFailure:o,codex:s,codexOptions:c,dismissCheckFailure:u,dismissError:d,dismissSuccess:f,error:m,errorsDismissed:h,hmrReady:_,pendingAction:v,setCodexOptions:y,status:x,success:S}=Ot(),[C,T]=b(),[E,D]=b(),O=JSON.stringify([x?.mode,x?.message,x?.busy,x?.target?.commit,x?.draft?.fingerprint,x?.pendingRebase,x?.setupFailure,x?.warnings,x?.codexCompletion?.id,x?.operation&&[x.operation.id,x.operation.phase,x.operation.state],o,m,s?.phase,S?.heading]),k=Tt(),A={...k,resetBranches:()=>{x?.operation&&a({type:`reset-branches`,operationId:x.operation.id})},resetDisabledReason:t(x)?k.pending?`Wait for Vite to restart`:void 0:`No active merge or rebase to reset`,resetPending:v?.type===`reset-branches`},j=St({status:x,codex:h&&s?.phase===`error`?void 0:s,error:h?void 0:m,success:S,pendingAction:v,controls:A});g(()=>{if(!S)return;let e=setTimeout(()=>{f(),Y(!1)},Ne);return()=>clearTimeout(e)},[f,S]),g(()=>{let e=x?.operation;if(e?.state!==`succeeded`||C===e.id||x?.codexCompletion||m||o||$(x))return;let t=Math.max(0,Ne-(Date.now()-(e.finishedAt??e.updatedAt))),n=setTimeout(()=>{Y(!1),_&&a({type:`acknowledge-operation`,id:e.id})},t);return()=>clearTimeout(n)},[a,x,m,o,_,C]);let M=r??w(Ke,{}),N=p(M)&&M.type===Ke?l(M,{paused:!x?.target}):M;return w(ze,{bottomOffset:e,ready:(_||!!x)&&j,indicator:x&&$(x,o)&&E!==O?N:null,rightOffset:i,children:w(ke.Provider,{value:_,children:w(qe,{connectionNotice:!_&&x?`Connection lost; progress may be stale. Reconnecting…`:void 0,act:a,checkFailure:o,codex:s,codexOptions:c,developmentControls:A,dismissCheckFailure:u,dismissError:()=>{D(O),d()},error:m,errorsDismissed:h,onClose:()=>{D(O),x?.operation&&!n(x.operation)&&x.operation.state!==`awaiting-resolution`&&!x.codexCompletion&&_&&a({type:`acknowledge-operation`,id:x.operation.id}),x?.codexCompletion&&_&&a({id:x.codexCompletion.id,type:`acknowledge-codex`}),Y(!1)},onInspectOperation:()=>T(x?.operation?.id),pendingAction:v,setCodexOptions:y,status:x,success:S})})})}function ze({bottomOffset:e,children:t,indicator:n,openOnMount:r=!1,ready:i=!0,rightOffset:a}){let[o,s]=b(null),c=x(kt,At,jt);g(()=>{!i&&c&&Y(!1)},[i,c]),g(()=>{r&&Y(!0);let e=!0,t=k(`coreframe-managed-dev`,document.body,{css:`@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
187
+ ;function xe(){return import.meta.hot}const Se={connect:`vite:ws:connect`,disconnect:`vite:ws:disconnect`};function Ce(){return import.meta.hot}const we=`GPT-6 Luna (High)`,V=[{description:`Nothing actionable: neither the drawer nor its indicator renders.`,id:`idle`,label:`Settled — overlay hidden`,status:{mode:`managed`,warnings:[]}},{description:`A scrollable mix of tracked and untracked files, including renamed and long paths.`,id:`local-changes`,label:`Review local changes`,status:{draft:{fingerprint:`debug-local-changes`,tracked:!0,trackedFiles:[{path:`src/web/app.tsx`,status:` M`},{path:`src/web/old-feature.tsx`,status:` D`},{path:`src/web/components/navigation.tsx`,status:`M `},{path:`src/web/components/search.tsx`,status:`A `},{path:`src/web/features/settings/preferences.tsx`,status:`R `,originalPath:`src/web/settings.tsx`},{path:`src/web/features/projects/components/project-activity-history-panel.tsx`,status:` M`},{path:`src/server/routes/projects.ts`,status:` M`},{path:`src/server/services/notifications.ts`,status:`A `},{path:`src/shared/project-types.ts`,status:` M`},{path:`src/web/components/legacy-sidebar.tsx`,status:` D`}],artifactFiles:[`dist/bundle.js`,`tsconfig.tsbuildinfo`],untracked:[`dist/bundle.js`,`tsconfig.tsbuildinfo`,`src/web/new-feature.tsx`,`src/web/new-feature.style.ts`,`src/web/features/projects/components/project-activity-filter.tsx`,`src/web/features/projects/components/project-activity-empty-state.tsx`,`src/server/services/project-activity.ts`,`src/shared/activity-types.ts`]},mode:`managed`,warnings:[]}},{description:`Local changes with a proposed Conventional Commit message.`,id:`confirm-commit`,label:`Confirm commit`,status:{draft:{fingerprint:`debug-confirm-commit`,tracked:!0,trackedFiles:[{path:`src/web/app.tsx`,status:` M`},{path:`src/web/old-feature.tsx`,status:` D`}],untracked:[`src/web/new-feature.tsx`]},mode:`managed`,proposal:`feat: add the new feature`,warnings:[]}},{description:`A newer commit is available from the local dev branch.`,id:`dev-update`,label:`Local dev update`,status:{mode:`managed`,target:{commit:`1234567890abcdef`,commits:[{commit:`fedcba0987654321`,shortCommit:`fedcba098765`,subject:`feat: add managed preview foundations`},{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: update the managed preview`}],shortCommit:`1234567890ab`,source:`dev`,subject:`feat: update the managed preview`},warnings:[]}},{description:`A newer upstream main commit is ready to refresh.`,id:`upstream-update`,label:`Upstream update`,status:{mode:`managed`,target:{commit:`abcdef1234567890`,commits:[{commit:`0123456789abcdef`,shortCommit:`0123456789ab`,subject:`chore: refresh shared dependencies`},{commit:`abcdef1234567890`,shortCommit:`abcdef123456`,subject:`fix: update shared project defaults`}],shortCommit:`abcdef123456`,source:`upstream`,subject:`fix: update shared project defaults`},warnings:[]}},{description:`The accepted update is currently being integrated.`,id:`busy`,label:`Busy integration`,status:{busy:`Integrating accepted update`,mode:`managed`,warnings:[]}},{description:`Managed development is paused until the checkout returns to main.`,id:`paused`,label:`Paused checkout`,status:{message:`Managed synchronization is paused until the primary checkout is back on local main.`,mode:`waiting`,warnings:[]}},{description:`Managed development cannot run from the current checkout.`,id:`unavailable`,label:`Unavailable checkout`,status:{message:`Managed development only runs from the primary checkout.`,mode:`unmanaged`,warnings:[]}},{description:`A managed-development warning requiring attention.`,id:`warning`,label:`Warning`,status:{mode:`managed`,warnings:[`The remote update could not be checked. The last known project state is shown.`]}},{description:`Typechecking failed after synchronization.`,id:`failed-check`,label:`Failed check`,status:{checks:{commit:`1234567890abcdef`,commands:[{command:`pnpm typecheck`,failureId:`debug-typecheck-failure`,output:`src/web/feature.tsx(12,4): error TS2322: Type mismatch.`,status:`failed`},{command:`pnpm test`,status:`passed`}],trigger:`synchronization`},mode:`managed`,warnings:[]}},{description:`Dependency installation failed after synchronization.`,id:`dependency-failure`,label:`Dependency failure`,status:{mode:`managed`,setupFailure:{command:`pnpm install --frozen-lockfile`,commit:`1234567890abcdef`,message:`The project was synchronized, but dependency installation failed. Fix the package or lockfile issue, then retry the install.`,output:`ERR_PNPM_OUTDATED_LOCKFILE Cannot install with a frozen lockfile.`,restartRequired:!0,stage:`dependencies`},warnings:[]}},{description:`Database migration failed and can be reset.`,id:`migration-failure`,label:`Database failure`,status:{mode:`managed`,setupFailure:{command:`pnpm db migrate-local`,commit:`1234567890abcdef`,message:`The project was synchronized, but its database migration failed. The previous database was restored.`,output:`Migration 0012_add_project_state failed: duplicate column name.`,restartRequired:!1,stage:`migration`},warnings:[]}},{codex:{commits:[{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: add managed development`}],messages:[{kind:`user`,text:`Resolve the current Git rebase conflicts in src/web/root.tsx.`},{kind:`thought`,text:`Inspecting the conflicting layout changes.`},{kind:`thought`,text:`Preserving the behavior introduced on both branches.`}],phase:`running`,requestId:`debug-codex-running`,stage:`resolve`,totalCommits:4},description:`Codex is resolving conflicts with previous thoughts collapsed.`,id:`codex-running`,label:`Codex reasoning`,status:{busy:`Integrating accepted update`,mode:`managed`,warnings:[]}},{codex:{commits:[{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: add managed development`}],messages:[{kind:`user`,text:`Resolve the current Git rebase conflicts in src/web/root.tsx.`},{kind:`thought`,text:`Preserving the behavior introduced on both branches.`},{author:we,kind:`agent`,text:`Resolved root.tsx while preserving both the command layer and overlay mounting.`}],phase:`complete`,requestId:`debug-codex-message`,stage:`verify`,totalCommits:1},description:`Codex has produced its final message while synchronization finishes.`,id:`codex-message`,label:`Codex response`,status:{busy:`Integrating accepted update`,mode:`managed`,warnings:[]}},{codex:{commits:[],messages:[{kind:`user`,text:`Resolve the current Git merge conflicts in src/web/root.tsx.`},{kind:`thought`,text:`The conflict could not be resolved safely.`}],phase:`error`,requestId:`debug-codex-error`,stage:`resolve`},description:`The Codex-assisted conflict resolution failed.`,error:`Codex could not resolve the merge conflicts.`,id:`codex-error`,label:`Codex failure`,status:{mode:`managed`,warnings:[]}},{description:`A durable Codex completion waiting for acknowledgment.`,id:`codex-finished`,label:`Codex finished`,status:{codexCompletion:{commits:[{commit:`1234567890abcdef`,shortCommit:`1234567890ab`,subject:`feat: add managed development`}],finalMessage:`Resolved root.tsx while preserving both the command layer and overlay mounting.`,id:`debug-completion`,messages:[{kind:`user`,text:`Resolve the current Git rebase conflicts in src/web/root.tsx.`},{kind:`thought`,text:`Inspecting the conflicting layout changes.`},{author:we,kind:`agent`,text:`Resolved root.tsx while preserving both the command layer and overlay mounting.`}],totalCommits:1},mode:`managed`,warnings:[]}},{description:`A successful synchronization result before it auto-dismisses.`,id:`success`,label:`Refresh success`,status:{mode:`managed`,warnings:[]},success:{heading:`Refresh complete`,message:`Your project is up to date.`}}],H=V.find(e=>e.id===`codex-running`),Te=V.find(e=>e.id===`upstream-update`).status.target,U={mode:`managed`,warnings:[]},W=Date.now()-12e3;V.push({id:`starting`,label:`Starting supervisor`,description:`Waiting for the first managed status.`,status:{mode:`waiting`,warnings:[]}},{id:`error`,label:`Session failure`,description:`Managed development stopped with an actionable error.`,status:{mode:`error`,message:`Managed development could not acquire its checkout lock.`,warnings:[]}},{id:`pending-rebase`,label:`Rebase awaiting approval`,description:`A partial replay stopped at a conflict; original commits remain pinned.`,status:{...U,pendingRebase:{applied:2,commits:[{commit:`cafebabe12345678`,shortCommit:`cafebabe1234`,subject:`feat: retain local navigation`}],files:[`src/web/root.tsx`],target:Te}}},{...H,id:`merge-running`,label:`Merge resolution`,description:`AI resolving a merge conflict without a rebase commit count.`,codex:{...H.codex,commits:[],totalCommits:void 0,messages:[{kind:`user`,text:`Resolve the current Git merge conflicts in src/web/root.tsx.`},{kind:`agent`,text:`Preserving navigation changes from both branches.`}]}},{...H,id:`verification`,label:`Verification tools`,description:`Verification with concurrent tools and expandable output.`,codex:{...H.codex,stage:`verify`,messages:[{kind:`user`,text:`Verify the prepared rebase result.`},{kind:`agent`,text:`The conflicts are resolved. Running typecheck and tests.`}]},status:{...U,busy:`Verifying prepared update`,activities:[{id:`typecheck`,label:`Typecheck`,command:`pnpm typecheck`,source:`codex`,stage:`verify`,status:`running`,startedAt:W},{id:`tests`,label:`Tests`,command:`pnpm test`,source:`codex`,stage:`verify`,status:`running`,startedAt:W},{id:`install`,label:`Dependencies`,command:`pnpm install --frozen-lockfile`,source:`supervisor`,stage:`verify`,status:`succeeded`,startedAt:W-4e3,finishedAt:W,output:`Lockfile is up to date`}]}},{id:`activity-failure`,label:`Failed and interrupted tools`,description:`Failed output alongside interrupted and cancelled activities.`,status:{...U,activities:[{id:`check`,label:`Typecheck`,command:`pnpm typecheck`,source:`codex`,status:`failed`,startedAt:W,finishedAt:W+1e3,exitCode:1,output:`src/web/root.tsx: Type mismatch`},{id:`build`,label:`Build`,command:`pnpm build`,source:`codex`,status:`interrupted`,startedAt:W,finishedAt:W+2e3},{id:`test`,label:`Tests`,command:`pnpm test`,source:`supervisor`,status:`cancelled`,startedAt:W,finishedAt:W+2e3}]}},{id:`codegen-failure`,label:`Codegen failure`,description:`Synchronized changes require a codegen retry.`,status:{...U,setupFailure:{command:`pnpm codegen`,commit:Te.commit,message:`Code generation failed. Fix the configuration and retry.`,output:`Invalid Panda configuration`,restartRequired:!1,stage:`codegen`}}},{id:`checks-running`,label:`Checks in progress`,description:`Post-synchronization checks running and pending.`,status:{...U,checks:{commit:Te.commit,trigger:`synchronization`,commands:[{command:`pnpm typecheck`,status:`running`},{command:`pnpm test`,status:`pending`}]}}},{id:`checks-passed`,label:`Checks passed`,description:`Both post-synchronization checks passed.`,status:{...U,checks:{commit:Te.commit,trigger:`synchronization`,commands:[{command:`pnpm typecheck`,status:`passed`},{command:`pnpm test`,status:`passed`}]}}},{id:`supervisor-recovering`,label:`Supervisor reconnecting`,description:`Automatic supervisor recovery is in progress.`,status:{mode:`waiting`,message:`Managed development supervisor is reconnecting.`,warnings:[]}},{id:`supervisor-failed`,label:`Supervisor recovery exhausted`,description:`Automatic recovery failed; manual retry remains available.`,status:{mode:`error`,message:`Managed development supervisor recovery failed after 4 attempts.`,warnings:[]}},{id:`cancelled`,label:`Update cancelled`,description:`Simulated cancellation has settled; no work is running.`,status:{...U,message:`The update integration was cancelled.`}}),V.push({...H,id:`cancelling`,label:`Cancellation requested`,description:`Cancel request pending while the operation is still active.`,pendingAction:{type:`cancel-codex`}},{id:`verification-setup`,label:`Verification setup`,description:`Supervisor preparing isolated verification dependencies before AI starts.`,status:{...U,busy:`Preparing verification`,activities:[{id:`install`,label:`Installing verification dependencies`,command:`pnpm install --frozen-lockfile`,source:`supervisor`,stage:`verify`,status:`running`,startedAt:W}]}},{id:`request-error`,label:`Action request failed`,description:`An action failed while the managed checkout remains available.`,status:U,error:`The working tree changed. Review the current changes before retrying.`},{id:`controls-running`,label:`Vite restart pending`,description:`Development controls waiting for a restart acknowledgment.`,status:U,controls:{pending:!0}},{id:`controls-failure`,label:`Vite restart failed`,description:`Development controls have a recoverable error.`,status:U,controls:{error:`Vite restart failed. Try again.`}},{id:`controls-success`,label:`Vite restart acknowledged`,description:`Development controls report a successful restart request.`,status:U,controls:{success:`Vite restart requested.`}});const Ee={id:`debug-operation-52e3`,requestIds:[`debug-resolve`],revision:8,sessionId:`debug-session`,source:`upstream`,target:Te.commit,kind:`rebase`,state:`running`,phase:`resolving`,startedAt:W,updatedAt:Date.now(),cancellation:`available`,published:!1,progress:{applied:1,total:4,skipped:0,remaining:3,current:H.codex.commits[0],files:[`src/web/root.tsx`,`src/web/navigation.tsx`]},turns:[{id:`first-stop`,stage:`resolve`,startedAt:W,finishedAt:W+1e3,status:`complete`,messages:[{kind:`agent`,author:we,text:`Resolved the first conflict while retaining local navigation.`}]},{id:`second-stop`,stage:`resolve`,startedAt:W+1e3,status:`running`,messages:H.codex.messages}],steps:[{id:`prepare`,label:`Prepare integration`,phase:`preparing`,status:`succeeded`,startedAt:W,finishedAt:W+1e3},{id:`replay`,label:`Replay commits`,phase:`replaying`,status:`failed`,startedAt:W+1e3,finishedAt:W+2e3},{id:`resolve`,label:`AI conflict resolution`,phase:`resolving`,status:`running`,startedAt:W+2e3}],activities:[]},De=V.find(({id:e})=>e===`verification`),G={...Ee,phase:`verifying`,progress:{applied:4,skipped:0,total:4,remaining:0},turns:[...Ee.turns.map(e=>({...e,status:`complete`,finishedAt:W+3e3})),{id:`verify-turn`,stage:`verify`,startedAt:W+3e3,status:`running`,messages:De.codex.messages}],activities:De.status.activities};for(let e of[{id:`operation-resolving`,label:`Recoverable rebase`,description:`Server-owned progress, grouped AI turns and cancellation.`,operation:Ee},{id:`operation-verifying`,label:`Recoverable verification`,description:`Concurrent tools and a Cancel control recover from status alone.`,operation:G},{id:`operation-cancelling`,label:`Waiting for cancellation`,description:`Cancellation requested; cleanup and subprocess exit have not settled.`,operation:{...G,state:`cancelling`,cancellation:`requested`}},{id:`operation-publication-cancel`,label:`Finishing publication before stopping`,description:`A cancellation request waits for coherent Git publication.`,operation:{...Ee,phase:`publishing`,state:`cancelling`,cancellation:`requested`,cancellationDeferred:!0}},{id:`operation-offline`,label:`Disconnected operation`,description:`The last snapshot stays visible; network actions are disabled.`,connected:!1,operation:G},{id:`operation-interrupted`,label:`Interrupted supervisor`,description:`An interrupted owner leaves a persistent, truthful recovery outcome.`,operation:{...G,phase:`finished`,state:`interrupted`,cancellation:`unavailable`,published:!0,finishedAt:Date.now(),message:`Changes were applied before the supervisor stopped. Review setup and checks before continuing.`,activities:[]}},{id:`operation-ready`,label:`Update complete`,description:`Full operation completion, including setup and checks.`,operation:{...G,phase:`finished`,state:`succeeded`,cancellation:`unavailable`,published:!0,startedAt:Date.now()-12e4,finishedAt:Date.now(),message:`Update complete.`,steps:[...G.steps.map((e,t)=>({...e,startedAt:Date.now()-12e4+t*1e3,status:e.status===`running`?`succeeded`:e.status,finishedAt:e.status===`running`?Date.now()-36e3:Date.now()-119e3+t*1e3})),{id:`setup-complete`,label:`Project setup`,phase:`setup`,status:`succeeded`,startedAt:Date.now()-36e3,finishedAt:Date.now()-24e3},{id:`checks-complete`,label:`Typecheck and tests`,phase:`checks`,status:`succeeded`,startedAt:Date.now()-24e3,finishedAt:Date.now()}],turns:G.turns.map(e=>({...e,status:`complete`,finishedAt:Date.now(),...e.stage===`verify`?{messages:[{kind:`agent`,text:`Update applied. Typecheck and tests passed.`}],finalMessage:`Update applied. Typecheck and tests passed.`}:{}})),activities:[]}}])V.push({id:e.id,label:e.label,description:e.description,connected:`connected`in e?e.connected:!0,status:{...U,operation:e.operation,...e.id===`operation-ready`?{currentCommit:`fedcba9876543210`,checks:{commit:`fedcba9876543210`,trigger:`synchronization`,commands:[{command:`pnpm typecheck`,status:`passed`},{command:`pnpm test`,status:`passed`}]}}:{},activities:e.operation.activities}});var K={actionError:`actionError`,actions:`actions`,actionSuccess:`actionSuccess`,activityCommand:`activityCommand`,activityDisclosure:`activityDisclosure`,activityList:`activityList`,activityMeta:`activityMeta`,activityOutput:`activityOutput`,activityRow:`activityRow`,activityState:`activityState`,activityStatus:`activityStatus`,activitySummary:`activitySummary`,button:`button`,"button-spin":`button-spin`,buttonContainer:`buttonContainer`,buttonSpinner:`buttonSpinner`,changeList:`changeList`,checkbox:`checkbox`,checkCommand:`checkCommand`,checkFailure:`checkFailure`,checkGuidance:`checkGuidance`,checkMessage:`checkMessage`,codexHistoryList:`codexHistoryList`,codexHistorySummary:`codexHistorySummary`,codexMessage:`codexMessage`,codexMessageAge:`codexMessageAge`,codexMessageHeader:`codexMessageHeader`,codexMessageLabel:`codexMessageLabel`,codexMessageText:`codexMessageText`,codexOptionSelect:`codexOptionSelect`,codexOutput:`codexOutput`,codexSettings:`codexSettings`,codexSettingsPopover:`codexSettingsPopover`,codexTranscript:`codexTranscript`,codexWaiting:`codexWaiting`,codexWorking:`codexWorking`,completionDetailBody:`completionDetailBody`,completionDetails:`completionDetails`,completionDialog:`completionDialog`,completionMetadata:`completionMetadata`,completionNote:`completionNote`,completionReceipt:`completionReceipt`,completionSteps:`completionSteps`,content:`content`,copyButton:`copyButton`,copyFooter:`copyFooter`,debugFooter:`debugFooter`,developmentControls:`developmentControls`,developmentControlsDropdown:`developmentControlsDropdown`,dialog:`dialog`,disabledTooltip:`disabledTooltip`,drawerBody:`drawerBody`,effortControl:`effortControl`,effortEndpoints:`effortEndpoints`,errorIcon:`errorIcon`,errorMessage:`errorMessage`,fileGroup:`fileGroup`,filePath:`filePath`,files:`files`,fileStatus:`fileStatus`,header:`header`,headerActions:`headerActions`,iconButton:`iconButton`,iconOnly:`iconOnly`,indicatorButton:`indicatorButton`,indicatorDot:`indicatorDot`,message:`message`,modelToggle:`modelToggle`,notificationActions:`notificationActions`,paragraph:`paragraph`,pendingCommits:`pendingCommits`,primary:`primary`,rebaseProgress:`rebaseProgress`,rebaseProgressFill:`rebaseProgressFill`,rebaseProgressLabel:`rebaseProgressLabel`,rebaseProgressTrack:`rebaseProgressTrack`,scenarioButton:`scenarioButton`,scenarioDescription:`scenarioDescription`,scenarioLabel:`scenarioLabel`,scenarioList:`scenarioList`,section:`section`,sectionDescription:`sectionDescription`,sectionHeading:`sectionHeading`,sectionLink:`sectionLink`,sectionTitle:`sectionTitle`,setupFailure:`setupFailure`,srOnly:`srOnly`,successIcon:`successIcon`,surface:`surface`,title:`title`,titleIcon:`titleIcon`,trackedFile:`trackedFile`,warning:`warning`};const q={userSelect:`text`,WebkitUserSelect:`text`},Oe={effort:`high`,model:`gpt-6-luna`},ke=u(!0);let J;function Ae(){if(J)return J;try{J=sessionStorage.getItem(`coreframe:managed-dev:client`)??void 0}catch{}if(!J){J=globalThis.crypto.getRandomValues(new Uint32Array(4)).join(`-`);try{sessionStorage.setItem(`coreframe:managed-dev:client`,J)}catch{}}return J}let je=!1;const Me=new Set,Ne=1600,Pe=[`codex-running`,`codex-finished`,`codex-message`,`codex-error`,`migration-failure`,`dependency-failure`,`failed-check`,`confirm-commit`,`local-changes`,`upstream-update`,`dev-update`,`busy`,`warning`,`paused`,`unavailable`,`success`,`idle`],Fe=[...Pe.slice(0,-2),...V.map(({id:e})=>e).filter(e=>!Pe.includes(e)),...Pe.slice(-2)].map(e=>{let t=V.find(t=>t.id===e);if(!t)throw Error(`Missing managed dev debug scenario: ${e}`);return t}).filter(e=>St(e));function Ie(){Y(!je)}function Y(e){if(je!==e){je=e;for(let e of Me)e()}}function Le({bottomOffset:e,debug:t=!1,indicator:n,rightOffset:r}){return w(t?Be:Re,{bottomOffset:e,indicator:n,rightOffset:r})}function Re({bottomOffset:e,indicator:r,rightOffset:i}){let{act:a,checkFailure:o,codex:s,codexOptions:c,dismissCheckFailure:u,dismissError:d,dismissSuccess:f,error:m,errorsDismissed:h,hmrReady:_,pendingAction:v,setCodexOptions:y,status:x,success:S}=Ot(),[C,E]=b(),[D,O]=b(),k=JSON.stringify([x?.mode,x?.message,x?.busy,x?.target?.commit,x?.draft?.fingerprint,x?.pendingRebase,x?.setupFailure,x?.warnings,x?.codexCompletion?.id,x?.operation&&[x.operation.id,x.operation.phase,x.operation.state],o,m,s?.phase,S?.heading]),A=Tt(),j={...A,recovery:x?.recovery?.length?T(`details`,{children:[w(`summary`,{children:`Recover previous state…`}),w(`p`,{className:K.paragraph,children:`Recover a checkpoint as two local branches. Your current branches and files stay in place.`}),x.recovery.map(e=>T(`details`,{children:[T(`summary`,{children:[e.completed?`Latest completed sync`:`Unresolved sync`,` ·`,` `,e.id.slice(0,8)]}),T(`p`,{className:K.paragraph,children:[`Main: `,e.main.slice(0,12),` · Dev: `,e.dev.slice(0,12)]}),T(Z,{children:[w(Q,{disabledReason:x.busy,onClick:()=>void a({type:`recover-history`,id:e.id}),children:`Recover as branches`}),[`main`,`dev`,...e.prepared?[`prepared`]:[]].map(t=>T(Q,{disabledReason:x.busy,onClick:()=>void a({type:`apply-recovery`,id:e.id,side:t,codex:c}),children:[`Recover `,t,` changes with agent`]},t)),w(Q,{disabledReason:x.busy,onClick:()=>void a({type:`discard-history`,id:e.id}),children:`Discard checkpoint`})]})]},e.id))]}):void 0,resetBranches:()=>{x?.operation&&a({type:`reset-branches`,operationId:x.operation.id})},resetDisabledReason:t(x)?A.pending?`Wait for Vite to restart`:void 0:`No active merge or rebase to reset`,resetPending:v?.type===`reset-branches`},M=St({status:x,codex:h&&s?.phase===`error`?void 0:s,error:h?void 0:m,success:S,pendingAction:v,controls:j});g(()=>{if(!S)return;let e=setTimeout(()=>{f(),Y(!1)},Ne);return()=>clearTimeout(e)},[f,S]),g(()=>{let e=x?.operation;if(e?.state!==`succeeded`||C===e.id||x?.codexCompletion||m||o||$(x))return;let t=Math.max(0,Ne-(Date.now()-(e.finishedAt??e.updatedAt))),n=setTimeout(()=>{Y(!1),_&&a({type:`acknowledge-operation`,id:e.id})},t);return()=>clearTimeout(n)},[a,x,m,o,_,C]);let N=r??w(Ke,{}),P=p(N)&&N.type===Ke?l(N,{paused:!x?.target}):N;return w(ze,{bottomOffset:e,ready:(_||!!x)&&M,indicator:x&&$(x,o)&&D!==k?P:null,rightOffset:i,children:w(ke.Provider,{value:_,children:w(qe,{connectionNotice:!_&&x?`Connection lost; progress may be stale. Reconnecting…`:void 0,act:a,checkFailure:o,codex:s,codexOptions:c,developmentControls:j,dismissCheckFailure:u,dismissError:()=>{O(k),d()},error:m,errorsDismissed:h,onClose:()=>{O(k),x?.operation&&!n(x.operation)&&x.operation.state!==`awaiting-resolution`&&!x.codexCompletion&&_&&a({type:`acknowledge-operation`,id:x.operation.id}),x?.codexCompletion&&_&&a({id:x.codexCompletion.id,type:`acknowledge-codex`}),Y(!1)},onInspectOperation:()=>E(x?.operation?.id),pendingAction:v,setCodexOptions:y,status:x,success:S})})})}function ze({bottomOffset:e,children:t,indicator:n,openOnMount:r=!1,ready:i=!0,rightOffset:a}){let[o,s]=b(null),c=x(kt,At,jt);g(()=>{!i&&c&&Y(!1)},[i,c]),g(()=>{r&&Y(!0);let e=!0,t=k(`coreframe-managed-dev`,document.body,{css:`@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:SN Pro Variable;font-style:normal;font-display:swap;font-weight:200 900;src:url(./files/sn-pro-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
188
188
 
189
189
  @font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-adlam-wght-normal.woff2)format("woff2-variations");unicode-range:U+61F,U+640,U+2015,U+201B,U+2020-2021,U+2030,U+204F,U+25CC,U+2E28-2E29,U+2E41,U+1E900-1E95F}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-canadian-aboriginal-wght-normal.woff2)format("woff2-variations");unicode-range:U+2C7,U+2D8-2D9,U+2DB,U+307,U+1400-167F,U+18B0-18F5,U+25CC,U+11AB?}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-cherokee-wght-normal.woff2)format("woff2-variations");unicode-range:U+300-302,U+304,U+30B-30C,U+323-324,U+330-331,U+13A0-13FF,U+AB70-ABBF}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-math-wght-normal.woff2)format("woff2-variations");unicode-range:U+302-303,U+305,U+307-308,U+310,U+312,U+315,U+31A,U+326-327,U+32C,U+32F-330,U+332-333,U+338,U+33A,U+346,U+34D,U+391-3A1,U+3A3-3A9,U+3B1-3C9,U+3D1,U+3D5-3D6,U+3F0-3F1,U+3F4-3F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE??}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-old-permic-wght-normal.woff2)format("woff2-variations");unicode-range:U+300,U+306-308,U+313,U+483,U+20DB,U+25CC,U+10350-1037A}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-symbols-wght-normal.woff2)format("woff2-variations");unicode-range:U+1-C,U+E-1F,U+7F-9F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+28??,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B??,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F0??,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F7??,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB??}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-symbols2-wght-normal.woff2)format("woff2-variations");unicode-range:U+2000-2001,U+2004-2008,U+200A,U+23B8-23BD,U+2500-259F}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-syriac-wght-normal.woff2)format("woff2-variations");unicode-range:U+303-304,U+307-308,U+30A,U+320,U+323-325,U+32D-32E,U+330-331,U+60C,U+61B-61C,U+61F,U+621,U+640,U+64B-655,U+660-66C,U+670,U+700-74F,U+860-86A,U+1DF8,U+1DFA,U+200C-200F,U+25CC,U+2670-2671}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Google Sans Code Variable;font-style:normal;font-display:swap;font-weight:300 800;src:url(./files/google-sans-code-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
190
190
 
191
191
  [data-isolet-root]{--overlay-font-body:"SN Pro Variable", system-ui, sans-serif;--overlay-font-monospace:"Google Sans Code Variable", ui-monospace, monospace;color-scheme:light dark;--oc-white:#fff;--oc-gray-0:#f8f9fa;--oc-gray-1:#f1f3f5;--oc-gray-2:#e9ecef;--oc-gray-3:#dee2e6;--oc-gray-4:#ced4da;--oc-gray-5:#adb5bd;--oc-gray-6:#868e96;--oc-gray-7:#495057;--oc-gray-8:#343a40;--oc-gray-9:#212529;--oc-red-0:#fff5f5;--oc-red-2:#ffc9c9;--oc-red-7:#f03e3e;--oc-red-9:#c92a2a;--oc-grape-0:#f8f0fc;--oc-grape-2:#eebefa;--oc-grape-7:#ae3ec9;--oc-grape-9:#862e9c;--oc-blue-0:#e7f5ff;--oc-blue-2:#a5d8ff;--oc-blue-4:#4dabf7;--oc-blue-6:#228be6;--oc-blue-7:#1c7ed6;--oc-blue-9:#1864ab;--oc-green-0:#ebfbee;--oc-green-2:#b2f2bb;--oc-green-7:#37b24d;--oc-green-9:#2b8a3e;--oc-yellow-0:#fff9db;--oc-yellow-2:#ffec99;--oc-yellow-7:#f59f00;--oc-yellow-9:#e67700;--overlay-background:var(--oc-white);--overlay-surface-subtle:var(--oc-gray-0);--overlay-surface-muted:var(--oc-gray-1);--overlay-border:var(--oc-gray-3);--overlay-border-strong:var(--oc-gray-4);--overlay-text:var(--oc-gray-9);--overlay-text-muted:var(--oc-gray-7);--overlay-text-subtle:var(--oc-gray-6);--overlay-accent:var(--oc-blue-6);--overlay-accent-hover:var(--oc-blue-7);--overlay-accent-soft:var(--oc-blue-0);--overlay-accent-border:var(--oc-blue-2);--overlay-accent-text:var(--oc-blue-9);--overlay-thought-soft:var(--oc-grape-0);--overlay-thought-border:var(--oc-grape-2);--overlay-thought-text:var(--oc-grape-9);--overlay-success-soft:var(--oc-green-0);--overlay-success-border:var(--oc-green-2);--overlay-success-text:var(--oc-green-9);--overlay-warning-soft:var(--oc-yellow-0);--overlay-warning-border:var(--oc-yellow-2);--overlay-warning-text:var(--oc-yellow-9);--overlay-danger-soft:var(--oc-red-0);--overlay-danger-border:var(--oc-red-2);--overlay-danger-text:var(--oc-red-9);--overlay-button-highlight:#ffffffb3;--overlay-button-shadow:#00000017;--overlay-button-hover:var(--overlay-background);--overlay-button-primary:#286fb4;--overlay-button-primary-hover:#307bbf;color:var(--overlay-text);font:14px/1.45 var(--overlay-font-body);-webkit-user-select:text;user-select:text}.surface{--managed-dev-bottom-offset:0px;--managed-dev-right-offset:0px}.indicatorButton{appearance:none;bottom:calc(10px + env(safe-area-inset-bottom,0px) + var(--managed-dev-bottom-offset));cursor:pointer;pointer-events:auto;height:44px;right:calc(10px + env(safe-area-inset-right,0px) + var(--managed-dev-right-offset));background:0 0;border:0;justify-content:center;align-items:center;width:44px;padding:0;display:flex;position:fixed}.indicatorButton:focus-visible{outline:3px solid var(--overlay-accent-border);outline-offset:-3px}.indicatorDot{background:var(--managed-dev-indicator-color);box-shadow:inset 0 0 0 .5px color-mix(in srgb, var(--overlay-border) 30%, transparent);height:var(--managed-dev-indicator-size);width:var(--managed-dev-indicator-size);border-radius:50%;display:block;position:relative}.dialog{background:var(--overlay-background);border:1px solid var(--overlay-border);box-shadow:0 8px 28px color-mix(in srgb, var(--oc-gray-9) 18%, transparent);color:var(--overlay-text);box-sizing:border-box;height:auto;bottom:20px;left:unset;overscroll-behavior:contain;pointer-events:auto;border-radius:12px;width:min(520px,100vw - 40px);max-width:min(520px,100vw - 40px);max-height:calc(100dvh - 40px);margin:0;padding:16px 18px;position:fixed;right:20px;overflow:hidden}.dialog[open]{flex-direction:column;gap:12px;display:flex}.drawerBody{align-content:start;gap:16px;min-width:0;min-height:0;display:grid;overflow:auto}.header{justify-content:space-between;align-items:center;gap:12px;display:flex}.copyFooter{flex:none;align-items:center;gap:8px;display:flex}.copyButton,.copyButton:hover{border-radius:50%}.headerActions{align-items:center;display:flex}.developmentControlsDropdown{display:flex;position:relative}.title{align-items:center;gap:8px;margin:0;font-size:16px;font-weight:600;display:flex}.titleIcon{color:var(--overlay-text-muted);flex:none}.iconButton{color:inherit;cursor:pointer;background:0 0;border:0;flex:none;justify-content:center;align-items:center;min-width:32px;min-height:32px;padding:4px;display:inline-flex}.iconButton:hover{background:var(--overlay-surface-muted);border-radius:8px}.iconButton:focus-visible,.scenarioButton:focus-visible,.sectionLink:focus-visible,.button:focus-visible,.message:focus-visible{outline:3px solid var(--overlay-accent-border);outline-offset:2px}.content{gap:12px;display:grid}.section{background:var(--overlay-surface-subtle);border:1px solid var(--overlay-border);border-radius:12px;gap:12px;padding:14px;display:grid}.sectionHeading{justify-content:space-between;align-items:start;gap:12px;display:flex}.sectionTitle{margin:0;font-size:13px}.sectionDescription{color:var(--overlay-text-muted);margin:3px 0 0;font-size:12px}.sectionLink{color:var(--overlay-accent-text);cursor:pointer;font:inherit;background:0 0;border:0;padding:2px;font-size:12px}.debugFooter{background:var(--overlay-surface-subtle);border-top:1px solid var(--overlay-border);color:var(--overlay-text-muted);flex:none;margin:0 -18px -12px;padding:4px 18px;font-size:11px;line-height:1.3}.scenarioList{gap:7px;max-height:min(480px,100dvh - 210px);display:grid;overflow:auto}.scenarioButton{background:var(--overlay-surface-subtle);color:inherit;cursor:pointer;font:inherit;text-align:start;border:1px solid #0000;border-radius:6px;gap:3px;padding:10px;display:grid}.scenarioButton:hover{background:var(--overlay-accent-soft);border-color:var(--overlay-accent-border)}.scenarioLabel{font-weight:650}.scenarioDescription{color:var(--overlay-text-muted);font-size:12px}.paragraph{margin:0}.pendingCommits{background:var(--overlay-surface-subtle);border:1px solid var(--overlay-border);box-sizing:border-box;font:12px/1.5 var(--overlay-font-monospace);white-space:pre-wrap;border-radius:6px;max-height:190px;margin:0;padding:10px;overflow:auto}.codexOutput{background:var(--overlay-surface-subtle);border:1px solid var(--overlay-border);box-sizing:border-box;font:12px/1.5 var(--overlay-font-monospace);white-space:pre-wrap;word-break:break-word;border-radius:6px;max-height:280px;margin:0;padding:10px;overflow:auto}.codexWorking{color:var(--overlay-text-muted);align-items:center;gap:6px;font-size:12px;display:flex}.codexTranscript{gap:10px;max-height:360px;display:grid;overflow:auto}.codexMessage{border-bottom:1px solid var(--overlay-border);gap:5px;padding:8px 0;display:grid}.codexMessage:last-child{border-bottom:0}.codexMessageHeader{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.codexMessageLabel{color:var(--overlay-text-muted);margin:0;font-size:11px;font-weight:650}.codexMessageAge{color:var(--overlay-text-subtle);white-space:nowrap;font-size:11px}.codexMessageText,.codexWaiting{font:13px/1.5 var(--overlay-font-body);white-space:pre-wrap;word-break:break-word;margin:0}.codexWaiting{color:var(--overlay-text-subtle)}.rebaseProgress{gap:8px;display:grid}.rebaseProgressLabel{color:var(--overlay-text-muted);justify-content:space-between;align-items:baseline;font-size:12px;display:flex}.rebaseProgressLabel strong{color:var(--overlay-text)}.rebaseProgressTrack{background:var(--overlay-surface-muted);border-radius:999px;height:6px;overflow:hidden}.rebaseProgressFill{background:var(--overlay-success-text);border-radius:inherit;height:100%;transition:width .18s;display:block}.codexHistorySummary{cursor:pointer;font-size:12px;font-weight:600}.codexHistoryList{gap:8px;padding-top:8px;display:grid}.files{gap:7px;max-height:190px;display:grid;overflow:auto}.checkbox{overflow-wrap:anywhere;align-items:start;gap:8px;display:flex}.checkbox input{accent-color:var(--overlay-accent)}.filePath{font-family:var(--overlay-font-monospace)}.message{background:var(--overlay-surface-subtle);border:1px solid var(--overlay-border-strong);box-sizing:border-box;color:var(--overlay-text);font-family:var(--overlay-font-monospace);resize:vertical;border-radius:6px;width:100%;min-height:92px;padding:10px}.codexSettings{justify-self:start}.codexSettingsPopover{z-index:2;box-sizing:border-box;background:var(--overlay-background);border:1px solid var(--overlay-border);border-radius:8px;gap:12px;width:220px;padding:12px;display:grid;position:fixed;box-shadow:0 4px 16px #0000002e}.codexSettingsPopover:before{content:"";z-index:-1;position:absolute;inset:-8px 0}.codexSettingsPopover>.sectionTitle{color:var(--overlay-text-muted);font-size:12px;font-weight:500}.modelToggle{background:var(--overlay-surface-subtle);border-radius:6px;gap:2px;padding:3px;display:flex}.modelToggle button{color:var(--overlay-text-muted);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:4px;flex:1;padding:5px 8px;font-size:13px}.modelToggle button[aria-pressed=true]{background:var(--overlay-surface-muted);color:var(--overlay-text)}.modelToggle button:focus-visible,.effortControl input:focus-visible{outline:2px solid var(--overlay-accent);outline-offset:2px}.modelToggle button:disabled{cursor:default;opacity:.55}.effortControl{gap:4px;font-size:12px;display:grid}.effortControl>span{justify-content:space-between;display:flex}.effortControl input{appearance:none;cursor:pointer;background:0 0;width:100%;height:20px;margin:0}.effortControl input::-webkit-slider-runnable-track{background:linear-gradient(to right, var(--overlay-accent) var(--effort-progress), var(--overlay-border-strong) var(--effort-progress));border-radius:2px;height:4px}.effortControl input::-webkit-slider-thumb{appearance:none;background:var(--overlay-accent);border-radius:50%;width:12px;height:12px;margin-top:-4px}.effortControl input::-moz-range-track{background:var(--overlay-border-strong);border-radius:2px;height:4px}.effortControl input::-moz-range-progress{background:var(--overlay-accent);height:4px}.effortControl input::-moz-range-thumb{background:var(--overlay-accent);border:0;border-radius:50%;width:12px;height:12px}.effortControl input:disabled{cursor:default;opacity:.55}.effortEndpoints{color:var(--overlay-text-muted)}.actions{flex-wrap:wrap;justify-content:end;gap:8px;display:flex}.developmentControls{background:var(--overlay-background);border:1px solid var(--overlay-border);box-shadow:0 10px 30px color-mix(in srgb, var(--oc-gray-9) 18%, transparent);box-sizing:border-box;z-index:1;border-radius:6px;gap:4px;min-width:170px;max-width:calc(100vw - 32px);margin:0;padding:4px;display:grid;position:absolute;top:calc(100% + 6px);right:0}.developmentControls .actions{justify-content:stretch;align-items:stretch;gap:0;width:100%;display:grid}.developmentControls .button{text-align:start;white-space:nowrap;justify-content:start;justify-self:stretch;width:100%;min-height:32px}.button{--button-fill:var(--overlay-surface-subtle);appearance:none;background:linear-gradient(#ffffff0a, #00000008), var(--button-fill);border:1px solid var(--overlay-border);box-shadow:inset 0 1px 0 var(--overlay-button-highlight), 0 1px 2px var(--overlay-button-shadow);box-sizing:border-box;color:inherit;cursor:pointer;font:inherit;border-radius:8px;justify-content:center;align-items:center;gap:6px;min-height:34px;padding:7px 14px;font-weight:600;transition:background-color .14s,border-color .14s,box-shadow .14s,transform .1s,opacity .14s;display:inline-flex}.button:hover:not(:disabled){--button-fill:var(--overlay-button-hover);border-color:var(--overlay-border-strong)}.button:active:not(:disabled){box-shadow:inset 0 1px 2px var(--overlay-button-shadow);transform:translateY(1px)}.button>svg:not(.buttonSpinner){opacity:.8}.primary{--button-fill:var(--overlay-button-primary);background-color:var(--button-fill);border-color:color-mix(in srgb, var(--button-fill), black 15%);box-shadow:inset 0 1px 0 #fff3, 0 1px 2px var(--overlay-button-shadow);color:var(--oc-white)}.primary:hover:not(:disabled){--button-fill:var(--overlay-button-primary-hover);border-color:color-mix(in srgb, var(--button-fill), black 15%)}.developmentControls .button{box-shadow:none;color:inherit;font-weight:inherit;background:0 0;border:0;transform:none}.developmentControls .button:hover:not(:disabled){background:var(--overlay-surface-muted)}.developmentControls .button:active:not(:disabled){box-shadow:none;transform:none}.button:disabled{cursor:default;opacity:.55}.buttonSpinner{animation:1.4s linear infinite button-spin}.iconOnly{box-sizing:border-box;flex:0 0 34px;width:34px;min-width:34px;height:34px;padding:7px}.warning{color:var(--overlay-warning-text);white-space:pre-wrap}.checkFailure{background:var(--overlay-danger-soft);border:1px solid var(--overlay-danger-border);color:var(--overlay-danger-text);border-radius:6px;gap:10px;padding:10px;display:grid}.checkCommand{font-family:var(--overlay-font-monospace);margin:0;font-weight:600}.checkGuidance{margin:3px 0 0;font-size:12px}.setupFailure{background:var(--overlay-danger-soft);border:1px solid var(--overlay-danger-border);color:var(--overlay-danger-text);border-radius:6px;gap:10px;padding:10px;display:grid}.actionError{background:var(--overlay-warning-soft);border:1px solid var(--overlay-warning-border);color:var(--overlay-warning-text);white-space:pre-wrap;border-radius:6px;gap:10px;padding:10px;display:grid}.errorMessage{grid-template-columns:auto 1fr;align-items:start;gap:8px;display:grid}.actionSuccess{background:var(--overlay-surface-subtle);border:1px solid var(--overlay-border);color:var(--overlay-success-text);border-radius:6px;grid-template-columns:auto 1fr;align-items:start;gap:8px;padding:10px;display:grid}.errorIcon,.successIcon{margin-top:1px}@media (prefers-color-scheme:dark){[data-isolet-root]{--overlay-background:var(--oc-gray-9);--overlay-button-highlight:#ffffff1a;--overlay-button-shadow:#00000040;--overlay-button-hover:color-mix(in srgb, var(--overlay-surface-subtle), white 5%);--overlay-button-primary:#306fae;--overlay-button-primary-hover:#397dbb;--overlay-surface-subtle:var(--oc-gray-8);--overlay-surface-muted:var(--oc-gray-7);--overlay-border:var(--oc-gray-7);--overlay-border-strong:var(--oc-gray-6);--overlay-text:var(--oc-gray-0);--overlay-text-muted:var(--oc-gray-4);--overlay-text-subtle:var(--oc-gray-5);--overlay-accent:var(--oc-blue-6);--overlay-accent-hover:var(--oc-blue-7);--overlay-accent-soft:color-mix(in srgb, var(--oc-blue-9) 32%, var(--overlay-background));--overlay-accent-border:var(--oc-blue-7);--overlay-accent-text:var(--oc-blue-2);--overlay-thought-soft:color-mix(in srgb, var(--oc-grape-9) 30%, var(--overlay-background));--overlay-thought-border:var(--oc-grape-7);--overlay-thought-text:var(--oc-grape-2);--overlay-success-soft:color-mix(in srgb, var(--oc-green-9) 30%, var(--overlay-background));--overlay-success-border:var(--oc-green-7);--overlay-success-text:var(--oc-green-2);--overlay-warning-soft:color-mix(in srgb, var(--oc-yellow-9) 24%, var(--overlay-background));--overlay-warning-border:var(--oc-yellow-7);--overlay-warning-text:var(--oc-yellow-2);--overlay-danger-soft:color-mix(in srgb, var(--oc-red-9) 30%, var(--overlay-background));--overlay-danger-border:var(--oc-red-7);--overlay-danger-text:var(--oc-red-2)}}@keyframes button-spin{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){.button{transition:none}.button:active:not(:disabled){transform:none}.buttonSpinner{animation:none}}@media (width<=600px){.dialog{max-width:none;max-height:100dvh;padding:calc(16px + env(safe-area-inset-top,0px)) calc(16px + env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) calc(16px + env(safe-area-inset-left,0px));border-radius:0;width:auto;inset:0}.debugFooter{margin:0 calc(-16px - env(safe-area-inset-right,0px)) calc(-16px - env(safe-area-inset-bottom,0px)) calc(-16px - env(safe-area-inset-left,0px));padding:4px calc(16px + env(safe-area-inset-right,0px)) calc(4px + env(safe-area-inset-bottom,0px)) calc(16px + env(safe-area-inset-left,0px))}.button{min-height:44px}.checkbox{align-items:center;min-height:44px}.iconButton{min-width:44px;min-height:44px}.iconOnly{flex-basis:44px;width:44px;min-width:44px;height:44px}}.buttonContainer{min-width:0;display:inline-flex}.buttonContainer:focus-visible{outline:2px solid var(--overlay-accent);outline-offset:2px;border-radius:8px}.button:disabled{pointer-events:none}.developmentControls .buttonContainer{width:100%;display:flex}.disabledTooltip{z-index:2147483647;border:1px solid var(--overlay-border);background:var(--overlay-surface-subtle);max-width:min(280px,100vw - 24px);color:var(--overlay-text-muted);pointer-events:none;border-radius:6px;padding:6px 8px;font-size:11px;font-weight:400;line-height:1.4;position:fixed;transform:translateY(-100%)}.srOnly{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.activityList{gap:8px;min-width:0;display:grid}.activityRow{border-bottom:1px solid var(--overlay-border);min-width:0;margin:0;padding:10px 0}.activitySummary{cursor:pointer;overflow-wrap:anywhere;grid-template-columns:14px minmax(0,1fr) auto;align-items:center;gap:8px;font-size:13px;list-style:none;display:grid}.activitySummary::-webkit-details-marker{display:none}.activityDisclosure{color:var(--overlay-text-subtle)}.activityRow[open]>summary .activityDisclosure{transform:rotate(90deg)}.activityState{vertical-align:middle;color:var(--overlay-text-muted);display:inline-flex}.activityState[data-status=succeeded]{color:var(--overlay-success-text)}.activityState[data-status=failed]{color:var(--overlay-danger-text)}.activityStatus{color:var(--overlay-text-muted);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:center;gap:6px;font-size:12px;display:inline-flex}.activityCommand{font-family:var(--overlay-font-monospace);white-space:pre-wrap;overflow-wrap:anywhere;margin-top:8px;font-size:12px;display:block}.activityMeta{color:var(--overlay-text-muted);margin-block:8px;font-size:12px}.activityOutput{white-space:pre-wrap;overflow-wrap:anywhere;max-height:200px;font-size:12px;overflow:auto}.content,.codexTranscript,.codexMessage,.checkMessage,.setupFailure,.actionError{overflow-wrap:anywhere;min-width:0}.pendingCommits,.codexOutput,.activityOutput{overflow-wrap:anywhere;tab-size:2}.codexOptionSelect:focus-visible,.checkbox input:focus-visible,.codexHistorySummary:focus-visible,.activitySummary:focus-visible{outline:2px solid var(--overlay-accent);outline-offset:2px}.activityRow:last-child{border-bottom:0}@media (prefers-reduced-motion:reduce){.rebaseProgressFill,.button{transition:none}}.notificationActions{flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:8px;padding:3px;display:flex;overflow-x:auto}.notificationActions:empty{display:none}.notificationActions>*{flex-shrink:0}.notificationActions>:first-child{margin-inline-start:auto}.notificationActions>.codexSettings{order:-1;margin-inline:0}.notificationActions>.copyFooter{order:-2;margin-inline:0 auto}.notificationActions .button{white-space:nowrap}.changeList{box-sizing:border-box;border-block:1px solid var(--overlay-border);gap:14px;min-height:0;max-height:min(240px,35dvh);padding-block:10px;display:grid;overflow:auto}.fileGroup{gap:8px;min-width:0;display:grid}.trackedFile{overflow-wrap:anywhere;align-items:baseline;gap:8px;display:flex}.fileStatus{font:600 12px/1.5 var(--overlay-font-monospace);text-align:center;flex:0 0 1.5em}.fileStatus[data-tone=added]{color:var(--overlay-success-text)}.fileStatus[data-tone=modified]{color:var(--overlay-warning-text)}.fileStatus[data-tone=deleted]{color:var(--overlay-danger-text)}.fileStatus[data-tone=renamed]{color:var(--overlay-accent-text)}.changeList .filePath{overflow-wrap:anywhere;min-width:0}.changeList:focus-visible{outline:2px solid var(--overlay-accent);outline-offset:2px}.completionReceipt{gap:16px;display:grid}.completionNote{color:var(--overlay-text-muted);margin:3px 0 0;font-size:13px}.completionDetails{font-size:13px}.completionDetailBody{border-top:1px solid var(--overlay-border);gap:14px;max-height:min(360px,50dvh);margin-top:12px;padding-top:12px;display:grid;overflow:auto}.completionMetadata{color:var(--overlay-text-muted);justify-content:space-between;gap:16px;font-size:12px;display:flex}.completionMetadata>:last-child{white-space:nowrap}.completionSteps{border-collapse:collapse;width:100%;font-size:13px}.completionSteps td{vertical-align:baseline;padding:5px 0}.completionSteps td:first-child{width:22px;color:var(--overlay-text-muted)}.completionSteps td:last-child{text-align:right;color:var(--overlay-text-muted);white-space:nowrap;font-size:12px}@media (width<=600px){.dialog.completionDialog{top:auto;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));border-radius:12px;max-height:calc(100dvh - 16px)}}
192
- `,hostAttributes:{"aria-live":`polite`,id:`coreframe-managed-dev`},hostStyles:{pointerEvents:`none`,position:`fixed`},zIndex:2147483647}),n=t.host,i=n?.parentNode,a=new MutationObserver(()=>{n&&i&&n.parentNode===i&&n.nextSibling&&i.appendChild(n)});return i&&a.observe(i,{childList:!0}),queueMicrotask(()=>{e&&s(t.container)}),()=>{e=!1,a.disconnect(),t.host?.remove()}},[r]);let l={"--managed-dev-bottom-offset":Ve(e),"--managed-dev-right-offset":Ve(a)};return o?S(T(`div`,{className:K.surface,style:l,children:[i?n:null,i&&c?t:null]}),o):null}function Be({scenario:e,onSnapshot:n,onAction:r,bottomOffset:i,indicator:a,rightOffset:o}){let[s,c]=b(),[u,d]=b(),[f,m]=b(Oe),[h,_]=b(),[v,y]=b(),[x,S]=b(!1),C=e??V.find(({id:e})=>e===s),T=e=>{c(e),_(void 0),y(void 0),S(!1)},E=C?.status.checks&&x?{...C.status,checks:{...C.status.checks,commands:C.status.checks.commands.map(e=>({...e,dismissed:!0}))}}:C?.status,D=C?.codex??(E?.operation?Dt(E.operation):void 0),O=!C||St({...C,status:E,error:x?void 0:C.error,codex:x&&C.codex?.phase===`error`?void 0:C.codex,success:v??C.success,controls:{...C.controls,success:h??C.controls?.success}});g(()=>{n?.({available:O,scenarioId:C?.id,status:C?.status,codex:C?.codex??(C?.status.operation?Dt(C.status.operation):void 0),error:C?.error,success:v??C?.success,errorsDismissed:x,codexOptions:f,controlSuccess:h,pendingAction:C?.pendingAction,controls:C?.controls})},[O,C,n,v,x,f,h]);let k=async e=>{if(r){r(e);return}if(e.type!==`configure-codex`){if(e.type===`decline-rebase`){Y(!1);return}if(e.type===`acknowledge-codex`){T(void 0);return}y(Et(e))}},A=a??w(Ke,{}),j={dismissError:()=>void 0,pending:C?.controls?.pending??!1,error:C?.controls?.error,reloadPage:()=>_(`Page reload simulated.`),restartVite:()=>_(`Vite restart simulated.`),resetBranches:()=>_(`Branch reset simulated.`),resetDisabledReason:t(C?.status)?void 0:`No active merge or rebase to reset`,success:h??C?.controls?.success},M=p(A)&&A.type===Ke?l(A,{paused:C?.status.mode===`waiting`}):A;return w(ze,{bottomOffset:i,indicator:u&&u===C?.id?null:M,ready:O,openOnMount:!0,rightOffset:o,children:C?w(ke.Provider,{value:C.connected??!0,children:w(qe,{connectionNotice:C.connected===!1?`Connection lost; progress may be stale. Reconnecting…`:void 0,act:k,checkFailure:bt(E),codex:D,codexOptions:f,developmentControls:j,dismissCheckFailure:()=>S(!0),dismissError:()=>S(!0),error:C.error,errorsDismissed:x,pendingAction:C.pendingAction,onBack:e?void 0:()=>T(void 0),onClose:()=>{d(C?.id),Y(!1)},setCodexOptions:m,status:E,success:v??C.success},C.id)}):w(He,{developmentControls:j,onClose:()=>{d(void 0),Y(!1)},onSelect:e=>T(e)})})}function Ve(e){return typeof e==`number`?`${e}px`:e??`0px`}function He({developmentControls:e,onClose:t,onSelect:n}){return w(Ue,{debug:!0,developmentControls:e,icon:re,onClose:t,title:`Overlay scenarios`,children:w(`div`,{className:K.scenarioList,children:Fe.map(e=>T(`button`,{className:K.scenarioButton,onClick:()=>n(e.id),type:`button`,children:[w(`span`,{className:K.scenarioLabel,children:e.label}),w(`span`,{className:K.scenarioDescription,children:e.description})]},e.id))})})}function Ue({children:e,compact:t=!1,debug:n=!1,developmentControls:r,diagnostics:i,icon:a,onBack:o,onClose:s,title:c}){let l=y(null),u=y(null),[d,f]=b(!1),[p,m]=b(null);return g(()=>{let e=e=>{let t=e.composedPath(),n=u.current;n&&!t.includes(n)&&f(!1);let r=l.current;r&&!t.includes(r)&&s()},t=e=>{e.key===`Escape`&&(e.preventDefault(),s())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[s]),T(`dialog`,{"aria-labelledby":`coreframe-managed-title`,"aria-modal":`true`,className:`${K.dialog} ${t?K.completionDialog:``}`,id:`coreframe-managed-dev-dialog`,open:!0,ref:l,children:[T(`div`,{className:K.header,children:[T(`h2`,{className:K.title,id:`coreframe-managed-title`,children:[w(a,{"aria-hidden":`true`,className:`${K.titleIcon} ${a===he?K.buttonSpinner:``}`,size:18}),c]}),T(`div`,{className:K.headerActions,children:[o?w(`button`,{"aria-label":`Back to scenarios`,className:K.iconButton,onClick:o,type:`button`,children:w(ne,{"aria-hidden":`true`,size:18})}):null,r?T(`div`,{className:K.developmentControlsDropdown,ref:u,children:[w(We,{"aria-expanded":d,"aria-haspopup":`menu`,label:`Development controls`,onClick:()=>f(e=>!e),children:w(fe,{"aria-hidden":`true`,size:18})}),d?w(Ye,{controls:r}):null]}):null,w(We,{label:`Hide`,onClick:s,children:w(ie,{"aria-hidden":`true`,size:18})})]})]}),T(lt.Provider,{value:p,children:[w(`div`,{className:K.drawerBody,children:e}),w(`div`,{className:K.notificationActions,ref:m,children:i?w(Ge,{diagnostics:{...i,title:c}}):null})]}),n?w(`footer`,{className:K.debugFooter,children:`Debug preview · actions are simulated`}):null]})}function We({label:e,className:t=``,children:n,...r}){let[i,a]=b(),o=y(null),s=_();v(()=>{let e=o.current;if(!i||!e)return;let t=e.getBoundingClientRect().width;e.style.left=`${Math.max(12,Math.min(i.left-t/2,window.innerWidth-t-12))}px`},[i]);let c=e=>{let t=e.closest(`[data-isolet-root]`),n=e.getBoundingClientRect();t&&a({left:n.left+n.width/2,top:n.top-8,root:t})};return T(C,{children:[w(`button`,{...r,"aria-label":e,"aria-describedby":i?s:void 0,className:`${K.iconButton} ${t}`,onBlur:()=>a(void 0),onFocus:e=>c(e.currentTarget),onMouseEnter:e=>c(e.currentTarget),onMouseLeave:()=>a(void 0),onKeyDown:e=>{e.key===`Escape`&&i&&(e.stopPropagation(),a(void 0))},type:`button`,children:n}),i?S(w(`span`,{className:K.disabledTooltip,id:s,ref:o,role:`tooltip`,style:{left:i.left,top:i.top,width:`max-content`},children:e}),i.root):null]})}function Ge({diagnostics:e}){let[t,n]=b();return g(()=>{if(!t)return;let e=globalThis.setTimeout(()=>n(void 0),3e3);return()=>globalThis.clearTimeout(e)},[t]),T(`div`,{className:K.copyFooter,children:[w(We,{label:`Copy this as JSON`,className:K.copyButton,onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify({source:`coreframe-managed-dev`,schemaVersion:1,capturedAt:new Date().toISOString(),...e},null,2)),n(`copied`)}catch{n(`failed`)}},children:w(t===`copied`?z:ue,{"aria-hidden":`true`,size:16})}),w(`span`,{className:t===`failed`?K.paragraph:K.srOnly,role:`status`,children:t===`copied`?`Copied as JSON`:t===`failed`?`Could not copy JSON. Check clipboard permissions and try again.`:``})]})}function Ke({color:e=`#228be6`,paused:t=!1,size:n=14,warningColor:r=`#fd7e14`}){let i=x(kt,At,jt),a={"--managed-dev-indicator-color":t?r:e,"--managed-dev-indicator-size":typeof n==`number`?`${n}px`:n};return w(`button`,{"aria-controls":`coreframe-managed-dev-dialog`,"aria-expanded":i,"aria-label":`${i?`Hide`:`Show`} Coreframe managed development`,className:K.indicatorButton,onClick:Ie,style:a,type:`button`,children:w(`span`,{className:K.indicatorDot})})}function qe({connectionNotice:e,act:t,checkFailure:r,codex:i,codexOptions:a,developmentControls:o,dismissCheckFailure:s,dismissError:c,error:l,errorsDismissed:u,onBack:d,onClose:f,onInspectOperation:p,pendingAction:m,setCodexOptions:h,status:_,success:v}){let[x,S]=b({value:``}),[E,D]=b(()=>({paths:new Set})),O=y(null),k=_?.operation,A=!k||k.state===`succeeded`?_?.codexCompletion:void 0,j=_?.draft,M=_?.codexRetry?.prepared?void 0:_?.pendingRebase,N=_?.codexRetry?void 0:_?.target,P=vt(_)||u&&i?.phase===`error`?void 0:i,F=!A&&!v&&(k?!n(k):!P),ee=!!ht(_,l,i),I=E.fingerprint===j?.fingerprint?E.paths:new Set((j?.untracked??[]).filter(e=>!j?.artifactFiles?.includes(e))),te=!!(j?.tracked||I.size),L=_?.proposalUntracked&&(_.proposalUntracked.length!==I.size||_.proposalUntracked.some(e=>!I.has(e)))?void 0:_?.proposal,R=x.fingerprint===j?.fingerprint&&x.proposal===L?x.value:L??``,ne={status:_??null,connectionNotice:e,checkFailure:r,codex:i,codexOptions:a,error:l,errorsDismissed:u,pendingAction:m,success:v,developmentControls:o?{error:o.error,pending:o.pending,success:o.success,resetDisabledReason:o.resetDisabledReason,resetPending:o.resetPending}:void 0,draft:j?{message:R,selectedUntracked:[...I]}:void 0},re=e=>{h(e),t({codex:e,type:`configure-codex`})};return g(()=>{let e=O.current;e&&i?.phase===`running`&&!e.querySelector(`details[open]`)&&(e.scrollTop=0)},[i]),k?.state===`succeeded`&&!$(_)&&!l?w(Ue,{compact:!0,debug:!!d,developmentControls:o,diagnostics:ne,icon:z,onBack:d,onClose:f,title:`Update complete`,children:w(Ze,{status:_,operation:k,codex:P,onInspect:p})}):r&&!n(k)?w(Ue,{debug:!!d,developmentControls:o,diagnostics:ne,icon:ye,onBack:d,onClose:f,title:`Check failed`,children:T(ut,{children:[e?w(`p`,{className:K.paragraph,role:`status`,children:e}):null,k?w(Qe,{operation:k}):null,w(`div`,{className:K.checkFailure,role:`alert`,children:T(`div`,{className:K.checkMessage,children:[T(`p`,{className:K.checkCommand,children:[r.check.command,` failed`]}),w(`p`,{className:K.checkGuidance,children:xt(r)}),w(`p`,{className:K.checkGuidance,children:`Copy the output and share it with your coding agent.`})]})}),T(Z,{children:[w(Q,{ariaLabel:`Retry failed checks`,busy:m?.type===`retry-checks`,disabledReason:_?.busy,icon:B,onClick:()=>void t({type:`retry-checks`}),primary:!0,children:`Retry checks`}),w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,onClick:()=>s(r),children:`Dismiss`}),w(Q,{ariaLabel:`Copy output for ${r.check.command}`,icon:ue,iconOnly:!0,onClick:()=>void navigator.clipboard.writeText(r.check.output??``),children:`Copy output`})]})]})}):w(Ue,{debug:!!d,developmentControls:o,diagnostics:ne,icon:pt({codex:P,completion:A,status:_,success:v}),onBack:d,onClose:f,title:k&&_?.mode===`managed`?Xe(k):A?`Conflict resolution finished`:v?.heading??(P?.phase===`complete`?P.stage===`verify`?`Finishing sync…`:`Finishing conflict resolution…`:P?.phase===`error`?P.stage===`verify`?`Verification failed`:`Conflict resolution failed`:P?P.stage===`verify`?`Verifying update`:`Resolving conflicts`:u&&!j&&!N&&!M?`Managed development`:ft(_)),children:T(ut,{children:[e?w(`p`,{className:K.paragraph,role:`status`,children:e}):null,k?w(Qe,{operation:k}):null,!n(k)&&(_?.codexRetry||_?.devAlignment||_?.fetchFailure||!_?.setupFailure&&_?.checks?.commands.some(e=>e.status===`failed`||e.status===`cancelled`))?T(C,{children:[_.fetchFailure?w(dt,{children:`Could not fetch updates: ${_.fetchFailure}`}):null,_.devAlignment?w(`p`,{className:K.paragraph,children:`Dev alignment is pending. Release its worktree or resolve the reported problem, then retry.`}):null,T(Z,{children:[_.codexRetry?w(Q,{ariaLabel:_.codexRetry.prepared?`Retry verification`:`Retry Codex`,busy:m?.type===`retry-codex`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-codex`,codex:a}),primary:!0,children:_.codexRetry.prepared?`Retry verification`:`Retry Codex`}):null,_.devAlignment?w(Q,{ariaLabel:`Retry dev alignment`,busy:m?.type===`retry-dev-alignment`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-dev-alignment`}),children:`Retry dev alignment`}):null,_.fetchFailure?w(Q,{ariaLabel:`Retry fetch`,busy:m?.type===`retry-fetch`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-fetch`}),children:`Retry fetch`}):null,!_.setupFailure&&_.checks?.commands.some(e=>e.status===`failed`||e.status===`cancelled`)?w(Q,{ariaLabel:`Retry failed checks`,busy:m?.type===`retry-checks`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-checks`}),children:`Retry checks`}):null]})]}):null,v&&!A?T(`div`,{className:K.actionSuccess,role:`status`,children:[w(oe,{"aria-hidden":`true`,className:K.successIcon,size:18}),w(`p`,{className:K.paragraph,children:v.message})]}):null,l&&!u?T(C,{children:[w(`div`,{className:K.actionError,role:`alert`,children:w(dt,{children:l})}),w(Z,{children:w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:c,children:`Dismiss`})})]}):null,!k&&(A?.totalCommits??P?.totalCommits)?w(it,{rebased:(A?.commits??P?.commits??[]).length,total:A?.totalCommits??P?.totalCommits}):null,w(et,{activities:_?.activities??[]}),A||!v&&P&&!_?.setupFailure?T(C,{children:[w($e,{completion:A,messages:k?P?.messages??[]:A?.messages??P?.messages??[],outputRef:O,stage:P?.stage??`resolve`,working:P?.phase===`running`,startedAt:P?.startedAt,turns:k?.turns,historyTruncated:k?.historyTruncated}),!k&&!A&&P?.phase===`running`?w(Z,{children:w(Q,{ariaLabel:P.stage===`verify`?`Cancel verification`:`Cancel conflict resolution`,busy:m?.type===`cancel-codex`,immediatelyEnabled:!0,icon:be,onClick:()=>void t({type:`cancel-codex`}),children:`Cancel`})}):null]}):null,F&&_?.setupFailure?T(C,{children:[u?w(`p`,{className:K.paragraph,children:`Error dismissed. Retry setup when ready.`}):T(`div`,{className:K.setupFailure,role:`alert`,children:[w(dt,{children:_.setupFailure.message}),w(`pre`,{className:K.codexOutput,children:_.setupFailure.output})]}),T(Z,{children:[u?null:w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:c,children:`Dismiss`}),w(Q,{ariaLabel:`Copy diagnostics`,requiresConnection:!1,disabledReason:_.busy,icon:ue,iconOnly:!0,onClick:()=>void navigator.clipboard.writeText(wt(_.setupFailure)),children:`Copy diagnostics`}),_.setupFailure.stage===`dependencies`?w(Q,{ariaLabel:`Retry install`,busy:m?.type===`retry-install`,disabledReason:_.busy,icon:B,iconOnly:!0,onClick:()=>void t({type:`retry-install`}),primary:!0,children:`Retry install`}):_.setupFailure.stage===`codegen`?w(Q,{ariaLabel:`Retry codegen`,busy:m?.type===`retry-codegen`,disabledReason:_.busy,icon:B,iconOnly:!0,onClick:()=>void t({type:`retry-codegen`}),primary:!0,children:`Retry codegen`}):T(C,{children:[w(Q,{ariaLabel:`Retry migration`,busy:m?.type===`retry-migration`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-migration`}),primary:!0,children:`Retry migration`}),w(Q,{busy:m?.type===`reset-database`,disabledReason:_.busy,icon:_e,onClick:()=>{globalThis.confirm(`Reset the local database? This permanently deletes all current data, then reapplies migrations and seed scripts.`)&&t({type:`reset-database`})},children:`Reset database`})]})]})]}):F&&_t(_)?T(C,{children:[w(`p`,{className:K.paragraph,children:u?`Error dismissed. Reconnect when ready.`:_?.message}),w(Z,{children:w(Q,{ariaLabel:`Retry managed development`,busy:m?.type===`retry-supervisor`,disabledReason:_?.busy,icon:B,immediatelyEnabled:!0,onClick:()=>void t({type:`retry-supervisor`}),primary:!0,children:`Retry`})})]}):F?w(`p`,{className:K.paragraph,children:_?_.busy||(u?`Dismissed.`:_.message||mt(_)):`Checking status…`}):null,A&&(!l||u)?w(Z,{children:w(Q,{busy:m?.type===`acknowledge-codex`,disabledReason:_?.busy,icon:z,onClick:()=>void t({id:A.id,type:`acknowledge-codex`}),primary:!0,children:`Continue`})}):null,F&&!u&&_?.mode===`waiting`&&_.message&&!vt(_)?T(`p`,{className:K.paragraph,children:[`Run `,w(`code`,{children:`git switch main`}),` in the primary checkout to resume synchronization.`]}):null,F&&N&&!j?w(`pre`,{className:K.pendingCommits,children:(N.commits??[N]).map(e=>`${e.shortCommit} ${e.subject}`).join(`
192
+ `,hostAttributes:{"aria-live":`polite`,id:`coreframe-managed-dev`},hostStyles:{pointerEvents:`none`,position:`fixed`},zIndex:2147483647}),n=t.host,i=n?.parentNode,a=new MutationObserver(()=>{n&&i&&n.parentNode===i&&n.nextSibling&&i.appendChild(n)});return i&&a.observe(i,{childList:!0}),queueMicrotask(()=>{e&&s(t.container)}),()=>{e=!1,a.disconnect(),t.host?.remove()}},[r]);let l={"--managed-dev-bottom-offset":Ve(e),"--managed-dev-right-offset":Ve(a)};return o?S(T(`div`,{className:K.surface,style:l,children:[i?n:null,i&&c?t:null]}),o):null}function Be({scenario:e,onSnapshot:n,onAction:r,bottomOffset:i,indicator:a,rightOffset:o}){let[s,c]=b(),[u,d]=b(),[f,m]=b(Oe),[h,_]=b(),[v,y]=b(),[x,S]=b(!1),C=e??V.find(({id:e})=>e===s),T=e=>{c(e),_(void 0),y(void 0),S(!1)},E=C?.status.checks&&x?{...C.status,checks:{...C.status.checks,commands:C.status.checks.commands.map(e=>({...e,dismissed:!0}))}}:C?.status,D=C?.codex??(E?.operation?Dt(E.operation):void 0),O=!C||St({...C,status:E,error:x?void 0:C.error,codex:x&&C.codex?.phase===`error`?void 0:C.codex,success:v??C.success,controls:{...C.controls,success:h??C.controls?.success}});g(()=>{n?.({available:O,scenarioId:C?.id,status:C?.status,codex:C?.codex??(C?.status.operation?Dt(C.status.operation):void 0),error:C?.error,success:v??C?.success,errorsDismissed:x,codexOptions:f,controlSuccess:h,pendingAction:C?.pendingAction,controls:C?.controls})},[O,C,n,v,x,f,h]);let k=async e=>{if(r){r(e);return}if(e.type!==`configure-codex`){if(e.type===`decline-rebase`){Y(!1);return}if(e.type===`acknowledge-codex`){T(void 0);return}y(Et(e))}},A=a??w(Ke,{}),j={dismissError:()=>void 0,pending:C?.controls?.pending??!1,error:C?.controls?.error,reloadPage:()=>_(`Page reload simulated.`),restartVite:()=>_(`Vite restart simulated.`),resetBranches:()=>_(`Branch reset simulated.`),resetDisabledReason:t(C?.status)?void 0:`No active merge or rebase to reset`,success:h??C?.controls?.success},M=p(A)&&A.type===Ke?l(A,{paused:C?.status.mode===`waiting`}):A;return w(ze,{bottomOffset:i,indicator:u&&u===C?.id?null:M,ready:O,openOnMount:!0,rightOffset:o,children:C?w(ke.Provider,{value:C.connected??!0,children:w(qe,{connectionNotice:C.connected===!1?`Connection lost; progress may be stale. Reconnecting…`:void 0,act:k,checkFailure:bt(E),codex:D,codexOptions:f,developmentControls:j,dismissCheckFailure:()=>S(!0),dismissError:()=>S(!0),error:C.error,errorsDismissed:x,pendingAction:C.pendingAction,onBack:e?void 0:()=>T(void 0),onClose:()=>{d(C?.id),Y(!1)},setCodexOptions:m,status:E,success:v??C.success},C.id)}):w(He,{developmentControls:j,onClose:()=>{d(void 0),Y(!1)},onSelect:e=>T(e)})})}function Ve(e){return typeof e==`number`?`${e}px`:e??`0px`}function He({developmentControls:e,onClose:t,onSelect:n}){return w(Ue,{debug:!0,developmentControls:e,icon:re,onClose:t,title:`Overlay scenarios`,children:w(`div`,{className:K.scenarioList,children:Fe.map(e=>T(`button`,{className:K.scenarioButton,onClick:()=>n(e.id),type:`button`,children:[w(`span`,{className:K.scenarioLabel,children:e.label}),w(`span`,{className:K.scenarioDescription,children:e.description})]},e.id))})})}function Ue({children:e,compact:t=!1,debug:n=!1,developmentControls:r,diagnostics:i,icon:a,onBack:o,onClose:s,title:c}){let l=y(null),u=y(null),[d,f]=b(!1),[p,m]=b(null);return g(()=>{let e=e=>{let t=e.composedPath(),n=u.current;n&&!t.includes(n)&&f(!1);let r=l.current;r&&!t.includes(r)&&s()},t=e=>{e.key===`Escape`&&(e.preventDefault(),s())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[s]),T(`dialog`,{"aria-labelledby":`coreframe-managed-title`,"aria-modal":`true`,className:`${K.dialog} ${t?K.completionDialog:``}`,id:`coreframe-managed-dev-dialog`,open:!0,ref:l,children:[T(`div`,{className:K.header,children:[T(`h2`,{className:K.title,id:`coreframe-managed-title`,children:[w(a,{"aria-hidden":`true`,className:`${K.titleIcon} ${a===he?K.buttonSpinner:``}`,size:18}),c]}),T(`div`,{className:K.headerActions,children:[o?w(`button`,{"aria-label":`Back to scenarios`,className:K.iconButton,onClick:o,type:`button`,children:w(ne,{"aria-hidden":`true`,size:18})}):null,r?T(`div`,{className:K.developmentControlsDropdown,ref:u,children:[w(We,{"aria-expanded":d,"aria-haspopup":`menu`,label:`Development controls`,onClick:()=>f(e=>!e),children:w(fe,{"aria-hidden":`true`,size:18})}),d?w(Ye,{controls:r}):null]}):null,w(We,{label:`Hide`,onClick:s,children:w(ie,{"aria-hidden":`true`,size:18})})]})]}),T(lt.Provider,{value:p,children:[w(`div`,{className:K.drawerBody,children:e}),w(`div`,{className:K.notificationActions,ref:m,children:i?w(Ge,{diagnostics:{...i,title:c}}):null})]}),n?w(`footer`,{className:K.debugFooter,children:`Debug preview · actions are simulated`}):null]})}function We({label:e,className:t=``,children:n,...r}){let[i,a]=b(),o=y(null),s=_();v(()=>{let e=o.current;if(!i||!e)return;let t=e.getBoundingClientRect().width;e.style.left=`${Math.max(12,Math.min(i.left-t/2,window.innerWidth-t-12))}px`},[i]);let c=e=>{let t=e.closest(`[data-isolet-root]`),n=e.getBoundingClientRect();t&&a({left:n.left+n.width/2,top:n.top-8,root:t})};return T(C,{children:[w(`button`,{...r,"aria-label":e,"aria-describedby":i?s:void 0,className:`${K.iconButton} ${t}`,onBlur:()=>a(void 0),onFocus:e=>c(e.currentTarget),onMouseEnter:e=>c(e.currentTarget),onMouseLeave:()=>a(void 0),onKeyDown:e=>{e.key===`Escape`&&i&&(e.stopPropagation(),a(void 0))},type:`button`,children:n}),i?S(w(`span`,{className:K.disabledTooltip,id:s,ref:o,role:`tooltip`,style:{left:i.left,top:i.top,width:`max-content`},children:e}),i.root):null]})}function Ge({diagnostics:e}){let[t,n]=b();return g(()=>{if(!t)return;let e=globalThis.setTimeout(()=>n(void 0),3e3);return()=>globalThis.clearTimeout(e)},[t]),T(`div`,{className:K.copyFooter,children:[w(We,{label:`Copy this as JSON`,className:K.copyButton,onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify({source:`coreframe-managed-dev`,schemaVersion:1,capturedAt:new Date().toISOString(),...e},null,2)),n(`copied`)}catch{n(`failed`)}},children:w(t===`copied`?z:ue,{"aria-hidden":`true`,size:16})}),w(`span`,{className:t===`failed`?K.paragraph:K.srOnly,role:`status`,children:t===`copied`?`Copied as JSON`:t===`failed`?`Could not copy JSON. Check clipboard permissions and try again.`:``})]})}function Ke({color:e=`#228be6`,paused:t=!1,size:n=14,warningColor:r=`#fd7e14`}){let i=x(kt,At,jt),a={"--managed-dev-indicator-color":t?r:e,"--managed-dev-indicator-size":typeof n==`number`?`${n}px`:n};return w(`button`,{"aria-controls":`coreframe-managed-dev-dialog`,"aria-expanded":i,"aria-label":`${i?`Hide`:`Show`} Coreframe managed development`,className:K.indicatorButton,onClick:Ie,style:a,type:`button`,children:w(`span`,{className:K.indicatorDot})})}function qe({connectionNotice:e,act:t,checkFailure:r,codex:i,codexOptions:a,developmentControls:o,dismissCheckFailure:s,dismissError:c,error:l,errorsDismissed:u,onBack:d,onClose:f,onInspectOperation:p,pendingAction:m,setCodexOptions:h,status:_,success:v}){let[x,S]=b({value:``}),[E,D]=b(()=>({paths:new Set})),O=y(null),k=_?.operation,A=!k||k.state===`succeeded`?_?.codexCompletion:void 0,j=_?.draft,M=_?.codexRetry?.prepared?void 0:_?.pendingRebase,N=_?.codexRetry||_?.history?void 0:_?.target,P=vt(_)||u&&i?.phase===`error`?void 0:i,F=!A&&!v&&(k?!n(k):!P),ee=!!ht(_,l,i),I=E.fingerprint===j?.fingerprint?E.paths:new Set((j?.untracked??[]).filter(e=>!j?.artifactFiles?.includes(e))),te=!!(j?.tracked||I.size),L=_?.proposalUntracked&&(_.proposalUntracked.length!==I.size||_.proposalUntracked.some(e=>!I.has(e)))?void 0:_?.proposal,R=x.fingerprint===j?.fingerprint&&x.proposal===L?x.value:L??``,ne={status:_??null,connectionNotice:e,checkFailure:r,codex:i,codexOptions:a,error:l,errorsDismissed:u,pendingAction:m,success:v,developmentControls:o?{error:o.error,pending:o.pending,success:o.success,resetDisabledReason:o.resetDisabledReason,resetPending:o.resetPending}:void 0,draft:j?{message:R,selectedUntracked:[...I]}:void 0},re=e=>{h(e),t({codex:e,type:`configure-codex`})};return g(()=>{let e=O.current;e&&i?.phase===`running`&&!e.querySelector(`details[open]`)&&(e.scrollTop=0)},[i]),k?.state===`succeeded`&&!$(_)&&!l?w(Ue,{compact:!0,debug:!!d,developmentControls:o,diagnostics:ne,icon:z,onBack:d,onClose:f,title:`Update complete`,children:w(Ze,{status:_,operation:k,codex:P,onInspect:p})}):r&&!n(k)?w(Ue,{debug:!!d,developmentControls:o,diagnostics:ne,icon:ye,onBack:d,onClose:f,title:`Check failed`,children:T(ut,{children:[e?w(`p`,{className:K.paragraph,role:`status`,children:e}):null,k?w(Qe,{operation:k}):null,w(`div`,{className:K.checkFailure,role:`alert`,children:T(`div`,{className:K.checkMessage,children:[T(`p`,{className:K.checkCommand,children:[r.check.command,` failed`]}),w(`p`,{className:K.checkGuidance,children:xt(r)}),w(`p`,{className:K.checkGuidance,children:`Copy the output and share it with your coding agent.`})]})}),T(Z,{children:[w(Q,{ariaLabel:`Retry failed checks`,busy:m?.type===`retry-checks`,disabledReason:_?.busy,icon:B,onClick:()=>void t({type:`retry-checks`}),primary:!0,children:`Retry checks`}),w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,onClick:()=>s(r),children:`Dismiss`}),w(Q,{ariaLabel:`Copy output for ${r.check.command}`,icon:ue,iconOnly:!0,onClick:()=>void navigator.clipboard.writeText(r.check.output??``),children:`Copy output`})]})]})}):w(Ue,{debug:!!d,developmentControls:o,diagnostics:ne,icon:pt({codex:P,completion:A,status:_,success:v}),onBack:d,onClose:f,title:k&&_?.mode===`managed`?Xe(k):A?`Conflict resolution finished`:v?.heading??(P?.phase===`complete`?P.stage===`verify`?`Finishing sync…`:`Finishing conflict resolution…`:P?.phase===`error`?P.stage===`verify`?`Verification failed`:`Conflict resolution failed`:P?P.stage===`verify`?`Verifying update`:`Resolving conflicts`:u&&!j&&!N&&!M?`Managed development`:ft(_)),children:T(ut,{children:[e?w(`p`,{className:K.paragraph,role:`status`,children:e}):null,k?w(Qe,{operation:k}):null,_?.history&&!n(k)?T(C,{children:[w(`p`,{className:K.paragraph,children:_.history.reason}),w(Z,{children:w(Q,{primary:!0,busy:m?.type===`sync-dev`,disabledReason:_.busy||(j&&_.history.kind!==`align`?`Commit or save main's working-tree changes first`:void 0),onClick:()=>void t({type:`sync-dev`,main:_.history.main,dev:_.history.dev,codex:a}),children:_.history.kind===`align`?`Update dev`:_.history.kind===`review`?`Review and repair with agent`:`Apply dev changes and align`})})]}):null,!n(k)&&(_?.codexRetry||_?.devAlignment||_?.fetchFailure||!_?.setupFailure&&_?.checks?.commands.some(e=>e.status===`failed`||e.status===`cancelled`))?T(C,{children:[_.fetchFailure?w(dt,{children:`Could not fetch updates: ${_.fetchFailure}`}):null,_.devAlignment?w(`p`,{className:K.paragraph,children:`Dev alignment is pending. Release its worktree or resolve the reported problem, then retry.`}):null,T(Z,{children:[_.codexRetry?w(Q,{ariaLabel:_.codexRetry.prepared?`Retry verification`:`Retry Codex`,busy:m?.type===`retry-codex`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-codex`,codex:a}),primary:!0,children:_.codexRetry.prepared?`Retry verification`:`Retry Codex`}):null,_.devAlignment?w(Q,{ariaLabel:`Retry dev alignment`,busy:m?.type===`retry-dev-alignment`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-dev-alignment`}),children:`Retry dev alignment`}):null,_.fetchFailure?w(Q,{ariaLabel:`Retry fetch`,busy:m?.type===`retry-fetch`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-fetch`}),children:`Retry fetch`}):null,!_.setupFailure&&_.checks?.commands.some(e=>e.status===`failed`||e.status===`cancelled`)?w(Q,{ariaLabel:`Retry failed checks`,busy:m?.type===`retry-checks`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-checks`}),children:`Retry checks`}):null]})]}):null,v&&!A?T(`div`,{className:K.actionSuccess,role:`status`,children:[w(oe,{"aria-hidden":`true`,className:K.successIcon,size:18}),w(`p`,{className:K.paragraph,children:v.message})]}):null,l&&!u?T(C,{children:[w(`div`,{className:K.actionError,role:`alert`,children:w(dt,{children:l})}),w(Z,{children:w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:c,children:`Dismiss`})})]}):null,!k&&(A?.totalCommits??P?.totalCommits)?w(it,{rebased:(A?.commits??P?.commits??[]).length,total:A?.totalCommits??P?.totalCommits}):null,w(et,{activities:_?.activities??[]}),A||!v&&P&&!_?.setupFailure?T(C,{children:[w($e,{completion:A,messages:k?P?.messages??[]:A?.messages??P?.messages??[],outputRef:O,stage:P?.stage??`resolve`,working:P?.phase===`running`,startedAt:P?.startedAt,turns:k?.turns,historyTruncated:k?.historyTruncated}),!k&&!A&&P?.phase===`running`?w(Z,{children:w(Q,{ariaLabel:P.stage===`verify`?`Cancel verification`:`Cancel conflict resolution`,busy:m?.type===`cancel-codex`,immediatelyEnabled:!0,icon:be,onClick:()=>void t({type:`cancel-codex`}),children:`Cancel`})}):null]}):null,F&&_?.setupFailure?T(C,{children:[u?w(`p`,{className:K.paragraph,children:`Error dismissed. Retry setup when ready.`}):T(`div`,{className:K.setupFailure,role:`alert`,children:[w(dt,{children:_.setupFailure.message}),w(`pre`,{className:K.codexOutput,children:_.setupFailure.output})]}),T(Z,{children:[u?null:w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:c,children:`Dismiss`}),w(Q,{ariaLabel:`Copy diagnostics`,requiresConnection:!1,disabledReason:_.busy,icon:ue,iconOnly:!0,onClick:()=>void navigator.clipboard.writeText(wt(_.setupFailure)),children:`Copy diagnostics`}),_.setupFailure.stage===`dependencies`?w(Q,{ariaLabel:`Retry install`,busy:m?.type===`retry-install`,disabledReason:_.busy,icon:B,iconOnly:!0,onClick:()=>void t({type:`retry-install`}),primary:!0,children:`Retry install`}):_.setupFailure.stage===`codegen`?w(Q,{ariaLabel:`Retry codegen`,busy:m?.type===`retry-codegen`,disabledReason:_.busy,icon:B,iconOnly:!0,onClick:()=>void t({type:`retry-codegen`}),primary:!0,children:`Retry codegen`}):T(C,{children:[w(Q,{ariaLabel:`Retry migration`,busy:m?.type===`retry-migration`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`retry-migration`}),primary:!0,children:`Retry migration`}),w(Q,{busy:m?.type===`reset-database`,disabledReason:_.busy,icon:_e,onClick:()=>{globalThis.confirm(`Reset the local database? This permanently deletes all current data, then reapplies migrations and seed scripts.`)&&t({type:`reset-database`})},children:`Reset database`})]})]})]}):F&&_t(_)?T(C,{children:[w(`p`,{className:K.paragraph,children:u?`Error dismissed. Reconnect when ready.`:_?.message}),w(Z,{children:w(Q,{ariaLabel:`Retry managed development`,busy:m?.type===`retry-supervisor`,disabledReason:_?.busy,icon:B,immediatelyEnabled:!0,onClick:()=>void t({type:`retry-supervisor`}),primary:!0,children:`Retry`})})]}):F?w(`p`,{className:K.paragraph,children:_?_.busy||(u?`Dismissed.`:_.message||mt(_)):`Checking status…`}):null,A&&(!l||u)?w(Z,{children:w(Q,{busy:m?.type===`acknowledge-codex`,disabledReason:_?.busy,icon:z,onClick:()=>void t({id:A.id,type:`acknowledge-codex`}),primary:!0,children:`Continue`})}):null,F&&!u&&_?.mode===`waiting`&&_.message&&!vt(_)?T(`p`,{className:K.paragraph,children:[`Run `,w(`code`,{children:`git switch main`}),` in the primary checkout to resume synchronization.`]}):null,F&&N&&!j?w(`pre`,{className:K.pendingCommits,children:(N.commits??[N]).map(e=>`${e.shortCommit} ${e.subject}`).join(`
193
193
  `)}):null,F&&!u?_?.warnings.map((e,t)=>w(`p`,{className:`${K.paragraph} ${K.warning}`,children:e},`${t}-${e}`)):null,F&&j?T(C,{children:[T(`div`,{className:K.changeList,"aria-label":`Changed files`,tabIndex:0,children:[j.tracked?T(`section`,{className:K.fileGroup,children:[w(`h3`,{className:K.sectionTitle,children:`Tracked changes · included automatically`}),j.trackedFiles?.map(e=>T(`div`,{className:K.trackedFile,children:[w(st,{status:e.status}),T(`span`,{className:K.filePath,children:[e.originalPath?`${e.originalPath} → `:``,e.path]})]},e.path))]}):null,[{label:`Untracked files`,files:j.untracked.filter(e=>!j.artifactFiles?.includes(e)),toggle:`Include all untracked files`},{label:`Build artifacts · excluded by default`,files:j.artifactFiles??[],toggle:`Include build artifacts`}].filter(e=>e.files.length>0).map(e=>T(`section`,{className:K.fileGroup,children:[w(`h3`,{className:K.sectionTitle,children:e.label}),e.files.length>0?w(ct,{checked:e.files.every(e=>I.has(e)),indeterminate:!e.files.every(e=>I.has(e))&&e.files.some(e=>I.has(e)),label:e.toggle,onChange:t=>D({fingerprint:j.fingerprint,paths:new Set(t?[...I,...e.files]:[...I].filter(t=>!e.files.includes(t)))})}):null,e.files.map(e=>w(ct,{checked:I.has(e),label:T(C,{children:[w(st,{status:`??`}),w(`span`,{className:K.filePath,children:e})]}),onChange:t=>D(()=>{let n=new Set(I);return t?n.add(e):n.delete(e),{fingerprint:j.fingerprint,paths:n}})},e))]},e.label))]}),te?L===void 0?T(Z,{children:[N?w(Q,{busy:m?.type===`reject`,disabledReason:_.busy,icon:_e,onClick:()=>void t({type:`reject`}),children:`Reject`}):null,w(Q,{busy:m?.type===`message`,disabledReason:_.busy,icon:ve,onClick:()=>void t({type:`message`,fingerprint:j.fingerprint,untracked:[...I]}),primary:!0,children:`Generate commit message`})]}):T(C,{children:[w(`textarea`,{"aria-label":`Commit message`,className:K.message,onChange:e=>S({fingerprint:j.fingerprint,proposal:L,value:e.target.value}),value:R}),N?w(Je,{disabled:!!_.busy,onChange:re,value:a}):null,T(Z,{children:[N?w(Q,{busy:m?.type===`reject`,disabledReason:_.busy,icon:_e,onClick:()=>void t({type:`reject`}),children:`Reject`}):null,w(Q,{busy:m?.type===(N?`apply`:`commit`),disabledReason:_.busy,icon:pe,onClick:()=>{t(N?{type:`apply`,target:N.commit,fingerprint:j.fingerprint,untracked:[...I],message:R,codex:a}:{type:`commit`,fingerprint:j.fingerprint,untracked:[...I],message:R})},primary:!0,children:N?`Commit and refresh`:`Commit changes`}),L===``?w(Q,{busy:m?.type===`message`,disabledReason:_.busy,icon:ve,onClick:()=>void t({type:`message`,fingerprint:j.fingerprint,untracked:[...I]}),children:`Retry generation`}):null]})]}):T(C,{children:[w(`p`,{className:K.paragraph,children:`Unchecked files stay on disk and will not be committed.`}),N?T(C,{children:[w(Je,{disabled:!!_.busy,onChange:re,value:a}),w(Z,{children:w(Q,{icon:B,primary:!0,disabledReason:_.busy,busy:m?.type===`apply`,onClick:()=>void t({type:`apply`,target:N.commit,fingerprint:j.fingerprint,untracked:[],codex:a}),children:`Refresh`})})]}):w(`p`,{className:K.paragraph,children:`Select files to commit.`})]})]}):F&&_&&M?T(C,{children:[w(`p`,{className:K.paragraph,children:M.applied>0?`The update replayed ${M.applied} of ${M.applied+M.commits.length} commits before stopping on a conflict. The cleanly applied commits are already on your branch; Codex can resolve the rest.`:`The update stopped on a conflict before any commit could be replayed. Codex can resolve your commits.`}),w(`div`,{className:K.files,children:M.files.map(e=>w(`span`,{className:K.filePath,children:e},e))}),M.commits.length>0?w(`pre`,{className:K.pendingCommits,children:M.commits.map(e=>`${e.shortCommit} ${e.subject}`).join(`
194
- `)}):null,w(Je,{disabled:!!_.busy,onChange:re,value:a}),T(Z,{children:[w(Q,{busy:m?.type===`decline-rebase`,disabledReason:_.busy,icon:be,onClick:()=>void t({type:`decline-rebase`}),children:`Decline`}),w(Q,{busy:m?.type===`resolve-rebase`,disabledReason:_.busy,icon:ve,onClick:()=>void t({codex:a,type:`resolve-rebase`}),primary:!0,children:`Resolve with Codex`})]})]}):F&&_&&N?T(C,{children:[w(Je,{disabled:!!_.busy,onChange:re,value:a}),w(Z,{children:w(Q,{busy:m?.type===`prepare`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`prepare`,target:N.commit,codex:a}),primary:!0,children:N.source===`upstream`?`Refresh`:String(N.source)===`dev`?`Sync with dev`:`Sync with main`})})]}):null,ee&&!u&&!l&&!(F&&_?.setupFailure)?w(Z,{children:w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:c,children:`Dismiss`})}):null,k&&n(k)?w(Z,{children:w(Q,{ariaLabel:`Cancel update`,busy:m?.type===`cancel-codex`||k.cancellation===`requested`,disabledReason:_?.mode===`managed`?k.cancellation===`unavailable`?`Finishing the current step`:void 0:`Reconnecting`,immediatelyEnabled:!0,icon:be,onClick:()=>void t({type:`cancel-codex`,operationId:k.id}),children:k.cancellation===`requested`?k.cancellationDeferred?`Finishing publication…`:`Cancelling…`:m?.type===`cancel-codex`?`Requesting cancellation…`:`Cancel update`})}):null,!A&&!v&&!j&&!N&&!M&&!n(k)&&!_?.busy&&!(!k&&P&&P.phase!==`error`)&&!(ee&&!u)&&!(F&&_?.setupFailure&&!u)&&(k||_?.message||_?.warnings.length||_&&_.mode!==`managed`)?w(Z,{children:w(Q,{icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:f,children:`Dismiss`})}):null]})})}function Je({disabled:e=!1,onChange:t,value:n}){let[a,o]=b(!1),[s,c]=b({top:0,left:0}),l=y(null),u=y(null),d=_(),f=y(null);v(()=>{let e=u.current?.getBoundingClientRect();if(a&&e&&f.current){let t=f.current.getBoundingClientRect().height;c({top:e.bottom+8+t<=window.innerHeight-8?e.bottom+8:Math.max(8,e.top-t-8),left:Math.max(8,Math.min(e.left,window.innerWidth-228))})}},[a]);let p=()=>{if(a)return;let e=u.current?.getBoundingClientRect();e&&c({top:Math.max(8,e.top-190),left:Math.max(8,Math.min(e.left,window.innerWidth-228))}),o(!0)};return g(()=>{if(!a)return;let e=e=>{l.current&&!e.composedPath().includes(l.current)&&o(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[a]),w(Z,{children:T(`div`,{className:K.codexSettings,ref:l,onMouseEnter:p,onMouseLeave:e=>{e.currentTarget.matches(`:focus-within`)||o(!1)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o(!1)},onKeyDown:e=>{e.key===`Escape`&&a&&(e.stopPropagation(),o(!1),u.current?.focus())},children:[w(`button`,{type:`button`,ref:u,className:K.iconButton,"aria-label":`Codex settings: ${n.model===`gpt-6.1-sol`?`Sol`:`Luna`}, ${n.effort} effort`,"aria-expanded":a,"aria-controls":d,"aria-haspopup":`dialog`,onClick:p,children:w(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`currentColor`,fillRule:`evenodd`,children:w(`path`,{d:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`})})}),a?T(`div`,{role:`dialog`,ref:f,"aria-label":`Codex settings`,id:d,className:K.codexSettingsPopover,style:s,children:[w(`span`,{className:K.sectionTitle,children:`Conflict resolution`}),w(`div`,{role:`group`,"aria-label":`Codex model`,className:K.modelToggle,children:i.map(r=>w(`button`,{type:`button`,"aria-pressed":n.model===r,disabled:e,onClick:()=>t({...n,model:r}),children:r===`gpt-6.1-sol`?`Sol`:`Luna`},r))}),T(`label`,{className:K.effortControl,children:[T(`span`,{children:[`Effort`,` `,w(`strong`,{children:{low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra high`,max:`Max`}[n.effort]})]}),w(`input`,{"aria-label":`Reasoning effort`,type:`range`,min:0,max:r.length-1,step:1,disabled:e,value:r.indexOf(n.effort),"aria-valuetext":n.effort,style:{"--effort-progress":`${r.indexOf(n.effort)/(r.length-1)*100}%`},onInput:e=>t({...n,effort:r[Number(e.currentTarget.value)]})}),T(`span`,{className:K.effortEndpoints,children:[w(`span`,{children:`Low`}),w(`span`,{children:`Max`})]})]})]}):null]})})}function Ye({controls:e}){return T(`div`,{"aria-label":`Development controls`,className:K.developmentControls,role:`menu`,children:[T(Z,{children:[w(Q,{immediatelyEnabled:!0,icon:B,requiresConnection:!1,onClick:e.reloadPage,role:`menuitem`,children:`Reload page`}),w(Q,{busy:e.pending,immediatelyEnabled:!0,icon:_e,onClick:e.restartVite,primary:!0,role:`menuitem`,children:e.pending?`Restarting Vite…`:`Restart Vite`}),w(Q,{busy:e.resetPending,disabledReason:e.resetDisabledReason??(e.resetBranches?void 0:`No active merge or rebase to reset`),immediatelyEnabled:!0,icon:_e,onClick:()=>e.resetBranches?.(),role:`menuitem`,children:e.resetPending?`Resetting branches…`:`Reset branches`})]}),e.error?T(C,{children:[w(`div`,{className:K.actionError,role:`alert`,children:w(dt,{children:`Vite restart failed: ${e.error}`})}),w(Z,{children:w(Q,{ariaLabel:`Dismiss restart error`,icon:be,iconOnly:!0,immediatelyEnabled:!0,onClick:e.dismissError,role:`menuitem`,children:`Dismiss`})})]}):null,e.success?T(`div`,{className:K.actionSuccess,role:`status`,children:[w(oe,{"aria-hidden":`true`,className:K.successIcon,size:18}),w(`p`,{className:K.paragraph,children:e.success})]}):null]})}function Xe(e){return e.state===`cancelled`?`Update cancelled`:e.state===`failed`?`Update failed`:e.state===`interrupted`?`Update interrupted`:e.state===`succeeded`?`Update complete`:e.state===`cancelling`?e.cancellationDeferred?`Finishing publication before stopping…`:`Cancelling update…`:o[e.phase]}function Ze({status:e,operation:t,codex:n,onInspect:r}){let i=y(null),a=t.source===`dev`?`local dev`:`upstream`,o=t.progress?.applied,s=t.steps.filter(e=>e.status===`succeeded`),c=t.steps.filter(e=>e.status!==`succeeded`),l=!!(e.checks?.commands.length&&e.checks.commit===e.currentCommit&&e.checks.commands.every(e=>e.status===`passed`)),u=s.some(e=>e.phase===`setup`);return T(`div`,{className:K.completionReceipt,children:[T(`div`,{role:`status`,children:[T(`p`,{className:K.paragraph,children:[t.kind===`rebase`?`Rebased onto ${a}.`:`Changes applied from ${a}.`,o===void 0?``:` ${o} commit${o===1?``:`s`} ${t.kind===`rebase`?`replayed`:`applied`}.`,t.progress?.skipped?` ${t.progress.skipped} skipped.`:``]}),l?w(`p`,{className:K.completionNote,children:u?`Setup and checks passed.`:`Project checks passed.`}):null]}),T(`details`,{className:K.completionDetails,onToggle:e=>{e.currentTarget.open&&r?.()},children:[w(`summary`,{className:K.codexHistorySummary,style:q,children:`Details`}),T(`div`,{className:K.completionDetailBody,children:[T(`div`,{className:K.completionMetadata,children:[T(`span`,{children:[t.kind===`rebase`?`Rebase`:t.kind===`merge`?`Merge`:`Sync`,` `,`· `,a,` `,w(`code`,{children:t.target.slice(0,12)})]}),w(`span`,{children:X(Math.floor(((t.finishedAt??t.updatedAt)-t.startedAt)/1e3))})]}),s.length?w(`table`,{className:K.completionSteps,"aria-label":`Completed update steps`,children:w(`tbody`,{children:s.map(e=>T(`tr`,{children:[w(`td`,{children:w(z,{"aria-label":`Succeeded`,size:14})}),w(`td`,{children:e.label}),w(`td`,{children:e.finishedAt===void 0?``:X(Math.floor((e.finishedAt-e.startedAt)/1e3))})]},e.id))})}):null,c.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Earlier attempts (`,c.length,`)`]}),c.map(e=>T(`p`,{className:K.completionNote,children:[e.label,` ·`,` `,e.status===`running`?`No final status recorded`:e.status===`failed`?`Failed attempt`:`Interrupted attempt`]},e.id))]}):null,t.turns.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Conflict resolution history · `,t.turns.length,` turns`]}),w($e,{outputRef:i,turns:t.turns,messages:n?.messages??[],stage:n?.stage??`resolve`,working:!1,historyTruncated:t.historyTruncated})]}):null,T(`details`,{children:[w(`summary`,{className:K.codexHistorySummary,style:q,children:`Logs and operation ID`}),w(`p`,{className:K.completionNote,children:w(`code`,{children:t.id})}),w(et,{activities:t.activities})]})]})]})]})}function Qe({operation:e}){let t=e.progress;return T(`section`,{"aria-label":`Update progress`,className:K.activityList,children:[e.kind===`rebase`&&t?.total?w(it,{rebased:t.applied,total:t.total}):null,t?.skipped?T(`p`,{className:K.activityMeta,children:[t.skipped,` skipped`,t.remaining===void 0?``:` · ${t.remaining} remaining`]}):null,t?.current?T(`p`,{className:K.paragraph,children:[w(`code`,{children:t.current.shortCommit}),` `,t.current.subject]}):null,t?.files?.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Conflicted files (`,t.files.length,`)`]}),w(`div`,{className:K.files,children:t.files.map(e=>w(`span`,{className:K.filePath,children:e},e))})]}):null,e.message?w(`p`,{className:K.paragraph,role:`status`,children:e.state===`succeeded`?`Update complete.`:e.message}):null,e.steps.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Steps (`,e.steps.length,`)`]}),T(`p`,{className:K.activityMeta,children:[e.kind,` · `,e.source,` `,w(`code`,{children:e.target.slice(0,12)}),` · #`,e.id.slice(0,8)]}),[...e.steps].sort((e,t)=>e.startedAt-t.startedAt).map(e=>T(`p`,{className:K.paragraph,children:[e.label,` `,T(`span`,{className:K.activityStatus,children:[w(rt,{status:e.status}),e.finishedAt===void 0?null:X(Math.floor((e.finishedAt-e.startedAt)/1e3))]})]},e.id))]}):null]})}function $e({turns:e,historyTruncated:t,completion:n,messages:r,outputRef:i,stage:a,startedAt:o,working:s}){let c=n?[...r].reverse().find(e=>e.kind===`agent`&&e.text===n.finalMessage):[...r].reverse().find(e=>e.kind!==`user`),l=r.filter(e=>e!==c),u=e?.slice(0,-1)??[],d=n?c??{author:[...r].reverse().find(e=>e.kind===`agent`)?.author,kind:`agent`,text:n.finalMessage}:c,f=c?`message-${r.lastIndexOf(c)}`:`completion`;return T(`div`,{"aria-live":n?void 0:`polite`,className:K.codexTranscript,ref:i,role:`log`,children:[d?w(at,{message:d,showAge:!0},f):null,s?T(`div`,{className:K.codexWorking,role:`status`,"aria-label":a===`verify`?`Codex is verifying the update`:`Codex is resolving conflicts`,children:[w(he,{"aria-hidden":`true`,className:K.buttonSpinner,size:14}),w(nt,{startedAt:o})]}):null,l.length||u.length||t?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`History (`,l.length+u.length,`)`]}),T(`div`,{className:K.codexHistoryList,children:[t?w(`p`,{className:K.codexWaiting,children:`Earlier output truncated to limit transcript size.`}):null,u.map((e,t)=>T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[e.stage===`verify`?`Verification`:`Resolution`,` `,t+1,` ·`,` `,w(rt,{status:e.status===`complete`?`succeeded`:e.status})]}),e.messages.map((e,t)=>w(at,{message:e},t))]},e.id)),l.map((e,t)=>w(at,{message:e},t))]})]}):null]})}function et({activities:e}){let t=e.filter(e=>e.status===`running`),n=e.filter(e=>[`failed`,`cancelled`,`interrupted`].includes(e.status)),r=e.filter(e=>e.status===`succeeded`);return e.length?T(`section`,{className:K.activityList,"aria-label":`Activity`,children:[[...t,...n].map(e=>w(tt,{activity:e},e.id)),r.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Recent activity (`,r.length,`)`]}),r.slice().reverse().map(e=>w(tt,{activity:e},e.id))]}):null]}):null}function tt({activity:e}){let[t,n]=b(Date.now);g(()=>{if(e.status!==`running`)return;let t=globalThis.setInterval(()=>n(Date.now()),1e3);return()=>globalThis.clearInterval(t)},[e.status]);let r=Math.max(0,Math.floor(((e.finishedAt??t)-e.startedAt)/1e3));return T(`details`,{className:K.activityRow,open:e.status===`failed`,children:[T(`summary`,{className:K.activitySummary,style:q,children:[w(ae,{"aria-hidden":`true`,className:K.activityDisclosure,size:14}),w(`span`,{children:e.label}),T(`span`,{className:K.activityStatus,children:[w(rt,{status:e.status}),X(r)]})]}),e.command?w(`code`,{className:K.activityCommand,children:e.command}):null,T(`p`,{className:K.activityMeta,children:[e.source===`codex`?`Codex`:`Supervisor`,e.stage?` · ${e.stage}`:``,e.exitCode===void 0?``:` · Exit code ${e.exitCode}`]}),e.output?w(`pre`,{className:K.activityOutput,children:e.output}):null]})}function nt({startedAt:e}){let[t]=b(Date.now),[n,r]=b(Date.now);return g(()=>{let e=globalThis.setInterval(()=>r(Date.now()),1e3);return()=>globalThis.clearInterval(e)},[]),T(C,{children:[`Working for `,X(Math.max(0,Math.floor((n-(e??t))/1e3))),`...`]})}function rt({status:e}){let t=e===`running`?he:e===`succeeded`?oe:e===`failed`?ye:se;return w(`span`,{className:K.activityState,"data-status":e,role:`img`,"aria-label":e,title:e,children:w(t,{"aria-hidden":`true`,className:e===`running`?K.buttonSpinner:void 0,size:15})})}function it({rebased:e,total:t}){let n=Math.min(e,t),r=Math.round(n/t*100);return T(`section`,{"aria-label":`Rebase progress`,className:K.rebaseProgress,children:[T(`div`,{className:K.rebaseProgressLabel,children:[T(`strong`,{children:[n,` of `,t,` commits rebased`]}),T(`span`,{children:[r,`%`]})]}),w(`div`,{"aria-valuemax":t,"aria-valuemin":0,"aria-valuenow":n,className:K.rebaseProgressTrack,role:`progressbar`,children:w(`span`,{className:K.rebaseProgressFill,style:{width:`${r}%`}})})]})}function at({message:e,showAge:t=!1}){let n=e.kind===`user`?`Request`:e.kind===`thought`?`Thought`:e.author??`Codex`;return T(`section`,{className:K.codexMessage,children:[T(`div`,{className:K.codexMessageHeader,children:[w(`h3`,{className:K.codexMessageLabel,children:n}),t?w(ot,{}):null]}),w(`p`,{className:K.codexMessageText,children:e.text})]})}function ot(){let e=y(0),[t,n]=b(0);return g(()=>{e.current=Date.now();let t=globalThis.setInterval(()=>{n(Math.floor((Date.now()-e.current)/1e3))},1e3);return()=>globalThis.clearInterval(t)},[]),T(`span`,{"aria-hidden":`true`,className:K.codexMessageAge,children:[X(t),` ago`]})}function X(e){let t=Math.floor(e/60),n=e%60;return t>0?`${t}m ${n}s`:`${n}s`}function st({status:e}){let[t,n,r]=e===`??`?[`U`,`Untracked`,`added`]:e.includes(`U`)||e===`AA`||e===`DD`?[`!`,`Conflict`,`deleted`]:e.includes(`R`)?[`R`,`Renamed`,`renamed`]:e.includes(`C`)?[`C`,`Copied`,`renamed`]:e.includes(`D`)?[`D`,`Deleted`,`deleted`]:e.includes(`A`)?[`A`,`Added`,`added`]:e.includes(`T`)?[`T`,`Type changed`,`modified`]:[`M`,`Modified`,`modified`];return w(`span`,{className:K.fileStatus,"data-tone":r,title:n,"aria-label":n,children:t})}function ct({checked:e,indeterminate:t=!1,label:n,onChange:r}){let i=y(null);return g(()=>{i.current&&(i.current.indeterminate=t)},[t]),T(`label`,{className:K.checkbox,children:[w(`input`,{ref:i,checked:e,onChange:e=>r(e.target.checked),type:`checkbox`}),n]})}const lt=u(void 0);function ut({children:e}){return w(`div`,{className:K.content,children:e})}function Z({children:e}){let t=h(lt);return t===void 0?w(`div`,{className:K.actions,children:e}):t?S(e,t):null}function dt({children:e}){return T(`div`,{className:K.errorMessage,children:[w(ye,{"aria-hidden":`true`,className:K.errorIcon,size:18}),w(`p`,{className:K.paragraph,children:e})]})}function Q({requiresConnection:e=!0,ariaLabel:t,busy:n,children:r,disabledReason:i,icon:a,iconOnly:o=!1,immediatelyEnabled:s=!1,onClick:c,primary:l=!1,role:u}){let d=h(ke),f=i??(!d&&e?`Connection lost; wait for reconnection`:void 0),[p,m]=b(!0),[v,y]=b(),x=_(),C=f?`Please wait: ${f.replace(/[.\u2026]+$/,``)}.`:n?`Waiting for ${t??(typeof r==`string`?`“${r}”`:`this action`)} to finish.`:p&&!s?`Enabled in a moment to prevent accidental clicks.`:void 0;g(()=>{let e=globalThis.setTimeout(()=>m(!1),1e3);return()=>globalThis.clearTimeout(e)},[]);let E=e=>{let t=e.getBoundingClientRect(),n=e.closest(`[data-isolet-root]`);n&&y({left:Math.max(12,Math.min(t.left,window.innerWidth-292)),top:t.top-8,root:n})};return T(`span`,{"aria-describedby":C?x:void 0,"aria-label":C?t??(typeof r==`string`?r:void 0):void 0,className:K.buttonContainer,onBlur:()=>y(void 0),onFocus:e=>E(e.currentTarget),onKeyDown:e=>{e.key===`Escape`&&C&&v&&(e.stopPropagation(),y(void 0))},onMouseEnter:e=>E(e.currentTarget),onMouseLeave:()=>y(void 0),onPointerDown:e=>{C&&e.currentTarget.focus()},tabIndex:C?0:void 0,children:[T(`button`,{"aria-label":t,"aria-busy":!!n,"aria-describedby":C?x:void 0,className:`${K.button} ${o?K.iconOnly:``} ${l?K.primary:``}`,disabled:!!C,onClick:c,role:u,title:!C&&o?t:void 0,type:`button`,children:[n?w(he,{"aria-hidden":`true`,className:K.buttonSpinner,size:16}):a?w(a,{"aria-hidden":`true`,size:16}):null,o?null:r]}),C?w(`span`,{className:K.srOnly,id:x,children:C}):null,C&&v?S(w(`span`,{className:K.disabledTooltip,role:`tooltip`,style:{left:v.left,top:v.top},children:C}),v.root):null]})}function ft(e){return e?e.mode===`waiting`&&e.message?`Sync paused`:e.mode===`unmanaged`?`Sync unavailable`:e.mode===`error`?`Sync stopped`:e.setupFailure?.stage===`dependencies`?`Dependency installation failed`:e.setupFailure?.stage===`codegen`?`Panda codegen failed`:e.setupFailure?.stage===`migration`?`Database setup failed`:e.draft?e.proposal===void 0?`Review local changes`:`Confirm your commit`:e.pendingRebase?`Resolve update conflicts`:e.target?.source===`upstream`?`Refresh from upstream`:String(e.target?.source)===`dev`?`Sync with dev`:e.target?`Sync with main`:e.checks?.commands.some(e=>e.status===`failed`&&!e.dismissed)?`Checks failed`:e.warnings.length>0?`Warning`:`Managed development`:`Managed development`}function pt({codex:e,completion:t,status:r,success:i}){return e?.phase===`running`||r?.operation&&n(r.operation)?he:e?.phase===`error`?ye:t?oe:e?he:r?.setupFailure?.stage===`migration`?de:r?.setupFailure?.stage===`dependencies`?ge:r?.setupFailure?.stage===`codegen`?B:r?.draft?pe:r?.pendingRebase?ve:r?.target?.source===`upstream`?le:r?.target?B:r?.checks?.commands.some(e=>e.status===`failed`&&!e.dismissed)?me:i?oe:r?r.mode===`waiting`?ce:r.mode===`unmanaged`?se:r.mode===`error`||r.warnings.length>0?ye:oe:B}function mt(e){return e.mode===`waiting`?`Waiting for the supervisor to start.`:e.mode===`unmanaged`?`Managed development is unavailable for this session.`:e.mode===`error`?`The managed development supervisor stopped.`:e.draft&&!e.target?`Review which local changes to include.`:e.pendingRebase?`The update stopped on a conflict.`:e.target&&e.target.source!==`upstream`?String(e.target?.source)===`dev`?`New commits are available on dev.`:`New commits are available on main.`:e.target?`A newer upstream commit is ready.`:``}function ht(e,t,n){let r=[t,n?.phase===`error`?n.requestId:void 0,e?.mode===`error`||e?.mode===`unmanaged`?e.mode:void 0,e?.message,e?.setupFailure,e?.warnings.length?e.warnings:void 0];return r.some(Boolean)?JSON.stringify(r):void 0}function gt(e,t){return JSON.stringify([e,t.command,t.output])}function _t(e){return e?.mode===`error`&&e.message?.startsWith(s)===!0}function vt(e){return e?.message?.startsWith(c)===!0}function yt(e){return e.mode!==`managed`||!!(e.busy||e.codexCompletion||e.draft||e.message||e.pendingRebase||e.setupFailure||e.codexRetry||e.devAlignment||e.fetchFailure||e.target||e.warnings.length>0)}function bt(e){if(!e?.checks||yt(e))return;let t=e.checks.commands.find(e=>e.status===`failed`&&!e.dismissed);return t?{check:t,commit:e.checks.commit,trigger:e.checks.trigger}:void 0}function xt({commit:e,trigger:t}){let n=e.slice(0,12);return t===`check-recovery`?`Reran against the current working tree at commit ${n}.`:t===`codegen-recovery`?`Ran after Panda codegen recovered at commit ${n}.`:t===`dependency-recovery`?`Ran after dependency installation recovered at commit ${n}.`:t===`database-recovery`?`Ran after database setup recovered at commit ${n}.`:`Ran after the update was applied at commit ${n}.`}function St({status:e,codex:t,error:n,success:r,pendingAction:i,controls:a}){return!!($(e)||e?.operation?.state===`succeeded`||t||n||r||i||a?.pending||a?.error||a?.success||e?.activities?.some(e=>e.status!==`succeeded`))}function $(e,t=bt(e)){return e?e.mode===`waiting`?!!e.message:e.operation?.state===`succeeded`?!!(t||e.codexCompletion||e.codexRetry||e.devAlignment||e.fetchFailure||e.setupFailure||e.pendingRebase||e.draft||e.target||e.busy||e.warnings.length||e.mode!==`managed`):!!(e.operation||t||yt(e)):!1}function Ct(e){let t=new Set(e.filter(e=>e.kind===`user`)),n=[...t].reduce((e,t)=>e+t.text.length,0),r=!1;for(let i of[...e].reverse())if(i.kind!==`user`){if(n+i.text.length>1e5&&r)break;t.add(i),r=!0,n+=i.text.length}return e.filter(e=>t.has(e))}function wt(e){return[e.message,`Commit: ${e.commit}`,`Command: ${e.command}`,``,e.output].join(`
195
- `)}function Tt(){let[t,n]=b(),[r,i]=b(!1),[a,o]=b(),s=xe(),c=y(void 0);return g(()=>{if(!s)return;let t=e=>{if(e.requestId===c.current){if(e.state===`busy`){i(!0);return}if(c.current=void 0,i(!1),e.state===`error`){o(void 0),n(e.error??`The Vite restart failed.`);return}n(void 0),o(`Vite restarted.`)}},r=()=>{c.current&&(c.current=void 0,i(!1),o(void 0),n(`The connection was interrupted during the restart. Reconnect before trying again.`))};return s.on(e.actionResult,t),s.on(Se.disconnect,r),()=>{s.off(e.actionResult,t),s.off(Se.disconnect,r)}},[s]),{dismissError:()=>n(void 0),error:t,pending:r,reloadPage:()=>globalThis.location.reload(),restartVite:()=>{if(r)return;if(n(void 0),o(void 0),!s){n(`The Vite HMR connection is unavailable.`);return}let t=globalThis.crypto.getRandomValues(new Uint32Array(4)).join(`-`);c.current=t,i(!0),s.send(e.action,{action:{type:`restart-vite`},requestId:t})},success:a}}function Et(e){return e.type===`reset-branches`?{heading:`Branches reset`,message:`Restored main and dev to their pre-integration commits.`}:e.type===`retry-codex`?{heading:`Refresh complete`,message:`The failed Codex stage completed and synchronization continued.`}:e.type===`retry-migration`?{heading:`Migration complete`,message:`Database migration completed and project checks resumed.`}:e.type===`retry-checks`?{heading:`Checks complete`,message:`The requested checks passed.`}:e.type===`retry-dev-alignment`?{heading:`Dev aligned`,message:`Dev now uses the synchronized main history.`}:e.type===`retry-fetch`?{heading:`Fetch complete`,message:`Checked for upstream updates.`}:e.type===`apply`?{heading:`Refresh complete`,message:`Your changes were committed and the project is up to date.`}:e.type===`prepare`?{heading:`Refresh complete`,message:`Your project is up to date.`}:e.type===`commit`?{heading:`Changes committed`,message:`Your local changes are committed. Checking for updates…`,preserveDuringStatus:!0}:e.type===`reject`?{heading:`Update dismissed`,message:`No further action needed.`}:e.type===`configure-codex`?{heading:`Codex preferences saved`,message:`Future Codex runs will use this model and effort.`}:e.type===`decline-rebase`?{heading:`Conflict resolution deferred`,message:`Applied changes stay on your branch. The remaining commits can be resolved later.`}:e.type===`resolve-rebase`?{heading:`Refresh complete`,message:`Codex resolved the remaining conflicts and the project is up to date.`}:e.type===`retry-install`?{heading:`Setup complete`,message:`Dependencies installed and the project is ready.`}:e.type===`retry-codegen`?{heading:`Codegen complete`,message:`Panda codegen finished.`}:e.type===`reset-database`?{heading:`Database reset complete`,message:`The database was recreated, migrated, and seeded.`}:e.type===`retry-supervisor`?{heading:`Reconnected`,message:`The supervisor is connected again.`}:e.type===`cancel-codex`?{heading:`Update cancelled`,message:`Codex conflict resolution cancelled.`}:{heading:`Action complete`,message:`No further action needed.`}}function Dt(e){let t=e.turns.at(-1);if(t)return{commits:[],messages:t.finalMessage&&!t.messages.some(e=>e.kind===`agent`&&e.text===t.finalMessage)?[...t.messages,{kind:`agent`,text:t.finalMessage}]:t.messages,phase:e.state===`failed`||e.state===`interrupted`?`error`:t.status===`running`&&n(e)?`running`:`complete`,requestId:e.requestIds.at(-1)??e.id,startedAt:Math.min(...e.turns.map(e=>e.startedAt)),stage:t.stage,totalCommits:e.progress?.total}}function Ot(){let[e,t]=b(),[r,i]=b(),[o,s]=b(!1),[c,l]=b(),[u,d]=b(),[f,p]=b(Oe),[h,_]=b(),[v,x]=b({dismissed:!1}),[S,C]=b(()=>new Set),w=y(void 0),T=y(void 0),E=y(new Map),D=Ce(),[O]=b(Ae),k=y(void 0),A=y(new Set),j=y(void 0),M=ht(e,r,u),N=!!(M&&M===v.key&&v.dismissed);M!==v.key&&x({key:M,dismissed:!1});let P=e?.checks&&S.size>0?{...e,checks:{...e.checks,commands:e.checks.commands.map(t=>!t.failureId&&S.has(gt(e.checks.commit,t))?{...t,dismissed:!0}:t)}}:e;g(()=>{if(!D)return;let e=E.current,r=e=>{try{D.send(a.diagnostic,e)}catch{}},o,c=Date.now(),u=()=>{try{e.size?D.send(a.statusRequest,{clientId:O,requestIds:[...e.keys()]}):D.send(a.statusRequest)}catch{s(!1)}},f=()=>{r({type:`connected`}),s(!1),u()},m=()=>{r({type:`disconnected`}),s(!1),o=void 0},h=({status:a})=>{let u=k.current,f=a;if(f.trace&&u?.trace){if(f.trace.sessionId===u.trace.sessionId&&f.trace.revision<u.trace.revision||A.current.has(f.trace.sessionId))return!1;f.trace.sessionId!==u.trace.sessionId&&(A.current.add(u.trace.sessionId),A.current.size>8&&A.current.delete(A.current.values().next().value))}vt(f)&&!f.operation&&u?.operation&&(f={...f,operation:u.operation,activities:u.activities,trace:u.trace}),k.current=f,c=Date.now();let m=JSON.stringify([f.trace,f.mode,f.busy]);m!==o&&(o=m,r({type:`status-received`,sessionId:f.trace?.sessionId,revision:f.trace?.revision,requestId:f.trace?.operationId,busy:!!f.busy}));let h=$(f),g=vt(f);if((f.mode===`unmanaged`&&u?.mode!==`unmanaged`||f.mode===`waiting`&&f.message&&!g&&(u?.mode!==`waiting`||!u.message||vt(u)))&&Y(!0),g&&(i(void 0),l(void 0)),f.operation){n(f.operation)&&j.current!==f.operation.id&&(j.current=f.operation.id,Y(!0));let t=g?void 0:Dt(f.operation);w.current=t,d(t);for(let[t,r]of e){let i=!n(f.operation);(f.operation.requestIds.includes(t)&&i||r.type===`cancel-codex`&&(f.operation.cancellation===`requested`||i))&&e.delete(t)}_([...e.values()].at(-1))}else u?.operation&&(w.current=void 0,d(void 0));s(!0),t(f),f.codexOptions&&p(e=>({...e,...f.codexOptions})),f.codexCompletion&&T.current!==f.codexCompletion.id&&(T.current=f.codexCompletion.id,Y(!0));let v=!f.busy&&!f.codexCompletion?[...e.entries()].filter(([,e])=>e.type===`acknowledge-codex`||e.type===`acknowledge-operation`).map(([e])=>e):[];if(v.length>0){for(let t of v)e.delete(t);_([...e.values()].at(-1)),l(void 0),h||Y(!1)}return h&&l(e=>e?.preserveDuringStatus?e:void 0),!0},g=t=>{if(r({type:`action-result-received`,requestId:t.requestId,sessionId:t.status?.trace?.sessionId,revision:t.status?.trace?.revision,busy:!!t.status?.busy,pending:e.has(t.requestId)}),t.errorCode===`UNKNOWN_REQUEST`&&k.current?.operation?.requestIds.includes(t.requestId))return;let n=t.status?h({status:t.status}):!0,a=e.get(t.requestId);if(a&&(e.delete(t.requestId),_([...e.values()].at(-1)),n)){if(a.type===`decline-rebase`&&!t.error&&t.status?.pendingRebase){Y(!1),l(void 0);return}if(t.status?.operation){l(void 0),t.error&&!t.status.operation.requestIds.includes(t.requestId)&&i(t.error);return}t.error?(w.current?.requestId===t.requestId&&(w.current=void 0,d(void 0)),i(t.error),a.type===`acknowledge-codex`&&Y(!0)):t.status?.codexCompletion?(T.current=t.status.codexCompletion.id,w.current=void 0,d(void 0),l(void 0),Y(!0)):a.type===`acknowledge-codex`?(l(void 0),t.status&&!$(t.status)&&Y(!1)):a.type===`dismiss-check`||a.type===`configure-codex`||a.type===`cancel-codex`?l(void 0):t.status&&(a.type===`commit`||!$(t.status))&&l(Et(a))}},v=t=>{if(k.current?.operation||t.phase===`activity`||!e.has(t.requestId))return;if(t.phase===`start`){let e={commits:t.commits,messages:[t.message],phase:`running`,requestId:t.requestId,stage:t.stage??`resolve`,startedAt:w.current?.requestId===t.requestId?w.current.startedAt??Date.now():Date.now(),totalCommits:t.totalCommits};w.current=e,d(e),Y(!0);return}let n=w.current;if(!n||n.requestId!==t.requestId)return;let r=t.phase===`message`?{...n,messages:Ct([...n.messages,t.message]),phase:t.stage!==void 0&&t.stage!==n.stage?`running`:n.phase,stage:t.stage??n.stage}:t.phase===`complete`?{commits:n.commits,messages:n.messages,phase:`complete`,requestId:t.requestId,stage:t.stage??n.stage,startedAt:n.startedAt,totalCommits:n.totalCommits}:t.phase===`progress`?{...n,commits:t.commits,stage:t.stage??n.stage,totalCommits:t.totalCommits??n.totalCommits}:{...n,phase:`error`};w.current=r,d(r)};D.on(Se.connect,f),D.on(Se.disconnect,m),D.on(a.status,h),D.on(a.actionResult,g),D.on(a.codex,v),u();let y=globalThis.setInterval(()=>{(n(k.current?.operation)||e.size>0)&&(Date.now()-c>1e4&&s(!1),u())},1e3),b=()=>{document.visibilityState!==`hidden`&&(Date.now()-c>1e4&&s(!1),u())},x=kt(()=>{At()&&u()});return globalThis.addEventListener(`online`,b),globalThis.addEventListener(`focus`,b),globalThis.addEventListener(`pageshow`,b),document.addEventListener(`visibilitychange`,b),()=>{globalThis.clearInterval(y),x(),globalThis.removeEventListener(`online`,b),globalThis.removeEventListener(`focus`,b),globalThis.removeEventListener(`pageshow`,b),document.removeEventListener(`visibilitychange`,b),D.off(Se.connect,f),D.off(Se.disconnect,m),D.off(a.status,h),D.off(a.actionResult,g),D.off(a.codex,v)}},[D,O]);let F=async e=>{if(e.type===`acknowledge-codex`&&(T.current=e.id),i(void 0),x({key:M,dismissed:!1}),l(void 0),e.type!==`cancel-codex`&&(w.current=void 0,d(void 0)),!D||!o){i(`The Vite HMR connection is unavailable. Wait for reconnection before trying again.`);return}let t=globalThis.crypto.getRandomValues(new Uint32Array(4)).join(`-`);E.current.set(t,e),_(e),D.send(a.action,{clientId:O,action:e,requestId:t})},ee=m(()=>l(void 0),[]);return{act:F,checkFailure:(!r||N)&&!c&&(!u||N&&u.phase===`error`||e?.operation?.state===`failed`)&&(!e?.codexCompletion||e?.operation?.state===`failed`)?bt(P):void 0,codex:u,codexOptions:f,dismissCheckFailure:e=>{if(!e.check.failureId){C(t=>new Set(t).add(gt(e.commit,e.check)));return}F({failureId:e.check.failureId,type:`dismiss-check`})},dismissError:()=>x({key:M,dismissed:!0}),dismissSuccess:ee,error:r,errorsDismissed:N,hmrReady:o,pendingAction:h,setCodexOptions:p,status:P,success:c}}function kt(e){return Me.add(e),()=>Me.delete(e)}function At(){return je}function jt(){return!1}export{Le as ManagedDevOverlay,Be as ManagedDevOverlayDebug,Ke as ManagedDevOverlayIndicator,Ie as toggleManagedDevOverlay};
194
+ `)}):null,w(Je,{disabled:!!_.busy,onChange:re,value:a}),T(Z,{children:[w(Q,{busy:m?.type===`decline-rebase`,disabledReason:_.busy,icon:be,onClick:()=>void t({type:`decline-rebase`}),children:`Decline`}),w(Q,{busy:m?.type===`resolve-rebase`,disabledReason:_.busy,icon:ve,onClick:()=>void t({codex:a,type:`resolve-rebase`}),primary:!0,children:`Resolve with Codex`})]})]}):F&&_&&N?T(C,{children:[w(Je,{disabled:!!_.busy,onChange:re,value:a}),w(Z,{children:w(Q,{busy:m?.type===`prepare`,disabledReason:_.busy,icon:B,onClick:()=>void t({type:`prepare`,target:N.commit,codex:a}),primary:!0,children:N.source===`upstream`?`Refresh`:String(N.source)===`dev`?`Sync with dev`:`Sync with main`})})]}):null,ee&&!u&&!l&&!(F&&_?.setupFailure)?w(Z,{children:w(Q,{ariaLabel:`Dismiss error`,icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:c,children:`Dismiss`})}):null,k&&n(k)?w(Z,{children:w(Q,{ariaLabel:`Cancel update`,busy:m?.type===`cancel-codex`||k.cancellation===`requested`,disabledReason:_?.mode===`managed`?k.cancellation===`unavailable`?`Finishing the current step`:void 0:`Reconnecting`,immediatelyEnabled:!0,icon:be,onClick:()=>void t({type:`cancel-codex`,operationId:k.id}),children:k.cancellation===`requested`?k.cancellationDeferred?`Finishing publication…`:`Cancelling…`:m?.type===`cancel-codex`?`Requesting cancellation…`:`Cancel update`})}):null,!A&&!v&&!j&&!N&&!M&&!n(k)&&!_?.busy&&!(!k&&P&&P.phase!==`error`)&&!(ee&&!u)&&!(F&&_?.setupFailure&&!u)&&(k||_?.message||_?.warnings.length||_&&_.mode!==`managed`)?w(Z,{children:w(Q,{icon:z,immediatelyEnabled:!0,requiresConnection:!1,onClick:f,children:`Dismiss`})}):null]})})}function Je({disabled:e=!1,onChange:t,value:n}){let[a,o]=b(!1),[s,c]=b({top:0,left:0}),l=y(null),u=y(null),d=_(),f=y(null);v(()=>{let e=u.current?.getBoundingClientRect();if(a&&e&&f.current){let t=f.current.getBoundingClientRect().height;c({top:e.bottom+8+t<=window.innerHeight-8?e.bottom+8:Math.max(8,e.top-t-8),left:Math.max(8,Math.min(e.left,window.innerWidth-228))})}},[a]);let p=()=>{if(a)return;let e=u.current?.getBoundingClientRect();e&&c({top:Math.max(8,e.top-190),left:Math.max(8,Math.min(e.left,window.innerWidth-228))}),o(!0)};return g(()=>{if(!a)return;let e=e=>{l.current&&!e.composedPath().includes(l.current)&&o(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[a]),w(Z,{children:T(`div`,{className:K.codexSettings,ref:l,onMouseEnter:p,onMouseLeave:e=>{e.currentTarget.matches(`:focus-within`)||o(!1)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o(!1)},onKeyDown:e=>{e.key===`Escape`&&a&&(e.stopPropagation(),o(!1),u.current?.focus())},children:[w(`button`,{type:`button`,ref:u,className:K.iconButton,"aria-label":`Codex settings: ${n.model===`gpt-6.1-sol`?`Sol`:`Luna`}, ${n.effort} effort`,"aria-expanded":a,"aria-controls":d,"aria-haspopup":`dialog`,onClick:p,children:w(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`currentColor`,fillRule:`evenodd`,children:w(`path`,{d:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`})})}),a?T(`div`,{role:`dialog`,ref:f,"aria-label":`Codex settings`,id:d,className:K.codexSettingsPopover,style:s,children:[w(`span`,{className:K.sectionTitle,children:`Conflict resolution`}),w(`div`,{role:`group`,"aria-label":`Codex model`,className:K.modelToggle,children:i.map(r=>w(`button`,{type:`button`,"aria-pressed":n.model===r,disabled:e,onClick:()=>t({...n,model:r}),children:r===`gpt-6.1-sol`?`Sol`:`Luna`},r))}),T(`label`,{className:K.effortControl,children:[T(`span`,{children:[`Effort`,` `,w(`strong`,{children:{low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra high`,max:`Max`}[n.effort]})]}),w(`input`,{"aria-label":`Reasoning effort`,type:`range`,min:0,max:r.length-1,step:1,disabled:e,value:r.indexOf(n.effort),"aria-valuetext":n.effort,style:{"--effort-progress":`${r.indexOf(n.effort)/(r.length-1)*100}%`},onInput:e=>t({...n,effort:r[Number(e.currentTarget.value)]})}),T(`span`,{className:K.effortEndpoints,children:[w(`span`,{children:`Low`}),w(`span`,{children:`Max`})]})]})]}):null]})})}function Ye({controls:e}){return T(`div`,{"aria-label":`Development controls`,className:K.developmentControls,role:`menu`,children:[T(Z,{children:[w(Q,{immediatelyEnabled:!0,icon:B,requiresConnection:!1,onClick:e.reloadPage,role:`menuitem`,children:`Reload page`}),w(Q,{busy:e.pending,immediatelyEnabled:!0,icon:_e,onClick:e.restartVite,primary:!0,role:`menuitem`,children:e.pending?`Restarting Vite…`:`Restart Vite`}),w(Q,{busy:e.resetPending,disabledReason:e.resetDisabledReason??(e.resetBranches?void 0:`No active merge or rebase to reset`),immediatelyEnabled:!0,icon:_e,onClick:()=>e.resetBranches?.(),role:`menuitem`,children:e.resetPending?`Resetting branches…`:`Reset branches`})]}),e.recovery,e.error?T(C,{children:[w(`div`,{className:K.actionError,role:`alert`,children:w(dt,{children:`Vite restart failed: ${e.error}`})}),w(Z,{children:w(Q,{ariaLabel:`Dismiss restart error`,icon:be,iconOnly:!0,immediatelyEnabled:!0,onClick:e.dismissError,role:`menuitem`,children:`Dismiss`})})]}):null,e.success?T(`div`,{className:K.actionSuccess,role:`status`,children:[w(oe,{"aria-hidden":`true`,className:K.successIcon,size:18}),w(`p`,{className:K.paragraph,children:e.success})]}):null]})}function Xe(e){return e.state===`cancelled`?`Update cancelled`:e.state===`failed`?`Update failed`:e.state===`interrupted`?`Update interrupted`:e.state===`succeeded`?`Update complete`:e.state===`cancelling`?e.cancellationDeferred?`Finishing publication before stopping…`:`Cancelling update…`:o[e.phase]}function Ze({status:e,operation:t,codex:n,onInspect:r}){let i=y(null),a=t.source===`dev`?`local dev`:`upstream`,o=t.progress?.applied,s=t.steps.filter(e=>e.status===`succeeded`),c=t.steps.filter(e=>e.status!==`succeeded`),l=!!(e.checks?.commands.length&&e.checks.commit===e.currentCommit&&e.checks.commands.every(e=>e.status===`passed`)),u=s.some(e=>e.phase===`setup`);return T(`div`,{className:K.completionReceipt,children:[T(`div`,{role:`status`,children:[T(`p`,{className:K.paragraph,children:[t.kind===`rebase`?`Rebased onto ${a}.`:`Changes applied from ${a}.`,o===void 0?``:` ${o} commit${o===1?``:`s`} ${t.kind===`rebase`?`replayed`:`applied`}.`,t.progress?.skipped?` ${t.progress.skipped} skipped.`:``]}),l?w(`p`,{className:K.completionNote,children:u?`Setup and checks passed.`:`Project checks passed.`}):null]}),T(`details`,{className:K.completionDetails,onToggle:e=>{e.currentTarget.open&&r?.()},children:[w(`summary`,{className:K.codexHistorySummary,style:q,children:`Details`}),T(`div`,{className:K.completionDetailBody,children:[T(`div`,{className:K.completionMetadata,children:[T(`span`,{children:[t.kind===`rebase`?`Rebase`:t.kind===`merge`?`Merge`:`Sync`,` `,`· `,a,` `,w(`code`,{children:t.target.slice(0,12)})]}),w(`span`,{children:X(Math.floor(((t.finishedAt??t.updatedAt)-t.startedAt)/1e3))})]}),s.length?w(`table`,{className:K.completionSteps,"aria-label":`Completed update steps`,children:w(`tbody`,{children:s.map(e=>T(`tr`,{children:[w(`td`,{children:w(z,{"aria-label":`Succeeded`,size:14})}),w(`td`,{children:e.label}),w(`td`,{children:e.finishedAt===void 0?``:X(Math.floor((e.finishedAt-e.startedAt)/1e3))})]},e.id))})}):null,c.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Earlier attempts (`,c.length,`)`]}),c.map(e=>T(`p`,{className:K.completionNote,children:[e.label,` ·`,` `,e.status===`running`?`No final status recorded`:e.status===`failed`?`Failed attempt`:`Interrupted attempt`]},e.id))]}):null,t.turns.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Conflict resolution history · `,t.turns.length,` turns`]}),w($e,{outputRef:i,turns:t.turns,messages:n?.messages??[],stage:n?.stage??`resolve`,working:!1,historyTruncated:t.historyTruncated})]}):null,T(`details`,{children:[w(`summary`,{className:K.codexHistorySummary,style:q,children:`Logs and operation ID`}),w(`p`,{className:K.completionNote,children:w(`code`,{children:t.id})}),w(et,{activities:t.activities})]})]})]})]})}function Qe({operation:e}){let t=e.progress;return T(`section`,{"aria-label":`Update progress`,className:K.activityList,children:[e.kind===`rebase`&&t?.total?w(it,{rebased:t.applied,total:t.total}):null,t?.skipped?T(`p`,{className:K.activityMeta,children:[t.skipped,` skipped`,t.remaining===void 0?``:` · ${t.remaining} remaining`]}):null,t?.current?T(`p`,{className:K.paragraph,children:[w(`code`,{children:t.current.shortCommit}),` `,t.current.subject]}):null,t?.files?.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Conflicted files (`,t.files.length,`)`]}),w(`div`,{className:K.files,children:t.files.map(e=>w(`span`,{className:K.filePath,children:e},e))})]}):null,e.message?w(`p`,{className:K.paragraph,role:`status`,children:e.state===`succeeded`?`Update complete.`:e.message}):null,e.steps.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Steps (`,e.steps.length,`)`]}),T(`p`,{className:K.activityMeta,children:[e.kind,` · `,e.source,` `,w(`code`,{children:e.target.slice(0,12)}),` · #`,e.id.slice(0,8)]}),[...e.steps].sort((e,t)=>e.startedAt-t.startedAt).map(e=>T(`p`,{className:K.paragraph,children:[e.label,` `,T(`span`,{className:K.activityStatus,children:[w(rt,{status:e.status}),e.finishedAt===void 0?null:X(Math.floor((e.finishedAt-e.startedAt)/1e3))]})]},e.id))]}):null]})}function $e({turns:e,historyTruncated:t,completion:n,messages:r,outputRef:i,stage:a,startedAt:o,working:s}){let c=n?[...r].reverse().find(e=>e.kind===`agent`&&e.text===n.finalMessage):[...r].reverse().find(e=>e.kind!==`user`),l=r.filter(e=>e!==c),u=e?.slice(0,-1)??[],d=n?c??{author:[...r].reverse().find(e=>e.kind===`agent`)?.author,kind:`agent`,text:n.finalMessage}:c,f=c?`message-${r.lastIndexOf(c)}`:`completion`;return T(`div`,{"aria-live":n?void 0:`polite`,className:K.codexTranscript,ref:i,role:`log`,children:[d?w(at,{message:d,showAge:!0},f):null,s?T(`div`,{className:K.codexWorking,role:`status`,"aria-label":a===`verify`?`Codex is verifying the update`:`Codex is resolving conflicts`,children:[w(he,{"aria-hidden":`true`,className:K.buttonSpinner,size:14}),w(nt,{startedAt:o})]}):null,l.length||u.length||t?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`History (`,l.length+u.length,`)`]}),T(`div`,{className:K.codexHistoryList,children:[t?w(`p`,{className:K.codexWaiting,children:`Earlier output truncated to limit transcript size.`}):null,u.map((e,t)=>T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[e.stage===`verify`?`Verification`:`Resolution`,` `,t+1,` ·`,` `,w(rt,{status:e.status===`complete`?`succeeded`:e.status})]}),e.messages.map((e,t)=>w(at,{message:e},t))]},e.id)),l.map((e,t)=>w(at,{message:e},t))]})]}):null]})}function et({activities:e}){let t=e.filter(e=>e.status===`running`),n=e.filter(e=>[`failed`,`cancelled`,`interrupted`].includes(e.status)),r=e.filter(e=>e.status===`succeeded`);return e.length?T(`section`,{className:K.activityList,"aria-label":`Activity`,children:[[...t,...n].map(e=>w(tt,{activity:e},e.id)),r.length?T(`details`,{children:[T(`summary`,{className:K.codexHistorySummary,style:q,children:[`Recent activity (`,r.length,`)`]}),r.slice().reverse().map(e=>w(tt,{activity:e},e.id))]}):null]}):null}function tt({activity:e}){let[t,n]=b(Date.now);g(()=>{if(e.status!==`running`)return;let t=globalThis.setInterval(()=>n(Date.now()),1e3);return()=>globalThis.clearInterval(t)},[e.status]);let r=Math.max(0,Math.floor(((e.finishedAt??t)-e.startedAt)/1e3));return T(`details`,{className:K.activityRow,open:e.status===`failed`,children:[T(`summary`,{className:K.activitySummary,style:q,children:[w(ae,{"aria-hidden":`true`,className:K.activityDisclosure,size:14}),w(`span`,{children:e.label}),T(`span`,{className:K.activityStatus,children:[w(rt,{status:e.status}),X(r)]})]}),e.command?w(`code`,{className:K.activityCommand,children:e.command}):null,T(`p`,{className:K.activityMeta,children:[e.source===`codex`?`Codex`:`Supervisor`,e.stage?` · ${e.stage}`:``,e.exitCode===void 0?``:` · Exit code ${e.exitCode}`]}),e.output?w(`pre`,{className:K.activityOutput,children:e.output}):null]})}function nt({startedAt:e}){let[t]=b(Date.now),[n,r]=b(Date.now);return g(()=>{let e=globalThis.setInterval(()=>r(Date.now()),1e3);return()=>globalThis.clearInterval(e)},[]),T(C,{children:[`Working for `,X(Math.max(0,Math.floor((n-(e??t))/1e3))),`...`]})}function rt({status:e}){let t=e===`running`?he:e===`succeeded`?oe:e===`failed`?ye:se;return w(`span`,{className:K.activityState,"data-status":e,role:`img`,"aria-label":e,title:e,children:w(t,{"aria-hidden":`true`,className:e===`running`?K.buttonSpinner:void 0,size:15})})}function it({rebased:e,total:t}){let n=Math.min(e,t),r=Math.round(n/t*100);return T(`section`,{"aria-label":`Rebase progress`,className:K.rebaseProgress,children:[T(`div`,{className:K.rebaseProgressLabel,children:[T(`strong`,{children:[n,` of `,t,` commits rebased`]}),T(`span`,{children:[r,`%`]})]}),w(`div`,{"aria-valuemax":t,"aria-valuemin":0,"aria-valuenow":n,className:K.rebaseProgressTrack,role:`progressbar`,children:w(`span`,{className:K.rebaseProgressFill,style:{width:`${r}%`}})})]})}function at({message:e,showAge:t=!1}){let n=e.kind===`user`?`Request`:e.kind===`thought`?`Thought`:e.author??`Codex`;return T(`section`,{className:K.codexMessage,children:[T(`div`,{className:K.codexMessageHeader,children:[w(`h3`,{className:K.codexMessageLabel,children:n}),t?w(ot,{}):null]}),w(`p`,{className:K.codexMessageText,children:e.text})]})}function ot(){let e=y(0),[t,n]=b(0);return g(()=>{e.current=Date.now();let t=globalThis.setInterval(()=>{n(Math.floor((Date.now()-e.current)/1e3))},1e3);return()=>globalThis.clearInterval(t)},[]),T(`span`,{"aria-hidden":`true`,className:K.codexMessageAge,children:[X(t),` ago`]})}function X(e){let t=Math.floor(e/60),n=e%60;return t>0?`${t}m ${n}s`:`${n}s`}function st({status:e}){let[t,n,r]=e===`??`?[`U`,`Untracked`,`added`]:e.includes(`U`)||e===`AA`||e===`DD`?[`!`,`Conflict`,`deleted`]:e.includes(`R`)?[`R`,`Renamed`,`renamed`]:e.includes(`C`)?[`C`,`Copied`,`renamed`]:e.includes(`D`)?[`D`,`Deleted`,`deleted`]:e.includes(`A`)?[`A`,`Added`,`added`]:e.includes(`T`)?[`T`,`Type changed`,`modified`]:[`M`,`Modified`,`modified`];return w(`span`,{className:K.fileStatus,"data-tone":r,title:n,"aria-label":n,children:t})}function ct({checked:e,indeterminate:t=!1,label:n,onChange:r}){let i=y(null);return g(()=>{i.current&&(i.current.indeterminate=t)},[t]),T(`label`,{className:K.checkbox,children:[w(`input`,{ref:i,checked:e,onChange:e=>r(e.target.checked),type:`checkbox`}),n]})}const lt=u(void 0);function ut({children:e}){return w(`div`,{className:K.content,children:e})}function Z({children:e}){let t=h(lt);return t===void 0?w(`div`,{className:K.actions,children:e}):t?S(e,t):null}function dt({children:e}){return T(`div`,{className:K.errorMessage,children:[w(ye,{"aria-hidden":`true`,className:K.errorIcon,size:18}),w(`p`,{className:K.paragraph,children:e})]})}function Q({requiresConnection:e=!0,ariaLabel:t,busy:n,children:r,disabledReason:i,icon:a,iconOnly:o=!1,immediatelyEnabled:s=!1,onClick:c,primary:l=!1,role:u}){let d=h(ke),f=i??(!d&&e?`Connection lost; wait for reconnection`:void 0),[p,m]=b(!0),[v,y]=b(),x=_(),C=f?`Please wait: ${f.replace(/[.\u2026]+$/,``)}.`:n?`Waiting for ${t??(typeof r==`string`?`“${r}”`:`this action`)} to finish.`:p&&!s?`Enabled in a moment to prevent accidental clicks.`:void 0;g(()=>{let e=globalThis.setTimeout(()=>m(!1),1e3);return()=>globalThis.clearTimeout(e)},[]);let E=e=>{let t=e.getBoundingClientRect(),n=e.closest(`[data-isolet-root]`);n&&y({left:Math.max(12,Math.min(t.left,window.innerWidth-292)),top:t.top-8,root:n})};return T(`span`,{"aria-describedby":C?x:void 0,"aria-label":C?t??(typeof r==`string`?r:void 0):void 0,className:K.buttonContainer,onBlur:()=>y(void 0),onFocus:e=>E(e.currentTarget),onKeyDown:e=>{e.key===`Escape`&&C&&v&&(e.stopPropagation(),y(void 0))},onMouseEnter:e=>E(e.currentTarget),onMouseLeave:()=>y(void 0),onPointerDown:e=>{C&&e.currentTarget.focus()},tabIndex:C?0:void 0,children:[T(`button`,{"aria-label":t,"aria-busy":!!n,"aria-describedby":C?x:void 0,className:`${K.button} ${o?K.iconOnly:``} ${l?K.primary:``}`,disabled:!!C,onClick:c,role:u,title:!C&&o?t:void 0,type:`button`,children:[n?w(he,{"aria-hidden":`true`,className:K.buttonSpinner,size:16}):a?w(a,{"aria-hidden":`true`,size:16}):null,o?null:r]}),C?w(`span`,{className:K.srOnly,id:x,children:C}):null,C&&v?S(w(`span`,{className:K.disabledTooltip,role:`tooltip`,style:{left:v.left,top:v.top},children:C}),v.root):null]})}function ft(e){return e?e.mode===`waiting`&&e.message?`Sync paused`:e.mode===`unmanaged`?`Sync unavailable`:e.mode===`error`?`Sync stopped`:e.setupFailure?.stage===`dependencies`?`Dependency installation failed`:e.setupFailure?.stage===`codegen`?`Panda codegen failed`:e.setupFailure?.stage===`migration`?`Database setup failed`:e.draft?e.proposal===void 0?`Review local changes`:`Confirm your commit`:e.pendingRebase?`Resolve update conflicts`:e.target?.source===`upstream`?`Refresh from upstream`:String(e.target?.source)===`dev`?`Sync with dev`:e.target?`Sync with main`:e.checks?.commands.some(e=>e.status===`failed`&&!e.dismissed)?`Checks failed`:e.warnings.length>0?`Warning`:`Managed development`:`Managed development`}function pt({codex:e,completion:t,status:r,success:i}){return e?.phase===`running`||r?.operation&&n(r.operation)?he:e?.phase===`error`?ye:t?oe:e?he:r?.setupFailure?.stage===`migration`?de:r?.setupFailure?.stage===`dependencies`?ge:r?.setupFailure?.stage===`codegen`?B:r?.draft?pe:r?.pendingRebase?ve:r?.target?.source===`upstream`?le:r?.target?B:r?.checks?.commands.some(e=>e.status===`failed`&&!e.dismissed)?me:i?oe:r?r.mode===`waiting`?ce:r.mode===`unmanaged`?se:r.mode===`error`||r.warnings.length>0?ye:oe:B}function mt(e){return e.mode===`waiting`?`Waiting for the supervisor to start.`:e.mode===`unmanaged`?`Managed development is unavailable for this session.`:e.mode===`error`?`The managed development supervisor stopped.`:e.draft&&!e.target?`Review which local changes to include.`:e.pendingRebase?`The update stopped on a conflict.`:e.target&&e.target.source!==`upstream`?String(e.target?.source)===`dev`?`New commits are available on dev.`:`New commits are available on main.`:e.target?`A newer upstream commit is ready.`:``}function ht(e,t,n){let r=[t,n?.phase===`error`?n.requestId:void 0,e?.mode===`error`||e?.mode===`unmanaged`?e.mode:void 0,e?.message,e?.setupFailure,e?.warnings.length?e.warnings:void 0];return r.some(Boolean)?JSON.stringify(r):void 0}function gt(e,t){return JSON.stringify([e,t.command,t.output])}function _t(e){return e?.mode===`error`&&e.message?.startsWith(s)===!0}function vt(e){return e?.message?.startsWith(c)===!0}function yt(e){return e.mode!==`managed`||!!(e.busy||e.codexCompletion||e.draft||e.message||e.pendingRebase||e.setupFailure||e.codexRetry||e.history||e.devAlignment||e.fetchFailure||e.target||e.warnings.length>0)}function bt(e){if(!e?.checks||yt(e))return;let t=e.checks.commands.find(e=>e.status===`failed`&&!e.dismissed);return t?{check:t,commit:e.checks.commit,trigger:e.checks.trigger}:void 0}function xt({commit:e,trigger:t}){let n=e.slice(0,12);return t===`check-recovery`?`Reran against the current working tree at commit ${n}.`:t===`codegen-recovery`?`Ran after Panda codegen recovered at commit ${n}.`:t===`dependency-recovery`?`Ran after dependency installation recovered at commit ${n}.`:t===`database-recovery`?`Ran after database setup recovered at commit ${n}.`:`Ran after the update was applied at commit ${n}.`}function St({status:e,codex:t,error:n,success:r,pendingAction:i,controls:a}){return!!($(e)||e?.operation?.state===`succeeded`||t||n||r||i||a?.pending||a?.error||a?.success||e?.history||e?.recovery?.length||e?.activities?.some(e=>e.status!==`succeeded`))}function $(e,t=bt(e)){return e?e.mode===`waiting`?!!e.message:e.operation?.state===`succeeded`?!!(t||e.codexCompletion||e.codexRetry||e.history||e.devAlignment||e.fetchFailure||e.setupFailure||e.pendingRebase||e.draft||e.target||e.busy||e.warnings.length||e.mode!==`managed`):!!(e.operation||t||yt(e)):!1}function Ct(e){let t=new Set(e.filter(e=>e.kind===`user`)),n=[...t].reduce((e,t)=>e+t.text.length,0),r=!1;for(let i of[...e].reverse())if(i.kind!==`user`){if(n+i.text.length>1e5&&r)break;t.add(i),r=!0,n+=i.text.length}return e.filter(e=>t.has(e))}function wt(e){return[e.message,`Commit: ${e.commit}`,`Command: ${e.command}`,``,e.output].join(`
195
+ `)}function Tt(){let[t,n]=b(),[r,i]=b(!1),[a,o]=b(),s=xe(),c=y(void 0);return g(()=>{if(!s)return;let t=e=>{if(e.requestId===c.current){if(e.state===`busy`){i(!0);return}if(c.current=void 0,i(!1),e.state===`error`){o(void 0),n(e.error??`The Vite restart failed.`);return}n(void 0),o(`Vite restarted.`)}},r=()=>{c.current&&(c.current=void 0,i(!1),o(void 0),n(`The connection was interrupted during the restart. Reconnect before trying again.`))};return s.on(e.actionResult,t),s.on(Se.disconnect,r),()=>{s.off(e.actionResult,t),s.off(Se.disconnect,r)}},[s]),{dismissError:()=>n(void 0),error:t,pending:r,reloadPage:()=>globalThis.location.reload(),restartVite:()=>{if(r)return;if(n(void 0),o(void 0),!s){n(`The Vite HMR connection is unavailable.`);return}let t=globalThis.crypto.getRandomValues(new Uint32Array(4)).join(`-`);c.current=t,i(!0),s.send(e.action,{action:{type:`restart-vite`},requestId:t})},success:a}}function Et(e){return e.type===`apply-recovery`?{heading:`Changes recovered`,message:`The agent reviewed and applied recovered changes while preserving current work.`}:e.type===`sync-dev`?{heading:`Local sync complete`,message:`Applied pending dev changes and updated branch alignment where safe.`}:e.type===`recover-history`?{heading:`Recovery branches created`,message:`The checkpoint is available as recovered-main and recovered-dev branches. Current work was preserved.`}:e.type===`discard-history`?{heading:`Checkpoint discarded`,message:`The selected recovery refs were removed.`}:e.type===`reset-branches`?{heading:`Branches reset`,message:`Restored main and dev to their pre-integration commits.`}:e.type===`retry-codex`?{heading:`Refresh complete`,message:`The failed Codex stage completed and synchronization continued.`}:e.type===`retry-migration`?{heading:`Migration complete`,message:`Database migration completed and project checks resumed.`}:e.type===`retry-checks`?{heading:`Checks complete`,message:`The requested checks passed.`}:e.type===`retry-dev-alignment`?{heading:`Dev aligned`,message:`Dev now uses the synchronized main history.`}:e.type===`retry-fetch`?{heading:`Fetch complete`,message:`Checked for upstream updates.`}:e.type===`apply`?{heading:`Refresh complete`,message:`Your changes were committed and the project is up to date.`}:e.type===`prepare`?{heading:`Refresh complete`,message:`Your project is up to date.`}:e.type===`commit`?{heading:`Changes committed`,message:`Your local changes are committed. Checking for updates…`,preserveDuringStatus:!0}:e.type===`reject`?{heading:`Update dismissed`,message:`No further action needed.`}:e.type===`configure-codex`?{heading:`Codex preferences saved`,message:`Future Codex runs will use this model and effort.`}:e.type===`decline-rebase`?{heading:`Conflict resolution deferred`,message:`Applied changes stay on your branch. The remaining commits can be resolved later.`}:e.type===`resolve-rebase`?{heading:`Refresh complete`,message:`Codex resolved the remaining conflicts and the project is up to date.`}:e.type===`retry-install`?{heading:`Setup complete`,message:`Dependencies installed and the project is ready.`}:e.type===`retry-codegen`?{heading:`Codegen complete`,message:`Panda codegen finished.`}:e.type===`reset-database`?{heading:`Database reset complete`,message:`The database was recreated, migrated, and seeded.`}:e.type===`retry-supervisor`?{heading:`Reconnected`,message:`The supervisor is connected again.`}:e.type===`cancel-codex`?{heading:`Update cancelled`,message:`Codex conflict resolution cancelled.`}:{heading:`Action complete`,message:`No further action needed.`}}function Dt(e){let t=e.turns.at(-1);if(t)return{commits:[],messages:t.finalMessage&&!t.messages.some(e=>e.kind===`agent`&&e.text===t.finalMessage)?[...t.messages,{kind:`agent`,text:t.finalMessage}]:t.messages,phase:e.state===`failed`||e.state===`interrupted`?`error`:t.status===`running`&&n(e)?`running`:`complete`,requestId:e.requestIds.at(-1)??e.id,startedAt:Math.min(...e.turns.map(e=>e.startedAt)),stage:t.stage,totalCommits:e.progress?.total}}function Ot(){let[e,t]=b(),[r,i]=b(),[o,s]=b(!1),[c,l]=b(),[u,d]=b(),[f,p]=b(Oe),[h,_]=b(),[v,x]=b({dismissed:!1}),[S,C]=b(()=>new Set),w=y(void 0),T=y(void 0),E=y(new Map),D=Ce(),[O]=b(Ae),k=y(void 0),A=y(new Set),j=y(void 0),M=ht(e,r,u),N=!!(M&&M===v.key&&v.dismissed);M!==v.key&&x({key:M,dismissed:!1});let P=e?.checks&&S.size>0?{...e,checks:{...e.checks,commands:e.checks.commands.map(t=>!t.failureId&&S.has(gt(e.checks.commit,t))?{...t,dismissed:!0}:t)}}:e;g(()=>{if(!D)return;let e=E.current,r=e=>{try{D.send(a.diagnostic,e)}catch{}},o,c=Date.now(),u=()=>{try{e.size?D.send(a.statusRequest,{clientId:O,requestIds:[...e.keys()]}):D.send(a.statusRequest)}catch{s(!1)}},f=()=>{r({type:`connected`}),s(!1),u()},m=()=>{r({type:`disconnected`}),s(!1),o=void 0},h=({status:a})=>{let u=k.current,f=a;if(f.trace&&u?.trace){if(f.trace.sessionId===u.trace.sessionId&&f.trace.revision<u.trace.revision||A.current.has(f.trace.sessionId))return!1;f.trace.sessionId!==u.trace.sessionId&&(A.current.add(u.trace.sessionId),A.current.size>8&&A.current.delete(A.current.values().next().value))}vt(f)&&!f.operation&&u?.operation&&(f={...f,operation:u.operation,activities:u.activities,trace:u.trace}),k.current=f,c=Date.now();let m=JSON.stringify([f.trace,f.mode,f.busy]);m!==o&&(o=m,r({type:`status-received`,sessionId:f.trace?.sessionId,revision:f.trace?.revision,requestId:f.trace?.operationId,busy:!!f.busy}));let h=$(f),g=vt(f);if((f.mode===`unmanaged`&&u?.mode!==`unmanaged`||f.mode===`waiting`&&f.message&&!g&&(u?.mode!==`waiting`||!u.message||vt(u)))&&Y(!0),g&&(i(void 0),l(void 0)),f.operation){n(f.operation)&&j.current!==f.operation.id&&(j.current=f.operation.id,Y(!0));let t=g?void 0:Dt(f.operation);w.current=t,d(t);for(let[t,r]of e){let i=!n(f.operation);(f.operation.requestIds.includes(t)&&i||r.type===`cancel-codex`&&(f.operation.cancellation===`requested`||i))&&e.delete(t)}_([...e.values()].at(-1))}else u?.operation&&(w.current=void 0,d(void 0));s(!0),t(f),f.codexOptions&&p(e=>({...e,...f.codexOptions})),f.codexCompletion&&T.current!==f.codexCompletion.id&&(T.current=f.codexCompletion.id,Y(!0));let v=!f.busy&&!f.codexCompletion?[...e.entries()].filter(([,e])=>e.type===`acknowledge-codex`||e.type===`acknowledge-operation`).map(([e])=>e):[];if(v.length>0){for(let t of v)e.delete(t);_([...e.values()].at(-1)),l(void 0),h||Y(!1)}return h&&l(e=>e?.preserveDuringStatus?e:void 0),!0},g=t=>{if(r({type:`action-result-received`,requestId:t.requestId,sessionId:t.status?.trace?.sessionId,revision:t.status?.trace?.revision,busy:!!t.status?.busy,pending:e.has(t.requestId)}),t.errorCode===`UNKNOWN_REQUEST`&&k.current?.operation?.requestIds.includes(t.requestId))return;let n=t.status?h({status:t.status}):!0,a=e.get(t.requestId);if(a&&(e.delete(t.requestId),_([...e.values()].at(-1)),n)){if(a.type===`decline-rebase`&&!t.error&&t.status?.pendingRebase){Y(!1),l(void 0);return}if(t.status?.operation){l(void 0),t.error&&!t.status.operation.requestIds.includes(t.requestId)&&i(t.error);return}t.error?(w.current?.requestId===t.requestId&&(w.current=void 0,d(void 0)),i(t.error),a.type===`acknowledge-codex`&&Y(!0)):t.status?.codexCompletion?(T.current=t.status.codexCompletion.id,w.current=void 0,d(void 0),l(void 0),Y(!0)):a.type===`acknowledge-codex`?(l(void 0),t.status&&!$(t.status)&&Y(!1)):a.type===`dismiss-check`||a.type===`configure-codex`||a.type===`cancel-codex`?l(void 0):t.status&&(a.type===`commit`||!$(t.status))&&l(Et(a))}},v=t=>{if(k.current?.operation||t.phase===`activity`||!e.has(t.requestId))return;if(t.phase===`start`){let e={commits:t.commits,messages:[t.message],phase:`running`,requestId:t.requestId,stage:t.stage??`resolve`,startedAt:w.current?.requestId===t.requestId?w.current.startedAt??Date.now():Date.now(),totalCommits:t.totalCommits};w.current=e,d(e),Y(!0);return}let n=w.current;if(!n||n.requestId!==t.requestId)return;let r=t.phase===`message`?{...n,messages:Ct([...n.messages,t.message]),phase:t.stage!==void 0&&t.stage!==n.stage?`running`:n.phase,stage:t.stage??n.stage}:t.phase===`complete`?{commits:n.commits,messages:n.messages,phase:`complete`,requestId:t.requestId,stage:t.stage??n.stage,startedAt:n.startedAt,totalCommits:n.totalCommits}:t.phase===`progress`?{...n,commits:t.commits,stage:t.stage??n.stage,totalCommits:t.totalCommits??n.totalCommits}:{...n,phase:`error`};w.current=r,d(r)};D.on(Se.connect,f),D.on(Se.disconnect,m),D.on(a.status,h),D.on(a.actionResult,g),D.on(a.codex,v),u();let y=globalThis.setInterval(()=>{(n(k.current?.operation)||e.size>0)&&(Date.now()-c>1e4&&s(!1),u())},1e3),b=()=>{document.visibilityState!==`hidden`&&(Date.now()-c>1e4&&s(!1),u())},x=kt(()=>{At()&&u()});return globalThis.addEventListener(`online`,b),globalThis.addEventListener(`focus`,b),globalThis.addEventListener(`pageshow`,b),document.addEventListener(`visibilitychange`,b),()=>{globalThis.clearInterval(y),x(),globalThis.removeEventListener(`online`,b),globalThis.removeEventListener(`focus`,b),globalThis.removeEventListener(`pageshow`,b),document.removeEventListener(`visibilitychange`,b),D.off(Se.connect,f),D.off(Se.disconnect,m),D.off(a.status,h),D.off(a.actionResult,g),D.off(a.codex,v)}},[D,O]);let F=async e=>{if(e.type===`acknowledge-codex`&&(T.current=e.id),i(void 0),x({key:M,dismissed:!1}),l(void 0),e.type!==`cancel-codex`&&(w.current=void 0,d(void 0)),!D||!o){i(`The Vite HMR connection is unavailable. Wait for reconnection before trying again.`);return}let t=globalThis.crypto.getRandomValues(new Uint32Array(4)).join(`-`);E.current.set(t,e),_(e),D.send(a.action,{clientId:O,action:e,requestId:t})},ee=m(()=>l(void 0),[]);return{act:F,checkFailure:(!r||N)&&!c&&(!u||N&&u.phase===`error`||e?.operation?.state===`failed`)&&(!e?.codexCompletion||e?.operation?.state===`failed`)?bt(P):void 0,codex:u,codexOptions:f,dismissCheckFailure:e=>{if(!e.check.failureId){C(t=>new Set(t).add(gt(e.commit,e.check)));return}F({failureId:e.check.failureId,type:`dismiss-check`})},dismissError:()=>x({key:M,dismissed:!0}),dismissSuccess:ee,error:r,errorsDismissed:N,hmrReady:o,pendingAction:h,setCodexOptions:p,status:P,success:c}}function kt(e){return Me.add(e),()=>Me.delete(e)}function At(){return je}function jt(){return!1}export{Le as ManagedDevOverlay,Be as ManagedDevOverlayDebug,Ke as ManagedDevOverlayIndicator,Ie as toggleManagedDevOverlay};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/vite",
3
- "version": "0.2.59",
3
+ "version": "0.2.60",
4
4
  "description": "Vite plugins and build integrations for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,14 +57,14 @@
57
57
  "obug": "^2.1.3",
58
58
  "unplugin": "^2.3.11",
59
59
  "vite-plugin-hashed-favicons": "^2.1.1",
60
+ "@coreframe/assets": "^0.1.22",
60
61
  "@coreframe/config": "^0.1.19",
61
62
  "@coreframe/dashboard": "^0.3.31",
62
- "@coreframe/dev": "^0.1.40",
63
- "@coreframe/dev-contracts": "^0.1.14",
64
- "@coreframe/flutter-js": "^0.1.33",
63
+ "@coreframe/dev": "^0.1.41",
64
+ "@coreframe/dev-contracts": "^0.1.15",
65
65
  "@coreframe/flutter-tools": "^0.1.31",
66
- "@coreframe/assets": "^0.1.22",
67
- "@coreframe/lib": "^0.2.17"
66
+ "@coreframe/lib": "^0.2.17",
67
+ "@coreframe/flutter-js": "^0.1.33"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@pandacss/dev": "2.4.0",