vibe64 0.1.61 → 0.1.63
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.
- package/bin/upgrade-state.js +1701 -1700
- package/dist/assets/{GithubBrowserTabs-DAgQxPXI.js → GithubBrowserTabs-DEq5_tSs.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-m1G8ZS5i.js → LocalDatabaseServer-CrQ9aolO.js} +1 -1
- package/dist/assets/{SelectField-DwWoHC2p.js → SelectField-RGWl_ms9.js} +1 -1
- package/dist/assets/VAutocomplete-BnpXAJGa.js +1 -0
- package/dist/assets/{VCheckbox-B40zJSbZ.js → VCheckbox-BK0ss4F4.js} +1 -1
- package/dist/assets/{VCheckboxBtn-6ebHAnh9.js → VCheckboxBtn-DDlYJnth.js} +1 -1
- package/dist/assets/{VDialog-B2W9wqR8.js → VDialog-BCIrX462.js} +1 -1
- package/dist/assets/VMenu-Bql3E6DV.js +1 -0
- package/dist/assets/VMenu-DCU7zd0B.css +1 -0
- package/dist/assets/VOverlay-EPzW7eVB.js +1 -0
- package/dist/assets/{VRadioGroup-D1duMMwJ.js → VRadioGroup-CL3HTmyT.js} +1 -1
- package/dist/assets/VSelect-Ch00dyiM.js +1 -0
- package/dist/assets/VSkeletonLoader-Bl9P5wdh.js +1 -0
- package/dist/assets/VSkeletonLoader-DXZarZ9m.css +1 -0
- package/dist/assets/{VSwitch-DUkp5sfW.js → VSwitch-DftK1EyR.js} +1 -1
- package/dist/assets/{VTextField-BMvaWVTN.js → VTextField-B9R7EIjg.js} +1 -1
- package/dist/assets/{VTextarea-CLaWcpd_.js → VTextarea-CMgyRNk-.js} +1 -1
- package/dist/assets/{Vibe64AsyncModuleState-C9rLM2H0.js → Vibe64AsyncModuleState-9bN0_H45.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-D3sB4BfM.js → Vibe64AuthSettingsButton-Bbgu_IRu.js} +1 -1
- package/dist/assets/{Vibe64ConversationLog-B-L5QsVr.js → Vibe64ConversationLog-MGFaNVSu.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-CMzX3wRM.js → Vibe64DashboardShell-i01oU7QS.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-Dewhs6_T.js → Vibe64DatabaseWorkspace-BqOIE7at.js} +1 -1
- package/dist/assets/Vibe64FileArea-B8_Tqtgv.js +1 -0
- package/dist/assets/Vibe64OutputControls-eaoCQsYn.js +8 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-CBsySPXN.js → Vibe64RepositoryWorkspace-CoSH_5qZ.js} +1 -1
- package/dist/assets/Vibe64SessionFiles-Dt1EY-Qo.js +1 -0
- package/dist/assets/{Vibe64SessionSourceEditor-BouH4fXC.js → Vibe64SessionSourceEditor-D5-abooo.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView--E04EEF8.js → Vibe64UiStoryboardView-CyuufVBB.js} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-94bFpxMK.js → Vibe64UnavailableSessions-CaLRMl-0.js} +1 -1
- package/dist/assets/{_pageId_-Ch4OpUkd.js → _pageId_-M5CNslNQ.js} +1 -1
- package/dist/assets/_sessionId_-jSlkZQLV.js +1 -0
- package/dist/assets/{_slug_-C8VNMRVH.js → _slug_-ClQKNEA9.js} +5 -5
- package/dist/assets/access-BqnqYSZR.js +1 -0
- package/dist/assets/{app-Bs6-Hv23.js → app-D7V6OMMB.js} +1 -1
- package/dist/assets/{changes-C6eMQ9YE.js → changes-odK1bV6J.js} +1 -1
- package/dist/assets/{client-qpL_kR4u.js → client-BLY6SeL-.js} +1 -1
- package/dist/assets/{client-CVgL_ShV.js → client-BRcncaFt.js} +1 -1
- package/dist/assets/{client-HWj_BNVZ.js → client-DwF9Q0VQ.js} +2 -2
- package/dist/assets/{client-qAKnahkF.js → client-P5LOKvwh.js} +2 -2
- package/dist/assets/client-rknXpZ1o.js +1 -0
- package/dist/assets/{conversation-ZN3-8jbz.css → conversation-BMyk8R_u.css} +1 -1
- package/dist/assets/{conversation-DbF0OrZB.js → conversation-BoB7Drme.js} +4 -4
- package/dist/assets/conversation-D7T_us2O.js +1 -0
- package/dist/assets/{dashboard-CzLsa0w0.js → dashboard-D6JkBdZg.js} +1 -1
- package/dist/assets/{english-definitions-BA8v5wP1.js → english-definitions-CwCZ8VJ-.js} +1 -1
- package/dist/assets/env-CIy7uwLb.js +1 -0
- package/dist/assets/{fileTypes-DRyfajWx.js → fileTypes-2k5HCkMT.js} +1 -1
- package/dist/assets/health-B9ZoQC78.js +1 -0
- package/dist/assets/history-IBqZqdSL.js +1 -0
- package/dist/assets/{index-fXKdz8oR.js → index-DAareKn3.js} +4 -4
- package/dist/assets/{integrations-cgbpgNNd.js → integrations-BBMdyyMq.js} +1 -1
- package/dist/assets/issues-DwUO1HjX.js +1 -0
- package/dist/assets/{learning-DZXWgVEW.js → learning-DAIqaO0B.js} +1 -1
- package/dist/assets/{pages-BUUwIXBf.js → pages-DoUMcieZ.js} +1 -1
- package/dist/assets/{project-files-BS2gdDSz.js → project-files-DilujZdI.js} +1 -1
- package/dist/assets/publish-KZQ_gdoN.js +3 -0
- package/dist/assets/pull-requests-BB3CAadu.js +1 -0
- package/dist/assets/{repository-Dkow-18G.js → repository-B90tiuN6.js} +1 -1
- package/dist/assets/settings-DdbhtNHb.js +1 -0
- package/dist/assets/thinkingText-mMYz6e03.js +8 -0
- package/dist/assets/{useArchivedVibe64Sessions-C0MVJuyX.js → useArchivedVibe64Sessions-B_pM75gN.js} +1 -1
- package/dist/assets/useVibe64ConversationLog-Ch0ZbnCG.js +2 -0
- package/dist/assets/{useVibe64Learning-RE4HXHqo.js → useVibe64Learning-DiLAIKbI.js} +1 -1
- package/dist/assets/{useVibe64SessionData-kGr7R7lG.js → useVibe64SessionData-COsXmbMm.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-BZ7WnRv0.js → useVibe64SessionSelection-CKBC-ZJw.js} +1 -1
- package/dist/assets/vibe64RepositoryRealtime-BIXVm4u9.js +1 -0
- package/dist/assets/{vibe64RepositoryRealtime-ByZfq2fE.css → vibe64RepositoryRealtime-rnWlv9jw.css} +1 -1
- package/dist/assets/vibe64SessionFocus-C0LfHXbF.js +1 -0
- package/dist/index.html +23 -27
- package/docs/colleague-usage/ai-tasks.md +3 -1
- package/docs/colleague-usage/auto-workflow.md +6 -3
- package/docs/colleague-usage/chat-settings.md +20 -0
- package/docs/colleague-usage/coding-agent-goals.md +16 -2
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +2 -0
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/package.json +1 -1
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +75 -75
- package/package.json +5 -5
- package/server.bundle.mjs +20011 -19995
- package/dist/assets/VAlert-Bp38AD8H.css +0 -1
- package/dist/assets/VAlert-DyCQWe9P.js +0 -1
- package/dist/assets/VAutocomplete-CiXrKMyn.js +0 -1
- package/dist/assets/VDivider-DGkInAUr.js +0 -1
- package/dist/assets/VDivider-DvkP_iX7.css +0 -1
- package/dist/assets/VMenu-9TUL6_ph.css +0 -1
- package/dist/assets/VMenu-DQ9SZ1Fq.js +0 -1
- package/dist/assets/VOverlay-DUKRqNx3.js +0 -1
- package/dist/assets/VSelect-9lMtP5cu.js +0 -1
- package/dist/assets/VSkeletonLoader-C5ZRrPV4.js +0 -1
- package/dist/assets/VSkeletonLoader-LCPSxykp.css +0 -1
- package/dist/assets/Vibe64FileArea-DluZTu-c.js +0 -1
- package/dist/assets/Vibe64OutputControls-BfbdD25Y.js +0 -8
- package/dist/assets/Vibe64SessionFiles--wtVe_KC.js +0 -1
- package/dist/assets/_sessionId_-DGT4d2La.js +0 -1
- package/dist/assets/access-BAOx4iCS.js +0 -1
- package/dist/assets/client-CIF5Y1Aj.js +0 -1
- package/dist/assets/conversation-p_mmD9ie.js +0 -8
- package/dist/assets/env-BqJ_GWbz.js +0 -1
- package/dist/assets/health-CIqrHpVK.js +0 -1
- package/dist/assets/history-BCjhpyP8.js +0 -1
- package/dist/assets/issues-AhouA6nE.js +0 -1
- package/dist/assets/publish-Bq_LPmX2.js +0 -3
- package/dist/assets/pull-requests-BvChbjCD.js +0 -1
- package/dist/assets/settings-r5RWQVzw.js +0 -1
- package/dist/assets/ssrBoot-C6UwmCGc.js +0 -1
- package/dist/assets/useVibe64ConversationLog-CUWEZhnf.js +0 -2
- package/dist/assets/vibe64RepositoryRealtime-R5QhcJ4H.js +0 -1
- package/dist/assets/vibe64SessionFocus-CHKCMxcJ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as useId,Et as unref,G as renderList,H as openBlock,K as renderSlot,Kt as normalizeClass,N as nextTick,O as inject,Tt as toValue,Xt as toDisplayString,_ as createSlots,b as createVNode,d as createBaseVNode,f as createBlock,gt as reactive,i as Fragment,it as watch,m as createElementBlock,mt as onScopeDispose,ot as withCtx,p as createCommentVNode,st as withDirectives,u as computed,vt as ref,xt as shallowRef,y as createTextVNode}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{S as VIcon,cr as vShow,lr as withKeys,mt as useDisplay,ur as withModifiers}from"./VChip-D2IukBZw.js";import{s as normalizeObject}from"./normalize-BD25VwNK.js";import{r as VProgressCircular,t as VBtn}from"./VBtn-2vbH580C.js";import{t as VDialog}from"./VDialog-B2W9wqR8.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{r as useRealtimeEvent}from"./useRealtimeEvent-B4oRg9Dt.js";var VIBE64_AI_TASKS_KEY=Symbol(`vibe64.ai-tasks`);var NO_AI_TASKS=Object.freeze({available:false});var AI_TASK_PHASES=Object.freeze({STARTING:`starting`,WORKING:`working`,CHECKING:`checking`,NEEDS_YOU:`needs_you`,CANCELLING:`cancelling`,DONE:`done`,NOT_DONE:`not_done`});var AI_TASK_REASONS=Object.freeze({AI_STUCK:`ai_stuck`,AI_UNAVAILABLE:`ai_unavailable`,ARCHIVED:`archived`,CANCELLED:`cancelled`,CHECK_STUCK:`check_stuck`,DRAFT_WAITING:`draft_waiting`,INTERRUPTED:`interrupted`,NO_RESULT:`no_result`,QUESTION:`question`,STOPPED:`stopped`,TURN_FAILED:`turn_failed`,UNCONFIRMED:`unconfirmed`,YOUR_TURN:`your_turn`});var AI_TASK_CHECKERS=Object.freeze({AGENT:`agent`,PERSON:`person`,VIBE64:`vibe64`});var AI_TASK_ACTIVE_PHASES=Object.freeze([AI_TASK_PHASES.STARTING,AI_TASK_PHASES.WORKING,AI_TASK_PHASES.CHECKING,AI_TASK_PHASES.CANCELLING]);var AI_TASK_ENDED_PHASES=Object.freeze([AI_TASK_PHASES.DONE,AI_TASK_PHASES.NOT_DONE]);function aiTaskEnded(task){return AI_TASK_ENDED_PHASES.includes(task.phase)}var AI_TASK_MESSAGES=Object.freeze({actions:Object.freeze({aiSetup:`Open AI setup`,answer:`Answer`,back:`Back`,cancel:`Cancel`,cancelling:`Cancelling…`,checkNow:`Check now`,close:`Close`,closing:`Closing…`,continue:`Continue`,details:`Details`,endNotDone:`End as not done`,finish:`Finish`,hide:`Hide`,keepGoing:`Keep going`,openChat:`Open chat`,review:`Review resolved conflicts`,waitForAi:`Wait for the AI`}),button:Object.freeze({busy:`Being fixed…`,fix:`Fix it with AI`,opening:`Opening…`,result:`See result`}),chat:Object.freeze({answer:`Type your answer…`,message:`Message the AI…`}),outcome:Object.freeze({done:`Done`,notDone:`Not done`,problem:`The problem`,seeConversation:`See the conversation`,showResult:`Show the result`,whatHappened:`What happened`,whatTheAiDid:`What the AI did`,whatsNext:`What's next`}),progress:Object.freeze({activity:`Activity`,unavailable:`Nothing is lost. The fix continues from here.`}),status:Object.freeze({aiStuck:`The AI could not finish this`,aiUnavailable:`The AI account can't run this right now`,cancelling:`Cancelling…`,draftWaiting:`The check failed. Your unsent message is waiting.`,interrupted:`Vibe64 restarted while the AI was working`,noResult:`The AI stopped without saying it finished`,question:`The AI needs your answer`,starting:`Starting…`,stopped:`Stopped. Tell the AI what to do next.`,turnFailed:`The AI ran into an error`,unconfirmed:`Vibe64 couldn't confirm the result`,working:`The AI is working on this`,yourTurn:`Your turn`}),tray:Object.freeze({cancelling:`Cancelling…`,done:`Done`,needsYou:`Needs you`,notDone:`Not done`,yourTurn:`Your turn`}),views:Object.freeze({chat:`Chat`,label:`Task views`,progress:`Progress`,waiting:`The AI is waiting for your answer`}),closeFailed:`That didn't finish. Try again.`,requestFailed:`That didn't reach Vibe64. Try again.`,attempt:(attempt,limit)=>`Attempt ${attempt} of ${limit}`,retrying:(attempt,limit)=>`The AI is trying again (attempt ${attempt} of ${limit})`,cancelQuestion:noun=>`Cancel this ${noun}? The AI stops. Anything it has changed stays in the session.`,cancelConfirm:noun=>`Cancel ${noun}`,cancelledByYou:noun=>`You cancelled this ${noun}.`,cancelledBy:(name,noun)=>`${name} cancelled this ${noun}.`,mainChatSince:time=>time?`The main chat's AI has been working since ${time}.`:`The main chat's AI is working.`,whatsNext:()=>`The problem is still there. Anything the AI changed stays in the session. To try again, close this and choose Fix it with AI.`,toast:(title,outcome)=>`${title}: ${outcome}.`});var AI_TASK_ACTIONS=Object.freeze({AI_SETUP:`ai-setup`,ANSWER:`answer`,CHECK:`check`,CONTINUE:`continue`,END:`end`,FINISH:`finish`,OPEN_CHAT:`open-chat`,REVIEW:`review`,RUN_NOW:`run-now`,WAIT_FOR_AI:`wait-for-ai`});var action=(id,label,primary=false)=>Object.freeze({id,label,primary});var OPEN_CHAT=action(AI_TASK_ACTIONS.OPEN_CHAT,AI_TASK_MESSAGES.actions.openChat);var CHECK_NOW=action(AI_TASK_ACTIONS.CHECK,AI_TASK_MESSAGES.actions.checkNow,true);var CONTINUE=action(AI_TASK_ACTIONS.CONTINUE,AI_TASK_MESSAGES.actions.continue,true);var NEEDS_YOU=Object.freeze({[AI_TASK_REASONS.QUESTION]:{status:AI_TASK_MESSAGES.status.question,chat:true,dot:true,actions:[action(AI_TASK_ACTIONS.ANSWER,AI_TASK_MESSAGES.actions.answer,true)]},[AI_TASK_REASONS.YOUR_TURN]:{glyph:`turn`,status:AI_TASK_MESSAGES.status.yourTurn,tray:AI_TASK_MESSAGES.tray.yourTurn,chat:true,dot:true,actions:[action(AI_TASK_ACTIONS.FINISH,AI_TASK_MESSAGES.actions.finish,true)]},[AI_TASK_REASONS.AI_STUCK]:{status:AI_TASK_MESSAGES.status.aiStuck,chat:true,actions:[action(AI_TASK_ACTIONS.END,AI_TASK_MESSAGES.actions.endNotDone),action(AI_TASK_ACTIONS.OPEN_CHAT,AI_TASK_MESSAGES.actions.openChat,true)]},[AI_TASK_REASONS.CHECK_STUCK]:{check:true,diagnostic:true,actions:[OPEN_CHAT,CHECK_NOW]},[AI_TASK_REASONS.NO_RESULT]:{status:AI_TASK_MESSAGES.status.noResult,actions:[OPEN_CHAT,CHECK_NOW]},[AI_TASK_REASONS.STOPPED]:{status:AI_TASK_MESSAGES.status.stopped,actions:[OPEN_CHAT,CONTINUE]},[AI_TASK_REASONS.AI_UNAVAILABLE]:{status:AI_TASK_MESSAGES.status.aiUnavailable,note:AI_TASK_MESSAGES.progress.unavailable,actions:[action(AI_TASK_ACTIONS.AI_SETUP,AI_TASK_MESSAGES.actions.aiSetup),CONTINUE]},[AI_TASK_REASONS.TURN_FAILED]:{status:AI_TASK_MESSAGES.status.turnFailed,actions:[OPEN_CHAT,CONTINUE]},[AI_TASK_REASONS.INTERRUPTED]:{status:AI_TASK_MESSAGES.status.interrupted,actions:[CONTINUE]},[AI_TASK_REASONS.UNCONFIRMED]:{status:AI_TASK_MESSAGES.status.unconfirmed,check:true,actions:[CHECK_NOW]},[AI_TASK_REASONS.DRAFT_WAITING]:{status:AI_TASK_MESSAGES.status.draftWaiting,chat:true,check:true,diagnostic:true,actions:[action(AI_TASK_ACTIONS.OPEN_CHAT,AI_TASK_MESSAGES.actions.openChat,true)]}});function stepsOf(task,needs){const[work,check]=task.steps;const counted=task.check.retryLimit>0?AI_TASK_MESSAGES.attempt(task.attempt,task.check.retryLimit):``;const ended=aiTaskEnded(task);const atCheck=task.phase===AI_TASK_PHASES.CHECKING||task.checkRunning||needs?.check===true;const passed=task.phase===AI_TASK_PHASES.DONE;const workState=passed||atCheck?`done`:ended?`failed`:`active`;const checkState=passed?`done`:needs?.check||ended&&atCheck?`failed`:atCheck?`active`:`pending`;const steps=[{label:work,state:workState,attempt:workState===`active`?counted:``}];if(check)steps.push({label:check,state:checkState,attempt:atCheck&&!ended?counted:``});return steps}function endedMessage(task,viewerId){if(task.message)return task.message;const by=task.endedBy;return by?.name&&by.id!==viewerId?AI_TASK_MESSAGES.cancelledBy(by.name,task.noun):AI_TASK_MESSAGES.cancelledByYou(task.noun)}function outcomeOf(task,viewerId){if(task.phase===AI_TASK_PHASES.DONE)return{heading:AI_TASK_MESSAGES.outcome.done,happened:task.message,report:task.report,next:``};return{heading:AI_TASK_MESSAGES.outcome.notDone,happened:endedMessage(task,viewerId),report:``,next:AI_TASK_MESSAGES.whatsNext()}}function runningStatus(task){if(task.phase===AI_TASK_PHASES.STARTING)return AI_TASK_MESSAGES.status.starting;if(task.phase===AI_TASK_PHASES.CANCELLING)return AI_TASK_MESSAGES.status.cancelling;if(task.phase===AI_TASK_PHASES.CHECKING)return task.waiting?task.message:task.check.label;return task.attempt>1?AI_TASK_MESSAGES.retrying(task.attempt,task.check.retryLimit):AI_TASK_MESSAGES.status.working}function noteOf(task,needs){if(task.phase===AI_TASK_PHASES.CANCELLING)return task.checkRunning?task.check.unstoppable:``;if(!needs)return``;return[needs.status&&task.message!==needs.status?task.message:``,needs.diagnostic&&!task.message.includes(task.diagnostic)?task.diagnostic:``,needs.note].filter(Boolean).join(` `)}function projectAiTask(task,{viewerId}){const ended=aiTaskEnded(task);const needs=task.phase===AI_TASK_PHASES.NEEDS_YOU?NEEDS_YOU[task.reason]:null;const whileAiWorks=task.phase===AI_TASK_PHASES.CHECKING&&task.waiting&&task.mainChatSince?task.check.whileAiWorks:null;const review=needs?.check&&task.reason===AI_TASK_REASONS.CHECK_STUCK&&task.conflictReview?[action(AI_TASK_ACTIONS.REVIEW,AI_TASK_MESSAGES.actions.review)]:[];const done=task.phase===AI_TASK_PHASES.DONE;const running=!ended&&!needs;return{glyph:done?`done`:ended?`not-done`:needs?needs.glyph||`attention`:`working`,status:done?AI_TASK_MESSAGES.outcome.done:ended?AI_TASK_MESSAGES.outcome.notDone:needs?needs.status||task.message:runningStatus(task),tray:done?AI_TASK_MESSAGES.tray.done:ended?AI_TASK_MESSAGES.tray.notDone:task.phase===AI_TASK_PHASES.CANCELLING?AI_TASK_MESSAGES.tray.cancelling:needs?needs.tray||AI_TASK_MESSAGES.tray.needsYou:task.tray,ended,chatDot:needs?.dot===true,opensOn:needs?.chat?`chat`:`progress`,composerOpen:Boolean(needs)||task.phase===AI_TASK_PHASES.WORKING,composerHint:task.reason===AI_TASK_REASONS.QUESTION?AI_TASK_MESSAGES.chat.answer:AI_TASK_MESSAGES.chat.message,note:whileAiWorks?`${AI_TASK_MESSAGES.mainChatSince(aiTaskTime(task.mainChatSince))} ${whileAiWorks.note}`:running&&task.phase!==AI_TASK_PHASES.CANCELLING?``:noteOf(task,needs),steps:stepsOf(task,needs),actions:needs?[...review,...needs.actions]:whileAiWorks?[action(AI_TASK_ACTIONS.WAIT_FOR_AI,AI_TASK_MESSAGES.actions.waitForAi),action(AI_TASK_ACTIONS.RUN_NOW,whileAiWorks.action,true)]:[],cancelQuestion:AI_TASK_MESSAGES.cancelQuestion(task.noun),outcome:ended?outcomeOf(task,viewerId):null}}function aiTaskFooterActions(actions,view){if(view!==`chat`)return actions;return actions.filter(({id})=>id!==AI_TASK_ACTIONS.ANSWER&&id!==AI_TASK_ACTIONS.OPEN_CHAT)}function aiTaskTime(at){const date=new Date(at);return Number.isNaN(date.getTime())?``:date.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}var SESSION_CHANGED_EVENT=`vibe64.session.changed`;var AI_TASK_CHANGED=`ai-task-changed`;function useAiTasks({sessionId,sessionsApiPath,projectSlug,enabled,request,onClosed}){const task=shallowRef(null);const loaded=ref(false);const error=ref(``);const cancelRequested=ref(false);const closing=ref(false);const starting=ref(false);const viewerId=ref(``);let readGeneration=0;const tasksPath=()=>`${toValue(sessionsApiPath)}/${encodeURIComponent(toValue(sessionId))}/ai-tasks`;const taskPath=(suffix=``)=>`${tasksPath()}/${encodeURIComponent(task.value.id)}${suffix}`;function remember(next){if(task.value?.id===next.id&&next.revision<task.value.revision)return;task.value=next}async function load(){const generation=++readGeneration;if(!toValue(enabled)||!toValue(sessionId))return;try{const{tasks,viewerId:viewer}=await request(tasksPath(),{method:`GET`});if(generation!==readGeneration)return;viewerId.value=viewer;const[saved=null]=tasks;if(saved)remember(saved);else task.value=null;loaded.value=true}catch{}}async function start(kind,input){error.value=``;starting.value=true;try{const answer=await request(tasksPath(),{method:`POST`,body:{kind,input}});remember(answer.task);return answer.task}catch(failure){error.value=failure.message||AI_TASK_MESSAGES.requestFailed;return null}finally{starting.value=false}}async function act(suffix,body={}){error.value=``;try{remember((await request(taskPath(suffix),{method:`POST`,body})).task)}catch(failure){error.value=failure.message||AI_TASK_MESSAGES.requestFailed;load()}}async function cancel(){cancelRequested.value=true;await act(`/cancel`);cancelRequested.value=false}const check=(input={})=>act(`/check`,input);const continueTask=()=>act(`/continue`);const finish=()=>act(`/finish`);async function close(){error.value=``;closing.value=true;try{await request(taskPath(),{method:`DELETE`});task.value=null}catch{error.value=AI_TASK_MESSAGES.closeFailed}finally{closing.value=false}}const matchesSession=payload=>payload.projectSlug===toValue(projectSlug)&&payload.sessionId===toValue(sessionId)&&payload.reason===AI_TASK_CHANGED;useRealtimeEvent({enabled:computed(()=>toValue(enabled)),event:SESSION_CHANGED_EVENT,matches:({payload={}}={})=>matchesSession(payload),onEvent({payload}){if(payload.aiTask){remember(payload.aiTask);return}if(payload.aiTaskClosed?.id!==task.value?.id)return;const closedHere=closing.value;task.value=null;if(!closedHere)onClosed(payload.aiTaskClosed)}});useRealtimeEvent({enabled:computed(()=>toValue(enabled)),event:`connect`,onEvent:()=>void load()});watch(()=>[toValue(sessionId),toValue(enabled)],([,on],previous)=>{if(previous?.[0]!==toValue(sessionId)){task.value=null;loaded.value=false}if(on)load()},{immediate:true});return{cancel,cancelRequested,check,close,closing,continueTask,error,finish,load,loaded,start,starting,task,viewerId}}var WINDOW_QUERY=`aiTask`;function useAiTaskWindow({task,loaded,active,opensOn,route,router}){const view=ref(`progress`);const transcriptOpen=ref(false);let opener=null;const wanted=computed(()=>String(route.query[WINDOW_QUERY]||``));const open=computed(()=>toValue(active)&&Boolean(wanted.value)&&toValue(task)?.id===wanted.value);function withoutWindow(){const{[WINDOW_QUERY]:_taskId,...query}=route.query;return{path:route.path,query,hash:route.hash}}async function show(element=null){const current=toValue(task);if(!current)return;opener=element;if(open.value)return;await router.push({path:route.path,query:{...route.query,[WINDOW_QUERY]:current.id},hash:route.hash})}function hide(){if(wanted.value)router.replace(withoutWindow())}function setView(next){view.value=next}watch(open,isOpen=>{if(!isOpen)return;view.value=toValue(opensOn);transcriptOpen.value=false},{immediate:true});watch(()=>[wanted.value,toValue(loaded),toValue(task)?.id,toValue(active)],()=>{if(wanted.value&&toValue(active)&&toValue(loaded)&&toValue(task)?.id!==wanted.value)router.replace(withoutWindow())},{immediate:true});return{hide,open,opener:()=>opener?.isConnected?opener:null,setView,show,transcriptOpen,view}}function useAiTaskHost({sessionId,sessionsApiPath,projectSlug,enabled,active,request,route,router,openAiSetup,reviewResolved,fallbackFocus}){const toast=ref(null);const tasks=useAiTasks({sessionId,sessionsApiPath,projectSlug,enabled,request,onClosed(closed){const heading=closed.phase===`done`?AI_TASK_MESSAGES.outcome.done:AI_TASK_MESSAGES.outcome.notDone;toast.value={text:AI_TASK_MESSAGES.toast(closed.title,heading),action:false}}});const projection=computed(()=>tasks.task.value&&projectAiTask(tasks.task.value,{viewerId:tasks.viewerId.value}));const taskWindow=useAiTaskWindow({task:tasks.task,loaded:tasks.loaded,active,opensOn:()=>projection.value?.opensOn||`progress`,route,router});function returnFocusTarget(){return taskWindow.opener()||document.querySelector(`[data-vibe64-ai-task-tray]`)||fallbackFocus()}async function start(kind,opener,input){const task=await tasks.start(kind,input);if(task)await nextTick();if(task)taskWindow.show(opener);else toast.value={text:tasks.error.value,action:false};return task}async function close(){const target=returnFocusTarget();await tasks.close();if(tasks.task.value)return;taskWindow.hide();await nextTick();(target?.isConnected?target:fallbackFocus())?.focus({preventScroll:true})}async function waitForAi(){taskWindow.hide();await nextTick();fallbackFocus()?.focus({preventScroll:true})}function run(actionId){const{task}=tasks;if(actionId===AI_TASK_ACTIONS.ANSWER||actionId===AI_TASK_ACTIONS.OPEN_CHAT)taskWindow.setView(`chat`);else if(actionId===AI_TASK_ACTIONS.CHECK)tasks.check();else if(actionId===AI_TASK_ACTIONS.RUN_NOW)tasks.check({whileAiWorks:true});else if(actionId===AI_TASK_ACTIONS.WAIT_FOR_AI)waitForAi();else if(actionId===AI_TASK_ACTIONS.CONTINUE)tasks.continueTask();else if(actionId===AI_TASK_ACTIONS.FINISH)tasks.finish();else if(actionId===AI_TASK_ACTIONS.END)tasks.cancel();else if(actionId===AI_TASK_ACTIONS.AI_SETUP)openAiSetup();else if(actionId===AI_TASK_ACTIONS.REVIEW&&task.value)reviewResolved()}function seeToastResult(){toast.value=null;taskWindow.show(null)}watch(()=>tasks.task.value&&aiTaskEnded(tasks.task.value),(ended,wasEnded)=>{if(!ended||wasEnded!==false||taskWindow.open.value||!toValue(active))return;toast.value={text:AI_TASK_MESSAGES.toast(tasks.task.value.title,projection.value.outcome.heading),action:true}});return reactive({cancel:tasks.cancel,cancelRequested:tasks.cancelRequested,check:tasks.check,close,closing:tasks.closing,error:tasks.error,hide:taskWindow.hide,open:taskWindow.open,projection,returnFocusTarget,run,seeToastResult,setTranscript:open=>{taskWindow.transcriptOpen.value=open},setView:taskWindow.setView,show:taskWindow.show,start,starting:tasks.starting,task:tasks.task,toast,transcriptOpen:taskWindow.transcriptOpen,view:taskWindow.view})}var _sfc_main$4={__name:`Vibe64AiTaskButton`,props:{kind:{required:true,type:String},allowed:{required:true,type:Boolean},title:{required:true,type:String},input:{required:true,type:Object}},emits:[`done`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const tasks=inject(VIBE64_AI_TASKS_KEY);const own=computed(()=>tasks.task?.kind===props.kind?tasks.task:null);const linked=computed(()=>Boolean(own.value));const label=computed(()=>{if(tasks.starting)return AI_TASK_MESSAGES.button.opening;if(!own.value)return AI_TASK_MESSAGES.button.fix;return tasks.projection.ended?AI_TASK_MESSAGES.button.result:AI_TASK_MESSAGES.button.busy});const disabled=computed(()=>!own.value&&(!props.allowed||tasks.starting));watch(()=>own.value?.phase===AI_TASK_PHASES.DONE?own.value.id:``,doneId=>{if(doneId)emit(`done`)});function activate(event){const opener=event.currentTarget;if(own.value)tasks.show(opener);else tasks.start(props.kind,opener,props.input)}return(_ctx,_cache)=>{return openBlock(),createBlock(VBtn,{"aria-busy":label.value===unref(AI_TASK_MESSAGES).button.opening?`true`:void 0,class:`vibe64-ai-task-button`,"data-vibe64-ai-task-button":``,disabled:disabled.value,"prepend-icon":`$smartToy`,size:`small`,title:__props.title,type:`button`,variant:`tonal`,onClick:activate},createSlots({default:withCtx(()=>[createTextVNode(toDisplayString(label.value)+` `,1)]),_:2},[linked.value?{name:`append`,fn:withCtx(()=>[createVNode(VIcon,{icon:`$arrowForward`,size:`16`,"aria-hidden":`true`})]),key:`0`}:void 0]),1032,[`aria-busy`,`disabled`,`title`])}}};var Vibe64AiTaskButton_default=_plugin_vue_export_helper_default(_sfc_main$4,[[`__scopeId`,`data-v-2233af9d`]]);var _hoisted_1$3=[`aria-label`,`title`];var _hoisted_2$3={class:`vibe64-ai-task-tray__label`};var _sfc_main$3={__name:`Vibe64AiTaskTray`,setup(__props){const tasks=inject(VIBE64_AI_TASKS_KEY);const glyphIcons={attention:`$errorFilled`,done:`$checkCircleFilled`,"not-done":`$cancel`,turn:`$circle`};return(_ctx,_cache)=>{return openBlock(),createElementBlock(`button`,{"aria-label":`${unref(tasks).task.title}: ${unref(tasks).projection.tray}`,class:normalizeClass([`vibe64-ai-task-tray`,`vibe64-ai-task-tray--${unref(tasks).projection.glyph}`]),"data-vibe64-ai-task-tray":``,title:unref(tasks).projection.tray,type:`button`,onClick:_cache[0]||(_cache[0]=$event=>unref(tasks).show($event.currentTarget))},[unref(tasks).projection.glyph===`working`?(openBlock(),createBlock(VProgressCircular,{key:0,indeterminate:``,size:`16`,width:`2`,"aria-hidden":`true`})):(openBlock(),createBlock(VIcon,{key:1,icon:glyphIcons[unref(tasks).projection.glyph],size:`18`,"aria-hidden":`true`},null,8,[`icon`])),createBaseVNode(`span`,_hoisted_2$3,toDisplayString(unref(tasks).projection.tray),1)],10,_hoisted_1$3)}}};var Vibe64AiTaskTray_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-56857b35`]]);var PHONE_WIDTH=600;var SHORT_HEIGHT=560;var EXPANDED_WIDTH=960;function aiTaskFit(width,height){const phone=width<PHONE_WIDTH;if(phone||height<SHORT_HEIGHT)return{fullscreen:true,phone,width:void 0,height:void 0};return width<EXPANDED_WIDTH?{fullscreen:false,phone,width:`min(92vw, 46rem)`,height:`88dvh`}:{fullscreen:false,phone,width:`46rem`,height:`min(80dvh, 46rem)`}}var REDUCED_MOTION=`(prefers-reduced-motion: reduce)`;function useAiTaskFocus({title,views,selectedView,setView,returnFocusTarget}){const tabElements=new Map;const motionQuery=globalThis.matchMedia(REDUCED_MOTION);const reducedMotion=ref(motionQuery.matches);const noteMotion=event=>{reducedMotion.value=event.matches};motionQuery.addEventListener(`change`,noteMotion);onScopeDispose(()=>motionQuery.removeEventListener(`change`,noteMotion));function focusTitle(){title.value?.focus({preventScroll:true})}function returnFocus(){returnFocusTarget()?.focus({preventScroll:true})}function setTab(view,element){if(element)tabElements.set(view,element);else tabElements.delete(view)}async function moveBetweenViews(event){const index=views.indexOf(selectedView());const next={ArrowLeft:views[(index+views.length-1)%views.length],ArrowRight:views[(index+1)%views.length],End:views.at(-1),Home:views[0]}[event.key];if(!next)return;event.preventDefault();setView(next);await nextTick();tabElements.get(next)?.focus()}return{focusTitle,moveBetweenViews,reducedMotion,returnFocus,setTab}}var _hoisted_1$2={class:`ai-task-outcome`};var _hoisted_2$2={key:0};var _hoisted_3$2={key:1};var _sfc_main$2={__name:`Vibe64AiTaskOutcome`,props:{task:{required:true,type:Object},projection:{required:true,type:Object}},emits:[`see-conversation`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,_hoisted_1$2,[createBaseVNode(`section`,null,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.problem),1),createBaseVNode(`p`,null,toDisplayString(__props.task.problem.summary),1)]),createBaseVNode(`section`,null,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.whatHappened),1),createBaseVNode(`p`,null,toDisplayString(__props.projection.outcome.happened),1)]),__props.projection.outcome.report?(openBlock(),createElementBlock(`section`,_hoisted_2$2,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.whatTheAiDid),1),createBaseVNode(`p`,null,toDisplayString(__props.projection.outcome.report),1)])):createCommentVNode(``,true),__props.projection.outcome.next?(openBlock(),createElementBlock(`section`,_hoisted_3$2,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.whatsNext),1),createBaseVNode(`p`,null,toDisplayString(__props.projection.outcome.next),1)])):createCommentVNode(``,true),createVNode(VBtn,{class:`ai-task-outcome__conversation`,"data-vibe64-ai-task-transcript":``,variant:`text`,onClick:_cache[0]||(_cache[0]=$event=>emit(`see-conversation`))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).outcome.seeConversation),1)]),_:1})])}}};var Vibe64AiTaskOutcome_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-bc318273`]]);var _hoisted_1$1={class:`ai-task-progress`};var _hoisted_2$1={class:`ai-task-progress__steps`};var _hoisted_3$1={class:`ai-task-progress__label`};var _hoisted_4$1={key:0,class:`ai-task-progress__attempt`};var _hoisted_5$1={key:0,class:`ai-task-progress__note`};var _hoisted_6$1={key:1,class:`ai-task-progress__output`};var _hoisted_7$1=[`aria-label`];var _hoisted_8$1={class:`ai-task-progress__heading`};var _hoisted_9$1=[`datetime`];var _sfc_main$1={__name:`Vibe64AiTaskProgress`,props:{task:{required:true,type:Object},projection:{required:true,type:Object},output:{required:true,type:Boolean},commentary:{required:true,type:Array}},setup(__props){const props=__props;const stepIcons={active:`$radioOn`,done:`$checkCircleFilled`,failed:`$cancel`,pending:`$circle`};const activity=computed(()=>[...props.task.log,...props.commentary].sort((a,b)=>a.at.localeCompare(b.at)));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,_hoisted_1$1,[createBaseVNode(`ol`,_hoisted_2$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.projection.steps,step=>{return openBlock(),createElementBlock(`li`,{key:step.label,class:normalizeClass([`ai-task-progress__step`,`ai-task-progress__step--${step.state}`])},[createVNode(VIcon,{icon:stepIcons[step.state],size:`18`,"aria-hidden":`true`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_3$1,toDisplayString(step.label),1),step.attempt?(openBlock(),createElementBlock(`span`,_hoisted_4$1,toDisplayString(step.attempt),1)):createCommentVNode(``,true)],2)}),128))]),__props.projection.note?(openBlock(),createElementBlock(`p`,_hoisted_5$1,toDisplayString(__props.projection.note),1)):createCommentVNode(``,true),_ctx.$slots[`check-output`]&&__props.output?(openBlock(),createElementBlock(`details`,_hoisted_6$1,[createBaseVNode(`summary`,null,toDisplayString(__props.task.check.output),1),renderSlot(_ctx.$slots,`check-output`,{},void 0,true)])):createCommentVNode(``,true),createBaseVNode(`section`,{class:`ai-task-progress__activity`,"aria-label":unref(AI_TASK_MESSAGES).progress.activity},[createBaseVNode(`h3`,_hoisted_8$1,toDisplayString(unref(AI_TASK_MESSAGES).progress.activity),1),createBaseVNode(`ol`,null,[(openBlock(true),createElementBlock(Fragment,null,renderList(activity.value,entry=>{return openBlock(),createElementBlock(`li`,{key:`${entry.at}:${entry.text}`},[createBaseVNode(`time`,{datetime:entry.at},toDisplayString(unref(aiTaskTime)(entry.at)),9,_hoisted_9$1),createBaseVNode(`span`,null,toDisplayString(entry.text),1)])}),128))])],8,_hoisted_7$1)])}}};var Vibe64AiTaskProgress_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-1d71ea78`]]);var _hoisted_1=[`aria-labelledby`,`data-vibe64-ai-task-phase`,`data-vibe64-ai-task-reason`];var _hoisted_2={class:`ai-task__header`};var _hoisted_3={class:`ai-task__heading`};var _hoisted_4=[`id`];var _hoisted_5={"aria-live":`polite`,class:`ai-task__status`,"data-vibe64-ai-task-status":``};var _hoisted_6={key:0,class:`ai-task__commands`};var _hoisted_7={class:`ai-task__problem`};var _hoisted_8=[`title`];var _hoisted_9=[`aria-expanded`,`aria-label`];var _hoisted_10={class:`ai-task__details-word`};var _hoisted_11={key:0,class:`ai-task__details`,"data-vibe64-ai-task-details-text":``,tabindex:`0`};var _hoisted_12=[`aria-label`];var _hoisted_13=[`id`,`aria-controls`,`aria-selected`,`data-vibe64-ai-task-view`,`tabindex`,`onClick`];var _hoisted_14=[`aria-label`];var _hoisted_15={class:`ai-task__body`};var _hoisted_16=[`id`,`aria-labelledby`];var _hoisted_17=[`id`,`aria-labelledby`,`role`];var _hoisted_18={key:1,class:`ai-task__error`,role:`alert`};var _hoisted_19={key:2,class:`ai-task__footer ai-task__footer--question`};var _hoisted_20={class:`ai-task__actions`};var _hoisted_21={key:3,class:`ai-task__footer`};var _hoisted_22={class:`ai-task__actions`};var _hoisted_23={key:4,class:`ai-task__footer`};var _hoisted_24={class:`ai-task__actions`};var _sfc_main={__name:`Vibe64AiTaskWindow`,props:{source:{required:true,type:Object},commentary:{required:true,type:Array},output:{required:true,type:Boolean}},setup(__props){const props=__props;const glyphIcons={attention:`$errorFilled`,done:`$checkCircleFilled`,"not-done":`$cancel`,turn:`$circle`};const titleId=useId();const title=ref(null);const task=computed(()=>props.source.task);const projection=computed(()=>props.source.projection);const footerActions=computed(()=>aiTaskFooterActions(projection.value.actions,props.source.view));const{width,height}=useDisplay();const fit=computed(()=>aiTaskFit(width.value,height.value));const detailsOpen=ref(false);const confirmingCancel=ref(false);const cancelling=computed(()=>props.source.cancelRequested||task.value.phase===`cancelling`);const tabs=[{id:`progress`,label:AI_TASK_MESSAGES.views.progress},{id:`chat`,label:AI_TASK_MESSAGES.views.chat}];const{focusTitle,moveBetweenViews,reducedMotion,returnFocus,setTab}=useAiTaskFocus({title,views:tabs.map(tab=>tab.id),selectedView:()=>props.source.view,setView:view=>props.source.setView(view),returnFocusTarget:()=>props.source.returnFocusTarget()});function requestCancel(){if(cancelling.value)props.source.cancel();else confirmingCancel.value=true}function cancel(){confirmingCancel.value=false;props.source.cancel()}function escape(){if(projection.value.ended)props.source.close();else props.source.hide()}watch(()=>projection.value.ended,async ended=>{if(!ended)return;confirmingCancel.value=false;await nextTick();focusTitle()});return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"aria-labelledby":unref(titleId),fullscreen:fit.value.fullscreen,height:fit.value.height,"model-value":__props.source.open,"no-click-animation":``,persistent:``,width:fit.value.width,transition:unref(reducedMotion)?false:void 0,onAfterEnter:unref(focusTitle),onAfterLeave:unref(returnFocus),onKeydown:withKeys(withModifiers(escape,[`stop`,`prevent`]),[`esc`])},{default:withCtx(()=>[createBaseVNode(`section`,{"aria-labelledby":unref(titleId),class:normalizeClass([`ai-task`,{"ai-task--fullscreen":fit.value.fullscreen,"ai-task--ended":projection.value.ended}]),"data-vibe64-ai-task":``,"data-vibe64-ai-task-phase":task.value.phase,"data-vibe64-ai-task-reason":task.value.reason},[createBaseVNode(`header`,_hoisted_2,[createBaseVNode(`span`,{class:normalizeClass([`ai-task__glyph`,`ai-task__glyph--${projection.value.glyph}`]),"aria-hidden":`true`},[projection.value.glyph===`working`?(openBlock(),createBlock(VProgressCircular,{key:0,indeterminate:!unref(reducedMotion),"model-value":unref(reducedMotion)?60:void 0,size:`20`,width:`2`},null,8,[`indeterminate`,`model-value`])):(openBlock(),createBlock(VIcon,{key:1,icon:glyphIcons[projection.value.glyph],size:`22`},null,8,[`icon`]))],2),createBaseVNode(`div`,_hoisted_3,[createBaseVNode(`h2`,{id:unref(titleId),ref_key:`title`,ref:title,tabindex:`-1`},toDisplayString(projection.value.ended?projection.value.outcome.heading:task.value.title),9,_hoisted_4),createBaseVNode(`p`,_hoisted_5,toDisplayString(projection.value.ended?task.value.title:projection.value.status),1)]),!projection.value.ended?(openBlock(),createElementBlock(`div`,_hoisted_6,[createVNode(VBtn,{"data-vibe64-ai-task-hide":``,variant:`text`,onClick:__props.source.hide},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).actions.hide),1)]),_:1},8,[`onClick`]),createVNode(VBtn,{"aria-busy":cancelling.value?`true`:void 0,"data-vibe64-ai-task-cancel":``,variant:`text`,onClick:requestCancel},{default:withCtx(()=>[createTextVNode(toDisplayString(cancelling.value?unref(AI_TASK_MESSAGES).actions.cancelling:unref(AI_TASK_MESSAGES).actions.cancel),1)]),_:1},8,[`aria-busy`])])):createCommentVNode(``,true)]),!projection.value.ended?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`div`,_hoisted_7,[createBaseVNode(`span`,{class:`ai-task__problem-line`,title:task.value.problem.summary},toDisplayString(task.value.problem.summary),9,_hoisted_8),task.value.problem.details?(openBlock(),createElementBlock(`button`,{key:0,"aria-expanded":detailsOpen.value?`true`:`false`,"aria-label":unref(AI_TASK_MESSAGES).actions.details,class:`ai-task__details-toggle`,"data-vibe64-ai-task-details":``,type:`button`,onClick:_cache[0]||(_cache[0]=$event=>detailsOpen.value=!detailsOpen.value)},[createBaseVNode(`span`,_hoisted_10,toDisplayString(unref(AI_TASK_MESSAGES).actions.details),1),createVNode(VIcon,{icon:detailsOpen.value?`$collapse`:`$expand`,size:`18`,"aria-hidden":`true`},null,8,[`icon`])],8,_hoisted_9)):createCommentVNode(``,true)]),detailsOpen.value?(openBlock(),createElementBlock(`pre`,_hoisted_11,toDisplayString(task.value.problem.details),1)):createCommentVNode(``,true),createBaseVNode(`div`,{"aria-label":unref(AI_TASK_MESSAGES).views.label,class:`ai-task__views`,role:`tablist`,onKeydown:_cache[1]||(_cache[1]=(...args)=>unref(moveBetweenViews)&&unref(moveBetweenViews)(...args))},[(openBlock(),createElementBlock(Fragment,null,renderList(tabs,tab=>{return createBaseVNode(`button`,{id:`${unref(titleId)}-${tab.id}-tab`,key:tab.id,ref_for:true,ref:element=>unref(setTab)(tab.id,element),"aria-controls":`${unref(titleId)}-${tab.id}`,"aria-selected":__props.source.view===tab.id?`true`:`false`,class:normalizeClass([`ai-task__view`,{"ai-task__view--selected":__props.source.view===tab.id}]),"data-vibe64-ai-task-view":tab.id,role:`tab`,tabindex:__props.source.view===tab.id?0:-1,type:`button`,onClick:$event=>__props.source.setView(tab.id)},[createTextVNode(toDisplayString(tab.label)+` `,1),tab.id===`chat`&&projection.value.chatDot?(openBlock(),createElementBlock(`span`,{key:0,class:`ai-task__dot`,role:`img`,"aria-label":unref(AI_TASK_MESSAGES).views.waiting},null,8,_hoisted_14)):createCommentVNode(``,true)],10,_hoisted_13)}),64))],40,_hoisted_12)],64)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_15,[!projection.value.ended?withDirectives((openBlock(),createElementBlock(`section`,{key:0,id:`${unref(titleId)}-progress`,"aria-labelledby":`${unref(titleId)}-progress-tab`,class:`ai-task__panel`,role:`tabpanel`},[createVNode(Vibe64AiTaskProgress_default,{commentary:__props.commentary,output:__props.output,projection:projection.value,task:task.value},{"check-output":withCtx(()=>[renderSlot(_ctx.$slots,`check-output`,{},void 0,true)]),_:3},8,[`commentary`,`output`,`projection`,`task`])],8,_hoisted_16)),[[vShow,__props.source.view===`progress`]]):!__props.source.transcriptOpen?(openBlock(),createBlock(Vibe64AiTaskOutcome_default,{key:1,projection:projection.value,task:task.value,onSeeConversation:_cache[2]||(_cache[2]=$event=>__props.source.setTranscript(true))},null,8,[`projection`,`task`])):createCommentVNode(``,true),withDirectives(createBaseVNode(`section`,{id:`${unref(titleId)}-chat`,"aria-labelledby":projection.value.ended?void 0:`${unref(titleId)}-chat-tab`,class:`ai-task__panel`,role:projection.value.ended?void 0:`tabpanel`},[renderSlot(_ctx.$slots,`chat`,{visible:__props.source.open&&(projection.value.ended?__props.source.transcriptOpen:__props.source.view===`chat`)},void 0,true)],8,_hoisted_17),[[vShow,!projection.value.ended?__props.source.view===`chat`:__props.source.transcriptOpen]])]),__props.source.error?(openBlock(),createElementBlock(`p`,_hoisted_18,toDisplayString(__props.source.error),1)):createCommentVNode(``,true),confirmingCancel.value?(openBlock(),createElementBlock(`footer`,_hoisted_19,[createBaseVNode(`p`,null,toDisplayString(projection.value.cancelQuestion),1),createBaseVNode(`div`,_hoisted_20,[createVNode(VBtn,{"data-vibe64-ai-task-keep-going":``,variant:`text`,onClick:_cache[3]||(_cache[3]=$event=>confirmingCancel.value=false)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).actions.keepGoing),1)]),_:1}),createVNode(VBtn,{color:`error`,"data-vibe64-ai-task-cancel-confirm":``,variant:`flat`,onClick:cancel},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).cancelConfirm(task.value.noun)),1)]),_:1})])])):projection.value.ended?(openBlock(),createElementBlock(`footer`,_hoisted_21,[createBaseVNode(`div`,_hoisted_22,[__props.source.transcriptOpen?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,onClick:_cache[4]||(_cache[4]=$event=>__props.source.setTranscript(false))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).outcome.showResult),1)]),_:1})):createCommentVNode(``,true),createVNode(VBtn,{"aria-busy":__props.source.closing?`true`:void 0,color:`primary`,"data-vibe64-ai-task-close":``,variant:`flat`,onClick:__props.source.close},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.source.closing?unref(AI_TASK_MESSAGES).actions.closing:unref(AI_TASK_MESSAGES).actions.close),1)]),_:1},8,[`aria-busy`,`onClick`])])])):footerActions.value.length?(openBlock(),createElementBlock(`footer`,_hoisted_23,[createBaseVNode(`div`,_hoisted_24,[(openBlock(true),createElementBlock(Fragment,null,renderList(footerActions.value,item=>{return openBlock(),createBlock(VBtn,{key:item.id,color:item.primary?`primary`:void 0,"data-vibe64-ai-task-action":item.id,variant:item.primary?`flat`:`text`,onClick:$event=>__props.source.run(item.id)},{default:withCtx(()=>[createTextVNode(toDisplayString(item.label),1)]),_:2},1032,[`color`,`data-vibe64-ai-task-action`,`variant`,`onClick`])}),128))])])):createCommentVNode(``,true)],10,_hoisted_1)]),_:3},8,[`aria-labelledby`,`fullscreen`,`height`,`model-value`,`width`,`transition`,`onAfterEnter`,`onAfterLeave`,`onKeydown`])}}};var Vibe64AiTaskWindow_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-5f35de55`]]);var REPOSITORY_STATUS_SESSION_REASONS=new Set([`claude-stream-turn-idle`,`codex-app-server-turn-idle`,`opencode-server-turn-idle`,`repository-canonical-changed`,`session-pull-request`,`session-repository-checked`,`session-save-completed`,`session-save-failed`,`session-save-started`,`session-save-update-required`,`session-starter-applied`,`session-turn-checkpoint-failed`,`session-turn-checkpoint-updated`,`session-update-completed`,`session-update-failed`,`session-update-started`]);var REPOSITORY_UPDATE_CHECK_FAILED_REASON=`session-repository-check-failed`;var REPOSITORY_CANONICAL_RECHECK_REASONS=new Set([`repository-canonical-changed`,`session-pull-request`,`session-save-failed`,`session-save-update-required`,`session-update-failed`]);function repositoryStatusSessionId(payload={}){const event=normalizeObject(payload);return String(event.sessionId||event.session?.sessionId||``).trim()}function repositoryStatusRealtimeShouldRefresh(payload={}){return REPOSITORY_STATUS_SESSION_REASONS.has(String(normalizeObject(payload).reason||``).trim())}function repositoryStatusRealtimeNeedsCanonicalCheck(payload={}){return REPOSITORY_CANONICAL_RECHECK_REASONS.has(String(normalizeObject(payload).reason||``).trim())}export{Vibe64AiTaskWindow_default as a,useAiTaskHost as c,repositoryStatusSessionId as i,AI_TASK_PHASES as l,repositoryStatusRealtimeNeedsCanonicalCheck as n,Vibe64AiTaskTray_default as o,repositoryStatusRealtimeShouldRefresh as r,Vibe64AiTaskButton_default as s,REPOSITORY_UPDATE_CHECK_FAILED_REASON as t,VIBE64_AI_TASKS_KEY as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Et as unref,H as openBlock,N as nextTick,Xt as toDisplayString,b as createVNode,d as createBaseVNode,f as createBlock,i as Fragment,it as watch,m as createElementBlock,ot as withCtx,p as createCommentVNode,u as computed,vt as ref,y as createTextVNode}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{S as VIcon,_ as VProgressLinear}from"./VChip-D2IukBZw.js";import{t as useEndpointResource}from"./useEndpointResource-CmMwteuX.js";import{t as VSelect}from"./VSelect-9lMtP5cu.js";import{t as VAlert}from"./VAlert-DyCQWe9P.js";import{t as VTextField}from"./VTextField-BMvaWVTN.js";import{i as scopedDevelopmentApiUrl}from"./studioUrls-k_pQIuPs.js";import{l as requestVibe64AiOnboarding,y as useModelRouting}from"./client-CVgL_ShV.js";import{t as VBtn}from"./VBtn-2vbH580C.js";import{t as VSheet}from"./VSheet-D5wAuyc2.js";import{t as VDialog}from"./VDialog-B2W9wqR8.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BFqQSnAE.js";import{t as VSpacer}from"./VSpacer-GgPR_AzN.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-C5ZRrPV4.js";import{t as VSwitch}from"./VSwitch-DUkp5sfW.js";import{t as VTextarea}from"./VTextarea-CLaWcpd_.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{t as _sfc_main$2}from"./SelectField-DwWoHC2p.js";import{t as useUiFeedback}from"./useUiFeedback-CWb6o71Z.js";import{t as readRefOrGetterValue}from"./vueRefOrGetterValue-y-4f_In7.js";import{L as vibe64SessionPath,k as vibe64RepositoryApiPath,o as VIBE64_SESSIONS_API_SUFFIX}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{b as sameVibe64AssistantSelection,c as vibe64AssistantSelectionLabel}from"./shared-B6plZPQ_.js";import{A as requestVibe64AccountConnectionsDialog,O as Vibe64SessionAssistantMenu_default}from"./index-fXKdz8oR.js";import{a as vibe64SessionPullRequest,i as vibe64SessionDisplayTitle}from"./vibe64SessionViewModel-CQCds_jb.js";import{a as githubProjectRepositoryName,t as GITHUB_BODY_MAX_LENGTH}from"./vibe64GithubProject-CJneIo5O.js";var _hoisted_1$1={class:`d-flex align-center justify-space-between ga-2 pa-5 pb-2`};var _hoisted_2$1={class:`d-flex align-center ga-3`};var _hoisted_3$1={class:`text-label-large`};var _hoisted_4$1={class:`text-body-medium mt-1`};var _hoisted_5$1={key:0,role:`status`};var _sfc_main$1={__name:`Vibe64CreatePullRequestDialog`,props:{modelValue:Boolean,dashboardContext:{required:true,type:Object}},emits:[`update:modelValue`,`created`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const title=ref(``);const body=ref(``);const draft=ref(true);const pending=ref(false);const destinationReview=ref(null);const feedback=useUiFeedback({source:`vibe64.pullRequests.create`});const session=computed(()=>props.dashboardContext.session||{});const source=computed(()=>vibe64SessionPullRequest(session.value));const repository=computed(()=>githubProjectRepositoryName(props.dashboardContext.projectContext));const branch=computed(()=>{if(source.value?.headBranch)return source.value.headBranch;const destination=props.dashboardContext.workState?.destination;if(destination?.mode===`github`&&destination.branch!==props.dashboardContext.projectContext?.repository?.defaultBranch)return destination.branch;return`vibe64/pr-${props.dashboardContext.sessionId}`});const base=computed(()=>source.value?.baseBranch||props.dashboardContext.projectContext?.repository?.defaultBranch||``);const path=computed(()=>vibe64SessionPath(readRefOrGetterValue(props.dashboardContext.sessionsApiPath),props.dashboardContext.sessionId,`/pull-request`));const resource=useEndpointResource({path,queryKey:computed(()=>[`vibe64.createPullRequest`,path.value]),enabled:false});watch(()=>props.modelValue,open=>{if(open)destinationReview.value=props.dashboardContext.workState?.destination?{...props.dashboardContext.workState.destination}:null},{immediate:true});watch(()=>props.dashboardContext.sessionId,()=>{title.value=source.value?.title||vibe64SessionDisplayTitle(session.value);body.value=source.value?.body||``;draft.value=true},{immediate:true});async function submit(){if(pending.value||!title.value.trim())return;pending.value=true;try{const result=await resource.save({title:title.value.trim(),body:body.value,draft:draft.value,destinationReview:destinationReview.value},{method:`POST`});feedback.success(`Pull request created. Future commits update its source branch.`);emit(`created`,result.pullRequest);emit(`update:modelValue`,false);props.dashboardContext.refreshSessionWork?.()}catch(error){feedback.error(error,`The pull request could not be confirmed. Retry to check GitHub and continue.`)}finally{pending.value=false}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`38rem`,scrollable:``,persistent:pending.value,"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{rounded:`xl`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$1,[createBaseVNode(`div`,_hoisted_2$1,[createVNode(VIcon,{icon:`$callMerge`,color:`primary`}),_cache[6]||(_cache[6]=createBaseVNode(`h2`,{class:`text-title-large`},`Create pull request`,-1))]),createVNode(VBtn,{icon:`$close`,size:`48`,variant:`text`,"aria-label":`Close pull request dialog`,disabled:pending.value,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,false))},null,8,[`disabled`])]),createVNode(VCardText,{class:`d-flex flex-column ga-3`},{default:withCtx(()=>[createVNode(VSheet,{color:`surface-light`,rounded:`lg`,class:`pa-3 pr-destination`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$1,toDisplayString(repository.value),1),createBaseVNode(`div`,_hoisted_4$1,toDisplayString(branch.value)+` → `+toDisplayString(base.value),1),_cache[7]||(_cache[7]=createBaseVNode(`p`,{class:`text-body-small on-surface-variant mt-2 mb-0`},`The base branch stays unchanged.`,-1))]),_:1}),_cache[8]||(_cache[8]=createBaseVNode(`p`,{class:`text-body-small ma-0`},`Save open file edits first.`,-1)),!destinationReview.value?(openBlock(),createElementBlock(`p`,_hoisted_5$1,`Refresh repository status before creating a pull request.`)):createCommentVNode(``,true),createVNode(VTextField,{modelValue:title.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>title.value=$event),label:`Title`,variant:`outlined`,maxlength:`256`,disabled:pending.value,"hide-details":``},null,8,[`modelValue`,`disabled`]),createVNode(VTextarea,{modelValue:body.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>body.value=$event),label:`Description`,placeholder:`What changed, and how did you check it?`,variant:`outlined`,rows:`3`,"auto-grow":``,maxlength:unref(GITHUB_BODY_MAX_LENGTH),disabled:pending.value,"hide-details":``},null,8,[`modelValue`,`maxlength`,`disabled`]),createVNode(VSwitch,{modelValue:draft.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>draft.value=$event),color:`primary`,label:`Create as draft`,disabled:pending.value,"hide-details":``},null,8,[`modelValue`,`disabled`]),_cache[9]||(_cache[9]=createBaseVNode(`details`,{class:`pr-details text-body-small`},[createBaseVNode(`summary`,{class:`py-3`},`What gets pushed`),createBaseVNode(`p`,null,`All saved file changes are committed and pushed to the PR branch. Database data and chat history are separate. GitHub automation may run; this does not publish the app.`)],-1))]),_:1}),createVNode(VCardActions,{class:`pa-5 pt-2`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{variant:`text`,disabled:pending.value,onClick:_cache[4]||(_cache[4]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[10]||(_cache[10]=[createTextVNode(`Cancel`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{color:`primary`,variant:`flat`,rounded:`pill`,disabled:pending.value||!title.value.trim()||!destinationReview.value||__props.dashboardContext.sourceOperationsSuspended,"aria-busy":pending.value,onClick:submit},{default:withCtx(()=>[createTextVNode(toDisplayString(pending.value?`Creating…`:draft.value?`Create draft PR`:`Create pull request`),1)]),_:1},8,[`disabled`,`aria-busy`])]),_:1})]),_:1})]),_:1},8,[`model-value`,`persistent`])}}};var Vibe64CreatePullRequestDialog_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-3f93a801`]]);var _hoisted_1={class:`vibe64-assistant-dialog__title-copy`};var _hoisted_2={class:`text-body-small`};var _hoisted_3={key:2,class:`vibe64-assistant-dialog__ai`};var _hoisted_4={class:`text-body-medium mb-0`};var _hoisted_5={key:3,class:`d-flex flex-column ga-2`};var _hoisted_6={key:0,class:`d-flex flex-column ga-3 mt-3`};var _hoisted_7={key:0,class:`text-body-small`,style:{"overflow-wrap":`anywhere`}};var _hoisted_8={key:0,class:`vibe64-assistant-dialog__progress`,role:`status`,"aria-live":`polite`};var _sfc_main={__name:`Vibe64AssistantSessionDialog`,props:{modelValue:Boolean,toolbar:{required:true,type:Object}},emits:[`created`,`update:model-value`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const routing=useModelRouting({enabled:computed(()=>props.modelValue),view:`main`});const mainSelection=routing.mainChatSelection;const openConnectionSettings=()=>requestVibe64AccountConnectionsDialog({section:`ai`});const canChooseSessionAi=computed(()=>routing.resource.data.value?.canConfigure===true);const sessionAi=ref(null);const customOpen=ref(false);const changeButton=ref(null);const aiSummary=computed(()=>sessionAi.value?`This session runs on: ${vibe64AssistantSelectionLabel(sessionAi.value)}`:`Runs on your main AI: ${vibe64AssistantSelectionLabel(mainSelection.value)}`);function openSessionAiChoice(){if(canChooseSessionAi.value&&!submitting.value)customOpen.value=true}function chooseSessionAi(selection){sessionAi.value=sameVibe64AssistantSelection(selection,mainSelection.value)?null:selection;return{ok:true}}function useMainAi(){sessionAi.value=null}function setUpAi(){close();requestVibe64AiOnboarding()}const submitButton=ref(null);const submitting=computed(()=>props.toolbar.createSessionRunning===true);const branchMode=ref(`project`);const chooseBranch=computed(()=>branchMode.value!==`project`);const createBranch=computed(()=>branchMode.value===`new`);const branchName=ref(``);const newBranchName=ref(``);const branchProject=computed(()=>props.toolbar.projectContext||{});const branchSelectionAvailable=computed(()=>!props.toolbar.repositoryBranchSelectionDisabled&&[`github`,`managed_git`].includes(branchProject.value.repositoryMode||branchProject.value.repository?.mode));const branchChoices=computed(()=>[{title:`Project branch (${branchProject.value.repository?.defaultBranch||`main`})`,value:`project`},{title:`Create a new branch`,value:`new`},{title:`Use an existing branch`,value:`existing`}]);const branchRepository=computed(()=>branchProject.value.githubRepository?.fullName||branchProject.value.repository?.github?.fullName||branchProject.value.slug);const branchPath=computed(()=>scopedDevelopmentApiUrl(`${vibe64RepositoryApiPath(`/api${VIBE64_SESSIONS_API_SUFFIX}`)}/branches`,branchProject.value.slug));const branches=useEndpointResource({path:branchPath,queryKey:computed(()=>[`vibe64.branches`,branchPath.value]),enabled:computed(()=>props.modelValue&&branchSelectionAvailable.value&&chooseBranch.value),queryOptions:{retry:false},fallbackLoadError:`Repository branches could not load.`});const selectedBranch=computed(()=>branches.data.value?.branches?.find(item=>item.name===branchName.value));const branchAlreadyExists=computed(()=>branches.data.value?.branches?.some(item=>item.name===newBranchName.value.trim()));const branchSelectionReady=computed(()=>{if(!chooseBranch.value)return true;if(!selectedBranch.value||branches.isLoading.value||branches.loadError.value)return false;return!createBranch.value||Boolean(newBranchName.value.trim())&&!branchAlreadyExists.value});watch(()=>branches.data.value,value=>{if(!value?.branches?.some(item=>item.name===branchName.value))branchName.value=value?.defaultBranch||``},{immediate:true});function close(){if(!submitting.value)emit(`update:model-value`,false)}async function submit(){if(!mainSelection.value||submitting.value||!branchSelectionReady.value)return;let response;try{const options={};if(chooseBranch.value)options.repositoryBranch={name:createBranch.value?newBranchName.value.trim():branchName.value,...createBranch.value?{fromBranch:branchName.value}:{},expectedCommit:selectedBranch.value.commit};response=await props.toolbar.createSession(sessionAi.value||{},options)}catch{return}if(response?.ok!==false&&response?.sessionId){emit(`created`,response);emit(`update:model-value`,false)}}watch(()=>props.modelValue,open=>{if(!open)return;branchMode.value=`project`;branchName.value=branches.data.value?.defaultBranch||``;newBranchName.value=``;sessionAi.value=null;customOpen.value=false},{immediate:true});watch(submitting,async(running,wasRunning)=>{if(running||!wasRunning||!props.modelValue)return;await nextTick();const target=submitButton.value?.$el;if(target?.isConnected===true)target.focus({preventScroll:true})});return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,persistent:submitting.value,"max-width":`38rem`,scrollable:``,"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>!$event&&close())},{default:withCtx(()=>[createVNode(VCard,{class:`vibe64-assistant-dialog`,rounded:`xl`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`vibe64-assistant-dialog__title`},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1,[_cache[7]||(_cache[7]=createBaseVNode(`strong`,{class:`text-title-large`},`Start an AI session`,-1)),createBaseVNode(`small`,_hoisted_2,toDisplayString(sessionAi.value?`Starts in Custom. Choose Senior, Junior or Auto from chat.`:`Starts in Auto. Choose Senior or Junior from chat.`),1)]),createVNode(VBtn,{"aria-label":`Close AI session dialog`,disabled:submitting.value,icon:`$close`,title:`Close`,variant:`text`,onClick:close},null,8,[`disabled`])]),_:1}),createVNode(VCardText,{class:`vibe64-assistant-dialog__body`},{default:withCtx(()=>[unref(routing).resource.isInitialLoading.value?(openBlock(),createBlock(VSkeletonLoader,{key:0,type:`list-item-two-line`})):unref(routing).loadError.value?(openBlock(),createBlock(VAlert,{key:1,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(routing).loadError.value)+` `,1),createVNode(VBtn,{variant:`text`,onClick:_cache[0]||(_cache[0]=$event=>unref(routing).resource.reload())},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Try again`,-1)])]),_:1})]),_:1})):unref(mainSelection)?(openBlock(),createElementBlock(`div`,_hoisted_3,[createBaseVNode(`p`,_hoisted_4,[createTextVNode(toDisplayString(aiSummary.value)+` `,1),canChooseSessionAi.value?(openBlock(),createBlock(VBtn,{key:0,ref_key:`changeButton`,ref:changeButton,disabled:submitting.value,size:`small`,variant:`text`,onClick:openSessionAiChoice},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(` Change `,-1)])]),_:1},8,[`disabled`])):createCommentVNode(``,true),sessionAi.value?(openBlock(),createBlock(VBtn,{key:1,disabled:submitting.value,size:`small`,variant:`text`,onClick:useMainAi},{default:withCtx(()=>[..._cache[10]||(_cache[10]=[createTextVNode(`Use main AI`,-1)])]),_:1},8,[`disabled`])):createCommentVNode(``,true)]),createVNode(VBtn,{class:`vibe64-assistant-dialog__main-ai`,disabled:submitting.value,"prepend-icon":`$settings`,size:`small`,variant:`text`,onClick:openConnectionSettings},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(` Change main AI for all sessions `,-1)])]),_:1},8,[`disabled`])])):(openBlock(),createElementBlock(`div`,_hoisted_5,[_cache[13]||(_cache[13]=createBaseVNode(`strong`,null,`No AI is set up yet`,-1)),_cache[14]||(_cache[14]=createBaseVNode(`span`,{class:`text-body-small`},`Set up your AI, then come back to start a session.`,-1)),createVNode(VBtn,{color:`primary`,variant:`flat`,class:`align-self-start`,onClick:setUpAi},{default:withCtx(()=>[..._cache[12]||(_cache[12]=[createTextVNode(`Set up your AI`,-1)])]),_:1})])),branchSelectionAvailable.value?(openBlock(),createElementBlock(Fragment,{key:4},[createVNode(VSelect,{modelValue:branchMode.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>branchMode.value=$event),items:branchChoices.value,label:`Work on`,disabled:submitting.value,"hide-details":``,class:`mt-4`},null,8,[`modelValue`,`items`,`disabled`]),chooseBranch.value?(openBlock(),createElementBlock(`div`,_hoisted_6,[createBranch.value?(openBlock(),createBlock(VTextField,{key:0,modelValue:newBranchName.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>newBranchName.value=$event),label:`New branch name`,placeholder:`e.g. improve-booking`,maxlength:`255`,disabled:submitting.value,"error-messages":newBranchName.value.trim()&&branchAlreadyExists.value?`That branch already exists. Choose an existing branch instead.`:``,"hide-details":`auto`},null,8,[`modelValue`,`disabled`,`error-messages`])):createCommentVNode(``,true),unref(branches).isLoading.value?(openBlock(),createBlock(VSkeletonLoader,{key:1,type:`list-item-two-line, paragraph`})):unref(branches).loadError.value?(openBlock(),createBlock(VAlert,{key:2,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(branches).loadError.value)+` `,1),createVNode(VBtn,{variant:`text`,onClick:_cache[3]||(_cache[3]=$event=>unref(branches).reload())},{default:withCtx(()=>[..._cache[15]||(_cache[15]=[createTextVNode(`Try again`,-1)])]),_:1})]),_:1})):(openBlock(),createElementBlock(Fragment,{key:3},[createVNode(unref(_sfc_main$2),{modelValue:branchName.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>branchName.value=$event),items:unref(branches).data.value?.branches||[],loading:unref(branches).isLoading.value,"item-title":`name`,"item-value":`name`,label:createBranch.value?`Create from`:`Branch`,disabled:submitting.value,"hide-details":``},null,8,[`modelValue`,`items`,`loading`,`label`,`disabled`]),selectedBranch.value?(openBlock(),createElementBlock(`p`,_hoisted_7,toDisplayString(createBranch.value?`Creates the branch and opens a new session.`:`Opens a new session on this branch.`)+` Your changes will be saved to `+toDisplayString(branchRepository.value)+`:`+toDisplayString(createBranch.value?newBranchName.value.trim()||`your new branch`:branchName.value)+`. `,1)):createCommentVNode(``,true),_cache[16]||(_cache[16]=createBaseVNode(`p`,{class:`text-body-small`},`Publishing the app still uses the project branch.`,-1))],64))])):createCommentVNode(``,true)],64)):createCommentVNode(``,true)]),_:1}),submitting.value?(openBlock(),createElementBlock(`div`,_hoisted_8,[createVNode(VProgressLinear,{indeterminate:``,color:`primary`,rounded:``}),_cache[17]||(_cache[17]=createBaseVNode(`p`,{class:`text-body-small mb-0`},` Copying the project source for the new session. This can take a little while for a large project. Any connected repositories and workspace setup then continue in the session, which shows their progress. `,-1))])):createCommentVNode(``,true),createVNode(VCardActions,{class:`vibe64-assistant-dialog__actions`},{default:withCtx(()=>[createVNode(VBtn,{disabled:submitting.value,variant:`text`,onClick:close},{default:withCtx(()=>[..._cache[18]||(_cache[18]=[createTextVNode(`Cancel`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{ref_key:`submitButton`,ref:submitButton,"aria-busy":submitting.value?`true`:void 0,color:`primary`,disabled:!unref(mainSelection)||submitting.value||!branchSelectionReady.value,variant:`flat`,onClick:submit},{default:withCtx(()=>[createTextVNode(toDisplayString(submitting.value?`Creating session…`:chooseBranch.value&&createBranch.value?`Create branch & session`:`Create session`),1)]),_:1},8,[`aria-busy`,`disabled`])]),_:1}),createVNode(Vibe64SessionAssistantMenu_default,{modelValue:customOpen.value,"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>customOpen.value=$event),target:changeButton.value?.$el||null,selection:sessionAi.value||unref(mainSelection),"can-configure":canChooseSessionAi.value,"changes-disabled":submitting.value,"save-selection":chooseSessionAi},null,8,[`modelValue`,`target`,`selection`,`can-configure`,`changes-disabled`])]),_:1})]),_:1},8,[`model-value`,`persistent`])}}};var Vibe64AssistantSessionDialog_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-2024d654`]]);var CREATED_SESSION_FOCUS_TIMEOUT_MS=2e3;async function focusCreatedVibe64SessionTab(sessionId=``){const normalizedSessionId=String(sessionId||``).trim();if(!normalizedSessionId||typeof document===`undefined`)return false;const deadline=Date.now()+CREATED_SESSION_FOCUS_TIMEOUT_MS;while(Date.now()<deadline){const dialogVisible=[...document.querySelectorAll(`.vibe64-assistant-dialog`)].some(element=>element.getClientRects().length>0);const target=[...document.querySelectorAll(`[data-vibe64-session-id]`)].find(element=>element.getAttribute(`data-vibe64-session-id`)===normalizedSessionId&&element.getClientRects().length>0);if(!dialogVisible&&target){target.focus({preventScroll:true});return document.activeElement===target}await new Promise(resolve=>{(globalThis.requestAnimationFrame||(callback=>setTimeout(callback,16)))(resolve)})}return false}export{Vibe64AssistantSessionDialog_default as n,Vibe64CreatePullRequestDialog_default as r,focusCreatedVibe64SessionTab as t};
|