vibe64 0.1.52 → 0.1.53

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 (52) hide show
  1. package/bin/upgrade-state.js +975 -974
  2. package/dist/assets/{GithubBrowserTabs-D7DveB8M.js → GithubBrowserTabs-DG2nCSNW.js} +1 -1
  3. package/dist/assets/{Vibe64AuthSettingsButton-DDArM5uw.js → Vibe64AuthSettingsButton-9OLqOZao.js} +1 -1
  4. package/dist/assets/{Vibe64DashboardShell-Ab65VYSS.js → Vibe64DashboardShell-hWNziCur.js} +1 -1
  5. package/dist/assets/{Vibe64DatabaseWorkspace-DHLt5bST.js → Vibe64DatabaseWorkspace-TqXOZJpI.js} +1 -1
  6. package/dist/assets/{Vibe64FileArea-DCqpclYH.js → Vibe64FileArea-BljhpApn.js} +1 -1
  7. package/dist/assets/{Vibe64OutputControls-BPDF1XfG.js → Vibe64OutputControls-Dk_DWuFb.js} +1 -1
  8. package/dist/assets/{Vibe64RepositoryWorkspace-C107tX19.js → Vibe64RepositoryWorkspace-CDnsAlIz.js} +1 -1
  9. package/dist/assets/{Vibe64SessionFiles-BKJ1Qem_.js → Vibe64SessionFiles-DjeEvtpc.js} +1 -1
  10. package/dist/assets/{Vibe64UiStoryboardView-CJajdYSt.js → Vibe64UiStoryboardView-idZz86bx.js} +1 -1
  11. package/dist/assets/{_sessionId_-BaNhTTVN.js → _sessionId_-DLLJsju9.js} +1 -1
  12. package/dist/assets/{_slug_-D7mzZsk3.css → _slug_-BRPxP_Yn.css} +1 -1
  13. package/dist/assets/{_slug_-nHO3Bg-f.js → _slug_-JgF_FQ6F.js} +7 -7
  14. package/dist/assets/{app-DbGzTUVN.js → app-Cuw9E-ru.js} +1 -1
  15. package/dist/assets/{changes-D7NjgKWf.js → changes-CoR0-8EL.js} +1 -1
  16. package/dist/assets/{conversation-DV8qCsqw.js → conversation-B1UoWMaA.js} +1 -1
  17. package/dist/assets/{dashboard-DL95BPsz.js → dashboard-DnuIxR1s.js} +1 -1
  18. package/dist/assets/{english-definitions-ChTTs3cC.js → english-definitions-By4b_Yl2.js} +1 -1
  19. package/dist/assets/{env-BdJvhqF-.js → env-KUPen-sS.js} +1 -1
  20. package/dist/assets/{history-DmGNxMVh.js → history-S_cJLehJ.js} +1 -1
  21. package/dist/assets/{index-BXZp5ztx.js → index-CNkd6O5t.js} +3 -3
  22. package/dist/assets/{integrations-DAYe7RkJ.js → integrations-Dmbbbs_A.js} +1 -1
  23. package/dist/assets/{issues-D_zOo2IW.js → issues-EeBajY3I.js} +1 -1
  24. package/dist/assets/{learning-ilyEoffw.js → learning-DDRM-FoP.js} +1 -1
  25. package/dist/assets/{project-files-CJWdFXh4.js → project-files-CQ1BLaaP.js} +1 -1
  26. package/dist/assets/{publish-D728amkk.js → publish-bvwc-KoQ.js} +1 -1
  27. package/dist/assets/{pull-requests-BsbM-5MA.js → pull-requests-Ce1ECyuL.js} +1 -1
  28. package/dist/assets/{repository-C8NwO4bj.js → repository-CK3osHmp.js} +1 -1
  29. package/dist/assets/{settings-DTLY7ZT5.js → settings-PQGw4vfn.js} +1 -1
  30. package/dist/assets/{useArchivedVibe64Sessions-Cc9GdKlD.js → useArchivedVibe64Sessions-BAQjW01a.js} +1 -1
  31. package/dist/assets/{useAssistantAttachments-DJKqt1hL.js → useAssistantAttachments-DJWb1KdF.js} +1 -1
  32. package/dist/assets/{useVibe64ConversationLog-Co0DhC3R.js → useVibe64ConversationLog-CjUZuvV7.js} +1 -1
  33. package/dist/assets/{useVibe64SessionData-D7fBm9xf.js → useVibe64SessionData-CbY_B5mC.js} +1 -1
  34. package/dist/assets/{vibe64SessionFocus-8fHAeoyU.js → vibe64SessionFocus-Bd3JuuZe.js} +1 -1
  35. package/dist/index.html +4 -4
  36. package/docs/colleague-usage/conversation-context.md +3 -1
  37. package/docs/colleague-usage/temporary-chats.md +26 -1
  38. package/docs/colleague-usage/workspace-preparation.md +17 -0
  39. package/node_modules/@jskit-ai/assistant-core/locales/en.json +1 -0
  40. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  41. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  42. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  43. package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
  44. package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
  45. package/node_modules/@jskit-ai/connectors-core/locales/en.json +1 -0
  46. package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
  47. package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +43 -43
  48. package/node_modules/@local/vibe64-genesis/src/server/index.js +189 -182
  49. package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +68 -61
  50. package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +532 -532
  51. package/package.json +7 -7
  52. package/server.bundle.mjs +28835 -28791
