vibe64 0.1.57 → 0.1.59
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/run.js +585 -585
- package/bin/server.js +169 -169
- package/bin/upgrade-state.js +1161 -1161
- package/dist/assets/{GithubBrowserTabs-DfRzbuSv.js → GithubBrowserTabs-D_nMB5Y1.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-7LqUsfAQ.js → LocalDatabaseServer-BgO_aeUg.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-DGm_9G9A.js → Vibe64AuthSettingsButton-Bx9patil.js} +1 -1
- package/dist/assets/{Vibe64ConversationLog-DlwCuaVi.js → Vibe64ConversationLog-DtOgxPNR.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-CZ5cMJ9k.js → Vibe64DashboardShell-DhPE6H3P.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-DfZpwSzB.js → Vibe64DatabaseWorkspace-CHV0cd3l.js} +1 -1
- package/dist/assets/{Vibe64OutputControls-CkXzIhro.js → Vibe64OutputControls-mNWUWLSm.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-BZQwcfGG.js → Vibe64SessionFiles-BXt__PJL.js} +1 -1
- package/dist/assets/{Vibe64SessionSourceEditor-CSX0GD_w.js → Vibe64SessionSourceEditor-NyG6niQM.js} +1 -1
- package/dist/assets/{Vibe64UiStoryboardView-Tml9lmTO.js → Vibe64UiStoryboardView-BXH2MSWn.js} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-D1LJQ7jc.js → Vibe64UnavailableSessions-CCPWJo8e.js} +1 -1
- package/dist/assets/{_pageId_-myxTAoqm.js → _pageId_-D54CqzqG.js} +1 -1
- package/dist/assets/{_sessionId_-BM4eQHUu.js → _sessionId_-CW044RVi.js} +1 -1
- package/dist/assets/{_slug_-C1Zt2FsE.js → _slug_-CRtFhc0A.js} +5 -5
- package/dist/assets/{_slug_-BvyD0DHo.css → _slug_-WWvJTLoc.css} +1 -1
- package/dist/assets/{access-DbK06uO7.js → access-ChMLRErk.js} +1 -1
- package/dist/assets/{app-D35Na9o5.js → app-D9FegZf0.js} +1 -1
- package/dist/assets/assistantRouting-D4SnnxJn.js +3 -0
- package/dist/assets/{client-C5sPrfkm.js → client-BBqNv4HL.js} +1 -1
- package/dist/assets/{client-CjNw-kf-.js → client-DnjkdG6K.js} +1 -1
- package/dist/assets/{client-DT3BbWpI.js → client-Dra4Vp3A.js} +2 -2
- package/dist/assets/{client-BTq67t0Y.js → client-DuDOzb5A.js} +2 -2
- package/dist/assets/{client-CkV1cE5C.js → client-mU-LObHG.js} +1 -1
- package/dist/assets/{dashboard-CbOtBwwu.js → dashboard-B26QwE6y.js} +1 -1
- package/dist/assets/{english-definitions--F8iwoB9.js → english-definitions-I9tIXY2u.js} +1 -1
- package/dist/assets/{env-BxyHxFmS.js → env-BXsvM592.js} +1 -1
- package/dist/assets/{health-Bnnb6E2j.js → health-C4WtefLm.js} +1 -1
- package/dist/assets/{history-1Xemjfmv.js → history-HHPFoNi3.js} +1 -1
- package/dist/assets/index-BBfSvf2i.css +1 -0
- package/dist/assets/{index-Btrr1DGq.js → index-Bvd00puv.js} +3 -3
- package/dist/assets/{integrations-hQJR-UJM.js → integrations-CQNJxkMu.js} +1 -1
- package/dist/assets/{issues-0y_naQdl.js → issues-BHr_nI-9.js} +1 -1
- package/dist/assets/{learning-CG0NUB8v.js → learning-0cINHUSN.js} +1 -1
- package/dist/assets/{pages-CHjGYtFn.js → pages-CIKw99GN.js} +1 -1
- package/dist/assets/{project-files-S6i36bSy.js → project-files-CklWobqZ.js} +1 -1
- package/dist/assets/{publish-BmfmLaWn.js → publish-Cot797YN.js} +1 -1
- package/dist/assets/{pull-requests-COBi3Wfj.js → pull-requests-ybnixBv0.js} +1 -1
- package/dist/assets/{settings-D0U9Lxsg.js → settings-DJByC5Wb.js} +1 -1
- package/dist/assets/{useArchivedVibe64Sessions-DQcmDT-k.js → useArchivedVibe64Sessions-B-DtXrk-.js} +1 -1
- package/dist/assets/{useVibe64ConversationLog-yo2ewb9G.js → useVibe64ConversationLog-BVANhCHq.js} +2 -2
- package/dist/assets/{useVibe64SessionData-DngAc96i.js → useVibe64SessionData-rBvWMqyc.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-Cxt1pCjM.js → useVibe64SessionSelection-C546mBu8.js} +1 -1
- package/dist/assets/{vibe64SessionFocus-CQraoYFY.js → vibe64SessionFocus-CxX2nK6F.js} +1 -1
- package/dist/assets/vibe64SessionFocus-DW73PN_o.css +1 -0
- package/dist/index.html +5 -5
- package/docs/colleague-usage/auto-workflow.md +2 -2
- package/docs/colleague-usage/chat-settings.md +7 -3
- package/docs/colleague-usage/coding-agents.md +10 -0
- package/docs/colleague-usage/sessions.md +2 -1
- package/docs/colleague-usage/ui-pass.md +8 -8
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +2 -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/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/connectors-core/README.md +8 -0
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +3 -0
- package/node_modules/@jskit-ai/kernel/package.json +1 -1
- package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +2 -0
- package/node_modules/@jskit-ai/payments-core/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/CHANGELOG.md +2 -0
- package/node_modules/@jskit-ai/realtime/package.json +1 -1
- package/node_modules/@jskit-ai/resource-core/CHANGELOG.md +5 -0
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/resource-core/patterns/table-resource/PATTERN.md +7 -4
- package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-execution/src/server/gitTurnCheckpointCommand.js +145 -530
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +89 -89
- package/node_modules/@local/vibe64-genesis/src/server/index.js +325 -322
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +41 -41
- package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +66 -66
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +318 -318
- package/package.json +14 -14
- package/server.bundle.mjs +33440 -33403
- package/dist/assets/assistantRouting--Xm-hai_.js +0 -3
- package/dist/assets/index-CmzEKG3z.css +0 -1
- package/dist/assets/vibe64SessionFocus-CcHYt9SU.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Et as unref,ht as proxyRefs,it as watch,mt as onScopeDispose,u as computed,vt as ref}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{N as useQueryClient,t as useEndpointResource}from"./useEndpointResource-61E93qP-.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-rsYWyW6m.js";import{s as normalizeObject}from"./normalize-BD25VwNK.js";import{o as projectSlugFromRoute}from"./vibe64ProjectScope.local-B9ZpdYlf.js";import{o as ROUTE_VISIBILITY_PUBLIC}from"./visibility-Cq31Xy7I.js";import{r as useRealtimeEvent}from"./useRealtimeEvent-B4oRg9Dt.js";import{t as useCommand}from"./useCommand-D96utlVe.js";import{t as usePaths}from"./usePaths-B-QGqa_I.js";import{t as useUiFeedback}from"./useUiFeedback-CycH_fvY.js";import{t as readRefOrGetterValue}from"./vueRefOrGetterValue-y-4f_In7.js";import{r as vibe64RealtimeOriginPayload}from"./vibe64BrowserTabOrigin-vIN_87mi.js";import{H as vibe64SessionsQueryKey,I as vibe64SessionEventMatchesScope,L as vibe64SessionPath,V as vibe64SessionQueryKey,a as VIBE64_CURRENT_SESSION_API_SUFFIX,c as VIBE64_SESSION_SUMMARY_CHANGED_EVENT,o as VIBE64_SESSIONS_API_SUFFIX}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{S as VIBE64_PROJECT_CHANGED_EVENT}from"./studioGateApi-CHIdcQvD.js";import{P as useVibe64ProjectSlug}from"./index-Btrr1DGq.js";import{i as vibe64SessionDisplayTitle,o as vibe64SessionRevision,r as shortVibe64SessionId,t as isArchivedVibe64Session}from"./vibe64SessionViewModel-CQCds_jb.js";import{i as vibe64SessionDebugSummary,n as vibe64SessionDebugError,r as vibe64SessionDebugLog,t as vibe64SessionDebugDurationMs}from"./vibe64SessionDebugLog-BfO7tG1A.js";import{i as visibleVibe64Sessions,n as enrichVibe64SessionForDisplay}from"./vibe64SessionPanelModel-B-WkXnPu.js";import{n as useVibe64SessionSelection,t as selectedSessionIdFromRoute}from"./useVibe64SessionSelection-Cxt1pCjM.js";function refetchEndpointResource(resource){return resource.query.refetch({cancelRefetch:false})}function sessionChangedReason(payload){return String(payload.reason||``).trim()}function sessionRevision(value){const revision=Number(value);return Number.isSafeInteger(revision)&&revision>=0?revision:null}function agentTurnRealtimeOverlayFromPayload(input,selectedSessionId=``){const payload=normalizeObject(input);const changedSessionId=String(payload.sessionId||payload.entityId||``).trim();if(!changedSessionId||changedSessionId!==String(selectedSessionId||``).trim())return null;const agentSession=normalizeObject(payload.agentSession);const turn=normalizeObject(agentSession.turn);const run=normalizeObject(payload.agentRun);const revision=sessionRevision(payload.revision);if(revision===null||!Object.keys(turn).length&&!Object.keys(run).length)return null;const active=turn.active===true||run.active===true;return{active,agentRun:{...run,active},agentSession:{...agentSession,turn:{...turn,active}},reason:sessionChangedReason(payload),revision,sessionId:changedSessionId}}function latestAgentTurnRealtimeOverlay(current=null,candidate=null){if(!candidate)return current;if(!current||candidate.revision>current.revision)return candidate;return current}function mergeAgentRunOverlay(agentRuns=[],overlayRun={}){const runs=Array.isArray(agentRuns)?agentRuns:[];const runId=String(overlayRun.id||``).trim();if(!runId)return runs;const nextRun={...overlayRun,id:runId};const index=runs.findIndex(run=>String(run?.id||``).trim()===runId);if(index<0)return[...runs,nextRun];return runs.map((run,runIndex)=>runIndex===index?{...run,...nextRun}:run)}function sessionWithAgentTurnRealtimeOverlay(session=null,overlay=null){const currentRevision=sessionRevision(session?.revision);if(!session||!overlay||session?.ok===false||session.sessionId!==overlay.sessionId||currentRevision!==null&&overlay.revision<=currentRevision)return session;const overlayAgentSession=normalizeObject(overlay.agentSession);return{...session,agentRuns:mergeAgentRunOverlay(session.agentRuns,normalizeObject(overlay.agentRun)),agentSession:{...normalizeObject(session.agentSession),...overlayAgentSession,thread:{...normalizeObject(session.agentSession?.thread),...normalizeObject(overlayAgentSession.thread)},turn:{...normalizeObject(session.agentSession?.turn),...normalizeObject(overlayAgentSession.turn),active:overlay.active===true}},revision:overlay.revision}}function sessionRecordHasDetailProjection(session=null){return Boolean(session&&typeof session===`object`&&Object.hasOwn(session,`agentSession`))}function sessionRecordHasActiveAgentWork(session=null){return(session?.agentSession?.turn?.active??session?.agentActivity?.active)===true}function sessionRecordMatchesId(session=null,sessionId=``){const normalizedSessionId=String(sessionId||``).trim();return Boolean(normalizedSessionId&&session?.sessionId===normalizedSessionId&&session?.ok!==false)}function latestSessionDetailRecord(current=null,candidate=null,sessionId=``){if(!sessionRecordMatchesId(candidate,sessionId))return current;if(!sessionRecordMatchesId(current,sessionId))return candidate;const currentRevision=vibe64SessionRevision(current);const candidateRevision=vibe64SessionRevision(candidate);if(currentRevision!==null&&candidateRevision!==null&&candidateRevision<currentRevision)return current;return candidate}function mountedSessionRecord(detailSession=null,listSession=null,sessionId=``){const normalizedSessionId=String(sessionId||``).trim();const listSessionMatches=sessionRecordMatchesId(listSession,normalizedSessionId);if(!sessionRecordMatchesId(detailSession,normalizedSessionId))return listSessionMatches?listSession:null;const detailRevision=vibe64SessionRevision(detailSession);const listRevision=vibe64SessionRevision(listSession);if(listSessionMatches&&listRevision!==null&&detailRevision!==null&&listRevision>detailRevision){if(sessionRecordHasDetailProjection(detailSession)&&!sessionRecordHasDetailProjection(listSession))return detailSession;return listSession}return detailSession}function mountedSessionDetailRefreshReason(detailSession=null,listSession=null,sessionId=``){const normalizedSessionId=String(sessionId||``).trim();if(!sessionRecordMatchesId(detailSession,normalizedSessionId)||!sessionRecordMatchesId(listSession,normalizedSessionId))return``;const detailRevision=vibe64SessionRevision(detailSession);const listRevision=vibe64SessionRevision(listSession);if(listRevision!==null&&detailRevision!==null&&listRevision>detailRevision&&sessionRecordHasDetailProjection(detailSession)&&!sessionRecordHasDetailProjection(listSession))return`newer_summary_without_detail`;return``}function mountedSessionDetailLoadState({detailSession=null,fetching=false,listSession=null,loadError=``,loading=false,sessionId=``}={}){const normalizedSessionId=String(sessionId||``).trim();const hasDetail=sessionRecordMatchesId(detailSession,normalizedSessionId);const hasSummary=sessionRecordMatchesId(listSession,normalizedSessionId);const error=String(loadError||``).trim();if(!normalizedSessionId)return{error:``,label:``,loading:false,ready:false,restoring:false,sessionId:``,state:`summaryOnly`};if(error&&!hasDetail)return{error,label:`Session could not load.`,loading:false,ready:false,restoring:false,sessionId:normalizedSessionId,state:`detailError`};if(hasDetail)return{error:``,label:``,loading:false,ready:true,refreshing:Boolean(fetching||loading),restoring:false,sessionId:normalizedSessionId,state:`detailReady`};if(loading||fetching)return{error:``,label:`Loading session...`,loading:true,ready:false,restoring:false,sessionId:normalizedSessionId,state:`detailLoading`};return{error:``,label:hasSummary?`Session could not load.`:`Loading session...`,loading:false,ready:false,restoring:false,sessionId:normalizedSessionId,state:`summaryOnly`}}function mountedSessionRealtimeShouldRefresh({payload={}}={},sessionId=``,read=`includeDetail`){const changedSessionId=String(payload.sessionId||payload.entityId||``).trim();if(!changedSessionId||changedSessionId!==String(sessionId||``).trim())return false;return payload.clientRefresh?.[read]!==false}function useVibe64SessionDialogs({beginArchive,finishArchive,isSelectedSessionArchived,refreshSessionData,selectedSessionId,selectedSessionTitle,sessionsApiPath}){const archiveDialogOpen=ref(false);const archiveDialogSessionId=ref(``);const archiveDialogSessionTitle=ref(``);const archivingSessionId=ref(``);const resolvedSessionsApiPath=computed(()=>String(readRefOrGetterValue(sessionsApiPath)||``));const archiveCommand=useCommand({access:`never`,apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildRawPayload:()=>vibe64RealtimeOriginPayload(),buildCommandOptions:(_payload,{context})=>({method:`POST`,path:vibe64SessionPath(resolvedSessionsApiPath.value,context?.sessionId,`/archive`)}),fallbackRunError:`Vibe64 session could not be archived.`,messages:{error:`Vibe64 session could not be archived.`,success:`Vibe64 session archived.`},onRunSuccess:async response=>{if(response?.ok!==true)throw new Error(response?.errors?.[0]?.message||response?.error||`Vibe64 session could not be archived.`)},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.archive`,surfaceId:`app`,writeMethod:`POST`});function clearArchiveDialog(){archiveDialogOpen.value=false;archiveDialogSessionId.value=``;archiveDialogSessionTitle.value=``}function requestArchiveSelectedSession(){if(!unref(selectedSessionId)||archivingSessionId.value||archiveCommand.isRunning||unref(isSelectedSessionArchived))return;archiveDialogSessionId.value=unref(selectedSessionId);archiveDialogSessionTitle.value=unref(selectedSessionTitle);archiveDialogOpen.value=true}function cancelArchiveSession(){if(!archiveCommand.isRunning)clearArchiveDialog()}async function confirmArchiveSession(){if(!archiveDialogSessionId.value||archivingSessionId.value||archiveCommand.isRunning)return false;const sessionId=archiveDialogSessionId.value;archivingSessionId.value=sessionId;clearArchiveDialog();const archiveScope=beginArchive(sessionId);let succeeded=false;try{const response=await archiveCommand.run({sessionId});succeeded=response?.ok===true;return response}catch{return false}finally{finishArchive(sessionId,succeeded,archiveScope);if(archivingSessionId.value===sessionId)archivingSessionId.value=``;refreshSessionData({reason:`archive-session`}).catch(()=>null)}}return{archiving:computed(()=>Boolean(archivingSessionId.value)),archivingSessionId,cancel:cancelArchiveSession,command:archiveCommand,confirm:confirmArchiveSession,open:archiveDialogOpen,request:requestArchiveSelectedSession,sessionId:archiveDialogSessionId,sessionTitle:archiveDialogSessionTitle}}function useVibe64SessionCreation({projectSlug,refreshSessionDataInBackground,selectSessionId,sessionListQueryKey,sessionsApiPath}){const queryClient=useQueryClient();const createSessionCommand=useCommand({access:`never`,apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`POST`,path:context?.apiPath}),buildRawPayload:(_model,{context})=>vibe64RealtimeOriginPayload({assistantSelection:context?.assistantSelection||{},...context?.repositoryBranch?{repositoryBranch:context.repositoryBranch}:{},...context?.pullRequestNumber?{pullRequestNumber:context.pullRequestNumber}:{}}),fallbackRunError:`Vibe64 session could not be created.`,messages:{error:`Vibe64 session could not be created.`,success:`Vibe64 session created.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.create`,surfaceId:`app`,writeMethod:`POST`});const createSessionRunning=ref(false);let createSessionInFlight=null;let disposed=false;onScopeDispose(()=>{disposed=true});async function createSession(assistantSelection={},{pullRequestNumber,repositoryBranch}={}){if(createSessionInFlight)return createSessionInFlight;const startedAtMs=Date.now();const creationProjectSlug=String(projectSlug.value||``).trim();const creationApiPath=sessionsApiPath.value;const creationQueryKey=[...sessionListQueryKey.value];vibe64SessionDebugLog(`client.sessionData.createSession.start`);createSessionRunning.value=true;createSessionInFlight=(async()=>{try{const response=await createSessionCommand.run({assistantSelection,pullRequestNumber,repositoryBranch,apiPath:creationApiPath});if(!disposed&&creationProjectSlug===String(projectSlug.value||``).trim()){if(response?.creation&&response?.limits)queryClient.setQueryData(creationQueryKey,currentPayload=>{if(!currentPayload||typeof currentPayload!==`object`||Array.isArray(currentPayload))return currentPayload;const currentSessions=Array.isArray(currentPayload.sessions)?currentPayload.sessions:[];const createdSession=response.sessionId?Object.fromEntries(Object.entries(response).filter(([key])=>![`creation`,`limits`,`ok`].includes(key))):null;return{...currentPayload,creation:response.creation,limits:response.limits,...createdSession&&!currentSessions.some(item=>item?.sessionId===createdSession.sessionId)?{sessions:[...currentSessions,createdSession]}:{}}});if(response?.sessionId)selectSessionId(response.sessionId);refreshSessionDataInBackground({reason:`create-session`})}vibe64SessionDebugLog(`client.sessionData.createSession.done`,{...vibe64SessionDebugSummary(response||{}),code:String(response?.code||response?.errors?.[0]?.code||``),durationMs:vibe64SessionDebugDurationMs(startedAtMs),ok:response?.ok!==false});return response}catch(error){vibe64SessionDebugLog(`client.sessionData.createSession.error`,{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error)});throw error}finally{createSessionRunning.value=false;createSessionInFlight=null}})();return createSessionInFlight}return{createSession,createSessionCommand,createSessionRunning}}function sessionIdExistsInList(sessionId=``,nextSessions=[]){const normalizedSessionId=String(sessionId||``).trim();return Boolean(normalizedSessionId)&&nextSessions.some(session=>session.sessionId===normalizedSessionId)}function renewedSuccessorSessionId({predecessorSessionId=``,sessions=[]}={}){const predecessorId=String(predecessorSessionId||``).trim();if(!predecessorId)return``;const matches=sessions.filter(session=>String(session?.metadata?.renewed_from||``).trim()===predecessorId);return matches.length===1?String(matches[0]?.sessionId||``).trim():``}function useVibe64SelectedSessionRenewal({availableSessions,projectSlug,route,router,selectedListSession,selectedSessionId,selectedSessionMissing,sessionList,sessionsApiPath}){let disposed=false;onScopeDispose(()=>{disposed=true});const selectionRenewalPredecessorId=computed(()=>{const selectedId=String(selectedSessionId.value||``).trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||``).trim())return``;if(sessionList.unavailableItems.some(session=>session.sessionId===selectedId))return``;if(selectedSessionMissing.value)return selectedId;return String(selectedListSession.value?.metadata?.renewed_from||``).trim()});const selectionRenewalPath=computed(()=>selectionRenewalPredecessorId.value?vibe64SessionPath(sessionsApiPath.value,selectionRenewalPredecessorId.value,`/renewal`):``);const selectionRenewalResource=useEndpointResource({enabled:computed(()=>Boolean(selectionRenewalPredecessorId.value)),fallbackLoadError:`The selected session renewal could not be checked.`,path:selectionRenewalPath,queryKey:computed(()=>[...vibe64SessionQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value),selectionRenewalPredecessorId.value,`renewal`]),queryOptions:{refetchOnMount:`always`,refetchOnWindowFocus:false},readMethod:`GET`,realtime:{event:VIBE64_SESSION_SUMMARY_CHANGED_EVENT,matches:({payload={}}={})=>mountedSessionRealtimeShouldRefresh({payload},selectionRenewalPredecessorId.value)},requestRecoveryLabel:`Selected session renewal`});let pendingRenewalNavigation=null;function syncRenewalSuccessorUrl(predecessorId,successorId){if(selectedSessionIdFromRoute(route)!==predecessorId)return;const capturedProject=String(projectSlug.value||``).trim();const capturedApiPath=sessionsApiPath.value;const predecessorUrl=route.fullPath;if(pendingRenewalNavigation?.predecessorUrl===predecessorUrl&&pendingRenewalNavigation?.successorId===successorId)return;const sameRenewal=()=>{const renewal=selectionRenewalResource.data.value?.renewal;return!disposed&&String(projectSlug.value||``).trim()===capturedProject&&sessionsApiPath.value===capturedApiPath&&selectedSessionId.value===successorId&&!selectionRenewalResource.loadError?.value&&!selectionRenewalResource.isInitialLoading?.value&&!selectionRenewalResource.isLoading?.value&&renewal?.status===`completed`&&String(renewal.sessionId||``).trim()===predecessorId&&String(renewal.successor?.sessionId||``).trim()===successorId&&renewedSuccessorSessionId({predecessorSessionId:predecessorId,sessions:availableSessions.value})===successorId};if(!sameRenewal())return;const target={path:route.path,hash:route.hash,query:{...route.query,session:successorId}};const targetUrl=router.resolve(target).fullPath;const navigation={predecessorUrl,successorId};const removeGuard=router.beforeResolve(to=>{if(to.fullPath===targetUrl&&(!sameRenewal()||route.fullPath!==predecessorUrl))return false});pendingRenewalNavigation=navigation;(async()=>{try{await router.replace(target)}catch(error){if(sameRenewal())vibe64SessionDebugLog(`client.sessionData.renewalNavigation.error`,{error:vibe64SessionDebugError(error),sessionId:successorId})}finally{removeGuard();if(pendingRenewalNavigation===navigation)pendingRenewalNavigation=null}})()}return{selectionRenewalPredecessorId,selectionRenewalResource,syncRenewalSuccessorUrl}}function ignorePublicationError(){}function createVibe64CurrentSessionPublisher({onError=ignorePublicationError,publish}){let pendingPublication=null;let publicationChain=Promise.resolve();let lastPublishedIdentity=null;let stopped=false;function request(publication={}){if(stopped)return publicationChain;const apiPath=String(publication.apiPath||``);const sessionId=String(publication.sessionId||``).trim();pendingPublication={apiPath,identity:JSON.stringify([apiPath,sessionId]),sessionId};publicationChain=publicationChain.catch(()=>null).then(async()=>{const publication=pendingPublication;pendingPublication=null;if(stopped||!publication)return;if(publication.identity===lastPublishedIdentity)return;try{await publish({apiPath:publication.apiPath,sessionId:publication.sessionId});lastPublishedIdentity=publication.identity}catch(error){onError(error,publication)}});return publicationChain}function stop(){stopped=true;pendingPublication=null}return Object.freeze({request,stop})}function selectedSessionIdForCurrentAlias({createSessionRunning=false,selectedSessionId=``,sessionListLoaded=true,sessionListLoadError=``,sessionListLoading=false,sessions=[]}={}){if(!sessionListLoaded||sessionListLoading||String(sessionListLoadError||``).trim())return null;const normalizedSessionId=String(selectedSessionId||``).trim();if(sessionIdExistsInList(normalizedSessionId,sessions))return normalizedSessionId;if(sessions.length>0||createSessionRunning)return null;return``}function useVibe64CurrentSessionPublication({selectionReconciliationState}){const updateCurrentSessionCommand=useCommand({access:`never`,apiSuffix:VIBE64_CURRENT_SESSION_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`PUT`,path:String(context?.apiPath||``)}),buildRawPayload:(_model,{context})=>({sessionId:String(context?.sessionId||``).trim()}),fallbackRunError:`The current session shortcut could not be updated.`,messages:{error:`The current session shortcut could not be updated.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.current.update`,suppressSuccessMessage:true,surfaceId:`app`,writeMethod:`PUT`});const currentSessionPublisher=createVibe64CurrentSessionPublisher({async publish({apiPath,sessionId}){const response=await updateCurrentSessionCommand.run({apiPath,sessionId});if(!response||response.ok===false)throw new Error(String(response?.error||`The current session shortcut could not be updated.`))},onError(error,publication){vibe64SessionDebugLog(`client.sessionData.currentSession.error`,{error:vibe64SessionDebugError(error),sessionId:publication.sessionId})}});onScopeDispose(()=>{currentSessionPublisher.stop()});watch(selectionReconciliationState,state=>{const publicationSessionId=selectedSessionIdForCurrentAlias({createSessionRunning:state.createSessionRunning,selectedSessionId:state.selectedSessionId,sessionListLoaded:state.sessionListLoaded,sessionListLoadError:state.sessionListLoadError,sessionListLoading:state.sessionListLoading,sessions:state.nextSessions});if(publicationSessionId===null||!state.currentSessionApiPath)return;currentSessionPublisher.request({apiPath:state.currentSessionApiPath,sessionId:publicationSessionId})},{flush:`post`,immediate:true})}function sessionArchiveOperation(session){try{return JSON.parse(session?.metadata?.session_archive_operation||`null`)}catch{return{status:`failed`,error:`Session archive state could not be read.`}}}function sessionArchiveState(session){const operation=sessionArchiveOperation(session);const failed=operation?.status===`failed`;return{archiveError:failed?operation.error:``,archiving:!failed&&(operation?.status===`running`||session?.metadata?.session_closing_reason===`archived`),operation}}function routeQueryWithoutUnlistedSession({route={},projectSlug=``,sessions=[]}={}){const routeSessionId=selectedSessionIdFromRoute(route);if(!routeSessionId||projectSlugFromRoute(route)!==projectSlug||sessionIdExistsInList(routeSessionId,sessions))return null;const{session:_session,conversation:_conversation,chat:_chat,...query}=route.query||{};return query}function shouldPreserveSelectedSessionDuringRefresh({createSessionRunning=false,currentSessionId=``,nextSessions=[],sessionListLoading=false}={}){const normalizedSessionId=String(currentSessionId||``).trim();if(!normalizedSessionId||sessionIdExistsInList(normalizedSessionId,nextSessions))return false;return Boolean(sessionListLoading||createSessionRunning)}function sessionListRealtimeShouldRefresh({payload={}}={},projectSlug=``){return vibe64SessionEventMatchesScope(payload,{projectSlug})&&payload.clientRefresh?.includeList!==false}function useVibe64SessionData(){const projectSlug=useVibe64ProjectSlug();const route=useRoute();const router=useRouter();const paths=usePaths();const selectionScope=computed(()=>String(projectSlug.value||``).trim());const sessionsApiPath=computed(()=>paths.api(VIBE64_SESSIONS_API_SUFFIX,{surface:`app`}));const currentSessionApiPath=computed(()=>paths.api(VIBE64_CURRENT_SESSION_API_SUFFIX,{surface:`app`}));const sessionListQueryKey=computed(()=>vibe64SessionsQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value));const sessionListResource=useEndpointResource({fallbackLoadError:`Vibe64 sessions could not be loaded.`,path:sessionsApiPath,queryKey:sessionListQueryKey,readQuery:{limit:20},queryOptions:{refetchOnMount:`always`,refetchOnWindowFocus:false},requestRecoveryLabel:`Vibe64 sessions`,realtime:{events:[VIBE64_SESSION_SUMMARY_CHANGED_EVENT,VIBE64_PROJECT_CHANGED_EVENT,`connect`],matches:event=>sessionListRealtimeShouldRefresh(event,projectSlug.value)}});const sessionList=proxyRefs({unavailableItems:computed(()=>sessionListResource.data.value?.unavailableSessions||[]),items:computed(()=>{const payload=sessionListResource.data.value||{};return Array.isArray(payload.sessions)?payload.sessions:[]}),loadError:computed(()=>sessionListResource.loadError.value),isInitialLoading:computed(()=>sessionListResource.isInitialLoading.value||!sessionListResource.query.isFetchedAfterMount.value),isLoading:computed(()=>sessionListResource.isLoading.value),pages:computed(()=>{const payload=sessionListResource.data.value;return payload&&typeof payload===`object`&&!Array.isArray(payload)?[payload]:[]}),reload:sessionListResource.reload,resource:sessionListResource});const sessionSelection=useVibe64SessionSelection({projectSlug,rememberedId:()=>sessionList.isInitialLoading?``:sessionList.pages[0]?.lastOpenedSessionId});const selectedSessionId=sessionSelection.selectedId;let emptySessionListObservedForProject=``;const{createSession,createSessionCommand,createSessionRunning}=useVibe64SessionCreation({projectSlug,refreshSessionDataInBackground,selectSessionId,sessionListQueryKey,sessionsApiPath});const archiveAttempts=ref({});const agentActivityBySessionId=ref({});const sessions=computed(()=>{const items=new Map((sessionList.items||[]).map(session=>[session.sessionId,session]));for(const[id,attempt]of Object.entries(archiveAttempts.value))if(attempt.succeeded)items.delete(id);else items.set(id,{...items.get(id)||attempt.session,archiving:true,archiveStartedAt:attempt.startedAt});return visibleVibe64Sessions([...items.values()]).map(session=>{const archiveState=sessionArchiveState(session);return{...session,agentActivity:latestAgentTurnRealtimeOverlay(session.agentActivity,agentActivityBySessionId.value[session.sessionId]),archiveOperation:archiveState.operation,archiveStartedAt:archiveState.operation?.startedAt||session.archiveStartedAt,archiveError:archiveState.archiveError,archiving:Boolean(session.archiving||archiveState.archiving)}})});const availableSessions=computed(()=>sessions.value.filter(session=>!session.archiving));const selectedListSession=computed(()=>{return sessions.value.find(session=>session.sessionId===selectedSessionId.value)||null});const selectedSessionMissing=computed(()=>{const selectedId=String(selectedSessionId.value||``).trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||``).trim()||sessionIdExistsInList(selectedId,sessions.value))return false;return true});const{selectionRenewalPredecessorId,selectionRenewalResource,syncRenewalSuccessorUrl}=useVibe64SelectedSessionRenewal({availableSessions,projectSlug,route,router,selectedListSession,selectedSessionId,selectedSessionMissing,sessionList,sessionsApiPath});const creationOptions=computed(()=>sessionList.pages?.[0]?.creation||{});const selectedSession=computed(()=>enrichVibe64SessionForDisplay(selectedListSession.value));const isSelectedSessionArchived=computed(()=>isArchivedVibe64Session(selectedSession.value||{}));const canCreateSession=computed(()=>{return creationOptions.value.canCreate===true});const createSessionVisible=computed(()=>creationOptions.value.showCreateAction===true);const createSessionTitle=computed(()=>{if(creationOptions.value.disabledReason)return String(creationOptions.value.disabledReason);if(creationOptions.value.canCreate!==true)return`Session creation is unavailable.`;return`Create a new Vibe64 session`});const selectedSessionTitle=computed(()=>{return vibe64SessionDisplayTitle(selectedSession.value||{})||`Session ${shortVibe64SessionId(selectedSessionId.value)}`});async function refreshSessionList(){return refetchEndpointResource(sessionListResource)}let refreshSessionDataInFlight=null;async function refreshSessionData(options={}){const reason=typeof options===`string`?options:String(options.reason||``);if(refreshSessionDataInFlight){vibe64SessionDebugLog(`client.sessionData.refresh.join`,{reason,selectedSessionId:String(selectedSessionId.value||``)});return refreshSessionDataInFlight}const startedAtMs=Date.now();vibe64SessionDebugLog(`client.sessionData.refresh.start`,{reason,selectedSessionId:String(selectedSessionId.value||``)});refreshSessionDataInFlight=refreshSessionList();try{const result=await refreshSessionDataInFlight;vibe64SessionDebugLog(`client.sessionData.refresh.done`,{durationMs:vibe64SessionDebugDurationMs(startedAtMs),reason,selectedSessionId:String(selectedSessionId.value||``),sessionCount:sessions.value.length});return result}catch(error){vibe64SessionDebugLog(`client.sessionData.refresh.error`,{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error),reason,selectedSessionId:String(selectedSessionId.value||``)});throw error}finally{refreshSessionDataInFlight=null}}function refreshSessionDataInBackground(options={}){refreshSessionData(options).catch(()=>{})}function selectSessionId(sessionId=``){const normalizedSessionId=String(sessionId||``).trim();if(sessions.value.some(session=>session.sessionId===normalizedSessionId&&session.archiving))return;vibe64SessionDebugLog(`client.sessionData.selectSession`,{fromSessionId:String(selectedSessionId.value||``),toSessionId:normalizedSessionId});if(normalizedSessionId)emptySessionListObservedForProject=``;sessionSelection.select(normalizedSessionId)}function clearSelectedSession(){emptySessionListObservedForProject=selectionScope.value;sessionSelection.clear()}function selectPreviousSession(sessionId){const navigation=sessions.value;const index=navigation.findIndex(session=>session.sessionId===sessionId);selectSessionId(navigation.slice(0,Math.max(0,index)).filter(session=>!session.archiving).at(-1)?.sessionId||availableSessions.value.at(-1)?.sessionId||``)}const archive=proxyRefs(useVibe64SessionDialogs({beginArchive(sessionId){archiveAttempts.value[sessionId]={startedAt:new Date().toISOString(),session:sessions.value.find(session=>session.sessionId===sessionId)};if(selectedSessionId.value===sessionId)selectPreviousSession(sessionId);return projectSlug.value},finishArchive(sessionId,succeeded,archiveProject){if(projectSlug.value!==archiveProject)return;if(succeeded)archiveAttempts.value[sessionId]={succeeded:true};else{delete archiveAttempts.value[sessionId];if(!selectedSessionId.value)selectSessionId(sessionId)}},isSelectedSessionArchived,refreshSessionData,selectedSessionId,selectedSessionTitle,sessionsApiPath}));const archiveFeedback=useUiFeedback({source:`vibe64.sessions.archive.remote`});const shownArchiveFailures=new Set;watch(projectSlug,()=>{archiveAttempts.value={};agentActivityBySessionId.value={};shownArchiveFailures.clear()});useRealtimeEvent({event:VIBE64_SESSION_SUMMARY_CHANGED_EVENT,matches:({payload={}}={})=>vibe64SessionEventMatchesScope(payload,{projectSlug:projectSlug.value}),onEvent:({payload={}}={})=>{const id=String(payload.sessionId||``);if(!id)return;const activity=agentTurnRealtimeOverlayFromPayload(payload,id);if(activity)agentActivityBySessionId.value[id]=latestAgentTurnRealtimeOverlay(agentActivityBySessionId.value[id],{active:activity.active,revision:activity.revision});if(payload.reason===`session-archiving`){const session=sessions.value.find(item=>item.sessionId===id);if(session)archiveAttempts.value[id]={session,startedAt:archiveAttempts.value[id]?.startedAt||new Date().toISOString()};if(selectedSessionId.value===id)selectPreviousSession(id)}else if(payload.reason===`session-archived`)archiveAttempts.value[id]={succeeded:true};else if(payload.reason===`session-archive-failed`){delete archiveAttempts.value[id];if(!selectedSessionId.value)selectSessionId(id)}}});watch(()=>sessionList.items,items=>{for(const id of Object.keys(agentActivityBySessionId.value))if(!items.some(session=>session.sessionId===id))delete agentActivityBySessionId.value[id];for(const[id,attempt]of Object.entries(archiveAttempts.value)){if(attempt.succeeded||archive.archivingSessionId===id)continue;const session=items.find(item=>item.sessionId===id);if(!session||!sessionArchiveState(session).archiving)delete archiveAttempts.value[id]}});watch(sessions,items=>{for(const session of items){const key=`${session.sessionId}:${session.metadata?.session_archive_operation}`;if(!session.archiveError||shownArchiveFailures.has(key))continue;shownArchiveFailures.add(key);if(archive.archivingSessionId!==session.sessionId)archiveFeedback.error(new Error(session.archiveError))}},{immediate:true});function dropUnlistedRouteSession(){const query=routeQueryWithoutUnlistedSession({route,projectSlug:projectSlug.value,sessions:sessions.value});if(query)router.replace({path:route.path,hash:route.hash,query}).catch(()=>null)}const selectionReconciliationState=computed(()=>{const nextSessions=availableSessions.value;return{createSessionRunning:createSessionRunning.value,currentSessionApiPath:currentSessionApiPath.value,selectionScope:selectionScope.value,selectionRenewal:selectionRenewalResource.data.value?.renewal||null,selectionRenewalLoadError:String(selectionRenewalResource.loadError?.value||``),selectionRenewalLoaded:Boolean(selectionRenewalResource.data.value&&typeof selectionRenewalResource.data.value===`object`&&!Array.isArray(selectionRenewalResource.data.value)),selectionRenewalLoading:Boolean(selectionRenewalResource.isInitialLoading?.value||selectionRenewalResource.isLoading?.value),selectionRenewalPredecessorId:selectionRenewalPredecessorId.value,projectSlug:String(projectSlug.value||``).trim(),selectedSessionMissing:selectedSessionMissing.value,nextSessions,selectedSessionId:String(selectedSessionId.value||``),sessionListInitialLoading:sessionList.isInitialLoading,sessionListLoaded:sessionList.pages.length>0,sessionListLoadError:String(sessionList.loadError||``),sessionListLoading:sessionList.isLoading}});watch(selectionReconciliationState,state=>{const nextSessions=state.nextSessions;if(sessions.value.some(session=>session.sessionId===state.selectedSessionId&&session.archiving)){selectPreviousSession(state.selectedSessionId);return}vibe64SessionDebugLog(`client.sessionData.sessions.changed`,{selectedSessionId:String(selectedSessionId.value||``),sessionCount:nextSessions.length});if(state.sessionListInitialLoading||state.sessionListLoadError||shouldPreserveSelectedSessionDuringRefresh({createSessionRunning:state.createSessionRunning,currentSessionId:state.selectedSessionId,nextSessions,sessionListLoading:state.sessionListLoading}))return;if(!state.selectedSessionId&&nextSessions.length===0)emptySessionListObservedForProject=state.selectionScope;if(state.selectionRenewalPredecessorId){if(state.selectionRenewalLoading||state.selectionRenewalLoadError||!state.selectionRenewalLoaded)return;const selectionRenewal=state.selectionRenewal;if(selectionRenewal&&String(selectionRenewal.sessionId||``).trim()===state.selectionRenewalPredecessorId){const renewalStatus=String(selectionRenewal.status||``).trim();if(renewalStatus===`completed`){const renewedSuccessorId=renewedSuccessorSessionId({predecessorSessionId:state.selectionRenewalPredecessorId,sessions:nextSessions});if(state.selectedSessionMissing){if(renewedSuccessorId)sessionSelection.selectAvailableId(nextSessions,{fallbackId:renewedSuccessorId,getId:session=>session.sessionId})}if(renewedSuccessorId&&selectedSessionId.value===renewedSuccessorId)syncRenewalSuccessorUrl(state.selectionRenewalPredecessorId,renewedSuccessorId);if(state.selectedSessionMissing)return}else if(state.selectedSessionMissing&&[`failed`,`running`].includes(renewalStatus))return;if([`failed`,`running`].includes(renewalStatus)){sessionSelection.select(state.selectionRenewalPredecessorId);return}}}if(!state.selectionRenewalPredecessorId)dropUnlistedRouteSession();if(!state.selectedSessionId&&emptySessionListObservedForProject===state.selectionScope)return;sessionSelection.selectAvailableId(nextSessions,{fallbackId:nextSessions.at(-1)?.sessionId||``,getId:session=>session.sessionId})},{immediate:true});useVibe64CurrentSessionPublication({selectionReconciliationState});return{archive,canCreateSession,clearSelectedSession,createSession,createSessionCommand,createSessionRunning,createSessionVisible,createSessionTitle,isSelectedSessionArchived,refreshSessionData,selectSessionId,selectedSession,selectedSessionId,selectedSessionTitle,sessionList,sessions,sessionsApiPath,shortSessionId:shortVibe64SessionId}}export{mountedSessionDetailRefreshReason as a,sessionRecordHasActiveAgentWork as c,sessionWithAgentTurnRealtimeOverlay as d,refetchEndpointResource as f,mountedSessionDetailLoadState as i,agentTurnRealtimeOverlayFromPayload as l,useVibe64SessionData as n,mountedSessionRealtimeShouldRefresh as o,latestSessionDetailRecord as r,mountedSessionRecord as s,sessionListRealtimeShouldRefresh as t,latestAgentTurnRealtimeOverlay as u};
|
|
1
|
+
import{Et as unref,ht as proxyRefs,it as watch,mt as onScopeDispose,u as computed,vt as ref}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{N as useQueryClient,t as useEndpointResource}from"./useEndpointResource-61E93qP-.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-rsYWyW6m.js";import{s as normalizeObject}from"./normalize-BD25VwNK.js";import{o as projectSlugFromRoute}from"./vibe64ProjectScope.local-B9ZpdYlf.js";import{o as ROUTE_VISIBILITY_PUBLIC}from"./visibility-Cq31Xy7I.js";import{r as useRealtimeEvent}from"./useRealtimeEvent-B4oRg9Dt.js";import{t as useCommand}from"./useCommand-D96utlVe.js";import{t as usePaths}from"./usePaths-B-QGqa_I.js";import{t as useUiFeedback}from"./useUiFeedback-CycH_fvY.js";import{t as readRefOrGetterValue}from"./vueRefOrGetterValue-y-4f_In7.js";import{r as vibe64RealtimeOriginPayload}from"./vibe64BrowserTabOrigin-vIN_87mi.js";import{H as vibe64SessionsQueryKey,I as vibe64SessionEventMatchesScope,L as vibe64SessionPath,V as vibe64SessionQueryKey,a as VIBE64_CURRENT_SESSION_API_SUFFIX,c as VIBE64_SESSION_SUMMARY_CHANGED_EVENT,o as VIBE64_SESSIONS_API_SUFFIX}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{S as VIBE64_PROJECT_CHANGED_EVENT}from"./studioGateApi-CHIdcQvD.js";import{P as useVibe64ProjectSlug}from"./index-Bvd00puv.js";import{i as vibe64SessionDisplayTitle,o as vibe64SessionRevision,r as shortVibe64SessionId,t as isArchivedVibe64Session}from"./vibe64SessionViewModel-CQCds_jb.js";import{i as vibe64SessionDebugSummary,n as vibe64SessionDebugError,r as vibe64SessionDebugLog,t as vibe64SessionDebugDurationMs}from"./vibe64SessionDebugLog-BfO7tG1A.js";import{i as visibleVibe64Sessions,n as enrichVibe64SessionForDisplay}from"./vibe64SessionPanelModel-B-WkXnPu.js";import{n as useVibe64SessionSelection,t as selectedSessionIdFromRoute}from"./useVibe64SessionSelection-C546mBu8.js";function refetchEndpointResource(resource){return resource.query.refetch({cancelRefetch:false})}function sessionChangedReason(payload){return String(payload.reason||``).trim()}function sessionRevision(value){const revision=Number(value);return Number.isSafeInteger(revision)&&revision>=0?revision:null}function agentTurnRealtimeOverlayFromPayload(input,selectedSessionId=``){const payload=normalizeObject(input);const changedSessionId=String(payload.sessionId||payload.entityId||``).trim();if(!changedSessionId||changedSessionId!==String(selectedSessionId||``).trim())return null;const agentSession=normalizeObject(payload.agentSession);const turn=normalizeObject(agentSession.turn);const run=normalizeObject(payload.agentRun);const revision=sessionRevision(payload.revision);if(revision===null||!Object.keys(turn).length&&!Object.keys(run).length)return null;const active=turn.active===true||run.active===true;return{active,agentRun:{...run,active},agentSession:{...agentSession,turn:{...turn,active}},reason:sessionChangedReason(payload),revision,sessionId:changedSessionId}}function latestAgentTurnRealtimeOverlay(current=null,candidate=null){if(!candidate)return current;if(!current||candidate.revision>current.revision)return candidate;return current}function mergeAgentRunOverlay(agentRuns=[],overlayRun={}){const runs=Array.isArray(agentRuns)?agentRuns:[];const runId=String(overlayRun.id||``).trim();if(!runId)return runs;const nextRun={...overlayRun,id:runId};const index=runs.findIndex(run=>String(run?.id||``).trim()===runId);if(index<0)return[...runs,nextRun];return runs.map((run,runIndex)=>runIndex===index?{...run,...nextRun}:run)}function sessionWithAgentTurnRealtimeOverlay(session=null,overlay=null){const currentRevision=sessionRevision(session?.revision);if(!session||!overlay||session?.ok===false||session.sessionId!==overlay.sessionId||currentRevision!==null&&overlay.revision<=currentRevision)return session;const overlayAgentSession=normalizeObject(overlay.agentSession);return{...session,agentRuns:mergeAgentRunOverlay(session.agentRuns,normalizeObject(overlay.agentRun)),agentSession:{...normalizeObject(session.agentSession),...overlayAgentSession,thread:{...normalizeObject(session.agentSession?.thread),...normalizeObject(overlayAgentSession.thread)},turn:{...normalizeObject(session.agentSession?.turn),...normalizeObject(overlayAgentSession.turn),active:overlay.active===true}},revision:overlay.revision}}function sessionRecordHasDetailProjection(session=null){return Boolean(session&&typeof session===`object`&&Object.hasOwn(session,`agentSession`))}function sessionRecordHasActiveAgentWork(session=null){return(session?.agentSession?.turn?.active??session?.agentActivity?.active)===true}function sessionRecordMatchesId(session=null,sessionId=``){const normalizedSessionId=String(sessionId||``).trim();return Boolean(normalizedSessionId&&session?.sessionId===normalizedSessionId&&session?.ok!==false)}function latestSessionDetailRecord(current=null,candidate=null,sessionId=``){if(!sessionRecordMatchesId(candidate,sessionId))return current;if(!sessionRecordMatchesId(current,sessionId))return candidate;const currentRevision=vibe64SessionRevision(current);const candidateRevision=vibe64SessionRevision(candidate);if(currentRevision!==null&&candidateRevision!==null&&candidateRevision<currentRevision)return current;return candidate}function mountedSessionRecord(detailSession=null,listSession=null,sessionId=``){const normalizedSessionId=String(sessionId||``).trim();const listSessionMatches=sessionRecordMatchesId(listSession,normalizedSessionId);if(!sessionRecordMatchesId(detailSession,normalizedSessionId))return listSessionMatches?listSession:null;const detailRevision=vibe64SessionRevision(detailSession);const listRevision=vibe64SessionRevision(listSession);if(listSessionMatches&&listRevision!==null&&detailRevision!==null&&listRevision>detailRevision){if(sessionRecordHasDetailProjection(detailSession)&&!sessionRecordHasDetailProjection(listSession))return detailSession;return listSession}return detailSession}function mountedSessionDetailRefreshReason(detailSession=null,listSession=null,sessionId=``){const normalizedSessionId=String(sessionId||``).trim();if(!sessionRecordMatchesId(detailSession,normalizedSessionId)||!sessionRecordMatchesId(listSession,normalizedSessionId))return``;const detailRevision=vibe64SessionRevision(detailSession);const listRevision=vibe64SessionRevision(listSession);if(listRevision!==null&&detailRevision!==null&&listRevision>detailRevision&&sessionRecordHasDetailProjection(detailSession)&&!sessionRecordHasDetailProjection(listSession))return`newer_summary_without_detail`;return``}function mountedSessionDetailLoadState({detailSession=null,fetching=false,listSession=null,loadError=``,loading=false,sessionId=``}={}){const normalizedSessionId=String(sessionId||``).trim();const hasDetail=sessionRecordMatchesId(detailSession,normalizedSessionId);const hasSummary=sessionRecordMatchesId(listSession,normalizedSessionId);const error=String(loadError||``).trim();if(!normalizedSessionId)return{error:``,label:``,loading:false,ready:false,restoring:false,sessionId:``,state:`summaryOnly`};if(error&&!hasDetail)return{error,label:`Session could not load.`,loading:false,ready:false,restoring:false,sessionId:normalizedSessionId,state:`detailError`};if(hasDetail)return{error:``,label:``,loading:false,ready:true,refreshing:Boolean(fetching||loading),restoring:false,sessionId:normalizedSessionId,state:`detailReady`};if(loading||fetching)return{error:``,label:`Loading session...`,loading:true,ready:false,restoring:false,sessionId:normalizedSessionId,state:`detailLoading`};return{error:``,label:hasSummary?`Session could not load.`:`Loading session...`,loading:false,ready:false,restoring:false,sessionId:normalizedSessionId,state:`summaryOnly`}}function mountedSessionRealtimeShouldRefresh({payload={}}={},sessionId=``,read=`includeDetail`){const changedSessionId=String(payload.sessionId||payload.entityId||``).trim();if(!changedSessionId||changedSessionId!==String(sessionId||``).trim())return false;return payload.clientRefresh?.[read]!==false}function useVibe64SessionDialogs({beginArchive,finishArchive,isSelectedSessionArchived,refreshSessionData,selectedSessionId,selectedSessionTitle,sessionsApiPath}){const archiveDialogOpen=ref(false);const archiveDialogSessionId=ref(``);const archiveDialogSessionTitle=ref(``);const archivingSessionId=ref(``);const resolvedSessionsApiPath=computed(()=>String(readRefOrGetterValue(sessionsApiPath)||``));const archiveCommand=useCommand({access:`never`,apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildRawPayload:()=>vibe64RealtimeOriginPayload(),buildCommandOptions:(_payload,{context})=>({method:`POST`,path:vibe64SessionPath(resolvedSessionsApiPath.value,context?.sessionId,`/archive`)}),fallbackRunError:`Vibe64 session could not be archived.`,messages:{error:`Vibe64 session could not be archived.`,success:`Vibe64 session archived.`},onRunSuccess:async response=>{if(response?.ok!==true)throw new Error(response?.errors?.[0]?.message||response?.error||`Vibe64 session could not be archived.`)},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.archive`,surfaceId:`app`,writeMethod:`POST`});function clearArchiveDialog(){archiveDialogOpen.value=false;archiveDialogSessionId.value=``;archiveDialogSessionTitle.value=``}function requestArchiveSelectedSession(){if(!unref(selectedSessionId)||archivingSessionId.value||archiveCommand.isRunning||unref(isSelectedSessionArchived))return;archiveDialogSessionId.value=unref(selectedSessionId);archiveDialogSessionTitle.value=unref(selectedSessionTitle);archiveDialogOpen.value=true}function cancelArchiveSession(){if(!archiveCommand.isRunning)clearArchiveDialog()}async function confirmArchiveSession(){if(!archiveDialogSessionId.value||archivingSessionId.value||archiveCommand.isRunning)return false;const sessionId=archiveDialogSessionId.value;archivingSessionId.value=sessionId;clearArchiveDialog();const archiveScope=beginArchive(sessionId);let succeeded=false;try{const response=await archiveCommand.run({sessionId});succeeded=response?.ok===true;return response}catch{return false}finally{finishArchive(sessionId,succeeded,archiveScope);if(archivingSessionId.value===sessionId)archivingSessionId.value=``;refreshSessionData({reason:`archive-session`}).catch(()=>null)}}return{archiving:computed(()=>Boolean(archivingSessionId.value)),archivingSessionId,cancel:cancelArchiveSession,command:archiveCommand,confirm:confirmArchiveSession,open:archiveDialogOpen,request:requestArchiveSelectedSession,sessionId:archiveDialogSessionId,sessionTitle:archiveDialogSessionTitle}}function useVibe64SessionCreation({projectSlug,refreshSessionDataInBackground,selectSessionId,sessionListQueryKey,sessionsApiPath}){const queryClient=useQueryClient();const createSessionCommand=useCommand({access:`never`,apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`POST`,path:context?.apiPath}),buildRawPayload:(_model,{context})=>vibe64RealtimeOriginPayload({assistantSelection:context?.assistantSelection||{},...context?.repositoryBranch?{repositoryBranch:context.repositoryBranch}:{},...context?.pullRequestNumber?{pullRequestNumber:context.pullRequestNumber}:{}}),fallbackRunError:`Vibe64 session could not be created.`,messages:{error:`Vibe64 session could not be created.`,success:`Vibe64 session created.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.create`,surfaceId:`app`,writeMethod:`POST`});const createSessionRunning=ref(false);let createSessionInFlight=null;let disposed=false;onScopeDispose(()=>{disposed=true});async function createSession(assistantSelection={},{pullRequestNumber,repositoryBranch}={}){if(createSessionInFlight)return createSessionInFlight;const startedAtMs=Date.now();const creationProjectSlug=String(projectSlug.value||``).trim();const creationApiPath=sessionsApiPath.value;const creationQueryKey=[...sessionListQueryKey.value];vibe64SessionDebugLog(`client.sessionData.createSession.start`);createSessionRunning.value=true;createSessionInFlight=(async()=>{try{const response=await createSessionCommand.run({assistantSelection,pullRequestNumber,repositoryBranch,apiPath:creationApiPath});if(!disposed&&creationProjectSlug===String(projectSlug.value||``).trim()){if(response?.creation&&response?.limits)queryClient.setQueryData(creationQueryKey,currentPayload=>{if(!currentPayload||typeof currentPayload!==`object`||Array.isArray(currentPayload))return currentPayload;const currentSessions=Array.isArray(currentPayload.sessions)?currentPayload.sessions:[];const createdSession=response.sessionId?Object.fromEntries(Object.entries(response).filter(([key])=>![`creation`,`limits`,`ok`].includes(key))):null;return{...currentPayload,creation:response.creation,limits:response.limits,...createdSession&&!currentSessions.some(item=>item?.sessionId===createdSession.sessionId)?{sessions:[...currentSessions,createdSession]}:{}}});if(response?.sessionId)selectSessionId(response.sessionId);refreshSessionDataInBackground({reason:`create-session`})}vibe64SessionDebugLog(`client.sessionData.createSession.done`,{...vibe64SessionDebugSummary(response||{}),code:String(response?.code||response?.errors?.[0]?.code||``),durationMs:vibe64SessionDebugDurationMs(startedAtMs),ok:response?.ok!==false});return response}catch(error){vibe64SessionDebugLog(`client.sessionData.createSession.error`,{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error)});throw error}finally{createSessionRunning.value=false;createSessionInFlight=null}})();return createSessionInFlight}return{createSession,createSessionCommand,createSessionRunning}}function sessionIdExistsInList(sessionId=``,nextSessions=[]){const normalizedSessionId=String(sessionId||``).trim();return Boolean(normalizedSessionId)&&nextSessions.some(session=>session.sessionId===normalizedSessionId)}function renewedSuccessorSessionId({predecessorSessionId=``,sessions=[]}={}){const predecessorId=String(predecessorSessionId||``).trim();if(!predecessorId)return``;const matches=sessions.filter(session=>String(session?.metadata?.renewed_from||``).trim()===predecessorId);return matches.length===1?String(matches[0]?.sessionId||``).trim():``}function useVibe64SelectedSessionRenewal({availableSessions,projectSlug,route,router,selectedListSession,selectedSessionId,selectedSessionMissing,sessionList,sessionsApiPath}){let disposed=false;onScopeDispose(()=>{disposed=true});const selectionRenewalPredecessorId=computed(()=>{const selectedId=String(selectedSessionId.value||``).trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||``).trim())return``;if(sessionList.unavailableItems.some(session=>session.sessionId===selectedId))return``;if(selectedSessionMissing.value)return selectedId;return String(selectedListSession.value?.metadata?.renewed_from||``).trim()});const selectionRenewalPath=computed(()=>selectionRenewalPredecessorId.value?vibe64SessionPath(sessionsApiPath.value,selectionRenewalPredecessorId.value,`/renewal`):``);const selectionRenewalResource=useEndpointResource({enabled:computed(()=>Boolean(selectionRenewalPredecessorId.value)),fallbackLoadError:`The selected session renewal could not be checked.`,path:selectionRenewalPath,queryKey:computed(()=>[...vibe64SessionQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value),selectionRenewalPredecessorId.value,`renewal`]),queryOptions:{refetchOnMount:`always`,refetchOnWindowFocus:false},readMethod:`GET`,realtime:{event:VIBE64_SESSION_SUMMARY_CHANGED_EVENT,matches:({payload={}}={})=>mountedSessionRealtimeShouldRefresh({payload},selectionRenewalPredecessorId.value)},requestRecoveryLabel:`Selected session renewal`});let pendingRenewalNavigation=null;function syncRenewalSuccessorUrl(predecessorId,successorId){if(selectedSessionIdFromRoute(route)!==predecessorId)return;const capturedProject=String(projectSlug.value||``).trim();const capturedApiPath=sessionsApiPath.value;const predecessorUrl=route.fullPath;if(pendingRenewalNavigation?.predecessorUrl===predecessorUrl&&pendingRenewalNavigation?.successorId===successorId)return;const sameRenewal=()=>{const renewal=selectionRenewalResource.data.value?.renewal;return!disposed&&String(projectSlug.value||``).trim()===capturedProject&&sessionsApiPath.value===capturedApiPath&&selectedSessionId.value===successorId&&!selectionRenewalResource.loadError?.value&&!selectionRenewalResource.isInitialLoading?.value&&!selectionRenewalResource.isLoading?.value&&renewal?.status===`completed`&&String(renewal.sessionId||``).trim()===predecessorId&&String(renewal.successor?.sessionId||``).trim()===successorId&&renewedSuccessorSessionId({predecessorSessionId:predecessorId,sessions:availableSessions.value})===successorId};if(!sameRenewal())return;const target={path:route.path,hash:route.hash,query:{...route.query,session:successorId}};const targetUrl=router.resolve(target).fullPath;const navigation={predecessorUrl,successorId};const removeGuard=router.beforeResolve(to=>{if(to.fullPath===targetUrl&&(!sameRenewal()||route.fullPath!==predecessorUrl))return false});pendingRenewalNavigation=navigation;(async()=>{try{await router.replace(target)}catch(error){if(sameRenewal())vibe64SessionDebugLog(`client.sessionData.renewalNavigation.error`,{error:vibe64SessionDebugError(error),sessionId:successorId})}finally{removeGuard();if(pendingRenewalNavigation===navigation)pendingRenewalNavigation=null}})()}return{selectionRenewalPredecessorId,selectionRenewalResource,syncRenewalSuccessorUrl}}function ignorePublicationError(){}function createVibe64CurrentSessionPublisher({onError=ignorePublicationError,publish}){let pendingPublication=null;let publicationChain=Promise.resolve();let lastPublishedIdentity=null;let stopped=false;function request(publication={}){if(stopped)return publicationChain;const apiPath=String(publication.apiPath||``);const sessionId=String(publication.sessionId||``).trim();pendingPublication={apiPath,identity:JSON.stringify([apiPath,sessionId]),sessionId};publicationChain=publicationChain.catch(()=>null).then(async()=>{const publication=pendingPublication;pendingPublication=null;if(stopped||!publication)return;if(publication.identity===lastPublishedIdentity)return;try{await publish({apiPath:publication.apiPath,sessionId:publication.sessionId});lastPublishedIdentity=publication.identity}catch(error){onError(error,publication)}});return publicationChain}function stop(){stopped=true;pendingPublication=null}return Object.freeze({request,stop})}function selectedSessionIdForCurrentAlias({createSessionRunning=false,selectedSessionId=``,sessionListLoaded=true,sessionListLoadError=``,sessionListLoading=false,sessions=[]}={}){if(!sessionListLoaded||sessionListLoading||String(sessionListLoadError||``).trim())return null;const normalizedSessionId=String(selectedSessionId||``).trim();if(sessionIdExistsInList(normalizedSessionId,sessions))return normalizedSessionId;if(sessions.length>0||createSessionRunning)return null;return``}function useVibe64CurrentSessionPublication({selectionReconciliationState}){const updateCurrentSessionCommand=useCommand({access:`never`,apiSuffix:VIBE64_CURRENT_SESSION_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:`PUT`,path:String(context?.apiPath||``)}),buildRawPayload:(_model,{context})=>({sessionId:String(context?.sessionId||``).trim()}),fallbackRunError:`The current session shortcut could not be updated.`,messages:{error:`The current session shortcut could not be updated.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.sessions.current.update`,suppressSuccessMessage:true,surfaceId:`app`,writeMethod:`PUT`});const currentSessionPublisher=createVibe64CurrentSessionPublisher({async publish({apiPath,sessionId}){const response=await updateCurrentSessionCommand.run({apiPath,sessionId});if(!response||response.ok===false)throw new Error(String(response?.error||`The current session shortcut could not be updated.`))},onError(error,publication){vibe64SessionDebugLog(`client.sessionData.currentSession.error`,{error:vibe64SessionDebugError(error),sessionId:publication.sessionId})}});onScopeDispose(()=>{currentSessionPublisher.stop()});watch(selectionReconciliationState,state=>{const publicationSessionId=selectedSessionIdForCurrentAlias({createSessionRunning:state.createSessionRunning,selectedSessionId:state.selectedSessionId,sessionListLoaded:state.sessionListLoaded,sessionListLoadError:state.sessionListLoadError,sessionListLoading:state.sessionListLoading,sessions:state.nextSessions});if(publicationSessionId===null||!state.currentSessionApiPath)return;currentSessionPublisher.request({apiPath:state.currentSessionApiPath,sessionId:publicationSessionId})},{flush:`post`,immediate:true})}function sessionArchiveOperation(session){try{return JSON.parse(session?.metadata?.session_archive_operation||`null`)}catch{return{status:`failed`,error:`Session archive state could not be read.`}}}function sessionArchiveState(session){const operation=sessionArchiveOperation(session);const failed=operation?.status===`failed`;return{archiveError:failed?operation.error:``,archiving:!failed&&(operation?.status===`running`||session?.metadata?.session_closing_reason===`archived`),operation}}function routeQueryWithoutUnlistedSession({route={},projectSlug=``,sessions=[]}={}){const routeSessionId=selectedSessionIdFromRoute(route);if(!routeSessionId||projectSlugFromRoute(route)!==projectSlug||sessionIdExistsInList(routeSessionId,sessions))return null;const{session:_session,conversation:_conversation,chat:_chat,...query}=route.query||{};return query}function shouldPreserveSelectedSessionDuringRefresh({createSessionRunning=false,currentSessionId=``,nextSessions=[],sessionListLoading=false}={}){const normalizedSessionId=String(currentSessionId||``).trim();if(!normalizedSessionId||sessionIdExistsInList(normalizedSessionId,nextSessions))return false;return Boolean(sessionListLoading||createSessionRunning)}function sessionListRealtimeShouldRefresh({payload={}}={},projectSlug=``){return vibe64SessionEventMatchesScope(payload,{projectSlug})&&payload.clientRefresh?.includeList!==false}function useVibe64SessionData(){const projectSlug=useVibe64ProjectSlug();const route=useRoute();const router=useRouter();const paths=usePaths();const selectionScope=computed(()=>String(projectSlug.value||``).trim());const sessionsApiPath=computed(()=>paths.api(VIBE64_SESSIONS_API_SUFFIX,{surface:`app`}));const currentSessionApiPath=computed(()=>paths.api(VIBE64_CURRENT_SESSION_API_SUFFIX,{surface:`app`}));const sessionListQueryKey=computed(()=>vibe64SessionsQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value));const sessionListResource=useEndpointResource({fallbackLoadError:`Vibe64 sessions could not be loaded.`,path:sessionsApiPath,queryKey:sessionListQueryKey,readQuery:{limit:20},queryOptions:{refetchOnMount:`always`,refetchOnWindowFocus:false},requestRecoveryLabel:`Vibe64 sessions`,realtime:{events:[VIBE64_SESSION_SUMMARY_CHANGED_EVENT,VIBE64_PROJECT_CHANGED_EVENT,`connect`],matches:event=>sessionListRealtimeShouldRefresh(event,projectSlug.value)}});const sessionList=proxyRefs({unavailableItems:computed(()=>sessionListResource.data.value?.unavailableSessions||[]),items:computed(()=>{const payload=sessionListResource.data.value||{};return Array.isArray(payload.sessions)?payload.sessions:[]}),loadError:computed(()=>sessionListResource.loadError.value),isInitialLoading:computed(()=>sessionListResource.isInitialLoading.value||!sessionListResource.query.isFetchedAfterMount.value),isLoading:computed(()=>sessionListResource.isLoading.value),pages:computed(()=>{const payload=sessionListResource.data.value;return payload&&typeof payload===`object`&&!Array.isArray(payload)?[payload]:[]}),reload:sessionListResource.reload,resource:sessionListResource});const sessionSelection=useVibe64SessionSelection({projectSlug,rememberedId:()=>sessionList.isInitialLoading?``:sessionList.pages[0]?.lastOpenedSessionId});const selectedSessionId=sessionSelection.selectedId;let emptySessionListObservedForProject=``;const{createSession,createSessionCommand,createSessionRunning}=useVibe64SessionCreation({projectSlug,refreshSessionDataInBackground,selectSessionId,sessionListQueryKey,sessionsApiPath});const archiveAttempts=ref({});const agentActivityBySessionId=ref({});const sessions=computed(()=>{const items=new Map((sessionList.items||[]).map(session=>[session.sessionId,session]));for(const[id,attempt]of Object.entries(archiveAttempts.value))if(attempt.succeeded)items.delete(id);else items.set(id,{...items.get(id)||attempt.session,archiving:true,archiveStartedAt:attempt.startedAt});return visibleVibe64Sessions([...items.values()]).map(session=>{const archiveState=sessionArchiveState(session);return{...session,agentActivity:latestAgentTurnRealtimeOverlay(session.agentActivity,agentActivityBySessionId.value[session.sessionId]),archiveOperation:archiveState.operation,archiveStartedAt:archiveState.operation?.startedAt||session.archiveStartedAt,archiveError:archiveState.archiveError,archiving:Boolean(session.archiving||archiveState.archiving)}})});const availableSessions=computed(()=>sessions.value.filter(session=>!session.archiving));const selectedListSession=computed(()=>{return sessions.value.find(session=>session.sessionId===selectedSessionId.value)||null});const selectedSessionMissing=computed(()=>{const selectedId=String(selectedSessionId.value||``).trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||``).trim()||sessionIdExistsInList(selectedId,sessions.value))return false;return true});const{selectionRenewalPredecessorId,selectionRenewalResource,syncRenewalSuccessorUrl}=useVibe64SelectedSessionRenewal({availableSessions,projectSlug,route,router,selectedListSession,selectedSessionId,selectedSessionMissing,sessionList,sessionsApiPath});const creationOptions=computed(()=>sessionList.pages?.[0]?.creation||{});const selectedSession=computed(()=>enrichVibe64SessionForDisplay(selectedListSession.value));const isSelectedSessionArchived=computed(()=>isArchivedVibe64Session(selectedSession.value||{}));const canCreateSession=computed(()=>{return creationOptions.value.canCreate===true});const createSessionVisible=computed(()=>creationOptions.value.showCreateAction===true);const createSessionTitle=computed(()=>{if(creationOptions.value.disabledReason)return String(creationOptions.value.disabledReason);if(creationOptions.value.canCreate!==true)return`Session creation is unavailable.`;return`Create a new Vibe64 session`});const selectedSessionTitle=computed(()=>{return vibe64SessionDisplayTitle(selectedSession.value||{})||`Session ${shortVibe64SessionId(selectedSessionId.value)}`});async function refreshSessionList(){return refetchEndpointResource(sessionListResource)}let refreshSessionDataInFlight=null;async function refreshSessionData(options={}){const reason=typeof options===`string`?options:String(options.reason||``);if(refreshSessionDataInFlight){vibe64SessionDebugLog(`client.sessionData.refresh.join`,{reason,selectedSessionId:String(selectedSessionId.value||``)});return refreshSessionDataInFlight}const startedAtMs=Date.now();vibe64SessionDebugLog(`client.sessionData.refresh.start`,{reason,selectedSessionId:String(selectedSessionId.value||``)});refreshSessionDataInFlight=refreshSessionList();try{const result=await refreshSessionDataInFlight;vibe64SessionDebugLog(`client.sessionData.refresh.done`,{durationMs:vibe64SessionDebugDurationMs(startedAtMs),reason,selectedSessionId:String(selectedSessionId.value||``),sessionCount:sessions.value.length});return result}catch(error){vibe64SessionDebugLog(`client.sessionData.refresh.error`,{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error),reason,selectedSessionId:String(selectedSessionId.value||``)});throw error}finally{refreshSessionDataInFlight=null}}function refreshSessionDataInBackground(options={}){refreshSessionData(options).catch(()=>{})}function selectSessionId(sessionId=``){const normalizedSessionId=String(sessionId||``).trim();if(sessions.value.some(session=>session.sessionId===normalizedSessionId&&session.archiving))return;vibe64SessionDebugLog(`client.sessionData.selectSession`,{fromSessionId:String(selectedSessionId.value||``),toSessionId:normalizedSessionId});if(normalizedSessionId)emptySessionListObservedForProject=``;sessionSelection.select(normalizedSessionId)}function clearSelectedSession(){emptySessionListObservedForProject=selectionScope.value;sessionSelection.clear()}function selectPreviousSession(sessionId){const navigation=sessions.value;const index=navigation.findIndex(session=>session.sessionId===sessionId);selectSessionId(navigation.slice(0,Math.max(0,index)).filter(session=>!session.archiving).at(-1)?.sessionId||availableSessions.value.at(-1)?.sessionId||``)}const archive=proxyRefs(useVibe64SessionDialogs({beginArchive(sessionId){archiveAttempts.value[sessionId]={startedAt:new Date().toISOString(),session:sessions.value.find(session=>session.sessionId===sessionId)};if(selectedSessionId.value===sessionId)selectPreviousSession(sessionId);return projectSlug.value},finishArchive(sessionId,succeeded,archiveProject){if(projectSlug.value!==archiveProject)return;if(succeeded)archiveAttempts.value[sessionId]={succeeded:true};else{delete archiveAttempts.value[sessionId];if(!selectedSessionId.value)selectSessionId(sessionId)}},isSelectedSessionArchived,refreshSessionData,selectedSessionId,selectedSessionTitle,sessionsApiPath}));const archiveFeedback=useUiFeedback({source:`vibe64.sessions.archive.remote`});const shownArchiveFailures=new Set;watch(projectSlug,()=>{archiveAttempts.value={};agentActivityBySessionId.value={};shownArchiveFailures.clear()});useRealtimeEvent({event:VIBE64_SESSION_SUMMARY_CHANGED_EVENT,matches:({payload={}}={})=>vibe64SessionEventMatchesScope(payload,{projectSlug:projectSlug.value}),onEvent:({payload={}}={})=>{const id=String(payload.sessionId||``);if(!id)return;const activity=agentTurnRealtimeOverlayFromPayload(payload,id);if(activity)agentActivityBySessionId.value[id]=latestAgentTurnRealtimeOverlay(agentActivityBySessionId.value[id],{active:activity.active,revision:activity.revision});if(payload.reason===`session-archiving`){const session=sessions.value.find(item=>item.sessionId===id);if(session)archiveAttempts.value[id]={session,startedAt:archiveAttempts.value[id]?.startedAt||new Date().toISOString()};if(selectedSessionId.value===id)selectPreviousSession(id)}else if(payload.reason===`session-archived`)archiveAttempts.value[id]={succeeded:true};else if(payload.reason===`session-archive-failed`){delete archiveAttempts.value[id];if(!selectedSessionId.value)selectSessionId(id)}}});watch(()=>sessionList.items,items=>{for(const id of Object.keys(agentActivityBySessionId.value))if(!items.some(session=>session.sessionId===id))delete agentActivityBySessionId.value[id];for(const[id,attempt]of Object.entries(archiveAttempts.value)){if(attempt.succeeded||archive.archivingSessionId===id)continue;const session=items.find(item=>item.sessionId===id);if(!session||!sessionArchiveState(session).archiving)delete archiveAttempts.value[id]}});watch(sessions,items=>{for(const session of items){const key=`${session.sessionId}:${session.metadata?.session_archive_operation}`;if(!session.archiveError||shownArchiveFailures.has(key))continue;shownArchiveFailures.add(key);if(archive.archivingSessionId!==session.sessionId)archiveFeedback.error(new Error(session.archiveError))}},{immediate:true});function dropUnlistedRouteSession(){const query=routeQueryWithoutUnlistedSession({route,projectSlug:projectSlug.value,sessions:sessions.value});if(query)router.replace({path:route.path,hash:route.hash,query}).catch(()=>null)}const selectionReconciliationState=computed(()=>{const nextSessions=availableSessions.value;return{createSessionRunning:createSessionRunning.value,currentSessionApiPath:currentSessionApiPath.value,selectionScope:selectionScope.value,selectionRenewal:selectionRenewalResource.data.value?.renewal||null,selectionRenewalLoadError:String(selectionRenewalResource.loadError?.value||``),selectionRenewalLoaded:Boolean(selectionRenewalResource.data.value&&typeof selectionRenewalResource.data.value===`object`&&!Array.isArray(selectionRenewalResource.data.value)),selectionRenewalLoading:Boolean(selectionRenewalResource.isInitialLoading?.value||selectionRenewalResource.isLoading?.value),selectionRenewalPredecessorId:selectionRenewalPredecessorId.value,projectSlug:String(projectSlug.value||``).trim(),selectedSessionMissing:selectedSessionMissing.value,nextSessions,selectedSessionId:String(selectedSessionId.value||``),sessionListInitialLoading:sessionList.isInitialLoading,sessionListLoaded:sessionList.pages.length>0,sessionListLoadError:String(sessionList.loadError||``),sessionListLoading:sessionList.isLoading}});watch(selectionReconciliationState,state=>{const nextSessions=state.nextSessions;if(sessions.value.some(session=>session.sessionId===state.selectedSessionId&&session.archiving)){selectPreviousSession(state.selectedSessionId);return}vibe64SessionDebugLog(`client.sessionData.sessions.changed`,{selectedSessionId:String(selectedSessionId.value||``),sessionCount:nextSessions.length});if(state.sessionListInitialLoading||state.sessionListLoadError||shouldPreserveSelectedSessionDuringRefresh({createSessionRunning:state.createSessionRunning,currentSessionId:state.selectedSessionId,nextSessions,sessionListLoading:state.sessionListLoading}))return;if(!state.selectedSessionId&&nextSessions.length===0)emptySessionListObservedForProject=state.selectionScope;if(state.selectionRenewalPredecessorId){if(state.selectionRenewalLoading||state.selectionRenewalLoadError||!state.selectionRenewalLoaded)return;const selectionRenewal=state.selectionRenewal;if(selectionRenewal&&String(selectionRenewal.sessionId||``).trim()===state.selectionRenewalPredecessorId){const renewalStatus=String(selectionRenewal.status||``).trim();if(renewalStatus===`completed`){const renewedSuccessorId=renewedSuccessorSessionId({predecessorSessionId:state.selectionRenewalPredecessorId,sessions:nextSessions});if(state.selectedSessionMissing){if(renewedSuccessorId)sessionSelection.selectAvailableId(nextSessions,{fallbackId:renewedSuccessorId,getId:session=>session.sessionId})}if(renewedSuccessorId&&selectedSessionId.value===renewedSuccessorId)syncRenewalSuccessorUrl(state.selectionRenewalPredecessorId,renewedSuccessorId);if(state.selectedSessionMissing)return}else if(state.selectedSessionMissing&&[`failed`,`running`].includes(renewalStatus))return;if([`failed`,`running`].includes(renewalStatus)){sessionSelection.select(state.selectionRenewalPredecessorId);return}}}if(!state.selectionRenewalPredecessorId)dropUnlistedRouteSession();if(!state.selectedSessionId&&emptySessionListObservedForProject===state.selectionScope)return;sessionSelection.selectAvailableId(nextSessions,{fallbackId:nextSessions.at(-1)?.sessionId||``,getId:session=>session.sessionId})},{immediate:true});useVibe64CurrentSessionPublication({selectionReconciliationState});return{archive,canCreateSession,clearSelectedSession,createSession,createSessionCommand,createSessionRunning,createSessionVisible,createSessionTitle,isSelectedSessionArchived,refreshSessionData,selectSessionId,selectedSession,selectedSessionId,selectedSessionTitle,sessionList,sessions,sessionsApiPath,shortSessionId:shortVibe64SessionId}}export{mountedSessionDetailRefreshReason as a,sessionRecordHasActiveAgentWork as c,sessionWithAgentTurnRealtimeOverlay as d,refetchEndpointResource as f,mountedSessionDetailLoadState as i,agentTurnRealtimeOverlayFromPayload as l,useVibe64SessionData as n,mountedSessionRealtimeShouldRefresh as o,latestSessionDetailRecord as r,mountedSessionRecord as s,sessionListRealtimeShouldRefresh as t,latestAgentTurnRealtimeOverlay as u};
|
package/dist/assets/{useVibe64SessionSelection-Cxt1pCjM.js → useVibe64SessionSelection-C546mBu8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Et as unref,Tt as toValue,it as watch,u as computed,vt as ref}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{g as useRoute}from"./useApi-BPuI6ZR9-rsYWyW6m.js";import{t as browserSessionStorage}from"./browser-D8z6v6Ge.js";import{p as selectedSessionStorageKey}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{P as useVibe64ProjectSlug}from"./index-
|
|
1
|
+
import{Et as unref,Tt as toValue,it as watch,u as computed,vt as ref}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{g as useRoute}from"./useApi-BPuI6ZR9-rsYWyW6m.js";import{t as browserSessionStorage}from"./browser-D8z6v6Ge.js";import{p as selectedSessionStorageKey}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{P as useVibe64ProjectSlug}from"./index-Bvd00puv.js";function readStoredValue(storageKey=``){try{return String(browserSessionStorage()?.getItem(storageKey)||``)}catch{return``}}function writeStoredValue(storageKey=``,value=``){try{const storage=browserSessionStorage();if(!storage)return;const normalizedValue=String(value||``).trim();if(normalizedValue){storage.setItem(storageKey,normalizedValue);return}storage.removeItem(storageKey)}catch{}}function readStorageKey(storageKey=``){return String(toValue(storageKey)||``).trim()}function readPreferredId(preferredId=``){return String(toValue(preferredId)||``).trim()}function useStoredSelection({preferredId=``,rememberedId,storageKey=``,enabled=true}){const selectionEnabled=computed(()=>Boolean(toValue(enabled)));const activeStorageKey=computed(()=>readStorageKey(storageKey));const activePreferredId=computed(()=>readPreferredId(preferredId));const restoredId=(key=activeStorageKey.value)=>rememberedId===void 0?readStoredValue(key):readPreferredId(rememberedId);const selectedId=ref(selectionEnabled.value?activePreferredId.value||restoredId():``);function select(id=``){if(!selectionEnabled.value)return;selectedId.value=String(id||``).trim();writeStoredValue(activeStorageKey.value,selectedId.value)}function clear(){select(``)}function selectAvailableId(items=[],{fallbackId=``,getId=item=>item?.id}={}){if(!selectionEnabled.value)return``;if(items.length===0){clear();return``}const itemIds=items.map(item=>String(getId(item)||``).trim()).filter(Boolean);if(itemIds.includes(selectedId.value)){select(selectedId.value);return selectedId.value}const preferredSelectionId=activePreferredId.value;if(itemIds.includes(preferredSelectionId)){select(preferredSelectionId);return selectedId.value}const restoredSelectionId=restoredId();select(itemIds.includes(restoredSelectionId)?restoredSelectionId:String(fallbackId||``).trim());return selectedId.value}function capture(){const key=activeStorageKey.value;const admitted=selectionEnabled.value;return Object.freeze({select(id=``){if(!admitted)return;const value=String(id||``).trim();writeStoredValue(key,value);if(selectionEnabled.value&&activeStorageKey.value===key)selectedId.value=value}})}watch(selectionEnabled,nextEnabled=>{selectedId.value=nextEnabled?activePreferredId.value||restoredId():``},{flush:`sync`});watch(activeStorageKey,nextStorageKey=>{if(selectionEnabled.value)selectedId.value=activePreferredId.value||restoredId(nextStorageKey)});watch(activePreferredId,nextPreferredId=>{if(selectionEnabled.value&&nextPreferredId)selectedId.value=nextPreferredId});return{capture,clear,select,selectAvailableId,selectedId}}function selectedSessionIdFromRoute(route={}){const rawValue=route.query?.session;const value=Array.isArray(rawValue)?rawValue[0]:rawValue;return String(value||``).trim()}function useVibe64SessionSelection({projectSlug=useVibe64ProjectSlug(),rememberedId,route=useRoute()}){return useStoredSelection({preferredId:computed(()=>selectedSessionIdFromRoute(route)),rememberedId,storageKey:computed(()=>selectedSessionStorageKey(unref(projectSlug)))})}export{useVibe64SessionSelection as n,selectedSessionIdFromRoute as t};
|
|
@@ -1 +1 @@
|
|
|
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-61E93qP-.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-oIU1Eq_t.js";import{l as requestVibe64AiOnboarding,y as useModelRouting}from"./client-CjNw-kf-.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 useUiFeedback}from"./useUiFeedback-CycH_fvY.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-X5MxTHwl.js";import{j as requestVibe64AccountConnectionsDialog,k as Vibe64SessionAssistantMenu_default}from"./index-Btrr1DGq.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-DNl0aDcC.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 deploy 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-84ea6dc2`]]);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.`:`Start with Senior. Choose Junior or Auto 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(VSelect,{modelValue:branchName.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>branchName.value=$event),items:unref(branches).data.value?.branches||[],"item-title":`name`,"item-value":`name`,label:createBranch.value?`Create from`:`Branch`,disabled:submitting.value,"hide-details":``},null,8,[`modelValue`,`items`,`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`},`Deploying 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-7f38a91a`]]);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};
|
|
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-61E93qP-.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-oIU1Eq_t.js";import{l as requestVibe64AiOnboarding,y as useModelRouting}from"./client-DnjkdG6K.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 useUiFeedback}from"./useUiFeedback-CycH_fvY.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-X5MxTHwl.js";import{j as requestVibe64AccountConnectionsDialog,k as Vibe64SessionAssistantMenu_default}from"./index-Bvd00puv.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-DNl0aDcC.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 deploy 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-84ea6dc2`]]);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(VSelect,{modelValue:branchName.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>branchName.value=$event),items:unref(branches).data.value?.branches||[],"item-title":`name`,"item-value":`name`,label:createBranch.value?`Create from`:`Branch`,disabled:submitting.value,"hide-details":``},null,8,[`modelValue`,`items`,`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`},`Deploying 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-64d684e1`]]);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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pr-destination[data-v-84ea6dc2]{overflow-wrap:anywhere}.pr-details summary[data-v-84ea6dc2]{cursor:pointer;min-height:48px}.vibe64-assistant-dialog__progress[data-v-64d684e1]{gap:.5rem;padding:0 1.5rem .5rem;display:grid}.vibe64-assistant-dialog[data-v-64d684e1]{border:1px solid rgb(var(--v-theme-outline-variant))}.vibe64-assistant-dialog__title[data-v-64d684e1]{justify-content:space-between;align-items:center;padding:1rem 1.25rem .75rem;display:flex}.vibe64-assistant-dialog__title-copy[data-v-64d684e1]{gap:.15rem;display:grid}.vibe64-assistant-dialog__title-copy small[data-v-64d684e1]{color:rgba(var(--v-theme-on-surface), .66);white-space:normal}.vibe64-assistant-dialog__body[data-v-64d684e1]{padding:.25rem 1.25rem 1rem!important}.vibe64-assistant-dialog__ai[data-v-64d684e1]{overflow-wrap:anywhere;justify-items:start;gap:.25rem;display:grid}.vibe64-assistant-dialog__main-ai[data-v-64d684e1]{margin-inline-start:-.5rem}.vibe64-assistant-dialog__actions[data-v-64d684e1]{border-top:1px solid rgb(var(--v-theme-outline-variant));justify-content:flex-end;gap:.5rem;padding:.75rem 1.25rem}@media (width<=600px){.vibe64-assistant-dialog__body[data-v-64d684e1],.vibe64-assistant-dialog__actions[data-v-64d684e1],.vibe64-assistant-dialog__title[data-v-64d684e1]{padding-inline:1rem!important}}
|
package/dist/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<style>@layer vuetify-core.reset, vuetify-core.base, vuetify-components, vuetify-overrides, vuetify-utilities.theme-base, vuetify-utilities.typography, vuetify-utilities.helpers, vuetify-utilities.theme-background, vuetify-utilities.theme-foreground, vuetify-final.transitions, vuetify-final.trumps;</style>
|
|
5
|
-
<meta name="jskit-client-build" content="
|
|
5
|
+
<meta name="jskit-client-build" content="6b32d7e7a4276a77">
|
|
6
6
|
|
|
7
7
|
<meta charset="UTF-8" />
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}, true);
|
|
25
25
|
</script>
|
|
26
26
|
<style>#startup-shell{color:#25232a;background:#faf9fc;grid-template-rows:56px 1fr;font:15px system-ui,sans-serif;display:grid;position:fixed;inset:0}#startup-shell header{border-bottom:1px solid #dedce3;align-items:center;padding:0 24px;font-weight:600;display:flex}#startup-shell main{grid-template-columns:240px 1fr;min-height:0;display:grid}#startup-shell aside{border-right:1px solid #dedce3;padding:24px}#startup-shell .startup-placeholder{background:#e5e2eb;border-radius:4px;height:16px;margin-bottom:20px}#startup-shell section{padding:32px}#startup-shell a{min-height:48px;color:inherit;align-items:center;display:inline-flex}@media (width<=600px){#startup-shell main{grid-template-columns:1fr}#startup-shell aside{display:none}}@media (prefers-color-scheme:dark){#startup-shell{color:#eeeaf3;background:#19181d}#startup-shell header,#startup-shell aside{border-color:#3c3942}#startup-shell .startup-placeholder{background:#35323d}}</style>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-Bvd00puv.js"></script>
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/runtime-core.esm-bundler-Bi1P1jMa.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/normalize-BD25VwNK.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/returnToPath-CILshEkc.js">
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
<link rel="modulepreload" crossorigin href="/assets/useUiFeedback-CycH_fvY.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/useCommand-D96utlVe.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/shared-X5MxTHwl.js">
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/assistantRouting
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/assistantRouting-D4SnnxJn.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="/assets/shared-DjZEYqzW.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="/assets/vibe64ApiResponses-DuJ9mfus.js">
|
|
94
94
|
<link rel="modulepreload" crossorigin href="/assets/studioGateApi-CHIdcQvD.js">
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/client-
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/client-DnjkdG6K.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/client-4uCr4dYG.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/VTextarea-CLaWcpd_.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/useAssistantAttachments-CkseokGM.js">
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
<link rel="stylesheet" crossorigin href="/assets/client-B8u2_Svv.css">
|
|
128
128
|
<link rel="stylesheet" crossorigin href="/assets/VTextarea--uW4w6nq.css">
|
|
129
129
|
<link rel="stylesheet" crossorigin href="/assets/conversation-La-pkh5h.css">
|
|
130
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
130
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BBfSvf2i.css">
|
|
131
131
|
</head>
|
|
132
132
|
<body>
|
|
133
133
|
<div id="app">
|
|
@@ -98,8 +98,8 @@ In Auto, Senior always does the finishing steps after implementation, even when
|
|
|
98
98
|
Senior implemented it or both roles use the same model: the review, Deslop and
|
|
99
99
|
[UI pass](ui-pass.md) the chat's **Chat settings** switches turn on, in one
|
|
100
100
|
Senior turn, then **Save**. **Automatically review changes**, **Automatically
|
|
101
|
-
deslop changes
|
|
102
|
-
**
|
|
101
|
+
deslop changes**, **Automatically UI pass changes** and **Automatically save
|
|
102
|
+
changes** are all on for new chats. Each step a switch starts adds a notice
|
|
103
103
|
such as **Review started automatically (Chat settings: Automatically review
|
|
104
104
|
changes)**. Turning a switch off asks first and says what is lost; **Cancel**
|
|
105
105
|
keeps it on. When review, Deslop and the UI pass are all off, a handoff after
|
|
@@ -8,9 +8,13 @@ finished is chosen by four **Chat settings** switches, the same in **Auto**,
|
|
|
8
8
|
| --- | --- | --- |
|
|
9
9
|
| **Automatically review changes** | Checks the finished work against your request, fixes what it finds, and checks the work's tests. | On |
|
|
10
10
|
| **Automatically deslop changes** | Cleans up the code without changing what it does: duplicated helpers, dead code and muddled structure. | On |
|
|
11
|
-
| **Automatically UI pass changes** | Brings the screens the work changed in line with the project's UI guidance; see [Run a UI pass](ui-pass.md). |
|
|
11
|
+
| **Automatically UI pass changes** | Brings the screens the work changed in line with the project's UI guidance; see [Run a UI pass](ui-pass.md). | On |
|
|
12
12
|
| **Automatically save changes** | Runs the session's ordinary **Save** once the steps above are done. | On |
|
|
13
13
|
|
|
14
|
+
A new session's chat starts in **Auto** with all four switches on. Each chat
|
|
15
|
+
then keeps its own choices, so changing one chat's switches never changes
|
|
16
|
+
another's.
|
|
17
|
+
|
|
14
18
|
## Find the switches
|
|
15
19
|
|
|
16
20
|
Open **Chat mode**, the icon inside the message box. Under the chat modes,
|
|
@@ -36,8 +40,8 @@ lost:
|
|
|
36
40
|
**Cancel** keeps the switch on; the red button saves it off for this chat.
|
|
37
41
|
Either way **Chat mode** stays open, so you can see the result. The
|
|
38
42
|
chat-mode button's label names each step that is on, for example **Automatic
|
|
39
|
-
review on. Automatic deslop on. Automatic save on**. A
|
|
40
|
-
next piece of work. The switches are the owner's main chat choice: a team
|
|
43
|
+
review on. Automatic deslop on. Automatic UI pass on. Automatic save on**. A
|
|
44
|
+
change applies to the next piece of work. The switches are the owner's main chat choice: a team
|
|
41
45
|
member sees them disabled, and they are disabled while a goal is active.
|
|
42
46
|
Temporary chats, AI tasks and Fix it with AI have no Chat settings and run none
|
|
43
47
|
of these steps. Neither do lessons: Deslop never rewrites a learner's code, and
|
|
@@ -100,6 +100,16 @@ Codex, Claude and OpenCode share the project-format check before refreshing
|
|
|
100
100
|
skills and agent guidance. This check reads the format marker without scanning
|
|
101
101
|
application files; it does not replace the separate guidance checks.
|
|
102
102
|
|
|
103
|
+
Wrong contents in a project file never stop a message. When Genesis cannot read
|
|
104
|
+
a file it gives the assistant, such as a `genesis/stack.md` line with prose after
|
|
105
|
+
a Verification command or an invalid `.claude/settings.json`, the message is
|
|
106
|
+
still sent, in Main, a temporary chat or an AI task alike. The chat shows a
|
|
107
|
+
notice once per problem, naming the file, the line where Genesis knows it, the
|
|
108
|
+
text found there and Genesis's explanation, and the assistant receives the same
|
|
109
|
+
explanation so it can repair the file. Skill and agent-guidance refresh waits
|
|
110
|
+
until the file reads again. Desktop and mobile behave the same; Colleague can
|
|
111
|
+
explain the notice and offer to ask the coding assistant to fix the file.
|
|
112
|
+
|
|
103
113
|
When an assistant cannot start, stops by itself or reports a failure, see [When a coding agent fails or stops](coding-agent-failures.md).
|
|
104
114
|
|
|
105
115
|
1. Select the intended project and session, then Main, the intended temporary
|
|
@@ -4,7 +4,8 @@ Use **New session** (+), or **Create session** when there are no open sessions,
|
|
|
4
4
|
to open **Start an AI session**. It shows **Runs on your main AI:** and the main
|
|
5
5
|
AI's model. A saved setup appears straight away: the dialog does not wait for
|
|
6
6
|
each AI tool's model list or start any AI tool. Without a change the new session
|
|
7
|
-
runs on the main AI and starts
|
|
7
|
+
runs on the main AI and its chat starts in **Auto**, as the dialog's **Starts in
|
|
8
|
+
Auto** line says, with every [Chat settings](chat-settings.md) switch on.
|
|
8
9
|
|
|
9
10
|
To run only this new session on another AI, for example DeepSeek, select
|
|
10
11
|
**Change** beside the main AI. It opens **Custom AI**, the same choice as a
|
|
@@ -45,20 +45,20 @@ reason instead of running on Junior; choose a Senior model in **Models**.
|
|
|
45
45
|
|
|
46
46
|
## Run it automatically after each piece of work
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
mode.
|
|
48
|
+
**Automatically UI pass changes**, under **Chat settings** in **Chat mode**
|
|
49
|
+
(the icon inside the message box), is on for new chats and works in every chat
|
|
50
|
+
mode. While it is on, once a piece of work is finished, the agent that finishes it
|
|
51
51
|
(Senior in **Auto**, otherwise the chat's own agent) runs the UI pass on the
|
|
52
52
|
screens that work changed, after any review and Deslop, in the same turn and
|
|
53
53
|
before **Save**. The chat notes **UI pass started automatically (Chat settings:
|
|
54
54
|
Automatically UI pass changes)** as it starts. Nothing runs on its own while the
|
|
55
55
|
switch is off.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
applies to the next piece of work. Turning it on
|
|
59
|
-
asks first, as the other switches do: **Turn off
|
|
60
|
-
the screens the work changes will no longer get
|
|
61
|
-
typing “UI pass” in the chat still runs one. **Cancel** keeps it on; **Turn off
|
|
57
|
+
It is saved for each chat, so a chat that has it off keeps it off until you
|
|
58
|
+
turn it on, and its change applies to the next piece of work. Turning it on
|
|
59
|
+
saves at once. Turning it off asks first, as the other switches do: **Turn off
|
|
60
|
+
Automatic UI pass?** says that the screens the work changes will no longer get
|
|
61
|
+
a design review, and that typing “UI pass” in the chat still runs one. **Cancel** keeps it on; **Turn off
|
|
62
62
|
Automatic UI pass** saves it off. The line under the switch is a reminder of the
|
|
63
63
|
chat command: **Or tell the agent “UI pass” any time — add “: <section>” or “:
|
|
64
64
|
the whole app”.** The chat-mode button's label adds **Automatic UI pass on**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Claude's model list is kept once per account in the server process instead of once per account-query owner, as plan usage already is: an owner the host creates again (a restarted service, a reopened project) answers `readCatalogue` from the list another owner read, without starting a tool-free Claude, while the account's credentials and Claude Code are unchanged. A credentials change (sign-in, sign-out, token refresh) or a Claude Code update still reads it again, and an owner's `invalidate()` drops the list of every account it used, for every owner.
|
|
5
6
|
- Test fixture only: the responsive assistant fixture's avatar is drawn in the theme's `primary` and `on-primary` roles instead of a raw `#6750a4` and `white`, so it follows the dark scheme like the rest of the conversation. A package test runs `jskit check m3`'s raw-colour rule over the fixture, which the check itself skips with every `fixtures/` folder.
|
|
6
7
|
- The assistant settings resource (`assistantConfigResource`) has a required boolean `canUpdate` attribute: whether the signed-in person may change the settings, as the server decides (`@jskit-ai/assistant-runtime`'s settings pane shows Save only when it is true).
|
|
7
8
|
- **Breaking (data-access redesign).** The assistant operations are API contracts: `assistantContract` and `assistantConfigContract` (view and patch, the two its routes serve), which replace `assistantResource` and `assistantConfigResource`.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
- The conversations and messages repositories hand their handle calls only the caller's transaction, with their own context and settings: a caller's other settings (a format, `missing`, `returning`, `fields`) no longer ride into every read and write they make. They take `passedOn` from `@jskit-ai/resource-core/shared/callOptions`, so `@jskit-ai/assistant-runtime/server` still loads on file storage, where `@jskit-ai/resource-runtime` (an optional peer) is not installed.
|
|
6
|
+
- Its table resources declare the foreign keys their migrations always create (`foreignKeys`), so json-rest-api 3.1.0 can skip the visibility query a system-context read makes for a record such a key guarantees exists. `jskit test --databases` checks each against an app's test database: assistant_conversations.created_by_user_id and assistant_turn_requests.actor_user_id to users, and assistant_messages.conversation_id to assistant_conversations and actor_user_id to users. The workspace_id keys exist only where the application has a workspaces table, so none declares them. `usersForeignKeysMigration.test.js` proves the declarations match the migrations.
|
|
6
7
|
- A database error in an assistant turn reaches the client only as the kernel's generic answer (`hideDatabaseError`: 409 `kernel.database.concurrentWrite` when the database refused the transaction for a concurrent one, else 500). A failure after the stream started was sent with its own message, which for a database error is the statement and its values, and the same message was saved with the turn and replayed, as an `AppError`, to a client that sent the message again; the chat route's error before the stream and a conversation subscription's acknowledgement carried the driver's code. Each now sends and saves the stand-in and logs the whole error; `createChatService` takes the runtime's `logger`.
|
|
7
8
|
- The assistant settings pane shows **Save** only to people the server lets change the settings. It offered Save to anyone who could read them, so a person without the permission (an employee, say) saw Save and was refused with `assistant.runtime.settings.updateForbidden` when they used it. The settings read now carries `canUpdate`, answered by the new `assistant.settings` service method `canUpdateSettings(input, { context })`, which runs the same check as `updateSettings` (an app's `assistantServer.<surface>.settingsUpdatePermission`, else `workspace.settings.update`, the console owner or `assistant.settings.update`) and answers false where that check refuses; a saved change carries `canUpdate: true`. Without it, the pane shows the instructions read-only, with no Save in the app bar. Apps change nothing; an app that supplies its own `assistant.settings` service adds `canUpdateSettings`.
|
|
8
9
|
- A conversation write through the SQL storage issues 8 statements on SQLite where it issued 12, whatever the conversation's length: the conversation and its transcript state come from one read, new messages take the next seq after the one the load read under the conversation's lock instead of reading it again, and one UPDATE writes the transcript state with the record's changes instead of an update, a read-back and a second update. A read issues 4 where it issued 5. `assistant.repositories`' conversations replace `readTranscriptState(id)` with `findWithTranscriptState(id, options)`, which answers `{ conversation, revision, summary }` (under a row lock with `forUpdate`), and `writeTranscriptState` takes the record's `changes` beside the revision and summary.
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
|
|
25
26
|
### Upgrading
|
|
26
27
|
|
|
28
|
+
- Register `AssistantStoreFeature` from `@jskit-ai/assistant-runtime/server` in the server providers beside `AssistantFeature`, unless the app provides `assistant.conversations` itself: the assistant's four tables are table resources that `AssistantStoreFeature` owns, and it provides the `assistant.repositories` the database-backed assistant keeps its conversations in, so `AssistantFeature` without it refuses to start, naming it.
|
|
27
29
|
- Grant `assistant.settings.update` to the people who configure the assistant, or set `settingsUpdatePermission` to a permission they already hold.
|
|
28
30
|
|
|
29
31
|
## 0.2.0 - 2026-10-29
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- connector_authorization_attempts declares its foreign key, connection_key to connector_connections.connection_key (`foreignKeys`), so json-rest-api 3.1.0 can skip the visibility query a system-context read makes for a record such a key guarantees exists. `jskit test --databases` checks each against an app's test database. `knexConnectionStore.test.js` proves it matches the migration on the connector test database.
|
|
5
6
|
- `@jskit-ai/database-runtime` and `@jskit-ai/resource-runtime` are optional peer dependencies, as they are of assistant-runtime, instead of dependencies: an app without a database installs, composes and starts the package without them, where installing them made boot refuse it for want of a database driver. An app that uses its knex connection store (`./server/storage`) has them through its database.
|
|
6
7
|
- `createKnexConnectionStore` owns the connector tables through resource-runtime's `createStandaloneResources`, with the connection store's declared system scope, instead of building a resource runtime and host of its own.
|
|
7
8
|
- `connectors.core` without a store requires `connectors.store` again, with a hint, so the kernel's startup error names the missing capability and says to register `createConnectionStoreFeature({ protection })` or pass `createConnectorsFeature({ store })`, instead of a check in its own setup.
|
|
@@ -426,6 +426,14 @@ Import `createKnexConnectionStore` and `createCredentialProtection` from
|
|
|
426
426
|
`@jskit-ai/connectors-core/server/storage`. Use the application's existing Knex
|
|
427
427
|
client, with its selected JSKIT MySQL or PostgreSQL driver.
|
|
428
428
|
|
|
429
|
+
`./server/storage` imports `@jskit-ai/resource-runtime`, which this package
|
|
430
|
+
takes as an optional peer, so npm does not install it. An application using the
|
|
431
|
+
database-backed store declares `@jskit-ai/resource-runtime` and
|
|
432
|
+
`@jskit-ai/database-runtime` itself, at the catalog's versions, as a JSKIT
|
|
433
|
+
application on a database already does; without them, importing
|
|
434
|
+
`./server/storage` fails with `ERR_MODULE_NOT_FOUND`. An application on file
|
|
435
|
+
storage imports `./server/file-storage` and needs neither.
|
|
436
|
+
|
|
429
437
|
```js
|
|
430
438
|
const protection = createCredentialProtection({
|
|
431
439
|
keys: { current: decoded32ByteSecretKey },
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- `request.callOptions({ input })` gives a route that runs no action (a provider's callback, a streamed download) the call options `{ context }` the same request's action would get: the action catalogue's new `contextFor({ input, context })` runs the same context contributors and normalizes the result as the action pipeline does, with the route's channel, surface, visibility and request, and `input` defaulting to the route's params, so the workspace is resolved from `workspaceSlug` as an action's is. Contributors are told no action, and no action permission is checked: the route's own `auth` and `permission` are its gate.
|
|
6
|
+
- **Security.** `defineFeature` refuses `runtime.resources` in `requires` or `optional` in any spelling the runtime resolves, such as `"Runtime.Resources"` or `" runtime.resources "`: capability ids are trimmed and lower-cased when they resolve, but the refusal compared the raw text, so another spelling handed a feature the whole resource runtime, whose `declareSystemScope` mints a system context.
|
|
7
|
+
- The action catalogue builds its registry once, when discovery or execution first reads it, instead of again at every registration: an app registering n contributors rebuilt its index n times at every composition. A contributor that repeats a registered action's id and version is still refused at its own registration, with the same message. An action input whose schema is frozen throughout, as a CRUD feature's are, is checked for `oneOf` once rather than at every registration of it; a schema that can still change is checked every time, as before.
|
|
5
8
|
- An action event whose scope is global (one written on a customer's or a public surface) carries the workspace the request resolved as its scope's `workspaceId`: the context's workspace, the resolved workspace context's, or the request's, when they agree, never one its input or payload names. Realtime reads the event's audience there, in place of a `workspaceId` the payload named.
|
|
6
9
|
- A database error never reaches a client. A driver's error carries the statement and its values (Knex starts its message with the SQL and its bindings; MySQL's `sqlMessage` and `sql`, Postgres's `detail`), and a wrapper that keeps one as its `cause`, such as json-rest-api's `RestApiWriteError`, copies its message and code. The HTTP error handler answered it 500 with the driver's code (`ER_CHECKREAD`, `ER_DUP_ENTRY`, `23505`). It now answers a stand-in: 409 with the code `kernel.database.concurrentWrite` ("Another request changed the same data at the same time. Try again.") when the database refused the transaction for a concurrent one (MySQL and MariaDB errno 1020 "Record has changed since last read", 1213 deadlock, 1205 lock wait timeout; Postgres `40001`, `40P01`, `55P03`; `SQLITE_BUSY`), so the client may send the request again, else 500 `internal_server_error`, with the wrapper's `transactionOutcome`; the whole error goes to the log as "Database error". An `AppError` keeps its own answer whatever it wraps, so a duplicate key a feature turns into a `ConflictError` answers as before. `hideDatabaseError(error)` (`@jskit-ai/kernel/server/runtime`) answers the stand-in, or the error itself when it is not a database error, for any other edge that answers a client. New message key: `jskit.kernel.database.concurrentWrite`.
|
|
7
10
|
- An action a system context or a job runs keeps that context's kind: `normalizeExecutionContext` now passes a context's symbol-keyed entries through with the rest, so the private markers of a json-rest-api system context and of a job context derived from one reach the action, and a handle call inside it reads as that system context or job, not as an anonymous request. The reserved fields are normalized as before, and a job done for one person is still signed in as no one: `actor` stays null, so an authenticated action and `requireAuth` refuse it.
|