vibe64 0.1.60 → 0.1.62

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.
Files changed (178) hide show
  1. package/bin/run.js +549 -547
  2. package/bin/upgrade-state.js +113 -105
  3. package/dist/assets/{GithubBrowserTabs-Vv-64NIg.js → GithubBrowserTabs-BJ2NXiuQ.js} +1 -1
  4. package/dist/assets/{LocalDatabaseServer-rolg-sXl.js → LocalDatabaseServer-Z5VQcWgu.js} +1 -1
  5. package/dist/assets/{SelectField-DwWoHC2p.js → SelectField-RGWl_ms9.js} +1 -1
  6. package/dist/assets/{ShellOutlet-Clsh2qYP.js → ShellOutlet-CdjsJfg9.js} +1 -1
  7. package/dist/assets/VAutocomplete-BnpXAJGa.js +1 -0
  8. package/dist/assets/{VCheckbox-B40zJSbZ.js → VCheckbox-BK0ss4F4.js} +1 -1
  9. package/dist/assets/{VCheckboxBtn-6ebHAnh9.js → VCheckboxBtn-DDlYJnth.js} +1 -1
  10. package/dist/assets/{VDialog-B2W9wqR8.js → VDialog-BCIrX462.js} +1 -1
  11. package/dist/assets/VMenu-Bql3E6DV.js +1 -0
  12. package/dist/assets/VMenu-DCU7zd0B.css +1 -0
  13. package/dist/assets/VOverlay-EPzW7eVB.js +1 -0
  14. package/dist/assets/{VRadioGroup-D1duMMwJ.js → VRadioGroup-CL3HTmyT.js} +1 -1
  15. package/dist/assets/VSelect-Ch00dyiM.js +1 -0
  16. package/dist/assets/VSkeletonLoader-Bl9P5wdh.js +1 -0
  17. package/dist/assets/VSkeletonLoader-DXZarZ9m.css +1 -0
  18. package/dist/assets/{VSwitch-DUkp5sfW.js → VSwitch-DftK1EyR.js} +1 -1
  19. package/dist/assets/{VTextField-BMvaWVTN.js → VTextField-B9R7EIjg.js} +1 -1
  20. package/dist/assets/{VTextarea-CLaWcpd_.js → VTextarea-CMgyRNk-.js} +1 -1
  21. package/dist/assets/{Vibe64AsyncModuleState-C9rLM2H0.js → Vibe64AsyncModuleState-9bN0_H45.js} +1 -1
  22. package/dist/assets/Vibe64AuthSettingsButton-B4FbKoV7.js +5 -0
  23. package/dist/assets/{Vibe64AuthSettingsButton-DbL7Ukry.css → Vibe64AuthSettingsButton-DFfFPrd7.css} +1 -1
  24. package/dist/assets/{Vibe64ConversationLog-K6aUo3q1.js → Vibe64ConversationLog-Dk2jeU21.js} +1 -1
  25. package/dist/assets/{Vibe64DashboardShell-C_wkAaSb.js → Vibe64DashboardShell-BGE8m2VG.js} +1 -1
  26. package/dist/assets/{Vibe64DatabaseWorkspace-Dy88t2ZX.js → Vibe64DatabaseWorkspace-BrB-0zdd.js} +1 -1
  27. package/dist/assets/Vibe64DestinationButton-CdyyK9tj.js +1 -0
  28. package/dist/assets/Vibe64DestinationButton-ZxY1Lwie.css +1 -0
  29. package/dist/assets/Vibe64FileArea-B8_Tqtgv.js +1 -0
  30. package/dist/assets/Vibe64OutputControls-JHBVJBQ4.js +8 -0
  31. package/dist/assets/{Vibe64RepositoryWorkspace-CWw4w5SA.js → Vibe64RepositoryWorkspace-DFuF1aDy.js} +1 -1
  32. package/dist/assets/Vibe64SessionFiles-Ih3aXiKq.js +1 -0
  33. package/dist/assets/{Vibe64SessionSourceEditor-BVfoXgmZ.js → Vibe64SessionSourceEditor-EUExI1YB.js} +1 -1
  34. package/dist/assets/{Vibe64UiStoryboardView-BYLWabXY.css → Vibe64UiStoryboardView-DqLN6ofL.css} +1 -1
  35. package/dist/assets/Vibe64UiStoryboardView-DrE3Dqjr.js +8 -0
  36. package/dist/assets/{Vibe64UnavailableSessions-BRB2bUR_.js → Vibe64UnavailableSessions-CCWWp2-Y.js} +1 -1
  37. package/dist/assets/_pageId_-JF3VAGm5.js +1 -0
  38. package/dist/assets/_sessionId_-7PyIUeUr.css +1 -0
  39. package/dist/assets/_sessionId_-DzhYkoTF.js +1 -0
  40. package/dist/assets/{_sessionTool_-CKPNp5fF.js → _sessionTool_-CBf51mfK.js} +1 -1
  41. package/dist/assets/_sessionTool_-DiYoi-BF.css +1 -0
  42. package/dist/assets/{_slug_-C5yeqlpL.js → _slug_-CK9TQknP.js} +6 -6
  43. package/dist/assets/_slug_-CZmGS16g.css +1 -0
  44. package/dist/assets/access-BOqP7tK6.js +1 -0
  45. package/dist/assets/{app-BKwP6m9e.js → app-C9NRUu1x.js} +1 -1
  46. package/dist/assets/{changes-DT8e3wYn.js → changes-Df2TTLEm.js} +1 -1
  47. package/dist/assets/{client-CUQfIUus.css → client-BBJzQIWS.css} +1 -1
  48. package/dist/assets/{client-B_iZQVU8.js → client-BRcncaFt.js} +1 -1
  49. package/dist/assets/client-Bkk7jZD9.js +1 -0
  50. package/dist/assets/{client-Cf6iimPy.js → client-BzNAjCJm.js} +2 -2
  51. package/dist/assets/{client-BHa4BumO.js → client-CiGvH-QO.js} +2 -2
  52. package/dist/assets/client-DdNHOrl8.js +2 -0
  53. package/dist/assets/conversation-D7T_us2O.js +1 -0
  54. package/dist/assets/{conversation-DA_fbJJD.css → conversation-ZN3-8jbz.css} +1 -1
  55. package/dist/assets/{conversation-CsB1b1JZ.js → conversation-wiDH8Ni4.js} +4 -4
  56. package/dist/assets/{dashboard-DRwBugiR.js → dashboard-Dt57zpvc.js} +1 -1
  57. package/dist/assets/{english-definitions-Bi3yaDu7.js → english-definitions-C0n2xolE.js} +1 -1
  58. package/dist/assets/env-CIJebqCq.js +1 -0
  59. package/dist/assets/{error-kdRkyK9x.js → error-BQ7r64JO.js} +1 -1
  60. package/dist/assets/{error-CX8_snYL.js → error-BqMxhgpB.js} +1 -1
  61. package/dist/assets/{fileTypes-DRyfajWx.js → fileTypes-2k5HCkMT.js} +1 -1
  62. package/dist/assets/health-B9ZoQC78.js +1 -0
  63. package/dist/assets/history-DqtrCyKI.js +1 -0
  64. package/dist/assets/{i18n-B5lc019_.js → i18n-Dm74yE_M.js} +1 -1
  65. package/dist/assets/{index-Wcdz2Rey.js → index-tPEeYKmw.js} +5 -5
  66. package/dist/assets/{integrations-BHURBo17.js → integrations-BST4Qw-s.js} +11 -4
  67. package/dist/assets/{integrations-Bo_beIy3.css → integrations-CwgrZgmM.css} +1 -1
  68. package/dist/assets/issues-CN8brLcd.js +1 -0
  69. package/dist/assets/issues-D46llNv-.css +1 -0
  70. package/dist/assets/{learning-BrBAyLFt.js → learning-B8e42exz.js} +1 -1
  71. package/dist/assets/{pages-BTk_FkDr.js → pages-DWmGyVcJ.js} +1 -1
  72. package/dist/assets/{project-files-CTGwnBh7.js → project-files-CiFrH7b9.js} +1 -1
  73. package/dist/assets/publish-D1Cm9dcY.js +3 -0
  74. package/dist/assets/pull-requests-DtqrTix0.css +1 -0
  75. package/dist/assets/pull-requests-ujRUy7Rf.js +1 -0
  76. package/dist/assets/{repository-DknGo0hr.js → repository-v-kDk9e_.js} +1 -1
  77. package/dist/assets/settings-CMMTWcem.js +1 -0
  78. package/dist/assets/thinkingText-mMYz6e03.js +8 -0
  79. package/dist/assets/{useArchivedVibe64Sessions-DI9ow2ds.js → useArchivedVibe64Sessions-C3w4gzum.js} +1 -1
  80. package/dist/assets/useAssistantAttachments-BkYZckgz.js +2 -0
  81. package/dist/assets/{useCommand-YOAaO5Wz.js → useCommand-CNDe8gM-.js} +1 -1
  82. package/dist/assets/{useUiFeedback-Bixow9mW.js → useUiFeedback-CWb6o71Z.js} +1 -1
  83. package/dist/assets/useVibe64ConversationLog-BfW5VQBw.js +2 -0
  84. package/dist/assets/{useVibe64Learning-RE4HXHqo.js → useVibe64Learning-DiLAIKbI.js} +1 -1
  85. package/dist/assets/{useVibe64SessionData-Df7M5k1M.js → useVibe64SessionData-BZUDqDiW.js} +1 -1
  86. package/dist/assets/{useVibe64SessionSelection-B0USk6X6.js → useVibe64SessionSelection-ChkFsI6Y.js} +1 -1
  87. package/dist/assets/vibe64RepositoryRealtime-BamEfp1M.js +1 -0
  88. package/dist/assets/{vibe64RepositoryRealtime-ByZfq2fE.css → vibe64RepositoryRealtime-rnWlv9jw.css} +1 -1
  89. package/dist/assets/vibe64SessionFocus-BCojr4E-.css +1 -0
  90. package/dist/assets/vibe64SessionFocus-CfH5XqgI.js +1 -0
  91. package/dist/index.html +28 -32
  92. package/docs/colleague-usage/ai-tasks.md +3 -1
  93. package/docs/colleague-usage/auto-workflow.md +6 -3
  94. package/docs/colleague-usage/back-navigation.md +16 -13
  95. package/docs/colleague-usage/chat-settings.md +20 -0
  96. package/docs/colleague-usage/coding-agent-goal-pause.md +15 -1
  97. package/docs/colleague-usage/coding-agent-goals.md +23 -3
  98. package/docs/colleague-usage/colleague-watches.md +1 -1
  99. package/docs/colleague-usage/connected-projects.md +1 -1
  100. package/docs/colleague-usage/dashboard-navigation.md +14 -11
  101. package/docs/colleague-usage/database.md +1 -1
  102. package/docs/colleague-usage/development-env.md +21 -12
  103. package/docs/colleague-usage/github-work.md +1 -1
  104. package/docs/colleague-usage/integrations.md +2 -2
  105. package/docs/colleague-usage/learning-teacher-guide.md +3 -2
  106. package/docs/colleague-usage/pages.md +1 -2
  107. package/docs/colleague-usage/project-messages.md +1 -1
  108. package/docs/colleague-usage/session-archive.md +3 -1
  109. package/docs/colleague-usage/sessions.md +3 -3
  110. package/docs/colleague-usage/ui-pass.md +1 -1
  111. package/node_modules/@jskit-ai/assistant-core/locales/en.json +4 -1
  112. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  113. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  114. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  115. package/node_modules/@jskit-ai/connector-google-calendar/CHANGELOG.md +4 -0
  116. package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
  117. package/node_modules/@jskit-ai/connectors-catalog/CHANGELOG.md +1 -0
  118. package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
  119. package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +1 -0
  120. package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
  121. package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
  122. package/node_modules/@jskit-ai/kernel/CHANGELOG.md +1 -0
  123. package/node_modules/@jskit-ai/kernel/package.json +3 -1
  124. package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +1 -0
  125. package/node_modules/@jskit-ai/payments-core/locales/en.json +2 -1
  126. package/node_modules/@jskit-ai/payments-core/package.json +1 -1
  127. package/node_modules/@jskit-ai/realtime/package.json +1 -1
  128. package/node_modules/@jskit-ai/resource-core/package.json +1 -1
  129. package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
  130. package/node_modules/@local/vibe64-ai-tasks/package.json +2 -1
  131. package/node_modules/@local/vibe64-execution/src/host/execHelper.js +484 -468
  132. package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +59 -59
  133. package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +93 -67
  134. package/node_modules/@local/vibe64-genesis/src/server/index.js +463 -453
  135. package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +60 -58
  136. package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +285 -282
  137. package/package.json +14 -14
  138. package/server.bundle.mjs +27312 -27279
  139. package/dist/assets/VAlert-Bp38AD8H.css +0 -1
  140. package/dist/assets/VAlert-DyCQWe9P.js +0 -1
  141. package/dist/assets/VAutocomplete-CiXrKMyn.js +0 -1
  142. package/dist/assets/VDivider-DGkInAUr.js +0 -1
  143. package/dist/assets/VDivider-DvkP_iX7.css +0 -1
  144. package/dist/assets/VMenu-9TUL6_ph.css +0 -1
  145. package/dist/assets/VMenu-DQ9SZ1Fq.js +0 -1
  146. package/dist/assets/VOverlay-DUKRqNx3.js +0 -1
  147. package/dist/assets/VSelect-9lMtP5cu.js +0 -1
  148. package/dist/assets/VSkeletonLoader-C5ZRrPV4.js +0 -1
  149. package/dist/assets/VSkeletonLoader-LCPSxykp.css +0 -1
  150. package/dist/assets/Vibe64AuthSettingsButton-BICxvZDm.js +0 -5
  151. package/dist/assets/Vibe64FileArea-BU5rPyqx.js +0 -1
  152. package/dist/assets/Vibe64OutputControls-Z2K52QCc.js +0 -8
  153. package/dist/assets/Vibe64SessionFiles-DI8ZH6aF.js +0 -1
  154. package/dist/assets/Vibe64UiStoryboardView-C-99xlAo.js +0 -8
  155. package/dist/assets/_pageId_-DPJ8pvUs.js +0 -1
  156. package/dist/assets/_sessionId_-B5V2Fs2n.css +0 -1
  157. package/dist/assets/_sessionId_-CiU1Awul.js +0 -1
  158. package/dist/assets/_sessionTool_-Be88HWbv.css +0 -1
  159. package/dist/assets/_slug_-Vy_1jrpy.css +0 -1
  160. package/dist/assets/access-Cq6GEVhT.js +0 -1
  161. package/dist/assets/client-C-Rw8t8y.js +0 -1
  162. package/dist/assets/client-DWPSlYBq.js +0 -2
  163. package/dist/assets/conversation-p_mmD9ie.js +0 -8
  164. package/dist/assets/env-ObiVMW6f.js +0 -1
  165. package/dist/assets/health-Ev-UBIsw.js +0 -1
  166. package/dist/assets/history-U6UcbKBZ.js +0 -1
  167. package/dist/assets/issues-D4Asc_wa.css +0 -1
  168. package/dist/assets/issues-DEzrDqDU.js +0 -1
  169. package/dist/assets/publish-BYZ7KRzq.js +0 -3
  170. package/dist/assets/pull-requests-C-puL4SG.js +0 -1
  171. package/dist/assets/pull-requests-DgWKsMdI.css +0 -1
  172. package/dist/assets/settings-BmOQ1NnW.js +0 -1
  173. package/dist/assets/ssrBoot-C6UwmCGc.js +0 -1
  174. package/dist/assets/useAssistantAttachments-CkseokGM.js +0 -2
  175. package/dist/assets/useVibe64ConversationLog-BkcPA64C.js +0 -2
  176. package/dist/assets/vibe64RepositoryRealtime-DKSXVg1B.js +0 -1
  177. package/dist/assets/vibe64SessionFocus-BJLy8eTE.js +0 -1
  178. package/dist/assets/vibe64SessionFocus-DdYRpG72.css +0 -1