@@ -1 +1 @@
1
- import{D as createVNode,E as createTextVNode,On as unref,g as computed,mt as openBlock,qt as withCtx,v as createBlock}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{o as projectSlugFromRoute,r as projectAppPath}from"./vibe64ProjectScope.local-BbrorE15.js";import{Rr as mdiSourcePull,pr as mdiRecordCircleOutline}from"./mdi-DwGK7nOu.js";import{X as VTab,Y as VTabs}from"./index-BXZp5ztx.js";var _sfc_main={__name:`GithubBrowserTabs`,setup(__props){const route=useRoute();const projectSlug=computed(()=>projectSlugFromRoute(route));const selected=computed(()=>route.path.endsWith(`/pull-requests`)?`pull-requests`:`issues`);return(_ctx,_cache)=>{return openBlock(),createBlock(VTabs,{"model-value":selected.value,color:`primary`,density:`compact`,"aria-label":`Issues and pull requests`},{default:withCtx(()=>[createVNode(VTab,{value:`issues`,"prepend-icon":unref(mdiRecordCircleOutline),to:{path:unref(projectAppPath)(projectSlug.value,`/dashboard/issues`),query:{...unref(route).query,issue:void 0}}},{default:withCtx(()=>[..._cache[0]||(_cache[0]=[createTextVNode(` Issues `,-1)])]),_:1},8,[`prepend-icon`,`to`]),createVNode(VTab,{value:`pull-requests`,"prepend-icon":unref(mdiSourcePull),to:{path:unref(projectAppPath)(projectSlug.value,`/dashboard/pull-requests`),query:{...unref(route).query,pr:void 0,createPullRequest:void 0}}},{default:withCtx(()=>[..._cache[1]||(_cache[1]=[createTextVNode(` Pull requests `,-1)])]),_:1},8,[`prepend-icon`,`to`])]),_:1},8,[`model-value`])}}};export{_sfc_main as t};
1
+ import{D as createVNode,E as createTextVNode,On as unref,g as computed,mt as openBlock,qt as withCtx,v as createBlock}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{o as projectSlugFromRoute,r as projectAppPath}from"./vibe64ProjectScope.local-BbrorE15.js";import{Rr as mdiSourcePull,pr as mdiRecordCircleOutline}from"./mdi-DwGK7nOu.js";import{X as VTab,Y as VTabs}from"./index-CNkd6O5t.js";var _sfc_main={__name:`GithubBrowserTabs`,setup(__props){const route=useRoute();const projectSlug=computed(()=>projectSlugFromRoute(route));const selected=computed(()=>route.path.endsWith(`/pull-requests`)?`pull-requests`:`issues`);return(_ctx,_cache)=>{return openBlock(),createBlock(VTabs,{"model-value":selected.value,color:`primary`,density:`compact`,"aria-label":`Issues and pull requests`},{default:withCtx(()=>[createVNode(VTab,{value:`issues`,"prepend-icon":unref(mdiRecordCircleOutline),to:{path:unref(projectAppPath)(projectSlug.value,`/dashboard/issues`),query:{...unref(route).query,issue:void 0}}},{default:withCtx(()=>[..._cache[0]||(_cache[0]=[createTextVNode(` Issues `,-1)])]),_:1},8,[`prepend-icon`,`to`]),createVNode(VTab,{value:`pull-requests`,"prepend-icon":unref(mdiSourcePull),to:{path:unref(projectAppPath)(projectSlug.value,`/dashboard/pull-requests`),query:{...unref(route).query,pr:void 0,createPullRequest:void 0}}},{default:withCtx(()=>[..._cache[1]||(_cache[1]=[createTextVNode(` Pull requests `,-1)])]),_:1},8,[`prepend-icon`,`to`])]),_:1},8,[`model-value`])}}};export{_sfc_main as t};
@@ -1,4 +1,4 @@
1
- import{ct as useTheme,ht as useDisplay,mr as withModifiers,pr as withKeys}from"./VChip-BRhZ1px1.js";import{D as createVNode,E as createTextVNode,Ht as watch,J as inject,On as unref,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,et as mergeProps,g as computed,it as onBeforeUnmount,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,v as createBlock,vn as ref,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{n as VList,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{o as VIBE64_COLLEAGUE_LAUNCHER_KEY}from"./vibe64AssistantHost-CP6oxv5b.js";import{O as mdiAutoFix,Q as mdiClose,Wn as mdiMapMarkerPath,Zn as mdiMonitor,c as mdiAccountOutline,li as mdiWeatherNight,r as mdiAccountCogOutline,rn as mdiGithub,ui as mdiWeatherSunny,xr as mdiRobotOutline}from"./mdi-DwGK7nOu.js";import{i as VBtnToggle,t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{_ as useVibe64Accounts,c as aiOnboardingNeeded,d as AiSetup_default,g as ProviderAccountsSetup_default,l as onVibe64AiOnboardingRequested,n as accountRowsForStatus,o as aiOnboardingAvailable,r as AiOnboardingSetUpPill_default,s as aiOnboardingBlocked,u as requestVibe64AiOnboarding}from"./client-CBSWtYl4.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{O as useVibe64Learning,Q as VContainer,X as VTab,Y as VTabs,Z as VMain,h as _sfc_main$4,j as onVibe64AccountConnectionsDialogRequested,n as writeAppearance,nt as VAppBar,t as readAppearance}from"./index-BXZp5ztx.js";var _sfc_main$3={__name:`Vibe64ColleagueLauncherTarget`,setup(__props){const target=inject(VIBE64_COLLEAGUE_LAUNCHER_KEY,null);const enabled=Boolean(target);let currentElement;function setTarget(element){if(element)target.value=element;else if(target.value===currentElement)target.value=null;currentElement=element}return(_ctx,_cache)=>{return unref(enabled)?(openBlock(),createElementBlock(`div`,{key:0,ref:setTarget,class:`vibe64-colleague-launcher-target`},null,512)):createCommentVNode(``,true)}}};var Vibe64ColleagueLauncherTarget_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-8e7b0e92`]]);var _sfc_main$2=Object.assign({inheritAttrs:false},{__name:`Vibe64LearningButton`,setup(__props){const learning=useVibe64Learning();const available=computed(()=>Boolean(learning.state.actorKey));const learn=computed(()=>learning.learnMode);const switching=computed(()=>learning.state.modeBusy===`set`);const title=computed(()=>learn.value?`Back to Develop (your projects)`:`Switch to Learn`);return(_ctx,_cache)=>{return available.value?(openBlock(),createBlock(VBtn,mergeProps({key:0},_ctx.$attrs,{class:[`vibe64-learning-button`,{"vibe64-learning-button--active":learn.value}],"aria-label":`Learn mode`,"aria-pressed":learn.value,title:title.value,"data-vibe64-guide":`learning`,density:`comfortable`,icon:``,size:`small`,disabled:switching.value,variant:learn.value?`flat`:`outlined`,onClick:_cache[0]||(_cache[0]=$event=>unref(learning).toggleMode())}),{default:withCtx(()=>[..._cache[1]||(_cache[1]=[createBaseVNode(`span`,{"aria-hidden":`true`},`L`,-1)])]),_:1},16,[`class`,`aria-pressed`,`title`,`disabled`,`variant`])):createCommentVNode(``,true)}}});var Vibe64LearningButton_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-8b4a54fb`]]);var _hoisted_1$1={class:`studio-app-shell-layout__top-right`};var SWIPE_MIN_DISTANCE_PX=64;var SWIPE_INTENT_DISTANCE_PX=12;var SWIPE_MAX_DURATION_MS=700;var SWIPE_HORIZONTAL_RATIO=2;var BROWSER_GESTURE_EDGE_PX=24;var _sfc_main$1={__name:`StudioAppShellLayout`,props:{mobilePaneSwipeEnabled:Boolean,chatCollapsed:Boolean,fillViewport:Boolean},emits:[`update:chatCollapsed`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;let paneSwipe=null;watch(()=>[props.mobilePaneSwipeEnabled,props.chatCollapsed],cancelPaneSwipe);function cancelPaneSwipe(){paneSwipe=null}function startPaneSwipe(event,header=false){cancelPaneSwipe();if(!props.mobilePaneSwipeEnabled||event.defaultPrevented||event.touches.length!==1||window.getSelection()?.isCollapsed===false)return;const target=event.target;if(target.closest(`
1
+ import{ct as useTheme,ht as useDisplay,mr as withModifiers,pr as withKeys}from"./VChip-BRhZ1px1.js";import{D as createVNode,E as createTextVNode,Ht as watch,J as inject,On as unref,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,et as mergeProps,g as computed,it as onBeforeUnmount,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,v as createBlock,vn as ref,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{n as VList,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{o as VIBE64_COLLEAGUE_LAUNCHER_KEY}from"./vibe64AssistantHost-CP6oxv5b.js";import{O as mdiAutoFix,Q as mdiClose,Wn as mdiMapMarkerPath,Zn as mdiMonitor,c as mdiAccountOutline,li as mdiWeatherNight,r as mdiAccountCogOutline,rn as mdiGithub,ui as mdiWeatherSunny,xr as mdiRobotOutline}from"./mdi-DwGK7nOu.js";import{i as VBtnToggle,t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{_ as useVibe64Accounts,c as aiOnboardingNeeded,d as AiSetup_default,g as ProviderAccountsSetup_default,l as onVibe64AiOnboardingRequested,n as accountRowsForStatus,o as aiOnboardingAvailable,r as AiOnboardingSetUpPill_default,s as aiOnboardingBlocked,u as requestVibe64AiOnboarding}from"./client-CBSWtYl4.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{O as useVibe64Learning,Q as VContainer,X as VTab,Y as VTabs,Z as VMain,h as _sfc_main$4,j as onVibe64AccountConnectionsDialogRequested,n as writeAppearance,nt as VAppBar,t as readAppearance}from"./index-CNkd6O5t.js";var _sfc_main$3={__name:`Vibe64ColleagueLauncherTarget`,setup(__props){const target=inject(VIBE64_COLLEAGUE_LAUNCHER_KEY,null);const enabled=Boolean(target);let currentElement;function setTarget(element){if(element)target.value=element;else if(target.value===currentElement)target.value=null;currentElement=element}return(_ctx,_cache)=>{return unref(enabled)?(openBlock(),createElementBlock(`div`,{key:0,ref:setTarget,class:`vibe64-colleague-launcher-target`},null,512)):createCommentVNode(``,true)}}};var Vibe64ColleagueLauncherTarget_default=_plugin_vue_export_helper_default(_sfc_main$3,[[`__scopeId`,`data-v-8e7b0e92`]]);var _sfc_main$2=Object.assign({inheritAttrs:false},{__name:`Vibe64LearningButton`,setup(__props){const learning=useVibe64Learning();const available=computed(()=>Boolean(learning.state.actorKey));const learn=computed(()=>learning.learnMode);const switching=computed(()=>learning.state.modeBusy===`set`);const title=computed(()=>learn.value?`Back to Develop (your projects)`:`Switch to Learn`);return(_ctx,_cache)=>{return available.value?(openBlock(),createBlock(VBtn,mergeProps({key:0},_ctx.$attrs,{class:[`vibe64-learning-button`,{"vibe64-learning-button--active":learn.value}],"aria-label":`Learn mode`,"aria-pressed":learn.value,title:title.value,"data-vibe64-guide":`learning`,density:`comfortable`,icon:``,size:`small`,disabled:switching.value,variant:learn.value?`flat`:`outlined`,onClick:_cache[0]||(_cache[0]=$event=>unref(learning).toggleMode())}),{default:withCtx(()=>[..._cache[1]||(_cache[1]=[createBaseVNode(`span`,{"aria-hidden":`true`},`L`,-1)])]),_:1},16,[`class`,`aria-pressed`,`title`,`disabled`,`variant`])):createCommentVNode(``,true)}}});var Vibe64LearningButton_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-8b4a54fb`]]);var _hoisted_1$1={class:`studio-app-shell-layout__top-right`};var SWIPE_MIN_DISTANCE_PX=64;var SWIPE_INTENT_DISTANCE_PX=12;var SWIPE_MAX_DURATION_MS=700;var SWIPE_HORIZONTAL_RATIO=2;var BROWSER_GESTURE_EDGE_PX=24;var _sfc_main$1={__name:`StudioAppShellLayout`,props:{mobilePaneSwipeEnabled:Boolean,chatCollapsed:Boolean,fillViewport:Boolean},emits:[`update:chatCollapsed`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;let paneSwipe=null;watch(()=>[props.mobilePaneSwipeEnabled,props.chatCollapsed],cancelPaneSwipe);function cancelPaneSwipe(){paneSwipe=null}function startPaneSwipe(event,header=false){cancelPaneSwipe();if(!props.mobilePaneSwipeEnabled||event.defaultPrevented||event.touches.length!==1||window.getSelection()?.isCollapsed===false)return;const target=event.target;if(target.closest(`
2
2
  input, textarea, select, [contenteditable]:not([contenteditable="false"]),
3
3
  [role="textbox"], [role="slider"], [role="separator"], [role="dialog"], [role="menu"],
4
4
  [draggable="true"], canvas, iframe, video, audio, .cm-editor, .xterm, [data-pane-swipe-ignore]
@@ -1 +1 @@
1
- import{D as createVNode,Lt as useSlots,On as unref,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,g as computed,gt as provide,it as onBeforeUnmount,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,v as createBlock,vn as ref,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{t as useEndpointResource}from"./useEndpointResource-BaT7yEQ5.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{t as VSelect}from"./VSelect-CFmsjLP4.js";import{n as VList,s as VListItem}from"./VMenu-BaCC4Of9.js";import{o as projectSlugFromRoute,r as projectAppPath}from"./vibe64ProjectScope.local-BbrorE15.js";import{r as scopedDevelopmentApiUrl}from"./studioUrls-BcpEogWH.js";import{t as VSheet}from"./VSheet-C1Vro_q8.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{h as _sfc_main$2,m as VIBE64_ACTIVE_SESSION_NAV_KEY}from"./index-BXZp5ztx.js";import{t as getPlacements}from"./placement-BCLIXgCD.js";function normalizeRoutePath(pathValue=``){const path=String(pathValue||``).trim();if(!path||path===`/`)return path||`/`;return path.replace(/\/+$/u,``)}function routePathContainsSection(routePathValue=``,sectionPathValue=``){const routePath=normalizeRoutePath(routePathValue);const sectionPath=normalizeRoutePath(sectionPathValue);return Boolean(sectionPath&&sectionPath!==`/`&&(routePath===sectionPath||routePath.startsWith(`${sectionPath}/`)))}var _hoisted_1$1={key:0,class:`section-container-shell__heading`};var _hoisted_2={key:0,class:`section-container-shell__title`};var _hoisted_3={key:1,class:`text-body-2 text-medium-emphasis mb-0`};var _hoisted_4={class:`section-container-shell__body`};var _hoisted_5=[`data-vibe64-guide-pane`];var _hoisted_6={class:`section-container-shell__content`};var MOBILE_SECTION_MEDIA_QUERY=`(max-width: 760px)`;var _sfc_main$1={__name:`SectionContainerShell`,props:{navigationCollapsed:{type:Boolean,default:false},navigationGuidePane:{type:String,default:``},title:{type:String,default:``},subtitle:{type:String,default:``},mobileSectionLinks:{type:Array,default:()=>[]}},setup(__props){const props=__props;const slots=useSlots();const route=useRoute();const router=useRouter();const mobileSectionLayout=ref(initialMobileSectionLayout());let mobileSectionMediaQuery=null;const resolvedTitle=computed(()=>String(props.title||``).trim());const resolvedSubtitle=computed(()=>String(props.subtitle||``).trim());const hasHeading=computed(()=>Boolean(resolvedTitle.value||resolvedSubtitle.value));const hasTabs=computed(()=>Boolean(slots.tabs));const mobileSectionLinks=computed(()=>{return props.mobileSectionLinks.map(link=>({disabled:link?.disabled===true,icon:String(link?.icon||``),id:String(link?.id||link?.to||link?.label||``),label:String(link?.label||``),to:normalizeRoutePath(link?.to||``)})).filter(link=>Boolean(link.id&&link.label&&link.to))});const mobileSectionsActive=computed(()=>Boolean(mobileSectionLayout.value&&mobileSectionLinks.value.length));const activeMobileSection=computed(()=>{return mobileSectionLinks.value.find(link=>routePathContainsSection(route.path||``,link.to))||null});const activeMobileSectionValue=computed(()=>activeMobileSection.value?.to||null);function initialMobileSectionLayout(){if(typeof window===`undefined`||typeof window.matchMedia!==`function`)return false;return window.matchMedia(MOBILE_SECTION_MEDIA_QUERY).matches}function syncMobileSectionLayout(){mobileSectionLayout.value=Boolean(mobileSectionMediaQuery?.matches)}function selectMobileSection(value=``){const targetPath=normalizeRoutePath(value||``);if(!targetPath||targetPath===activeMobileSectionValue.value)return;const targetLink=mobileSectionLinks.value.find(link=>link.to===targetPath);if(!targetLink||targetLink.disabled)return;router.push(targetLink.to)}onMounted(()=>{if(typeof window===`undefined`||typeof window.matchMedia!==`function`)return;mobileSectionMediaQuery=window.matchMedia(MOBILE_SECTION_MEDIA_QUERY);syncMobileSectionLayout();if(typeof mobileSectionMediaQuery.addEventListener===`function`)mobileSectionMediaQuery.addEventListener(`change`,syncMobileSectionLayout);else mobileSectionMediaQuery.addListener?.(syncMobileSectionLayout)});onBeforeUnmount(()=>{if(typeof mobileSectionMediaQuery?.removeEventListener===`function`)mobileSectionMediaQuery.removeEventListener(`change`,syncMobileSectionLayout);else mobileSectionMediaQuery?.removeListener?.(syncMobileSectionLayout);mobileSectionMediaQuery=null});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{class:normalizeClass([`section-container-shell`,{"section-container-shell--with-heading":hasHeading.value,"section-container-shell--collapsed":__props.navigationCollapsed}])},[hasHeading.value?(openBlock(),createElementBlock(`header`,_hoisted_1$1,[resolvedTitle.value?(openBlock(),createElementBlock(`h1`,_hoisted_2,toDisplayString(resolvedTitle.value),1)):createCommentVNode(``,true),resolvedSubtitle.value?(openBlock(),createElementBlock(`p`,_hoisted_3,toDisplayString(resolvedSubtitle.value),1)):createCommentVNode(``,true)])):createCommentVNode(``,true),createVNode(VSheet,{rounded:__props.navigationCollapsed?0:`xl`,border:!__props.navigationCollapsed,class:`section-container-shell__panel`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4,[mobileSectionsActive.value&&!__props.navigationCollapsed?(openBlock(),createBlock(VSelect,{key:0,class:`section-container-shell__mobile-select`,"data-vibe64-guide-pane":__props.navigationGuidePane||void 0,"model-value":activeMobileSectionValue.value,items:mobileSectionLinks.value,"item-title":`label`,"item-value":`to`,"item-props":item=>({disabled:item.disabled,prependIcon:item.icon||void 0}),"prepend-inner-icon":activeMobileSection.value?.icon||void 0,label:`Dashboard section`,rounded:`lg`,variant:`outlined`,"hide-details":``,"onUpdate:modelValue":selectMobileSection},null,8,[`data-vibe64-guide-pane`,`model-value`,`items`,`item-props`,`prepend-inner-icon`])):createCommentVNode(``,true),hasTabs.value&&!mobileSectionsActive.value&&!__props.navigationCollapsed?(openBlock(),createElementBlock(`nav`,{key:1,class:`section-container-shell__nav`,"data-vibe64-guide-pane":__props.navigationGuidePane||void 0,"aria-label":`Dashboard sections`},[createVNode(VList,{nav:``,"bg-color":`transparent`,density:`compact`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`tabs`,{},void 0,true)]),_:3})],8,_hoisted_5)):createCommentVNode(``,true),createBaseVNode(`main`,_hoisted_6,[renderSlot(_ctx.$slots,`default`,{},void 0,true)])])]),_:3},8,[`rounded`,`border`])],2)}}};var SectionContainerShell_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-25df3993`]]);function useVibe64DashboardPage({dashboardContext=null}={}){const route=useRoute();const projectSlug=computed(()=>projectSlugFromRoute(route));const projectBasePath=computed(()=>projectAppPath(projectSlug.value));return{dashboardSectionLinks:computed(()=>getPlacements().filter(placement=>placement?.kind===`link`&&placement?.owner===`app-dashboard`&&placement?.target===`page.section-nav`&&dashboardPlacementVisible(placement,dashboardContext)).sort((left,right)=>Number(left?.order||0)-Number(right?.order||0)).map(placement=>({disabled:placement?.props?.disabled===true,icon:placement?.props?.icon||``,id:placement?.id||``,label:placement?.props?.label||``,to:`${projectBasePath.value}${dashboardSectionSuffix(placement)}`})))}}function dashboardPlacementVisible(placement={},dashboardContext=null){const predicate=placement?.props?.visibleWhen;if(typeof predicate!==`function`)return true;const context=typeof dashboardContext===`function`?dashboardContext():dashboardContext?.value??dashboardContext;return predicate(context&&typeof context===`object`?context:{})===true}function activeSessionMobileSectionLinks(activeSessionNav=null){if(!activeSessionNav?.visible||!Array.isArray(activeSessionNav.tools))return[];return activeSessionNav.tools.map(tool=>({disabled:tool?.disabled===true,icon:String(tool?.icon||``),id:`active-session:${String(tool?.id||tool?.to||tool?.label||``)}`,label:String(tool?.label||``),to:String(tool?.to||``)})).filter(tool=>Boolean(tool.id!==`active-session:`&&tool.label&&tool.to))}function dashboardSectionSuffix(placement={}){const suffix=String(placement?.props?.scopedSuffix||placement?.props?.unscopedSuffix||``).trim();if(!suffix)return``;const projectRelativeSuffix=suffix.replace(/^\/+/u,``).replace(/^project\/\[slug\](?=\/|$)/u,``).replace(/^\[slug\](?=\/|$)/u,``).replace(/^\/+/u,``);return projectRelativeSuffix?`/${projectRelativeSuffix}`:``}var _hoisted_1={key:0,class:`vibe64-dashboard-nav-group-label`};var _sfc_main={__name:`Vibe64DashboardShell`,props:{dashboardContext:{default:()=>({}),type:Object},noProject:Boolean,section:{default:``,type:String}},emits:[`select`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const route=useRoute();const incomingPath=computed(()=>scopedDevelopmentApiUrl(`/api/vibe64/incoming`,projectSlugFromRoute(route)));const incomingQuery=computed(()=>({sessionId:props.dashboardContext.sessionId,state:`pending`,limit:1}));const incoming=useEndpointResource({path:incomingPath,readQuery:incomingQuery,queryKey:computed(()=>[`vibe64.incoming`,incomingPath.value,`badge`,incomingQuery.value]),enabled:computed(()=>props.dashboardContext.active!==false&&Boolean(props.dashboardContext.sessionId)&&props.dashboardContext.projectContext?.repositoryMode===`github`),queryOptions:{retry:false,staleTime:3e4,refetchInterval:6e4}});const incomingCount=computed(()=>incoming.loadError.value?null:incoming.data.value?.pendingCount??null);provide(`vibe64.incoming.pendingCount`,incomingCount);const githubBrowserOpen=computed(()=>/\/dashboard\/(issues|pull-requests)\/?$/u.test(route.path));const{dashboardSectionLinks}=useVibe64DashboardPage({dashboardContext:()=>props.dashboardContext});const activeSessionNav=computed(()=>{const nav=props.dashboardContext?.activeSessionNav||null;return nav&&typeof nav===`object`?nav:null});const mobileDashboardSectionLinks=computed(()=>props.noProject?[]:[...dashboardSectionLinks.value.map(link=>link.id===`vibe64.incoming.link`&&incomingCount.value>0?{...link,label:`${link.label} (${incomingCount.value})`}:link),...activeSessionMobileSectionLinks(activeSessionNav.value)]);provide(VIBE64_ACTIVE_SESSION_NAV_KEY,activeSessionNav);return(_ctx,_cache)=>{return openBlock(),createBlock(SectionContainerShell_default,{"mobile-section-links":mobileDashboardSectionLinks.value,"navigation-collapsed":githubBrowserOpen.value,"navigation-guide-pane":`dashboard`},{tabs:withCtx(()=>[unref(dashboardSectionLinks).length?(openBlock(),createElementBlock(`span`,_hoisted_1,`Project`)):createCommentVNode(``,true),__props.noProject?(openBlock(true),createElementBlock(Fragment,{key:1},renderList(unref(dashboardSectionLinks),(link,index)=>{return openBlock(),createBlock(VListItem,{key:link.id,active:link.id===__props.section||!__props.section&&index===0,"prepend-icon":link.icon||void 0,title:link.label,"data-dashboard-section":link.id,onClick:$event=>emit(`select`,link.id)},null,8,[`active`,`prepend-icon`,`title`,`data-dashboard-section`,`onClick`])}),128)):(openBlock(),createBlock(unref(_sfc_main$2),{key:2,target:`app-dashboard:primary-menu`,context:__props.dashboardContext},null,8,[`context`])),!__props.noProject?(openBlock(),createBlock(unref(_sfc_main$2),{key:3,target:`app-dashboard:active-session-menu`,context:{activeSessionNav:activeSessionNav.value||{}}},null,8,[`context`])):createCommentVNode(``,true)]),default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{},void 0,true)]),_:3},8,[`mobile-section-links`,`navigation-collapsed`])}}};var Vibe64DashboardShell_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-1c300fc7`]]);export{normalizeRoutePath as n,routePathContainsSection as r,Vibe64DashboardShell_default as t};
1
+ import{D as createVNode,Lt as useSlots,On as unref,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,g as computed,gt as provide,it as onBeforeUnmount,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,v as createBlock,vn as ref,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{t as useEndpointResource}from"./useEndpointResource-BaT7yEQ5.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{t as VSelect}from"./VSelect-CFmsjLP4.js";import{n as VList,s as VListItem}from"./VMenu-BaCC4Of9.js";import{o as projectSlugFromRoute,r as projectAppPath}from"./vibe64ProjectScope.local-BbrorE15.js";import{r as scopedDevelopmentApiUrl}from"./studioUrls-BcpEogWH.js";import{t as VSheet}from"./VSheet-C1Vro_q8.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{h as _sfc_main$2,m as VIBE64_ACTIVE_SESSION_NAV_KEY}from"./index-CNkd6O5t.js";import{t as getPlacements}from"./placement-BCLIXgCD.js";function normalizeRoutePath(pathValue=``){const path=String(pathValue||``).trim();if(!path||path===`/`)return path||`/`;return path.replace(/\/+$/u,``)}function routePathContainsSection(routePathValue=``,sectionPathValue=``){const routePath=normalizeRoutePath(routePathValue);const sectionPath=normalizeRoutePath(sectionPathValue);return Boolean(sectionPath&&sectionPath!==`/`&&(routePath===sectionPath||routePath.startsWith(`${sectionPath}/`)))}var _hoisted_1$1={key:0,class:`section-container-shell__heading`};var _hoisted_2={key:0,class:`section-container-shell__title`};var _hoisted_3={key:1,class:`text-body-2 text-medium-emphasis mb-0`};var _hoisted_4={class:`section-container-shell__body`};var _hoisted_5=[`data-vibe64-guide-pane`];var _hoisted_6={class:`section-container-shell__content`};var MOBILE_SECTION_MEDIA_QUERY=`(max-width: 760px)`;var _sfc_main$1={__name:`SectionContainerShell`,props:{navigationCollapsed:{type:Boolean,default:false},navigationGuidePane:{type:String,default:``},title:{type:String,default:``},subtitle:{type:String,default:``},mobileSectionLinks:{type:Array,default:()=>[]}},setup(__props){const props=__props;const slots=useSlots();const route=useRoute();const router=useRouter();const mobileSectionLayout=ref(initialMobileSectionLayout());let mobileSectionMediaQuery=null;const resolvedTitle=computed(()=>String(props.title||``).trim());const resolvedSubtitle=computed(()=>String(props.subtitle||``).trim());const hasHeading=computed(()=>Boolean(resolvedTitle.value||resolvedSubtitle.value));const hasTabs=computed(()=>Boolean(slots.tabs));const mobileSectionLinks=computed(()=>{return props.mobileSectionLinks.map(link=>({disabled:link?.disabled===true,icon:String(link?.icon||``),id:String(link?.id||link?.to||link?.label||``),label:String(link?.label||``),to:normalizeRoutePath(link?.to||``)})).filter(link=>Boolean(link.id&&link.label&&link.to))});const mobileSectionsActive=computed(()=>Boolean(mobileSectionLayout.value&&mobileSectionLinks.value.length));const activeMobileSection=computed(()=>{return mobileSectionLinks.value.find(link=>routePathContainsSection(route.path||``,link.to))||null});const activeMobileSectionValue=computed(()=>activeMobileSection.value?.to||null);function initialMobileSectionLayout(){if(typeof window===`undefined`||typeof window.matchMedia!==`function`)return false;return window.matchMedia(MOBILE_SECTION_MEDIA_QUERY).matches}function syncMobileSectionLayout(){mobileSectionLayout.value=Boolean(mobileSectionMediaQuery?.matches)}function selectMobileSection(value=``){const targetPath=normalizeRoutePath(value||``);if(!targetPath||targetPath===activeMobileSectionValue.value)return;const targetLink=mobileSectionLinks.value.find(link=>link.to===targetPath);if(!targetLink||targetLink.disabled)return;router.push(targetLink.to)}onMounted(()=>{if(typeof window===`undefined`||typeof window.matchMedia!==`function`)return;mobileSectionMediaQuery=window.matchMedia(MOBILE_SECTION_MEDIA_QUERY);syncMobileSectionLayout();if(typeof mobileSectionMediaQuery.addEventListener===`function`)mobileSectionMediaQuery.addEventListener(`change`,syncMobileSectionLayout);else mobileSectionMediaQuery.addListener?.(syncMobileSectionLayout)});onBeforeUnmount(()=>{if(typeof mobileSectionMediaQuery?.removeEventListener===`function`)mobileSectionMediaQuery.removeEventListener(`change`,syncMobileSectionLayout);else mobileSectionMediaQuery?.removeListener?.(syncMobileSectionLayout);mobileSectionMediaQuery=null});return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,{class:normalizeClass([`section-container-shell`,{"section-container-shell--with-heading":hasHeading.value,"section-container-shell--collapsed":__props.navigationCollapsed}])},[hasHeading.value?(openBlock(),createElementBlock(`header`,_hoisted_1$1,[resolvedTitle.value?(openBlock(),createElementBlock(`h1`,_hoisted_2,toDisplayString(resolvedTitle.value),1)):createCommentVNode(``,true),resolvedSubtitle.value?(openBlock(),createElementBlock(`p`,_hoisted_3,toDisplayString(resolvedSubtitle.value),1)):createCommentVNode(``,true)])):createCommentVNode(``,true),createVNode(VSheet,{rounded:__props.navigationCollapsed?0:`xl`,border:!__props.navigationCollapsed,class:`section-container-shell__panel`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_4,[mobileSectionsActive.value&&!__props.navigationCollapsed?(openBlock(),createBlock(VSelect,{key:0,class:`section-container-shell__mobile-select`,"data-vibe64-guide-pane":__props.navigationGuidePane||void 0,"model-value":activeMobileSectionValue.value,items:mobileSectionLinks.value,"item-title":`label`,"item-value":`to`,"item-props":item=>({disabled:item.disabled,prependIcon:item.icon||void 0}),"prepend-inner-icon":activeMobileSection.value?.icon||void 0,label:`Dashboard section`,rounded:`lg`,variant:`outlined`,"hide-details":``,"onUpdate:modelValue":selectMobileSection},null,8,[`data-vibe64-guide-pane`,`model-value`,`items`,`item-props`,`prepend-inner-icon`])):createCommentVNode(``,true),hasTabs.value&&!mobileSectionsActive.value&&!__props.navigationCollapsed?(openBlock(),createElementBlock(`nav`,{key:1,class:`section-container-shell__nav`,"data-vibe64-guide-pane":__props.navigationGuidePane||void 0,"aria-label":`Dashboard sections`},[createVNode(VList,{nav:``,"bg-color":`transparent`,density:`compact`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`tabs`,{},void 0,true)]),_:3})],8,_hoisted_5)):createCommentVNode(``,true),createBaseVNode(`main`,_hoisted_6,[renderSlot(_ctx.$slots,`default`,{},void 0,true)])])]),_:3},8,[`rounded`,`border`])],2)}}};var SectionContainerShell_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-25df3993`]]);function useVibe64DashboardPage({dashboardContext=null}={}){const route=useRoute();const projectSlug=computed(()=>projectSlugFromRoute(route));const projectBasePath=computed(()=>projectAppPath(projectSlug.value));return{dashboardSectionLinks:computed(()=>getPlacements().filter(placement=>placement?.kind===`link`&&placement?.owner===`app-dashboard`&&placement?.target===`page.section-nav`&&dashboardPlacementVisible(placement,dashboardContext)).sort((left,right)=>Number(left?.order||0)-Number(right?.order||0)).map(placement=>({disabled:placement?.props?.disabled===true,icon:placement?.props?.icon||``,id:placement?.id||``,label:placement?.props?.label||``,to:`${projectBasePath.value}${dashboardSectionSuffix(placement)}`})))}}function dashboardPlacementVisible(placement={},dashboardContext=null){const predicate=placement?.props?.visibleWhen;if(typeof predicate!==`function`)return true;const context=typeof dashboardContext===`function`?dashboardContext():dashboardContext?.value??dashboardContext;return predicate(context&&typeof context===`object`?context:{})===true}function activeSessionMobileSectionLinks(activeSessionNav=null){if(!activeSessionNav?.visible||!Array.isArray(activeSessionNav.tools))return[];return activeSessionNav.tools.map(tool=>({disabled:tool?.disabled===true,icon:String(tool?.icon||``),id:`active-session:${String(tool?.id||tool?.to||tool?.label||``)}`,label:String(tool?.label||``),to:String(tool?.to||``)})).filter(tool=>Boolean(tool.id!==`active-session:`&&tool.label&&tool.to))}function dashboardSectionSuffix(placement={}){const suffix=String(placement?.props?.scopedSuffix||placement?.props?.unscopedSuffix||``).trim();if(!suffix)return``;const projectRelativeSuffix=suffix.replace(/^\/+/u,``).replace(/^project\/\[slug\](?=\/|$)/u,``).replace(/^\[slug\](?=\/|$)/u,``).replace(/^\/+/u,``);return projectRelativeSuffix?`/${projectRelativeSuffix}`:``}var _hoisted_1={key:0,class:`vibe64-dashboard-nav-group-label`};var _sfc_main={__name:`Vibe64DashboardShell`,props:{dashboardContext:{default:()=>({}),type:Object},noProject:Boolean,section:{default:``,type:String}},emits:[`select`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const route=useRoute();const incomingPath=computed(()=>scopedDevelopmentApiUrl(`/api/vibe64/incoming`,projectSlugFromRoute(route)));const incomingQuery=computed(()=>({sessionId:props.dashboardContext.sessionId,state:`pending`,limit:1}));const incoming=useEndpointResource({path:incomingPath,readQuery:incomingQuery,queryKey:computed(()=>[`vibe64.incoming`,incomingPath.value,`badge`,incomingQuery.value]),enabled:computed(()=>props.dashboardContext.active!==false&&Boolean(props.dashboardContext.sessionId)&&props.dashboardContext.projectContext?.repositoryMode===`github`),queryOptions:{retry:false,staleTime:3e4,refetchInterval:6e4}});const incomingCount=computed(()=>incoming.loadError.value?null:incoming.data.value?.pendingCount??null);provide(`vibe64.incoming.pendingCount`,incomingCount);const githubBrowserOpen=computed(()=>/\/dashboard\/(issues|pull-requests)\/?$/u.test(route.path));const{dashboardSectionLinks}=useVibe64DashboardPage({dashboardContext:()=>props.dashboardContext});const activeSessionNav=computed(()=>{const nav=props.dashboardContext?.activeSessionNav||null;return nav&&typeof nav===`object`?nav:null});const mobileDashboardSectionLinks=computed(()=>props.noProject?[]:[...dashboardSectionLinks.value.map(link=>link.id===`vibe64.incoming.link`&&incomingCount.value>0?{...link,label:`${link.label} (${incomingCount.value})`}:link),...activeSessionMobileSectionLinks(activeSessionNav.value)]);provide(VIBE64_ACTIVE_SESSION_NAV_KEY,activeSessionNav);return(_ctx,_cache)=>{return openBlock(),createBlock(SectionContainerShell_default,{"mobile-section-links":mobileDashboardSectionLinks.value,"navigation-collapsed":githubBrowserOpen.value,"navigation-guide-pane":`dashboard`},{tabs:withCtx(()=>[unref(dashboardSectionLinks).length?(openBlock(),createElementBlock(`span`,_hoisted_1,`Project`)):createCommentVNode(``,true),__props.noProject?(openBlock(true),createElementBlock(Fragment,{key:1},renderList(unref(dashboardSectionLinks),(link,index)=>{return openBlock(),createBlock(VListItem,{key:link.id,active:link.id===__props.section||!__props.section&&index===0,"prepend-icon":link.icon||void 0,title:link.label,"data-dashboard-section":link.id,onClick:$event=>emit(`select`,link.id)},null,8,[`active`,`prepend-icon`,`title`,`data-dashboard-section`,`onClick`])}),128)):(openBlock(),createBlock(unref(_sfc_main$2),{key:2,target:`app-dashboard:primary-menu`,context:__props.dashboardContext},null,8,[`context`])),!__props.noProject?(openBlock(),createBlock(unref(_sfc_main$2),{key:3,target:`app-dashboard:active-session-menu`,context:{activeSessionNav:activeSessionNav.value||{}}},null,8,[`context`])):createCommentVNode(``,true)]),default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{},void 0,true)]),_:3},8,[`mobile-section-links`,`navigation-collapsed`])}}};var Vibe64DashboardShell_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-1c300fc7`]]);export{normalizeRoutePath as n,routePathContainsSection as r,Vibe64DashboardShell_default as t};
@@ -1,4 +1,4 @@
1
- import{fr as vShow,mr as withModifiers,pr as withKeys,t as VChip,x as VIcon}from"./VChip-BRhZ1px1.js";import{$ as mergeModels,$n as normalizeProps,Cn as toRaw,D as createVNode,E as createTextVNode,Ft as useModel,Ht as watch,J as inject,Lt as useSlots,Nt as useAttrs,On as unref,Ut as watchEffect,Yt as withDirectives,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,er as normalizeStyle,et as mergeProps,fn as markRaw,g as computed,gn as reactive,gt as provide,it as onBeforeUnmount,k as defineComponent,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,u as Teleport,un as isRef,v as createBlock,vn as ref,wn as toRef,wt as resolveDynamicComponent,xn as shallowRef,xt as renderSlot,y as createCommentVNode,z as guardReactiveProps}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{t as VSelect}from"./VSelect-CFmsjLP4.js";import{n as VList,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{i as VIBE64_COLLEAGUE_DATABASE_KEY}from"./vibe64AssistantHost-CP6oxv5b.js";import{t as AppError}from"./errors-4Oktlo2s.js";import{C as mdiArrowLeft,Ct as mdiDatabaseOutline,G as mdiChevronRight,Gr as mdiTable,Hn as mdiMagnify,Hr as mdiStop,In as mdiLinkVariant,K as mdiChevronUp,Kr as mdiTableEye,Kt as mdiFilterPlusOutline,M as mdiBookmarkPlusOutline,Q as mdiClose,St as mdiDatabaseAlertOutline,U as mdiChevronDown,V as mdiCheckCircleOutline,W as mdiChevronLeft,_n as mdiKeyVariant,_t as mdiCreationOutline,ar as mdiPin,cn as mdiHistory,ei as mdiTuneVariant,f as mdiAlertCircleOutline,fn as mdiImageFilterCenterFocus,gr as mdiRefresh,hn as mdiInformationOutline,in as mdiGraphOutline,ir as mdiPencilOutline,it as mdiCodeTags,j as mdiBookmarkOutline,lr as mdiPlus,mr as mdiRedo,nn as mdiFullscreenExit,or as mdiPinOutline,qr as mdiTableSearch,sr as mdiPlay,ti as mdiUndo,tn as mdiFullscreen,wt as mdiDeleteOutline,yr as mdiRestore}from"./mdi-DwGK7nOu.js";import{i as VBtnToggle,t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VAutocomplete}from"./VAutocomplete-WEsn78My.js";import{t as VCheckbox}from"./VCheckbox-Bybg_FNE.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VSheet}from"./VSheet-C1Vro_q8.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{n as VRadio,t as VRadioGroup}from"./VRadioGroup-C021gapy.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-DFBUIKJZ.js";import{t as VSwitch}from"./VSwitch-fUpmdN4R.js";import{t as VTextarea}from"./VTextarea-CFF7cmcU.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{s as AssistantConversationElement_default}from"./conversation-DV8qCsqw.js";import{l as vibe64AssistantSelectionLabel}from"./shared-MIKdzAzL.js";import{t as useUiFeedback}from"./useUiFeedback-CZj76aLa.js";import{r as useVibe64DatabaseTools}from"./useVibe64DatabaseTools-BWZjnV6r.js";import{P as useAssistantConversation}from"./index-BXZp5ztx.js";import{n as defaultTableQuery,t as SQL_QUOTING}from"./sqlQuoting-BingbgQf.js";import{B as tags,C as continuedIndent,G as drawSelection,H as EditorView,I as syntaxHighlighting,L as syntaxTree,Q as lineNumbers,Y as highlightActiveLine,Z as keymap,c as completeFromList,f as ExternalTokenizer,h as LRLanguage,j as indentNodeProp,k as foldNodeProp,l as ifNotIn,n as history,p as LRParser,r as historyKeymap,st as EditorState,t as defaultKeymap,v as LanguageSupport,w as defaultHighlightStyle,x as bracketMatching,z as styleTags}from"./dist-CDa9Iec1.js";import{a as _sfc_main$d,c as getBoundsofRects,d as getSmoothStepPath,f as isMacOs,i as _sfc_main$1$2,l as getConnectedEdges,m as wheelDelta,n as Position,o as _sfc_main$e,p as useVueFlow,r as _sfc_main$15,s as _sfc_main$f,t as MarkerType,u as getRectOfNodes}from"./vue-flow-core-BlVEnES8.js";function useDatabaseCopilot({activeView,assistantCommand,assistantEndpoint,diagramSelections,queryResult,rememberSelectedTableState,schema,selectedTableName,sessionId,state}){const assistantConfigured=computed(()=>Boolean(state.value?.assistant?.available));const assistantStatusLabel=computed(()=>{const assistant=state.value?.assistant;if(!assistantConfigured.value)return`Unavailable`;return vibe64AssistantSelectionLabel({engineId:assistant.engineId,modelId:assistant.model,variantId:assistant.variantId})});const assistantUnavailableCopy=computed(()=>{return state.value?.assistant?.message||`Ask the owner to choose an Explain & check model in Models. Database browsing and editing work without AI.`});const assistantTableName=computed(()=>{const name=activeView.value===`data`?selectedTableName.value:diagramSelections[activeView.value];return schema.value.tables.some(table=>table.qualifiedName===name)?name:``});const assistantBinding=useAssistantConversation({boundedTask:{command:assistantCommand,endpoint:assistantEndpoint,scope:sessionId,input:messages=>({messages:messages.map(({content:text,role,table})=>({content:text,role,table}))}),result:result=>({content:result.answer,intent:result.intent,role:`assistant`,sql:result.sql}),onResult(result,{message:{table}}){const lastQuery=result.queries?.at(-1)?.result;if(lastQuery&&activeView.value===`data`&&table===selectedTableName.value){queryResult.value=lastQuery;rememberSelectedTableState()}}},active:assistantConfigured,data:()=>({table:assistantTableName.value}),presentation:computed(()=>({assistantLabel:`Copilot`,visible:true,variant:`task`,submitOnEnter:false,submitOnModifierEnter:true,placeholder:assistantTableName.value?`Ask about this table…`:`Ask about this database…`,ariaLabel:`Message database copilot`,submitAriaLabel:`Ask database copilot`}))});return{assistantAdapter:assistantBinding.adapter,assistantBinding,assistantConfigured,assistantStatusLabel,assistantTableName,assistantUnavailableCopy}}function useDatabaseDiagramLayout({active,saveLayout,sessionId,state}){const erdLayout=ref({nodes:[]});const diagramSavesPending=ref(0);let disposed=false;let diagramSaveQueue=Promise.resolve();let diagramSaveRevision=0;watch([()=>state.value?.layout,active,diagramSavesPending],([layout,isActive,pending])=>{if(isActive&&!pending&&layout&&layout.revision>(erdLayout.value.revision||0))erdLayout.value=layout},{immediate:true});onBeforeUnmount(()=>{disposed=true});function saveDiagramLayout(layout){const savedSessionId=sessionId();const revision=++diagramSaveRevision;const previousLayout=erdLayout.value;const pending=JSON.parse(JSON.stringify(layout));pending.revision=previousLayout.revision||0;diagramSavesPending.value+=1;erdLayout.value=pending;diagramSaveQueue=diagramSaveQueue.catch(()=>null).then(async()=>{try{if(disposed||sessionId()!==savedSessionId)return;const result=await saveLayout(pending);if(!disposed&&sessionId()===savedSessionId&&revision===diagramSaveRevision)erdLayout.value=result?.layout||previousLayout}catch{if(!disposed&&sessionId()===savedSessionId&&revision===diagramSaveRevision)erdLayout.value=previousLayout}finally{diagramSavesPending.value-=1}});return diagramSaveQueue}return{erdLayout,saveDiagramLayout}}var whitespace=36;var LineComment=1;var BlockComment=2;var String$1=3;var Number$1=4;var Bool=5;var Null=6;var ParenL=7;var ParenR=8;var BraceL=9;var BraceR=10;var BracketL=11;var BracketR=12;var Semi=13;var Dot=14;var Operator=15;var Punctuation=16;var SpecialVar=17;var Identifier=18;var QuotedIdentifier=19;var Keyword=20;var Type=21;var Bits=22;var Bytes=23;var Builtin=24;function isAlpha(ch){return ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57}function isHexDigit(ch){return ch>=48&&ch<=57||ch>=97&&ch<=102||ch>=65&&ch<=70}function readLiteral(input,endQuote,backslashEscapes){for(let escaped=false;;){if(input.next<0)return;if(input.next==endQuote&&!escaped){input.advance();return}escaped=backslashEscapes&&!escaped&&input.next==92;input.advance()}}function readDoubleDollarLiteral(input,tag){scan:for(;;){if(input.next<0)return;if(input.next==36){input.advance();for(let i=0;i<tag.length;i++){if(input.next!=tag.charCodeAt(i))continue scan;input.advance()}if(input.next==36){input.advance();return}}else input.advance()}}function readPLSQLQuotedLiteral(input,openDelim){let matchingDelim=`[{<(`.indexOf(String.fromCharCode(openDelim));let closeDelim=matchingDelim<0?openDelim:`]}>)`.charCodeAt(matchingDelim);for(;;){if(input.next<0)return;if(input.next==closeDelim&&input.peek(1)==39){input.advance(2);return}input.advance()}}function readWord(input,result){for(;;){if(input.next!=95&&!isAlpha(input.next))break;if(result!=null)result+=String.fromCharCode(input.next);input.advance()}return result}function readWordOrQuoted(input){if(input.next==39||input.next==34||input.next==96){let quote=input.next;input.advance();readLiteral(input,quote,false)}else readWord(input)}function readBits(input,endQuote){while(input.next==48||input.next==49)input.advance();if(endQuote&&input.next==endQuote)input.advance()}function readNumber(input,sawDot){for(;;){if(input.next==46){if(sawDot)break;sawDot=true}else if(input.next<48||input.next>57)break;input.advance()}if(input.next==69||input.next==101){input.advance();if(input.next==43||input.next==45)input.advance();while(input.next>=48&&input.next<=57)input.advance()}}function eol(input){while(!(input.next<0||input.next==10))input.advance()}function inString(ch,str){for(let i=0;i<str.length;i++)if(str.charCodeAt(i)==ch)return true;return false}var Space=` \r
1
+ import{fr as vShow,mr as withModifiers,pr as withKeys,t as VChip,x as VIcon}from"./VChip-BRhZ1px1.js";import{$ as mergeModels,$n as normalizeProps,Cn as toRaw,D as createVNode,E as createTextVNode,Ft as useModel,Ht as watch,J as inject,Lt as useSlots,Nt as useAttrs,On as unref,Ut as watchEffect,Yt as withDirectives,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,ct as onMounted,er as normalizeStyle,et as mergeProps,fn as markRaw,g as computed,gn as reactive,gt as provide,it as onBeforeUnmount,k as defineComponent,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,u as Teleport,un as isRef,v as createBlock,vn as ref,wn as toRef,wt as resolveDynamicComponent,xn as shallowRef,xt as renderSlot,y as createCommentVNode,z as guardReactiveProps}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{t as VSelect}from"./VSelect-CFmsjLP4.js";import{n as VList,s as VListItem,t as VMenu}from"./VMenu-BaCC4Of9.js";import{t as VTextField}from"./VTextField-Dmm1M-tz.js";import{i as VIBE64_COLLEAGUE_DATABASE_KEY}from"./vibe64AssistantHost-CP6oxv5b.js";import{t as AppError}from"./errors-4Oktlo2s.js";import{C as mdiArrowLeft,Ct as mdiDatabaseOutline,G as mdiChevronRight,Gr as mdiTable,Hn as mdiMagnify,Hr as mdiStop,In as mdiLinkVariant,K as mdiChevronUp,Kr as mdiTableEye,Kt as mdiFilterPlusOutline,M as mdiBookmarkPlusOutline,Q as mdiClose,St as mdiDatabaseAlertOutline,U as mdiChevronDown,V as mdiCheckCircleOutline,W as mdiChevronLeft,_n as mdiKeyVariant,_t as mdiCreationOutline,ar as mdiPin,cn as mdiHistory,ei as mdiTuneVariant,f as mdiAlertCircleOutline,fn as mdiImageFilterCenterFocus,gr as mdiRefresh,hn as mdiInformationOutline,in as mdiGraphOutline,ir as mdiPencilOutline,it as mdiCodeTags,j as mdiBookmarkOutline,lr as mdiPlus,mr as mdiRedo,nn as mdiFullscreenExit,or as mdiPinOutline,qr as mdiTableSearch,sr as mdiPlay,ti as mdiUndo,tn as mdiFullscreen,wt as mdiDeleteOutline,yr as mdiRestore}from"./mdi-DwGK7nOu.js";import{i as VBtnToggle,t as VBtn}from"./VBtn-B6ryRXW-.js";import{t as VAlert}from"./VAlert-CBpSKTfy.js";import{t as VAutocomplete}from"./VAutocomplete-WEsn78My.js";import{t as VCheckbox}from"./VCheckbox-Bybg_FNE.js";import{t as VDivider}from"./VDivider-DY2s_j83.js";import{t as VSheet}from"./VSheet-C1Vro_q8.js";import{t as VDialog}from"./VDialog-CYfdjZRu.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-BzaViLPx.js";import{t as VSpacer}from"./VSpacer-B5ip6FSG.js";import{n as VRadio,t as VRadioGroup}from"./VRadioGroup-C021gapy.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-DFBUIKJZ.js";import{t as VSwitch}from"./VSwitch-fUpmdN4R.js";import{t as VTextarea}from"./VTextarea-CFF7cmcU.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{s as AssistantConversationElement_default}from"./conversation-B1UoWMaA.js";import{l as vibe64AssistantSelectionLabel}from"./shared-MIKdzAzL.js";import{t as useUiFeedback}from"./useUiFeedback-CZj76aLa.js";import{r as useVibe64DatabaseTools}from"./useVibe64DatabaseTools-BWZjnV6r.js";import{P as useAssistantConversation}from"./index-CNkd6O5t.js";import{n as defaultTableQuery,t as SQL_QUOTING}from"./sqlQuoting-BingbgQf.js";import{B as tags,C as continuedIndent,G as drawSelection,H as EditorView,I as syntaxHighlighting,L as syntaxTree,Q as lineNumbers,Y as highlightActiveLine,Z as keymap,c as completeFromList,f as ExternalTokenizer,h as LRLanguage,j as indentNodeProp,k as foldNodeProp,l as ifNotIn,n as history,p as LRParser,r as historyKeymap,st as EditorState,t as defaultKeymap,v as LanguageSupport,w as defaultHighlightStyle,x as bracketMatching,z as styleTags}from"./dist-CDa9Iec1.js";import{a as _sfc_main$d,c as getBoundsofRects,d as getSmoothStepPath,f as isMacOs,i as _sfc_main$1$2,l as getConnectedEdges,m as wheelDelta,n as Position,o as _sfc_main$e,p as useVueFlow,r as _sfc_main$15,s as _sfc_main$f,t as MarkerType,u as getRectOfNodes}from"./vue-flow-core-BlVEnES8.js";function useDatabaseCopilot({activeView,assistantCommand,assistantEndpoint,diagramSelections,queryResult,rememberSelectedTableState,schema,selectedTableName,sessionId,state}){const assistantConfigured=computed(()=>Boolean(state.value?.assistant?.available));const assistantStatusLabel=computed(()=>{const assistant=state.value?.assistant;if(!assistantConfigured.value)return`Unavailable`;return vibe64AssistantSelectionLabel({engineId:assistant.engineId,modelId:assistant.model,variantId:assistant.variantId})});const assistantUnavailableCopy=computed(()=>{return state.value?.assistant?.message||`Ask the owner to choose an Explain & check model in Models. Database browsing and editing work without AI.`});const assistantTableName=computed(()=>{const name=activeView.value===`data`?selectedTableName.value:diagramSelections[activeView.value];return schema.value.tables.some(table=>table.qualifiedName===name)?name:``});const assistantBinding=useAssistantConversation({boundedTask:{command:assistantCommand,endpoint:assistantEndpoint,scope:sessionId,input:messages=>({messages:messages.map(({content:text,role,table})=>({content:text,role,table}))}),result:result=>({content:result.answer,intent:result.intent,role:`assistant`,sql:result.sql}),onResult(result,{message:{table}}){const lastQuery=result.queries?.at(-1)?.result;if(lastQuery&&activeView.value===`data`&&table===selectedTableName.value){queryResult.value=lastQuery;rememberSelectedTableState()}}},active:assistantConfigured,data:()=>({table:assistantTableName.value}),presentation:computed(()=>({assistantLabel:`Copilot`,visible:true,variant:`task`,submitOnEnter:false,submitOnModifierEnter:true,placeholder:assistantTableName.value?`Ask about this table…`:`Ask about this database…`,ariaLabel:`Message database copilot`,submitAriaLabel:`Ask database copilot`}))});return{assistantAdapter:assistantBinding.adapter,assistantBinding,assistantConfigured,assistantStatusLabel,assistantTableName,assistantUnavailableCopy}}function useDatabaseDiagramLayout({active,saveLayout,sessionId,state}){const erdLayout=ref({nodes:[]});const diagramSavesPending=ref(0);let disposed=false;let diagramSaveQueue=Promise.resolve();let diagramSaveRevision=0;watch([()=>state.value?.layout,active,diagramSavesPending],([layout,isActive,pending])=>{if(isActive&&!pending&&layout&&layout.revision>(erdLayout.value.revision||0))erdLayout.value=layout},{immediate:true});onBeforeUnmount(()=>{disposed=true});function saveDiagramLayout(layout){const savedSessionId=sessionId();const revision=++diagramSaveRevision;const previousLayout=erdLayout.value;const pending=JSON.parse(JSON.stringify(layout));pending.revision=previousLayout.revision||0;diagramSavesPending.value+=1;erdLayout.value=pending;diagramSaveQueue=diagramSaveQueue.catch(()=>null).then(async()=>{try{if(disposed||sessionId()!==savedSessionId)return;const result=await saveLayout(pending);if(!disposed&&sessionId()===savedSessionId&&revision===diagramSaveRevision)erdLayout.value=result?.layout||previousLayout}catch{if(!disposed&&sessionId()===savedSessionId&&revision===diagramSaveRevision)erdLayout.value=previousLayout}finally{diagramSavesPending.value-=1}});return diagramSaveQueue}return{erdLayout,saveDiagramLayout}}var whitespace=36;var LineComment=1;var BlockComment=2;var String$1=3;var Number$1=4;var Bool=5;var Null=6;var ParenL=7;var ParenR=8;var BraceL=9;var BraceR=10;var BracketL=11;var BracketR=12;var Semi=13;var Dot=14;var Operator=15;var Punctuation=16;var SpecialVar=17;var Identifier=18;var QuotedIdentifier=19;var Keyword=20;var Type=21;var Bits=22;var Bytes=23;var Builtin=24;function isAlpha(ch){return ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57}function isHexDigit(ch){return ch>=48&&ch<=57||ch>=97&&ch<=102||ch>=65&&ch<=70}function readLiteral(input,endQuote,backslashEscapes){for(let escaped=false;;){if(input.next<0)return;if(input.next==endQuote&&!escaped){input.advance();return}escaped=backslashEscapes&&!escaped&&input.next==92;input.advance()}}function readDoubleDollarLiteral(input,tag){scan:for(;;){if(input.next<0)return;if(input.next==36){input.advance();for(let i=0;i<tag.length;i++){if(input.next!=tag.charCodeAt(i))continue scan;input.advance()}if(input.next==36){input.advance();return}}else input.advance()}}function readPLSQLQuotedLiteral(input,openDelim){let matchingDelim=`[{<(`.indexOf(String.fromCharCode(openDelim));let closeDelim=matchingDelim<0?openDelim:`]}>)`.charCodeAt(matchingDelim);for(;;){if(input.next<0)return;if(input.next==closeDelim&&input.peek(1)==39){input.advance(2);return}input.advance()}}function readWord(input,result){for(;;){if(input.next!=95&&!isAlpha(input.next))break;if(result!=null)result+=String.fromCharCode(input.next);input.advance()}return result}function readWordOrQuoted(input){if(input.next==39||input.next==34||input.next==96){let quote=input.next;input.advance();readLiteral(input,quote,false)}else readWord(input)}function readBits(input,endQuote){while(input.next==48||input.next==49)input.advance();if(endQuote&&input.next==endQuote)input.advance()}function readNumber(input,sawDot){for(;;){if(input.next==46){if(sawDot)break;sawDot=true}else if(input.next<48||input.next>57)break;input.advance()}if(input.next==69||input.next==101){input.advance();if(input.next==43||input.next==45)input.advance();while(input.next>=48&&input.next<=57)input.advance()}}function eol(input){while(!(input.next<0||input.next==10))input.advance()}function inString(ch,str){for(let i=0;i<str.length;i++)if(str.charCodeAt(i)==ch)return true;return false}var Space=` \r
2
2
  `;function keywords(keywords,types,builtin){let result=Object.create(null);result[`true`]=result[`false`]=Bool;result[`null`]=result[`unknown`]=Null;for(let kw of keywords.split(` `))if(kw)result[kw]=Keyword;for(let tp of types.split(` `))if(tp)result[tp]=Type;for(let kw of(builtin||``).split(` `))if(kw)result[kw]=Builtin;return result}var SQLTypes=`array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying `;var SQLKeywords=`absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone `;var defaults={backslashEscapes:false,hashComments:false,spaceAfterDashes:false,slashComments:false,doubleQuotedStrings:false,doubleDollarQuotedStrings:false,unquotedBitLiterals:false,treatBitsAsBytes:false,charSetCasts:false,plsqlQuotingMechanism:false,operatorChars:`*+-%<>!=&|~^/`,specialVar:`?`,identifierQuotes:`"`,caseInsensitiveIdentifiers:false,words:keywords(SQLKeywords,SQLTypes)};function dialect(spec,kws,types,builtin){let dialect={};for(let prop in defaults)dialect[prop]=(spec.hasOwnProperty(prop)?spec:defaults)[prop];if(kws)dialect.words=keywords(kws,types||``,builtin);return dialect}function tokensFor(d){return new ExternalTokenizer(input=>{var _a;let{next}=input;input.advance();if(inString(next,Space)){while(inString(input.next,Space))input.advance();input.acceptToken(whitespace)}else if(next==36&&d.doubleDollarQuotedStrings){let tag=readWord(input,``);if(input.next==36){input.advance();readDoubleDollarLiteral(input,tag);input.acceptToken(String$1)}}else if(next==39||next==34&&d.doubleQuotedStrings){readLiteral(input,next,d.backslashEscapes);input.acceptToken(String$1)}else if(next==35&&d.hashComments||next==47&&input.next==47&&d.slashComments){eol(input);input.acceptToken(LineComment)}else if(next==45&&input.next==45&&(!d.spaceAfterDashes||input.peek(1)==32)){eol(input);input.acceptToken(LineComment)}else if(next==47&&input.next==42){input.advance();for(let depth=1;;){let cur=input.next;if(input.next<0)break;input.advance();if(cur==42&&input.next==47){depth--;input.advance();if(!depth)break}else if(cur==47&&input.next==42){depth++;input.advance()}}input.acceptToken(BlockComment)}else if((next==101||next==69)&&input.next==39){input.advance();readLiteral(input,39,true);input.acceptToken(String$1)}else if((next==110||next==78)&&input.next==39&&d.charSetCasts){input.advance();readLiteral(input,39,d.backslashEscapes);input.acceptToken(String$1)}else if(next==95&&d.charSetCasts)for(let i=0;;i++){if(input.next==39&&i>1){input.advance();readLiteral(input,39,d.backslashEscapes);input.acceptToken(String$1);break}if(!isAlpha(input.next))break;input.advance()}else if(d.plsqlQuotingMechanism&&(next==113||next==81)&&input.next==39&&input.peek(1)>0&&!inString(input.peek(1),Space)){let openDelim=input.peek(1);input.advance(2);readPLSQLQuotedLiteral(input,openDelim);input.acceptToken(String$1)}else if(inString(next,d.identifierQuotes)){readLiteral(input,next==91?93:next,false);input.acceptToken(QuotedIdentifier)}else if(next==40)input.acceptToken(ParenL);else if(next==41)input.acceptToken(ParenR);else if(next==123)input.acceptToken(BraceL);else if(next==125)input.acceptToken(BraceR);else if(next==91)input.acceptToken(BracketL);else if(next==93)input.acceptToken(BracketR);else if(next==59)input.acceptToken(Semi);else if(d.unquotedBitLiterals&&next==48&&input.next==98){input.advance();readBits(input);input.acceptToken(Bits)}else if((next==98||next==66)&&(input.next==39||input.next==34)){const quoteStyle=input.next;input.advance();if(d.treatBitsAsBytes){readLiteral(input,quoteStyle,d.backslashEscapes);input.acceptToken(Bytes)}else{readBits(input,quoteStyle);input.acceptToken(Bits)}}else if(next==48&&(input.next==120||input.next==88)||(next==120||next==88)&&input.next==39){let quoted=input.next==39;input.advance();while(isHexDigit(input.next))input.advance();if(quoted&&input.next==39)input.advance();input.acceptToken(Number$1)}else if(next==46&&input.next>=48&&input.next<=57){readNumber(input,true);input.acceptToken(Number$1)}else if(next==46)input.acceptToken(Dot);else if(next>=48&&next<=57){readNumber(input,false);input.acceptToken(Number$1)}else if(inString(next,d.operatorChars)){while(inString(input.next,d.operatorChars))input.advance();input.acceptToken(Operator)}else if(inString(next,d.specialVar)){if(input.next==next)input.advance();readWordOrQuoted(input);input.acceptToken(SpecialVar)}else if(next==58||next==44)input.acceptToken(Punctuation);else if(isAlpha(next)){let word=readWord(input,String.fromCharCode(next));input.acceptToken(input.next==46||input.peek(-word.length-1)==46?Identifier:(_a=d.words[word.toLowerCase()])!==null&&_a!==void 0?_a:Identifier)}})}var tokens=tokensFor(defaults);var parser$1=LRParser.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:`⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement`,maxTerm:38,nodeProps:[[`isolate`,-4,1,2,3,19,``]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:`RORO`,tokenizers:[0,tokens],topRules:{"Script":[0,25]},tokenPrec:0});function tokenBefore(tree){let cursor=tree.cursor().moveTo(tree.from,-1);while(/Comment/.test(cursor.name))cursor.moveTo(cursor.from,-1);return cursor.node}function idName(doc,node){let text=doc.sliceString(node.from,node.to);let quoted=/^([`'"\[])(.*)([`'"\]])$/.exec(text);return quoted?quoted[2]:text}function plainID(node){return node&&(node.name==`Identifier`||node.name==`QuotedIdentifier`)}function pathFor(doc,id){if(id.name==`CompositeIdentifier`){let path=[];for(let ch=id.firstChild;ch;ch=ch.nextSibling)if(plainID(ch))path.push(idName(doc,ch));return path}return[idName(doc,id)]}function parentsFor(doc,node){for(let path=[];;){if(!node||node.name!=`.`)return path;let name=tokenBefore(node);if(!plainID(name))return path;path.unshift(idName(doc,name));node=tokenBefore(name)}}function sourceContext(state,startPos){let pos=syntaxTree(state).resolveInner(startPos,-1);let aliases=getAliases(state.doc,pos);if(pos.name==`Identifier`||pos.name==`QuotedIdentifier`||pos.name==`Keyword`)return{from:pos.from,quoted:pos.name==`QuotedIdentifier`?state.doc.sliceString(pos.from,pos.from+1):null,parents:parentsFor(state.doc,tokenBefore(pos)),aliases};if(pos.name==`.`)return{from:startPos,quoted:null,parents:parentsFor(state.doc,pos),aliases};else return{from:startPos,quoted:null,parents:[],empty:true,aliases}}var EndFrom=new Set(`where group having order union intersect except all distinct limit offset fetch for`.split(` `));function getAliases(doc,at){let statement;for(let parent=at;!statement;parent=parent.parent){if(!parent)return null;if(parent.name==`Statement`)statement=parent}let aliases=null;for(let scan=statement.firstChild,sawFrom=false,prevID=null;scan;scan=scan.nextSibling){let kw=scan.name==`Keyword`?doc.sliceString(scan.from,scan.to).toLowerCase():null;let alias=null;if(!sawFrom)sawFrom=kw==`from`;else if(kw==`as`&&prevID&&plainID(scan.nextSibling))alias=idName(doc,scan.nextSibling);else if(kw&&EndFrom.has(kw))break;else if(prevID&&plainID(scan))alias=idName(doc,scan);if(alias){if(!aliases)aliases=Object.create(null);aliases[alias]=pathFor(doc,prevID)}prevID=/Identifier$/.test(scan.name)?scan:null}return aliases}function maybeQuoteCompletions(openingQuote,closingQuote,completions){return completions.map(c=>({...c,label:c.label[0]==openingQuote?c.label:openingQuote+c.label+closingQuote,apply:void 0}))}var Span=/^\w*$/;var QuotedSpan=/^[`'"\[]?\w*[`'"\]]?$/;function isSelfTag(namespace){return namespace.self&&typeof namespace.self.label==`string`}var CompletionLevel=class CompletionLevel{constructor(idQuote,idCaseInsensitive){this.idQuote=idQuote;this.idCaseInsensitive=idCaseInsensitive;this.list=[];this.children=void 0}child(name){let children=this.children||(this.children=Object.create(null));let found=children[name];if(found)return found;if(name&&!this.list.some(c=>c.label==name))this.list.push(nameCompletion(name,`type`,this.idQuote,this.idCaseInsensitive));return children[name]=new CompletionLevel(this.idQuote,this.idCaseInsensitive)}maybeChild(name){return this.children?this.children[name]:null}addCompletion(option){let found=this.list.findIndex(o=>o.label==option.label);if(found>-1)this.list[found]=option;else this.list.push(option)}addCompletions(completions){for(let option of completions)this.addCompletion(typeof option==`string`?nameCompletion(option,`property`,this.idQuote,this.idCaseInsensitive):option)}addNamespace(namespace){if(Array.isArray(namespace))this.addCompletions(namespace);else if(isSelfTag(namespace))this.addNamespace(namespace.children);else this.addNamespaceObject(namespace)}addNamespaceObject(namespace){for(let name of Object.keys(namespace)){let children=namespace[name],self=null;let parts=name.replace(/\\?\./g,p=>p==`.`?`\0`:p).split(`\0`);let scope=this;if(isSelfTag(children)){self=children.self;children=children.children}for(let i=0;i<parts.length;i++){if(self&&i==parts.length-1)scope.addCompletion(self);scope=scope.child(parts[i].replace(/\\\./g,`.`))}scope.addNamespace(children)}}};function nameCompletion(label,type,idQuote,idCaseInsensitive){if(new RegExp(`^[a-z_][a-z_\\d]*$`,idCaseInsensitive?`i`:``).test(label))return{label,type};return{label,type,apply:idQuote+label+getClosingQuote(idQuote)}}function getClosingQuote(openingQuote){return openingQuote===`[`?`]`:openingQuote}function completeFromSchema(schema,tables,schemas,defaultTableName,defaultSchemaName,dialect){var _a;let idQuote=((_a=dialect===null||dialect===void 0?void 0:dialect.spec.identifierQuotes)===null||_a===void 0?void 0:_a[0])||`"`;let top=new CompletionLevel(idQuote,!!(dialect===null||dialect===void 0?void 0:dialect.spec.caseInsensitiveIdentifiers));let defaultSchema=defaultSchemaName?top.child(defaultSchemaName):null;top.addNamespace(schema);if(tables)(defaultSchema||top).addCompletions(tables);if(schemas)top.addCompletions(schemas);if(defaultSchema)top.addCompletions(defaultSchema.list);if(defaultTableName)top.addCompletions((defaultSchema||top).child(defaultTableName).list);return context=>{let{parents,from,quoted,empty,aliases}=sourceContext(context.state,context.pos);if(empty&&!context.explicit)return null;if(aliases&&parents.length==1)parents=aliases[parents[0]]||parents;let level=top;for(let name of parents){while(!level.children||!level.children[name])if(level==top&&defaultSchema)level=defaultSchema;else if(level==defaultSchema&&defaultTableName)level=level.child(defaultTableName);else return null;let next=level.maybeChild(name);if(!next)return null;level=next}let options=level.list;if(level==top&&aliases)options=options.concat(Object.keys(aliases).map(name=>({label:name,type:`constant`})));if(quoted){let openingQuote=quoted[0];let closingQuote=getClosingQuote(openingQuote);return{from,to:context.state.sliceDoc(context.pos,context.pos+1)==closingQuote?context.pos+1:void 0,options:maybeQuoteCompletions(openingQuote,closingQuote,options),validFor:QuotedSpan}}else return{from,options,validFor:Span}}}function completionType(tokenType){return tokenType==Type?`type`:tokenType==Keyword?`keyword`:`variable`}function completeKeywords(keywords,upperCase,build){let completions=Object.keys(keywords).map(keyword=>build(upperCase?keyword.toUpperCase():keyword,completionType(keywords[keyword])));return ifNotIn([`QuotedIdentifier`,`String`,`LineComment`,`BlockComment`,`.`],completeFromList(completions))}var parser=parser$1.configure({props:[indentNodeProp.add({Statement:continuedIndent()}),foldNodeProp.add({Statement(tree,state){return{from:Math.min(tree.from+100,state.doc.lineAt(tree.from).to),to:tree.to}},BlockComment(tree){return{from:tree.from+2,to:tree.to-2}}}),styleTags({Keyword:tags.keyword,Type:tags.typeName,Builtin:tags.standard(tags.name),Bits:tags.number,Bytes:tags.string,Bool:tags.bool,Null:tags.null,Number:tags.number,String:tags.string,Identifier:tags.name,QuotedIdentifier:tags.special(tags.string),SpecialVar:tags.special(tags.name),LineComment:tags.lineComment,BlockComment:tags.blockComment,Operator:tags.operator,"Semi Punctuation":tags.punctuation,"( )":tags.paren,"{ }":tags.brace,"[ ]":tags.squareBracket})]});var SQLDialect=class SQLDialect{constructor(dialect,language,spec){this.dialect=dialect;this.language=language;this.spec=spec}get extension(){return this.language.extension}configureLanguage(options,name){return new SQLDialect(this.dialect,this.language.configure(options,name),this.spec)}static define(spec){let d=dialect(spec,spec.keywords,spec.types,spec.builtin);let language=LRLanguage.define({name:`sql`,parser:parser.configure({tokenizers:[{from:tokens,to:tokensFor(d)}]}),languageData:{commentTokens:{line:`--`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}});return new SQLDialect(d,language,spec)}};function defaultKeyword(label,type){return{label,type,boost:-1}}function keywordCompletionSource(dialect,upperCase=false,build){return completeKeywords(dialect.dialect.words,upperCase,build||defaultKeyword)}function schemaCompletionSource(config){return config.schema?completeFromSchema(config.schema,config.tables,config.schemas,config.defaultTable,config.defaultSchema,config.dialect||StandardSQL):()=>null}function schemaCompletion(config){return config.schema?(config.dialect||StandardSQL).language.data.of({autocomplete:schemaCompletionSource(config)}):[]}function sql(config={}){let lang=config.dialect||StandardSQL;return new LanguageSupport(lang.language,[schemaCompletion(config),lang.language.data.of({autocomplete:keywordCompletionSource(lang,config.upperCaseKeywords,config.keywordCompletion)})])}var StandardSQL=SQLDialect.define({});var PostgreSQL=SQLDialect.define({charSetCasts:true,doubleDollarQuotedStrings:true,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:``,keywords:SQLKeywords+`abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes`,types:SQLTypes+`bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml`});var MySQLKeywords=`accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill`;var MySQLTypes=SQLTypes+`bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int1 int2 int3 int4 int8 float4 float8 varbinary varcharacter precision datetime unsigned signed`;var MySQLBuiltin=`charset clear edit ego help nopager notee nowarning pager print prompt quit rehash source status system tee`;var MySQL=SQLDialect.define({operatorChars:`*+-%<>!=&|^`,charSetCasts:true,doubleQuotedStrings:true,unquotedBitLiterals:true,hashComments:true,spaceAfterDashes:true,specialVar:`@?`,identifierQuotes:"`",keywords:SQLKeywords+`group_concat `+MySQLKeywords,types:MySQLTypes,builtin:MySQLBuiltin});var MariaSQL=SQLDialect.define({operatorChars:`*+-%<>!=&|^`,charSetCasts:true,doubleQuotedStrings:true,unquotedBitLiterals:true,hashComments:true,spaceAfterDashes:true,specialVar:`@?`,identifierQuotes:"`",keywords:SQLKeywords+`always generated groupby_concat hard persistent shutdown soft virtual `+MySQLKeywords,types:MySQLTypes,builtin:MySQLBuiltin});var MSSQL=SQLDialect.define({keywords:SQLKeywords+`add external procedure all fetch public alter file raiserror and fillfactor read any for readtext as foreign reconfigure asc freetext references authorization freetexttable replication backup from restore begin full restrict between function return break goto revert browse grant revoke bulk group right by having rollback cascade holdlock rowcount case identity rowguidcol check identity_insert rule checkpoint identitycol save close if schema clustered in securityaudit coalesce index select collate inner semantickeyphrasetable column insert semanticsimilaritydetailstable commit intersect semanticsimilaritytable compute into session_user constraint is set contains join setuser containstable key shutdown continue kill some convert left statistics create like system_user cross lineno table current load tablesample current_date merge textsize current_time national then current_timestamp nocheck to current_user nonclustered top cursor not tran database null transaction dbcc nullif trigger deallocate of truncate declare off try_convert default offsets tsequal delete on union deny open unique desc opendatasource unpivot disk openquery update distinct openrowset updatetext distributed openxml use double option user drop or values dump order varying else outer view end over waitfor errlvl percent when escape pivot where except plan while exec precision with execute primary within group exists print writetext exit proc `+`noexpand index forceseek forcescan holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot spatial_window_max_cells tablock tablockx updlock xlock keepidentity keepdefaults ignore_constraints ignore_triggers`,types:SQLTypes+`smalldatetime datetimeoffset datetime2 datetime bigint smallint smallmoney tinyint money real text nvarchar ntext varbinary image hierarchyid uniqueidentifier sql_variant xml`,builtin:`approx_count_distinct approx_percentile_cont approx_percentile_disc avg checksum_agg count count_big grouping grouping_id max min product stdev stdevp sum var varp ai_generate_embeddings ai_generate_chunks cume_dist first_value lag last_value lead percentile_cont percentile_disc percent_rank left_shift right_shift bit_count get_bit set_bit collationproperty tertiary_weights @@datefirst @@dbts @@langid @@language @@lock_timeout @@max_connections @@max_precision @@nestlevel @@options @@remserver @@servername @@servicename @@spid @@textsize @@version cast convert parse try_cast try_convert try_parse asymkey_id asymkeyproperty certproperty cert_id crypt_gen_random decryptbyasymkey decryptbycert decryptbykey decryptbykeyautoasymkey decryptbykeyautocert decryptbypassphrase encryptbyasymkey encryptbycert encryptbykey encryptbypassphrase hashbytes is_objectsigned key_guid key_id key_name signbyasymkey signbycert symkeyproperty verifysignedbycert verifysignedbyasymkey @@cursor_rows @@fetch_status cursor_status datalength ident_current ident_incr ident_seed identity sql_variant_property @@datefirst current_timestamp current_timezone current_timezone_id date_bucket dateadd datediff datediff_big datefromparts datename datepart datetime2fromparts datetimefromparts datetimeoffsetfromparts datetrunc day eomonth getdate getutcdate isdate month smalldatetimefromparts switchoffset sysdatetime sysdatetimeoffset sysutcdatetime timefromparts todatetimeoffset year edit_distance edit_distance_similarity jaro_winkler_distance jaro_winkler_similarity edge_id_from_parts graph_id_from_edge_id graph_id_from_node_id node_id_from_parts object_id_from_edge_id object_id_from_node_id json isjson json_array json_contains json_modify json_object json_path_exists json_query json_value regexp_like regexp_replace regexp_substr regexp_instr regexp_count regexp_matches regexp_split_to_table abs acos asin atan atn2 ceiling cos cot degrees exp floor log log10 pi power radians rand round sign sin sqrt square tan choose greatest iif least @@procid app_name applock_mode applock_test assemblyproperty col_length col_name columnproperty databasepropertyex db_id db_name file_id file_idex file_name filegroup_id filegroup_name filegroupproperty fileproperty filepropertyex fulltextcatalogproperty fulltextserviceproperty index_col indexkey_property indexproperty next value for object_definition object_id object_name object_schema_name objectproperty objectpropertyex original_db_name parsename schema_id schema_name scope_identity serverproperty stats_date type_id type_name typeproperty dense_rank ntile rank row_number publishingservername certenclosed certprivatekey current_user database_principal_id has_dbaccess has_perms_by_name is_member is_rolemember is_srvrolemember loginproperty original_login permissions pwdencrypt pwdcompare session_user sessionproperty suser_id suser_name suser_sid suser_sname system_user user user_id user_name ascii char charindex concat concat_ws difference format left len lower ltrim nchar patindex quotename replace replicate reverse right rtrim soundex space str string_agg string_escape stuff substring translate trim unicode upper $partition @@error @@identity @@pack_received @@rowcount @@trancount binary_checksum checksum compress connectionproperty context_info current_request_id current_transaction_id decompress error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big session_context xact_state @@connections @@cpu_busy @@idle @@io_busy @@pack_sent @@packet_errors @@timeticks @@total_errors @@total_read @@total_write textptr textvalid columns_updated eventdata trigger_nestlevel vector_distance vectorproperty vector_search generate_series opendatasource openjson openquery openrowset openxml predict string_split coalesce nullif apply catch filter force include keep keepfixed modify optimize parameterization parameters partition recompile sequence set`,operatorChars:`*+-%<>!=^&|/`,specialVar:`@`,identifierQuotes:`"[`});var SQLite=SQLDialect.define({keywords:SQLKeywords+`abort analyze attach autoincrement conflict database detach exclusive fail glob ignore index indexed instead isnull notnull offset plan pragma query raise regexp reindex rename replace temp vacuum virtual`,types:SQLTypes+`bool blob long longblob longtext medium mediumblob mediumint mediumtext tinyblob tinyint tinytext text bigint int2 int8 unsigned signed real`,builtin:`auth backup bail changes clone databases dbinfo dump echo eqp explain fullschema headers help import imposter indexes iotrace lint load log mode nullvalue once print prompt quit restore save scanstats separator shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width`,operatorChars:`*+-%<>!=&|/~`,identifierQuotes:'`"',specialVar:`@:?$`});var Cassandra=SQLDialect.define({keywords:`add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime infinity NaN`,types:SQLTypes+`ascii bigint blob counter frozen inet list map static text timeuuid tuple uuid varint`,slashComments:true});var PLSQL=SQLDialect.define({keywords:SQLKeywords+`abort accept access add all alter and any arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body by case cast char_base check close cluster clusters colauth column comment commit compress connected constant constraint crash create current currval cursor data_base database dba deallocate debugoff debugon declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry exception exception_init exchange exclusive exists external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base of off offline on online only option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw rebuild record ref references refresh rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work`,builtin:`appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define echo editfile embedded feedback flagger flush heading headsep instance linesize lno loboffset logsource longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar repfooter repheader serveroutput shiftinout show showmode spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout timing trimout trimspool ttitle underline verify version wrap`,types:SQLTypes+`ascii bfile bfilename bigserial bit blob dec long number nvarchar nvarchar2 serial smallint string text uid varchar2 xml`,operatorChars:`*/+-%<>!=~`,doubleQuotedStrings:true,charSetCasts:true,plsqlQuotingMechanism:true});function defineDatabaseClientDialect(definition={}){if(!definition.codeMirrorDialect||typeof definition.quoteIdentifier!==`function`||typeof definition.stringLiteral!==`function`)throw new TypeError(`A database client dialect must implement the complete UI adapter contract.`);return Object.freeze(definition)}var DATABASE_CLIENT_DIALECTS=Object.freeze({sqlite:defineDatabaseClientDialect({...SQL_QUOTING.sqlite,codeMirrorDialect:SQLite}),mysql:defineDatabaseClientDialect({...SQL_QUOTING.mysql,codeMirrorDialect:MariaSQL}),postgresql:defineDatabaseClientDialect({...SQL_QUOTING.postgresql,codeMirrorDialect:PostgreSQL})});function databaseClientDialect(engine=``){const candidate=String(engine||``).trim().toLowerCase();const dialect=DATABASE_CLIENT_DIALECTS[candidate];if(!dialect)throw new TypeError(`Unsupported database client dialect: ${candidate||`missing`}.`);return dialect}var REPLAY_SAFE_COMMANDS=new Set([`DESC`,`DESCRIBE`,`EXPLAIN`,`SELECT`,`SHOW`]);var NUMERIC_TYPE=/^(?:smallint|integer|bigint|decimal|numeric|real|double|float|int|tinyint|mediumint)/iu;function quoteIdentifier(name,engine){return databaseClientDialect(engine).quoteIdentifier(name)}function sqlLiteral(value,column,engine){const raw=String(value??``);const type=column.dataType||column.nativeType;if(NUMERIC_TYPE.test(type)&&/^-?(?:\d+\.?\d*|\.\d+)$/u.test(raw.trim()))return raw.trim();if(/^(?:boolean|bool)/iu.test(type)&&/^(?:true|false)$/iu.test(raw.trim()))return raw.trim().toUpperCase();return databaseClientDialect(engine).stringLiteral(raw)}function filteredTableSql(table,filters,engine){const predicates=filters.map(filter=>{const column=table.columns.find(candidate=>candidate.name===filter.column)||{};return filter.operator.startsWith(`IS `)?`${quoteIdentifier(filter.column,engine)} ${filter.operator}`:`${quoteIdentifier(filter.column,engine)} ${filter.operator} ${sqlLiteral(filter.value,column,engine)}`});const where=predicates.length?`\nWHERE ${predicates.join(`
3
3
  AND `)}`:``;return`${defaultTableQuery(table,engine).replace(/;$/u,``)}${where};`}function useDatabaseTableQueries({activeView,cancelQuery,connection,reload,runQuery,running,schema}){const selectedTableName=ref(``);const sqlText=ref(``);const queryResult=ref(null);const activeQueryId=ref(``);const resultSearch=ref(``);const filters=ref([]);const tableQueryStates=new Map;const selectedTable=computed(()=>schema.value.tables.find(table=>table.qualifiedName===selectedTableName.value)||null);const currentQueryIsDefault=computed(()=>Boolean(selectedTable.value&&sqlText.value.trim()===defaultTableSql(selectedTable.value)));function defaultTableSql(table){return defaultTableQuery(table,schema.value.engine)}function rememberSelectedTableState(){if(!selectedTableName.value)return;tableQueryStates.set(selectedTableName.value,{filters:filters.value.map(filter=>({...filter})),queryResult:queryResult.value,sqlText:sqlText.value})}async function openTable(table,{rememberCurrent=true}={}){if(!table.qualifiedName||running.value)return;if(rememberCurrent)rememberSelectedTableState();selectedTableName.value=table.qualifiedName;resultSearch.value=``;activeView.value=`data`;const saved=tableQueryStates.get(table.qualifiedName);if(saved){filters.value=saved.filters.map(filter=>({...filter}));sqlText.value=saved.sqlText;queryResult.value=saved.queryResult;return}filters.value=[];sqlText.value=defaultTableSql(table);queryResult.value=null;await executeQuery({automatic:true})}function selectTable(table){return openTable(table)}function clearSelectedTable(){selectedTableName.value=``;sqlText.value=``;queryResult.value=null;filters.value=[]}function forgetTableQueries(){tableQueryStates.clear();clearSelectedTable()}function loadSql(value){filters.value=[];sqlText.value=String(value||``);activeView.value=`data`;rememberSelectedTableState()}function updateSqlText(value){sqlText.value=String(value||``);rememberSelectedTableState()}function useAssistantSql(sql){filters.value=[];updateSqlText(sql);activeView.value=`data`}async function resetTableQuery(){if(!selectedTable.value||running.value)return;filters.value=[];resultSearch.value=``;sqlText.value=defaultTableSql(selectedTable.value);queryResult.value=null;tableQueryStates.delete(selectedTable.value.qualifiedName);await executeQuery({automatic:true})}function regenerateFilteredSql(){if(!selectedTable.value)return;sqlText.value=filteredTableSql(selectedTable.value,filters.value,schema.value.engine);rememberSelectedTableState()}function addFilter(filter){filters.value.push({id:crypto.randomUUID(),...filter});regenerateFilteredSql()}function removeFilter(id){filters.value=filters.value.filter(filter=>filter.id!==id);regenerateFilteredSql()}async function requestRun(){if(!sqlText.value.trim()||running.value)return;await executeQuery()}async function executeQuery({automatic=currentQueryIsDefault.value}={}){const queryId=crypto.randomUUID();const querySql=sqlText.value;activeQueryId.value=queryId;try{const result=await runQuery({automatic,confirmationDatabase:connection.value.database,confirmed:true,queryId,readOnly:automatic,sql:querySql,writeUnlocked:true});if(result){queryResult.value=result;rememberSelectedTableState()}if(!automatic)await reload()}finally{if(activeQueryId.value===queryId)activeQueryId.value=``}}async function cancelActiveQuery(){if(activeQueryId.value)await cancelQuery(activeQueryId.value)}async function refreshVisibleRows(){if(queryResult.value?.kind===`result-set`&&REPLAY_SAFE_COMMANDS.has(String(queryResult.value.command||``).toUpperCase())&&sqlText.value.trim()){await executeQuery();return}queryResult.value=null;await reload()}return{activeQueryId,addFilter,cancelActiveQuery,clearSelectedTable,filters,forgetTableQueries,loadSql,openTable,queryResult,refreshVisibleRows,rememberSelectedTableState,removeFilter,requestRun,resetTableQuery,resultSearch,selectTable,selectedTable,selectedTableName,sqlText,updateSqlText,useAssistantSql}}var DATA_OVERVIEW_PATH=`data-overview.json`;var DATA_OVERVIEW_ABSTRACTIONS=[{value:`none`,title:`Not abstract`,description:`Make every physical table its own actor; do not combine tables.`},{value:`balanced`,title:`Balanced`,description:`Aim for 5–10 business concepts, with supporting tables inside them and only the main business connections shown.`},{value:`high`,title:`Very abstract`,description:`Aim for 3–5 broad business domains, including their supporting concepts across multiple relationships.`}];var DATA_OVERVIEW_INSTRUCTIONS=[`Vibe64's Data overview groups real database tables under main actors. It does not change the database.`,`Read the refreshed schema and relevant application models, migrations and documentation to choose meaningful actors and their supporting tables. Relationship distance does not determine membership.`,`Write data-overview.json in the project source root using: {"version":1,"abstraction":"balanced","reviewedTables":["public.bookings","public.invoice_groups","public.checklists","public.transactions"],"actors":[{"table":"public.bookings","name":"Bookings","description":"Bookings with invoice groups, checklists and transactions","tables":["public.bookings","public.invoice_groups","public.checklists","public.transactions"]}]}.`,`Use each schema table's exact reference field everywhere in this file, never its qualifiedName. MySQL/MariaDB references are database-relative (bookings); PostgreSQL references retain the application schema (public.bookings). Never store the selected MySQL database name: it changes between sessions and environments. Every actor's table must be included in its tables list. Each table has one home; put genuinely shared concepts in their own actor and retain their relationships. Technical or unclassified tables may remain outside the groups and appear under Other tables.`,`Choose supporting tables explicitly, even several relationships away. A broader Booking actor may contain invoice groups, checklists and transactions; a smaller one may contain only bookings and invoice groups, leaving Checklists and Transactions as separate actors. Follow the application's meaning and the user's preference.`,`Preserve existing authored groupings unless the task requires changing them. After a schema change, classify new tables, update renamed/removed references, then run vibe64-helper database refresh and vibe64-helper database overview --json to check coverage and warnings.`,`abstraction is none (each physical table is its own actor), balanced (business actors with supporting tables), or high (a few broad business actors). Follow the generation request's selected level and scope. reviewedTables records every exact table name you have reviewed, including tables deliberately left under Other tables. Preserve this record on incremental work. For new-tables-only generation, process coverage.unreviewed only; preserve existing actors, memberships, names and manual choices, while allowing new tables to join existing actors. Full regeneration may replace the grouping and should review all current tables.`,`Also author "rings": [["public.bookings"],["public.contacts","public.dogs","public.payments"]]. Rings run from the important business concepts in the centre out to smaller supporting concepts; each ring lists actors clockwise from the top. Include every actor exactly once. Choose the centre from application meaning, not just table count or technical foreign-key degree. Keep closely related actors in neighbouring angular sectors across rings. Use a few central actors, then major domains, then peripheral services. Vibe64 packs sparse rings together and calculates readable card sizes, compact spacing and routes. Preserve existing placement during incremental work, adding new actors near related concepts.`,`Balanced should normally produce 5–10 actors; high should normally produce 3–5. These are useful targets, not quotas: use fewer for small schemas and explain any necessary excess. Avoid making each small feature or infrastructure service its own actor. Group related capabilities into understandable business concepts; put administration together where appropriate.`,`For balanced and high, also write "mainRelationships": ["exact relationship reference from schema.relationships"]. MySQL references use table:constraint_name without a database prefix; PostgreSQL retains schema.table:constraint_name. Choose the real foreign keys that best express the main business connections between actors. Typically each concept has one or two main connections. Do not select every cross-actor FK: workspace ownership, created_by/updated_by, audit authorship, shared attachments and similar administrative dependencies usually belong only in the detailed view. Keep any such relationship that is itself central to this application. An empty list is valid when no business links exist. Preserve existing choices on incremental work, adding main connections for new concepts where needed. Not abstract may omit this field to show all connections.`,`Optional "positions" maps actor main-table names (or "other-tables") to {"x":number,"y":number}. These are user-dragged positions and override automatic rings. Preserve them during incremental updates; full regeneration may clear them to apply the new arrangement. Do not invent pixel coordinates.`,`Do not invent relationships or cardinalities; mainRelationships must use actual schema relationship reference fields. Vibe64 resolves these against the selected database and retains the actual endpoints and all physical relationships in the ERD; users can also show all overview connections. Do not read data rows or credentials merely to classify tables. Do not edit Vibe64 runtime artifacts.`].join(`
4
4
  `);function validateDataOverview(value){const fail=(message,code,params)=>{throw new AppError(400,`Data overview: ${message}`,{code,params})};const record=(item,fields,label)=>{if(!item||typeof item!==`object`||Array.isArray(item))fail(`${label} must be an object.`,`vibe64_database_overview_object_required`,{label});if(Object.keys(item).some(key=>!fields.includes(key)))fail(`${label} contains unknown fields.`,`vibe64_database_overview_fields_unknown`,{label})};const text=(item,label,limit)=>{if(typeof item!==`string`||!item.trim()||item.length>limit)fail(`${label} must be non-empty text of at most ${limit} characters.`,`vibe64_database_overview_text_invalid`,{label,limit});return item.trim()};record(value,[`version`,`actors`,`abstraction`,`reviewedTables`,`rings`,`mainRelationships`,`positions`],`document`);if(value.version!==1)fail(`version must be 1.`,`vibe64_database_overview_version_unsupported`);if(!Array.isArray(value.actors)||value.actors.length>2e3)fail(`actors must be an array of at most 2000 items.`,`vibe64_database_overview_actors_invalid`);if(value.abstraction!==void 0&&!DATA_OVERVIEW_ABSTRACTIONS.some(item=>item.value===value.abstraction))fail(`abstraction must be none, balanced or high.`,`vibe64_database_overview_abstraction_invalid`);let reviewedTables;if(value.reviewedTables!==void 0){if(!Array.isArray(value.reviewedTables)||value.reviewedTables.length>2e3)fail(`reviewedTables must be an array of at most 2000 table names.`,`vibe64_database_overview_reviewed_tables_invalid`);reviewedTables=value.reviewedTables.map(entry=>text(entry,`reviewed table name`,512));if(new Set(reviewedTables).size!==reviewedTables.length)fail(`reviewedTables must not repeat a table.`,`vibe64_database_overview_reviewed_table_repeated`)}const assigned=new Set;const actors=value.actors.map(actor=>{record(actor,[`table`,`name`,`description`,`tables`],`actor`);const table=text(actor.table,`actor table`,512);const name=text(actor.name,`actor name`,120);if(typeof actor.description!==`string`||actor.description.length>600)fail(`description must be text of at most 600 characters.`,`vibe64_database_overview_description_invalid`);if(!Array.isArray(actor.tables)||!actor.tables.length||actor.tables.length>2e3)fail(`${name} must include between 1 and 2000 tables.`,`vibe64_database_overview_actor_tables_invalid`,{name});const tables=actor.tables.map(entry=>{const id=text(entry,`table name`,512);if(assigned.has(id))fail(`${id} belongs to more than one group or is repeated.`,`vibe64_database_overview_table_repeated`,{table:id});assigned.add(id);return id});if(!tables.includes(table))fail(`${name} must include its main table ${table}.`,`vibe64_database_overview_main_table_excluded`,{name,table});return{table,name,description:actor.description.trim(),tables}});if(assigned.size>2e3)fail(`at most 2000 tables may be classified.`,`vibe64_database_overview_tables_too_many`);let rings;if(value.rings!==void 0){if(!Array.isArray(value.rings)||value.rings.length>2e3)fail(`rings must be an array of at most 2000 rings.`,`vibe64_database_overview_rings_invalid`);const mainTables=new Set(actors.map(actor=>actor.table));const placed=new Set;rings=value.rings.map(ring=>{if(!Array.isArray(ring)||!ring.length||ring.length>2e3)fail(`each ring must contain actor main tables.`,`vibe64_database_overview_ring_invalid`);return ring.map(entry=>{const table=text(entry,`ring actor`,512);if(!mainTables.has(table)||placed.has(table))fail(`rings must contain each actor exactly once, using its main table.`,`vibe64_database_overview_ring_actor_invalid`);placed.add(table);return table})});if(placed.size!==actors.length)fail(`rings must place every actor.`,`vibe64_database_overview_ring_actor_unplaced`)}let mainRelationships;if(value.mainRelationships!==void 0){if(!Array.isArray(value.mainRelationships)||value.mainRelationships.length>2e3)fail(`mainRelationships must be an array of at most 2000 relationship IDs.`,`vibe64_database_overview_main_relationships_invalid`);mainRelationships=value.mainRelationships.map(entry=>text(entry,`main relationship ID`,1024));if(new Set(mainRelationships).size!==mainRelationships.length)fail(`mainRelationships must not repeat an ID.`,`vibe64_database_overview_main_relationship_repeated`)}let positions;if(value.positions!==void 0){const allowed=new Set([...actors.map(actor=>actor.table),`other-tables`]);record(value.positions,[...allowed],`positions`);positions=Object.fromEntries(Object.entries(value.positions).map(([table,position])=>{record(position,[`x`,`y`],`actor position`);if(![position.x,position.y].every(n=>typeof n===`number`&&Number.isFinite(n)&&Math.abs(n)<=1e6))fail(`actor coordinates must be finite numbers between -1000000 and 1000000.`,`vibe64_database_overview_position_invalid`);return[table,{x:position.x,y:position.y}]}))}return{version:1,actors,...value.abstraction!==void 0?{abstraction:value.abstraction}:{},...reviewedTables?{reviewedTables}:{},...rings?{rings}:{},...mainRelationships?{mainRelationships}:{},...positions?{positions}:{}}}function dataOverviewCoverage(schema={},definition={actors:[]}){const tables=new Set((schema.tables||[]).map(table=>table.qualifiedName));const assigned=new Set(definition.actors.flatMap(actor=>actor.tables));const relationships=new Set((schema.relationships||[]).map(relationship=>relationship.id));const reviewed=new Set([...definition.reviewedTables||[],...assigned]);return{total:tables.size,classified:[...tables].filter(table=>assigned.has(table)).length,others:[...tables].filter(table=>!assigned.has(table)),reviewed:[...tables].filter(table=>reviewed.has(table)).length,unreviewed:[...tables].filter(table=>!reviewed.has(table)),missing:[...assigned].filter(table=>!tables.has(table)),missingRelationships:(definition.mainRelationships||[]).filter(id=>!relationships.has(id))}}function buildOverviewAssistantRequest({abstraction,scope,schemaTables,tables}){const level=DATA_OVERVIEW_ABSTRACTIONS.find(item=>item.value===abstraction)||DATA_OVERVIEW_ABSTRACTIONS[1];const tableReferences=tables.map(name=>schemaTables.find(table=>table.qualifiedName===name)?.reference||name);const scopeInstruction=scope===`ungrouped`?`Review only these currently ungrouped tables: ${JSON.stringify(tableReferences)}. Preserve existing actors, names, descriptions, memberships and manual choices. Classify these tables into existing or new actors where appropriate. Explain any deliberately retained under Other tables. Preserve reviewedTables and record this review.`:scope===`new`?`Process only coverage.unreviewed tables. Preserve existing actors, names, descriptions, memberships and manual choices. New tables may join an existing actor or form a new one. Preserve reviewedTables and add the newly reviewed tables, including those deliberately left under Other tables.`:`Regenerate the whole grouping at the selected abstraction level, replacing existing actor choices as needed. Review every current table and record every one in reviewedTables, including those deliberately left under Other tables.`;return{title:`Data overview`,displayMessage:`${scope===`ungrouped`?`Review ${tableReferences.length} ungrouped tables`:scope===`new`?`Process new tables only`:`Regenerate the data overview`}: ${level.title}.`,message:`Create or review this project's Data overview. Run \`vibe64-helper database overview --json\` to read its current definition, refreshed schema and exact authoring instructions. Inspect the relevant application source to understand the main actors. Selected abstraction: ${level.title} (${level.value}). ${level.description} ${scopeInstruction} Save the grouping in data-overview.json with abstraction set to "${level.value}". Supporting tables may be several relationships away. Change only this grouping file; do not change database records, schema or other application files. Run \`vibe64-helper database refresh\` followed by \`vibe64-helper database overview --json\`, fix invalid or missing references, and report coverage plus any tables left under Other tables.`,dedupeKey:`database-overview`}}function shortDate(value){if(!value)return`never`;const date=new Date(value);return Number.isNaN(date.getTime())?String(value):date.toLocaleString([],{dateStyle:`medium`,timeStyle:`short`})}function firstSqlLine(value){return String(value||``).trim().split(`