@@ -1 +0,0 @@
1
- import{Et as unref,G as renderList,H as openBlock,Xt as toDisplayString,b as createVNode,d as createBaseVNode,f as createBlock,ft as isRef,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{t as useEndpointResource}from"./useEndpointResource-CmMwteuX.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-rsYWyW6m.js";import{t as VSelect}from"./VSelect-9lMtP5cu.js";import{t as VAlert}from"./VAlert-DyCQWe9P.js";import{t as VTextField}from"./VTextField-BMvaWVTN.js";import{i as scopedDevelopmentApiUrl}from"./studioUrls-k_pQIuPs.js";import{o as ROUTE_VISIBILITY_PUBLIC}from"./visibility-Cq31Xy7I.js";import{t as VBtn}from"./VBtn-2vbH580C.js";import{t as VCheckbox}from"./VCheckbox-B40zJSbZ.js";import{n as VRadio,t as VRadioGroup}from"./VRadioGroup-D1duMMwJ.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{r as useRealtimeEvent}from"./useRealtimeEvent-B4oRg9Dt.js";import{t as _sfc_main$3}from"./SelectField-DwWoHC2p.js";import{t as useCommand}from"./useCommand-YOAaO5Wz.js";import{o as reloadPage}from"./browser-D8z6v6Ge.js";import{c as VIBE64_SESSION_SUMMARY_CHANGED_EVENT}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{A as projectSettingsQueryKey,E as engineeringSettingsQueryKey,S as VIBE64_PROJECT_CHANGED_EVENT,T as VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX,_ as VIBE64_ENGINEERING_API_SUFFIX,d as PROMPT_HINTS_SETTINGS_ENDPOINT,g as VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX,m as VIBE64_COLLABORATION_API_SUFFIX,n as DEVELOPMENT_DATABASE_ENDPOINT,r as ENGINEERING_ENDPOINT,t as COLLABORATION_ENDPOINT,u as PROJECT_SETTINGS_ENDPOINT}from"./studioGateApi-UqmdV50W.js";import{P as useVibe64ProjectSlug,j as requestVibe64AccountConnectionsDialog}from"./index-Wcdz2Rey.js";import{t as Vibe64AsyncModuleState_default}from"./Vibe64AsyncModuleState-C9rLM2H0.js";import{t as sessionListRealtimeShouldRefresh}from"./useVibe64SessionData-Df7M5k1M.js";var CONNECTED_CUSTOM_PACKAGE_TYPE=`custom`;var CONNECTED_PACKAGE_TYPES=Object.freeze([Object.freeze({value:`npm`,label:`npm (Node.js)`}),Object.freeze({value:`composer`,label:`Composer (PHP)`}),Object.freeze({value:`pip`,label:`pip (Python)`}),Object.freeze({value:`bundler`,label:`Bundler (Ruby)`}),Object.freeze({value:`gomod`,label:`Go modules`}),Object.freeze({value:`cargo`,label:`Cargo (Rust)`}),Object.freeze({value:`maven`,label:`Maven`}),Object.freeze({value:`gradle`,label:`Gradle`}),Object.freeze({value:`nuget`,label:`NuGet (.NET)`}),Object.freeze({value:CONNECTED_CUSTOM_PACKAGE_TYPE,label:`custom`})]);var CONNECTED_PACKAGE_TYPE_VALUES=Object.freeze(CONNECTED_PACKAGE_TYPES.map(type=>type.value));function connectedPackageTypeUsesScript(type){return type===CONNECTED_CUSTOM_PACKAGE_TYPE}var _hoisted_1$2={class:`project-settings__section`,"aria-labelledby":`connected-projects-title`};var _hoisted_2$1={class:`project-settings__content text-body-medium`};var _hoisted_3$1={key:0};var _hoisted_4$1={key:0};var _hoisted_5$1=[`disabled`];var _hoisted_6$1={class:`text-label-large`};var _hoisted_7$1={key:2};var _hoisted_8$1={class:`connection-actions`};var _sfc_main$2={__name:`ConnectedProjectsSettings`,props:{projectSlug:{type:String,required:true},state:{type:Object,default:()=>({})}},emits:[`saved`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const draft=ref([]);const baseline=ref(`[]`);const revision=ref(``);const saving=ref(false);const changed=computed(()=>JSON.stringify(draft.value)!==baseline.value);const stale=computed(()=>props.state.available&&revision.value!==props.state.revision);const relationships=[{label:`Dependency — a library or tool`,value:`dependency`},{label:`Composition — source assembled into this project`,value:`composition`}];const packageTypes=[{label:`Stack default`,value:``},...CONNECTED_PACKAGE_TYPES];function scriptAllowed(entry){return!entry.type||connectedPackageTypeUsesScript(entry.type)}function setPackageType(entry,value){if(value)entry.type=value;else delete entry.type;if(!scriptAllowed(entry))delete entry.script}function setScript(entry,value){if(value)entry.script=value;else delete entry.script}function resetDraft(){draft.value=(props.state.repositories||[]).map(entry=>({...entry}));baseline.value=JSON.stringify(draft.value);revision.value=props.state.revision||``}let sourceIdentity=``;watch(()=>[props.projectSlug,props.state],()=>{if(!props.state.source)return;const identity=JSON.stringify([props.projectSlug,props.state.source]);if(identity!==sourceIdentity||!changed.value)resetDraft();sourceIdentity=identity},{immediate:true});const saveCommand=useCommand({access:`never`,apiSuffix:`/vibe64/settings/connections`,buildCommandOptions:()=>({method:`PUT`,path:scopedDevelopmentApiUrl(`/api/vibe64/settings/connections`,props.projectSlug)}),buildRawPayload:(_model,{context})=>context,fallbackRunError:`Connected repositories could not be saved.`,messages:{error:`Connected repositories could not be saved.`,success:`Connected repositories saved in source.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.project.connections.save`,surfaceId:`app`,writeMethod:`PUT`});async function save(){if(saving.value||stale.value||!props.state.canEdit)return;saving.value=true;try{if(!await saveCommand.run({repositories:draft.value.map(entry=>({...entry})),revision:revision.value,sessionId:props.state.source?.sessionId||``}))return;baseline.value=JSON.stringify(draft.value);emit(`saved`)}catch{}finally{saving.value=false}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$2,[_cache[6]||(_cache[6]=createBaseVNode(`div`,{class:`project-settings__section-copy text-body-medium`},[createBaseVNode(`h2`,{id:`connected-projects-title`,class:`text-title-medium font-weight-bold`},`Connected repositories`),createBaseVNode(`p`,null,`Libraries and source projects you contribute to from this project.`),createBaseVNode(`p`,null,[createTextVNode(`Saved in this source checkout’s `),createBaseVNode(`code`,null,`vibe64.connections.json`),createTextVNode(`. Changes follow normal project Save.`)])],-1)),createBaseVNode(`div`,_hoisted_2$1,[!__props.state.available?(openBlock(),createElementBlock(`p`,_hoisted_3$1,toDisplayString(__props.state.unavailableReason||`Select a session to configure connected repositories.`),1)):(openBlock(),createElementBlock(Fragment,{key:1},[!__props.state.exists?(openBlock(),createElementBlock(`p`,_hoisted_4$1,`No connection file yet. Add repositories below, then save the list.`)):createCommentVNode(``,true),stale.value?(openBlock(),createBlock(VAlert,{key:1,type:`warning`,variant:`tonal`},{default:withCtx(()=>[_cache[2]||(_cache[2]=createTextVNode(` The saved list changed while you were editing. Reload the saved list and review your changes before saving. `,-1)),createVNode(VBtn,{variant:`text`,onClick:resetDraft},{default:withCtx(()=>[..._cache[1]||(_cache[1]=[createTextVNode(`Reload saved list`,-1)])]),_:1})]),_:1})):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(draft.value,(entry,index)=>{return openBlock(),createElementBlock(`fieldset`,{key:index,class:`connection-entry`,disabled:!__props.state.canEdit||saving.value},[createBaseVNode(`legend`,_hoisted_6$1,`Connected repository `+toDisplayString(index+1),1),createVNode(VTextField,{disabled:!__props.state.canEdit||saving.value,modelValue:entry.name,"onUpdate:modelValue":$event=>entry.name=$event,label:`Name`,maxlength:`100`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`modelValue`,`onUpdate:modelValue`]),createVNode(VTextField,{disabled:!__props.state.canEdit||saving.value,modelValue:entry.repository,"onUpdate:modelValue":$event=>entry.repository=$event,label:`GitHub repository URL`,placeholder:`https://github.com/owner/repository`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`modelValue`,`onUpdate:modelValue`]),createVNode(VSelect,{disabled:!__props.state.canEdit||saving.value,modelValue:entry.relationship,"onUpdate:modelValue":$event=>entry.relationship=$event,label:`Relationship`,items:relationships,"item-title":`label`,"item-value":`value`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`modelValue`,`onUpdate:modelValue`]),createVNode(VSelect,{disabled:!__props.state.canEdit||saving.value,"model-value":entry.type||``,"onUpdate:modelValue":$event=>setPackageType(entry,$event),label:`Package type`,items:packageTypes,"item-title":`label`,"item-value":`value`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`model-value`,`onUpdate:modelValue`]),createVNode(VTextField,{disabled:!__props.state.canEdit||saving.value||!scriptAllowed(entry),"model-value":entry.script||``,"onUpdate:modelValue":$event=>setScript(entry,$event),label:`Preparation script (project-relative)`,placeholder:`tooling/prepare-native-worker.mjs`,maxlength:`1024`,hint:`Required for custom. Relative to this project's root; Stack declares the runtime.`,"persistent-hint":``,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`model-value`,`onUpdate:modelValue`]),createVNode(VBtn,{disabled:!__props.state.canEdit||saving.value,variant:`text`,"aria-label":`Remove ${entry.name||`connected repository`}`,onClick:$event=>draft.value.splice(index,1)},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Remove`,-1)])]),_:1},8,[`disabled`,`aria-label`,`onClick`])],8,_hoisted_5$1)}),128)),__props.state.exists&&!draft.value.length?(openBlock(),createElementBlock(`p`,_hoisted_7$1,`No connected repositories.`)):createCommentVNode(``,true),_cache[5]||(_cache[5]=createBaseVNode(`p`,{class:`text-body-small`},`Removing a connection keeps each session's copy of it until that copy's work is saved.`,-1)),createBaseVNode(`div`,_hoisted_8$1,[createVNode(VBtn,{disabled:!__props.state.canEdit||saving.value||draft.value.length>=unref(64),variant:`outlined`,onClick:_cache[0]||(_cache[0]=$event=>draft.value.push({name:``,repository:``,relationship:`dependency`}))},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Add repository`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{disabled:!__props.state.canEdit||saving.value||stale.value||!changed.value&&__props.state.exists,color:`primary`,variant:`flat`,onClick:save},{default:withCtx(()=>[createTextVNode(toDisplayString(saving.value?`Saving…`:`Save connected repositories`),1)]),_:1},8,[`disabled`])])],64))])])}}};var ConnectedProjectsSettings_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-155efa6f`]]);function normalizeCollaborationDraft(value={}){return{tone:String(value.tone||``),responseLength:String(value.responseLength||``),experience:String(value.experience||``),explanationStyle:String(value.explanationStyle||``),requirements:String(value.requirements||``)}}function collaborationChoiceOptions(collaboration={},field=``){const choices=collaboration.choices?.[field];return(Array.isArray(choices)?choices:[]).flatMap(choice=>{const value=String(choice?.id||``).trim();const label=String(choice?.name||``).trim();return value&&label?[{label,value}]:[]})}function useVibe64CollaborationSettings({projectSlug,resource,routeSessionId}){const collaborationDraft=ref(normalizeCollaborationDraft());const savedCollaboration=ref(normalizeCollaborationDraft());const collaborationSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_COLLABORATION_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:COLLABORATION_ENDPOINT}),buildRawPayload:(_model,{context})=>({...context.collaboration,...context.sessionId?{sessionId:context.sessionId}:{}}),fallbackRunError:`Collaboration guidance could not be saved.`,messages:{error:`Collaboration guidance could not be saved.`,success:`Collaboration guidance saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.collaboration.save`,surfaceId:`app`,writeMethod:`PUT`});const collaboration=computed(()=>resource.data.value?.collaboration||{});const collaborationAvailable=computed(()=>collaboration.value.available===true);const collaborationCanEdit=computed(()=>collaboration.value.canEdit===true);const collaborationSourceLabel=computed(()=>collaboration.value.source?.rootKind===`session-source`?`This session's project source`:`This project source`);const collaborationUnavailableReason=computed(()=>String(collaboration.value.unavailableReason||`Collaboration guidance is not available for this source.`));const toneOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`tone`));const responseLengthOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`responseLength`));const experienceOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`experience`));const explanationStyleOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`explanationStyle`));const collaborationSaving=ref(false);const collaborationChanged=computed(()=>JSON.stringify(collaborationDraft.value)!==JSON.stringify(savedCollaboration.value));let collaborationSource=null;watch([projectSlug,collaboration],([slug,value])=>{if(!value.source)return;const sourceChanged=!collaborationSource||collaborationSource.projectSlug!==slug||collaborationSource.rootKind!==value.source.rootKind||collaborationSource.sessionId!==value.source.sessionId;const next=normalizeCollaborationDraft(value);if(sourceChanged||!collaborationChanged.value)collaborationDraft.value=next;savedCollaboration.value={...next};collaborationSource={projectSlug:slug,...value.source}},{immediate:true});async function saveCollaboration(){if(!collaborationChanged.value||!collaborationAvailable.value||!collaborationCanEdit.value||collaborationSaving.value)return;collaborationSaving.value=true;try{try{await collaborationSaveCommand.run({collaboration:normalizeCollaborationDraft(collaborationDraft.value),sessionId:routeSessionId.value||String(collaboration.value.source?.sessionId||``).trim()})}catch{return}await resource.reload()}finally{collaborationSaving.value=false}}return{collaborationAvailable,collaborationCanEdit,collaborationChanged,collaborationDraft,collaborationSaving,collaborationSourceLabel,collaborationUnavailableReason,experienceOptions,explanationStyleOptions,responseLengthOptions,saveCollaboration,toneOptions}}function useVibe64DevelopmentDatabaseSettings({resource}){const scopeDraft=ref(`session`);const sharedSessionsDraft=ref(false);const databaseSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:DEVELOPMENT_DATABASE_ENDPOINT}),buildRawPayload:(_model,{context})=>({scope:context.scope,allowSharedDatabaseSessions:context.allowSharedDatabaseSessions}),fallbackRunError:`Development database choice could not be saved.`,messages:{error:`Development database choice could not be saved.`,success:`Development database choice saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.development-database.scope.save`,surfaceId:`app`,writeMethod:`PUT`});const developmentDatabase=computed(()=>resource.data.value?.developmentDatabase||{});const managed=computed(()=>developmentDatabase.value.managed===true);const canChange=computed(()=>developmentDatabase.value.canChange===true);const disabledReason=computed(()=>String(developmentDatabase.value.disabledReason||``));const sessionScopeOption=computed(()=>developmentDatabase.value.options?.session||{});const projectScopeOption=computed(()=>developmentDatabase.value.options?.project||{});const sessionScopeAvailable=computed(()=>sessionScopeOption.value.available===true);const projectScopeAvailable=computed(()=>projectScopeOption.value.available===true);const sessionScopeReason=computed(()=>String(sessionScopeOption.value.disabledReason||``));const projectScopeReason=computed(()=>String(projectScopeOption.value.disabledReason||``));const scopeDraftAvailable=computed(()=>scopeDraft.value===`project`?projectScopeAvailable.value:sessionScopeAvailable.value);const databaseSaving=computed(()=>databaseSaveCommand.isRunning===true);const databaseChanged=computed(()=>managed.value&&(scopeDraft.value!==developmentDatabase.value.scope||sharedSessionsDraft.value!==(developmentDatabase.value.allowSharedDatabaseSessions===true)));const databaseSaveAllowed=computed(()=>scopeDraft.value===developmentDatabase.value.scope||canChange.value&&scopeDraftAvailable.value);watch(()=>developmentDatabase.value.allowSharedDatabaseSessions,value=>{sharedSessionsDraft.value=value===true},{immediate:true});watch(()=>developmentDatabase.value.scope,scope=>{if([`project`,`session`].includes(scope))scopeDraft.value=scope},{immediate:true});async function saveDatabase(){if(!databaseChanged.value||!databaseSaveAllowed.value||databaseSaving.value)return;await databaseSaveCommand.run({scope:scopeDraft.value,allowSharedDatabaseSessions:sharedSessionsDraft.value});await resource.reload()}return{databaseChanged,databaseSaveAllowed,databaseSaving,disabledReason,managed,projectScopeAvailable,projectScopeReason,saveDatabase,scopeDraft,sessionScopeAvailable,sessionScopeReason,sharedSessionsDraft}}function useVibe64EngineeringSettings({projectSlug,route,router,routeSessionId}){const engineeringProfileDraft=ref(``);const savedEngineeringProfile=ref(``);const engineeringResource=useEndpointResource({fallbackLoadError:`Engineering approach could not load.`,path:computed(()=>scopedDevelopmentApiUrl(ENGINEERING_ENDPOINT,projectSlug.value)),queryKey:computed(()=>engineeringSettingsQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value,routeSessionId.value)),readQuery:computed(()=>routeSessionId.value?{sessionId:routeSessionId.value}:{}),realtime:{event:VIBE64_PROJECT_CHANGED_EVENT,matches:()=>!engineeringSaveCommand.isRunning},refreshOnPull:true,requestRecoveryLabel:`Engineering approach`});const engineeringSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_ENGINEERING_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:ENGINEERING_ENDPOINT}),buildRawPayload:(_model,{context})=>({profile:context.profile,...context.sessionId?{sessionId:context.sessionId}:{}}),fallbackRunError:`Engineering approach could not be saved.`,messages:{error:`Engineering approach could not be saved.`,success:`Engineering approach saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.engineering.profile.save`,surfaceId:`app`,writeMethod:`PUT`});const engineering=computed(()=>engineeringResource.data.value?.engineering||{});const engineeringAvailable=computed(()=>engineering.value.available===true);const engineeringProfiles=computed(()=>Array.isArray(engineering.value.profiles)?engineering.value.profiles:[]);const engineeringSourceLabel=computed(()=>engineering.value.source?.rootKind===`session-source`?`This session's project source`:`This project source`);const engineeringUnavailableReason=computed(()=>String(engineering.value.unavailableReason||`An engineering profile is not available for this source.`));const selectedEngineeringDescription=computed(()=>String(engineeringProfiles.value.find(profile=>profile.id===engineeringProfileDraft.value)?.description||``));const engineeringStatusText=computed(()=>engineering.value.status===`defaulted`?`The focused default is active. Saving records the choice in genesis/engineering.md.`:`This choice is stored in genesis/engineering.md and follows the source.`);const engineeringSaving=ref(false);const engineeringChanged=computed(()=>engineeringAvailable.value&&Boolean(engineeringProfileDraft.value)&&engineeringProfileDraft.value!==savedEngineeringProfile.value);let engineeringSource=null;watch([projectSlug,engineering],([slug,value])=>{if(!value.source)return;const sourceChanged=!engineeringSource||engineeringSource.projectSlug!==slug||engineeringSource.rootKind!==value.source.rootKind||engineeringSource.sessionId!==value.source.sessionId;const profile=String(value.profile?.id||``).trim();if(sourceChanged||engineeringProfileDraft.value===savedEngineeringProfile.value)engineeringProfileDraft.value=profile;savedEngineeringProfile.value=profile;engineeringSource={projectSlug:slug,...value.source};const sourceSessionId=String(value.source?.sessionId||``).trim();if(!routeSessionId.value&&sourceSessionId)router.replace({query:{...route.query,sessionId:sourceSessionId}})},{immediate:true});async function saveEngineeringProfile(){if(!engineeringChanged.value||engineeringSaving.value)return;engineeringSaving.value=true;try{await engineeringSaveCommand.run({profile:engineeringProfileDraft.value,sessionId:routeSessionId.value||String(engineering.value.source?.sessionId||``).trim()})}catch{}finally{try{await engineeringResource.reload()}finally{engineeringSaving.value=false}}}return{engineeringAvailable,engineeringChanged,engineeringProfileDraft,engineeringProfiles,engineeringResource,engineeringSaving,engineeringSourceLabel,engineeringStatusText,engineeringUnavailableReason,saveEngineeringProfile,selectedEngineeringDescription}}var _hoisted_1$1={class:`project-settings`};var _hoisted_2={class:`project-settings__header`};var _hoisted_3={class:`project-settings__section`,"aria-labelledby":`engineering-approach-title`};var _hoisted_4={class:`project-settings__section-copy text-body-medium`};var _hoisted_5={key:0,class:`project-settings__scope text-label-medium`};var _hoisted_6={key:0,class:`project-settings__content text-body-medium`};var _hoisted_7={class:`project-settings__engineering-field`};var _hoisted_8={class:`project-settings__action text-body-small`};var _hoisted_9={key:1,class:`project-settings__action text-body-small`};var _hoisted_10={class:`project-settings__section`,"aria-labelledby":`development-database-title`};var _hoisted_11={class:`project-settings__section-copy text-body-medium`};var _hoisted_12={key:0};var _hoisted_13={key:1};var _hoisted_14={key:0,class:`project-settings__content text-body-medium`};var _hoisted_15={class:`project-settings__option`};var _hoisted_16={key:0,id:`development-database-session-reason`,class:`project-settings__option-support text-body-small`};var _hoisted_17={class:`project-settings__option`};var _hoisted_18={key:0,id:`development-database-project-reason`,class:`project-settings__option-support text-body-small`};var _hoisted_19={key:0,class:`project-settings__action text-body-small`};var _hoisted_20={class:`project-settings__action text-body-small`};var _hoisted_21={key:0};var _hoisted_22={key:1};var _hoisted_23={class:`project-settings__section`,"aria-labelledby":`ai-behaviour-title`};var _hoisted_24={class:`project-settings__section-copy text-body-medium`};var _hoisted_25={class:`project-settings__scope text-label-medium`};var _hoisted_26={class:`project-settings__content text-body-medium`};var _hoisted_27={class:`project-settings__ai-fields`};var _hoisted_28={class:`project-settings__action text-body-small`};var _hoisted_29={key:0};var _hoisted_30={key:1};var _hoisted_31={key:2};var _hoisted_32={class:`project-settings__section`,"aria-labelledby":`prompt-suggestions-title`};var _hoisted_33={class:`project-settings__content text-body-medium`};var _hoisted_34={class:`project-settings__action text-body-small`};var _hoisted_35={key:0,class:`project-settings__section`,"aria-labelledby":`repository-workflow-title`};var _hoisted_36={class:`project-settings__content text-body-medium`};var _hoisted_37={class:`project-settings__action text-body-small`};var _sfc_main$1={__name:`ProjectSettingsPanel`,setup(__props){const projectSlug=useVibe64ProjectSlug();const route=useRoute();const router=useRouter();const promptHintsDraft=ref(true);const savedPromptHints=ref(true);const requirePullRequest=ref(false);const routeSessionId=computed(()=>String(route.query.sessionId||``).trim());const resource=useEndpointResource({fallbackLoadError:`Project settings could not load.`,path:computed(()=>scopedDevelopmentApiUrl(PROJECT_SETTINGS_ENDPOINT,projectSlug.value)),queryKey:computed(()=>projectSettingsQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value,routeSessionId.value)),readQuery:computed(()=>routeSessionId.value?{sessionId:routeSessionId.value}:{}),refreshOnPull:true,requestRecoveryLabel:`Project settings`});const{databaseChanged,databaseSaveAllowed,databaseSaving,disabledReason,managed,projectScopeAvailable,projectScopeReason,saveDatabase,scopeDraft,sessionScopeAvailable,sessionScopeReason,sharedSessionsDraft}=useVibe64DevelopmentDatabaseSettings({resource});const{collaborationAvailable,collaborationCanEdit,collaborationChanged,collaborationDraft,collaborationSaving,collaborationSourceLabel,collaborationUnavailableReason,experienceOptions,explanationStyleOptions,responseLengthOptions,saveCollaboration,toneOptions}=useVibe64CollaborationSettings({projectSlug,resource,routeSessionId});const promptHintsSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:PROMPT_HINTS_SETTINGS_ENDPOINT}),buildRawPayload:(_model,{context})=>({promptHints:context.promptHints}),fallbackRunError:`Prompt suggestions could not be saved.`,messages:{error:`Prompt suggestions could not be saved.`,success:`Prompt suggestions saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.prompt-hints.save`,surfaceId:`app`,writeMethod:`PUT`});const repositoryWorkflowCommand=useCommand({access:`never`,apiSuffix:`/vibe64/repository/workflow`,buildCommandOptions:()=>({method:`PUT`,path:scopedDevelopmentApiUrl(`/api/vibe64/repository/workflow`,projectSlug.value)}),buildRawPayload:(_model,{context})=>({requirePullRequest:context.requirePullRequest}),fallbackRunError:`Repository workflow could not be saved.`,messages:{error:`Repository workflow could not be saved.`,success:`Repository workflow saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.repository.workflow`,surfaceId:`app`,writeMethod:`PUT`});const repositoryWorkflow=computed(()=>resource.data.value?.repositoryWorkflow||{});watch(()=>repositoryWorkflow.value.requirePullRequest,value=>{requirePullRequest.value=value===true},{immediate:true});async function saveRepositoryWorkflow(){await repositoryWorkflowCommand.run({requirePullRequest:requirePullRequest.value});await resource.reload()}const{engineeringAvailable,engineeringChanged,engineeringProfileDraft,engineeringProfiles,engineeringResource,engineeringSaving,engineeringSourceLabel,engineeringStatusText,engineeringUnavailableReason,saveEngineeringProfile,selectedEngineeringDescription}=useVibe64EngineeringSettings({projectSlug,route,router,routeSessionId});const promptHints=computed(()=>resource.data.value?.promptHints||{});const promptHintsCanEdit=computed(()=>promptHints.value.canEdit===true);const loading=computed(()=>resource.isLoading.value===true||engineeringResource.isLoading.value===true);const initialLoading=computed(()=>loading.value&&(!resource.data.value||!engineeringResource.data.value));const loadError=computed(()=>String(resource.loadError.value||engineeringResource.loadError.value||``));const promptHintsSaving=computed(()=>promptHintsSaveCommand.isRunning===true);const promptHintsChanged=computed(()=>promptHintsDraft.value!==savedPromptHints.value);watch(()=>promptHints.value.enabled,value=>{const enabled=value!==false;if(!promptHintsChanged.value)promptHintsDraft.value=enabled;savedPromptHints.value=enabled},{immediate:true});useRealtimeEvent({event:VIBE64_SESSION_SUMMARY_CHANGED_EVENT,matches:event=>sessionListRealtimeShouldRefresh(event,projectSlug.value),onEvent(){resource.reload();engineeringResource.reload()}});async function refresh(){await Promise.all([resource.reload(),engineeringResource.reload()])}async function savePromptHints(){if(!promptHintsChanged.value||!promptHintsCanEdit.value||promptHintsSaving.value)return;await promptHintsSaveCommand.run({promptHints:promptHintsDraft.value});await resource.reload()}function openPersonalSettings(){requestVibe64AccountConnectionsDialog({refresh:false,section:`profile`})}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$1,[createBaseVNode(`header`,_hoisted_2,[_cache[11]||(_cache[11]=createBaseVNode(`div`,null,[createBaseVNode(`h2`,{class:`text-headline-small font-weight-bold ma-0`},`Project settings`),createBaseVNode(`p`,{class:`text-body-medium`},`Choose how you and your AI work on this project.`)],-1)),createVNode(VBtn,{class:`project-settings__refresh`,disabled:loading.value,type:`button`,variant:`text`,onClick:refresh},{default:withCtx(()=>[createTextVNode(toDisplayString(loading.value?`Refreshing…`:`Refresh`),1)]),_:1},8,[`disabled`])]),initialLoading.value||loadError.value?(openBlock(),createBlock(Vibe64AsyncModuleState_default,{key:0,label:`Project settings`,loading:loading.value,message:loadError.value||`Loading project settings.`,"min-height":`12rem`,onReload:unref(reloadPage),onRetry:refresh},null,8,[`loading`,`message`,`onReload`])):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(ConnectedProjectsSettings_default,{"project-slug":unref(projectSlug),state:unref(resource).data.value?.connectedProjects,onSaved:_cache[0]||(_cache[0]=$event=>unref(resource).reload())},null,8,[`project-slug`,`state`]),createBaseVNode(`section`,_hoisted_3,[createBaseVNode(`div`,_hoisted_4,[unref(engineeringAvailable)?(openBlock(),createElementBlock(`p`,_hoisted_5,toDisplayString(unref(engineeringSourceLabel)),1)):createCommentVNode(``,true),_cache[12]||(_cache[12]=createBaseVNode(`h2`,{id:`engineering-approach-title`,class:`text-title-medium font-weight-bold`},`Engineering approach`,-1)),_cache[13]||(_cache[13]=createBaseVNode(`p`,null,` Choose how cautiously the AI changes your software. Every profile keeps changes simple and asks before adding necessary complexity. `,-1))]),unref(engineeringAvailable)?(openBlock(),createElementBlock(`div`,_hoisted_6,[createBaseVNode(`div`,_hoisted_7,[createVNode(unref(_sfc_main$3),{modelValue:unref(engineeringProfileDraft),"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>isRef(engineeringProfileDraft)?engineeringProfileDraft.value=$event:null),disabled:unref(engineeringSaving),density:`comfortable`,"hide-details":`auto`,hint:unref(selectedEngineeringDescription),"item-title":`name`,"item-value":`id`,items:unref(engineeringProfiles),loading:unref(engineeringResource).isLoading.value,label:`Engineering profile`,"persistent-hint":``,variant:`outlined`},null,8,[`modelValue`,`disabled`,`hint`,`items`,`loading`])]),createBaseVNode(`div`,_hoisted_8,[createBaseVNode(`p`,null,toDisplayString(unref(engineeringStatusText)),1),createVNode(VBtn,{disabled:!unref(engineeringChanged)||unref(engineeringSaving),color:unref(engineeringChanged)?`primary`:void 0,type:`button`,variant:`flat`,onClick:unref(saveEngineeringProfile)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(engineeringSaving)?`Saving…`:`Save engineering approach`),1)]),_:1},8,[`disabled`,`color`,`onClick`])])])):(openBlock(),createElementBlock(`div`,_hoisted_9,[createBaseVNode(`p`,null,toDisplayString(unref(engineeringUnavailableReason)),1)]))]),createBaseVNode(`section`,_hoisted_10,[createBaseVNode(`div`,_hoisted_11,[_cache[14]||(_cache[14]=createBaseVNode(`h2`,{id:`development-database-title`,class:`text-title-medium font-weight-bold`},`Development database`,-1)),unref(managed)?(openBlock(),createElementBlock(`p`,_hoisted_12,` Share development data across sessions or keep a separate database for each. `)):(openBlock(),createElementBlock(`p`,_hoisted_13,` This Vibe64 installation does not manage development databases. The application receives its database connection through the project Env configuration. `))]),unref(managed)?(openBlock(),createElementBlock(`div`,_hoisted_14,[createVNode(VRadioGroup,{modelValue:unref(scopeDraft),"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>isRef(scopeDraft)?scopeDraft.value=$event:null),"aria-labelledby":`development-database-title`,class:`project-settings__options`,disabled:unref(databaseSaving),"hide-details":``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_15,[createVNode(VRadio,{class:`py-1`,"aria-describedby":unref(sessionScopeReason)?`development-database-session-reason`:void 0,disabled:!unref(sessionScopeAvailable),label:`A separate database for each session`,value:`session`},null,8,[`aria-describedby`,`disabled`]),unref(sessionScopeReason)?(openBlock(),createElementBlock(`p`,_hoisted_16,toDisplayString(unref(sessionScopeReason)),1)):createCommentVNode(``,true)]),createBaseVNode(`div`,_hoisted_17,[createVNode(VRadio,{class:`py-1`,"aria-describedby":unref(projectScopeReason)?`development-database-project-reason`:void 0,disabled:!unref(projectScopeAvailable),label:`One database shared by this project`,value:`project`},null,8,[`aria-describedby`,`disabled`]),unref(projectScopeReason)?(openBlock(),createElementBlock(`p`,_hoisted_18,toDisplayString(unref(projectScopeReason)),1)):createCommentVNode(``,true)])]),_:1},8,[`modelValue`,`disabled`]),unref(scopeDraft)===`project`?(openBlock(),createElementBlock(`div`,_hoisted_19,[createVNode(VCheckbox,{modelValue:unref(sharedSessionsDraft),"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>isRef(sharedSessionsDraft)?sharedSessionsDraft.value=$event:null),label:`Allow multiple sessions with this shared database`,disabled:unref(databaseSaving),"hide-details":``},null,8,[`modelValue`,`disabled`]),_cache[15]||(_cache[15]=createBaseVNode(`p`,null,`All sessions will share the same database.`,-1))])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_20,[unref(disabledReason)?(openBlock(),createElementBlock(`p`,_hoisted_21,toDisplayString(unref(disabledReason)),1)):unref(scopeDraft)===`project`?(openBlock(),createElementBlock(`p`,_hoisted_22,` Data and schema changes will be visible to every project session and remain after a session is archived. `)):createCommentVNode(``,true),createVNode(VBtn,{disabled:!unref(databaseChanged)||!unref(databaseSaveAllowed)||unref(databaseSaving),color:unref(databaseChanged)?`primary`:void 0,type:`button`,variant:`flat`,onClick:unref(saveDatabase)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(databaseSaving)?`Saving…`:`Save database choice`),1)]),_:1},8,[`disabled`,`color`,`onClick`])])])):createCommentVNode(``,true)]),createBaseVNode(`section`,_hoisted_23,[createBaseVNode(`div`,_hoisted_24,[createBaseVNode(`p`,_hoisted_25,toDisplayString(unref(collaborationSourceLabel)),1),_cache[17]||(_cache[17]=createBaseVNode(`h2`,{id:`ai-behaviour-title`,class:`text-title-medium font-weight-bold`},`AI behaviour`,-1)),_cache[18]||(_cache[18]=createBaseVNode(`p`,null,` Set the tone, level of detail and project requirements for your conversations. These choices follow your project source. `,-1)),createVNode(VBtn,{class:`project-settings__account-link`,type:`button`,variant:`text`,onClick:openPersonalSettings},{default:withCtx(()=>[..._cache[16]||(_cache[16]=[createTextVNode(` Set your Vibe64 name `,-1)])]),_:1})]),createBaseVNode(`div`,_hoisted_26,[createBaseVNode(`div`,_hoisted_27,[createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).tone,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>unref(collaborationDraft).tone=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(toneOptions),loading:unref(resource).isLoading.value,label:`Tone`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).responseLength,"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>unref(collaborationDraft).responseLength=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(responseLengthOptions),loading:unref(resource).isLoading.value,label:`Response length`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).experience,"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>unref(collaborationDraft).experience=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(experienceOptions),loading:unref(resource).isLoading.value,label:`Experience level`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).explanationStyle,"onUpdate:modelValue":_cache[7]||(_cache[7]=$event=>unref(collaborationDraft).explanationStyle=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(explanationStyleOptions),loading:unref(resource).isLoading.value,label:`Explanation style`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(VTextarea,{modelValue:unref(collaborationDraft).requirements,"onUpdate:modelValue":_cache[8]||(_cache[8]=$event=>unref(collaborationDraft).requirements=$event),class:`project-settings__ai-note`,disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),"auto-grow":``,density:`comfortable`,"hide-details":``,label:`Project requirements (optional)`,placeholder:`For example: use Australian English.`,rows:`6`,"max-rows":`18`,variant:`outlined`},null,8,[`modelValue`,`disabled`])]),createBaseVNode(`div`,_hoisted_28,[!unref(collaborationAvailable)?(openBlock(),createElementBlock(`p`,_hoisted_29,toDisplayString(unref(collaborationUnavailableReason)),1)):!unref(collaborationCanEdit)?(openBlock(),createElementBlock(`p`,_hoisted_30,` Only the project owner can change these controls in Settings. Anyone who can edit this source can change genesis/collaboration.md directly. `)):(openBlock(),createElementBlock(`p`,_hoisted_31,` Applies when a conversation next starts or refreshes its context. Existing history and instructions in an active Codex conversation stay as they are. `)),createVNode(VBtn,{disabled:!unref(collaborationChanged)||!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),color:unref(collaborationChanged)?`primary`:void 0,type:`button`,variant:`flat`,onClick:unref(saveCollaboration)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(collaborationSaving)?`Saving…`:`Save collaboration`),1)]),_:1},8,[`disabled`,`color`,`onClick`])])])]),createBaseVNode(`section`,_hoisted_32,[_cache[19]||(_cache[19]=createBaseVNode(`div`,{class:`project-settings__section-copy text-body-medium`},[createBaseVNode(`h2`,{id:`prompt-suggestions-title`,class:`text-title-medium font-weight-bold`},`Prompt suggestions`),createBaseVNode(`p`,null,`Get ideas for what to ask next. This Vibe64 setting does not change your AI's instructions.`)],-1)),createBaseVNode(`div`,_hoisted_33,[createVNode(VSwitch,{modelValue:promptHintsDraft.value,"onUpdate:modelValue":_cache[9]||(_cache[9]=$event=>promptHintsDraft.value=$event),class:`project-settings__ai-hints`,color:`primary`,disabled:!promptHintsCanEdit.value||promptHintsSaving.value,"hide-details":``,label:`Suggest useful next prompts`},null,8,[`modelValue`,`disabled`]),createBaseVNode(`div`,_hoisted_34,[createVNode(VBtn,{disabled:!promptHintsChanged.value||!promptHintsCanEdit.value||promptHintsSaving.value,color:promptHintsChanged.value?`primary`:void 0,type:`button`,variant:`flat`,onClick:savePromptHints},{default:withCtx(()=>[createTextVNode(toDisplayString(promptHintsSaving.value?`Saving…`:`Save prompt suggestions`),1)]),_:1},8,[`disabled`,`color`])])])]),repositoryWorkflow.value.available?(openBlock(),createElementBlock(`section`,_hoisted_35,[_cache[22]||(_cache[22]=createBaseVNode(`div`,{class:`project-settings__section-copy text-body-medium`},[createBaseVNode(`h2`,{id:`repository-workflow-title`,class:`text-title-medium font-weight-bold`},`Git workflow`),createBaseVNode(`p`,null,`Choose how Vibe64 saves changes to this repository.`)],-1)),createBaseVNode(`div`,_hoisted_36,[createVNode(VRadioGroup,{modelValue:requirePullRequest.value,"onUpdate:modelValue":_cache[10]||(_cache[10]=$event=>requirePullRequest.value=$event),label:`GitHub save workflow`,color:`primary`,"hide-details":``,disabled:!repositoryWorkflow.value.canEdit||unref(repositoryWorkflowCommand).isRunning},{default:withCtx(()=>[createVNode(VRadio,{label:`Allow direct commits and pushes`,value:false,class:`py-1`}),createVNode(VRadio,{label:`Require pull requests`,value:true,class:`py-1`})]),_:1},8,[`modelValue`,`disabled`]),_cache[20]||(_cache[20]=createBaseVNode(`p`,null,`GitHub branch rules still apply. Requiring pull requests makes Create draft PR the main Save action until a session is attached to a PR.`,-1)),_cache[21]||(_cache[21]=createBaseVNode(`p`,null,`This setting controls Vibe64's Save actions. GitHub rules control pushes from terminals and other tools.`,-1)),createBaseVNode(`div`,_hoisted_37,[createVNode(VBtn,{color:requirePullRequest.value!==repositoryWorkflow.value.requirePullRequest?`primary`:void 0,variant:`flat`,disabled:!repositoryWorkflow.value.canEdit||unref(repositoryWorkflowCommand).isRunning||requirePullRequest.value===repositoryWorkflow.value.requirePullRequest,onClick:saveRepositoryWorkflow},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(repositoryWorkflowCommand).isRunning?`Saving…`:`Save repository workflow`),1)]),_:1},8,[`color`,`disabled`])])])])):createCommentVNode(``,true)],64))])}}};var ProjectSettingsPanel_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-aebab399`]]);var _hoisted_1={class:`vibe64-dashboard-page`};var _sfc_main={__name:`index`,setup(__props){return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1,[createVNode(ProjectSettingsPanel_default)])}}};var settings_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-d998a641`]]);export{settings_default as default};
@@ -1 +0,0 @@
1
- import{Ct as toRef,_t as readonly,xt as shallowRef,z as onMounted}from"./runtime-core.esm-bundler-Bi1P1jMa.js";function useSsrBoot(){const isBooted=shallowRef(false);onMounted(()=>{window.requestAnimationFrame(()=>{isBooted.value=true})});return{ssrBootStyles:toRef(()=>!isBooted.value?{transition:`none !important`}:void 0),isBooted:readonly(isBooted)}}export{useSsrBoot as t};
@@ -1,2 +0,0 @@
1
- import{Tt as toValue,gt as reactive,it as watch,mt as onScopeDispose,u as computed,ut as getCurrentScope,vt as ref}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import"./client-4uCr4dYG.js";import{r as useJskitText,t as registerJskitMessages}from"./i18n-BuXRXGaO.js";var jskit=JSON.parse(`{"assistant":{"api":{"requestFailed":"Assistant request failed."},"attachments":{"announcement":{"cancelled":"{count} attachment cancelled. | {count} attachments cancelled.","inProgress":"{count} attachment is in progress. | {count} attachments are in progress.","needAttention":"{count} attachment needs attention. | {count} attachments need attention.","ready":"{count} attachment ready. | {count} attachments ready."},"attached":"Attached files","bytes":"{sent} / {size}","bytesPercent":"{sent} / {size} · {percent}%","cancelItem":"Cancel {name}","close":"Close","download":"Download","error":{"cleanupFailed":"Attachment cleanup failed.","localFilePaste":"Copied local files cannot be pasted from this browser. Drop the file or use Attach files.","noFile":"The prepared attachment did not produce a file.","preparationFailed":"Attachment preparation failed.","tooLarge":"{fileName} is larger than the {limit} attachment limit.","tooMany":"A message can keep at most {count} attachments.","unusable":"Uploaded attachment could not be used.","uploadFailed":"Attachment upload failed."},"limit":"{count} / {max}","preparingName":"Preparing attachment…","previewUnavailable":"Preview is unavailable for this file. You can download it below.","queue":"Message attachments","removeItem":"Remove {name}","retryItem":"Retry {name}","sizeBytes":"{size} B","sizeKilobytes":"{size} KB","sizeMebibytes":"{size} MiB","sizeMegabytes":"{size} MB","status":{"cancelled":"Cancelled","delivering":"Sending to Codex","preparationFailed":"Preparation failed","preparing":"Preparing","queued":"Queued","ready":"Ready","sendingFailed":"Sending failed","uploadFailed":"Upload failed","uploading":"Uploading"},"summary":{"cancelled":"{completed} ready · {cancelled} cancelled","inProgress":"{completed} of {total} ready · in progress","needAttention":"{completed} of {total} ready · {count} needs attention | {completed} of {total} ready · {count} need attention","percent":"{completed} of {total} ready · {percent}%","ready":"{completed} of {total} ready"},"unnamed":"attachment","uploadProgress":"Upload progress for {name}"},"chat":{"attachFiles":"Attach files","avatar":"Conversation avatar","discardUnsent":"Discard unsent message","editUnsent":"Edit unsent message","label":"Assistant conversation","messageAssistant":"Message AI assistant","minimiseAvatar":"Minimise avatar","reviewAttachedFiles":"Please review the attached files.","sendingToAssistant":"Sending to assistant…","showAvatar":"Show avatar","working":"Assistant is working…"},"composer":{"cannotSendYet":"Your words are in the chat box, but this conversation cannot send yet.","chatChanged":"The chat changed before sending. Review the draft before sending.","notReady":"The chat composer is not ready yet.","send":"Send","sendMessage":"Send message","sending":"Sending…","stop":"Stop","stopping":"Stopping…","suggestedPrompts":"Suggested prompts","suggestionsAvailable":"{count} suggested prompts are available before the message controls.","thinkingOfIdeas":"Thinking of a few ideas","thinkingOfIdeasStatus":"Thinking of a few ideas.","useSuggestion":"Use suggestion: {prompt}"},"delivery":{"cancelling":"Cancelling…","cancelUnreachable":"Couldn't reach the server — Cancel again","checkBeforeResend":"Check delivery before resending.","checkPrevious":"Check the previous message's delivery before sending again.","checking":"Checking…","notConfirmed":"Message delivery is not confirmed.","notSent":"Message could not be sent.","retry":"Retry","retryCheck":"Retry delivery check","unconfirmed":"Delivery could not be confirmed.","unconfirmedShort":"Delivery unconfirmed."},"goal":{"blocked":"Goal blocked","budgetLimited":"Goal budget reached","cancel":"Cancel goal","cancelInterruptsTurn":"Cancel stops the current turn and clears the goal.","cancelRemovesGoal":"Cancel removes this goal. Use Stop to interrupt a turn already running.","cancelling":"Cancelling…","complete":"Goal complete","elapsed":"{label}: {elapsed}","elapsedSinceStart":"Elapsed since goal started (including pauses)","goal":"Goal","loading":"Loading goal…","objective":"Goal objective","pause":"Pause goal","pauseInterruptsTurn":"Pause stops the current turn and keeps the goal for later.","pausePreventsTurns":"Pausing prevents further automatic turns. Use Stop to interrupt the current turn.","paused":"Goal paused","pausing":"Pausing…","resume":"Resume goal","resuming":"Resuming…","running":"Goal running","runningTime":"Running time","set":"Set goal","start":"Start goal","starting":"Starting…","tokenBudget":"Token budget (optional)","unavailable":"Goal unavailable","usageLimited":"Goal waiting for allowance"},"longText":{"details":"Details","table":"Table"},"model":{"apply":"Apply","applying":"Applying…","chooseAi":"Choose AI","chooseModel":"Choose model","controls":"AI controls","loading":"Loading available AIs","model":"Model","noMatchingModels":"No matching models","noModels":"No available models.","noneConfigured":"No configured AIs are available for this session.","provider":"Provider","selector":"AI session selector","thinking":"Thinking","tryAgain":"Try again","viewOnly":"AI choices are view-only while the assistant is working.","waitBeforeChanging":"Wait for the active turn to finish before changing models."},"progress":{"hide":"Hide progress updates","showAll":"Show all {count} progress update | Show all {count} progress updates","showLatest":"Show latest {count} progress update | Show latest {count} progress updates"},"questions":{"answerNormally":"Answer normally instead","answerRequired":"Answer question {number}.","fieldLabel":"[{number}] {label}","label":"Assistant questions","suggestedAnswers":"Suggested answers"},"settings":{"readOnly":"Read-only","systemPromptTooLong":"Assistant system prompt must be at most {max} characters.","systemPromptInvalid":"Assistant system prompt must be valid text."},"transcript":{"assistant":"Assistant","cancel":"Cancel","edit":"Edit","failed":"Failed: {error}","history":"Conversation history","loadOlder":"Load older messages","loading":"Loading conversation","loadingOlder":"Loading older messages…","messages":"Conversation messages","pending":"Pending","pendingReason":"Pending: {reason}","preparing":"Preparing conversation","progress":"{name} progress","readMore":"Read more","recommended":" · Recommended","reload":"Reload chat","reloading":"Reloading chat","reloadingShort":"Reloading…","reviewMessage":"Review your message","showLess":"Show less","status":"Status"},"turn":{"failed":"Assistant stopped with an error.","stopped":"Stopped.","invalidResponse":"The assistant returned an invalid response.","requestIncomplete":"The assistant could not complete this request."},"conversation":{"handleClosed":"This conversation handle is closed.","handleDisposed":"This conversation handle is disposed.","runtimeClosed":"This conversation runtime is closed.","pagedHistoryUnsupported":"This conversation does not supply paged history.","completedEnvelopesNeedNativeOwner":"Completed envelopes require a runtime-owned native conversation.","completedEnvelopesNotOwned":"This conversation does not own completed envelopes.","goalAttachmentContentUnsupported":"Native goals require extracted text or supported image bytes for attachments.","originalSendOnly":"This conversation supports its original application Send operation.","attachmentIdsOnly":"Supply attachmentIds; only the application's resolver can supply file content.","attachmentsNotConfigured":"File attachments are not configured for this conversation.","steeringUnsupported":"This connection does not support steering.","goalsUnsupported":"This connection does not support native goals.","goalTokenBudgetsUnsupported":"This connection does not support goal token budgets.","goalCommandUnsupported":"This connection does not support that goal command.","goalAttachmentsUnsupported":"This engine's native goal commands do not accept attachments.","completedEnvelopesNeedNativeEngine":"Completed envelopes require a native engine.","replacementPolicyRetained":"This conversation retains its original replacement policy.","selectedProfileRetained":"This scoped conversation retains its original selected profile.","hostSelectionRequired":"This host requires its authorized assistant selection operation.","liveSettingsUnsupported":"This provider does not support live native settings.","completedEnvelopesNeedStorage":"Completed envelopes require runtime-owned canonical storage.","originalReadOnly":"This conversation uses its original read and subscription operations.","messageCancelUnsupported":"This conversation cannot cancel one message.","messageCancelled":"This message was cancelled. Send it again as a new message.","authorizedSelectionRequired":"Use the conversation's authorized selection operation.","eventDeliveryRetained":"This scoped conversation retains its original event delivery.","engineChanged":"The selected native engine changed.","useReplaceForEngine":"Use replace() to change this conversation's engine.","rewindInspectionBeforeOpen":"This conversation has an unfinished Undo operation from an earlier runtime. Inspect its saved native and local history offline before opening it; no history was changed.","rewindInspectionBeforeReplace":"This conversation has an unfinished Undo operation from an earlier runtime. Inspect its saved native and local history offline before replacing it; no history was changed.","responseOwnerChanged":"The completed response owner changed.","newerResponseOwnsWorker":"A newer completed response owns this worker.","responseIdentityChanged":"The completed response identity changed.","applicationToolMessageStale":"This application tool's admitted message is no longer current.","nativeCompletionMessageStale":"This native completion's admitted message is no longer current.","toolObservationRetired":"The native tool observation belongs to a retired response.","toolObservationReceiptLost":"The native tool observation lost its exact admitted receipt.","waitForNativeResponse":"Wait for the native response to finish.","waitForAnswer":"Wait for this answer or use steer to send another instruction.","waitForTurnSaving":"Wait for the current turn to finish saving before starting the goal.","waitForInstructionAdmission":"Wait for the pending instruction to be admitted before steering again.","waitForGoalCommand":"Wait for the goal command to be admitted.","waitForSubmission":"Wait for the current submission before checking delivery.","stopBeforeReplace":"Stop the current turn before replacing its native conversation.","stopBeforeSettings":"Stop the current turn before changing its settings.","completedResponseNoReceipt":"The completed response has no current verified receipt.","completedResponseNoTurnReceipt":"The completed response has no exact native turn receipt.","completedClaudeNoToolEvidence":"The completed Claude response has no native tool-attempt evidence.","responseAssociationUnverified":"The native owner could not verify this response association.","responseOtherOperation":"This response already belongs to a different application operation.","completedResponseNoPlainReply":"This completed response does not own a plain reply.","completedReplyNoTarget":"The completed reply has no current plain authored target.","publishedReplyChanged":"The published reply target or text changed.","replyTargetUsed":"This plain reply target already has unassociated content or consumption.","operationResponseIdentity":"The operation has a different completed response identity.","plainReplyPublished":"This completed response already published its plain reply.","savedOperationChanged":"The saved response operation changed.","turnFinishedBeforeSend":"The native turn finished before this instruction was sent. Send it as a new message.","noActiveTurnToSteer":"There is no active native turn to steer. Send a new message.","briefingBeforeTerminal":"Send a chat message to deliver the saved continuity briefing before starting a native terminal or goal.","briefingBeforeGoal":"Send a message to catch this AI up before starting or resuming its goal.","briefingBeforeReplacement":"Deliver the previous replacement's briefing before replacing native history again.","historyExclusionsInvalid":"Native history exclusions require a server-owned completed application wake and exact message IDs.","messageContentRequired":"Bounded text or attachment IDs and a stable messageId are required.","steerNotBoolean":"steer must be a boolean.","applicationDataInvalid":"Application data must be a JSON object within the conversation input limit.","goalMessageIdRequired":"A stable messageId is required for this goal command.","goalConversationChanged":"The conversation changed before this goal command was sent.","goalNeedsNativeConversation":"This command requires an existing native conversation.","messageIdExclusionsConflict":"This messageId already belongs to different native history exclusions.","messageIdContentConflict":"This messageId already belongs to different content.","completedClaudeNotSteerable":"Completed Claude responses cannot share a native steering turn. Wait for the response or stop it.","replacementPendingBeforeSend":"Finish the pending native replacement before sending another message.","replacementPendingBeforeRecovery":"Finish the native replacement before recovering output.","replacementUnfinished":"Retry the unfinished native replacement before starting another one.","replacementPendingBeforeSettings":"Finish the pending native replacement before changing settings.","retainedDeliveryUncertain":"This message has uncertain delivery in a retained conversation. Select that engine and check its receipt before submitting it again.","previousInstructionUnchecked":"Check delivery of the previous instruction before preparing another completed response.","previousSubmissionUncertain":"The previous submission has uncertain delivery. It will not be resent automatically.","goalCommandDeliveryUncertain":"Check the uncertain command's delivery before changing the goal.","earlierGoalCommandUnresolved":"A goal command from an earlier runtime has unresolved delivery. Inspect its saved state before changing the goal.","pendingDeliveryBeforeReplace":"Resolve pending delivery before replacing native history. Another engine may be selected while its receipt stays pending.","deliveryUncertainBeforeSettings":"Resolve uncertain delivery before changing settings.","goalActionRequired":"A goal action and current conversation segment are required.","goalObjectiveInvalid":"A bounded objective and optional positive token budget are required.","goalToResumeRequired":"Select the goal to resume.","goalToStopRequired":"Select the goal to stop.","replacementRequestInvalid":"Replacement needs an operationId, exact predecessor segment, and an engine-change, model-change or renewal reason.","replacementBriefingRequired":"Native replacement requires a continuity briefing.","predecessorChanged":"The native predecessor has changed. Read the conversation before replacing it.","replacementOperationConflict":"This replacement operationId already belongs to another request.","replacementChangedBeforeWrite":"The saved replacement changed before it could be written.","replacementChangedBeforeRelease":"The saved replacement changed before its binding was released.","predecessorChangedBeforeRelease":"The native predecessor identity changed before its binding was released.","predecessorIncomplete":"The native predecessor identity changed or is incomplete.","hostScopeMismatch":"This open conversation already belongs to another host scope. Dispose its handle before reopening it on the original host.","cleanupNeedsOriginalConversation":"Native cleanup requires its original bound conversation.","deliveryUnconfirmed":"Native delivery could not be confirmed.","messageNotSent":"This message was not sent. Review it before sending a new message.","attachmentIdsInvalid":"Attachments require at most {max} distinct, nonempty attachment IDs.","attachmentResolverIncomplete":"The attachment resolver must return a receipt for every requested file and bounded model content.","attachmentLocalFilesUnsupported":"This engine cannot accept local attachment files. Supply extracted text or supported image bytes.","attachmentReceiptInvalid":"Attachment receipts require the requested ID, a bounded fileName and a nonnegative size.","attachmentLocalFileInvalid":"Local attachment files require their exact requested receipt and an authorized absolute native path.","attachmentFormatUnsupported":"This engine cannot accept that attachment format. Supply extracted text or a supported image.","attachmentTextEmpty":"Attachment text must be nonempty.","attachmentBytesRequired":"Attachments require authorized bytes and a supported media type; remote URLs and paths are not accepted.","attachmentBytesExceeded":"Attachment content exceeds the configured byte limit for this request.","replacementRetryMismatch":"Replacement retry does not match the saved operation.","previousReplacementUnfinished":"Finish the previous native conversation replacement first.","previousReleaseUndoUnfinished":"An unfinished conversation Undo from a previous release blocks assistant work. Complete it using the previous release before upgrading.","pendingDeliveryBeforeContextReplace":"Finish pending delivery before replacing native context.","shutdownUnconfirmed":"Native conversation shutdown was not confirmed.","submissionInterrupted":"The previous submission was interrupted. Check delivery before submitting it again.","restartInterrupted":"The application restarted before this answer completed. The request was not replayed.","copiedInterrupted":"Copied into a stopped development environment. This request was not replayed.","operationResultUnsaved":"The application operation result could not be saved. Restore storage access and retry saving.","progressUnsaved":"Conversation progress could not be saved. Restore access to its storage before continuing.","requestTimedOut":"The conversation request exceeded its time limit.","workStopped":"Work stopped.","stoppedByUser":"Stopped by user.","apiHistoryLimit":"This conversation exceeds the configured API history limit. Start another conversation or increase the limit.","outputTokenLimit":"The model reached its output token limit before completing the answer. Increase maxOutputTokens in the conversation limits.","toolCallsUnconfirmed":"The model stream ended without confirming its application tool calls.","answerUnconfirmed":"The model stream ended without confirming a completed answer.","toolProgressLimit":"Application tool progress text exceeds the configured API limit.","finalReplyLimit":"The assistant exceeded the configured final reply limit.","historyBudgetExceeded":"Conversation updates exceed the configured history budget. Renew the context with a continuity briefing before continuing.","briefingBudgetExceeded":"The continuity briefing exceeds the configured history budget.","contextChangedInstallingPrompt":"Conversation context changed while installing its system prompt. Retry before sending.","contextChangedReadingInstructions":"Conversation context changed while reading instructions. Retry before sending.","messageNotAcknowledged":"The engine did not acknowledge the message.","stopTemporaryBeforeChange":"Stop this temporary conversation before changing its AI.","toolArgumentsTooLarge":"The application tool arguments exceed their size limit.","toolCallLimit":"The assistant reached the application tool-call limit for this turn."},"claude":{"goalChanged":"The Claude goal changed. Refresh before trying again.","goalTokenBudgetUnsupported":"Claude goals do not support a token budget.","goalBlockerReasonRequired":"An active Claude goal needs a blocker reason of up to 1,000 characters.","goalConditionRequired":"Enter a goal condition of up to 4,000 characters.","goalAlreadySet":"Cancel the existing goal before setting another.","goalActionUnknown":"Unknown Claude goal action.","compactWhileWorking":"Claude is still working. Wait for it to finish before freeing its context.","noActiveTurn":"Claude has no active turn for this message.","steeringUnavailable":"This Claude turn cannot accept steering now.","settingsChangeWhileWorking":"Stop the current Claude turn before changing its settings.","notConnected":"Claude Code is not connected.","accountStatusInvalid":"Claude Code returned an invalid account status.","accountChangedRefreshModels":"The signed-in Claude account changed. Refresh the model list.","accountQueryCancelled":"Claude account query was cancelled for reconnection.","accountQueryCleanupUnconfirmed":"Claude account query process cleanup could not be confirmed.","answerInterrupted":"Claude interrupted this answer.","chooseConnectedModel":"Choose a connected Claude Code model.","closedOrWorking":"This Claude conversation is closed or already working.","connectionClosed":"Claude connection is closed.","connectionWasClosed":"Claude connection was closed.","controlNeedsTerminal":"This control request requires the native Claude Code terminal.","eventConnectionEnded":"Claude event connection ended unexpectedly.","exitedUnexpectedly":"Claude exited unexpectedly.","modelUnsupported":"This exact provider/model is not supported by the Claude integration. Choose a supported model without renaming it.","noTurnToSteer":"Claude has no active turn to steer.","otherHostConfiguration":"This Claude conversation belongs to another working directory or credential home. Restore its original host configuration.","reasoningEffortUnsupported":"The selected Claude model does not support this reasoning effort.","reconnecting":"Claude is reconnecting.","sendNowUnsupported":"This Claude version does not support targeted Send now.","signInRequired":"Sign in with claude auth login before using this conversation.","stopBeforeReset":"Stop Claude before resetting its turn view.","toolCallLimit":"Claude exceeded the application tool-call limit.","turnStillWorking":"This Claude turn is still working.","workEnded":"Claude work ended.","outputTooLarge":"Claude output exceeded its size limit."},"codex":{"helperThreadUnavailable":"This low-cost assistant thread is no longer available. Start the background task again instead of reusing another assistant conversation.","helperOwnershipBlocked":"{applicationName} could not prove ownership of a persisted low-cost assistant thread.","threadDeleteUnavailable":"Codex app-server thread deletion is not available.","goalActionInvalid":"Choose set, pause, resume, or cancel.","goalObjectiveInvalid":"Enter a goal objective and an optional positive whole-number token budget.","goalConversationChanged":"The Codex conversation changed. Refresh the goal before trying again.","goalConversationStopped":"Resume or send a message to restore the stopped conversation before setting a goal.","goalChangedBeforeSet":"The Codex goal changed. Refresh it before setting a new goal.","goalChanged":"The Codex goal changed. Refresh it before trying again.","goalAlreadyStopped":"This goal is already stopped. Refresh its details.","goalStopUnconfirmed":"Codex has not yet confirmed a stop. Retry after the service has stopped.","goalNotResumable":"This goal cannot be resumed from its current status. Refresh its details.","stopUnverified":"Codex's stop could not be verified. Its runtime owner is unavailable.","turnNotReady":"The active assistant turn is not ready to accept this message yet.","messageEmpty":"Codex message is empty.","messageInputEmpty":"Codex message input is empty.","operationNotSteerable":"The active assistant operation cannot accept messages yet.","temporaryConversationBusy":"Temporary AI is already working on this conversation.","accountChangedSendAgain":"Codex (OpenAI) changed account. Send your message again.","accountUnavailable":"The selected Codex account is unavailable. Reconnect Codex and retry.","assistantChangedRefresh":"The assistant changed. Refresh before resuming.","authChangedReopen":"Codex authentication changed. Reopen the conversation with its original account.","authModeUnsupported":"The selected Codex authentication mode is unsupported. Reconnect Codex and retry.","authRecordInvalid":"The selected Codex authentication record is invalid. Reconnect Codex and retry.","authRecordTooLarge":"The selected Codex authentication record is too large. Reconnect Codex and retry.","authRecordUnreadable":"The selected Codex authentication record could not be read. Reconnect Codex and retry.","authorizedSettingsRequired":"Codex requires current authorized settings before resuming this conversation.","connectionClosedBeforeSettings":"The assistant connection closed before confirming its settings.","connectionUnverified":"The assistant connection could not be verified. Your conversation and files are preserved. Retry the connection, or renew the session to continue in a fresh conversation.","credentialsUnreadable":"Codex credential data could not be read. Restore its account configuration.","ephemeralInstructionsFixed":"Start a new ephemeral conversation to change its instructions.","goalPauseUnconfirmed":"Codex did not confirm that the same goal was paused.","goalsAreControls":"Codex goals are controls. Inspect any unresolved goal-message record before continuing.","helperAccessTokenStale":"The selected Codex account has not produced a newer access token yet. Reconnect Codex and retry.","helperAccountActivationFailed":"Codex could not activate the selected account for isolated helper work. Reconnect Codex and retry.","helperAccountChanged":"The selected Codex account changed during helper work. Retry the task with the current account.","helperAccountChangedBeforeRun":"The selected Codex account changed before low-cost assistant work could run. Retry the task with the current account.","helperAccountChangedStarting":"The selected Codex account changed while helper execution was starting. Retry the task.","helperAccountIdentityInvalid":"The requested low-cost assistant account identity is invalid. Refresh the task and retry.","helperAuthRefreshRejected":"Codex helper authentication refresh was rejected. Reconnect Codex and retry.","helperAuthUnavailable":"Codex helper authentication is unavailable. Reconnect Codex and retry.","helperExecutionFailed":"Codex isolated helper execution failed. Retry the task.","helperThreadReconnectAccount":"Reconnect the original Codex account to resume or delete this helper thread.","historyFormatStartFresh":"This conversation uses an unsupported Codex history format. Start a fresh conversation.","historyFormatUnsupported":"This conversation uses an unsupported Codex history format. Renew the session to keep your files and saved chat and start a fresh conversation. You can write the handover yourself.","loadedThreadsInvalid":"Codex returned an invalid loaded-thread inventory. Restore its connection before retrying.","modelDiscoveryUnavailable":"Codex live model discovery is unavailable.","modelUnsupported":"This exact provider/model is not supported by the Codex integration. Choose a supported model without renaming it.","nativeGoalChanged":"The native goal changed. Read it again before changing it.","observationLostStopUnverified":"Codex observation was lost and a stop is not yet verified. Retry after the service has stopped.","oldThreadUnreadable":"The old assistant thread cannot be read. Write or edit the handover manually instead.","otherAccount":"This conversation belongs to another Codex account. Restore that account or start a new conversation.","otherHostConfiguration":"This Codex conversation belongs to another working directory or credential home. Restore its original host configuration.","otherProviderAccount":"This conversation belongs to another Codex provider account. Restore that connection or start a new conversation.","outputTooLarge":"Codex output exceeded the configured limit.","paginatedConversationHistoryMissing":"Codex did not create the required paginated conversation history. Update Codex before starting a conversation.","paginatedHistoryMissing":"Codex did not create the required paginated history. Update Codex before starting this conversation.","reasoningEffortUnsupported":"The selected Codex model does not support this reasoning effort.","reconnectOpenAi":"Reconnect the OpenAI account before using this model.","responseTimeout":"Timed out waiting for Codex app-server response.","signInRequired":"Sign in with codex login before using this conversation.","stillReconnecting":"Codex is still reconnecting: its shared runtime is busy starting or stopping. Please try again shortly.","stoppedUseResume":"Codex is stopped. Use Resume or Send to continue.","temporaryConnectionLost":"Connection to Codex was lost while the temporary AI was working.","temporaryConversationClosed":"Temporary AI conversation was closed.","temporaryTurnStopped":"Temporary AI turn was stopped.","threadInventoryUntrusted":"Codex returned an untrustworthy thread/provider inventory. Restore its connection before changing credentials.","toolEntryPointsChanged":"This Codex conversation was created with different application tool entry points. Start a new conversation to enable or remove application tools.","turnStopUnconfirmed":"Codex did not confirm that its turn stopped."},"provider":{"notConfigured":"Assistant provider is not configured.","requestFailed":"Assistant provider request failed.","requestRejected":"Request failed."},"stream":{"failed":"Assistant stream failed.","requestFailed":"Request failed."},"opencode":{"cleanupUnconfirmed":"OpenCode process cleanup could not be confirmed. Restore its execution host before continuing.","closedOrWorking":"This OpenCode conversation is closed or already working.","messageNotAcknowledged":"OpenCode did not acknowledge the message.","modelDefinitionUnavailable":"OpenCode could not load the configured model definition. Check the selected integration before sending.","nativeStillWorking":"The native OpenCode conversation is still working. Stop or inspect it before sending another message.","noTurnToSteer":"OpenCode has no active turn to steer.","otherAccount":"This conversation belongs to another OpenCode account. Restore that connection or start a new conversation.","otherHistoryStore":"This OpenCode conversation belongs to another native history store. Restore its original host configuration.","otherHistoryStoreOrRuntime":"This OpenCode conversation belongs to another native history store or runtime. Restore its original host configuration.","otherWorkingDirectory":"This OpenCode conversation belongs to another working directory or native state directory. Restore its original host configuration.","reasoningEffortUnsupported":"The selected OpenCode model does not support this reasoning effort.","reopenTerminalToAttach":"Reopen the OpenCode terminal before attaching files.","savedConversationUnavailable":"The saved OpenCode conversation is unavailable. Restore its native history before continuing.","turnFailed":"OpenCode turn failed.","turnUnreadable":"The exact OpenCode turn did not produce a readable result.","turnNotFinished":"OpenCode did not finish the turn."}},"errors":{"conversation_forbidden":"This conversation is not available to this identity.","conversation_storage_version":"This conversation needs its offline runtime-state upgrade before it can be opened. Its saved requests were not replayed or changed.","conversation_configuration_mismatch":"Use configure() to change a saved conversation's settings.","conversation_goal_stopped":"The goal command was stopped before delivery.","conversation_attachment_manifest_changed":"Authorized attachment paths changed after this instruction was prepared. Restore the original files or send a new message.","conversation_receipt_unavailable":"The native receipt has no stored authored message.","conversation_goal_unavailable":"The native goal is unavailable. Try reading its status again.","assistant_provider_invalid_response":"Assistant provider returned an invalid response payload.","assistant_opencode_conversation_busy":"This conversation is still working.","assistant_opencode_key_verification_failed":"OpenCode rejected the API-key verification request.","assistant_opencode_turn_thread_mismatch":"The OpenCode predecessor history changed before handover generation.","assistant_opencode_turn_fresh_thread_required":"The renewed OpenCode conversation does not own the expected fresh native history.","assistant_opencode_turn_unrelated_history":"The successor OpenCode history contains unrelated conversation and cannot be used for renewal.","conversation_claude_turn_timeout":"Claude did not finish within the time limit.","conversation_claude_renewal_history_mismatch":"The Claude renewal conversation does not match the expected native history.","conversation_claude_renewal_unrelated_history":"The successor Claude conversation already contains unrelated messages.","conversation_claude_renewal_turn_active":"Stop the current turn before renewing this conversation.","conversation_claude_unavailable":"This Claude conversation is unavailable.","conversation_claude_retained_goal_invalid":"The retained Claude goal is invalid. Restore its saved conversation state.","conversation_claude_retained_goal_conflict":"The saved Claude goal cannot be both paused and blocked.","conversation_claude_session_closing":"This session is closing.","conversation_claude_preparation_stopped":"Claude preparation was stopped while this session was closing or changing.","conversation_claude_terminal_turn_active":"Stop the current turn before opening the Claude Code terminal.","conversation_claude_still_working":"This conversation is still working.","conversation_claude_history_retire_busy":"Stop the saved Claude process and its terminal before retiring native history.","conversation_claude_message_required":"Enter a message for Claude.","conversation_claude_command_stopped":"The goal command was stopped before delivery.","conversation_claude_context_usage_unavailable":"Claude's current context usage is unavailable.","conversation_claude_goal_clear_unconfirmed":"Claude has not saved the retained goal's native clear receipt.","conversation_claude_saved_state_unreadable":"The saved Claude conversation {conversationId} is unreadable. Restore its saved conversation state.","conversation_tool_not_executed":"Execution stopped before the action began.","conversation_tool_outcome_unknown":"The application operation did not return a verified result. Inspect its target before requesting another execution.","conversation_unsupported":"This original scoped conversation has no canonical message or goal receipt.","assistant_claude_goal_attachment_pending":"Claude accepted the goal command, but its goal attachment is not available yet. Check its original receipt before trying again.","assistant_claude_admission_unknown":"Claude has not acknowledged this prompt. Its delivery is uncertain.","assistant_claude_startup_exited":"Claude exited before initialization completed.","claude_stop_unconfirmed":"Claude process cleanup could not be confirmed. Restore its execution host before continuing.","claude_account_changed":"This conversation belongs to another Claude account. Reconnect that account or start a new session.","assistant_opencode_recovery_order_unconfirmed":"OpenCode could not confirm that the new input follows its final-answer recovery. The admitted message was not resent.","assistant_opencode_interrupt_unconfirmed":"OpenCode did not confirm Stop. Try Stop again.","assistant_opencode_interrupt_timeout":"OpenCode did not confirm Stop within 5 seconds. Try Stop again.","assistant_opencode_key_verification_unavailable":"OpenCode API-key verification could not run.","assistant_opencode_stop_unverified":"OpenCode process exit could not be verified.","assistant_opencode_connection_reload_failed":"OpenCode could not load the changed AI connection for this work. Send your message again.","assistant_opencode_response_too_large":"OpenCode returned more data than the bridge accepts.","assistant_opencode_event_too_large":"An OpenCode event exceeded the bridge limit.","assistant_opencode_directory_unavailable":"OpenCode did not confirm its conversation directory is ready.","assistant_opencode_catalog_invalid":"OpenCode returned an invalid provider catalogue.","assistant_opencode_catalog_stop_failed":"The temporary OpenCode catalogue process did not stop cleanly.","assistant_opencode_events_timeout":"OpenCode's event connection did not become ready.","assistant_opencode_observation_lost":"OpenCode's event connection ended before observation was closed.","assistant_opencode_parent_unverified":"The subagent's parent session could not be verified.","assistant_opencode_start_timeout":"OpenCode did not become ready before the startup deadline.","assistant_opencode_version_mismatch":"OpenCode {installed} is installed; this host requires {required}.","assistant_opencode_zen_catalog_unavailable":"OpenCode Zen's current model list could not be read. Try again.","assistant_agent_control_binding_retained":"Another native subscriber retained the previous assistant settings. Close the native assistant terminal and retry Resume.","assistant_codex_provider_binding_retained":"Another native subscriber retained the previous model provider. Close the native assistant terminal and retry.","assistant_codex_provider_switch_busy":"Stop the current turn before immediately changing model providers.","assistant_codex_history_request_too_large":"Codex history exceeds the adapter request limit.","assistant_codex_history_request_unreadable":"Codex sent an unreadable or oversized history request.","assistant_custom_endpoint_unreachable":"Your model server at {upstream} isn't answering. Start it, then send your message again.","assistant_codex_app_server_message_too_large":"Codex app-server message exceeded the configured transport limit.","codex_reconnect_required":"Sign in with codex login before continuing.","codex_provider_connection_changed":"This Codex provider connection changed. Work is stopped; use Send or Resume after reconnecting.","codex_runtime_invalidated":"Codex's native runtime was invalidated.","assistant_provider_fetch_missing":"Global fetch is not available for anthropic provider.","assistant_tool_arguments_invalid":"Tool arguments must be a JSON object.","assistant_tool_result_unserializable":"Tool result could not be serialized.","assistant_tool_result_too_large":"Tool result exceeds the assistant size limit. Narrow the request and try again.","assistant_tool_contract_too_large":"Action contract exceeds the assistant size limit. Narrow the request and try again.","assistant_tool_arguments_too_large":"Tool arguments exceed the assistant size limit. Narrow the request and try again.","assistant_action_cursor_invalid":"Action search cursor is invalid for this query.","assistant_action_unknown":"Action is not available.","assistant_action_contract_required":"Load this action's exact contract before executing it.","assistant_tool_output_invalid":"Assistant tool output validation failed.","assistant_tool_unknown":"Unknown tool.","assistant_claude_control_timeout":"Claude {request} timed out."}}`);var en_default={jskit};registerJskitMessages(en_default);function attachmentSizeLabel(size){const bytes=Number(size);if(!Number.isFinite(bytes)||bytes<0)return``;if(bytes<1024)return`${bytes} B`;if(bytes<1048576)return`${(bytes/1024).toFixed(1)} KB`;return`${(bytes/1048576).toFixed(1)} MB`}var jskitText=useJskitText();var{formatNumber,t:t$3}=jskitText;var WHOLE=Object.freeze({useGrouping:false});var ONE_DECIMAL=Object.freeze({maximumFractionDigits:1,minimumFractionDigits:1,useGrouping:false});function attachmentSizeText(size){if(!jskitText.locale)return attachmentSizeLabel(size);const bytes=Number(size);if(!Number.isFinite(bytes)||bytes<0)return``;if(bytes<1024)return t$3(`jskit.assistant.attachments.sizeBytes`,{size:formatNumber(bytes,WHOLE)});if(bytes<1048576)return t$3(`jskit.assistant.attachments.sizeKilobytes`,{size:formatNumber(bytes/1024,ONE_DECIMAL)});return t$3(`jskit.assistant.attachments.sizeMegabytes`,{size:formatNumber(bytes/1048576,ONE_DECIMAL)})}function attachmentLimitText(maxBytes){if(!jskitText.locale)return maxBytes%1048576===0?`${maxBytes/1048576} MiB`:`${maxBytes/1e6} MB`;return maxBytes%1048576===0?t$3(`jskit.assistant.attachments.sizeMebibytes`,{size:formatNumber(maxBytes/1048576,WHOLE)}):t$3(`jskit.assistant.attachments.sizeMegabytes`,{size:formatNumber(maxBytes/1e6,{useGrouping:false})})}var{t:t$2}=useJskitText();function assistantAttachmentFiles(fileList){return Array.from(fileList||[]).filter(file=>file&&file.size>=0)}function assistantAttachmentFilesFromTransferItems(items){return assistantAttachmentFiles(Array.from(items||[]).map(item=>{if(item?.kind!==`file`||typeof item.getAsFile!==`function`)return null;return item.getAsFile()}))}function assistantAttachmentFilesFromDropEvent(event){const dataTransfer=event?.dataTransfer;const itemFiles=assistantAttachmentFilesFromTransferItems(dataTransfer?.items);if(itemFiles.length>0)return itemFiles;return assistantAttachmentFiles(dataTransfer?.files)}function assistantAttachmentFilesFromPasteEvent(event){const clipboardData=event?.clipboardData;const itemFiles=assistantAttachmentFilesFromTransferItems(clipboardData?.items);if(itemFiles.length>0)return itemFiles;return assistantAttachmentFiles(clipboardData?.files)}function assistantAttachmentEventHasFiles(event){const dataTransfer=event?.dataTransfer;return assistantAttachmentFilesFromDropEvent(event).length>0||Array.from(dataTransfer?.items||[]).some(item=>item?.kind===`file`)||Array.from(dataTransfer?.types||[]).some(type=>type===`Files`||type===`application/x-moz-file`)}function assistantAttachmentClipboardText(event){if(typeof event?.clipboardData?.getData!==`function`)return``;return String(event.clipboardData.getData(`text/plain`)||``)}function assistantAttachmentClipboardLocalFileReference(event){const clipboardData=event?.clipboardData;if(!clipboardData||typeof clipboardData.getData!==`function`)return``;const types=Array.from(clipboardData.types||[]);const text=[clipboardData.getData(`x-special/gnome-copied-files`),clipboardData.getData(`text/uri-list`),clipboardData.getData(`text/plain`)].map(value=>String(value||``).trim()).filter(Boolean).join(`
2
- `);if(types.includes(`Files`)||types.includes(`application/x-moz-file`)||types.includes(`x-special/gnome-copied-files`)||/^file:/imu.test(text))return text||`file://`;return``}function useAttachmentDropTarget({uploadFiles,reportAttachmentError}){const dragDepth=ref(0);const dragActive=computed(()=>dragDepth.value>0);function resetDragState(){dragDepth.value=0}function handleDragEnter(event){if(!assistantAttachmentEventHasFiles(event))return;dragDepth.value+=1;if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragOver(event){if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragLeave(){dragDepth.value=Math.max(0,dragDepth.value-1)}async function handleDrop(event){resetDragState();return uploadFiles(assistantAttachmentFilesFromDropEvent(event))}async function handlePaste(event){const files=assistantAttachmentFilesFromPasteEvent(event);if(files.length<1){if(assistantAttachmentClipboardLocalFileReference(event))reportAttachmentError(t$2(`jskit.assistant.attachments.error.localFilePaste`));return[]}if(!assistantAttachmentClipboardText(event))event?.preventDefault?.();return uploadFiles(files)}return{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}}var{t:t$1}=useJskitText();function attachmentUploadError(attachment){return attachment?.error||attachment?.errors?.[0]?.message||``}function attachmentIdentity(attachment){return String(attachment?.clientId||attachment?.attachmentId||attachment?.path||attachment?.fileName||``)}var attachmentClientSequence=0;function nextAttachmentClientId(){attachmentClientSequence+=1;return`attachment-${Date.now().toString(36)}-${attachmentClientSequence.toString(36)}`}function attachmentFileName(file){return String(file?.name||`attachment`)}function attachmentUploadResult(upload=null){if(upload&&typeof upload.then===`function`)return{cancel:typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload};if(upload?.promise&&typeof upload.promise.then===`function`)return{cancel:typeof upload.abort===`function`?()=>upload.abort():typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload.promise};return{cancel:null,promise:Promise.resolve(upload)}}function attachmentProgress(progress={},possibleTotal,fallbackTotal=0){const directNumericProgress=typeof progress===`number`?progress:null;const progressObject=progress&&typeof progress===`object`?progress:{};const totalBytes=Math.max(0,Number(progressObject.totalBytes??progressObject.total??possibleTotal??fallbackTotal)||0);const bytesValue=progressObject.bytesSent??progressObject.loaded??progressObject.uploadedBytes??directNumericProgress;const bytesKnown=bytesValue!==null&&bytesValue!==void 0&&bytesValue!==``;let bytesSent=bytesKnown?Number(bytesValue)||0:0;const directPercent=progressObject.percent;let percent=directPercent!==null&&directPercent!==void 0&&directPercent!==``?Number(directPercent):null;const progressValue=progressObject.progress;if(!Number.isFinite(percent)&&progressValue!==null&&progressValue!==void 0&&progressValue!==``){const numericProgressValue=Number(progressValue);if(Number.isFinite(numericProgressValue))percent=numericProgressValue<=1?numericProgressValue*100:numericProgressValue}if(!Number.isFinite(percent))percent=bytesKnown&&totalBytes>0?bytesSent/totalBytes*100:null;if(percent!==null)percent=Math.max(0,Math.min(100,percent));if(totalBytes>0){const inferredBytes=percent===null?0:totalBytes*percent/100;bytesSent=Math.max(0,Math.min(totalBytes,bytesSent||inferredBytes))}else bytesSent=Math.max(0,bytesSent);return{bytesSent,percent,totalBytes}}function attachmentReceipt(row,uploaded){return{...uploaded,attachmentId:String(uploaded?.attachmentId||``),clientId:row.clientId,fileName:String(uploaded?.fileName||row.fileName),sessionId:row.sessionId,size:Number(uploaded?.size??row.size)||0}}function createWaiter(row){let resolve=null;row.waiter={promise:new Promise(currentResolve=>{resolve=currentResolve}),resolve,settled:false};return row.waiter}function settleWaiter(row,value=null,waiter=row.waiter){if(!waiter||waiter.settled)return;waiter.settled=true;waiter.resolve(value)}function updateRowProgress(row,progress,total){if(!row.retained||row.phase!==`uploading`)return;const next=attachmentProgress(progress,total,row.totalBytes);row.bytesSent=Math.max(row.bytesSent,next.bytesSent);row.totalBytes=next.totalBytes||row.totalBytes;if(next.percent!==null)row.progress=Math.max(Number(row.progress)||0,next.percent)}function buildQueueRow({currentSessionId,file=null,fileName=`attachment`,phase=`queued`,producer=null,size=0}={}){const normalizedSize=Number(file?.size??size)||0;return reactive({activeHandoffToken:null,activeToken:null,attachmentId:``,bytesSent:0,clientId:nextAttachmentClientId(),error:``,failureStage:``,file,fileName:file?attachmentFileName(file):String(fileName||`attachment`),path:``,phase,producer,producerAbortController:null,producerToken:null,progress:null,receipt:null,retained:true,sessionId:currentSessionId,size:normalizedSize,totalBytes:normalizedSize,waiter:null})}function createReceiptCleanup({deleteAttachment,deletesUnsentUploads,reportAttachmentError}){const cleanupTasks=new Set;const receiptCleanupById=new Map;const cleanedReceiptIds=new Set;function trackCleanup(task){const cleanup=Promise.resolve(task).catch(error=>{reportAttachmentError(error,t$1(`jskit.assistant.attachments.error.cleanupFailed`));return false});cleanupTasks.add(cleanup);cleanup.finally(()=>cleanupTasks.delete(cleanup));return cleanup}async function deleteUploadedAttachment(currentSessionId,attachment){const attachmentId=String(attachment?.attachmentId||``).trim();if(!attachmentId||!deletesUnsentUploads)return false;const response=await deleteAttachment(currentSessionId,attachmentId);if(response?.ok===false)throw new Error(attachmentUploadError(response)||t$1(`jskit.assistant.attachments.error.cleanupFailed`));return true}function cleanupReceipt(currentSessionId,receipt){const attachmentId=String(receipt?.attachmentId||``).trim();const cleanupId=`${currentSessionId}:${attachmentId}`;if(!attachmentId)return Promise.resolve(false);if(cleanedReceiptIds.has(cleanupId))return Promise.resolve(false);if(receiptCleanupById.has(cleanupId))return receiptCleanupById.get(cleanupId);const cleanup=trackCleanup(deleteUploadedAttachment(currentSessionId,receipt)).then(deleted=>{if(deleted)cleanedReceiptIds.add(cleanupId);return deleted});receiptCleanupById.set(cleanupId,cleanup);cleanup.finally(()=>receiptCleanupById.delete(cleanupId));return cleanup}async function waitForAttachmentCleanup(){while(cleanupTasks.size>0)await Promise.allSettled([...cleanupTasks])}return Object.freeze({cleanupReceipt,waitForAttachmentCleanup})}var{serverMessage,t}=useJskitText();function attachmentErrorText(error,fallback){return String(error&&typeof error===`object`&&serverMessage(error)||error?.message||error||fallback)}function assistantAttachmentSessionId(sessionId){return String(toValue(sessionId)||``).trim()}function assistantAttachmentUploadAllowed(canUpload){return toValue(canUpload)!==false}var ASSISTANT_ATTACHMENT_MAX_BYTES=1e8;var ASSISTANT_ATTACHMENT_UPLOAD_CONCURRENCY=2;var ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES=new Set([`preparing`,`queued`,`uploading`,`delivering`,`failed`]);function keepAttachmentErrorInStatus(){}async function keepUploadedAttachmentsReady(){return null}function useAssistantAttachments({canUpload=()=>true,deleteAttachment,onError=keepAttachmentErrorInStatus,onUploaded=keepUploadedAttachmentsReady,sessionId,uploadAttachment,maxBytes=ASSISTANT_ATTACHMENT_MAX_BYTES,maxItems=10,uploadConcurrency=2}){if(![maxBytes,maxItems,uploadConcurrency].every(value=>Number.isSafeInteger(value)&&value>0))throw new TypeError(`Attachment limits must be positive integers.`);const attachments=ref([]);const queueItems=ref([]);const status=ref(``);const activeUploadCount=ref(0);const uploadQueue=[];const rowsById=new Map;const activeAttempts=new Map;let disposed=false;const uploading=computed(()=>activeUploadCount.value>0||queueItems.value.some(item=>[`preparing`,`uploading`,`delivering`].includes(item.phase)));const hasUnresolved=computed(()=>queueItems.value.some(item=>ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES.has(item.phase)));const canSubmit=computed(()=>!hasUnresolved.value);const retainedItemCount=computed(()=>queueItems.value.filter(item=>item.phase!==`cancelled`).length);const atCapacity=computed(()=>retainedItemCount.value>=maxItems);const canAddFiles=computed(()=>Boolean(!disposed&&assistantAttachmentSessionId(sessionId)&&assistantAttachmentUploadAllowed(canUpload)&&!atCapacity.value));const aggregateProgress=computed(()=>{const retainedItems=queueItems.value.filter(item=>item.phase!==`cancelled`);const totalBytes=retainedItems.reduce((sum,item)=>sum+item.totalBytes,0);const bytesSent=retainedItems.reduce((sum,item)=>sum+item.bytesSent,0);return{bytesSent,percent:totalBytes>0?Math.round(bytesSent/totalBytes*100):0,totalBytes}});const tooLarge=row=>t(`jskit.assistant.attachments.error.tooLarge`,{fileName:row.fileName,limit:attachmentLimitText(maxBytes)});const tooMany=()=>t(`jskit.assistant.attachments.error.tooMany`,{count:maxItems});function reportAttachmentError(error,fallbackMessage=t(`jskit.assistant.attachments.error.uploadFailed`),{notify=true}={}){const message=attachmentErrorText(error,fallbackMessage);status.value=message;if(notify)try{onError(error||new Error(message),fallbackMessage)}catch{}return message}function clearStatus(){status.value=``}function failRow(row,failureStage,error,fallbackMessage){row.error=attachmentErrorText(error,fallbackMessage);row.failureStage=failureStage;row.phase=`failed`;reportAttachmentError(error,fallbackMessage,{notify:false})}function canonicalRow(attachment={}){const identity=attachmentIdentity(attachment);return identity?rowsById.get(identity)||queueItems.value.find(row=>attachmentIdentity(row)===identity||row.attachmentId===identity):null}const{cleanupReceipt,waitForAttachmentCleanup}=createReceiptCleanup({deleteAttachment,deletesUnsentUploads:typeof deleteAttachment===`function`,reportAttachmentError});const{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}=useAttachmentDropTarget({uploadFiles,reportAttachmentError});function removeReadyReceipt(row){const removed=attachments.value.filter(attachment=>attachment.clientId===row.clientId);attachments.value=attachments.value.filter(attachment=>attachment.clientId!==row.clientId);return removed}async function handOffUploadedAttachment(row,receipt,waiter=row.waiter){const token=Symbol(`${row.clientId}-handoff`);row.activeHandoffToken=token;row.phase=`delivering`;if(!attachments.value.some(attachment=>attachment.clientId===row.clientId))attachments.value.push(receipt);try{const accepted=(await onUploaded([receipt]))?.accepted===true;if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){removeReadyReceipt(row);if(!accepted)await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;row.error=``;row.failureStage=``;if(accepted){removeReadyReceipt(row);row.retained=false;rowsById.delete(row.clientId);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);settleWaiter(row,receipt,waiter);return receipt}row.phase=`ready`;settleWaiter(row,receipt,waiter);return receipt}catch(error){if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;removeReadyReceipt(row);failRow(row,`handoff`,error,t(`jskit.assistant.attachments.error.unusable`));settleWaiter(row,null,waiter);return null}}async function finishUploadAttempt(attempt,uploaded,uploadError=null){activeAttempts.delete(attempt.token);activeUploadCount.value=activeAttempts.size;pumpQueue();const{row}=attempt;const isCurrentAttempt=row.activeToken===attempt.token;const uploadSucceeded=Boolean(!uploadError&&uploaded&&uploaded.ok!==false&&String(uploaded.attachmentId||``).trim());if(!isCurrentAttempt||!row.retained||disposed){if(uploadSucceeded)await cleanupReceipt(attempt.sessionId,uploaded);settleWaiter(row,null,attempt.waiter);pumpQueue();return}row.activeToken=null;if(uploadSucceeded){const receipt=attachmentReceipt(row,uploaded);row.receipt=receipt;row.attachmentId=receipt.attachmentId;row.path=String(receipt.path||``);row.bytesSent=row.totalBytes;row.progress=100;row.error=``;row.failureStage=``;await handOffUploadedAttachment(row,receipt,attempt.waiter)}else{failRow(row,`upload`,uploadError||new Error(attachmentUploadError(uploaded)||t(`jskit.assistant.attachments.error.uploadFailed`)),t(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,attempt.waiter)}pumpQueue()}function startUpload(row){const token=Symbol(row.clientId);const abortController=new AbortController;const attempt={abortController,cancel:null,row,sessionId:row.sessionId,settled:null,token,waiter:row.waiter};row.activeToken=token;row.phase=`uploading`;row.error=``;activeAttempts.set(token,attempt);activeUploadCount.value=activeAttempts.size;try{const transport=attachmentUploadResult(uploadAttachment(row.sessionId,row.file,{onProgress:(progress,total)=>updateRowProgress(row,progress,total),signal:abortController.signal}));attempt.cancel=transport.cancel;attempt.settled=transport.promise.then(uploaded=>finishUploadAttempt(attempt,uploaded),error=>finishUploadAttempt(attempt,null,error))}catch(error){attempt.settled=finishUploadAttempt(attempt,null,error)}}function pumpQueue(){if(disposed)return;while(activeAttempts.size<uploadConcurrency&&uploadQueue.length>0){const row=uploadQueue.shift();if(!row?.retained||row.phase!==`queued`)continue;startUpload(row)}}function cancelAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`preparing`,`queued`,`uploading`].includes(row.phase))return false;const token=row.activeToken;row.activeToken=null;row.activeHandoffToken=null;row.phase=`cancelled`;row.error=``;const receipt=row.receipt;removeReadyReceipt(row);if(receipt)cleanupReceipt(row.sessionId,receipt);row.receipt=null;row.failureStage=``;settleWaiter(row,null);const attempt=token?activeAttempts.get(token):null;try{row.producerAbortController?.abort();attempt?.abortController.abort();attempt?.cancel?.()}catch{}row.producerAbortController=null;row.producerToken=null;pumpQueue();return true}function retryAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`failed`,`cancelled`].includes(row.phase)||row.sessionId!==assistantAttachmentSessionId(sessionId)||!assistantAttachmentUploadAllowed(canUpload))return Promise.resolve(null);if(row.phase===`cancelled`&&retainedItemCount.value>=maxItems){reportAttachmentError(tooMany());return Promise.resolve(null)}if(row.failureStage===`handoff`&&row.receipt){row.error=``;row.phase=`uploading`;const waiter=createWaiter(row);handOffUploadedAttachment(row,row.receipt,waiter);return waiter.promise}if(row.producer&&!row.file){const waiter=createWaiter(row);startAttachmentProducer(row);return waiter.promise}if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t(`jskit.assistant.attachments.error.uploadFailed`));return Promise.resolve(null)}row.bytesSent=0;row.progress=null;row.error=``;row.failureStage=``;row.phase=`queued`;const waiter=createWaiter(row);uploadQueue.push(row);pumpQueue();return waiter.promise}function detachRow(row){if([`preparing`,`queued`,`uploading`].includes(row.phase))cancelAttachment(row);row.retained=false;rowsById.delete(row.clientId);settleWaiter(row,null)}function removeAttachment(attachment={}){const row=canonicalRow(attachment);if(!row)return[];const removedReceipts=removeReadyReceipt(row);const removed=removedReceipts.length>0?removedReceipts:[row];const receiptToClean=removedReceipts[0]||row.receipt;detachRow(row);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);if(receiptToClean)cleanupReceipt(row.sessionId,receiptToClean);return removed}function clearAttachments({accepted=true,attachmentIds=null}={}){if(!accepted)return abandonAttachments();const selectedIds=Array.isArray(attachmentIds)?new Set(attachmentIds):null;const cleared=attachments.value.filter(attachment=>!selectedIds||selectedIds.has(attachment.attachmentId));const readyIds=new Set(cleared.map(attachment=>attachment.clientId));const remaining=[];for(const row of[...queueItems.value]){if(selectedIds&&!readyIds.has(row.clientId)){remaining.push(row);continue}if(readyIds.has(row.clientId)){row.retained=false;rowsById.delete(row.clientId);continue}detachRow(row);if(row.receipt)cleanupReceipt(row.sessionId,row.receipt)}attachments.value=attachments.value.filter(attachment=>!readyIds.has(attachment.clientId));queueItems.value=remaining;return cleared}async function abandonAttachments({onlySessionId=``}={}){const normalizedSessionId=String(onlySessionId||``).trim();const rows=queueItems.value.filter(row=>!normalizedSessionId||row.sessionId===normalizedSessionId);const rowIds=new Set(rows.map(row=>row.clientId));const readyReceipts=rows.map(row=>row.receipt).filter(Boolean);const attempts=[...activeAttempts.values()].filter(attempt=>rowIds.has(attempt.row.clientId));for(const row of rows)detachRow(row);queueItems.value=queueItems.value.filter(row=>!rowIds.has(row.clientId));attachments.value=attachments.value.filter(attachment=>!rowIds.has(attachment.clientId));const readyCleanup=readyReceipts.map(attachment=>cleanupReceipt(attachment.sessionId,attachment));await Promise.allSettled([...readyCleanup,...attempts.map(attempt=>attempt.settled).filter(Boolean)]);await waitForAttachmentCleanup();return rows}async function disposeAttachments(){if(disposed){await waitForAttachmentCleanup();return[]}disposed=true;stopSessionWatch();return abandonAttachments()}function createQueueRow(options){const row=buildQueueRow(options);rowsById.set(row.clientId,row);queueItems.value.push(row);createWaiter(row);return row}function queuePreparedFile(row,file,waiter=row.waiter){const preparedFile=assistantAttachmentFiles([file])[0];if(!preparedFile)throw Object.assign(new Error(`The prepared attachment did not produce a file.`),{messageCode:`assistant.attachments.error.noFile`,messageParams:{}});row.file=preparedFile;row.fileName=attachmentFileName(preparedFile);row.size=Number(preparedFile.size)||0;row.totalBytes=row.size;if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,waiter);return false}row.phase=`queued`;uploadQueue.push(row);pumpQueue();return true}function startAttachmentProducer(row){const token=Symbol(`${row.clientId}-producer`);const waiter=row.waiter;const abortController=new AbortController;row.file=null;row.producerAbortController=abortController;row.producerToken=token;row.phase=`preparing`;row.error=``;row.failureStage=``;row.producerSettled=Promise.resolve().then(()=>row.producer({signal:abortController.signal})).then(file=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;try{queuePreparedFile(row,file,waiter)}catch(error){failRow(row,`preparing`,error,t(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter)}return file},error=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;if(error?.name===`AbortError`){row.phase=`cancelled`;row.error=``}else failRow(row,`preparing`,error,t(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter);return null})}function uploadFileProducer({fileName=t(`jskit.assistant.attachments.preparingName`),produce}={}){const currentSessionId=assistantAttachmentSessionId(sessionId);if(!canAddFiles.value||typeof produce!==`function`){if(atCapacity.value)reportAttachmentError(tooMany());return Promise.resolve(null)}status.value=``;const row=createQueueRow({currentSessionId,fileName,phase:`preparing`,producer:produce});const waiter=row.waiter;startAttachmentProducer(row);return waiter.promise}async function uploadFiles(files=[]){const uploadableFiles=assistantAttachmentFiles(files);const currentSessionId=assistantAttachmentSessionId(sessionId);if(uploadableFiles.length<1||!currentSessionId||disposed||!assistantAttachmentUploadAllowed(canUpload))return[];status.value=``;const availableSlots=Math.max(0,maxItems-retainedItemCount.value);const acceptedFiles=uploadableFiles.slice(0,availableSlots);if(acceptedFiles.length<uploadableFiles.length)reportAttachmentError(tooMany());const waiters=[];for(const file of acceptedFiles){const row=createQueueRow({currentSessionId,file});const waiter=row.waiter;waiters.push(waiter.promise);if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null)}else uploadQueue.push(row)}pumpQueue();return(await Promise.all(waiters)).filter(attachment=>attachment&&attachments.value.some(candidate=>candidate.clientId===attachment.clientId))}const stopSessionWatch=watch(()=>assistantAttachmentSessionId(sessionId),(nextSessionId,previousSessionId)=>{if(nextSessionId!==previousSessionId&&previousSessionId)abandonAttachments({onlySessionId:previousSessionId})},{flush:`sync`});if(getCurrentScope())onScopeDispose(()=>{disposeAttachments()});return{maxBytes,maxItems,abandonAttachments,aggregateProgress,attachments,atCapacity,canAddFiles,cancelAttachment,canSubmit,clearAttachments,clearStatus,disposeAttachments,dragActive,hasUnresolved,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,queueItems,removeAttachment,resetDragState,retryAttachment,status,uploading,uploadFiles,uploadFileProducer,waitForAttachmentCleanup}}export{en_default as a,attachmentSizeText as i,assistantAttachmentFilesFromDropEvent as n,assistantAttachmentFilesFromPasteEvent as r,useAssistantAttachments as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/english-definitions-Bi3yaDu7.js","assets/placement-B2V88UDJ.js","assets/placement-1lT0lW3-.js","assets/runtime-core.esm-bundler-Bi1P1jMa.js","assets/returnToPath-CILshEkc.js","assets/normalize-BD25VwNK.js","assets/linkPath-BsiibCNd.js","assets/surface-CBlx7sF_.js","assets/vibe64GithubProject-CJneIo5O.js","assets/vibe64SessionToolDefinitions-BijEEwqu.js","assets/vibe64ProjectScope.local-B9ZpdYlf.js","assets/deepFreeze-BgoYkoTa.js","assets/validators-HqYRjxEO.js","assets/i18n-DpzQwXg6.js","assets/index-Wcdz2Rey.js","assets/VChip-D2IukBZw.js","assets/VChip-4Nj-0ztL.css","assets/error-kdRkyK9x.js","assets/i18n-BuXRXGaO.js","assets/i18n-B5lc019_.js","assets/useEndpointResource-CmMwteuX.js","assets/httpClient-Bwitq9Xf.js","assets/queryPath-yKLyWw8V.js","assets/visibility-Cq31Xy7I.js","assets/useRealtimeEvent-B4oRg9Dt.js","assets/errorMessageHelpers-BjIt31kK.js","assets/i18n-BkxO7BMl.js","assets/useApi-BPuI6ZR9-rsYWyW6m.js","assets/devtools-CN5uWJaH-_xug6686.js","assets/preload-helper-BvdcsxN9.js","assets/VSelect-9lMtP5cu.js","assets/VOverlay-DUKRqNx3.js","assets/lazy-vXRXMwYF.js","assets/VOverlay-DG-PukqI.css","assets/VMenu-DQ9SZ1Fq.js","assets/ssrBoot-C6UwmCGc.js","assets/VDivider-DGkInAUr.js","assets/VDivider-DvkP_iX7.css","assets/VMenu-9TUL6_ph.css","assets/VTextField-BMvaWVTN.js","assets/VTextField-F6unyhrS.css","assets/VCheckboxBtn-6ebHAnh9.js","assets/VCheckboxBtn-o1O5Bixh.css","assets/VSheet-D5wAuyc2.js","assets/VSheet-BbLSwuzR.css","assets/VSelect-yFA6_y4G.css","assets/VAlert-DyCQWe9P.js","assets/VBtn-2vbH580C.js","assets/VBtn-C1plz3b1.css","assets/VAlert-Bp38AD8H.css","assets/useVibe64Learning-RE4HXHqo.js","assets/vibe64AssistantHost-CyWUOG-F.js","assets/asyncModuleRecovery-BALhPqsY.js","assets/VDialog-B2W9wqR8.js","assets/VDialog-DP-kc9Gx.css","assets/_plugin-vue_export-helper-DNW4j-dv.js","assets/browser-D8z6v6Ge.js","assets/StudioErrorNotice-CCT_T6mT.js","assets/StudioErrorNotice-CQfeUEOD.css","assets/browserLocalStorage-B4C7rHrs.js","assets/clipboard-CZs9aH3L.js","assets/useVibe64Learning-B9b7aUr-.css","assets/layout-B_cpKP4k.js","assets/errors-D17nJYne.js","assets/studioUrls-k_pQIuPs.js","assets/client-B_iZQVU8.js","assets/VAutocomplete-CiXrKMyn.js","assets/VAutocomplete-D48FgPMA.css","assets/VCheckbox-B40zJSbZ.js","assets/VCheckbox-ChRKi1kj.css","assets/VCard-BFqQSnAE.js","assets/VCard-dv-Dc592.css","assets/VRow-Dz87sIhY.js","assets/VRow-BdVn5u8X.css","assets/VSpacer-GgPR_AzN.js","assets/VSpacer-DfbUir7X.css","assets/VExpansionPanels-BHw1Id_o.js","assets/VExpansionPanels-cvCWEkWz.css","assets/VRadioGroup-D1duMMwJ.js","assets/VRadioGroup-C9f4tbih.css","assets/VSkeletonLoader-C5ZRrPV4.js","assets/VSkeletonLoader-LCPSxykp.css","assets/VSwitch-DUkp5sfW.js","assets/VSwitch-DAlld-JI.css","assets/useCommand-YOAaO5Wz.js","assets/usePaths-CvUbx5-V.js","assets/pathname-JHQIKk21.js","assets/useUiFeedback-Bixow9mW.js","assets/shared-B6plZPQ_.js","assets/assistantRouting-BS0ZW5Ki.js","assets/shared-DjZEYqzW.js","assets/vibe64ApiResponses-DuJ9mfus.js","assets/studioGateApi-UqmdV50W.js","assets/client-CM6TGZc9.css","assets/client-4uCr4dYG.js","assets/VTextarea-CLaWcpd_.js","assets/VTextarea--uW4w6nq.css","assets/useAssistantAttachments-CkseokGM.js","assets/conversation-CsB1b1JZ.js","assets/conversation-p_mmD9ie.js","assets/conversation-DA_fbJJD.css","assets/SelectField-DwWoHC2p.js","assets/vueRefOrGetterValue-y-4f_In7.js","assets/vibe64BrowserTabOrigin-vIN_87mi.js","assets/vibe64SessionRequestConfig-DVRCRAex.js","assets/windowSizeClass-DQekxFgV.js","assets/index-Ctygjyf8.css"])))=>i.map(i=>d[i]);
2
- import{it as watch,mt as onScopeDispose,u as computed,vt as ref,xt as shallowRef}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{r as isRecord,s as normalizeObject}from"./normalize-BD25VwNK.js";import{t as __vitePreload}from"./preload-helper-BvdcsxN9.js";import{n as getHttpWebClient}from"./httpClient-Bwitq9Xf.js";import{n as normalizeConversationTurn$1}from"./conversation-p_mmD9ie.js";import{r as useRealtimeEvent}from"./useRealtimeEvent-B4oRg9Dt.js";import{t as usePaths}from"./usePaths-CvUbx5-V.js";import{t as readRefOrGetterValue}from"./vueRefOrGetterValue-y-4f_In7.js";import{I as vibe64SessionEventMatchesScope,L as vibe64SessionPath,o as VIBE64_SESSIONS_API_SUFFIX,s as VIBE64_SESSION_CHANGED_EVENT}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{o as normalizeVibe64ConversationAttachments}from"./shared-B6plZPQ_.js";import{P as useVibe64ProjectSlug}from"./index-Wcdz2Rey.js";var CONVERSATION_LOG_REALTIME_REASONS=new Set([`project-message-changed`,`conversation-rewound`,`session-assistant-selection-updated`,`integration-setup-skipped`,`integration-setup-completed`,`assistant-response-bundle`,`codex-app-server-agent-result`,`codex-app-server-agent-result-invalid`,`codex-app-server-agent-result-missing`,`codex-app-server-agent-result-provider-failed`,`codex-app-server-commentary`,`codex-app-server-final-assistant-message`,`codex-app-server-live-progress`,`codex-app-server-reasoning-summary`,`codex-app-server-terminal-assistant-message`,`codex-app-server-terminal-thinking-message`,`codex-app-server-terminal-user-message`,`codex-turn-outcome`,`codex-app-server-message-delivered`,`opencode-credential-failure`,`opencode-provider-failure`,`opencode-server-assistant-message`,`opencode-server-message-delivered`,`opencode-server-reasoning`,`opencode-server-tool`,`opencode-server-turn-idle`,`claude-stream-turn-idle`,`claude-stream-message`,`claude-stream-message-delivered`,`session-agent-message-cancelled`,`session-agent-message-accepted`,`session-agent-message-delivered`,`session-agent-message-failed`]);function normalizeConversationTurn(turn={},index=0){const normalized=normalizeConversationTurn$1(turn,index,{normalizeAttachments:normalizeVibe64ConversationAttachments});return normalized&&{...normalized,...isRecord(turn.integrationSetup)?{integrationSetup:turn.integrationSetup}:{}}}function normalizeConversationLog(payload,options={}){const log=normalizeObject(payload).conversationLog;return conversationTurnsWithPending((Array.isArray(log)?log:[]).map((turn,index)=>normalizeConversationTurn(turn,index)).filter(Boolean),options.pending)}function conversationTurnsWithPending(turns,pending){const pendingTurnIndex=pending===true?turns.length-1:-1;return turns.map((turn,index)=>{if(index===pendingTurnIndex&&turn.user&&!turn.assistant)return{...turn,pending:true};return turn})}function sessionAgentTurnActive(session={}){return(session&&typeof session===`object`&&!Array.isArray(session)?session:{}).agentSession?.turn?.active===true}function conversationLogRealtimeShouldRefresh({payload={}}={},sessionId=``){const normalizedSessionId=String(sessionId||``).trim();const changedSessionId=String(payload.sessionId||payload.entityId||``).trim();if(!normalizedSessionId||changedSessionId!==normalizedSessionId)return false;const reason=String(payload.reason||``).trim();return!reason||CONVERSATION_LOG_REALTIME_REASONS.has(reason)}function conversationLogCompletedTurnKey(session={}){const source=isRecord(session)?session:{};const turn=isRecord(source.agentSession?.turn)?source.agentSession.turn:{};const sessionId=String(source.sessionId||``).trim();const turnId=String(turn.id||``).trim();const revision=Number(source.revision);if(!sessionId||!turnId||turn.active!==false||!Number.isSafeInteger(revision)||revision<0)return``;return`${sessionId}|${revision}|${turnId}`}function useConversationIntegrationActions({turns,enabled,sessionId,projectSlug,sessionsApiPath,reloadConversationLog,httpClient}){const integrationActionPending=shallowRef(null);const integrationActionError=ref(null);const integrationConnections=shallowRef({});function connectIntegrationRequest(request={}){return runIntegrationRequestAction(request,`connect`)}function checkIntegrationRequest(request={}){return runIntegrationRequestAction(request,`status`)}function cancelIntegrationRequest(request={}){return runIntegrationRequestAction(request,`cancel`)}function skipIntegrationRequest(request={}){return runIntegrationRequestAction(request,`skip`)}function resumeIntegrationRequest(request={}){return runIntegrationRequestAction(request,`resume`)}async function runIntegrationRequestAction(request,action){const turn=turns.value.find(entry=>entry.turnId===request.turnId);if(!enabled.value||request.sessionId!==sessionId.value||integrationActionPending.value||turn?.integrationSetup?.outcome!==(action===`resume`?`completed`:`pending`)||turn.integrationSetup.requestId!==request.requestId)return false;const selection={sessionId:sessionId.value,turnId:request.turnId,requestId:request.requestId};integrationActionPending.value=selection;integrationActionError.value=null;try{if([`connect`,`cancel`,`status`].includes(action)){const path=vibe64SessionPath(sessionsApiPath.value,selection.sessionId,`/integrations`);const config=await httpClient.request(path);if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false;const integrationId=turn.integrationSetup.integrationId;const integration=config?.configuration?.integrations?.[integrationId];if(!integration)throw new Error(`Choose Configure to set up this integration first.`);const{connectorDefinitions}=await __vitePreload(async()=>{const{connectorDefinitions}=await import(`./english-definitions-Bi3yaDu7.js`).then(n=>n.n);return{connectorDefinitions}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106]));if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false;if(connectorDefinitions.some(provider=>provider.id===integration.provider&&(provider.configurationOnly||provider.configurationOnlyForSettings?.(integration?.settings||{})))){integrationConnections.value={...integrationConnections.value,[selection.requestId]:{status:`configuration-only`}};return true}if(integration.accountMode===`per-user`)throw new Error(`Each app user connects their account inside the application. Choose Configure for setup instructions.`);const endpoint=`${path}/${encodeURIComponent(integrationId)}/setup`;const previous=integrationConnections.value[selection.requestId];if(action===`cancel`&&!previous?.attemptId)return false;let connection=await httpClient.request(endpoint,{method:`POST`,body:{operation:action,...action===`cancel`?{attemptId:previous.attemptId}:{setupRequest:{turnId:selection.turnId,requestId:selection.requestId,configurationHash:config.baseHash}}}});if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false;if(action===`cancel`){connection=await httpClient.request(endpoint,{method:`POST`,body:{operation:`status`}});if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false}integrationConnections.value={...integrationConnections.value,[selection.requestId]:connection};if(connection.integrationSetup?.outcome===`completed`&&connection.integrationSetup.continuation?.status!==`accepted`){const resumed=await httpClient.request(vibe64SessionPath(sessionsApiPath.value,selection.sessionId,`/integration-setup/resume`),{method:`POST`,body:{turnId:selection.turnId,requestId:selection.requestId}});if(resumed?.ok!==true)throw new Error(resumed?.error||`Assistant continuation is not yet confirmed.`)}if(integrationActionPending.value===selection&&sessionId.value===selection.sessionId)await reloadConversationLog();return true}const result=await httpClient.request(vibe64SessionPath(sessionsApiPath.value,selection.sessionId,`/integration-setup/${action}`),{method:`POST`,body:{turnId:selection.turnId,requestId:selection.requestId}});if(result?.ok!==true)throw new Error(result?.error||`Could not update integration setup.`);if(integrationActionPending.value===selection&&sessionId.value===selection.sessionId)await reloadConversationLog();return true}catch(error){if(sessionId.value===selection.sessionId&&integrationActionPending.value===selection){integrationActionError.value={turnId:selection.turnId,message:String(error?.message||`Could not update integration setup.`)};if(action===`resume`||action===`connect`||action===`status`)await reloadConversationLog()}return false}finally{if(sessionId.value===selection.sessionId&&integrationActionPending.value===selection)integrationActionPending.value=null}}onScopeDispose(()=>{integrationActionPending.value=null});watch([sessionId,projectSlug],()=>{integrationActionPending.value=null;integrationActionError.value=null;integrationConnections.value={}});return{integrationConnections,connectIntegrationRequest,checkIntegrationRequest,cancelIntegrationRequest,integrationActionPending,integrationActionError,skipIntegrationRequest,resumeIntegrationRequest}}function useVibe64ConversationLog({active=true,projectSlug:projectSlugInput,sessionsApiPath:sessionsApiPathInput,session,conversation}){const paths=usePaths();const httpClient=getHttpWebClient();const projectSlug=projectSlugInput===void 0?useVibe64ProjectSlug():computed(()=>readRefOrGetterValue(projectSlugInput));const currentSession=computed(()=>readRefOrGetterValue(session)||null);const sessionId=computed(()=>String(currentSession.value?.sessionId||``).trim());const enabled=computed(()=>Boolean(readRefOrGetterValue(active)!==false&&sessionId.value));const sessionsApiPath=computed(()=>readRefOrGetterValue(sessionsApiPathInput)||paths.api(`/vibe64/sessions`,{surface:`app`}));const turns=computed(()=>conversationTurnsWithPending(conversation.turns.value,sessionAgentTurnActive(currentSession.value)));const integrationActions=useConversationIntegrationActions({turns,enabled,sessionId,projectSlug,sessionsApiPath,reloadConversationLog:conversation.reload,httpClient});let realtimeCompletionKey=``;const realtime=useRealtimeEvent({enabled,event:VIBE64_SESSION_CHANGED_EVENT,matches:context=>([`session-assistant-selection-updated`,`integration-setup-skipped`,`integration-setup-completed`].includes(context?.payload?.reason)||conversationLogCompletedTurnKey(context?.payload))&&conversationLogRealtimeShouldRefresh(context,sessionId.value)&&vibe64SessionEventMatchesScope(context?.payload,{projectSlug:projectSlug.value}),onEvent:({payload={}}={})=>{realtimeCompletionKey=conversationLogCompletedTurnKey(payload)||realtimeCompletionKey;return payload.reason===`session-assistant-selection-updated`?conversation.reload({resubscribe:true}):conversation.reload()}});watch(()=>conversationLogCompletedTurnKey(currentSession.value),key=>{if(!enabled.value||!key)return;if(key===realtimeCompletionKey){realtimeCompletionKey=``;return}conversation.reload()?.catch(()=>{})},{flush:`post`});return{integrationConnections:integrationActions.integrationConnections,connectIntegrationRequest:integrationActions.connectIntegrationRequest,checkIntegrationRequest:integrationActions.checkIntegrationRequest,cancelIntegrationRequest:integrationActions.cancelIntegrationRequest,integrationActionPending:integrationActions.integrationActionPending,integrationActionError:integrationActions.integrationActionError,skipIntegrationRequest:integrationActions.skipIntegrationRequest,resumeIntegrationRequest:integrationActions.resumeIntegrationRequest,turns,error:conversation.error,errorReloadable:computed(()=>conversation.accessDenied?.value===false),hasMoreBefore:conversation.hasMoreBefore,loadMore:conversation.loadMore,loadMoreError:conversation.loadMoreError,loading:conversation.loading,initializing:computed(()=>!conversation.snapshot.value&&conversation.loading.value),loadingMore:conversation.loadingMore,reload:conversation.reload,realtime,visible:computed(()=>Boolean(conversation.loading.value||conversation.error.value||turns.value.length))}}export{useVibe64ConversationLog as n,normalizeConversationLog as t};
@@ -1 +0,0 @@
1
- import{$ as useId,Et as unref,G as renderList,H as openBlock,K as renderSlot,Kt as normalizeClass,N as nextTick,O as inject,Tt as toValue,Xt as toDisplayString,_ as createSlots,b as createVNode,d as createBaseVNode,f as createBlock,gt as reactive,i as Fragment,it as watch,m as createElementBlock,mt as onScopeDispose,ot as withCtx,p as createCommentVNode,st as withDirectives,u as computed,vt as ref,xt as shallowRef,y as createTextVNode}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{S as VIcon,cr as vShow,lr as withKeys,mt as useDisplay,ur as withModifiers}from"./VChip-D2IukBZw.js";import{s as normalizeObject}from"./normalize-BD25VwNK.js";import{r as VProgressCircular,t as VBtn}from"./VBtn-2vbH580C.js";import{t as VDialog}from"./VDialog-B2W9wqR8.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{r as useRealtimeEvent}from"./useRealtimeEvent-B4oRg9Dt.js";var VIBE64_AI_TASKS_KEY=Symbol(`vibe64.ai-tasks`);var AI_TASK_PHASES=Object.freeze({STARTING:`starting`,WORKING:`working`,CHECKING:`checking`,NEEDS_YOU:`needs_you`,CANCELLING:`cancelling`,DONE:`done`,NOT_DONE:`not_done`});var AI_TASK_REASONS=Object.freeze({AI_STUCK:`ai_stuck`,AI_UNAVAILABLE:`ai_unavailable`,ARCHIVED:`archived`,CANCELLED:`cancelled`,CHECK_STUCK:`check_stuck`,DRAFT_WAITING:`draft_waiting`,INTERRUPTED:`interrupted`,NO_RESULT:`no_result`,QUESTION:`question`,STOPPED:`stopped`,TURN_FAILED:`turn_failed`,UNCONFIRMED:`unconfirmed`,YOUR_TURN:`your_turn`});var AI_TASK_CHECKERS=Object.freeze({AGENT:`agent`,PERSON:`person`,VIBE64:`vibe64`});var AI_TASK_ACTIVE_PHASES=Object.freeze([AI_TASK_PHASES.STARTING,AI_TASK_PHASES.WORKING,AI_TASK_PHASES.CHECKING,AI_TASK_PHASES.CANCELLING]);var AI_TASK_ENDED_PHASES=Object.freeze([AI_TASK_PHASES.DONE,AI_TASK_PHASES.NOT_DONE]);function aiTaskEnded(task){return AI_TASK_ENDED_PHASES.includes(task.phase)}var AI_TASK_MESSAGES=Object.freeze({actions:Object.freeze({aiSetup:`Open AI setup`,answer:`Answer`,back:`Back`,cancel:`Cancel`,cancelling:`Cancelling…`,checkNow:`Check now`,close:`Close`,closing:`Closing…`,continue:`Continue`,details:`Details`,endNotDone:`End as not done`,finish:`Finish`,hide:`Hide`,keepGoing:`Keep going`,openChat:`Open chat`,review:`Review resolved conflicts`,waitForAi:`Wait for the AI`}),button:Object.freeze({busy:`Being fixed…`,fix:`Fix it with AI`,opening:`Opening…`,result:`See result`}),chat:Object.freeze({answer:`Type your answer…`,message:`Message the AI…`}),outcome:Object.freeze({done:`Done`,notDone:`Not done`,problem:`The problem`,seeConversation:`See the conversation`,showResult:`Show the result`,whatHappened:`What happened`,whatTheAiDid:`What the AI did`,whatsNext:`What's next`}),progress:Object.freeze({activity:`Activity`,unavailable:`Nothing is lost. The fix continues from here.`}),status:Object.freeze({aiStuck:`The AI could not finish this`,aiUnavailable:`The AI account can't run this right now`,cancelling:`Cancelling…`,draftWaiting:`The check failed. Your unsent message is waiting.`,interrupted:`Vibe64 restarted while the AI was working`,noResult:`The AI stopped without saying it finished`,question:`The AI needs your answer`,starting:`Starting…`,stopped:`Stopped. Tell the AI what to do next.`,turnFailed:`The AI ran into an error`,unconfirmed:`Vibe64 couldn't confirm the result`,working:`The AI is working on this`,yourTurn:`Your turn`}),tray:Object.freeze({cancelling:`Cancelling…`,done:`Done`,needsYou:`Needs you`,notDone:`Not done`,yourTurn:`Your turn`}),views:Object.freeze({chat:`Chat`,label:`Task views`,progress:`Progress`,waiting:`The AI is waiting for your answer`}),closeFailed:`That didn't finish. Try again.`,requestFailed:`That didn't reach Vibe64. Try again.`,attempt:(attempt,limit)=>`Attempt ${attempt} of ${limit}`,retrying:(attempt,limit)=>`The AI is trying again (attempt ${attempt} of ${limit})`,cancelQuestion:noun=>`Cancel this ${noun}? The AI stops. Anything it has changed stays in the session.`,cancelConfirm:noun=>`Cancel ${noun}`,cancelledByYou:noun=>`You cancelled this ${noun}.`,cancelledBy:(name,noun)=>`${name} cancelled this ${noun}.`,mainChatSince:time=>time?`The main chat's AI has been working since ${time}.`:`The main chat's AI is working.`,whatsNext:()=>`The problem is still there. Anything the AI changed stays in the session. To try again, close this and choose Fix it with AI.`,toast:(title,outcome)=>`${title}: ${outcome}.`});var AI_TASK_ACTIONS=Object.freeze({AI_SETUP:`ai-setup`,ANSWER:`answer`,CHECK:`check`,CONTINUE:`continue`,END:`end`,FINISH:`finish`,OPEN_CHAT:`open-chat`,REVIEW:`review`,RUN_NOW:`run-now`,WAIT_FOR_AI:`wait-for-ai`});var action=(id,label,primary=false)=>Object.freeze({id,label,primary});var OPEN_CHAT=action(AI_TASK_ACTIONS.OPEN_CHAT,AI_TASK_MESSAGES.actions.openChat);var CHECK_NOW=action(AI_TASK_ACTIONS.CHECK,AI_TASK_MESSAGES.actions.checkNow,true);var CONTINUE=action(AI_TASK_ACTIONS.CONTINUE,AI_TASK_MESSAGES.actions.continue,true);var NEEDS_YOU=Object.freeze({[AI_TASK_REASONS.QUESTION]:{status:AI_TASK_MESSAGES.status.question,chat:true,dot:true,actions:[action(AI_TASK_ACTIONS.ANSWER,AI_TASK_MESSAGES.actions.answer,true)]},[AI_TASK_REASONS.YOUR_TURN]:{glyph:`turn`,status:AI_TASK_MESSAGES.status.yourTurn,tray:AI_TASK_MESSAGES.tray.yourTurn,chat:true,dot:true,actions:[action(AI_TASK_ACTIONS.FINISH,AI_TASK_MESSAGES.actions.finish,true)]},[AI_TASK_REASONS.AI_STUCK]:{status:AI_TASK_MESSAGES.status.aiStuck,chat:true,actions:[action(AI_TASK_ACTIONS.END,AI_TASK_MESSAGES.actions.endNotDone),action(AI_TASK_ACTIONS.OPEN_CHAT,AI_TASK_MESSAGES.actions.openChat,true)]},[AI_TASK_REASONS.CHECK_STUCK]:{check:true,diagnostic:true,actions:[OPEN_CHAT,CHECK_NOW]},[AI_TASK_REASONS.NO_RESULT]:{status:AI_TASK_MESSAGES.status.noResult,actions:[OPEN_CHAT,CHECK_NOW]},[AI_TASK_REASONS.STOPPED]:{status:AI_TASK_MESSAGES.status.stopped,actions:[OPEN_CHAT,CONTINUE]},[AI_TASK_REASONS.AI_UNAVAILABLE]:{status:AI_TASK_MESSAGES.status.aiUnavailable,note:AI_TASK_MESSAGES.progress.unavailable,actions:[action(AI_TASK_ACTIONS.AI_SETUP,AI_TASK_MESSAGES.actions.aiSetup),CONTINUE]},[AI_TASK_REASONS.TURN_FAILED]:{status:AI_TASK_MESSAGES.status.turnFailed,actions:[OPEN_CHAT,CONTINUE]},[AI_TASK_REASONS.INTERRUPTED]:{status:AI_TASK_MESSAGES.status.interrupted,actions:[CONTINUE]},[AI_TASK_REASONS.UNCONFIRMED]:{status:AI_TASK_MESSAGES.status.unconfirmed,check:true,actions:[CHECK_NOW]},[AI_TASK_REASONS.DRAFT_WAITING]:{status:AI_TASK_MESSAGES.status.draftWaiting,chat:true,check:true,diagnostic:true,actions:[action(AI_TASK_ACTIONS.OPEN_CHAT,AI_TASK_MESSAGES.actions.openChat,true)]}});function stepsOf(task,needs){const[work,check]=task.steps;const counted=task.check.retryLimit>0?AI_TASK_MESSAGES.attempt(task.attempt,task.check.retryLimit):``;const ended=aiTaskEnded(task);const atCheck=task.phase===AI_TASK_PHASES.CHECKING||task.checkRunning||needs?.check===true;const passed=task.phase===AI_TASK_PHASES.DONE;const workState=passed||atCheck?`done`:ended?`failed`:`active`;const checkState=passed?`done`:needs?.check||ended&&atCheck?`failed`:atCheck?`active`:`pending`;const steps=[{label:work,state:workState,attempt:workState===`active`?counted:``}];if(check)steps.push({label:check,state:checkState,attempt:atCheck&&!ended?counted:``});return steps}function endedMessage(task,viewerId){if(task.message)return task.message;const by=task.endedBy;return by?.name&&by.id!==viewerId?AI_TASK_MESSAGES.cancelledBy(by.name,task.noun):AI_TASK_MESSAGES.cancelledByYou(task.noun)}function outcomeOf(task,viewerId){if(task.phase===AI_TASK_PHASES.DONE)return{heading:AI_TASK_MESSAGES.outcome.done,happened:task.message,report:task.report,next:``};return{heading:AI_TASK_MESSAGES.outcome.notDone,happened:endedMessage(task,viewerId),report:``,next:AI_TASK_MESSAGES.whatsNext()}}function runningStatus(task){if(task.phase===AI_TASK_PHASES.STARTING)return AI_TASK_MESSAGES.status.starting;if(task.phase===AI_TASK_PHASES.CANCELLING)return AI_TASK_MESSAGES.status.cancelling;if(task.phase===AI_TASK_PHASES.CHECKING)return task.waiting?task.message:task.check.label;return task.attempt>1?AI_TASK_MESSAGES.retrying(task.attempt,task.check.retryLimit):AI_TASK_MESSAGES.status.working}function noteOf(task,needs){if(task.phase===AI_TASK_PHASES.CANCELLING)return task.checkRunning?task.check.unstoppable:``;if(!needs)return``;return[needs.status&&task.message!==needs.status?task.message:``,needs.diagnostic&&!task.message.includes(task.diagnostic)?task.diagnostic:``,needs.note].filter(Boolean).join(` `)}function projectAiTask(task,{viewerId}){const ended=aiTaskEnded(task);const needs=task.phase===AI_TASK_PHASES.NEEDS_YOU?NEEDS_YOU[task.reason]:null;const whileAiWorks=task.phase===AI_TASK_PHASES.CHECKING&&task.waiting&&task.mainChatSince?task.check.whileAiWorks:null;const review=needs?.check&&task.reason===AI_TASK_REASONS.CHECK_STUCK&&task.conflictReview?[action(AI_TASK_ACTIONS.REVIEW,AI_TASK_MESSAGES.actions.review)]:[];const done=task.phase===AI_TASK_PHASES.DONE;const running=!ended&&!needs;return{glyph:done?`done`:ended?`not-done`:needs?needs.glyph||`attention`:`working`,status:done?AI_TASK_MESSAGES.outcome.done:ended?AI_TASK_MESSAGES.outcome.notDone:needs?needs.status||task.message:runningStatus(task),tray:done?AI_TASK_MESSAGES.tray.done:ended?AI_TASK_MESSAGES.tray.notDone:task.phase===AI_TASK_PHASES.CANCELLING?AI_TASK_MESSAGES.tray.cancelling:needs?needs.tray||AI_TASK_MESSAGES.tray.needsYou:task.tray,ended,chatDot:needs?.dot===true,opensOn:needs?.chat?`chat`:`progress`,composerOpen:Boolean(needs)||task.phase===AI_TASK_PHASES.WORKING,composerHint:task.reason===AI_TASK_REASONS.QUESTION?AI_TASK_MESSAGES.chat.answer:AI_TASK_MESSAGES.chat.message,note:whileAiWorks?`${AI_TASK_MESSAGES.mainChatSince(aiTaskTime(task.mainChatSince))} ${whileAiWorks.note}`:running&&task.phase!==AI_TASK_PHASES.CANCELLING?``:noteOf(task,needs),steps:stepsOf(task,needs),actions:needs?[...review,...needs.actions]:whileAiWorks?[action(AI_TASK_ACTIONS.WAIT_FOR_AI,AI_TASK_MESSAGES.actions.waitForAi),action(AI_TASK_ACTIONS.RUN_NOW,whileAiWorks.action,true)]:[],cancelQuestion:AI_TASK_MESSAGES.cancelQuestion(task.noun),outcome:ended?outcomeOf(task,viewerId):null}}function aiTaskFooterActions(actions,view){if(view!==`chat`)return actions;return actions.filter(({id})=>id!==AI_TASK_ACTIONS.ANSWER&&id!==AI_TASK_ACTIONS.OPEN_CHAT)}function aiTaskTime(at){const date=new Date(at);return Number.isNaN(date.getTime())?``:date.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}var SESSION_CHANGED_EVENT=`vibe64.session.changed`;var AI_TASK_CHANGED=`ai-task-changed`;function useAiTasks({sessionId,sessionsApiPath,projectSlug,enabled,request,onClosed}){const task=shallowRef(null);const loaded=ref(false);const error=ref(``);const cancelRequested=ref(false);const closing=ref(false);const starting=ref(false);const viewerId=ref(``);let readGeneration=0;const tasksPath=()=>`${toValue(sessionsApiPath)}/${encodeURIComponent(toValue(sessionId))}/ai-tasks`;const taskPath=(suffix=``)=>`${tasksPath()}/${encodeURIComponent(task.value.id)}${suffix}`;function remember(next){if(task.value?.id===next.id&&next.revision<task.value.revision)return;task.value=next}async function load(){const generation=++readGeneration;if(!toValue(enabled)||!toValue(sessionId))return;try{const{tasks,viewerId:viewer}=await request(tasksPath(),{method:`GET`});if(generation!==readGeneration)return;viewerId.value=viewer;const[saved=null]=tasks;if(saved)remember(saved);else task.value=null;loaded.value=true}catch{}}async function start(kind,input){error.value=``;starting.value=true;try{const answer=await request(tasksPath(),{method:`POST`,body:{kind,input}});remember(answer.task);return answer.task}catch(failure){error.value=failure.message||AI_TASK_MESSAGES.requestFailed;return null}finally{starting.value=false}}async function act(suffix,body={}){error.value=``;try{remember((await request(taskPath(suffix),{method:`POST`,body})).task)}catch(failure){error.value=failure.message||AI_TASK_MESSAGES.requestFailed;load()}}async function cancel(){cancelRequested.value=true;await act(`/cancel`);cancelRequested.value=false}const check=(input={})=>act(`/check`,input);const continueTask=()=>act(`/continue`);const finish=()=>act(`/finish`);async function close(){error.value=``;closing.value=true;try{await request(taskPath(),{method:`DELETE`});task.value=null}catch{error.value=AI_TASK_MESSAGES.closeFailed}finally{closing.value=false}}const matchesSession=payload=>payload.projectSlug===toValue(projectSlug)&&payload.sessionId===toValue(sessionId)&&payload.reason===AI_TASK_CHANGED;useRealtimeEvent({enabled:computed(()=>toValue(enabled)),event:SESSION_CHANGED_EVENT,matches:({payload={}}={})=>matchesSession(payload),onEvent({payload}){if(payload.aiTask){remember(payload.aiTask);return}if(payload.aiTaskClosed?.id!==task.value?.id)return;const closedHere=closing.value;task.value=null;if(!closedHere)onClosed(payload.aiTaskClosed)}});useRealtimeEvent({enabled:computed(()=>toValue(enabled)),event:`connect`,onEvent:()=>void load()});watch(()=>[toValue(sessionId),toValue(enabled)],([,on],previous)=>{if(previous?.[0]!==toValue(sessionId)){task.value=null;loaded.value=false}if(on)load()},{immediate:true});return{cancel,cancelRequested,check,close,closing,continueTask,error,finish,load,loaded,start,starting,task,viewerId}}var WINDOW_QUERY=`aiTask`;function useAiTaskWindow({task,loaded,active,opensOn,route,router}){const view=ref(`progress`);const transcriptOpen=ref(false);let opener=null;const wanted=computed(()=>String(route.query[WINDOW_QUERY]||``));const open=computed(()=>toValue(active)&&Boolean(wanted.value)&&toValue(task)?.id===wanted.value);function withoutWindow(){const{[WINDOW_QUERY]:_taskId,...query}=route.query;return{path:route.path,query,hash:route.hash}}async function show(element=null){const current=toValue(task);if(!current)return;opener=element;if(open.value)return;await router.push({path:route.path,query:{...route.query,[WINDOW_QUERY]:current.id},hash:route.hash})}function hide(){if(wanted.value)router.replace(withoutWindow())}function setView(next){view.value=next}watch(open,isOpen=>{if(!isOpen)return;view.value=toValue(opensOn);transcriptOpen.value=false},{immediate:true});watch(()=>[wanted.value,toValue(loaded),toValue(task)?.id,toValue(active)],()=>{if(wanted.value&&toValue(active)&&toValue(loaded)&&toValue(task)?.id!==wanted.value)router.replace(withoutWindow())},{immediate:true});return{hide,open,opener:()=>opener?.isConnected?opener:null,setView,show,transcriptOpen,view}}function useAiTaskHost({sessionId,sessionsApiPath,projectSlug,enabled,active,request,route,router,openAiSetup,reviewResolved,fallbackFocus}){const toast=ref(null);const tasks=useAiTasks({sessionId,sessionsApiPath,projectSlug,enabled,request,onClosed(closed){const heading=closed.phase===`done`?AI_TASK_MESSAGES.outcome.done:AI_TASK_MESSAGES.outcome.notDone;toast.value={text:AI_TASK_MESSAGES.toast(closed.title,heading),action:false}}});const projection=computed(()=>tasks.task.value&&projectAiTask(tasks.task.value,{viewerId:tasks.viewerId.value}));const taskWindow=useAiTaskWindow({task:tasks.task,loaded:tasks.loaded,active,opensOn:()=>projection.value?.opensOn||`progress`,route,router});function returnFocusTarget(){return taskWindow.opener()||document.querySelector(`[data-vibe64-ai-task-tray]`)||fallbackFocus()}async function start(kind,opener,input){const task=await tasks.start(kind,input);if(task)await nextTick();if(task)taskWindow.show(opener);else toast.value={text:tasks.error.value,action:false};return task}async function close(){const target=returnFocusTarget();await tasks.close();if(tasks.task.value)return;taskWindow.hide();await nextTick();(target?.isConnected?target:fallbackFocus())?.focus({preventScroll:true})}async function waitForAi(){taskWindow.hide();await nextTick();fallbackFocus()?.focus({preventScroll:true})}function run(actionId){const{task}=tasks;if(actionId===AI_TASK_ACTIONS.ANSWER||actionId===AI_TASK_ACTIONS.OPEN_CHAT)taskWindow.setView(`chat`);else if(actionId===AI_TASK_ACTIONS.CHECK)tasks.check();else if(actionId===AI_TASK_ACTIONS.RUN_NOW)tasks.check({whileAiWorks:true});else if(actionId===AI_TASK_ACTIONS.WAIT_FOR_AI)waitForAi();else if(actionId===AI_TASK_ACTIONS.CONTINUE)tasks.continueTask();else if(actionId===AI_TASK_ACTIONS.FINISH)tasks.finish();else if(actionId===AI_TASK_ACTIONS.END)tasks.cancel();else if(actionId===AI_TASK_ACTIONS.AI_SETUP)openAiSetup();else if(actionId===AI_TASK_ACTIONS.REVIEW&&task.value)reviewResolved()}function seeToastResult(){toast.value=null;taskWindow.show(null)}watch(()=>tasks.task.value&&aiTaskEnded(tasks.task.value),(ended,wasEnded)=>{if(!ended||wasEnded!==false||taskWindow.open.value||!toValue(active))return;toast.value={text:AI_TASK_MESSAGES.toast(tasks.task.value.title,projection.value.outcome.heading),action:true}});return reactive({cancel:tasks.cancel,cancelRequested:tasks.cancelRequested,check:tasks.check,close,closing:tasks.closing,error:tasks.error,hide:taskWindow.hide,open:taskWindow.open,projection,returnFocusTarget,run,seeToastResult,setTranscript:open=>{taskWindow.transcriptOpen.value=open},setView:taskWindow.setView,show:taskWindow.show,start,starting:tasks.starting,task:tasks.task,toast,transcriptOpen:taskWindow.transcriptOpen,view:taskWindow.view})}var _sfc_main$4={__name:`Vibe64AiTaskButton`,props:{kind:{required:true,type:String},allowed:{required:true,type:Boolean},title:{required:true,type:String},input:{required:true,type:Object}},emits:[`done`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const tasks=inject(VIBE64_AI_TASKS_KEY);const own=computed(()=>tasks.task?.kind===props.kind?tasks.task:null);const linked=computed(()=>Boolean(own.value));const label=computed(()=>{if(tasks.starting)return AI_TASK_MESSAGES.button.opening;if(!own.value)return AI_TASK_MESSAGES.button.fix;return tasks.projection.ended?AI_TASK_MESSAGES.button.result:AI_TASK_MESSAGES.button.busy});const disabled=computed(()=>!own.value&&(!props.allowed||tasks.starting));watch(()=>own.value?.phase===AI_TASK_PHASES.DONE?own.value.id:``,doneId=>{if(doneId)emit(`done`)});function activate(event){const opener=event.currentTarget;if(own.value)tasks.show(opener);else tasks.start(props.kind,opener,props.input)}return(_ctx,_cache)=>{return openBlock(),createBlock(VBtn,{"aria-busy":label.value===unref(AI_TASK_MESSAGES).button.opening?`true`:void 0,class:`vibe64-ai-task-button`,"data-vibe64-ai-task-button":``,disabled:disabled.value,"prepend-icon":`$smartToy`,size:`small`,title:__props.title,type:`button`,variant:`tonal`,onClick:activate},createSlots({default:withCtx(()=>[createTextVNode(toDisplayString(label.value)+` `,1)]),_:2},[linked.value?{name:`append`,fn:withCtx(()=>[createVNode(VIcon,{icon:`$arrowForward`,size:`16`,"aria-hidden":`true`})]),key:`0`}:void 0]),1032,[`aria-busy`,`disabled`,`title`])}}};var Vibe64AiTaskButton_default=_plugin_vue_export_helper_default(_sfc_main$4,[[`__scopeId`,`data-v-2233af9d`]]);var _hoisted_1$3=[`aria-label`,`title`];var _hoisted_2$3={class:`vibe64-ai-task-tray__label`};var _sfc_main$3={__name:`Vibe64AiTaskTray`,setup(__props){const tasks=inject(VIBE64_AI_TASKS_KEY);const glyphIcons={attention:`$errorFilled`,done:`$checkCircleFilled`,"not-done":`$cancel`,turn:`$circle`};return(_ctx,_cache)=>{return openBlock(),createElementBlock(`button`,{"aria-label":`${unref(tasks).task.title}: ${unref(tasks).projection.tray}`,class:normalizeClass([`vibe64-ai-task-tray`,`vibe64-ai-task-tray--${unref(tasks).projection.glyph}`]),"data-vibe64-ai-task-tray":``,title:unref(tasks).projection.tray,type:`button`,onClick:_cache[0]||(_cache[0]=$event=>unref(tasks).show($event.currentTarget))},[unref(tasks).projection.glyph===`working`?(openBlock(),createBlock(VProgressCircular,{key:0,indeterminate:``,size:`16`,width:`2`,"aria-hidden":`true`})):(openBlock(),createBlock(VIcon,{key:1,icon:glyphIcons[unref(tasks).projection.glyph],size:`18`,"aria-hidden":`true`},null,8,[`icon`])),createBaseVNode(`span`,_hoisted_2$3,toDisplayString(unref(tasks).projection.tray),1)],10,_hoisted_1$3)}}};var Vibe64AiTaskTray_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-56857b35`]]);var PHONE_WIDTH=600;var SHORT_HEIGHT=560;var EXPANDED_WIDTH=960;function aiTaskFit(width,height){const phone=width<PHONE_WIDTH;if(phone||height<SHORT_HEIGHT)return{fullscreen:true,phone,width:void 0,height:void 0};return width<EXPANDED_WIDTH?{fullscreen:false,phone,width:`min(92vw, 46rem)`,height:`88dvh`}:{fullscreen:false,phone,width:`46rem`,height:`min(80dvh, 46rem)`}}var REDUCED_MOTION=`(prefers-reduced-motion: reduce)`;function useAiTaskFocus({title,views,selectedView,setView,returnFocusTarget}){const tabElements=new Map;const motionQuery=globalThis.matchMedia(REDUCED_MOTION);const reducedMotion=ref(motionQuery.matches);const noteMotion=event=>{reducedMotion.value=event.matches};motionQuery.addEventListener(`change`,noteMotion);onScopeDispose(()=>motionQuery.removeEventListener(`change`,noteMotion));function focusTitle(){title.value?.focus({preventScroll:true})}function returnFocus(){returnFocusTarget()?.focus({preventScroll:true})}function setTab(view,element){if(element)tabElements.set(view,element);else tabElements.delete(view)}async function moveBetweenViews(event){const index=views.indexOf(selectedView());const next={ArrowLeft:views[(index+views.length-1)%views.length],ArrowRight:views[(index+1)%views.length],End:views.at(-1),Home:views[0]}[event.key];if(!next)return;event.preventDefault();setView(next);await nextTick();tabElements.get(next)?.focus()}return{focusTitle,moveBetweenViews,reducedMotion,returnFocus,setTab}}var _hoisted_1$2={class:`ai-task-outcome`};var _hoisted_2$2={key:0};var _hoisted_3$2={key:1};var _sfc_main$2={__name:`Vibe64AiTaskOutcome`,props:{task:{required:true,type:Object},projection:{required:true,type:Object}},emits:[`see-conversation`],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,_hoisted_1$2,[createBaseVNode(`section`,null,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.problem),1),createBaseVNode(`p`,null,toDisplayString(__props.task.problem.summary),1)]),createBaseVNode(`section`,null,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.whatHappened),1),createBaseVNode(`p`,null,toDisplayString(__props.projection.outcome.happened),1)]),__props.projection.outcome.report?(openBlock(),createElementBlock(`section`,_hoisted_2$2,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.whatTheAiDid),1),createBaseVNode(`p`,null,toDisplayString(__props.projection.outcome.report),1)])):createCommentVNode(``,true),__props.projection.outcome.next?(openBlock(),createElementBlock(`section`,_hoisted_3$2,[createBaseVNode(`h3`,null,toDisplayString(unref(AI_TASK_MESSAGES).outcome.whatsNext),1),createBaseVNode(`p`,null,toDisplayString(__props.projection.outcome.next),1)])):createCommentVNode(``,true),createVNode(VBtn,{class:`ai-task-outcome__conversation`,"data-vibe64-ai-task-transcript":``,variant:`text`,onClick:_cache[0]||(_cache[0]=$event=>emit(`see-conversation`))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).outcome.seeConversation),1)]),_:1})])}}};var Vibe64AiTaskOutcome_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-bc318273`]]);var _hoisted_1$1={class:`ai-task-progress`};var _hoisted_2$1={class:`ai-task-progress__steps`};var _hoisted_3$1={class:`ai-task-progress__label`};var _hoisted_4$1={key:0,class:`ai-task-progress__attempt`};var _hoisted_5$1={key:0,class:`ai-task-progress__note`};var _hoisted_6$1={key:1,class:`ai-task-progress__output`};var _hoisted_7$1=[`aria-label`];var _hoisted_8$1={class:`ai-task-progress__heading`};var _hoisted_9$1=[`datetime`];var _sfc_main$1={__name:`Vibe64AiTaskProgress`,props:{task:{required:true,type:Object},projection:{required:true,type:Object},output:{required:true,type:Boolean},commentary:{required:true,type:Array}},setup(__props){const props=__props;const stepIcons={active:`$radioOn`,done:`$checkCircleFilled`,failed:`$cancel`,pending:`$circle`};const activity=computed(()=>[...props.task.log,...props.commentary].sort((a,b)=>a.at.localeCompare(b.at)));return(_ctx,_cache)=>{return openBlock(),createElementBlock(`div`,_hoisted_1$1,[createBaseVNode(`ol`,_hoisted_2$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.projection.steps,step=>{return openBlock(),createElementBlock(`li`,{key:step.label,class:normalizeClass([`ai-task-progress__step`,`ai-task-progress__step--${step.state}`])},[createVNode(VIcon,{icon:stepIcons[step.state],size:`18`,"aria-hidden":`true`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_3$1,toDisplayString(step.label),1),step.attempt?(openBlock(),createElementBlock(`span`,_hoisted_4$1,toDisplayString(step.attempt),1)):createCommentVNode(``,true)],2)}),128))]),__props.projection.note?(openBlock(),createElementBlock(`p`,_hoisted_5$1,toDisplayString(__props.projection.note),1)):createCommentVNode(``,true),_ctx.$slots[`check-output`]&&__props.output?(openBlock(),createElementBlock(`details`,_hoisted_6$1,[createBaseVNode(`summary`,null,toDisplayString(__props.task.check.output),1),renderSlot(_ctx.$slots,`check-output`,{},void 0,true)])):createCommentVNode(``,true),createBaseVNode(`section`,{class:`ai-task-progress__activity`,"aria-label":unref(AI_TASK_MESSAGES).progress.activity},[createBaseVNode(`h3`,_hoisted_8$1,toDisplayString(unref(AI_TASK_MESSAGES).progress.activity),1),createBaseVNode(`ol`,null,[(openBlock(true),createElementBlock(Fragment,null,renderList(activity.value,entry=>{return openBlock(),createElementBlock(`li`,{key:`${entry.at}:${entry.text}`},[createBaseVNode(`time`,{datetime:entry.at},toDisplayString(unref(aiTaskTime)(entry.at)),9,_hoisted_9$1),createBaseVNode(`span`,null,toDisplayString(entry.text),1)])}),128))])],8,_hoisted_7$1)])}}};var Vibe64AiTaskProgress_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-1d71ea78`]]);var _hoisted_1=[`aria-labelledby`,`data-vibe64-ai-task-phase`,`data-vibe64-ai-task-reason`];var _hoisted_2={class:`ai-task__header`};var _hoisted_3={class:`ai-task__heading`};var _hoisted_4=[`id`];var _hoisted_5={"aria-live":`polite`,class:`ai-task__status`,"data-vibe64-ai-task-status":``};var _hoisted_6={key:0,class:`ai-task__commands`};var _hoisted_7={class:`ai-task__problem`};var _hoisted_8=[`title`];var _hoisted_9=[`aria-expanded`,`aria-label`];var _hoisted_10={class:`ai-task__details-word`};var _hoisted_11={key:0,class:`ai-task__details`,"data-vibe64-ai-task-details-text":``,tabindex:`0`};var _hoisted_12=[`aria-label`];var _hoisted_13=[`id`,`aria-controls`,`aria-selected`,`data-vibe64-ai-task-view`,`tabindex`,`onClick`];var _hoisted_14=[`aria-label`];var _hoisted_15={class:`ai-task__body`};var _hoisted_16=[`id`,`aria-labelledby`];var _hoisted_17=[`id`,`aria-labelledby`,`role`];var _hoisted_18={key:1,class:`ai-task__error`,role:`alert`};var _hoisted_19={key:2,class:`ai-task__footer ai-task__footer--question`};var _hoisted_20={class:`ai-task__actions`};var _hoisted_21={key:3,class:`ai-task__footer`};var _hoisted_22={class:`ai-task__actions`};var _hoisted_23={key:4,class:`ai-task__footer`};var _hoisted_24={class:`ai-task__actions`};var _sfc_main={__name:`Vibe64AiTaskWindow`,props:{source:{required:true,type:Object},commentary:{required:true,type:Array},output:{required:true,type:Boolean}},setup(__props){const props=__props;const glyphIcons={attention:`$errorFilled`,done:`$checkCircleFilled`,"not-done":`$cancel`,turn:`$circle`};const titleId=useId();const title=ref(null);const task=computed(()=>props.source.task);const projection=computed(()=>props.source.projection);const footerActions=computed(()=>aiTaskFooterActions(projection.value.actions,props.source.view));const{width,height}=useDisplay();const fit=computed(()=>aiTaskFit(width.value,height.value));const detailsOpen=ref(false);const confirmingCancel=ref(false);const cancelling=computed(()=>props.source.cancelRequested||task.value.phase===`cancelling`);const tabs=[{id:`progress`,label:AI_TASK_MESSAGES.views.progress},{id:`chat`,label:AI_TASK_MESSAGES.views.chat}];const{focusTitle,moveBetweenViews,reducedMotion,returnFocus,setTab}=useAiTaskFocus({title,views:tabs.map(tab=>tab.id),selectedView:()=>props.source.view,setView:view=>props.source.setView(view),returnFocusTarget:()=>props.source.returnFocusTarget()});function requestCancel(){if(cancelling.value)props.source.cancel();else confirmingCancel.value=true}function cancel(){confirmingCancel.value=false;props.source.cancel()}function escape(){if(projection.value.ended)props.source.close();else props.source.hide()}watch(()=>projection.value.ended,async ended=>{if(!ended)return;confirmingCancel.value=false;await nextTick();focusTitle()});return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"aria-labelledby":unref(titleId),fullscreen:fit.value.fullscreen,height:fit.value.height,"model-value":__props.source.open,"no-click-animation":``,persistent:``,width:fit.value.width,transition:unref(reducedMotion)?false:void 0,onAfterEnter:unref(focusTitle),onAfterLeave:unref(returnFocus),onKeydown:withKeys(withModifiers(escape,[`stop`,`prevent`]),[`esc`])},{default:withCtx(()=>[createBaseVNode(`section`,{"aria-labelledby":unref(titleId),class:normalizeClass([`ai-task`,{"ai-task--fullscreen":fit.value.fullscreen,"ai-task--ended":projection.value.ended}]),"data-vibe64-ai-task":``,"data-vibe64-ai-task-phase":task.value.phase,"data-vibe64-ai-task-reason":task.value.reason},[createBaseVNode(`header`,_hoisted_2,[createBaseVNode(`span`,{class:normalizeClass([`ai-task__glyph`,`ai-task__glyph--${projection.value.glyph}`]),"aria-hidden":`true`},[projection.value.glyph===`working`?(openBlock(),createBlock(VProgressCircular,{key:0,indeterminate:!unref(reducedMotion),"model-value":unref(reducedMotion)?60:void 0,size:`20`,width:`2`},null,8,[`indeterminate`,`model-value`])):(openBlock(),createBlock(VIcon,{key:1,icon:glyphIcons[projection.value.glyph],size:`22`},null,8,[`icon`]))],2),createBaseVNode(`div`,_hoisted_3,[createBaseVNode(`h2`,{id:unref(titleId),ref_key:`title`,ref:title,tabindex:`-1`},toDisplayString(projection.value.ended?projection.value.outcome.heading:task.value.title),9,_hoisted_4),createBaseVNode(`p`,_hoisted_5,toDisplayString(projection.value.ended?task.value.title:projection.value.status),1)]),!projection.value.ended?(openBlock(),createElementBlock(`div`,_hoisted_6,[createVNode(VBtn,{"data-vibe64-ai-task-hide":``,variant:`text`,onClick:__props.source.hide},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).actions.hide),1)]),_:1},8,[`onClick`]),createVNode(VBtn,{"aria-busy":cancelling.value?`true`:void 0,"data-vibe64-ai-task-cancel":``,variant:`text`,onClick:requestCancel},{default:withCtx(()=>[createTextVNode(toDisplayString(cancelling.value?unref(AI_TASK_MESSAGES).actions.cancelling:unref(AI_TASK_MESSAGES).actions.cancel),1)]),_:1},8,[`aria-busy`])])):createCommentVNode(``,true)]),!projection.value.ended?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`div`,_hoisted_7,[createBaseVNode(`span`,{class:`ai-task__problem-line`,title:task.value.problem.summary},toDisplayString(task.value.problem.summary),9,_hoisted_8),task.value.problem.details?(openBlock(),createElementBlock(`button`,{key:0,"aria-expanded":detailsOpen.value?`true`:`false`,"aria-label":unref(AI_TASK_MESSAGES).actions.details,class:`ai-task__details-toggle`,"data-vibe64-ai-task-details":``,type:`button`,onClick:_cache[0]||(_cache[0]=$event=>detailsOpen.value=!detailsOpen.value)},[createBaseVNode(`span`,_hoisted_10,toDisplayString(unref(AI_TASK_MESSAGES).actions.details),1),createVNode(VIcon,{icon:detailsOpen.value?`$collapse`:`$expand`,size:`18`,"aria-hidden":`true`},null,8,[`icon`])],8,_hoisted_9)):createCommentVNode(``,true)]),detailsOpen.value?(openBlock(),createElementBlock(`pre`,_hoisted_11,toDisplayString(task.value.problem.details),1)):createCommentVNode(``,true),createBaseVNode(`div`,{"aria-label":unref(AI_TASK_MESSAGES).views.label,class:`ai-task__views`,role:`tablist`,onKeydown:_cache[1]||(_cache[1]=(...args)=>unref(moveBetweenViews)&&unref(moveBetweenViews)(...args))},[(openBlock(),createElementBlock(Fragment,null,renderList(tabs,tab=>{return createBaseVNode(`button`,{id:`${unref(titleId)}-${tab.id}-tab`,key:tab.id,ref_for:true,ref:element=>unref(setTab)(tab.id,element),"aria-controls":`${unref(titleId)}-${tab.id}`,"aria-selected":__props.source.view===tab.id?`true`:`false`,class:normalizeClass([`ai-task__view`,{"ai-task__view--selected":__props.source.view===tab.id}]),"data-vibe64-ai-task-view":tab.id,role:`tab`,tabindex:__props.source.view===tab.id?0:-1,type:`button`,onClick:$event=>__props.source.setView(tab.id)},[createTextVNode(toDisplayString(tab.label)+` `,1),tab.id===`chat`&&projection.value.chatDot?(openBlock(),createElementBlock(`span`,{key:0,class:`ai-task__dot`,role:`img`,"aria-label":unref(AI_TASK_MESSAGES).views.waiting},null,8,_hoisted_14)):createCommentVNode(``,true)],10,_hoisted_13)}),64))],40,_hoisted_12)],64)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_15,[!projection.value.ended?withDirectives((openBlock(),createElementBlock(`section`,{key:0,id:`${unref(titleId)}-progress`,"aria-labelledby":`${unref(titleId)}-progress-tab`,class:`ai-task__panel`,role:`tabpanel`},[createVNode(Vibe64AiTaskProgress_default,{commentary:__props.commentary,output:__props.output,projection:projection.value,task:task.value},{"check-output":withCtx(()=>[renderSlot(_ctx.$slots,`check-output`,{},void 0,true)]),_:3},8,[`commentary`,`output`,`projection`,`task`])],8,_hoisted_16)),[[vShow,__props.source.view===`progress`]]):!__props.source.transcriptOpen?(openBlock(),createBlock(Vibe64AiTaskOutcome_default,{key:1,projection:projection.value,task:task.value,onSeeConversation:_cache[2]||(_cache[2]=$event=>__props.source.setTranscript(true))},null,8,[`projection`,`task`])):createCommentVNode(``,true),withDirectives(createBaseVNode(`section`,{id:`${unref(titleId)}-chat`,"aria-labelledby":projection.value.ended?void 0:`${unref(titleId)}-chat-tab`,class:`ai-task__panel`,role:projection.value.ended?void 0:`tabpanel`},[renderSlot(_ctx.$slots,`chat`,{visible:__props.source.open&&(projection.value.ended?__props.source.transcriptOpen:__props.source.view===`chat`)},void 0,true)],8,_hoisted_17),[[vShow,!projection.value.ended?__props.source.view===`chat`:__props.source.transcriptOpen]])]),__props.source.error?(openBlock(),createElementBlock(`p`,_hoisted_18,toDisplayString(__props.source.error),1)):createCommentVNode(``,true),confirmingCancel.value?(openBlock(),createElementBlock(`footer`,_hoisted_19,[createBaseVNode(`p`,null,toDisplayString(projection.value.cancelQuestion),1),createBaseVNode(`div`,_hoisted_20,[createVNode(VBtn,{"data-vibe64-ai-task-keep-going":``,variant:`text`,onClick:_cache[3]||(_cache[3]=$event=>confirmingCancel.value=false)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).actions.keepGoing),1)]),_:1}),createVNode(VBtn,{color:`error`,"data-vibe64-ai-task-cancel-confirm":``,variant:`flat`,onClick:cancel},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).cancelConfirm(task.value.noun)),1)]),_:1})])])):projection.value.ended?(openBlock(),createElementBlock(`footer`,_hoisted_21,[createBaseVNode(`div`,_hoisted_22,[__props.source.transcriptOpen?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,onClick:_cache[4]||(_cache[4]=$event=>__props.source.setTranscript(false))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(AI_TASK_MESSAGES).outcome.showResult),1)]),_:1})):createCommentVNode(``,true),createVNode(VBtn,{"aria-busy":__props.source.closing?`true`:void 0,color:`primary`,"data-vibe64-ai-task-close":``,variant:`flat`,onClick:__props.source.close},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.source.closing?unref(AI_TASK_MESSAGES).actions.closing:unref(AI_TASK_MESSAGES).actions.close),1)]),_:1},8,[`aria-busy`,`onClick`])])])):footerActions.value.length?(openBlock(),createElementBlock(`footer`,_hoisted_23,[createBaseVNode(`div`,_hoisted_24,[(openBlock(true),createElementBlock(Fragment,null,renderList(footerActions.value,item=>{return openBlock(),createBlock(VBtn,{key:item.id,color:item.primary?`primary`:void 0,"data-vibe64-ai-task-action":item.id,variant:item.primary?`flat`:`text`,onClick:$event=>__props.source.run(item.id)},{default:withCtx(()=>[createTextVNode(toDisplayString(item.label),1)]),_:2},1032,[`color`,`data-vibe64-ai-task-action`,`variant`,`onClick`])}),128))])])):createCommentVNode(``,true)],10,_hoisted_1)]),_:3},8,[`aria-labelledby`,`fullscreen`,`height`,`model-value`,`width`,`transition`,`onAfterEnter`,`onAfterLeave`,`onKeydown`])}}};var Vibe64AiTaskWindow_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-5f35de55`]]);var REPOSITORY_STATUS_SESSION_REASONS=new Set([`claude-stream-turn-idle`,`codex-app-server-turn-idle`,`opencode-server-turn-idle`,`repository-canonical-changed`,`session-pull-request`,`session-repository-checked`,`session-save-completed`,`session-save-failed`,`session-save-started`,`session-save-update-required`,`session-starter-applied`,`session-turn-checkpoint-failed`,`session-turn-checkpoint-updated`,`session-update-completed`,`session-update-failed`,`session-update-started`]);var REPOSITORY_UPDATE_CHECK_FAILED_REASON=`session-repository-check-failed`;var REPOSITORY_CANONICAL_RECHECK_REASONS=new Set([`repository-canonical-changed`,`session-pull-request`,`session-save-failed`,`session-save-update-required`,`session-update-failed`]);function repositoryStatusSessionId(payload={}){const event=normalizeObject(payload);return String(event.sessionId||event.session?.sessionId||``).trim()}function repositoryStatusRealtimeShouldRefresh(payload={}){return REPOSITORY_STATUS_SESSION_REASONS.has(String(normalizeObject(payload).reason||``).trim())}function repositoryStatusRealtimeNeedsCanonicalCheck(payload={}){return REPOSITORY_CANONICAL_RECHECK_REASONS.has(String(normalizeObject(payload).reason||``).trim())}export{Vibe64AiTaskWindow_default as a,useAiTaskHost as c,repositoryStatusSessionId as i,AI_TASK_PHASES as l,repositoryStatusRealtimeNeedsCanonicalCheck as n,Vibe64AiTaskTray_default as o,repositoryStatusRealtimeShouldRefresh as r,Vibe64AiTaskButton_default as s,REPOSITORY_UPDATE_CHECK_FAILED_REASON as t,VIBE64_AI_TASKS_KEY as u};
@@ -1 +0,0 @@
1
- import{Et as unref,H as openBlock,N as nextTick,Xt as toDisplayString,b as createVNode,d as createBaseVNode,f as createBlock,i as Fragment,it as watch,m as createElementBlock,ot as withCtx,p as createCommentVNode,u as computed,vt as ref,y as createTextVNode}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{S as VIcon,_ as VProgressLinear}from"./VChip-D2IukBZw.js";import{t as useEndpointResource}from"./useEndpointResource-CmMwteuX.js";import{t as VSelect}from"./VSelect-9lMtP5cu.js";import{t as VAlert}from"./VAlert-DyCQWe9P.js";import{t as VTextField}from"./VTextField-BMvaWVTN.js";import{i as scopedDevelopmentApiUrl}from"./studioUrls-k_pQIuPs.js";import{l as requestVibe64AiOnboarding,y as useModelRouting}from"./client-B_iZQVU8.js";import{t as VBtn}from"./VBtn-2vbH580C.js";import{t as VSheet}from"./VSheet-D5wAuyc2.js";import{t as VDialog}from"./VDialog-B2W9wqR8.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BFqQSnAE.js";import{t as VSpacer}from"./VSpacer-GgPR_AzN.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-C5ZRrPV4.js";import{t as VSwitch}from"./VSwitch-DUkp5sfW.js";import{t as VTextarea}from"./VTextarea-CLaWcpd_.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{t as _sfc_main$2}from"./SelectField-DwWoHC2p.js";import{t as useUiFeedback}from"./useUiFeedback-Bixow9mW.js";import{t as readRefOrGetterValue}from"./vueRefOrGetterValue-y-4f_In7.js";import{L as vibe64SessionPath,k as vibe64RepositoryApiPath,o as VIBE64_SESSIONS_API_SUFFIX}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{b as sameVibe64AssistantSelection,c as vibe64AssistantSelectionLabel}from"./shared-B6plZPQ_.js";import{j as requestVibe64AccountConnectionsDialog,k as Vibe64SessionAssistantMenu_default}from"./index-Wcdz2Rey.js";import{a as vibe64SessionPullRequest,i as vibe64SessionDisplayTitle}from"./vibe64SessionViewModel-CQCds_jb.js";import{a as githubProjectRepositoryName,t as GITHUB_BODY_MAX_LENGTH}from"./vibe64GithubProject-CJneIo5O.js";var _hoisted_1$1={class:`d-flex align-center justify-space-between ga-2 pa-5 pb-2`};var _hoisted_2$1={class:`d-flex align-center ga-3`};var _hoisted_3$1={class:`text-label-large`};var _hoisted_4$1={class:`text-body-medium mt-1`};var _hoisted_5$1={key:0,role:`status`};var _sfc_main$1={__name:`Vibe64CreatePullRequestDialog`,props:{modelValue:Boolean,dashboardContext:{required:true,type:Object}},emits:[`update:modelValue`,`created`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const title=ref(``);const body=ref(``);const draft=ref(true);const pending=ref(false);const destinationReview=ref(null);const feedback=useUiFeedback({source:`vibe64.pullRequests.create`});const session=computed(()=>props.dashboardContext.session||{});const source=computed(()=>vibe64SessionPullRequest(session.value));const repository=computed(()=>githubProjectRepositoryName(props.dashboardContext.projectContext));const branch=computed(()=>{if(source.value?.headBranch)return source.value.headBranch;const destination=props.dashboardContext.workState?.destination;if(destination?.mode===`github`&&destination.branch!==props.dashboardContext.projectContext?.repository?.defaultBranch)return destination.branch;return`vibe64/pr-${props.dashboardContext.sessionId}`});const base=computed(()=>source.value?.baseBranch||props.dashboardContext.projectContext?.repository?.defaultBranch||``);const path=computed(()=>vibe64SessionPath(readRefOrGetterValue(props.dashboardContext.sessionsApiPath),props.dashboardContext.sessionId,`/pull-request`));const resource=useEndpointResource({path,queryKey:computed(()=>[`vibe64.createPullRequest`,path.value]),enabled:false});watch(()=>props.modelValue,open=>{if(open)destinationReview.value=props.dashboardContext.workState?.destination?{...props.dashboardContext.workState.destination}:null},{immediate:true});watch(()=>props.dashboardContext.sessionId,()=>{title.value=source.value?.title||vibe64SessionDisplayTitle(session.value);body.value=source.value?.body||``;draft.value=true},{immediate:true});async function submit(){if(pending.value||!title.value.trim())return;pending.value=true;try{const result=await resource.save({title:title.value.trim(),body:body.value,draft:draft.value,destinationReview:destinationReview.value},{method:`POST`});feedback.success(`Pull request created. Future commits update its source branch.`);emit(`created`,result.pullRequest);emit(`update:modelValue`,false);props.dashboardContext.refreshSessionWork?.()}catch(error){feedback.error(error,`The pull request could not be confirmed. Retry to check GitHub and continue.`)}finally{pending.value=false}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`38rem`,scrollable:``,persistent:pending.value,"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{rounded:`xl`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$1,[createBaseVNode(`div`,_hoisted_2$1,[createVNode(VIcon,{icon:`$callMerge`,color:`primary`}),_cache[6]||(_cache[6]=createBaseVNode(`h2`,{class:`text-title-large`},`Create pull request`,-1))]),createVNode(VBtn,{icon:`$close`,size:`48`,variant:`text`,"aria-label":`Close pull request dialog`,disabled:pending.value,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,false))},null,8,[`disabled`])]),createVNode(VCardText,{class:`d-flex flex-column ga-3`},{default:withCtx(()=>[createVNode(VSheet,{color:`surface-light`,rounded:`lg`,class:`pa-3 pr-destination`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$1,toDisplayString(repository.value),1),createBaseVNode(`div`,_hoisted_4$1,toDisplayString(branch.value)+` → `+toDisplayString(base.value),1),_cache[7]||(_cache[7]=createBaseVNode(`p`,{class:`text-body-small on-surface-variant mt-2 mb-0`},`The base branch stays unchanged.`,-1))]),_:1}),_cache[8]||(_cache[8]=createBaseVNode(`p`,{class:`text-body-small ma-0`},`Save open file edits first.`,-1)),!destinationReview.value?(openBlock(),createElementBlock(`p`,_hoisted_5$1,`Refresh repository status before creating a pull request.`)):createCommentVNode(``,true),createVNode(VTextField,{modelValue:title.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>title.value=$event),label:`Title`,variant:`outlined`,maxlength:`256`,disabled:pending.value,"hide-details":``},null,8,[`modelValue`,`disabled`]),createVNode(VTextarea,{modelValue:body.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>body.value=$event),label:`Description`,placeholder:`What changed, and how did you check it?`,variant:`outlined`,rows:`3`,"auto-grow":``,maxlength:unref(GITHUB_BODY_MAX_LENGTH),disabled:pending.value,"hide-details":``},null,8,[`modelValue`,`maxlength`,`disabled`]),createVNode(VSwitch,{modelValue:draft.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>draft.value=$event),color:`primary`,label:`Create as draft`,disabled:pending.value,"hide-details":``},null,8,[`modelValue`,`disabled`]),_cache[9]||(_cache[9]=createBaseVNode(`details`,{class:`pr-details text-body-small`},[createBaseVNode(`summary`,{class:`py-3`},`What gets pushed`),createBaseVNode(`p`,null,`All saved file changes are committed and pushed to the PR branch. Database data and chat history are separate. GitHub automation may run; this does not 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(unref(_sfc_main$2),{modelValue:branchName.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>branchName.value=$event),items:unref(branches).data.value?.branches||[],loading:unref(branches).isLoading.value,"item-title":`name`,"item-value":`name`,label:createBranch.value?`Create from`:`Branch`,disabled:submitting.value,"hide-details":``},null,8,[`modelValue`,`items`,`loading`,`label`,`disabled`]),selectedBranch.value?(openBlock(),createElementBlock(`p`,_hoisted_7,toDisplayString(createBranch.value?`Creates the branch and opens a new session.`:`Opens a new session on this branch.`)+` Your changes will be saved to `+toDisplayString(branchRepository.value)+`:`+toDisplayString(createBranch.value?newBranchName.value.trim()||`your new branch`:branchName.value)+`. `,1)):createCommentVNode(``,true),_cache[16]||(_cache[16]=createBaseVNode(`p`,{class:`text-body-small`},`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-66b229de`]]);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 +0,0 @@
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-66b229de]{gap:.5rem;padding:0 1.5rem .5rem;display:grid}.vibe64-assistant-dialog[data-v-66b229de]{border:1px solid rgb(var(--v-theme-outline-variant))}.vibe64-assistant-dialog__title[data-v-66b229de]{justify-content:space-between;align-items:center;padding:1rem 1.25rem .75rem;display:flex}.vibe64-assistant-dialog__title-copy[data-v-66b229de]{gap:.15rem;display:grid}.vibe64-assistant-dialog__title-copy small[data-v-66b229de]{color:rgba(var(--v-theme-on-surface), .66);white-space:normal}.vibe64-assistant-dialog__body[data-v-66b229de]{padding:.25rem 1.25rem 1rem!important}.vibe64-assistant-dialog__ai[data-v-66b229de]{overflow-wrap:anywhere;justify-items:start;gap:.25rem;display:grid}.vibe64-assistant-dialog__main-ai[data-v-66b229de]{margin-inline-start:-.5rem}.vibe64-assistant-dialog__actions[data-v-66b229de]{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-66b229de],.vibe64-assistant-dialog__actions[data-v-66b229de],.vibe64-assistant-dialog__title[data-v-66b229de]{padding-inline:1rem!important}}