vibe64 0.1.59 → 0.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run.js +1228 -1210
- package/bin/server.js +392 -376
- package/bin/upgrade-state.js +4457 -4430
- package/dist/assets/{GithubBrowserTabs-D_nMB5Y1.js → GithubBrowserTabs-DAgQxPXI.js} +1 -1
- package/dist/assets/{LocalDatabaseServer-BgO_aeUg.js → LocalDatabaseServer-m1G8ZS5i.js} +1 -1
- package/dist/assets/SelectField-DwWoHC2p.js +1 -0
- package/dist/assets/{ShellOutlet-Cr8SJs7s.js → ShellOutlet-CdjsJfg9.js} +1 -1
- package/dist/assets/Vibe64AuthSettingsButton-D3sB4BfM.js +5 -0
- package/dist/assets/{Vibe64AuthSettingsButton-DRTKdimW.css → Vibe64AuthSettingsButton-DFfFPrd7.css} +1 -1
- package/dist/assets/{Vibe64ConversationLog-DtOgxPNR.js → Vibe64ConversationLog-B-L5QsVr.js} +4 -4
- package/dist/assets/{Vibe64ConversationLog-NH61odld.css → Vibe64ConversationLog-ksf1U6PP.css} +1 -1
- package/dist/assets/{Vibe64DashboardShell-DhPE6H3P.js → Vibe64DashboardShell-CMzX3wRM.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-Bpnbjs4l.css → Vibe64DashboardShell-D0GNI4V8.css} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-cfn8TTxQ.css → Vibe64DatabaseWorkspace-De4sbXAN.css} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-CHV0cd3l.js → Vibe64DatabaseWorkspace-Dewhs6_T.js} +2 -2
- package/dist/assets/Vibe64DestinationButton-CdyyK9tj.js +1 -0
- package/dist/assets/Vibe64DestinationButton-ZxY1Lwie.css +1 -0
- package/dist/assets/Vibe64FileArea-DluZTu-c.js +1 -0
- package/dist/assets/{Vibe64FileArea-mydNQQl8.css → Vibe64FileArea-ZEzsvLt2.css} +1 -1
- package/dist/assets/Vibe64OutputControls-BfbdD25Y.js +8 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-DUSMn4pR.js → Vibe64RepositoryWorkspace-CBsySPXN.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-BXt__PJL.js → Vibe64SessionFiles--wtVe_KC.js} +1 -1
- package/dist/assets/{Vibe64SessionSourceEditor-NyG6niQM.js → Vibe64SessionSourceEditor-BouH4fXC.js} +1 -1
- package/dist/assets/Vibe64UiStoryboardView--E04EEF8.js +8 -0
- package/dist/assets/{Vibe64UiStoryboardView-CtlJWiCY.css → Vibe64UiStoryboardView-DqLN6ofL.css} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-CCPWJo8e.js → Vibe64UnavailableSessions-94bFpxMK.js} +1 -1
- package/dist/assets/_pageId_-Ch4OpUkd.js +1 -0
- package/dist/assets/_sessionId_-7PyIUeUr.css +1 -0
- package/dist/assets/_sessionId_-DGT4d2La.js +1 -0
- package/dist/assets/{_sessionTool_-CKPNp5fF.js → _sessionTool_-CBf51mfK.js} +1 -1
- package/dist/assets/_sessionTool_-DiYoi-BF.css +1 -0
- package/dist/assets/_slug_-C8VNMRVH.js +14 -0
- package/dist/assets/_slug_-CZmGS16g.css +1 -0
- package/dist/assets/access-BAOx4iCS.js +1 -0
- package/dist/assets/access-BH1OsqPS.css +1 -0
- package/dist/assets/{app-D9FegZf0.js → app-Bs6-Hv23.js} +1 -1
- package/dist/assets/{assistantRouting-D4SnnxJn.js → assistantRouting-BS0ZW5Ki.js} +1 -1
- package/dist/assets/{changes-DtfJc780.js → changes-C6eMQ9YE.js} +1 -1
- package/dist/assets/{client-CUQfIUus.css → client-BBJzQIWS.css} +1 -1
- package/dist/assets/{client-BBqNv4HL.js → client-CIF5Y1Aj.js} +1 -1
- package/dist/assets/{client-B8u2_Svv.css → client-CM6TGZc9.css} +1 -1
- package/dist/assets/{client-DnjkdG6K.js → client-CVgL_ShV.js} +1 -1
- package/dist/assets/{client-DuDOzb5A.js → client-HWj_BNVZ.js} +2 -2
- package/dist/assets/{client-Dra4Vp3A.js → client-qAKnahkF.js} +2 -2
- package/dist/assets/{client-mU-LObHG.js → client-qpL_kR4u.js} +2 -2
- package/dist/assets/{conversation-QpMeXw70.js → conversation-DbF0OrZB.js} +3 -3
- package/dist/assets/{conversation-La-pkh5h.css → conversation-ZN3-8jbz.css} +1 -1
- package/dist/assets/{dashboard-B26QwE6y.js → dashboard-CzLsa0w0.js} +1 -1
- package/dist/assets/{english-definitions-I9tIXY2u.js → english-definitions-BA8v5wP1.js} +1 -1
- package/dist/assets/{env-BXsvM592.js → env-BqJ_GWbz.js} +1 -1
- package/dist/assets/{error-kdRkyK9x.js → error-BQ7r64JO.js} +1 -1
- package/dist/assets/{error-CX8_snYL.js → error-BqMxhgpB.js} +1 -1
- package/dist/assets/errorMessageHelpers-BjIt31kK.js +1 -0
- package/dist/assets/{errors-DErd0NON.js → errors-D17nJYne.js} +1 -1
- package/dist/assets/{health-C4WtefLm.js → health-CIqrHpVK.js} +1 -1
- package/dist/assets/history-BCjhpyP8.js +1 -0
- package/dist/assets/history-BSIuLgnI.css +1 -0
- package/dist/assets/{httpClient-BRO3GqjU.js → httpClient-Bwitq9Xf.js} +1 -1
- package/dist/assets/i18n-BkxO7BMl.js +1 -0
- package/dist/assets/{i18n-B5lc019_.js → i18n-Dm74yE_M.js} +1 -1
- package/dist/assets/index-Ctygjyf8.css +1 -0
- package/dist/assets/index-fXKdz8oR.js +134 -0
- package/dist/assets/{integrations-CrI893NK.css → integrations-CwgrZgmM.css} +1 -1
- package/dist/assets/{integrations-CQNJxkMu.js → integrations-cgbpgNNd.js} +12 -5
- package/dist/assets/issues-AhouA6nE.js +1 -0
- package/dist/assets/issues-D46llNv-.css +1 -0
- package/dist/assets/{learning-0cINHUSN.js → learning-DZXWgVEW.js} +1 -1
- package/dist/assets/{pages-DbF-yXqO.js → pages-5jaEclQo.js} +1 -1
- package/dist/assets/{pages-CIKw99GN.js → pages-BUUwIXBf.js} +1 -1
- package/dist/assets/{pathname-DOqQPPVa.js → pathname-JHQIKk21.js} +1 -1
- package/dist/assets/{placement-BAaZQhAh.js → placement-1lT0lW3-.js} +1 -1
- package/dist/assets/{placement-Lk1Lpy6s.js → placement-B2V88UDJ.js} +1 -1
- package/dist/assets/{project-files-CklWobqZ.js → project-files-BS2gdDSz.js} +1 -1
- package/dist/assets/publish-Bq_LPmX2.js +3 -0
- package/dist/assets/{publish-DOybV3Qz.css → publish-C9O0tDPB.css} +1 -1
- package/dist/assets/pull-requests-BvChbjCD.js +1 -0
- package/dist/assets/pull-requests-DtqrTix0.css +1 -0
- package/dist/assets/{repository-wJZei_NJ.js → repository-Dkow-18G.js} +1 -1
- package/dist/assets/settings-BKZcbISO.css +1 -0
- package/dist/assets/settings-r5RWQVzw.js +1 -0
- package/dist/assets/{shared-X5MxTHwl.js → shared-B6plZPQ_.js} +1 -1
- package/dist/assets/{studioGateApi-CHIdcQvD.js → studioGateApi-UqmdV50W.js} +1 -1
- package/dist/assets/{studioUrls-oIU1Eq_t.js → studioUrls-k_pQIuPs.js} +1 -1
- package/dist/assets/useArchivedVibe64Sessions-C0MVJuyX.js +1 -0
- package/dist/assets/useAssistantAttachments-BkYZckgz.js +2 -0
- package/dist/assets/useCommand-CNDe8gM-.js +1 -0
- package/dist/assets/{useEndpointResource-61E93qP-.js → useEndpointResource-CmMwteuX.js} +1 -1
- package/dist/assets/{usePaths-B-QGqa_I.js → usePaths-CvUbx5-V.js} +1 -1
- package/dist/assets/{useUiFeedback-CycH_fvY.js → useUiFeedback-CWb6o71Z.js} +1 -1
- package/dist/assets/useVibe64ConversationLog-CUWEZhnf.js +2 -0
- package/dist/assets/{useVibe64Learning-DZCyrfpy.js → useVibe64Learning-RE4HXHqo.js} +1 -1
- package/dist/assets/{useVibe64SessionData-rBvWMqyc.js → useVibe64SessionData-kGr7R7lG.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-C546mBu8.js → useVibe64SessionSelection-BZ7WnRv0.js} +1 -1
- package/dist/assets/validators-HqYRjxEO.js +1 -0
- package/dist/assets/{vibe64FileUpload-D0Lv2mMJ.js → vibe64FileUpload-BDkcaUyk.js} +1 -1
- package/dist/assets/vibe64GithubProject-CJneIo5O.js +1 -0
- package/dist/assets/vibe64RepositoryRealtime-R5QhcJ4H.js +1 -0
- package/dist/assets/vibe64SessionFocus-BCojr4E-.css +1 -0
- package/dist/assets/vibe64SessionFocus-CHKCMxcJ.js +1 -0
- package/dist/index.html +29 -27
- package/docs/colleague-usage/ai-tasks.md +15 -4
- package/docs/colleague-usage/back-navigation.md +16 -13
- package/docs/colleague-usage/coding-agent-goal-pause.md +15 -1
- package/docs/colleague-usage/coding-agent-goals.md +23 -3
- package/docs/colleague-usage/coding-agent-recovery.md +3 -1
- package/docs/colleague-usage/coding-agents.md +19 -1
- package/docs/colleague-usage/colleague-watches.md +1 -1
- package/docs/colleague-usage/connected-projects.md +1 -1
- package/docs/colleague-usage/connected-repositories.md +16 -4
- package/docs/colleague-usage/dashboard-navigation.md +14 -11
- package/docs/colleague-usage/database.md +1 -1
- package/docs/colleague-usage/development-env.md +21 -12
- package/docs/colleague-usage/files.md +2 -1
- package/docs/colleague-usage/github-work.md +51 -12
- package/docs/colleague-usage/health-checks.md +1 -1
- package/docs/colleague-usage/integrations.md +2 -2
- package/docs/colleague-usage/learning-teacher-guide.md +3 -2
- package/docs/colleague-usage/pages.md +1 -2
- package/docs/colleague-usage/preview-browser-checks.md +3 -0
- package/docs/colleague-usage/preview.md +29 -0
- package/docs/colleague-usage/project-messages.md +4 -3
- package/docs/colleague-usage/project-settings.md +3 -0
- package/docs/colleague-usage/session-archive.md +11 -0
- package/docs/colleague-usage/sessions.md +8 -7
- package/docs/colleague-usage/temporary-chats.md +4 -3
- package/docs/colleague-usage/ui-pass.md +1 -1
- package/docs/colleague-usage/usage-map.md +3 -2
- package/docs/colleague-usage/workspace-preparation.md +12 -0
- package/node_modules/@jskit-ai/agent/CHANGELOG.md +5 -0
- package/node_modules/@jskit-ai/agent/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +8 -0
- package/node_modules/@jskit-ai/assistant-core/locales/en.json +4 -1
- package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +4 -0
- package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
- package/node_modules/@jskit-ai/connector-google-calendar/CHANGELOG.md +4 -0
- package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-catalog/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
- package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +2 -0
- package/node_modules/@jskit-ai/connectors-core/README.md +4 -0
- package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
- package/node_modules/@jskit-ai/http-runtime/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +8 -0
- package/node_modules/@jskit-ai/kernel/package.json +3 -1
- package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/payments-core/locales/en.json +2 -1
- package/node_modules/@jskit-ai/payments-core/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/realtime/package.json +1 -1
- package/node_modules/@jskit-ai/resource-core/CHANGELOG.md +1 -0
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
- package/node_modules/@local/vibe64-ai-tasks/package.json +2 -1
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +463 -442
- package/node_modules/@local/vibe64-genesis/bin/genesis +17 -11
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +827 -813
- package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +93 -67
- package/node_modules/@local/vibe64-genesis/src/server/index.js +608 -584
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +180 -175
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +490 -479
- package/node_modules/@local/vibe64-source-editor/src/server/searchIndexWorker.js +12 -11
- package/node_modules/@local/vibe64-system-graph/README.md +9 -5
- package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +262 -252
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1026 -981
- package/node_modules/json-rest-schema/README.md +3 -1
- package/node_modules/json-rest-schema/package.json +1 -1
- package/package.json +17 -17
- package/server.bundle.mjs +43244 -42953
- package/dist/assets/Vibe64AuthSettingsButton-Bx9patil.js +0 -5
- package/dist/assets/Vibe64FileArea-DIDyAUvD.js +0 -1
- package/dist/assets/Vibe64OutputControls-mNWUWLSm.js +0 -8
- package/dist/assets/Vibe64UiStoryboardView-BXH2MSWn.js +0 -8
- package/dist/assets/_pageId_-D54CqzqG.js +0 -1
- package/dist/assets/_sessionId_-B5V2Fs2n.css +0 -1
- package/dist/assets/_sessionId_-CW044RVi.js +0 -1
- package/dist/assets/_sessionTool_-Be88HWbv.css +0 -1
- package/dist/assets/_slug_-CRtFhc0A.js +0 -14
- package/dist/assets/_slug_-WWvJTLoc.css +0 -1
- package/dist/assets/access-ChMLRErk.js +0 -1
- package/dist/assets/access-Cm2lrMF6.css +0 -1
- package/dist/assets/errorMessageHelpers-L2GsOwCP.js +0 -1
- package/dist/assets/history-BhqQz5jH.css +0 -1
- package/dist/assets/history-HHPFoNi3.js +0 -1
- package/dist/assets/index-BBfSvf2i.css +0 -1
- package/dist/assets/index-Bvd00puv.js +0 -134
- package/dist/assets/issues-BHr_nI-9.js +0 -1
- package/dist/assets/issues-CpBRQTQ_.css +0 -1
- package/dist/assets/publish-Cot797YN.js +0 -3
- package/dist/assets/pull-requests-DnEm9m_1.css +0 -1
- package/dist/assets/pull-requests-ybnixBv0.js +0 -1
- package/dist/assets/settings-DJByC5Wb.js +0 -1
- package/dist/assets/settings-bEkDjn0Y.css +0 -1
- package/dist/assets/useArchivedVibe64Sessions-B-DtXrk-.js +0 -1
- package/dist/assets/useAssistantAttachments-CkseokGM.js +0 -2
- package/dist/assets/useCommand-D96utlVe.js +0 -1
- package/dist/assets/useVibe64ConversationLog-BVANhCHq.js +0 -2
- package/dist/assets/validators-B3YzM6px.js +0 -1
- package/dist/assets/vibe64GithubProject-DNl0aDcC.js +0 -1
- package/dist/assets/vibe64RepositoryRealtime-BPsE5l5E.js +0 -1
- package/dist/assets/vibe64SessionFocus-CxX2nK6F.js +0 -1
- package/dist/assets/vibe64SessionFocus-DW73PN_o.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as openBlock,f as createBlock,p as createCommentVNode}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{t as Vibe64RepositoryWorkspace_default}from"./Vibe64RepositoryWorkspace-
|
|
1
|
+
import{H as openBlock,f as createBlock,p as createCommentVNode}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{t as Vibe64RepositoryWorkspace_default}from"./Vibe64RepositoryWorkspace-CBsySPXN.js";var _sfc_main={__name:`index`,props:{dashboardContext:{default:()=>({}),type:Object}},setup(__props){return(_ctx,_cache)=>{return __props.dashboardContext.active!==false?(openBlock(),createBlock(Vibe64RepositoryWorkspace_default,{key:0,"dashboard-context":__props.dashboardContext,view:`history`},null,8,[`dashboard-context`])):createCommentVNode(``,true)}}};export{_sfc_main as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.project-settings__section-copy[data-v-155efa6f],.project-settings__content[data-v-155efa6f]{gap:1rem;min-width:0;display:grid}.project-settings__section-copy[data-v-155efa6f]{align-content:start;gap:.5rem}.project-settings__section-copy p[data-v-155efa6f],.project-settings__content p[data-v-155efa6f]{overflow-wrap:anywhere;margin:0}.connection-entry[data-v-155efa6f]{border:0;gap:.75rem;min-width:0;margin:1rem 0;padding:0;display:grid}.connection-entry legend[data-v-155efa6f]{margin-bottom:.75rem}.connection-actions[data-v-155efa6f]{flex-wrap:wrap;gap:.75rem;display:flex}.project-settings[data-v-aebab399]{width:100%;min-width:0;max-width:76rem;container:project-settings/inline-size}.project-settings__header[data-v-aebab399]{justify-content:space-between;align-items:start;gap:1rem;padding-block-end:1.5rem;display:flex}.project-settings p[data-v-aebab399],.project-settings h2[data-v-aebab399]{margin:0}.project-settings p[data-v-aebab399]{color:rgba(var(--v-theme-on-surface), .7);overflow-wrap:anywhere}.project-settings__header p[data-v-aebab399]{margin-top:.5rem}.project-settings__refresh[data-v-aebab399]{flex:none}.project-settings__section[data-v-aebab399]{border-top:thin solid rgba(var(--v-border-color), var(--v-border-opacity));grid-template-columns:minmax(12rem,1fr) minmax(0,2fr);align-items:start;gap:1.5rem 2rem;padding-block:1.5rem;display:grid}.project-settings__section-copy[data-v-aebab399],.project-settings__content[data-v-aebab399],.project-settings__action[data-v-aebab399]{gap:1rem;min-width:0;display:grid}.project-settings__section-copy[data-v-aebab399]{align-content:start;gap:.5rem}.project-settings__action[data-v-aebab399]{justify-items:start}.project-settings__account-link[data-v-aebab399]{justify-self:start;margin-inline-start:-.75rem}.project-settings__engineering-field[data-v-aebab399],.project-settings__option[data-v-aebab399]{min-width:0}.project-settings .project-settings__option-support[data-v-aebab399]{margin-inline-start:2.5rem}.project-settings__ai-fields[data-v-aebab399]{grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:1.5rem 1rem;min-width:0;display:grid}.project-settings__ai-note[data-v-aebab399]{grid-column:1/-1}@container project-settings (width<=48rem){.project-settings__section[data-v-aebab399]{grid-template-columns:minmax(0,1fr)}}.vibe64-dashboard-page[data-v-d998a641]{gap:.75rem;min-width:0;display:grid}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Et as unref,G as renderList,H as openBlock,Xt as toDisplayString,b as createVNode,d as createBaseVNode,f as createBlock,ft as isRef,i as Fragment,it as watch,m as createElementBlock,ot as withCtx,p as createCommentVNode,u as computed,vt as ref,y as createTextVNode}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{t as useEndpointResource}from"./useEndpointResource-CmMwteuX.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-rsYWyW6m.js";import{t as VSelect}from"./VSelect-9lMtP5cu.js";import{t as VAlert}from"./VAlert-DyCQWe9P.js";import{t as VTextField}from"./VTextField-BMvaWVTN.js";import{i as scopedDevelopmentApiUrl}from"./studioUrls-k_pQIuPs.js";import{o as ROUTE_VISIBILITY_PUBLIC}from"./visibility-Cq31Xy7I.js";import{t as VBtn}from"./VBtn-2vbH580C.js";import{t as VCheckbox}from"./VCheckbox-B40zJSbZ.js";import{n as VRadio,t as VRadioGroup}from"./VRadioGroup-D1duMMwJ.js";import{t as VSwitch}from"./VSwitch-DUkp5sfW.js";import{t as VTextarea}from"./VTextarea-CLaWcpd_.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{r as useRealtimeEvent}from"./useRealtimeEvent-B4oRg9Dt.js";import{t as _sfc_main$3}from"./SelectField-DwWoHC2p.js";import{t as useCommand}from"./useCommand-CNDe8gM-.js";import{o as reloadPage}from"./browser-D8z6v6Ge.js";import{c as VIBE64_SESSION_SUMMARY_CHANGED_EVENT}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{A as projectSettingsQueryKey,E as engineeringSettingsQueryKey,S as VIBE64_PROJECT_CHANGED_EVENT,T as VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX,_ as VIBE64_ENGINEERING_API_SUFFIX,d as PROMPT_HINTS_SETTINGS_ENDPOINT,g as VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX,m as VIBE64_COLLABORATION_API_SUFFIX,n as DEVELOPMENT_DATABASE_ENDPOINT,r as ENGINEERING_ENDPOINT,t as COLLABORATION_ENDPOINT,u as PROJECT_SETTINGS_ENDPOINT}from"./studioGateApi-UqmdV50W.js";import{A as requestVibe64AccountConnectionsDialog,N as useVibe64ProjectSlug}from"./index-fXKdz8oR.js";import{t as Vibe64AsyncModuleState_default}from"./Vibe64AsyncModuleState-C9rLM2H0.js";import{t as sessionListRealtimeShouldRefresh}from"./useVibe64SessionData-kGr7R7lG.js";var CONNECTED_CUSTOM_PACKAGE_TYPE=`custom`;var CONNECTED_PACKAGE_TYPES=Object.freeze([Object.freeze({value:`npm`,label:`npm (Node.js)`}),Object.freeze({value:`composer`,label:`Composer (PHP)`}),Object.freeze({value:`pip`,label:`pip (Python)`}),Object.freeze({value:`bundler`,label:`Bundler (Ruby)`}),Object.freeze({value:`gomod`,label:`Go modules`}),Object.freeze({value:`cargo`,label:`Cargo (Rust)`}),Object.freeze({value:`maven`,label:`Maven`}),Object.freeze({value:`gradle`,label:`Gradle`}),Object.freeze({value:`nuget`,label:`NuGet (.NET)`}),Object.freeze({value:CONNECTED_CUSTOM_PACKAGE_TYPE,label:`custom`})]);var CONNECTED_PACKAGE_TYPE_VALUES=Object.freeze(CONNECTED_PACKAGE_TYPES.map(type=>type.value));function connectedPackageTypeUsesScript(type){return type===CONNECTED_CUSTOM_PACKAGE_TYPE}var _hoisted_1$2={class:`project-settings__section`,"aria-labelledby":`connected-projects-title`};var _hoisted_2$1={class:`project-settings__content text-body-medium`};var _hoisted_3$1={key:0};var _hoisted_4$1={key:0};var _hoisted_5$1=[`disabled`];var _hoisted_6$1={class:`text-label-large`};var _hoisted_7$1={key:2};var _hoisted_8$1={class:`connection-actions`};var _sfc_main$2={__name:`ConnectedProjectsSettings`,props:{projectSlug:{type:String,required:true},state:{type:Object,default:()=>({})}},emits:[`saved`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const draft=ref([]);const baseline=ref(`[]`);const revision=ref(``);const saving=ref(false);const changed=computed(()=>JSON.stringify(draft.value)!==baseline.value);const stale=computed(()=>props.state.available&&revision.value!==props.state.revision);const relationships=[{label:`Dependency — a library or tool`,value:`dependency`},{label:`Composition — source assembled into this project`,value:`composition`}];const packageTypes=[{label:`Stack default`,value:``},...CONNECTED_PACKAGE_TYPES];function scriptAllowed(entry){return!entry.type||connectedPackageTypeUsesScript(entry.type)}function setPackageType(entry,value){if(value)entry.type=value;else delete entry.type;if(!scriptAllowed(entry))delete entry.script}function setScript(entry,value){if(value)entry.script=value;else delete entry.script}function resetDraft(){draft.value=(props.state.repositories||[]).map(entry=>({...entry}));baseline.value=JSON.stringify(draft.value);revision.value=props.state.revision||``}let sourceIdentity=``;watch(()=>[props.projectSlug,props.state],()=>{if(!props.state.source)return;const identity=JSON.stringify([props.projectSlug,props.state.source]);if(identity!==sourceIdentity||!changed.value)resetDraft();sourceIdentity=identity},{immediate:true});const saveCommand=useCommand({access:`never`,apiSuffix:`/vibe64/settings/connections`,buildCommandOptions:()=>({method:`PUT`,path:scopedDevelopmentApiUrl(`/api/vibe64/settings/connections`,props.projectSlug)}),buildRawPayload:(_model,{context})=>context,fallbackRunError:`Connected repositories could not be saved.`,messages:{error:`Connected repositories could not be saved.`,success:`Connected repositories saved in source.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.project.connections.save`,surfaceId:`app`,writeMethod:`PUT`});async function save(){if(saving.value||stale.value||!props.state.canEdit)return;saving.value=true;try{if(!await saveCommand.run({repositories:draft.value.map(entry=>({...entry})),revision:revision.value,sessionId:props.state.source?.sessionId||``}))return;baseline.value=JSON.stringify(draft.value);emit(`saved`)}catch{}finally{saving.value=false}}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$2,[_cache[6]||(_cache[6]=createBaseVNode(`div`,{class:`project-settings__section-copy text-body-medium`},[createBaseVNode(`h2`,{id:`connected-projects-title`,class:`text-title-medium font-weight-bold`},`Connected repositories`),createBaseVNode(`p`,null,`Libraries and source projects you contribute to from this project.`),createBaseVNode(`p`,null,[createTextVNode(`Saved in this source checkout’s `),createBaseVNode(`code`,null,`vibe64.connections.json`),createTextVNode(`. Changes follow normal project Save.`)])],-1)),createBaseVNode(`div`,_hoisted_2$1,[!__props.state.available?(openBlock(),createElementBlock(`p`,_hoisted_3$1,toDisplayString(__props.state.unavailableReason||`Select a session to configure connected repositories.`),1)):(openBlock(),createElementBlock(Fragment,{key:1},[!__props.state.exists?(openBlock(),createElementBlock(`p`,_hoisted_4$1,`No connection file yet. Add repositories below, then save the list.`)):createCommentVNode(``,true),stale.value?(openBlock(),createBlock(VAlert,{key:1,type:`warning`,variant:`tonal`},{default:withCtx(()=>[_cache[2]||(_cache[2]=createTextVNode(` The saved list changed while you were editing. Reload the saved list and review your changes before saving. `,-1)),createVNode(VBtn,{variant:`text`,onClick:resetDraft},{default:withCtx(()=>[..._cache[1]||(_cache[1]=[createTextVNode(`Reload saved list`,-1)])]),_:1})]),_:1})):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(draft.value,(entry,index)=>{return openBlock(),createElementBlock(`fieldset`,{key:index,class:`connection-entry`,disabled:!__props.state.canEdit||saving.value},[createBaseVNode(`legend`,_hoisted_6$1,`Connected repository `+toDisplayString(index+1),1),createVNode(VTextField,{disabled:!__props.state.canEdit||saving.value,modelValue:entry.name,"onUpdate:modelValue":$event=>entry.name=$event,label:`Name`,maxlength:`100`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`modelValue`,`onUpdate:modelValue`]),createVNode(VTextField,{disabled:!__props.state.canEdit||saving.value,modelValue:entry.repository,"onUpdate:modelValue":$event=>entry.repository=$event,label:`GitHub repository URL`,placeholder:`https://github.com/owner/repository`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`modelValue`,`onUpdate:modelValue`]),createVNode(VSelect,{disabled:!__props.state.canEdit||saving.value,modelValue:entry.relationship,"onUpdate:modelValue":$event=>entry.relationship=$event,label:`Relationship`,items:relationships,"item-title":`label`,"item-value":`value`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`modelValue`,`onUpdate:modelValue`]),createVNode(VSelect,{disabled:!__props.state.canEdit||saving.value,"model-value":entry.type||``,"onUpdate:modelValue":$event=>setPackageType(entry,$event),label:`Package type`,items:packageTypes,"item-title":`label`,"item-value":`value`,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`model-value`,`onUpdate:modelValue`]),createVNode(VTextField,{disabled:!__props.state.canEdit||saving.value||!scriptAllowed(entry),"model-value":entry.script||``,"onUpdate:modelValue":$event=>setScript(entry,$event),label:`Preparation script (project-relative)`,placeholder:`tooling/prepare-native-worker.mjs`,maxlength:`1024`,hint:`Required for custom. Relative to this project's root; Stack declares the runtime.`,"persistent-hint":``,variant:`outlined`,"hide-details":`auto`},null,8,[`disabled`,`model-value`,`onUpdate:modelValue`]),createVNode(VBtn,{disabled:!__props.state.canEdit||saving.value,variant:`text`,"aria-label":`Remove ${entry.name||`connected repository`}`,onClick:$event=>draft.value.splice(index,1)},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Remove`,-1)])]),_:1},8,[`disabled`,`aria-label`,`onClick`])],8,_hoisted_5$1)}),128)),__props.state.exists&&!draft.value.length?(openBlock(),createElementBlock(`p`,_hoisted_7$1,`No connected repositories.`)):createCommentVNode(``,true),_cache[5]||(_cache[5]=createBaseVNode(`p`,{class:`text-body-small`},`Removing a connection keeps each session's copy of it until that copy's work is saved.`,-1)),createBaseVNode(`div`,_hoisted_8$1,[createVNode(VBtn,{disabled:!__props.state.canEdit||saving.value||draft.value.length>=unref(64),variant:`outlined`,onClick:_cache[0]||(_cache[0]=$event=>draft.value.push({name:``,repository:``,relationship:`dependency`}))},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Add repository`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{disabled:!__props.state.canEdit||saving.value||stale.value||!changed.value&&__props.state.exists,color:`primary`,variant:`flat`,onClick:save},{default:withCtx(()=>[createTextVNode(toDisplayString(saving.value?`Saving…`:`Save connected repositories`),1)]),_:1},8,[`disabled`])])],64))])])}}};var ConnectedProjectsSettings_default=_plugin_vue_export_helper_default(_sfc_main$2,[[`__scopeId`,`data-v-155efa6f`]]);function normalizeCollaborationDraft(value={}){return{tone:String(value.tone||``),responseLength:String(value.responseLength||``),experience:String(value.experience||``),explanationStyle:String(value.explanationStyle||``),requirements:String(value.requirements||``)}}function collaborationChoiceOptions(collaboration={},field=``){const choices=collaboration.choices?.[field];return(Array.isArray(choices)?choices:[]).flatMap(choice=>{const value=String(choice?.id||``).trim();const label=String(choice?.name||``).trim();return value&&label?[{label,value}]:[]})}function useVibe64CollaborationSettings({projectSlug,resource,routeSessionId}){const collaborationDraft=ref(normalizeCollaborationDraft());const savedCollaboration=ref(normalizeCollaborationDraft());const collaborationSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_COLLABORATION_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:COLLABORATION_ENDPOINT}),buildRawPayload:(_model,{context})=>({...context.collaboration,...context.sessionId?{sessionId:context.sessionId}:{}}),fallbackRunError:`Collaboration guidance could not be saved.`,messages:{error:`Collaboration guidance could not be saved.`,success:`Collaboration guidance saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.collaboration.save`,surfaceId:`app`,writeMethod:`PUT`});const collaboration=computed(()=>resource.data.value?.collaboration||{});const collaborationAvailable=computed(()=>collaboration.value.available===true);const collaborationCanEdit=computed(()=>collaboration.value.canEdit===true);const collaborationSourceLabel=computed(()=>collaboration.value.source?.rootKind===`session-source`?`This session's project source`:`This project source`);const collaborationUnavailableReason=computed(()=>String(collaboration.value.unavailableReason||`Collaboration guidance is not available for this source.`));const toneOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`tone`));const responseLengthOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`responseLength`));const experienceOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`experience`));const explanationStyleOptions=computed(()=>collaborationChoiceOptions(collaboration.value,`explanationStyle`));const collaborationSaving=ref(false);const collaborationChanged=computed(()=>JSON.stringify(collaborationDraft.value)!==JSON.stringify(savedCollaboration.value));let collaborationSource=null;watch([projectSlug,collaboration],([slug,value])=>{if(!value.source)return;const sourceChanged=!collaborationSource||collaborationSource.projectSlug!==slug||collaborationSource.rootKind!==value.source.rootKind||collaborationSource.sessionId!==value.source.sessionId;const next=normalizeCollaborationDraft(value);if(sourceChanged||!collaborationChanged.value)collaborationDraft.value=next;savedCollaboration.value={...next};collaborationSource={projectSlug:slug,...value.source}},{immediate:true});async function saveCollaboration(){if(!collaborationChanged.value||!collaborationAvailable.value||!collaborationCanEdit.value||collaborationSaving.value)return;collaborationSaving.value=true;try{try{await collaborationSaveCommand.run({collaboration:normalizeCollaborationDraft(collaborationDraft.value),sessionId:routeSessionId.value||String(collaboration.value.source?.sessionId||``).trim()})}catch{return}await resource.reload()}finally{collaborationSaving.value=false}}return{collaborationAvailable,collaborationCanEdit,collaborationChanged,collaborationDraft,collaborationSaving,collaborationSourceLabel,collaborationUnavailableReason,experienceOptions,explanationStyleOptions,responseLengthOptions,saveCollaboration,toneOptions}}function useVibe64DevelopmentDatabaseSettings({resource}){const scopeDraft=ref(`session`);const sharedSessionsDraft=ref(false);const databaseSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:DEVELOPMENT_DATABASE_ENDPOINT}),buildRawPayload:(_model,{context})=>({scope:context.scope,allowSharedDatabaseSessions:context.allowSharedDatabaseSessions}),fallbackRunError:`Development database choice could not be saved.`,messages:{error:`Development database choice could not be saved.`,success:`Development database choice saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.development-database.scope.save`,surfaceId:`app`,writeMethod:`PUT`});const developmentDatabase=computed(()=>resource.data.value?.developmentDatabase||{});const managed=computed(()=>developmentDatabase.value.managed===true);const canChange=computed(()=>developmentDatabase.value.canChange===true);const disabledReason=computed(()=>String(developmentDatabase.value.disabledReason||``));const sessionScopeOption=computed(()=>developmentDatabase.value.options?.session||{});const projectScopeOption=computed(()=>developmentDatabase.value.options?.project||{});const sessionScopeAvailable=computed(()=>sessionScopeOption.value.available===true);const projectScopeAvailable=computed(()=>projectScopeOption.value.available===true);const sessionScopeReason=computed(()=>String(sessionScopeOption.value.disabledReason||``));const projectScopeReason=computed(()=>String(projectScopeOption.value.disabledReason||``));const scopeDraftAvailable=computed(()=>scopeDraft.value===`project`?projectScopeAvailable.value:sessionScopeAvailable.value);const databaseSaving=computed(()=>databaseSaveCommand.isRunning===true);const databaseChanged=computed(()=>managed.value&&(scopeDraft.value!==developmentDatabase.value.scope||sharedSessionsDraft.value!==(developmentDatabase.value.allowSharedDatabaseSessions===true)));const databaseSaveAllowed=computed(()=>scopeDraft.value===developmentDatabase.value.scope||canChange.value&&scopeDraftAvailable.value);watch(()=>developmentDatabase.value.allowSharedDatabaseSessions,value=>{sharedSessionsDraft.value=value===true},{immediate:true});watch(()=>developmentDatabase.value.scope,scope=>{if([`project`,`session`].includes(scope))scopeDraft.value=scope},{immediate:true});async function saveDatabase(){if(!databaseChanged.value||!databaseSaveAllowed.value||databaseSaving.value)return;await databaseSaveCommand.run({scope:scopeDraft.value,allowSharedDatabaseSessions:sharedSessionsDraft.value});await resource.reload()}return{databaseChanged,databaseSaveAllowed,databaseSaving,disabledReason,managed,projectScopeAvailable,projectScopeReason,saveDatabase,scopeDraft,sessionScopeAvailable,sessionScopeReason,sharedSessionsDraft}}function useVibe64EngineeringSettings({projectSlug,route,router,routeSessionId}){const engineeringProfileDraft=ref(``);const savedEngineeringProfile=ref(``);const engineeringResource=useEndpointResource({fallbackLoadError:`Engineering approach could not load.`,path:computed(()=>scopedDevelopmentApiUrl(ENGINEERING_ENDPOINT,projectSlug.value)),queryKey:computed(()=>engineeringSettingsQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value,routeSessionId.value)),readQuery:computed(()=>routeSessionId.value?{sessionId:routeSessionId.value}:{}),realtime:{event:VIBE64_PROJECT_CHANGED_EVENT,matches:()=>!engineeringSaveCommand.isRunning},refreshOnPull:true,requestRecoveryLabel:`Engineering approach`});const engineeringSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_ENGINEERING_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:ENGINEERING_ENDPOINT}),buildRawPayload:(_model,{context})=>({profile:context.profile,...context.sessionId?{sessionId:context.sessionId}:{}}),fallbackRunError:`Engineering approach could not be saved.`,messages:{error:`Engineering approach could not be saved.`,success:`Engineering approach saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.engineering.profile.save`,surfaceId:`app`,writeMethod:`PUT`});const engineering=computed(()=>engineeringResource.data.value?.engineering||{});const engineeringAvailable=computed(()=>engineering.value.available===true);const engineeringProfiles=computed(()=>Array.isArray(engineering.value.profiles)?engineering.value.profiles:[]);const engineeringSourceLabel=computed(()=>engineering.value.source?.rootKind===`session-source`?`This session's project source`:`This project source`);const engineeringUnavailableReason=computed(()=>String(engineering.value.unavailableReason||`An engineering profile is not available for this source.`));const selectedEngineeringDescription=computed(()=>String(engineeringProfiles.value.find(profile=>profile.id===engineeringProfileDraft.value)?.description||``));const engineeringStatusText=computed(()=>engineering.value.status===`defaulted`?`The focused default is active. Saving records the choice in genesis/engineering.md.`:`This choice is stored in genesis/engineering.md and follows the source.`);const engineeringSaving=ref(false);const engineeringChanged=computed(()=>engineeringAvailable.value&&Boolean(engineeringProfileDraft.value)&&engineeringProfileDraft.value!==savedEngineeringProfile.value);let engineeringSource=null;watch([projectSlug,engineering],([slug,value])=>{if(!value.source)return;const sourceChanged=!engineeringSource||engineeringSource.projectSlug!==slug||engineeringSource.rootKind!==value.source.rootKind||engineeringSource.sessionId!==value.source.sessionId;const profile=String(value.profile?.id||``).trim();if(sourceChanged||engineeringProfileDraft.value===savedEngineeringProfile.value)engineeringProfileDraft.value=profile;savedEngineeringProfile.value=profile;engineeringSource={projectSlug:slug,...value.source};const sourceSessionId=String(value.source?.sessionId||``).trim();if(!routeSessionId.value&&sourceSessionId)router.replace({query:{...route.query,sessionId:sourceSessionId}})},{immediate:true});async function saveEngineeringProfile(){if(!engineeringChanged.value||engineeringSaving.value)return;engineeringSaving.value=true;try{await engineeringSaveCommand.run({profile:engineeringProfileDraft.value,sessionId:routeSessionId.value||String(engineering.value.source?.sessionId||``).trim()})}catch{}finally{try{await engineeringResource.reload()}finally{engineeringSaving.value=false}}}return{engineeringAvailable,engineeringChanged,engineeringProfileDraft,engineeringProfiles,engineeringResource,engineeringSaving,engineeringSourceLabel,engineeringStatusText,engineeringUnavailableReason,saveEngineeringProfile,selectedEngineeringDescription}}var _hoisted_1$1={class:`project-settings`};var _hoisted_2={class:`project-settings__header`};var _hoisted_3={class:`project-settings__section`,"aria-labelledby":`engineering-approach-title`};var _hoisted_4={class:`project-settings__section-copy text-body-medium`};var _hoisted_5={key:0,class:`project-settings__scope text-label-medium`};var _hoisted_6={key:0,class:`project-settings__content text-body-medium`};var _hoisted_7={class:`project-settings__engineering-field`};var _hoisted_8={class:`project-settings__action text-body-small`};var _hoisted_9={key:1,class:`project-settings__action text-body-small`};var _hoisted_10={class:`project-settings__section`,"aria-labelledby":`development-database-title`};var _hoisted_11={class:`project-settings__section-copy text-body-medium`};var _hoisted_12={key:0};var _hoisted_13={key:1};var _hoisted_14={key:0,class:`project-settings__content text-body-medium`};var _hoisted_15={class:`project-settings__option`};var _hoisted_16={key:0,id:`development-database-session-reason`,class:`project-settings__option-support text-body-small`};var _hoisted_17={class:`project-settings__option`};var _hoisted_18={key:0,id:`development-database-project-reason`,class:`project-settings__option-support text-body-small`};var _hoisted_19={key:0,class:`project-settings__action text-body-small`};var _hoisted_20={class:`project-settings__action text-body-small`};var _hoisted_21={key:0};var _hoisted_22={key:1};var _hoisted_23={class:`project-settings__section`,"aria-labelledby":`ai-behaviour-title`};var _hoisted_24={class:`project-settings__section-copy text-body-medium`};var _hoisted_25={class:`project-settings__scope text-label-medium`};var _hoisted_26={class:`project-settings__content text-body-medium`};var _hoisted_27={class:`project-settings__ai-fields`};var _hoisted_28={class:`project-settings__action text-body-small`};var _hoisted_29={key:0};var _hoisted_30={key:1};var _hoisted_31={key:2};var _hoisted_32={class:`project-settings__section`,"aria-labelledby":`prompt-suggestions-title`};var _hoisted_33={class:`project-settings__content text-body-medium`};var _hoisted_34={class:`project-settings__action text-body-small`};var _hoisted_35={key:0,class:`project-settings__section`,"aria-labelledby":`repository-workflow-title`};var _hoisted_36={class:`project-settings__content text-body-medium`};var _hoisted_37={class:`project-settings__action text-body-small`};var _sfc_main$1={__name:`ProjectSettingsPanel`,setup(__props){const projectSlug=useVibe64ProjectSlug();const route=useRoute();const router=useRouter();const promptHintsDraft=ref(true);const savedPromptHints=ref(true);const requirePullRequest=ref(false);const routeSessionId=computed(()=>String(route.query.sessionId||``).trim());const resource=useEndpointResource({fallbackLoadError:`Project settings could not load.`,path:computed(()=>scopedDevelopmentApiUrl(PROJECT_SETTINGS_ENDPOINT,projectSlug.value)),queryKey:computed(()=>projectSettingsQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value,routeSessionId.value)),readQuery:computed(()=>routeSessionId.value?{sessionId:routeSessionId.value}:{}),refreshOnPull:true,requestRecoveryLabel:`Project settings`});const{databaseChanged,databaseSaveAllowed,databaseSaving,disabledReason,managed,projectScopeAvailable,projectScopeReason,saveDatabase,scopeDraft,sessionScopeAvailable,sessionScopeReason,sharedSessionsDraft}=useVibe64DevelopmentDatabaseSettings({resource});const{collaborationAvailable,collaborationCanEdit,collaborationChanged,collaborationDraft,collaborationSaving,collaborationSourceLabel,collaborationUnavailableReason,experienceOptions,explanationStyleOptions,responseLengthOptions,saveCollaboration,toneOptions}=useVibe64CollaborationSettings({projectSlug,resource,routeSessionId});const promptHintsSaveCommand=useCommand({access:`never`,apiSuffix:VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX,buildCommandOptions:()=>({method:`PUT`,path:PROMPT_HINTS_SETTINGS_ENDPOINT}),buildRawPayload:(_model,{context})=>({promptHints:context.promptHints}),fallbackRunError:`Prompt suggestions could not be saved.`,messages:{error:`Prompt suggestions could not be saved.`,success:`Prompt suggestions saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.prompt-hints.save`,surfaceId:`app`,writeMethod:`PUT`});const repositoryWorkflowCommand=useCommand({access:`never`,apiSuffix:`/vibe64/repository/workflow`,buildCommandOptions:()=>({method:`PUT`,path:scopedDevelopmentApiUrl(`/api/vibe64/repository/workflow`,projectSlug.value)}),buildRawPayload:(_model,{context})=>({requirePullRequest:context.requirePullRequest}),fallbackRunError:`Repository workflow could not be saved.`,messages:{error:`Repository workflow could not be saved.`,success:`Repository workflow saved.`},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:`vibe64.repository.workflow`,surfaceId:`app`,writeMethod:`PUT`});const repositoryWorkflow=computed(()=>resource.data.value?.repositoryWorkflow||{});watch(()=>repositoryWorkflow.value.requirePullRequest,value=>{requirePullRequest.value=value===true},{immediate:true});async function saveRepositoryWorkflow(){await repositoryWorkflowCommand.run({requirePullRequest:requirePullRequest.value});await resource.reload()}const{engineeringAvailable,engineeringChanged,engineeringProfileDraft,engineeringProfiles,engineeringResource,engineeringSaving,engineeringSourceLabel,engineeringStatusText,engineeringUnavailableReason,saveEngineeringProfile,selectedEngineeringDescription}=useVibe64EngineeringSettings({projectSlug,route,router,routeSessionId});const promptHints=computed(()=>resource.data.value?.promptHints||{});const promptHintsCanEdit=computed(()=>promptHints.value.canEdit===true);const loading=computed(()=>resource.isLoading.value===true||engineeringResource.isLoading.value===true);const initialLoading=computed(()=>loading.value&&(!resource.data.value||!engineeringResource.data.value));const loadError=computed(()=>String(resource.loadError.value||engineeringResource.loadError.value||``));const promptHintsSaving=computed(()=>promptHintsSaveCommand.isRunning===true);const promptHintsChanged=computed(()=>promptHintsDraft.value!==savedPromptHints.value);watch(()=>promptHints.value.enabled,value=>{const enabled=value!==false;if(!promptHintsChanged.value)promptHintsDraft.value=enabled;savedPromptHints.value=enabled},{immediate:true});useRealtimeEvent({event:VIBE64_SESSION_SUMMARY_CHANGED_EVENT,matches:event=>sessionListRealtimeShouldRefresh(event,projectSlug.value),onEvent(){resource.reload();engineeringResource.reload()}});async function refresh(){await Promise.all([resource.reload(),engineeringResource.reload()])}async function savePromptHints(){if(!promptHintsChanged.value||!promptHintsCanEdit.value||promptHintsSaving.value)return;await promptHintsSaveCommand.run({promptHints:promptHintsDraft.value});await resource.reload()}function openPersonalSettings(){requestVibe64AccountConnectionsDialog({refresh:false,section:`profile`})}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$1,[createBaseVNode(`header`,_hoisted_2,[_cache[11]||(_cache[11]=createBaseVNode(`div`,null,[createBaseVNode(`h2`,{class:`text-headline-small font-weight-bold ma-0`},`Project settings`),createBaseVNode(`p`,{class:`text-body-medium`},`Choose how you and your AI work on this project.`)],-1)),createVNode(VBtn,{class:`project-settings__refresh`,disabled:loading.value,type:`button`,variant:`text`,onClick:refresh},{default:withCtx(()=>[createTextVNode(toDisplayString(loading.value?`Refreshing…`:`Refresh`),1)]),_:1},8,[`disabled`])]),initialLoading.value||loadError.value?(openBlock(),createBlock(Vibe64AsyncModuleState_default,{key:0,label:`Project settings`,loading:loading.value,message:loadError.value||`Loading project settings.`,"min-height":`12rem`,onReload:unref(reloadPage),onRetry:refresh},null,8,[`loading`,`message`,`onReload`])):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(ConnectedProjectsSettings_default,{"project-slug":unref(projectSlug),state:unref(resource).data.value?.connectedProjects,onSaved:_cache[0]||(_cache[0]=$event=>unref(resource).reload())},null,8,[`project-slug`,`state`]),createBaseVNode(`section`,_hoisted_3,[createBaseVNode(`div`,_hoisted_4,[unref(engineeringAvailable)?(openBlock(),createElementBlock(`p`,_hoisted_5,toDisplayString(unref(engineeringSourceLabel)),1)):createCommentVNode(``,true),_cache[12]||(_cache[12]=createBaseVNode(`h2`,{id:`engineering-approach-title`,class:`text-title-medium font-weight-bold`},`Engineering approach`,-1)),_cache[13]||(_cache[13]=createBaseVNode(`p`,null,` Choose how cautiously the AI changes your software. Every profile keeps changes simple and asks before adding necessary complexity. `,-1))]),unref(engineeringAvailable)?(openBlock(),createElementBlock(`div`,_hoisted_6,[createBaseVNode(`div`,_hoisted_7,[createVNode(unref(_sfc_main$3),{modelValue:unref(engineeringProfileDraft),"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>isRef(engineeringProfileDraft)?engineeringProfileDraft.value=$event:null),disabled:unref(engineeringSaving),density:`comfortable`,"hide-details":`auto`,hint:unref(selectedEngineeringDescription),"item-title":`name`,"item-value":`id`,items:unref(engineeringProfiles),loading:unref(engineeringResource).isLoading.value,label:`Engineering profile`,"persistent-hint":``,variant:`outlined`},null,8,[`modelValue`,`disabled`,`hint`,`items`,`loading`])]),createBaseVNode(`div`,_hoisted_8,[createBaseVNode(`p`,null,toDisplayString(unref(engineeringStatusText)),1),createVNode(VBtn,{disabled:!unref(engineeringChanged)||unref(engineeringSaving),color:unref(engineeringChanged)?`primary`:void 0,type:`button`,variant:`flat`,onClick:unref(saveEngineeringProfile)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(engineeringSaving)?`Saving…`:`Save engineering approach`),1)]),_:1},8,[`disabled`,`color`,`onClick`])])])):(openBlock(),createElementBlock(`div`,_hoisted_9,[createBaseVNode(`p`,null,toDisplayString(unref(engineeringUnavailableReason)),1)]))]),createBaseVNode(`section`,_hoisted_10,[createBaseVNode(`div`,_hoisted_11,[_cache[14]||(_cache[14]=createBaseVNode(`h2`,{id:`development-database-title`,class:`text-title-medium font-weight-bold`},`Development database`,-1)),unref(managed)?(openBlock(),createElementBlock(`p`,_hoisted_12,` Share development data across sessions or keep a separate database for each. `)):(openBlock(),createElementBlock(`p`,_hoisted_13,` This Vibe64 installation does not manage development databases. The application receives its database connection through the project Env configuration. `))]),unref(managed)?(openBlock(),createElementBlock(`div`,_hoisted_14,[createVNode(VRadioGroup,{modelValue:unref(scopeDraft),"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>isRef(scopeDraft)?scopeDraft.value=$event:null),"aria-labelledby":`development-database-title`,class:`project-settings__options`,disabled:unref(databaseSaving),"hide-details":``},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_15,[createVNode(VRadio,{class:`py-1`,"aria-describedby":unref(sessionScopeReason)?`development-database-session-reason`:void 0,disabled:!unref(sessionScopeAvailable),label:`A separate database for each session`,value:`session`},null,8,[`aria-describedby`,`disabled`]),unref(sessionScopeReason)?(openBlock(),createElementBlock(`p`,_hoisted_16,toDisplayString(unref(sessionScopeReason)),1)):createCommentVNode(``,true)]),createBaseVNode(`div`,_hoisted_17,[createVNode(VRadio,{class:`py-1`,"aria-describedby":unref(projectScopeReason)?`development-database-project-reason`:void 0,disabled:!unref(projectScopeAvailable),label:`One database shared by this project`,value:`project`},null,8,[`aria-describedby`,`disabled`]),unref(projectScopeReason)?(openBlock(),createElementBlock(`p`,_hoisted_18,toDisplayString(unref(projectScopeReason)),1)):createCommentVNode(``,true)])]),_:1},8,[`modelValue`,`disabled`]),unref(scopeDraft)===`project`?(openBlock(),createElementBlock(`div`,_hoisted_19,[createVNode(VCheckbox,{modelValue:unref(sharedSessionsDraft),"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>isRef(sharedSessionsDraft)?sharedSessionsDraft.value=$event:null),label:`Allow multiple sessions with this shared database`,disabled:unref(databaseSaving),"hide-details":``},null,8,[`modelValue`,`disabled`]),_cache[15]||(_cache[15]=createBaseVNode(`p`,null,`All sessions will share the same database.`,-1))])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_20,[unref(disabledReason)?(openBlock(),createElementBlock(`p`,_hoisted_21,toDisplayString(unref(disabledReason)),1)):unref(scopeDraft)===`project`?(openBlock(),createElementBlock(`p`,_hoisted_22,` Data and schema changes will be visible to every project session and remain after a session is archived. `)):createCommentVNode(``,true),createVNode(VBtn,{disabled:!unref(databaseChanged)||!unref(databaseSaveAllowed)||unref(databaseSaving),color:unref(databaseChanged)?`primary`:void 0,type:`button`,variant:`flat`,onClick:unref(saveDatabase)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(databaseSaving)?`Saving…`:`Save database choice`),1)]),_:1},8,[`disabled`,`color`,`onClick`])])])):createCommentVNode(``,true)]),createBaseVNode(`section`,_hoisted_23,[createBaseVNode(`div`,_hoisted_24,[createBaseVNode(`p`,_hoisted_25,toDisplayString(unref(collaborationSourceLabel)),1),_cache[17]||(_cache[17]=createBaseVNode(`h2`,{id:`ai-behaviour-title`,class:`text-title-medium font-weight-bold`},`AI behaviour`,-1)),_cache[18]||(_cache[18]=createBaseVNode(`p`,null,` Set the tone, level of detail and project requirements for your conversations. These choices follow your project source. `,-1)),createVNode(VBtn,{class:`project-settings__account-link`,type:`button`,variant:`text`,onClick:openPersonalSettings},{default:withCtx(()=>[..._cache[16]||(_cache[16]=[createTextVNode(` Set your Vibe64 name `,-1)])]),_:1})]),createBaseVNode(`div`,_hoisted_26,[createBaseVNode(`div`,_hoisted_27,[createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).tone,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>unref(collaborationDraft).tone=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(toneOptions),loading:unref(resource).isLoading.value,label:`Tone`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).responseLength,"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>unref(collaborationDraft).responseLength=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(responseLengthOptions),loading:unref(resource).isLoading.value,label:`Response length`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).experience,"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>unref(collaborationDraft).experience=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(experienceOptions),loading:unref(resource).isLoading.value,label:`Experience level`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(unref(_sfc_main$3),{modelValue:unref(collaborationDraft).explanationStyle,"onUpdate:modelValue":_cache[7]||(_cache[7]=$event=>unref(collaborationDraft).explanationStyle=$event),disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),density:`comfortable`,"hide-details":``,"item-title":`label`,"item-value":`value`,items:unref(explanationStyleOptions),loading:unref(resource).isLoading.value,label:`Explanation style`,variant:`outlined`},null,8,[`modelValue`,`disabled`,`items`,`loading`]),createVNode(VTextarea,{modelValue:unref(collaborationDraft).requirements,"onUpdate:modelValue":_cache[8]||(_cache[8]=$event=>unref(collaborationDraft).requirements=$event),class:`project-settings__ai-note`,disabled:!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),"auto-grow":``,density:`comfortable`,"hide-details":``,label:`Project requirements (optional)`,placeholder:`For example: use Australian English.`,rows:`6`,"max-rows":`18`,variant:`outlined`},null,8,[`modelValue`,`disabled`])]),createBaseVNode(`div`,_hoisted_28,[!unref(collaborationAvailable)?(openBlock(),createElementBlock(`p`,_hoisted_29,toDisplayString(unref(collaborationUnavailableReason)),1)):!unref(collaborationCanEdit)?(openBlock(),createElementBlock(`p`,_hoisted_30,` Only the project owner can change these controls in Settings. Anyone who can edit this source can change genesis/collaboration.md directly. `)):(openBlock(),createElementBlock(`p`,_hoisted_31,` Applies when a conversation next starts or refreshes its context. Existing history and instructions in an active Codex conversation stay as they are. `)),createVNode(VBtn,{disabled:!unref(collaborationChanged)||!unref(collaborationAvailable)||!unref(collaborationCanEdit)||unref(collaborationSaving),color:unref(collaborationChanged)?`primary`:void 0,type:`button`,variant:`flat`,onClick:unref(saveCollaboration)},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(collaborationSaving)?`Saving…`:`Save collaboration`),1)]),_:1},8,[`disabled`,`color`,`onClick`])])])]),createBaseVNode(`section`,_hoisted_32,[_cache[19]||(_cache[19]=createBaseVNode(`div`,{class:`project-settings__section-copy text-body-medium`},[createBaseVNode(`h2`,{id:`prompt-suggestions-title`,class:`text-title-medium font-weight-bold`},`Prompt suggestions`),createBaseVNode(`p`,null,`Get ideas for what to ask next. This Vibe64 setting does not change your AI's instructions.`)],-1)),createBaseVNode(`div`,_hoisted_33,[createVNode(VSwitch,{modelValue:promptHintsDraft.value,"onUpdate:modelValue":_cache[9]||(_cache[9]=$event=>promptHintsDraft.value=$event),class:`project-settings__ai-hints`,color:`primary`,disabled:!promptHintsCanEdit.value||promptHintsSaving.value,"hide-details":``,label:`Suggest useful next prompts`},null,8,[`modelValue`,`disabled`]),createBaseVNode(`div`,_hoisted_34,[createVNode(VBtn,{disabled:!promptHintsChanged.value||!promptHintsCanEdit.value||promptHintsSaving.value,color:promptHintsChanged.value?`primary`:void 0,type:`button`,variant:`flat`,onClick:savePromptHints},{default:withCtx(()=>[createTextVNode(toDisplayString(promptHintsSaving.value?`Saving…`:`Save prompt suggestions`),1)]),_:1},8,[`disabled`,`color`])])])]),repositoryWorkflow.value.available?(openBlock(),createElementBlock(`section`,_hoisted_35,[_cache[22]||(_cache[22]=createBaseVNode(`div`,{class:`project-settings__section-copy text-body-medium`},[createBaseVNode(`h2`,{id:`repository-workflow-title`,class:`text-title-medium font-weight-bold`},`Git workflow`),createBaseVNode(`p`,null,`Choose how Vibe64 saves changes to this repository.`)],-1)),createBaseVNode(`div`,_hoisted_36,[createVNode(VRadioGroup,{modelValue:requirePullRequest.value,"onUpdate:modelValue":_cache[10]||(_cache[10]=$event=>requirePullRequest.value=$event),label:`GitHub save workflow`,color:`primary`,"hide-details":``,disabled:!repositoryWorkflow.value.canEdit||unref(repositoryWorkflowCommand).isRunning},{default:withCtx(()=>[createVNode(VRadio,{label:`Allow direct commits and pushes`,value:false,class:`py-1`}),createVNode(VRadio,{label:`Require pull requests`,value:true,class:`py-1`})]),_:1},8,[`modelValue`,`disabled`]),_cache[20]||(_cache[20]=createBaseVNode(`p`,null,`GitHub branch rules still apply. Requiring pull requests makes Create draft PR the main Save action until a session is attached to a PR.`,-1)),_cache[21]||(_cache[21]=createBaseVNode(`p`,null,`This setting controls Vibe64's Save actions. GitHub rules control pushes from terminals and other tools.`,-1)),createBaseVNode(`div`,_hoisted_37,[createVNode(VBtn,{color:requirePullRequest.value!==repositoryWorkflow.value.requirePullRequest?`primary`:void 0,variant:`flat`,disabled:!repositoryWorkflow.value.canEdit||unref(repositoryWorkflowCommand).isRunning||requirePullRequest.value===repositoryWorkflow.value.requirePullRequest,onClick:saveRepositoryWorkflow},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(repositoryWorkflowCommand).isRunning?`Saving…`:`Save repository workflow`),1)]),_:1},8,[`color`,`disabled`])])])])):createCommentVNode(``,true)],64))])}}};var ProjectSettingsPanel_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-aebab399`]]);var _hoisted_1={class:`vibe64-dashboard-page`};var _sfc_main={__name:`index`,setup(__props){return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1,[createVNode(ProjectSettingsPanel_default)])}}};var settings_default=_plugin_vue_export_helper_default(_sfc_main,[[`__scopeId`,`data-v-d998a641`]]);export{settings_default as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as toText,s as normalizeObject}from"./normalize-BD25VwNK.js";import{t as AppError}from"./errors-DErd0NON.js";var VIBE64_ASSISTANT_ENGINE_IDS=Object.freeze({CLAUDE:`claude`,CODEX:`codex`,OPENCODE:`opencode`});var VIBE64_ASSISTANT_TRANSPORT_IDS=Object.freeze({CLAUDE_STREAM_JSON:`claude_stream_json`,CODEX_APP_SERVER:`codex_app_server`,OPENCODE_SERVER:`opencode_server`});var VIBE64_ASSISTANT_SELECTION_SCHEMA=`vibe64.assistant-selection.v1`;var VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN=/^sha256:[a-f0-9]{64}$/u;var VIBE64_ASSISTANT_ENGINE_ID_SET=new Set(Object.values(VIBE64_ASSISTANT_ENGINE_IDS));var VIBE64_ASSISTANT_SELECTION_ERROR_CODES=Object.freeze({CATALOG_STALE:`vibe64_assistant_catalog_stale`,CONNECTION_REQUIRED:`vibe64_assistant_connection_required`,ENGINE_IMMUTABLE:`vibe64_assistant_engine_immutable`,INVALID:`vibe64_assistant_selection_invalid`,TURN_ACTIVE:`vibe64_assistant_selection_turn_active`,UNAVAILABLE:`vibe64_assistant_selection_unavailable`});function selectionError(code,message,details={}){return new AppError(409,message,{code,details:Object.freeze({...details})})}function containsControlCharacter(value=``){return Array.from(value).some(character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127})}function boundedIdentifier(value,field,options={}){const{allowEmpty=false,maxLength=512}=options;const normalized=toText(value);if(!normalized&&!allowEmpty||normalized.length>maxLength||containsControlCharacter(normalized))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant ${field} is invalid.`,{field});return normalized}function catalogRevision(value,field=`catalogRevision`){const revision=toText(value);if(!VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN.test(revision))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant catalog revision is invalid.`,{field});return revision}function defineVibe64AssistantSelection(value={}){const input=normalizeObject(value);const engineId=boundedIdentifier(input.engineId,`engineId`,{maxLength:64});if(!VIBE64_ASSISTANT_ENGINE_ID_SET.has(engineId))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Unknown assistant engine: ${engineId}.`,{engineId,field:`engineId`});const schema=toText(input.schema)||VIBE64_ASSISTANT_SELECTION_SCHEMA;if(schema!==VIBE64_ASSISTANT_SELECTION_SCHEMA)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant selection schema is unsupported.`,{field:`schema`,schema});return Object.freeze({agentId:boundedIdentifier(input.agentId,`agentId`,{maxLength:256}),catalogRevision:catalogRevision(input.catalogRevision),engineId,modelId:boundedIdentifier(input.modelId,`modelId`),modelProviderId:boundedIdentifier(input.modelProviderId,`modelProviderId`,{maxLength:256}),schema,variantId:boundedIdentifier(input.variantId,`variantId`,{allowEmpty:true,maxLength:256})})}function assertVibe64AssistantSelectionUpdate(currentValue={},nextValue={},options={}){const{turnActive=false}=options;defineVibe64AssistantSelection(currentValue);const next=defineVibe64AssistantSelection(nextValue);if(turnActive===true)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.TURN_ACTIVE,`Wait for the active assistant turn to finish before changing its selection.`);return next}var VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS=Object.freeze([`engineId`,`modelProviderId`,`modelId`,`agentId`,`variantId`]);function sameVibe64AssistantSelection(left,right){return VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS.every(key=>String(left?.[key]??``).trim()===String(right?.[key]??``).trim())}var __testables$2=Object.freeze({assertVibe64AssistantSelectionUpdate,VIBE64_ASSISTANT_SELECTION_ERROR_CODES});var model=(id,contextWindow,variants,options={})=>Object.freeze({id,contextWindow,variants:Object.freeze(variants),...options});var NATIVE_AI_PROVIDERS=Object.freeze([Object.freeze({id:`deepseek`,baseUrl:`https://api.deepseek.com/`,claudeBaseUrl:`https://api.deepseek.com/anthropic`,claudeAutoCompactWindow:786432,webSearch:false,models:Object.freeze([model(`deepseek-flash`,1048576,[`low`,`high`,`max`],{images:true,freeformPatch:true,codexHistoryRouting:true}),model(`deepseek-v4-pro`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai-coding-plan`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])})]);var CUSTOM_AI_PROVIDER_ID=`custom`;function nativeAiProvider(id){return NATIVE_AI_PROVIDERS.find(provider=>provider.id===id)||null}function nativeAiModel(id,providerId=``){for(const provider of NATIVE_AI_PROVIDERS){if(providerId&&provider.id!==providerId)continue;const model=provider.models.find(candidate=>candidate.id===id);if(model)return{...model,modelProviderId:provider.id}}return null}var curatedModel=(providerId,id,label,defaultThinking)=>{const{modelProviderId:_provider,...definition}=nativeAiModel(id,providerId);return Object.freeze({...definition,label,defaultThinking})};var CURATED_CODEX_PROVIDERS=Object.freeze([Object.freeze({...nativeAiProvider(`deepseek`),label:`DeepSeek`,shortLabel:`DeepSeek`,description:`DeepSeek API key · usage-based billing`,keyUrl:`https://platform.deepseek.com/api_keys`,guideUrl:`https://api-docs.deepseek.com/quick_start/agent_integrations/codex/`,ownerOnly:false,models:Object.freeze([curatedModel(`deepseek`,`deepseek-flash`,`DeepSeek V4.1 Flash`,`high`),curatedModel(`deepseek`,`deepseek-v4-pro`,`DeepSeek V4 Pro`,`high`)])}),Object.freeze({...nativeAiProvider(`zai-coding-plan`),label:`GLM · Coding Plan`,shortLabel:`GLM`,description:`Z.AI Coding Plan key · uses your subscription quota`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/devpack/tool/codex`,ownerOnly:true,models:Object.freeze([curatedModel(`zai-coding-plan`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({...nativeAiProvider(`zai`),label:`GLM · Pay-as-you-go API`,shortLabel:`GLM`,description:`Z.AI API key · pay-as-you-go account`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/guides/overview/quick-start`,setupNote:`Use a key from a Z.AI account without a Coding Plan. Pay-as-you-go access through Codex and Claude Code still needs live verification; a successful check confirms model access, not billing.`,ownerOnly:false,models:Object.freeze([curatedModel(`zai`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({id:CUSTOM_AI_PROVIDER_ID,custom:true,label:`Custom endpoint`,shortLabel:`Custom`,description:`Your own model server · no Vibe64 billing`,ownerOnly:true,models:Object.freeze([])})]);function curatedCodexProvider(id){return CURATED_CODEX_PROVIDERS.find(provider=>provider.id===id)||null}function isPlainRecord(value){if(!value||typeof value!==`object`||Array.isArray(value))return false;const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}var VIBE64_AGENT_EXECUTION_PROFILE_IDS=Object.freeze({HELPER:`helper`});var VIBE64_AGENT_EXECUTION_WORKLOAD_IDS=Object.freeze({COMMIT_TITLE:`commit_title`,CONVERSATION_SUMMARY:`conversation_summary`,VOICE_TURN:`voice_turn`,DATABASE_ASSISTANT:`database_assistant`,LESSON_REVIEW:`lesson_review`,PROMPT_HINT:`prompt_hint`,REQUEST_ROUTING:`request_routing`,SESSION_TITLE:`session_title`,SOURCE_EXPLANATION:`source_explanation`});var VIBE64_AGENT_HELPER_WORKLOAD_LIMITS=Object.freeze({[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.COMMIT_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.VOICE_TURN]:Object.freeze({maxInputCharacters:12e3,maxOutputCharacters:512,timeoutMs:1e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.CONVERSATION_SUMMARY]:Object.freeze({maxInputCharacters:2e5,maxOutputCharacters:16e3,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.DATABASE_ASSISTANT]:Object.freeze({maxInputCharacters:5e5,maxOutputCharacters:16e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.LESSON_REVIEW]:Object.freeze({maxInputCharacters:16e4,maxOutputCharacters:12e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.PROMPT_HINT]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:2500,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.REQUEST_ROUTING]:Object.freeze({maxInputCharacters:128e3,maxOutputCharacters:8192,timeoutMs:6e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SESSION_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:3e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SOURCE_EXPLANATION]:Object.freeze({maxInputCharacters:1e5,maxOutputCharacters:32e3,timeoutMs:18e4})});var VIBE64_AGENT_EXECUTION_TOOL_POLICIES=Object.freeze({NONE:`none`});var VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS=Object.freeze({MAX_INPUT_CHARACTERS:5e5,MAX_OUTPUT_CHARACTERS:32e3,MAX_TIMEOUT_MS:3e5});var VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES=Object.freeze({INVALID:`vibe64_agent_execution_profile_invalid`,MODEL_UNAVAILABLE:`vibe64_agent_execution_profile_model_unavailable`,POLICY_UNENFORCEABLE:`vibe64_agent_execution_profile_policy_unenforceable`,PROFILE_UNKNOWN:`vibe64_agent_execution_profile_unknown`,REASONING_UNSUPPORTED:`vibe64_agent_execution_profile_reasoning_unsupported`,UNBOUNDED:`vibe64_agent_execution_profile_unbounded`,UNSAFE:`vibe64_agent_execution_profile_unsafe`,WORKLOAD_UNSUPPORTED:`vibe64_agent_execution_profile_workload_unsupported`});var VIBE64_AGENT_EXECUTION_PROFILE_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_PROFILE_IDS));var VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_WORKLOAD_IDS));var Vibe64AgentExecutionProfileError=class extends Error{constructor(code,message,details={}){super(message);this.name=`Vibe64AgentExecutionProfileError`;this.code=code;this.details=Object.freeze({...details});for(const[name,value]of Object.entries(this.details))if(![`code`,`details`,`message`,`name`].includes(name))this[name]=value}};function executionProfileError(code,message,details={}){return new Vibe64AgentExecutionProfileError(code,message,details)}function requiredRecord(value,fieldName){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be an object.`,{field:fieldName});return value}function requireOnlyFields(value,allowedFields,fieldName){const allowed=new Set(allowedFields);const unexpected=Object.keys(value).find(name=>!allowed.has(name));if(unexpected)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} contains an unsupported field: ${unexpected}.`,{field:`${fieldName}.${unexpected}`})}function requiredText(value,fieldName,maximumLength=256){if(typeof value!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be text.`,{field:fieldName});const normalized=value.trim();if(!normalized||normalized.length>maximumLength)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} is invalid.`,{field:fieldName});return normalized}function requiredBoolean(value,fieldName){if(typeof value!==`boolean`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be a boolean.`,{field:fieldName});return value}function requireSafeFalse(value,fieldName){if(requiredBoolean(value,fieldName)!==false)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile ${fieldName} must be disabled.`,{field:fieldName});return false}function boundedPositiveInteger(value,fieldName,maximum){if(!Number.isSafeInteger(value)||value<=0||value>maximum)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile ${fieldName} must be a positive integer no greater than ${maximum}.`,{field:fieldName,maximum});return value}function requiredLimits(value){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile limits are required.`,{field:`limits`});return value}function normalizeProfileId(value){const profileId=requiredText(value,`profileId`,64);if(!VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(profileId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.PROFILE_UNKNOWN,`Unknown execution profile: ${profileId}.`,{profileId});return profileId}function normalizeWorkloadId(value){const workloadId=requiredText(value,`workloadId`,64);if(!VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES.has(workloadId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.WORKLOAD_UNSUPPORTED,`Unsupported execution profile workload: ${workloadId}.`,{workloadId});return workloadId}function normalizedExecutionProfileRequest(input){return Object.freeze({profileId:normalizeProfileId(input.profileId),workloadId:normalizeWorkloadId(input.workloadId)})}function defineVibe64AgentExecutionProfileResolution(value){const input=requiredRecord(value,`resolution`);const executionProfile=normalizedExecutionProfileRequest(input);const request=requiredRecord(input.request,`request policy`);const policy=requiredRecord(input.policy,`tool policy`);const limits=requiredLimits(input.limits);requireOnlyFields(request,[`allowProviderModelFallback`,`reasoning`,`summary`],`request`);requireOnlyFields(policy,[`environmentAccess`,`networkAccess`,`repositoryWrite`,`tools`],`policy`);requireOnlyFields(limits,[`maxInputCharacters`,`maxOutputCharacters`,`timeoutMs`],`limits`);const reasoning=requiredBoolean(request.reasoning,`request.reasoning`);if(typeof input.thinking!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking must be text.`,{field:`thinking`});const thinking=input.thinking.trim();if(reasoning&&!thinking||!reasoning&&thinking)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile thinking must agree with its reasoning request.`,{field:`thinking`});if(thinking.length>64)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking is invalid.`,{field:`thinking`});if(policy.tools!==VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile tools must be disabled.`,{field:`policy.tools`});return Object.freeze({limits:Object.freeze({maxInputCharacters:boundedPositiveInteger(limits.maxInputCharacters,`limits.maxInputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_INPUT_CHARACTERS),maxOutputCharacters:boundedPositiveInteger(limits.maxOutputCharacters,`limits.maxOutputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_OUTPUT_CHARACTERS),timeoutMs:boundedPositiveInteger(limits.timeoutMs,`limits.timeoutMs`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_TIMEOUT_MS)}),model:requiredText(input.model,`model`),policy:Object.freeze({environmentAccess:requireSafeFalse(policy.environmentAccess,`policy.environmentAccess`),networkAccess:requireSafeFalse(policy.networkAccess,`policy.networkAccess`),repositoryWrite:requireSafeFalse(policy.repositoryWrite,`policy.repositoryWrite`),tools:VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE}),profileId:executionProfile.profileId,providerId:requiredText(input.providerId,`providerId`,64),request:Object.freeze({allowProviderModelFallback:requireSafeFalse(request.allowProviderModelFallback,`request.allowProviderModelFallback`),reasoning,summary:requireSafeFalse(request.summary,`request.summary`)}),revision:requiredText(input.revision,`revision`,128),thinking,workloadId:executionProfile.workloadId})}function vibe64AgentExecutionProfileAuditSnapshot(value){return defineVibe64AgentExecutionProfileResolution(value)}function vibe64AgentProviderSupportsExecutionProfile(provider,profileId){if(!isPlainRecord(provider)||typeof profileId!==`string`)return false;const normalizedProfileId=profileId.trim();return provider.implemented===true&&VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(normalizedProfileId)&&Array.isArray(provider.executionProfiles)&&provider.executionProfiles.includes(normalizedProfileId)}var __testables$1=Object.freeze({VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS,VIBE64_AGENT_EXECUTION_TOOL_POLICIES,vibe64AgentProviderSupportsExecutionProfile});var VIBE64_AGENT_PROVIDER_UNKNOWN_CODE=`vibe64_agent_provider_unknown`;var VIBE64_AGENT_PARAMETER_IDS=Object.freeze({MODEL:`model`,THINKING:`thinking`});var VIBE64_DEFAULT_AGENT_PROVIDER_ID=VIBE64_ASSISTANT_ENGINE_IDS.CODEX;var VIBE64_CODEX_SOL_MODEL=`gpt-5.6-sol`;var VIBE64_CODEX_GPT_5_5_MODEL=`gpt-5.5`;var VIBE64_CODEX_DEFAULT_MODEL=VIBE64_CODEX_SOL_MODEL;var VIBE64_CODEX_DEFAULT_THINKING=`xhigh`;var VIBE64_CODEX_SPARK_MODEL=`gpt-5.3-codex-spark`;var VIBE64_CODEX_STANDARD_THINKING_VALUES=Object.freeze([`low`,`medium`,`high`,`xhigh`]);var VIBE64_CODEX_SOL_THINKING_VALUES=Object.freeze([...VIBE64_CODEX_STANDARD_THINKING_VALUES,`max`]);var VIBE64_AGENT_PROVIDERS=Object.freeze([Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CODEX,implemented:true,label:`Codex`,accountLabel:`Codex (OpenAI)`,planUsage:Object.freeze({label:`Codex`,managementUrl:`https://chatgpt.com/codex/settings/usage`}),terminal:`codex`,terminalAttachments:false,parameters:Object.freeze([Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.MODEL,defaultValue:VIBE64_CODEX_DEFAULT_MODEL,label:`Model`,options:Object.freeze([Object.freeze({label:`Automatic (GPT-5.6 Sol)`,value:``}),Object.freeze({label:`GPT-5.6 Sol`,supportedThinking:VIBE64_CODEX_SOL_THINKING_VALUES,value:VIBE64_CODEX_DEFAULT_MODEL}),Object.freeze({label:`GPT-5.5`,supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_GPT_5_5_MODEL}),Object.freeze({label:`Codex Spark`,request:Object.freeze({summary:false}),supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_SPARK_MODEL})])}),Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.THINKING,defaultValue:VIBE64_CODEX_DEFAULT_THINKING,label:`Thinking`,options:Object.freeze([Object.freeze({label:`Automatic`,value:``}),Object.freeze({label:`Low`,value:`low`}),Object.freeze({label:`Medium`,value:`medium`}),Object.freeze({label:`High`,value:`high`}),Object.freeze({label:`X High`,value:`xhigh`}),Object.freeze({label:`Max`,value:`max`})])})])}),Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE,implemented:true,label:`Claude Code`,accountLabel:`Claude`,planUsage:Object.freeze({label:`Claude`,managementUrl:`https://claude.ai/settings/usage`}),parameters:Object.freeze([]),terminal:`native`,terminalAttachments:false}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_ASSISTANT_ENGINE_IDS.OPENCODE,implemented:false,label:`OpenCode`,parameters:Object.freeze([]),terminal:`native`,terminalAttachments:true})]);function findVibe64AgentProvider(engineId=``){const normalizedEngineId=normalizeAgentSettingText(engineId);return VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedEngineId)||null}function agentProviderDefinition(providerId=``){const normalizedProviderId=normalizeAgentSettingText(providerId)||VIBE64_DEFAULT_AGENT_PROVIDER_ID;const provider=VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedProviderId);if(provider)return provider;const error=new Error(`Unknown assistant provider: ${normalizedProviderId}.`);error.code=VIBE64_AGENT_PROVIDER_UNKNOWN_CODE;error.providerId=normalizedProviderId;throw error}function agentProviderParameter(provider={},parameterId=``){const normalizedParameterId=normalizeAgentSettingText(parameterId);return(Array.isArray(provider.parameters)?provider.parameters:[]).find(parameter=>parameter.id===normalizedParameterId)||null}function normalizeAgentSettingText(value=``){return String(value||``).trim()}function normalizeVibe64AgentSettings(value={}){const input=value&&typeof value===`object`&&!Array.isArray(value)?value:{};const provider=agentProviderDefinition(input.providerId||input.provider);const model=normalizeAgentSettingText(input.model);return{model,providerId:provider.id,thinking:normalizedAgentThinkingValue(provider,model,input.thinking)}}function defaultVibe64AgentSettings(providerId=VIBE64_DEFAULT_AGENT_PROVIDER_ID){return normalizeVibe64AgentSettings({providerId})}function effectiveAgentParameterValue(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);return normalizeAgentSettingText(value)||normalizeAgentSettingText(parameter?.defaultValue)}function effectiveAgentParameterOption(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);const effectiveValue=effectiveAgentParameterValue(provider,parameterId,value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(option=>normalizeAgentSettingText(option.value)===effectiveValue)||null}function supportedAgentThinkingValues(provider={},model=``){const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,model);return Array.isArray(modelOption?.supportedThinking)?new Set(modelOption.supportedThinking.map(value=>normalizeAgentSettingText(value))):null}function normalizedAgentThinkingValue(provider={},model=``,value=``){const normalized=normalizeAgentSettingText(value);if(provider.id===VIBE64_ASSISTANT_ENGINE_IDS.CODEX)return normalized;const supported=supportedAgentThinkingValues(provider,model);if(!supported||!normalized||supported.has(normalized))return normalized;const fallback=normalizeAgentSettingText(agentProviderParameter(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING)?.defaultValue);return supported.has(fallback)?fallback:``}function vibe64AgentSettingParameters(value={}){const normalized=normalizeVibe64AgentSettings(value);const provider=agentProviderDefinition(normalized.providerId);const requestsReasoning=agentOptionRequestValue(effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,normalized.model),`reasoning`,true);const supportedThinking=supportedAgentThinkingValues(provider,normalized.model);return(Array.isArray(provider.parameters)?provider.parameters:[]).flatMap(parameter=>{if(parameter.id===VIBE64_AGENT_PARAMETER_IDS.THINKING&&requestsReasoning===false)return[];if(parameter.id!==VIBE64_AGENT_PARAMETER_IDS.THINKING||!supportedThinking)return[parameter];return[{...parameter,options:parameter.options.filter(option=>!normalizeAgentSettingText(option.value)||supportedThinking.has(normalizeAgentSettingText(option.value)))}]})}function agentOptionRequestValue(option={},name=``,fallback=true){const request=option&&typeof option.request===`object`&&!Array.isArray(option.request)?option.request:{};return Object.hasOwn(request,name)?request[name]:fallback}function displayVibe64AgentSetting(providerId=``,parameterId=``,value=``){const parameter=agentProviderParameter(agentProviderDefinition(providerId),parameterId);const normalizedValue=normalizeAgentSettingText(value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(candidate=>normalizeAgentSettingText(candidate.value)===normalizedValue)?.label||normalizedValue||`Automatic`}var __testables=Object.freeze({displayVibe64AgentSetting,VIBE64_AGENT_PROVIDER_UNKNOWN_CODE,VIBE64_CODEX_GPT_5_5_MODEL,VIBE64_CODEX_SOL_MODEL,VIBE64_CODEX_SPARK_MODEL,vibe64AgentSettingParameters});function vibe64AssistantSelectionLabel(selection,options={}){const{includeThinking=true}=options;const engine=VIBE64_AGENT_PROVIDERS.find(({id})=>id===selection.engineId)?.label||selection.engineId;if(!includeThinking)return`${engine} (${selection.modelId})`;const thinking=selection.variantId===``?`default`:selection.variantId||`not recorded`;return`${engine} (${selection.modelId} ${thinking})`}function vibe64ProviderPresentation(selection){const provider=curatedCodexProvider(selection?.modelProviderId);const commentaryAsThinking=Boolean(provider)&&[VIBE64_ASSISTANT_ENGINE_IDS.CODEX,VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE].includes(selection?.engineId);return Object.freeze({label:provider?.shortLabel||findVibe64AgentProvider(selection?.engineId)?.label||``,keyUsage:Boolean(provider),commentaryAsThinking,thinkingParagraphUpdates:!commentaryAsThinking&&selection?.engineId===VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE})}var VIBE64_AGENT_TASK_RESULT_KINDS=Object.freeze({COMPLETE:`complete`,CONTINUE:`continue`});var VIBE64_AGENT_TASK_RESULT_SCHEMA=Object.freeze({additionalProperties:false,properties:{kind:{enum:Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),type:`string`},message:{description:`Normal Markdown shown to the user for this task turn.`,type:`string`},report:{description:`A concise factual handoff for the main conversation when the task is complete; otherwise an empty string.`,type:`string`}},required:[`kind`,`message`,`report`],type:`object`});var VIBE64_AI_TASK_RESULT_KINDS=Object.freeze({CANNOT:`cannot`,COMPLETE:`complete`,QUESTION:`question`});var VIBE64_AI_TASK_RESULT_SCHEMA=Object.freeze({additionalProperties:false,properties:{kind:{description:`complete when the work is ready for Vibe64 to check, question when you need the person's decision, cannot when you cannot finish this.`,enum:Object.values(VIBE64_AI_TASK_RESULT_KINDS),type:`string`},message:{description:`Normal Markdown shown to the user for this task turn. For question, the question. For cannot, why.`,type:`string`},report:{description:`What you did, in a few plain sentences, when the task is complete; otherwise an empty string.`,type:`string`}},required:[`kind`,`message`,`report`],type:`object`});var VIBE64_TASK_RESULT_KINDS=Object.freeze([...Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),VIBE64_AI_TASK_RESULT_KINDS.QUESTION,VIBE64_AI_TASK_RESULT_KINDS.CANNOT]);var VIBE64_ASSISTANT_ACCESS_ERROR_CODES=Object.freeze({RESTRICTED:`vibe64_assistant_owner_required`,UNAVAILABLE:`vibe64_assistant_connection_unavailable`});var VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS=10;var VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS=160;var ATTACHMENT_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;var IMAGE_TYPES=Object.freeze({avif:`image/avif`,bmp:`image/bmp`,gif:`image/gif`,jpeg:`image/jpeg`,jpg:`image/jpeg`,png:`image/png`,webp:`image/webp`});function conversationAttachmentContentType(fileName=``){const extension=String(fileName).split(`.`).at(-1).toLowerCase();return Object.hasOwn(IMAGE_TYPES,extension)?IMAGE_TYPES[extension]:`application/octet-stream`}function conversationAttachmentReference(attachment={},number=1){return`[${conversationAttachmentContentType(attachment.fileName).startsWith(`image/`)?`Image`:`File`} #${number}]`}function conversationAttachmentFileName(value=``){const normalized=Array.from(String(value??``),character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127?` `:character}).join(``).trim();return Array.from(normalized).slice(0,VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS).join(``)}function normalizeVibe64ConversationAttachments(value=[]){return(Array.isArray(value)?value:[]).slice(0,VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS).map(candidate=>{if(!candidate||typeof candidate!==`object`||Array.isArray(candidate)||typeof candidate.fileName!==`string`)return null;const fileName=conversationAttachmentFileName(candidate.fileName);if(!fileName)return null;return{...ATTACHMENT_ID_PATTERN.test(String(candidate.attachmentId||``))?{attachmentId:candidate.attachmentId}:{},.../^\[(?:Image|File) #[1-9][0-9]{0,3}\]$/u.test(candidate.reference||``)?{reference:candidate.reference}:{},fileName,...Number.isSafeInteger(candidate.size)&&candidate.size>=0?{size:candidate.size}:{}}}).filter(Boolean)}var VIBE64_PROMPT_HINT_LABEL_MAX_CHARACTERS=24;var VIBE64_PROMPT_HINT_PROMPT_MAX_CHARACTERS=108;function normalizedPromptHintDraft(value=``){return Array.from(String(value??``).replace(/\r\n?/gu,`
|
|
1
|
+
import{p as toText,s as normalizeObject}from"./normalize-BD25VwNK.js";import{t as AppError}from"./errors-D17nJYne.js";var VIBE64_ASSISTANT_ENGINE_IDS=Object.freeze({CLAUDE:`claude`,CODEX:`codex`,OPENCODE:`opencode`});var VIBE64_ASSISTANT_TRANSPORT_IDS=Object.freeze({CLAUDE_STREAM_JSON:`claude_stream_json`,CODEX_APP_SERVER:`codex_app_server`,OPENCODE_SERVER:`opencode_server`});var VIBE64_ASSISTANT_SELECTION_SCHEMA=`vibe64.assistant-selection.v1`;var VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN=/^sha256:[a-f0-9]{64}$/u;var VIBE64_ASSISTANT_ENGINE_ID_SET=new Set(Object.values(VIBE64_ASSISTANT_ENGINE_IDS));var VIBE64_ASSISTANT_SELECTION_ERROR_CODES=Object.freeze({CATALOG_STALE:`vibe64_assistant_catalog_stale`,CONNECTION_REQUIRED:`vibe64_assistant_connection_required`,ENGINE_IMMUTABLE:`vibe64_assistant_engine_immutable`,INVALID:`vibe64_assistant_selection_invalid`,TURN_ACTIVE:`vibe64_assistant_selection_turn_active`,UNAVAILABLE:`vibe64_assistant_selection_unavailable`});function selectionError(code,message,details={}){return new AppError(409,message,{code,details:Object.freeze({...details})})}function containsControlCharacter(value=``){return Array.from(value).some(character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127})}function boundedIdentifier(value,field,options={}){const{allowEmpty=false,maxLength=512}=options;const normalized=toText(value);if(!normalized&&!allowEmpty||normalized.length>maxLength||containsControlCharacter(normalized))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant ${field} is invalid.`,{field});return normalized}function catalogRevision(value,field=`catalogRevision`){const revision=toText(value);if(!VIBE64_ASSISTANT_CATALOG_REVISION_PATTERN.test(revision))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant catalog revision is invalid.`,{field});return revision}function defineVibe64AssistantSelection(value={}){const input=normalizeObject(value);const engineId=boundedIdentifier(input.engineId,`engineId`,{maxLength:64});if(!VIBE64_ASSISTANT_ENGINE_ID_SET.has(engineId))throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Unknown assistant engine: ${engineId}.`,{engineId,field:`engineId`});const schema=toText(input.schema)||VIBE64_ASSISTANT_SELECTION_SCHEMA;if(schema!==VIBE64_ASSISTANT_SELECTION_SCHEMA)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.INVALID,`Assistant selection schema is unsupported.`,{field:`schema`,schema});return Object.freeze({agentId:boundedIdentifier(input.agentId,`agentId`,{maxLength:256}),catalogRevision:catalogRevision(input.catalogRevision),engineId,modelId:boundedIdentifier(input.modelId,`modelId`),modelProviderId:boundedIdentifier(input.modelProviderId,`modelProviderId`,{maxLength:256}),schema,variantId:boundedIdentifier(input.variantId,`variantId`,{allowEmpty:true,maxLength:256})})}function assertVibe64AssistantSelectionUpdate(currentValue={},nextValue={},options={}){const{turnActive=false}=options;defineVibe64AssistantSelection(currentValue);const next=defineVibe64AssistantSelection(nextValue);if(turnActive===true)throw selectionError(VIBE64_ASSISTANT_SELECTION_ERROR_CODES.TURN_ACTIVE,`Wait for the active assistant turn to finish before changing its selection.`);return next}var VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS=Object.freeze([`engineId`,`modelProviderId`,`modelId`,`agentId`,`variantId`]);function sameVibe64AssistantSelection(left,right){return VIBE64_ASSISTANT_SELECTION_IDENTITY_FIELDS.every(key=>String(left?.[key]??``).trim()===String(right?.[key]??``).trim())}var __testables$2=Object.freeze({assertVibe64AssistantSelectionUpdate,VIBE64_ASSISTANT_SELECTION_ERROR_CODES});var model=(id,contextWindow,variants,options={})=>Object.freeze({id,contextWindow,variants:Object.freeze(variants),...options});var NATIVE_AI_PROVIDERS=Object.freeze([Object.freeze({id:`deepseek`,baseUrl:`https://api.deepseek.com/`,claudeBaseUrl:`https://api.deepseek.com/anthropic`,claudeAutoCompactWindow:786432,webSearch:false,models:Object.freeze([model(`deepseek-flash`,1048576,[`low`,`high`,`max`],{images:true,freeformPatch:true,codexHistoryRouting:true}),model(`deepseek-v4-pro`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai-coding-plan`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])}),Object.freeze({id:`zai`,baseUrl:`https://api.z.ai/api/v1`,claudeBaseUrl:`https://api.z.ai/api/anthropic`,claudeAutoCompactWindow:1e6,webSearch:false,models:Object.freeze([model(`glm-5.3`,1048576,[`low`,`high`,`max`],{freeformPatch:true,codexHistoryRouting:true})])})]);var CUSTOM_AI_PROVIDER_ID=`custom`;function nativeAiProvider(id){return NATIVE_AI_PROVIDERS.find(provider=>provider.id===id)||null}function nativeAiModel(id,providerId=``){for(const provider of NATIVE_AI_PROVIDERS){if(providerId&&provider.id!==providerId)continue;const model=provider.models.find(candidate=>candidate.id===id);if(model)return{...model,modelProviderId:provider.id}}return null}var curatedModel=(providerId,id,label,defaultThinking)=>{const{modelProviderId:_provider,...definition}=nativeAiModel(id,providerId);return Object.freeze({...definition,label,defaultThinking})};var CURATED_CODEX_PROVIDERS=Object.freeze([Object.freeze({...nativeAiProvider(`deepseek`),label:`DeepSeek`,shortLabel:`DeepSeek`,description:`DeepSeek API key · usage-based billing`,keyUrl:`https://platform.deepseek.com/api_keys`,guideUrl:`https://api-docs.deepseek.com/quick_start/agent_integrations/codex/`,ownerOnly:false,models:Object.freeze([curatedModel(`deepseek`,`deepseek-flash`,`DeepSeek V4.1 Flash`,`high`),curatedModel(`deepseek`,`deepseek-v4-pro`,`DeepSeek V4 Pro`,`high`)])}),Object.freeze({...nativeAiProvider(`zai-coding-plan`),label:`GLM · Coding Plan`,shortLabel:`GLM`,description:`Z.AI Coding Plan key · uses your subscription quota`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/devpack/tool/codex`,ownerOnly:true,models:Object.freeze([curatedModel(`zai-coding-plan`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({...nativeAiProvider(`zai`),label:`GLM · Pay-as-you-go API`,shortLabel:`GLM`,description:`Z.AI API key · pay-as-you-go account`,keyUrl:`https://z.ai/manage-apikey/apikey-list`,guideUrl:`https://docs.z.ai/guides/overview/quick-start`,setupNote:`Use a key from a Z.AI account without a Coding Plan. Pay-as-you-go access through Codex and Claude Code still needs live verification; a successful check confirms model access, not billing.`,ownerOnly:false,models:Object.freeze([curatedModel(`zai`,`glm-5.3`,`GLM 5.3`,`max`)])}),Object.freeze({id:CUSTOM_AI_PROVIDER_ID,custom:true,label:`Custom endpoint`,shortLabel:`Custom`,description:`Your own model server · no Vibe64 billing`,ownerOnly:true,models:Object.freeze([])})]);function curatedCodexProvider(id){return CURATED_CODEX_PROVIDERS.find(provider=>provider.id===id)||null}function isPlainRecord(value){if(!value||typeof value!==`object`||Array.isArray(value))return false;const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}var VIBE64_AGENT_EXECUTION_PROFILE_IDS=Object.freeze({HELPER:`helper`});var VIBE64_AGENT_EXECUTION_WORKLOAD_IDS=Object.freeze({COMMIT_TITLE:`commit_title`,CONVERSATION_SUMMARY:`conversation_summary`,VOICE_TURN:`voice_turn`,DATABASE_ASSISTANT:`database_assistant`,LESSON_REVIEW:`lesson_review`,PROMPT_HINT:`prompt_hint`,REQUEST_ROUTING:`request_routing`,SESSION_TITLE:`session_title`,SOURCE_EXPLANATION:`source_explanation`});var VIBE64_AGENT_HELPER_WORKLOAD_LIMITS=Object.freeze({[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.COMMIT_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.VOICE_TURN]:Object.freeze({maxInputCharacters:12e3,maxOutputCharacters:512,timeoutMs:1e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.CONVERSATION_SUMMARY]:Object.freeze({maxInputCharacters:2e5,maxOutputCharacters:16e3,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.DATABASE_ASSISTANT]:Object.freeze({maxInputCharacters:5e5,maxOutputCharacters:16e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.LESSON_REVIEW]:Object.freeze({maxInputCharacters:16e4,maxOutputCharacters:12e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.PROMPT_HINT]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:2500,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.REQUEST_ROUTING]:Object.freeze({maxInputCharacters:128e3,maxOutputCharacters:8192,timeoutMs:6e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SESSION_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:3e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SOURCE_EXPLANATION]:Object.freeze({maxInputCharacters:1e5,maxOutputCharacters:32e3,timeoutMs:18e4})});var VIBE64_AGENT_EXECUTION_TOOL_POLICIES=Object.freeze({NONE:`none`});var VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS=Object.freeze({MAX_INPUT_CHARACTERS:5e5,MAX_OUTPUT_CHARACTERS:32e3,MAX_TIMEOUT_MS:3e5});var VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES=Object.freeze({INVALID:`vibe64_agent_execution_profile_invalid`,MODEL_UNAVAILABLE:`vibe64_agent_execution_profile_model_unavailable`,POLICY_UNENFORCEABLE:`vibe64_agent_execution_profile_policy_unenforceable`,PROFILE_UNKNOWN:`vibe64_agent_execution_profile_unknown`,REASONING_UNSUPPORTED:`vibe64_agent_execution_profile_reasoning_unsupported`,UNBOUNDED:`vibe64_agent_execution_profile_unbounded`,UNSAFE:`vibe64_agent_execution_profile_unsafe`,WORKLOAD_UNSUPPORTED:`vibe64_agent_execution_profile_workload_unsupported`});var VIBE64_AGENT_EXECUTION_PROFILE_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_PROFILE_IDS));var VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_WORKLOAD_IDS));var Vibe64AgentExecutionProfileError=class extends Error{constructor(code,message,details={}){super(message);this.name=`Vibe64AgentExecutionProfileError`;this.code=code;this.details=Object.freeze({...details});for(const[name,value]of Object.entries(this.details))if(![`code`,`details`,`message`,`name`].includes(name))this[name]=value}};function executionProfileError(code,message,details={}){return new Vibe64AgentExecutionProfileError(code,message,details)}function requiredRecord(value,fieldName){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be an object.`,{field:fieldName});return value}function requireOnlyFields(value,allowedFields,fieldName){const allowed=new Set(allowedFields);const unexpected=Object.keys(value).find(name=>!allowed.has(name));if(unexpected)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} contains an unsupported field: ${unexpected}.`,{field:`${fieldName}.${unexpected}`})}function requiredText(value,fieldName,maximumLength=256){if(typeof value!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be text.`,{field:fieldName});const normalized=value.trim();if(!normalized||normalized.length>maximumLength)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} is invalid.`,{field:fieldName});return normalized}function requiredBoolean(value,fieldName){if(typeof value!==`boolean`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be a boolean.`,{field:fieldName});return value}function requireSafeFalse(value,fieldName){if(requiredBoolean(value,fieldName)!==false)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile ${fieldName} must be disabled.`,{field:fieldName});return false}function boundedPositiveInteger(value,fieldName,maximum){if(!Number.isSafeInteger(value)||value<=0||value>maximum)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile ${fieldName} must be a positive integer no greater than ${maximum}.`,{field:fieldName,maximum});return value}function requiredLimits(value){if(!isPlainRecord(value))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile limits are required.`,{field:`limits`});return value}function normalizeProfileId(value){const profileId=requiredText(value,`profileId`,64);if(!VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(profileId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.PROFILE_UNKNOWN,`Unknown execution profile: ${profileId}.`,{profileId});return profileId}function normalizeWorkloadId(value){const workloadId=requiredText(value,`workloadId`,64);if(!VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES.has(workloadId))throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.WORKLOAD_UNSUPPORTED,`Unsupported execution profile workload: ${workloadId}.`,{workloadId});return workloadId}function normalizedExecutionProfileRequest(input){return Object.freeze({profileId:normalizeProfileId(input.profileId),workloadId:normalizeWorkloadId(input.workloadId)})}function defineVibe64AgentExecutionProfileResolution(value){const input=requiredRecord(value,`resolution`);const executionProfile=normalizedExecutionProfileRequest(input);const request=requiredRecord(input.request,`request policy`);const policy=requiredRecord(input.policy,`tool policy`);const limits=requiredLimits(input.limits);requireOnlyFields(request,[`allowProviderModelFallback`,`reasoning`,`summary`],`request`);requireOnlyFields(policy,[`environmentAccess`,`networkAccess`,`repositoryWrite`,`tools`],`policy`);requireOnlyFields(limits,[`maxInputCharacters`,`maxOutputCharacters`,`timeoutMs`],`limits`);const reasoning=requiredBoolean(request.reasoning,`request.reasoning`);if(typeof input.thinking!==`string`)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking must be text.`,{field:`thinking`});const thinking=input.thinking.trim();if(reasoning&&!thinking||!reasoning&&thinking)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile thinking must agree with its reasoning request.`,{field:`thinking`});if(thinking.length>64)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile thinking is invalid.`,{field:`thinking`});if(policy.tools!==VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE)throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile tools must be disabled.`,{field:`policy.tools`});return Object.freeze({limits:Object.freeze({maxInputCharacters:boundedPositiveInteger(limits.maxInputCharacters,`limits.maxInputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_INPUT_CHARACTERS),maxOutputCharacters:boundedPositiveInteger(limits.maxOutputCharacters,`limits.maxOutputCharacters`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_OUTPUT_CHARACTERS),timeoutMs:boundedPositiveInteger(limits.timeoutMs,`limits.timeoutMs`,VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_TIMEOUT_MS)}),model:requiredText(input.model,`model`),policy:Object.freeze({environmentAccess:requireSafeFalse(policy.environmentAccess,`policy.environmentAccess`),networkAccess:requireSafeFalse(policy.networkAccess,`policy.networkAccess`),repositoryWrite:requireSafeFalse(policy.repositoryWrite,`policy.repositoryWrite`),tools:VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE}),profileId:executionProfile.profileId,providerId:requiredText(input.providerId,`providerId`,64),request:Object.freeze({allowProviderModelFallback:requireSafeFalse(request.allowProviderModelFallback,`request.allowProviderModelFallback`),reasoning,summary:requireSafeFalse(request.summary,`request.summary`)}),revision:requiredText(input.revision,`revision`,128),thinking,workloadId:executionProfile.workloadId})}function vibe64AgentExecutionProfileAuditSnapshot(value){return defineVibe64AgentExecutionProfileResolution(value)}function vibe64AgentProviderSupportsExecutionProfile(provider,profileId){if(!isPlainRecord(provider)||typeof profileId!==`string`)return false;const normalizedProfileId=profileId.trim();return provider.implemented===true&&VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(normalizedProfileId)&&Array.isArray(provider.executionProfiles)&&provider.executionProfiles.includes(normalizedProfileId)}var __testables$1=Object.freeze({VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS,VIBE64_AGENT_EXECUTION_TOOL_POLICIES,vibe64AgentProviderSupportsExecutionProfile});var VIBE64_AGENT_PROVIDER_UNKNOWN_CODE=`vibe64_agent_provider_unknown`;var VIBE64_AGENT_PARAMETER_IDS=Object.freeze({MODEL:`model`,THINKING:`thinking`});var VIBE64_DEFAULT_AGENT_PROVIDER_ID=VIBE64_ASSISTANT_ENGINE_IDS.CODEX;var VIBE64_CODEX_SOL_MODEL=`gpt-5.6-sol`;var VIBE64_CODEX_GPT_5_5_MODEL=`gpt-5.5`;var VIBE64_CODEX_DEFAULT_MODEL=VIBE64_CODEX_SOL_MODEL;var VIBE64_CODEX_DEFAULT_THINKING=`xhigh`;var VIBE64_CODEX_SPARK_MODEL=`gpt-5.3-codex-spark`;var VIBE64_CODEX_STANDARD_THINKING_VALUES=Object.freeze([`low`,`medium`,`high`,`xhigh`]);var VIBE64_CODEX_SOL_THINKING_VALUES=Object.freeze([...VIBE64_CODEX_STANDARD_THINKING_VALUES,`max`]);var VIBE64_AGENT_PROVIDERS=Object.freeze([Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CODEX,implemented:true,label:`Codex`,accountLabel:`Codex (OpenAI)`,planUsage:Object.freeze({label:`Codex`,managementUrl:`https://chatgpt.com/codex/settings/usage`}),terminal:`codex`,terminalAttachments:false,parameters:Object.freeze([Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.MODEL,defaultValue:VIBE64_CODEX_DEFAULT_MODEL,label:`Model`,options:Object.freeze([Object.freeze({label:`Automatic (GPT-5.6 Sol)`,value:``}),Object.freeze({label:`GPT-5.6 Sol`,supportedThinking:VIBE64_CODEX_SOL_THINKING_VALUES,value:VIBE64_CODEX_DEFAULT_MODEL}),Object.freeze({label:`GPT-5.5`,supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_GPT_5_5_MODEL}),Object.freeze({label:`Codex Spark`,request:Object.freeze({summary:false}),supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_SPARK_MODEL})])}),Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.THINKING,defaultValue:VIBE64_CODEX_DEFAULT_THINKING,label:`Thinking`,options:Object.freeze([Object.freeze({label:`Automatic`,value:``}),Object.freeze({label:`Low`,value:`low`}),Object.freeze({label:`Medium`,value:`medium`}),Object.freeze({label:`High`,value:`high`}),Object.freeze({label:`X High`,value:`xhigh`}),Object.freeze({label:`Max`,value:`max`})])})])}),Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.HELPER]),id:VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE,implemented:true,label:`Claude Code`,accountLabel:`Claude`,planUsage:Object.freeze({label:`Claude`,managementUrl:`https://claude.ai/settings/usage`}),parameters:Object.freeze([]),terminal:`native`,terminalAttachments:false}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_ASSISTANT_ENGINE_IDS.OPENCODE,implemented:false,label:`OpenCode`,parameters:Object.freeze([]),terminal:`native`,terminalAttachments:true})]);function findVibe64AgentProvider(engineId=``){const normalizedEngineId=normalizeAgentSettingText(engineId);return VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedEngineId)||null}function agentProviderDefinition(providerId=``){const normalizedProviderId=normalizeAgentSettingText(providerId)||VIBE64_DEFAULT_AGENT_PROVIDER_ID;const provider=VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedProviderId);if(provider)return provider;const error=new Error(`Unknown assistant provider: ${normalizedProviderId}.`);error.code=VIBE64_AGENT_PROVIDER_UNKNOWN_CODE;error.providerId=normalizedProviderId;throw error}function agentProviderParameter(provider={},parameterId=``){const normalizedParameterId=normalizeAgentSettingText(parameterId);return(Array.isArray(provider.parameters)?provider.parameters:[]).find(parameter=>parameter.id===normalizedParameterId)||null}function normalizeAgentSettingText(value=``){return String(value||``).trim()}function normalizeVibe64AgentSettings(value={}){const input=value&&typeof value===`object`&&!Array.isArray(value)?value:{};const provider=agentProviderDefinition(input.providerId||input.provider);const model=normalizeAgentSettingText(input.model);return{model,providerId:provider.id,thinking:normalizedAgentThinkingValue(provider,model,input.thinking)}}function defaultVibe64AgentSettings(providerId=VIBE64_DEFAULT_AGENT_PROVIDER_ID){return normalizeVibe64AgentSettings({providerId})}function effectiveAgentParameterValue(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);return normalizeAgentSettingText(value)||normalizeAgentSettingText(parameter?.defaultValue)}function effectiveAgentParameterOption(provider={},parameterId=``,value=``){const parameter=agentProviderParameter(provider,parameterId);const effectiveValue=effectiveAgentParameterValue(provider,parameterId,value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(option=>normalizeAgentSettingText(option.value)===effectiveValue)||null}function supportedAgentThinkingValues(provider={},model=``){const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,model);return Array.isArray(modelOption?.supportedThinking)?new Set(modelOption.supportedThinking.map(value=>normalizeAgentSettingText(value))):null}function normalizedAgentThinkingValue(provider={},model=``,value=``){const normalized=normalizeAgentSettingText(value);if(provider.id===VIBE64_ASSISTANT_ENGINE_IDS.CODEX)return normalized;const supported=supportedAgentThinkingValues(provider,model);if(!supported||!normalized||supported.has(normalized))return normalized;const fallback=normalizeAgentSettingText(agentProviderParameter(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING)?.defaultValue);return supported.has(fallback)?fallback:``}function vibe64AgentSettingParameters(value={}){const normalized=normalizeVibe64AgentSettings(value);const provider=agentProviderDefinition(normalized.providerId);const requestsReasoning=agentOptionRequestValue(effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,normalized.model),`reasoning`,true);const supportedThinking=supportedAgentThinkingValues(provider,normalized.model);return(Array.isArray(provider.parameters)?provider.parameters:[]).flatMap(parameter=>{if(parameter.id===VIBE64_AGENT_PARAMETER_IDS.THINKING&&requestsReasoning===false)return[];if(parameter.id!==VIBE64_AGENT_PARAMETER_IDS.THINKING||!supportedThinking)return[parameter];return[{...parameter,options:parameter.options.filter(option=>!normalizeAgentSettingText(option.value)||supportedThinking.has(normalizeAgentSettingText(option.value)))}]})}function agentOptionRequestValue(option={},name=``,fallback=true){const request=option&&typeof option.request===`object`&&!Array.isArray(option.request)?option.request:{};return Object.hasOwn(request,name)?request[name]:fallback}function displayVibe64AgentSetting(providerId=``,parameterId=``,value=``){const parameter=agentProviderParameter(agentProviderDefinition(providerId),parameterId);const normalizedValue=normalizeAgentSettingText(value);return(Array.isArray(parameter?.options)?parameter.options:[]).find(candidate=>normalizeAgentSettingText(candidate.value)===normalizedValue)?.label||normalizedValue||`Automatic`}var __testables=Object.freeze({displayVibe64AgentSetting,VIBE64_AGENT_PROVIDER_UNKNOWN_CODE,VIBE64_CODEX_GPT_5_5_MODEL,VIBE64_CODEX_SOL_MODEL,VIBE64_CODEX_SPARK_MODEL,vibe64AgentSettingParameters});function vibe64AssistantSelectionLabel(selection,options={}){const{includeThinking=true}=options;const engine=VIBE64_AGENT_PROVIDERS.find(({id})=>id===selection.engineId)?.label||selection.engineId;if(!includeThinking)return`${engine} (${selection.modelId})`;const thinking=selection.variantId===``?`default`:selection.variantId||`not recorded`;return`${engine} (${selection.modelId} ${thinking})`}function vibe64ProviderPresentation(selection){const provider=curatedCodexProvider(selection?.modelProviderId);const commentaryAsThinking=Boolean(provider)&&[VIBE64_ASSISTANT_ENGINE_IDS.CODEX,VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE].includes(selection?.engineId);return Object.freeze({label:provider?.shortLabel||findVibe64AgentProvider(selection?.engineId)?.label||``,keyUsage:Boolean(provider),commentaryAsThinking,thinkingParagraphUpdates:!commentaryAsThinking&&selection?.engineId===VIBE64_ASSISTANT_ENGINE_IDS.CLAUDE})}var VIBE64_AGENT_TASK_RESULT_KINDS=Object.freeze({COMPLETE:`complete`,CONTINUE:`continue`});var VIBE64_AGENT_TASK_RESULT_SCHEMA=Object.freeze({additionalProperties:false,properties:{kind:{enum:Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),type:`string`},message:{description:`Normal Markdown shown to the user for this task turn.`,type:`string`},report:{description:`A concise factual handoff for the main conversation when the task is complete; otherwise an empty string.`,type:`string`}},required:[`kind`,`message`,`report`],type:`object`});var VIBE64_AI_TASK_RESULT_KINDS=Object.freeze({CANNOT:`cannot`,COMPLETE:`complete`,QUESTION:`question`});var VIBE64_AI_TASK_RESULT_SCHEMA=Object.freeze({additionalProperties:false,properties:{kind:{description:`complete when the work is ready for Vibe64 to check, question when you need the person's decision, cannot when you cannot finish this.`,enum:Object.values(VIBE64_AI_TASK_RESULT_KINDS),type:`string`},message:{description:`Normal Markdown shown to the user for this task turn. For question, the question. For cannot, why.`,type:`string`},report:{description:`What you did, in a few plain sentences, when the task is complete; otherwise an empty string.`,type:`string`}},required:[`kind`,`message`,`report`],type:`object`});var VIBE64_TASK_RESULT_KINDS=Object.freeze([...Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),VIBE64_AI_TASK_RESULT_KINDS.QUESTION,VIBE64_AI_TASK_RESULT_KINDS.CANNOT]);var VIBE64_ASSISTANT_ACCESS_ERROR_CODES=Object.freeze({RESTRICTED:`vibe64_assistant_owner_required`,UNAVAILABLE:`vibe64_assistant_connection_unavailable`});var VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS=10;var VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS=160;var ATTACHMENT_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;var IMAGE_TYPES=Object.freeze({avif:`image/avif`,bmp:`image/bmp`,gif:`image/gif`,jpeg:`image/jpeg`,jpg:`image/jpeg`,png:`image/png`,webp:`image/webp`});function conversationAttachmentContentType(fileName=``){const extension=String(fileName).split(`.`).at(-1).toLowerCase();return Object.hasOwn(IMAGE_TYPES,extension)?IMAGE_TYPES[extension]:`application/octet-stream`}function conversationAttachmentReference(attachment={},number=1){return`[${conversationAttachmentContentType(attachment.fileName).startsWith(`image/`)?`Image`:`File`} #${number}]`}function conversationAttachmentFileName(value=``){const normalized=Array.from(String(value??``),character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127?` `:character}).join(``).trim();return Array.from(normalized).slice(0,VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS).join(``)}function normalizeVibe64ConversationAttachments(value=[]){return(Array.isArray(value)?value:[]).slice(0,VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS).map(candidate=>{if(!candidate||typeof candidate!==`object`||Array.isArray(candidate)||typeof candidate.fileName!==`string`)return null;const fileName=conversationAttachmentFileName(candidate.fileName);if(!fileName)return null;return{...ATTACHMENT_ID_PATTERN.test(String(candidate.attachmentId||``))?{attachmentId:candidate.attachmentId}:{},.../^\[(?:Image|File) #[1-9][0-9]{0,3}\]$/u.test(candidate.reference||``)?{reference:candidate.reference}:{},fileName,...Number.isSafeInteger(candidate.size)&&candidate.size>=0?{size:candidate.size}:{}}}).filter(Boolean)}var VIBE64_PROMPT_HINT_LABEL_MAX_CHARACTERS=24;var VIBE64_PROMPT_HINT_PROMPT_MAX_CHARACTERS=108;function normalizedPromptHintDraft(value=``){return Array.from(String(value??``).replace(/\r\n?/gu,`
|
|
2
2
|
`).trim()).slice(-4e3).join(``)}var VIBE64_PROMPT_HINT_OUTPUT_SCHEMA=Object.freeze({additionalProperties:false,properties:Object.freeze({suggestions:Object.freeze({items:Object.freeze({additionalProperties:false,properties:Object.freeze({label:Object.freeze({maxLength:24,minLength:1,type:`string`}),prompt:Object.freeze({maxLength:108,minLength:1,type:`string`})}),required:Object.freeze([`label`,`prompt`]),type:`object`}),maxItems:3,minItems:3,type:`array`})}),required:Object.freeze([`suggestions`]),type:`object`});var VIBE64_PROMPT_HINT_STATIC_STARTERS=Object.freeze({existingProject:Object.freeze([Object.freeze({label:`Tour this project`,prompt:`Give me a quick tour of this project`}),Object.freeze({label:`Find first improvement`,prompt:`What should I improve first?`}),Object.freeze({label:`Plan safe change`,prompt:`Help me plan a small safe change`})]),greenfield:Object.freeze([Object.freeze({label:`Shape app idea`,prompt:`Help me shape my app idea`}),Object.freeze({label:`Plan first version`,prompt:`Show me the simplest useful first version`}),Object.freeze({label:`Decide first steps`,prompt:`What should we decide first?`})])});function normalizedPromptHintSuggestion(suggestion={}){if(!suggestion||typeof suggestion!==`object`||Array.isArray(suggestion)||Object.keys(suggestion).length!==2||!Object.hasOwn(suggestion,`label`)||!Object.hasOwn(suggestion,`prompt`)||typeof suggestion.label!==`string`||typeof suggestion.prompt!==`string`||[suggestion.label,suggestion.prompt].some(text=>Array.from(text).some(character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127})))return null;const label=suggestion.label.trim().replace(/[\t ]+/gu,` `);const prompt=suggestion.prompt.trim().replace(/[\t ]+/gu,` `);const labelWordCount=label?label.split(/\s+/u).length:0;return label&&prompt&&Array.from(label).length<=24&&Array.from(prompt).length<=108&&labelWordCount>=2&&labelWordCount<=4?{label,prompt}:null}function normalizedPromptHintSuggestions(value=[]){if(!Array.isArray(value)||value.length!==3)return[];const suggestions=value.map(normalizedPromptHintSuggestion).filter(Boolean);return suggestions.length===3&&new Set(suggestions.map(({label})=>label.toLocaleLowerCase())).size===3&&new Set(suggestions.map(({prompt})=>prompt.toLocaleLowerCase())).size===3?suggestions:[]}export{curatedCodexProvider as _,conversationAttachmentReference as a,sameVibe64AssistantSelection as b,vibe64AssistantSelectionLabel as c,VIBE64_DEFAULT_AGENT_PROVIDER_ID as d,defaultVibe64AgentSettings as f,CURATED_CODEX_PROVIDERS as g,vibe64AgentExecutionProfileAuditSnapshot as h,conversationAttachmentContentType as i,vibe64ProviderPresentation as l,normalizeVibe64AgentSettings as m,normalizedPromptHintSuggestion as n,normalizeVibe64ConversationAttachments as o,findVibe64AgentProvider as p,normalizedPromptHintSuggestions as r,VIBE64_ASSISTANT_ACCESS_ERROR_CODES as s,normalizedPromptHintDraft as t,VIBE64_AGENT_PROVIDERS as u,CUSTOM_AI_PROVIDER_ID as v,defineVibe64AssistantSelection as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as vibe64ProjectQueryScope}from"./vibe64ProjectScope.local-B9ZpdYlf.js";import{a as studioApiPath}from"./studioUrls-
|
|
1
|
+
import{s as vibe64ProjectQueryScope}from"./vibe64ProjectScope.local-B9ZpdYlf.js";import{a as studioApiPath}from"./studioUrls-k_pQIuPs.js";var VIBE64_PROJECT_CREATE_API_SUFFIX=`/vibe64/projects`;var VIBE64_ENV_SECRET_REVEAL_API_SUFFIX=`/vibe64/env/reveal`;var VIBE64_ENV_DOWNLOAD_API_SUFFIX=`/vibe64/env/download`;var VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX=`/vibe64/settings/development-database`;var VIBE64_ENGINEERING_API_SUFFIX=`/vibe64/settings/engineering`;var VIBE64_COLLABORATION_API_SUFFIX=`/vibe64/settings/collaboration`;var VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX=`/vibe64/settings/prompt-hints`;var VIBE64_ENV_USER_VALUES_API_SUFFIX=`/vibe64/env/user-values`;var VIBE64_PREVIEW_IDENTITIES_API_SUFFIX=`/vibe64/preview-identities`;var VIBE64_PROJECT_SELECT_API_SUFFIX=`/vibe64/projects/select`;var VIBE64_CONNECTIONS_CHANGED_EVENT=`vibe64.connections.changed`;var VIBE64_PROJECT_CHANGED_EVENT=`vibe64.project.changed`;var TARGET_PROJECT_ENDPOINT=studioApiPath(`studio/current-app`);var STUDIO_HEALTH_ENDPOINT=studioApiPath(`studio/health`);var STUDIO_TOOLS_ENDPOINT=studioApiPath(`studio/health/tools`);var VIBE64_ENDPOINT=studioApiPath(`vibe64`);var PROJECT_SELECTION_ENDPOINT=`${VIBE64_ENDPOINT}/projects`;var ENV_ENDPOINT=`${VIBE64_ENDPOINT}/env`;var ENV_SECRET_REVEAL_ENDPOINT=`${ENV_ENDPOINT}/reveal`;var ENV_DOWNLOAD_ENDPOINT=`${ENV_ENDPOINT}/download`;var PROJECT_SETTINGS_ENDPOINT=`${VIBE64_ENDPOINT}/settings`;var DEVELOPMENT_DATABASE_ENDPOINT=`${PROJECT_SETTINGS_ENDPOINT}/development-database`;var ENGINEERING_ENDPOINT=`${PROJECT_SETTINGS_ENDPOINT}/engineering`;var COLLABORATION_ENDPOINT=`${PROJECT_SETTINGS_ENDPOINT}/collaboration`;var PROMPT_HINTS_SETTINGS_ENDPOINT=`${PROJECT_SETTINGS_ENDPOINT}/prompt-hints`;var ENV_USER_VALUES_ENDPOINT=`${ENV_ENDPOINT}/user-values`;var PREVIEW_IDENTITIES_ENDPOINT=`${VIBE64_ENDPOINT}/preview-identities`;function projectSelectionQueryKey(surfaceId,ownershipFilter,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`projects`]}function envQueryKey(surfaceId,ownershipFilter,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`env`]}function projectSettingsQueryKey(surfaceId,ownershipFilter,projectSlug,sessionId=``){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`settings`,String(sessionId||``).trim()||`selected-source`]}function engineeringSettingsQueryKey(surfaceId,ownershipFilter,projectSlug,sessionId=``){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`engineering`,String(sessionId||``).trim()||`selected-source`]}function previewIdentitiesQueryKey(surfaceId,ownershipFilter,projectSlug){return[`vibe64`,...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,`preview-identities`]}function studioHealthQueryKey(surfaceId,ownershipFilter){return[`vibe64`,surfaceId,ownershipFilter,`studio-health`]}export{projectSettingsQueryKey as A,VIBE64_PROJECT_CREATE_API_SUFFIX as C,envQueryKey as D,engineeringSettingsQueryKey as E,previewIdentitiesQueryKey as O,VIBE64_PROJECT_CHANGED_EVENT as S,VIBE64_PROMPT_HINTS_SETTINGS_API_SUFFIX as T,VIBE64_ENGINEERING_API_SUFFIX as _,ENV_ENDPOINT as a,VIBE64_ENV_USER_VALUES_API_SUFFIX as b,PREVIEW_IDENTITIES_ENDPOINT as c,PROMPT_HINTS_SETTINGS_ENDPOINT as d,STUDIO_HEALTH_ENDPOINT as f,VIBE64_DEVELOPMENT_DATABASE_API_SUFFIX as g,VIBE64_CONNECTIONS_CHANGED_EVENT as h,ENV_DOWNLOAD_ENDPOINT as i,studioHealthQueryKey as j,projectSelectionQueryKey as k,PROJECT_SELECTION_ENDPOINT as l,VIBE64_COLLABORATION_API_SUFFIX as m,DEVELOPMENT_DATABASE_ENDPOINT as n,ENV_SECRET_REVEAL_ENDPOINT as o,STUDIO_TOOLS_ENDPOINT as p,ENGINEERING_ENDPOINT as r,ENV_USER_VALUES_ENDPOINT as s,COLLABORATION_ENDPOINT as t,PROJECT_SETTINGS_ENDPOINT as u,VIBE64_ENV_DOWNLOAD_API_SUFFIX as v,VIBE64_PROJECT_SELECT_API_SUFFIX as w,VIBE64_PREVIEW_IDENTITIES_API_SUFFIX as x,VIBE64_ENV_SECRET_REVEAL_API_SUFFIX as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as currentProjectSlugFromLocation}from"./vibe64ProjectScope.local-B9ZpdYlf.js";import{n as getHttpWebClient}from"./httpClient-
|
|
1
|
+
import{t as currentProjectSlugFromLocation}from"./vibe64ProjectScope.local-B9ZpdYlf.js";import{n as getHttpWebClient}from"./httpClient-Bwitq9Xf.js";import{t as resolveScopedApiBasePath}from"./surface-CBlx7sF_.js";function studioApiPath(relativePath){return resolveScopedApiBasePath({routeBase:`/`,relativePath,strictParams:false})}function resolveStudioRequestUrl(url){return scopedDevelopmentApiUrl(url,currentProjectSlugFromLocation())}function requestStudio(url,options){return getHttpWebClient().request(resolveStudioRequestUrl(url),options)}function scopedDevelopmentApiUrl(url,slug=currentProjectSlugFromLocation(),{scopeGlobalPaths=false}={}){const projectSlug=String(slug||``).trim();if(!projectSlug)return url;const source=String(url||``).trim();if(!source)return url;const absolute=/^[a-z][a-z0-9+.-]*:\/\//iu.test(source);const base=typeof window===`undefined`?`http://vibe64.local`:window.location.origin;const parsed=new URL(source,base);const pathname=scopedDevelopmentApiPathname(parsed.pathname,projectSlug,{scopeGlobalPaths});if(pathname===parsed.pathname)return url;parsed.pathname=pathname;return absolute?parsed.toString():`${parsed.pathname}${parsed.search}${parsed.hash}`}function scopedDevelopmentApiPathname(pathname=``,slug=``,{scopeGlobalPaths=false}={}){const normalizedPathname=String(pathname||``).trim();if(!slug||normalizedPathname.startsWith(`/api/app/`)||!scopeGlobalPaths&&isGlobalApiPathname(normalizedPathname)||!isDevelopmentApiPathname(normalizedPathname))return normalizedPathname;return`/api/app/${encodeURIComponent(slug)}${normalizedPathname.slice(4)}`}function isGlobalApiPathname(pathname=``){return pathname===`/api/studio/health`||pathname.startsWith(`/api/studio/health/`)||pathname===`/api/studio/browser-lifecycle/ws`||pathname===`/api/vibe64/projects`||pathname.startsWith(`/api/vibe64/projects/`)||pathname===`/api/vibe64/colleague`||pathname.startsWith(`/api/vibe64/colleague/`)||pathname===`/api/vibe64/training`||pathname.startsWith(`/api/vibe64/training/`)||pathname===`/api/vibe64/voice`||pathname.startsWith(`/api/vibe64/voice/`)||pathname===`/api/vibe64/launcher`||pathname.startsWith(`/api/vibe64/launcher/`)||pathname===`/api/vibe64/github`||pathname.startsWith(`/api/vibe64/github/`)}function isDevelopmentApiPathname(pathname=``){return pathname===`/api/studio`||pathname.startsWith(`/api/studio/`)||pathname===`/api/vibe64`||pathname.startsWith(`/api/vibe64/`)}function resolveWebSocketUrl(pathname,browserWindow=window){const protocol=browserWindow.location.protocol===`https:`?`wss:`:`ws:`;const scopedPathname=scopedDevelopmentApiUrl(pathname,currentProjectSlugFromLocation());return`${protocol}//${browserWindow.location.host}${scopedPathname}`}export{studioApiPath as a,scopedDevelopmentApiUrl as i,resolveStudioRequestUrl as n,resolveWebSocketUrl as r,requestStudio as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ht as proxyRefs,it as watch,u as computed,vt as ref}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{t as useEndpointResource}from"./useEndpointResource-CmMwteuX.js";import{g as useRoute}from"./useApi-BPuI6ZR9-rsYWyW6m.js";import{r as projectAppPath}from"./vibe64ProjectScope.local-B9ZpdYlf.js";import{n as getHttpWebClient}from"./httpClient-Bwitq9Xf.js";import{o as ROUTE_VISIBILITY_PUBLIC}from"./visibility-Cq31Xy7I.js";import{a as normalizeConversationLogPage,i as mergeConversationLogPages,o as normalizeConversationLogPagination,r as conversationLogReadQuery}from"./conversation-p_mmD9ie.js";import{t as usePaths}from"./usePaths-CvUbx5-V.js";import{t as readRefOrGetterValue}from"./vueRefOrGetterValue-y-4f_In7.js";import{H as vibe64SessionsQueryKey,L as vibe64SessionPath,V as vibe64SessionQueryKey,b as vibe64ConversationLogPath,n as VIBE64_ARCHIVED_SESSIONS_API_SUFFIX,o as VIBE64_SESSIONS_API_SUFFIX,x as vibe64ConversationLogQueryKey}from"./vibe64SessionRequestConfig-DVRCRAex.js";import{N as useVibe64ProjectSlug}from"./index-fXKdz8oR.js";import{t as isArchivedVibe64Session}from"./vibe64SessionViewModel-CQCds_jb.js";import{n as enrichVibe64SessionForDisplay}from"./vibe64SessionPanelModel-B-WkXnPu.js";import{t as normalizeConversationLog}from"./useVibe64ConversationLog-CUWEZhnf.js";function useArchivedVibe64ConversationHistory({active=true,projectSlug,session,sessionsApiPath}={}){const httpClient=getHttpWebClient();const sessionId=computed(()=>String(readRefOrGetterValue(session)?.sessionId||``).trim());const enabled=computed(()=>readRefOrGetterValue(active)!==false&&Boolean(sessionId.value));const path=computed(()=>sessionId.value?vibe64ConversationLogPath(readRefOrGetterValue(sessionsApiPath),sessionId.value):``);const resource=useEndpointResource({enabled,fallbackLoadError:`Conversation history could not be loaded.`,path,queryKey:computed(()=>vibe64ConversationLogQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,sessionId.value,readRefOrGetterValue(projectSlug))),queryOptions:{queryFn:({signal})=>httpClient.request(path.value,{method:`GET`,query:conversationLogReadQuery(),signal}),placeholderData:previousData=>previousData,refetchOnMount:false,refetchOnWindowFocus:false},readMethod:`GET`,refreshOnPull:true,requestRecoveryLabel:`Conversation history`,realtime:null});const olderPages=ref([]);const loadingMore=ref(false);const loadMoreError=ref(``);const latestPage=computed(()=>normalizeConversationLogPage(resource.data.value||{}));const oldestLoadedPage=computed(()=>olderPages.value[0]||latestPage.value);const hasMoreBefore=computed(()=>Boolean(normalizeConversationLogPagination(oldestLoadedPage.value?.pagination).hasMoreBefore));const turns=computed(()=>normalizeConversationLog(mergeConversationLogPages([...olderPages.value,latestPage.value])));function reload(){olderPages.value=[];loadMoreError.value=``;return resource.reload()}async function loadMore({complete}={}){const finish=result=>{if(typeof complete===`function`)complete(result)};const pagination=normalizeConversationLogPagination(oldestLoadedPage.value?.pagination);const beforeTurnId=pagination.nextBeforeTurnId||pagination.oldestTurnId||String(turns.value[0]?.turnId||``).trim();if(!enabled.value||!path.value||!hasMoreBefore.value||loadingMore.value||!beforeTurnId){finish({changed:false,loaded:false});return false}const requestedSessionId=sessionId.value;loadingMore.value=true;loadMoreError.value=``;try{const page=await httpClient.request(path.value,{method:`GET`,query:conversationLogReadQuery({beforeTurnId,limit:10})});if(sessionId.value!==requestedSessionId){finish({changed:false,loaded:false});return false}const messageCount=()=>turns.value.reduce((count,turn)=>count+(turn.messages?.length||0),0);const previousOldestTurnId=String(turns.value[0]?.turnId||``).trim();const previousMessageCount=messageCount();olderPages.value=[normalizeConversationLogPage(page),...olderPages.value];const nextOldestTurnId=String(turns.value[0]?.turnId||``).trim();finish({changed:Boolean(nextOldestTurnId&&(nextOldestTurnId!==previousOldestTurnId||messageCount()!==previousMessageCount)),loaded:true});return true}catch(error){if(sessionId.value===requestedSessionId)loadMoreError.value=String(error?.message||error||`Older conversation history could not be loaded.`);finish({changed:false,loaded:false});return false}finally{loadingMore.value=false}}watch(sessionId,()=>{olderPages.value=[];loadMoreError.value=``});return{error:resource.loadError,hasMoreBefore,loadMore,loadMoreError,loading:resource.isLoading,loadingMore,reload,turns}}var archivedVibe64SessionsEmits=[`loading-changed`];var ARCHIVED_SESSIONS_PAGE_SIZE=30;var ARCHIVED_SESSIONS_MAX_LIMIT=1e3;var archivedAtFormatter=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});var archivedVibe64SessionsProps={description:{default:``,type:String},emptyText:{default:``,type:String},emptyTitle:{default:`No sessions`,type:String},showRefresh:{default:true,type:Boolean},title:{default:``,type:String}};function useArchivedVibe64Sessions(emit){const paths=usePaths();const projectSlug=useVibe64ProjectSlug();const sessionsApiPath=computed(()=>paths.api(VIBE64_ARCHIVED_SESSIONS_API_SUFFIX,{surface:`app`}));const shownLimit=ref(ARCHIVED_SESSIONS_PAGE_SIZE);watch(projectSlug,()=>{shownLimit.value=ARCHIVED_SESSIONS_PAGE_SIZE});const sessionListResource=useEndpointResource({fallbackLoadError:`Archived sessions could not be loaded.`,path:sessionsApiPath,queryKey:computed(()=>[...vibe64SessionsQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value),`archived`,shownLimit.value]),queryOptions:{placeholderData:previous=>previous},readQuery:computed(()=>({sessionLimit:String(shownLimit.value)})),requestRecoveryLabel:`Archived sessions`});const loading=computed(()=>Boolean(sessionListResource.isLoading.value));const error=computed(()=>String(sessionListResource.loadError.value||``));const sessions=computed(()=>{const payload=sessionListResource.data.value;return(Array.isArray(payload?.sessions)?payload.sessions:[]).map(enrichVibe64SessionForDisplay).filter(isArchivedVibe64Session)});watch(loading,isLoading=>{emit(`loading-changed`,isLoading)},{immediate:true});const sessionCount=computed(()=>Number(sessionListResource.data.value?.sessionCount??sessions.value.length));const hasMore=computed(()=>sessionListResource.data.value?.nextSessionOffset!=null&&shownLimit.value<ARCHIVED_SESSIONS_MAX_LIMIT);function showMore(){if(!hasMore.value||loading.value)return;shownLimit.value=Math.min(shownLimit.value+ARCHIVED_SESSIONS_PAGE_SIZE,ARCHIVED_SESSIONS_MAX_LIMIT)}return{unavailableSessions:computed(()=>sessionListResource.data.value?.unavailableSessions||[]),error,hasMore,loadSessions,loading,sessionCount,showMore,formatArchivedAt,sessionRoute,sessions};async function loadSessions(){await sessionListResource.reload()}function sessionRoute(session={}){return archivedSessionDetailRoute({projectSlug:projectSlug.value,sessionId:session.sessionId})}}function useArchivedVibe64SessionDetail(){const route=useRoute();const paths=usePaths();const projectSlug=useVibe64ProjectSlug(route);const sessionId=computed(()=>firstRouteParam(route.params.sessionId));const sessionsApiPath=computed(()=>paths.api(VIBE64_SESSIONS_API_SUFFIX,{surface:`app`}));const sessionPath=computed(()=>sessionId.value?vibe64SessionPath(sessionsApiPath.value,sessionId.value):``);const sessionResource=useEndpointResource({enabled:computed(()=>Boolean(sessionId.value)),fallbackLoadError:`Archived session could not be loaded.`,path:sessionPath,queryKey:computed(()=>[...vibe64SessionQueryKey(`app`,ROUTE_VISIBILITY_PUBLIC,projectSlug.value),`archive-detail`,sessionId.value]),readQuery:computed(()=>projectSlug.value?{projectSlug:projectSlug.value}:null),requestRecoveryLabel:`Archived session`});const session=computed(()=>{const payload=sessionResource.data.value;if(!payload||typeof payload!==`object`||Array.isArray(payload))return null;if(String(payload.sessionId||``).trim()!==sessionId.value)return null;const enrichedSession=enrichVibe64SessionForDisplay(payload);return isArchivedVibe64Session(enrichedSession)?enrichedSession:null});const sessionHistoryTo=computed(()=>({path:`${projectAppPath(projectSlug.value)}/dashboard/history`}));return{conversationLog:proxyRefs(useArchivedVibe64ConversationHistory({active:computed(()=>Boolean(session.value)),projectSlug,session,sessionsApiPath})),error:computed(()=>String(sessionResource.loadError.value||``)),loading:computed(()=>Boolean(sessionResource.isLoading.value||sessionResource.isInitialLoading?.value)),reload:sessionResource.reload,session,sessionHistoryTo,sessionId,sessionsApiPath,projectSlug}}function formatArchivedAt(value=``){const date=new Date(String(value||``));return Number.isNaN(date.getTime())?`time unavailable`:archivedAtFormatter.format(date)}function archivedSessionDetailRoute({projectSlug=``,sessionId=``}={}){return{path:`${projectAppPath(projectSlug)}/dashboard/history/${encodeURIComponent(String(sessionId||``).trim())}`}}function firstRouteParam(value){return String(Array.isArray(value)?value[0]:value||``).trim()}function metadataValue(session={},name=``){return String(session.metadata?.[name]||``).trim()}function archiveFactRows(session={}){return[{icon:`$forkRight`,label:`Branch`,value:session.branch||metadataValue(session,`source_recovery_branch`)},{icon:`$commit`,label:`Head`,value:metadataValue(session,`source_recovery_head`)||metadataValue(session,`base_commit`)},{icon:`$description`,label:`Saved patch`,value:metadataValue(session,`source_recovery_patch_artifact`)||`No saved patch`},{icon:`$description`,label:`Untracked files`,value:metadataValue(session,`source_recovery_untracked_artifact`)||`No saved untracked archive`}].filter(row=>row.value)}export{useArchivedVibe64Sessions as a,useArchivedVibe64SessionDetail as i,archivedVibe64SessionsEmits as n,archivedVibe64SessionsProps as r,archiveFactRows as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Tt as toValue,gt as reactive,it as watch,mt as onScopeDispose,u as computed,ut as getCurrentScope,vt as ref}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import"./client-4uCr4dYG.js";import{r as useJskitText,t as registerJskitMessages}from"./i18n-BuXRXGaO.js";var jskit=JSON.parse(`{"assistant":{"api":{"requestFailed":"Assistant request failed."},"attachments":{"announcement":{"cancelled":"{count} attachment cancelled. | {count} attachments cancelled.","inProgress":"{count} attachment is in progress. | {count} attachments are in progress.","needAttention":"{count} attachment needs attention. | {count} attachments need attention.","ready":"{count} attachment ready. | {count} attachments ready."},"attached":"Attached files","bytes":"{sent} / {size}","bytesPercent":"{sent} / {size} · {percent}%","cancelItem":"Cancel {name}","close":"Close","download":"Download","error":{"cleanupFailed":"Attachment cleanup failed.","localFilePaste":"Copied local files cannot be pasted from this browser. Drop the file or use Attach files.","noFile":"The prepared attachment did not produce a file.","preparationFailed":"Attachment preparation failed.","tooLarge":"{fileName} is larger than the {limit} attachment limit.","tooMany":"A message can keep at most {count} attachments.","unusable":"Uploaded attachment could not be used.","uploadFailed":"Attachment upload failed."},"limit":"{count} / {max}","preparingName":"Preparing attachment…","previewUnavailable":"Preview is unavailable for this file. You can download it below.","queue":"Message attachments","removeItem":"Remove {name}","retryItem":"Retry {name}","sizeBytes":"{size} B","sizeKilobytes":"{size} KB","sizeMebibytes":"{size} MiB","sizeMegabytes":"{size} MB","status":{"cancelled":"Cancelled","delivering":"Sending to Codex","preparationFailed":"Preparation failed","preparing":"Preparing","queued":"Queued","ready":"Ready","sendingFailed":"Sending failed","uploadFailed":"Upload failed","uploading":"Uploading"},"summary":{"cancelled":"{completed} ready · {cancelled} cancelled","inProgress":"{completed} of {total} ready · in progress","needAttention":"{completed} of {total} ready · {count} needs attention | {completed} of {total} ready · {count} need attention","percent":"{completed} of {total} ready · {percent}%","ready":"{completed} of {total} ready"},"unnamed":"attachment","uploadProgress":"Upload progress for {name}"},"chat":{"attachFiles":"Attach files","avatar":"Conversation avatar","discardUnsent":"Discard unsent message","editUnsent":"Edit unsent message","label":"Assistant conversation","messageAssistant":"Message AI assistant","minimiseAvatar":"Minimise avatar","reviewAttachedFiles":"Please review the attached files.","sendingToAssistant":"Sending to assistant…","showAvatar":"Show avatar","working":"Assistant is working…"},"composer":{"cannotSendYet":"Your words are in the chat box, but this conversation cannot send yet.","chatChanged":"The chat changed before sending. Review the draft before sending.","notReady":"The chat composer is not ready yet.","send":"Send","sendMessage":"Send message","sending":"Sending…","stop":"Stop","stopping":"Stopping…","suggestedPrompts":"Suggested prompts","suggestionsAvailable":"{count} suggested prompts are available before the message controls.","thinkingOfIdeas":"Thinking of a few ideas","thinkingOfIdeasStatus":"Thinking of a few ideas.","useSuggestion":"Use suggestion: {prompt}"},"delivery":{"cancelling":"Cancelling…","cancelUnreachable":"Couldn't reach the server — Cancel again","checkBeforeResend":"Check delivery before resending.","checkPrevious":"Check the previous message's delivery before sending again.","checking":"Checking…","notConfirmed":"Message delivery is not confirmed.","notSent":"Message could not be sent.","retry":"Retry","retryCheck":"Retry delivery check","unconfirmed":"Delivery could not be confirmed.","unconfirmedShort":"Delivery unconfirmed."},"goal":{"blocked":"Goal blocked","budgetLimited":"Goal budget reached","cancel":"Cancel goal","cancelInterruptsTurn":"Cancel stops the current turn and clears the goal.","cancelRemovesGoal":"Cancel removes this goal. Use Stop to interrupt a turn already running.","cancelling":"Cancelling…","complete":"Goal complete","elapsed":"{label}: {elapsed}","elapsedSinceStart":"Elapsed since goal started (including pauses)","goal":"Goal","loading":"Loading goal…","objective":"Goal objective","outOfCredit":"Out of credit: top up or switch AI account","pause":"Pause goal","pauseInterruptsTurn":"Pause stops the current turn and keeps the goal for later.","pausePreventsTurns":"Pausing prevents further automatic turns. Use Stop to interrupt the current turn.","paused":"Goal paused","pausing":"Pausing…","resume":"Resume goal","resuming":"Resuming…","running":"Goal running","runningTime":"Running time","set":"Set goal","start":"Start goal","starting":"Starting…","tokenBudget":"Token budget (optional)","unavailable":"Goal unavailable","usageLimited":"Waiting: AI usage limit","usageLimitedHint":"The goal does not continue by itself. Choose Resume goal once the AI account can work again.","usageLimitedUntil":"Waiting: AI usage limit, resets at {time}"},"longText":{"details":"Details","table":"Table"},"model":{"apply":"Apply","applying":"Applying…","chooseAi":"Choose AI","chooseModel":"Choose model","controls":"AI controls","loading":"Loading available AIs","model":"Model","noMatchingModels":"No matching models","noModels":"No available models.","noneConfigured":"No configured AIs are available for this session.","provider":"Provider","selector":"AI session selector","thinking":"Thinking","tryAgain":"Try again","viewOnly":"AI choices are view-only while the assistant is working.","waitBeforeChanging":"Wait for the active turn to finish before changing models."},"progress":{"hide":"Hide progress updates","showAll":"Show all {count} progress update | Show all {count} progress updates","showLatest":"Show latest {count} progress update | Show latest {count} progress updates"},"questions":{"answerNormally":"Answer normally instead","answerRequired":"Answer question {number}.","fieldLabel":"[{number}] {label}","label":"Assistant questions","suggestedAnswers":"Suggested answers"},"settings":{"readOnly":"Read-only","systemPromptTooLong":"Assistant system prompt must be at most {max} characters.","systemPromptInvalid":"Assistant system prompt must be valid text."},"transcript":{"assistant":"Assistant","cancel":"Cancel","edit":"Edit","failed":"Failed: {error}","history":"Conversation history","loadOlder":"Load older messages","loading":"Loading conversation","loadingOlder":"Loading older messages…","messages":"Conversation messages","pending":"Pending","pendingReason":"Pending: {reason}","preparing":"Preparing conversation","progress":"{name} progress","readMore":"Read more","recommended":" · Recommended","reload":"Reload chat","reloading":"Reloading chat","reloadingShort":"Reloading…","reviewMessage":"Review your message","showLess":"Show less","status":"Status"},"turn":{"failed":"Assistant stopped with an error.","stopped":"Stopped.","invalidResponse":"The assistant returned an invalid response.","requestIncomplete":"The assistant could not complete this request."},"conversation":{"handleClosed":"This conversation handle is closed.","handleDisposed":"This conversation handle is disposed.","runtimeClosed":"This conversation runtime is closed.","pagedHistoryUnsupported":"This conversation does not supply paged history.","completedEnvelopesNeedNativeOwner":"Completed envelopes require a runtime-owned native conversation.","completedEnvelopesNotOwned":"This conversation does not own completed envelopes.","goalAttachmentContentUnsupported":"Native goals require extracted text or supported image bytes for attachments.","originalSendOnly":"This conversation supports its original application Send operation.","attachmentIdsOnly":"Supply attachmentIds; only the application's resolver can supply file content.","attachmentsNotConfigured":"File attachments are not configured for this conversation.","steeringUnsupported":"This connection does not support steering.","goalsUnsupported":"This connection does not support native goals.","goalTokenBudgetsUnsupported":"This connection does not support goal token budgets.","goalCommandUnsupported":"This connection does not support that goal command.","goalAttachmentsUnsupported":"This engine's native goal commands do not accept attachments.","completedEnvelopesNeedNativeEngine":"Completed envelopes require a native engine.","replacementPolicyRetained":"This conversation retains its original replacement policy.","selectedProfileRetained":"This scoped conversation retains its original selected profile.","hostSelectionRequired":"This host requires its authorized assistant selection operation.","liveSettingsUnsupported":"This provider does not support live native settings.","completedEnvelopesNeedStorage":"Completed envelopes require runtime-owned canonical storage.","originalReadOnly":"This conversation uses its original read and subscription operations.","messageCancelUnsupported":"This conversation cannot cancel one message.","messageCancelled":"This message was cancelled. Send it again as a new message.","authorizedSelectionRequired":"Use the conversation's authorized selection operation.","eventDeliveryRetained":"This scoped conversation retains its original event delivery.","engineChanged":"The selected native engine changed.","useReplaceForEngine":"Use replace() to change this conversation's engine.","rewindInspectionBeforeOpen":"This conversation has an unfinished Undo operation from an earlier runtime. Inspect its saved native and local history offline before opening it; no history was changed.","rewindInspectionBeforeReplace":"This conversation has an unfinished Undo operation from an earlier runtime. Inspect its saved native and local history offline before replacing it; no history was changed.","responseOwnerChanged":"The completed response owner changed.","newerResponseOwnsWorker":"A newer completed response owns this worker.","responseIdentityChanged":"The completed response identity changed.","applicationToolMessageStale":"This application tool's admitted message is no longer current.","nativeCompletionMessageStale":"This native completion's admitted message is no longer current.","toolObservationRetired":"The native tool observation belongs to a retired response.","toolObservationReceiptLost":"The native tool observation lost its exact admitted receipt.","waitForNativeResponse":"Wait for the native response to finish.","waitForAnswer":"Wait for this answer or use steer to send another instruction.","waitForTurnSaving":"Wait for the current turn to finish saving before starting the goal.","waitForInstructionAdmission":"Wait for the pending instruction to be admitted before steering again.","waitForGoalCommand":"Wait for the goal command to be admitted.","waitForSubmission":"Wait for the current submission before checking delivery.","stopBeforeReplace":"Stop the current turn before replacing its native conversation.","stopBeforeSettings":"Stop the current turn before changing its settings.","completedResponseNoReceipt":"The completed response has no current verified receipt.","completedResponseNoTurnReceipt":"The completed response has no exact native turn receipt.","completedClaudeNoToolEvidence":"The completed Claude response has no native tool-attempt evidence.","responseAssociationUnverified":"The native owner could not verify this response association.","responseOtherOperation":"This response already belongs to a different application operation.","completedResponseNoPlainReply":"This completed response does not own a plain reply.","completedReplyNoTarget":"The completed reply has no current plain authored target.","publishedReplyChanged":"The published reply target or text changed.","replyTargetUsed":"This plain reply target already has unassociated content or consumption.","operationResponseIdentity":"The operation has a different completed response identity.","plainReplyPublished":"This completed response already published its plain reply.","savedOperationChanged":"The saved response operation changed.","turnFinishedBeforeSend":"The native turn finished before this instruction was sent. Send it as a new message.","noActiveTurnToSteer":"There is no active native turn to steer. Send a new message.","briefingBeforeTerminal":"Send a chat message to deliver the saved continuity briefing before starting a native terminal or goal.","briefingBeforeGoal":"Send a message to catch this AI up before starting or resuming its goal.","briefingBeforeReplacement":"Deliver the previous replacement's briefing before replacing native history again.","historyExclusionsInvalid":"Native history exclusions require a server-owned completed application wake and exact message IDs.","messageContentRequired":"Bounded text or attachment IDs and a stable messageId are required.","steerNotBoolean":"steer must be a boolean.","applicationDataInvalid":"Application data must be a JSON object within the conversation input limit.","goalMessageIdRequired":"A stable messageId is required for this goal command.","goalConversationChanged":"The conversation changed before this goal command was sent.","goalNeedsNativeConversation":"This command requires an existing native conversation.","messageIdExclusionsConflict":"This messageId already belongs to different native history exclusions.","messageIdContentConflict":"This messageId already belongs to different content.","completedClaudeNotSteerable":"Completed Claude responses cannot share a native steering turn. Wait for the response or stop it.","replacementPendingBeforeSend":"Finish the pending native replacement before sending another message.","replacementPendingBeforeRecovery":"Finish the native replacement before recovering output.","replacementUnfinished":"Retry the unfinished native replacement before starting another one.","replacementPendingBeforeSettings":"Finish the pending native replacement before changing settings.","retainedDeliveryUncertain":"This message has uncertain delivery in a retained conversation. Select that engine and check its receipt before submitting it again.","previousInstructionUnchecked":"Check delivery of the previous instruction before preparing another completed response.","previousSubmissionUncertain":"The previous submission has uncertain delivery. It will not be resent automatically.","goalCommandDeliveryUncertain":"Check the uncertain command's delivery before changing the goal.","earlierGoalCommandUnresolved":"A goal command from an earlier runtime has unresolved delivery. Inspect its saved state before changing the goal.","pendingDeliveryBeforeReplace":"Resolve pending delivery before replacing native history. Another engine may be selected while its receipt stays pending.","deliveryUncertainBeforeSettings":"Resolve uncertain delivery before changing settings.","goalActionRequired":"A goal action and current conversation segment are required.","goalObjectiveInvalid":"A bounded objective and optional positive token budget are required.","goalToResumeRequired":"Select the goal to resume.","goalToStopRequired":"Select the goal to stop.","replacementRequestInvalid":"Replacement needs an operationId, exact predecessor segment, and an engine-change, model-change or renewal reason.","replacementBriefingRequired":"Native replacement requires a continuity briefing.","predecessorChanged":"The native predecessor has changed. Read the conversation before replacing it.","replacementOperationConflict":"This replacement operationId already belongs to another request.","replacementChangedBeforeWrite":"The saved replacement changed before it could be written.","replacementChangedBeforeRelease":"The saved replacement changed before its binding was released.","predecessorChangedBeforeRelease":"The native predecessor identity changed before its binding was released.","predecessorIncomplete":"The native predecessor identity changed or is incomplete.","hostScopeMismatch":"This open conversation already belongs to another host scope. Dispose its handle before reopening it on the original host.","cleanupNeedsOriginalConversation":"Native cleanup requires its original bound conversation.","deliveryUnconfirmed":"Native delivery could not be confirmed.","messageNotSent":"This message was not sent. Review it before sending a new message.","attachmentIdsInvalid":"Attachments require at most {max} distinct, nonempty attachment IDs.","attachmentResolverIncomplete":"The attachment resolver must return a receipt for every requested file and bounded model content.","attachmentLocalFilesUnsupported":"This engine cannot accept local attachment files. Supply extracted text or supported image bytes.","attachmentReceiptInvalid":"Attachment receipts require the requested ID, a bounded fileName and a nonnegative size.","attachmentLocalFileInvalid":"Local attachment files require their exact requested receipt and an authorized absolute native path.","attachmentFormatUnsupported":"This engine cannot accept that attachment format. Supply extracted text or a supported image.","attachmentTextEmpty":"Attachment text must be nonempty.","attachmentBytesRequired":"Attachments require authorized bytes and a supported media type; remote URLs and paths are not accepted.","attachmentBytesExceeded":"Attachment content exceeds the configured byte limit for this request.","replacementRetryMismatch":"Replacement retry does not match the saved operation.","previousReplacementUnfinished":"Finish the previous native conversation replacement first.","previousReleaseUndoUnfinished":"An unfinished conversation Undo from a previous release blocks assistant work. Complete it using the previous release before upgrading.","pendingDeliveryBeforeContextReplace":"Finish pending delivery before replacing native context.","shutdownUnconfirmed":"Native conversation shutdown was not confirmed.","submissionInterrupted":"The previous submission was interrupted. Check delivery before submitting it again.","restartInterrupted":"The application restarted before this answer completed. The request was not replayed.","copiedInterrupted":"Copied into a stopped development environment. This request was not replayed.","operationResultUnsaved":"The application operation result could not be saved. Restore storage access and retry saving.","progressUnsaved":"Conversation progress could not be saved. Restore access to its storage before continuing.","requestTimedOut":"The conversation request exceeded its time limit.","workStopped":"Work stopped.","stoppedByUser":"Stopped by user.","apiHistoryLimit":"This conversation exceeds the configured API history limit. Start another conversation or increase the limit.","outputTokenLimit":"The model reached its output token limit before completing the answer. Increase maxOutputTokens in the conversation limits.","toolCallsUnconfirmed":"The model stream ended without confirming its application tool calls.","answerUnconfirmed":"The model stream ended without confirming a completed answer.","toolProgressLimit":"Application tool progress text exceeds the configured API limit.","finalReplyLimit":"The assistant exceeded the configured final reply limit.","historyBudgetExceeded":"Conversation updates exceed the configured history budget. Renew the context with a continuity briefing before continuing.","briefingBudgetExceeded":"The continuity briefing exceeds the configured history budget.","contextChangedInstallingPrompt":"Conversation context changed while installing its system prompt. Retry before sending.","contextChangedReadingInstructions":"Conversation context changed while reading instructions. Retry before sending.","messageNotAcknowledged":"The engine did not acknowledge the message.","stopTemporaryBeforeChange":"Stop this temporary conversation before changing its AI.","toolArgumentsTooLarge":"The application tool arguments exceed their size limit.","toolCallLimit":"The assistant reached the application tool-call limit for this turn."},"claude":{"goalChanged":"The Claude goal changed. Refresh before trying again.","goalTokenBudgetUnsupported":"Claude goals do not support a token budget.","goalBlockerReasonRequired":"An active Claude goal needs a blocker reason of up to 1,000 characters.","goalConditionRequired":"Enter a goal condition of up to 4,000 characters.","goalAlreadySet":"Cancel the existing goal before setting another.","goalActionUnknown":"Unknown Claude goal action.","compactWhileWorking":"Claude is still working. Wait for it to finish before freeing its context.","noActiveTurn":"Claude has no active turn for this message.","steeringUnavailable":"This Claude turn cannot accept steering now.","settingsChangeWhileWorking":"Stop the current Claude turn before changing its settings.","notConnected":"Claude Code is not connected.","accountStatusInvalid":"Claude Code returned an invalid account status.","accountChangedRefreshModels":"The signed-in Claude account changed. Refresh the model list.","accountQueryCancelled":"Claude account query was cancelled for reconnection.","accountQueryCleanupUnconfirmed":"Claude account query process cleanup could not be confirmed.","answerInterrupted":"Claude interrupted this answer.","chooseConnectedModel":"Choose a connected Claude Code model.","closedOrWorking":"This Claude conversation is closed or already working.","connectionClosed":"Claude connection is closed.","connectionWasClosed":"Claude connection was closed.","controlNeedsTerminal":"This control request requires the native Claude Code terminal.","eventConnectionEnded":"Claude event connection ended unexpectedly.","exitedUnexpectedly":"Claude exited unexpectedly.","modelUnsupported":"This exact provider/model is not supported by the Claude integration. Choose a supported model without renaming it.","noTurnToSteer":"Claude has no active turn to steer.","otherHostConfiguration":"This Claude conversation belongs to another working directory or credential home. Restore its original host configuration.","reasoningEffortUnsupported":"The selected Claude model does not support this reasoning effort.","reconnecting":"Claude is reconnecting.","sendNowUnsupported":"This Claude version does not support targeted Send now.","signInRequired":"Sign in with claude auth login before using this conversation.","stopBeforeReset":"Stop Claude before resetting its turn view.","toolCallLimit":"Claude exceeded the application tool-call limit.","turnStillWorking":"This Claude turn is still working.","workEnded":"Claude work ended.","outputTooLarge":"Claude output exceeded its size limit."},"codex":{"helperThreadUnavailable":"This low-cost assistant thread is no longer available. Start the background task again instead of reusing another assistant conversation.","helperOwnershipBlocked":"{applicationName} could not prove ownership of a persisted low-cost assistant thread.","threadDeleteUnavailable":"Codex app-server thread deletion is not available.","goalActionInvalid":"Choose set, pause, resume, or cancel.","goalObjectiveInvalid":"Enter a goal objective and an optional positive whole-number token budget.","goalConversationChanged":"The Codex conversation changed. Refresh the goal before trying again.","goalConversationStopped":"Resume or send a message to restore the stopped conversation before setting a goal.","goalChangedBeforeSet":"The Codex goal changed. Refresh it before setting a new goal.","goalChanged":"The Codex goal changed. Refresh it before trying again.","goalAlreadyStopped":"This goal is already stopped. Refresh its details.","goalStopUnconfirmed":"Codex has not yet confirmed a stop. Retry after the service has stopped.","goalNotResumable":"This goal cannot be resumed from its current status. Refresh its details.","stopUnverified":"Codex's stop could not be verified. Its runtime owner is unavailable.","turnNotReady":"The active assistant turn is not ready to accept this message yet.","messageEmpty":"Codex message is empty.","messageInputEmpty":"Codex message input is empty.","operationNotSteerable":"The active assistant operation cannot accept messages yet.","temporaryConversationBusy":"Temporary AI is already working on this conversation.","accountChangedSendAgain":"Codex (OpenAI) changed account. Send your message again.","accountUnavailable":"The selected Codex account is unavailable. Reconnect Codex and retry.","assistantChangedRefresh":"The assistant changed. Refresh before resuming.","authChangedReopen":"Codex authentication changed. Reopen the conversation with its original account.","authModeUnsupported":"The selected Codex authentication mode is unsupported. Reconnect Codex and retry.","authRecordInvalid":"The selected Codex authentication record is invalid. Reconnect Codex and retry.","authRecordTooLarge":"The selected Codex authentication record is too large. Reconnect Codex and retry.","authRecordUnreadable":"The selected Codex authentication record could not be read. Reconnect Codex and retry.","authorizedSettingsRequired":"Codex requires current authorized settings before resuming this conversation.","connectionClosedBeforeSettings":"The assistant connection closed before confirming its settings.","connectionUnverified":"The assistant connection could not be verified. Your conversation and files are preserved. Retry the connection, or renew the session to continue in a fresh conversation.","credentialsUnreadable":"Codex credential data could not be read. Restore its account configuration.","ephemeralInstructionsFixed":"Start a new ephemeral conversation to change its instructions.","goalPauseUnconfirmed":"Codex did not confirm that the same goal was paused.","goalsAreControls":"Codex goals are controls. Inspect any unresolved goal-message record before continuing.","helperAccessTokenStale":"The selected Codex account has not produced a newer access token yet. Reconnect Codex and retry.","helperAccountActivationFailed":"Codex could not activate the selected account for isolated helper work. Reconnect Codex and retry.","helperAccountChanged":"The selected Codex account changed during helper work. Retry the task with the current account.","helperAccountChangedBeforeRun":"The selected Codex account changed before low-cost assistant work could run. Retry the task with the current account.","helperAccountChangedStarting":"The selected Codex account changed while helper execution was starting. Retry the task.","helperAccountIdentityInvalid":"The requested low-cost assistant account identity is invalid. Refresh the task and retry.","helperAuthRefreshRejected":"Codex helper authentication refresh was rejected. Reconnect Codex and retry.","helperAuthUnavailable":"Codex helper authentication is unavailable. Reconnect Codex and retry.","helperExecutionFailed":"Codex isolated helper execution failed. Retry the task.","helperThreadReconnectAccount":"Reconnect the original Codex account to resume or delete this helper thread.","historyFormatStartFresh":"This conversation uses an unsupported Codex history format. Start a fresh conversation.","historyFormatUnsupported":"This conversation uses an unsupported Codex history format. Renew the session to keep your files and saved chat and start a fresh conversation. You can write the handover yourself.","loadedThreadsInvalid":"Codex returned an invalid loaded-thread inventory. Restore its connection before retrying.","modelDiscoveryUnavailable":"Codex live model discovery is unavailable.","modelUnsupported":"This exact provider/model is not supported by the Codex integration. Choose a supported model without renaming it.","nativeGoalChanged":"The native goal changed. Read it again before changing it.","observationLostStopUnverified":"Codex observation was lost and a stop is not yet verified. Retry after the service has stopped.","oldThreadUnreadable":"The old assistant thread cannot be read. Write or edit the handover manually instead.","otherAccount":"This conversation belongs to another Codex account. Restore that account or start a new conversation.","otherHostConfiguration":"This Codex conversation belongs to another working directory or credential home. Restore its original host configuration.","otherProviderAccount":"This conversation belongs to another Codex provider account. Restore that connection or start a new conversation.","outputTooLarge":"Codex output exceeded the configured limit.","paginatedConversationHistoryMissing":"Codex did not create the required paginated conversation history. Update Codex before starting a conversation.","paginatedHistoryMissing":"Codex did not create the required paginated history. Update Codex before starting this conversation.","reasoningEffortUnsupported":"The selected Codex model does not support this reasoning effort.","reconnectOpenAi":"Reconnect the OpenAI account before using this model.","responseTimeout":"Timed out waiting for Codex app-server response.","signInRequired":"Sign in with codex login before using this conversation.","stillReconnecting":"Codex is still reconnecting: its shared runtime is busy starting or stopping. Please try again shortly.","stoppedUseResume":"Codex is stopped. Use Resume or Send to continue.","temporaryConnectionLost":"Connection to Codex was lost while the temporary AI was working.","temporaryConversationClosed":"Temporary AI conversation was closed.","temporaryTurnStopped":"Temporary AI turn was stopped.","threadInventoryUntrusted":"Codex returned an untrustworthy thread/provider inventory. Restore its connection before changing credentials.","toolEntryPointsChanged":"This Codex conversation was created with different application tool entry points. Start a new conversation to enable or remove application tools.","turnStopUnconfirmed":"Codex did not confirm that its turn stopped."},"provider":{"notConfigured":"Assistant provider is not configured.","requestFailed":"Assistant provider request failed.","requestRejected":"Request failed."},"stream":{"failed":"Assistant stream failed.","requestFailed":"Request failed."},"opencode":{"cleanupUnconfirmed":"OpenCode process cleanup could not be confirmed. Restore its execution host before continuing.","closedOrWorking":"This OpenCode conversation is closed or already working.","messageNotAcknowledged":"OpenCode did not acknowledge the message.","modelDefinitionUnavailable":"OpenCode could not load the configured model definition. Check the selected integration before sending.","nativeStillWorking":"The native OpenCode conversation is still working. Stop or inspect it before sending another message.","noTurnToSteer":"OpenCode has no active turn to steer.","otherAccount":"This conversation belongs to another OpenCode account. Restore that connection or start a new conversation.","otherHistoryStore":"This OpenCode conversation belongs to another native history store. Restore its original host configuration.","otherHistoryStoreOrRuntime":"This OpenCode conversation belongs to another native history store or runtime. Restore its original host configuration.","otherWorkingDirectory":"This OpenCode conversation belongs to another working directory or native state directory. Restore its original host configuration.","reasoningEffortUnsupported":"The selected OpenCode model does not support this reasoning effort.","reopenTerminalToAttach":"Reopen the OpenCode terminal before attaching files.","savedConversationUnavailable":"The saved OpenCode conversation is unavailable. Restore its native history before continuing.","turnFailed":"OpenCode turn failed.","turnUnreadable":"The exact OpenCode turn did not produce a readable result.","turnNotFinished":"OpenCode did not finish the turn."}},"errors":{"conversation_forbidden":"This conversation is not available to this identity.","conversation_storage_version":"This conversation needs its offline runtime-state upgrade before it can be opened. Its saved requests were not replayed or changed.","conversation_configuration_mismatch":"Use configure() to change a saved conversation's settings.","conversation_goal_stopped":"The goal command was stopped before delivery.","conversation_attachment_manifest_changed":"Authorized attachment paths changed after this instruction was prepared. Restore the original files or send a new message.","conversation_receipt_unavailable":"The native receipt has no stored authored message.","conversation_goal_unavailable":"The native goal is unavailable. Try reading its status again.","assistant_provider_invalid_response":"Assistant provider returned an invalid response payload.","assistant_opencode_conversation_busy":"This conversation is still working.","assistant_opencode_key_verification_failed":"OpenCode rejected the API-key verification request.","assistant_opencode_turn_thread_mismatch":"The OpenCode predecessor history changed before handover generation.","assistant_opencode_turn_fresh_thread_required":"The renewed OpenCode conversation does not own the expected fresh native history.","assistant_opencode_turn_unrelated_history":"The successor OpenCode history contains unrelated conversation and cannot be used for renewal.","conversation_claude_turn_timeout":"Claude did not finish within the time limit.","conversation_claude_renewal_history_mismatch":"The Claude renewal conversation does not match the expected native history.","conversation_claude_renewal_unrelated_history":"The successor Claude conversation already contains unrelated messages.","conversation_claude_renewal_turn_active":"Stop the current turn before renewing this conversation.","conversation_claude_unavailable":"This Claude conversation is unavailable.","conversation_claude_retained_goal_invalid":"The retained Claude goal is invalid. Restore its saved conversation state.","conversation_claude_retained_goal_conflict":"The saved Claude goal cannot be both paused and blocked.","conversation_claude_session_closing":"This session is closing.","conversation_claude_preparation_stopped":"Claude preparation was stopped while this session was closing or changing.","conversation_claude_terminal_turn_active":"Stop the current turn before opening the Claude Code terminal.","conversation_claude_still_working":"This conversation is still working.","conversation_claude_history_retire_busy":"Stop the saved Claude process and its terminal before retiring native history.","conversation_claude_message_required":"Enter a message for Claude.","conversation_claude_command_stopped":"The goal command was stopped before delivery.","conversation_claude_context_usage_unavailable":"Claude's current context usage is unavailable.","conversation_claude_goal_clear_unconfirmed":"Claude has not saved the retained goal's native clear receipt.","conversation_claude_saved_state_unreadable":"The saved Claude conversation {conversationId} is unreadable. Restore its saved conversation state.","conversation_tool_not_executed":"Execution stopped before the action began.","conversation_tool_outcome_unknown":"The application operation did not return a verified result. Inspect its target before requesting another execution.","conversation_unsupported":"This original scoped conversation has no canonical message or goal receipt.","assistant_claude_goal_attachment_pending":"Claude accepted the goal command, but its goal attachment is not available yet. Check its original receipt before trying again.","assistant_claude_admission_unknown":"Claude has not acknowledged this prompt. Its delivery is uncertain.","assistant_claude_startup_exited":"Claude exited before initialization completed.","claude_stop_unconfirmed":"Claude process cleanup could not be confirmed. Restore its execution host before continuing.","claude_account_changed":"This conversation belongs to another Claude account. Reconnect that account or start a new session.","assistant_opencode_recovery_order_unconfirmed":"OpenCode could not confirm that the new input follows its final-answer recovery. The admitted message was not resent.","assistant_opencode_interrupt_unconfirmed":"OpenCode did not confirm Stop. Try Stop again.","assistant_opencode_interrupt_timeout":"OpenCode did not confirm Stop within 5 seconds. Try Stop again.","assistant_opencode_key_verification_unavailable":"OpenCode API-key verification could not run.","assistant_opencode_stop_unverified":"OpenCode process exit could not be verified.","assistant_opencode_connection_reload_failed":"OpenCode could not load the changed AI connection for this work. Send your message again.","assistant_opencode_response_too_large":"OpenCode returned more data than the bridge accepts.","assistant_opencode_event_too_large":"An OpenCode event exceeded the bridge limit.","assistant_opencode_directory_unavailable":"OpenCode did not confirm its conversation directory is ready.","assistant_opencode_catalog_invalid":"OpenCode returned an invalid provider catalogue.","assistant_opencode_catalog_stop_failed":"The temporary OpenCode catalogue process did not stop cleanly.","assistant_opencode_events_timeout":"OpenCode's event connection did not become ready.","assistant_opencode_observation_lost":"OpenCode's event connection ended before observation was closed.","assistant_opencode_parent_unverified":"The subagent's parent session could not be verified.","assistant_opencode_start_timeout":"OpenCode did not become ready before the startup deadline.","assistant_opencode_version_mismatch":"OpenCode {installed} is installed; this host requires {required}.","assistant_opencode_zen_catalog_unavailable":"OpenCode Zen's current model list could not be read. Try again.","assistant_agent_control_binding_retained":"Another native subscriber retained the previous assistant settings. Close the native assistant terminal and retry Resume.","assistant_codex_provider_binding_retained":"Another native subscriber retained the previous model provider. Close the native assistant terminal and retry.","assistant_codex_provider_switch_busy":"Stop the current turn before immediately changing model providers.","assistant_codex_history_request_too_large":"Codex history exceeds the adapter request limit.","assistant_codex_history_request_unreadable":"Codex sent an unreadable or oversized history request.","assistant_custom_endpoint_unreachable":"Your model server at {upstream} isn't answering. Start it, then send your message again.","assistant_codex_app_server_message_too_large":"Codex app-server message exceeded the configured transport limit.","codex_reconnect_required":"Sign in with codex login before continuing.","codex_provider_connection_changed":"This Codex provider connection changed. Work is stopped; use Send or Resume after reconnecting.","codex_runtime_invalidated":"Codex's native runtime was invalidated.","assistant_provider_fetch_missing":"Global fetch is not available for anthropic provider.","assistant_tool_arguments_invalid":"Tool arguments must be a JSON object.","assistant_tool_result_unserializable":"Tool result could not be serialized.","assistant_tool_result_too_large":"Tool result exceeds the assistant size limit. Narrow the request and try again.","assistant_tool_contract_too_large":"Action contract exceeds the assistant size limit. Narrow the request and try again.","assistant_tool_arguments_too_large":"Tool arguments exceed the assistant size limit. Narrow the request and try again.","assistant_action_cursor_invalid":"Action search cursor is invalid for this query.","assistant_action_unknown":"Action is not available.","assistant_action_contract_required":"Load this action's exact contract before executing it.","assistant_tool_output_invalid":"Assistant tool output validation failed.","assistant_tool_unknown":"Unknown tool.","assistant_claude_control_timeout":"Claude {request} timed out."}}`);var en_default={jskit};registerJskitMessages(en_default);function attachmentSizeLabel(size){const bytes=Number(size);if(!Number.isFinite(bytes)||bytes<0)return``;if(bytes<1024)return`${bytes} B`;if(bytes<1048576)return`${(bytes/1024).toFixed(1)} KB`;return`${(bytes/1048576).toFixed(1)} MB`}var jskitText=useJskitText();var{formatNumber,t:t$3}=jskitText;var WHOLE=Object.freeze({useGrouping:false});var ONE_DECIMAL=Object.freeze({maximumFractionDigits:1,minimumFractionDigits:1,useGrouping:false});function attachmentSizeText(size){if(!jskitText.locale)return attachmentSizeLabel(size);const bytes=Number(size);if(!Number.isFinite(bytes)||bytes<0)return``;if(bytes<1024)return t$3(`jskit.assistant.attachments.sizeBytes`,{size:formatNumber(bytes,WHOLE)});if(bytes<1048576)return t$3(`jskit.assistant.attachments.sizeKilobytes`,{size:formatNumber(bytes/1024,ONE_DECIMAL)});return t$3(`jskit.assistant.attachments.sizeMegabytes`,{size:formatNumber(bytes/1048576,ONE_DECIMAL)})}function attachmentLimitText(maxBytes){if(!jskitText.locale)return maxBytes%1048576===0?`${maxBytes/1048576} MiB`:`${maxBytes/1e6} MB`;return maxBytes%1048576===0?t$3(`jskit.assistant.attachments.sizeMebibytes`,{size:formatNumber(maxBytes/1048576,WHOLE)}):t$3(`jskit.assistant.attachments.sizeMegabytes`,{size:formatNumber(maxBytes/1e6,{useGrouping:false})})}var{t:t$2}=useJskitText();function assistantAttachmentFiles(fileList){return Array.from(fileList||[]).filter(file=>file&&file.size>=0)}function assistantAttachmentFilesFromTransferItems(items){return assistantAttachmentFiles(Array.from(items||[]).map(item=>{if(item?.kind!==`file`||typeof item.getAsFile!==`function`)return null;return item.getAsFile()}))}function assistantAttachmentFilesFromDropEvent(event){const dataTransfer=event?.dataTransfer;const itemFiles=assistantAttachmentFilesFromTransferItems(dataTransfer?.items);if(itemFiles.length>0)return itemFiles;return assistantAttachmentFiles(dataTransfer?.files)}function assistantAttachmentFilesFromPasteEvent(event){const clipboardData=event?.clipboardData;const itemFiles=assistantAttachmentFilesFromTransferItems(clipboardData?.items);if(itemFiles.length>0)return itemFiles;return assistantAttachmentFiles(clipboardData?.files)}function assistantAttachmentEventHasFiles(event){const dataTransfer=event?.dataTransfer;return assistantAttachmentFilesFromDropEvent(event).length>0||Array.from(dataTransfer?.items||[]).some(item=>item?.kind===`file`)||Array.from(dataTransfer?.types||[]).some(type=>type===`Files`||type===`application/x-moz-file`)}function assistantAttachmentClipboardText(event){if(typeof event?.clipboardData?.getData!==`function`)return``;return String(event.clipboardData.getData(`text/plain`)||``)}function assistantAttachmentClipboardLocalFileReference(event){const clipboardData=event?.clipboardData;if(!clipboardData||typeof clipboardData.getData!==`function`)return``;const types=Array.from(clipboardData.types||[]);const text=[clipboardData.getData(`x-special/gnome-copied-files`),clipboardData.getData(`text/uri-list`),clipboardData.getData(`text/plain`)].map(value=>String(value||``).trim()).filter(Boolean).join(`
|
|
2
|
+
`);if(types.includes(`Files`)||types.includes(`application/x-moz-file`)||types.includes(`x-special/gnome-copied-files`)||/^file:/imu.test(text))return text||`file://`;return``}function useAttachmentDropTarget({uploadFiles,reportAttachmentError}){const dragDepth=ref(0);const dragActive=computed(()=>dragDepth.value>0);function resetDragState(){dragDepth.value=0}function handleDragEnter(event){if(!assistantAttachmentEventHasFiles(event))return;dragDepth.value+=1;if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragOver(event){if(event?.dataTransfer)event.dataTransfer.dropEffect=`copy`}function handleDragLeave(){dragDepth.value=Math.max(0,dragDepth.value-1)}async function handleDrop(event){resetDragState();return uploadFiles(assistantAttachmentFilesFromDropEvent(event))}async function handlePaste(event){const files=assistantAttachmentFilesFromPasteEvent(event);if(files.length<1){if(assistantAttachmentClipboardLocalFileReference(event))reportAttachmentError(t$2(`jskit.assistant.attachments.error.localFilePaste`));return[]}if(!assistantAttachmentClipboardText(event))event?.preventDefault?.();return uploadFiles(files)}return{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}}var{t:t$1}=useJskitText();function attachmentUploadError(attachment){return attachment?.error||attachment?.errors?.[0]?.message||``}function attachmentIdentity(attachment){return String(attachment?.clientId||attachment?.attachmentId||attachment?.path||attachment?.fileName||``)}var attachmentClientSequence=0;function nextAttachmentClientId(){attachmentClientSequence+=1;return`attachment-${Date.now().toString(36)}-${attachmentClientSequence.toString(36)}`}function attachmentFileName(file){return String(file?.name||`attachment`)}function attachmentUploadResult(upload=null){if(upload&&typeof upload.then===`function`)return{cancel:typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload};if(upload?.promise&&typeof upload.promise.then===`function`)return{cancel:typeof upload.abort===`function`?()=>upload.abort():typeof upload.cancel===`function`?()=>upload.cancel():null,promise:upload.promise};return{cancel:null,promise:Promise.resolve(upload)}}function attachmentProgress(progress={},possibleTotal,fallbackTotal=0){const directNumericProgress=typeof progress===`number`?progress:null;const progressObject=progress&&typeof progress===`object`?progress:{};const totalBytes=Math.max(0,Number(progressObject.totalBytes??progressObject.total??possibleTotal??fallbackTotal)||0);const bytesValue=progressObject.bytesSent??progressObject.loaded??progressObject.uploadedBytes??directNumericProgress;const bytesKnown=bytesValue!==null&&bytesValue!==void 0&&bytesValue!==``;let bytesSent=bytesKnown?Number(bytesValue)||0:0;const directPercent=progressObject.percent;let percent=directPercent!==null&&directPercent!==void 0&&directPercent!==``?Number(directPercent):null;const progressValue=progressObject.progress;if(!Number.isFinite(percent)&&progressValue!==null&&progressValue!==void 0&&progressValue!==``){const numericProgressValue=Number(progressValue);if(Number.isFinite(numericProgressValue))percent=numericProgressValue<=1?numericProgressValue*100:numericProgressValue}if(!Number.isFinite(percent))percent=bytesKnown&&totalBytes>0?bytesSent/totalBytes*100:null;if(percent!==null)percent=Math.max(0,Math.min(100,percent));if(totalBytes>0){const inferredBytes=percent===null?0:totalBytes*percent/100;bytesSent=Math.max(0,Math.min(totalBytes,bytesSent||inferredBytes))}else bytesSent=Math.max(0,bytesSent);return{bytesSent,percent,totalBytes}}function attachmentReceipt(row,uploaded){return{...uploaded,attachmentId:String(uploaded?.attachmentId||``),clientId:row.clientId,fileName:String(uploaded?.fileName||row.fileName),sessionId:row.sessionId,size:Number(uploaded?.size??row.size)||0}}function createWaiter(row){let resolve=null;row.waiter={promise:new Promise(currentResolve=>{resolve=currentResolve}),resolve,settled:false};return row.waiter}function settleWaiter(row,value=null,waiter=row.waiter){if(!waiter||waiter.settled)return;waiter.settled=true;waiter.resolve(value)}function updateRowProgress(row,progress,total){if(!row.retained||row.phase!==`uploading`)return;const next=attachmentProgress(progress,total,row.totalBytes);row.bytesSent=Math.max(row.bytesSent,next.bytesSent);row.totalBytes=next.totalBytes||row.totalBytes;if(next.percent!==null)row.progress=Math.max(Number(row.progress)||0,next.percent)}function buildQueueRow({currentSessionId,file=null,fileName=`attachment`,phase=`queued`,producer=null,size=0}={}){const normalizedSize=Number(file?.size??size)||0;return reactive({activeHandoffToken:null,activeToken:null,attachmentId:``,bytesSent:0,clientId:nextAttachmentClientId(),error:``,failureStage:``,file,fileName:file?attachmentFileName(file):String(fileName||`attachment`),path:``,phase,producer,producerAbortController:null,producerToken:null,progress:null,receipt:null,retained:true,sessionId:currentSessionId,size:normalizedSize,totalBytes:normalizedSize,waiter:null})}function createReceiptCleanup({deleteAttachment,deletesUnsentUploads,reportAttachmentError}){const cleanupTasks=new Set;const receiptCleanupById=new Map;const cleanedReceiptIds=new Set;function trackCleanup(task){const cleanup=Promise.resolve(task).catch(error=>{reportAttachmentError(error,t$1(`jskit.assistant.attachments.error.cleanupFailed`));return false});cleanupTasks.add(cleanup);cleanup.finally(()=>cleanupTasks.delete(cleanup));return cleanup}async function deleteUploadedAttachment(currentSessionId,attachment){const attachmentId=String(attachment?.attachmentId||``).trim();if(!attachmentId||!deletesUnsentUploads)return false;const response=await deleteAttachment(currentSessionId,attachmentId);if(response?.ok===false)throw new Error(attachmentUploadError(response)||t$1(`jskit.assistant.attachments.error.cleanupFailed`));return true}function cleanupReceipt(currentSessionId,receipt){const attachmentId=String(receipt?.attachmentId||``).trim();const cleanupId=`${currentSessionId}:${attachmentId}`;if(!attachmentId)return Promise.resolve(false);if(cleanedReceiptIds.has(cleanupId))return Promise.resolve(false);if(receiptCleanupById.has(cleanupId))return receiptCleanupById.get(cleanupId);const cleanup=trackCleanup(deleteUploadedAttachment(currentSessionId,receipt)).then(deleted=>{if(deleted)cleanedReceiptIds.add(cleanupId);return deleted});receiptCleanupById.set(cleanupId,cleanup);cleanup.finally(()=>receiptCleanupById.delete(cleanupId));return cleanup}async function waitForAttachmentCleanup(){while(cleanupTasks.size>0)await Promise.allSettled([...cleanupTasks])}return Object.freeze({cleanupReceipt,waitForAttachmentCleanup})}var{serverMessage,t}=useJskitText();function attachmentErrorText(error,fallback){return String(error&&typeof error===`object`&&serverMessage(error)||error?.message||error||fallback)}function assistantAttachmentSessionId(sessionId){return String(toValue(sessionId)||``).trim()}function assistantAttachmentUploadAllowed(canUpload){return toValue(canUpload)!==false}var ASSISTANT_ATTACHMENT_MAX_BYTES=1e8;var ASSISTANT_ATTACHMENT_UPLOAD_CONCURRENCY=2;var ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES=new Set([`preparing`,`queued`,`uploading`,`delivering`,`failed`]);function keepAttachmentErrorInStatus(){}async function keepUploadedAttachmentsReady(){return null}function useAssistantAttachments({canUpload=()=>true,deleteAttachment,onError=keepAttachmentErrorInStatus,onUploaded=keepUploadedAttachmentsReady,sessionId,uploadAttachment,maxBytes=ASSISTANT_ATTACHMENT_MAX_BYTES,maxItems=10,uploadConcurrency=2}){if(![maxBytes,maxItems,uploadConcurrency].every(value=>Number.isSafeInteger(value)&&value>0))throw new TypeError(`Attachment limits must be positive integers.`);const attachments=ref([]);const queueItems=ref([]);const status=ref(``);const activeUploadCount=ref(0);const uploadQueue=[];const rowsById=new Map;const activeAttempts=new Map;let disposed=false;const uploading=computed(()=>activeUploadCount.value>0||queueItems.value.some(item=>[`preparing`,`uploading`,`delivering`].includes(item.phase)));const hasUnresolved=computed(()=>queueItems.value.some(item=>ASSISTANT_ATTACHMENT_UNRESOLVED_PHASES.has(item.phase)));const canSubmit=computed(()=>!hasUnresolved.value);const retainedItemCount=computed(()=>queueItems.value.filter(item=>item.phase!==`cancelled`).length);const atCapacity=computed(()=>retainedItemCount.value>=maxItems);const canAddFiles=computed(()=>Boolean(!disposed&&assistantAttachmentSessionId(sessionId)&&assistantAttachmentUploadAllowed(canUpload)&&!atCapacity.value));const aggregateProgress=computed(()=>{const retainedItems=queueItems.value.filter(item=>item.phase!==`cancelled`);const totalBytes=retainedItems.reduce((sum,item)=>sum+item.totalBytes,0);const bytesSent=retainedItems.reduce((sum,item)=>sum+item.bytesSent,0);return{bytesSent,percent:totalBytes>0?Math.round(bytesSent/totalBytes*100):0,totalBytes}});const tooLarge=row=>t(`jskit.assistant.attachments.error.tooLarge`,{fileName:row.fileName,limit:attachmentLimitText(maxBytes)});const tooMany=()=>t(`jskit.assistant.attachments.error.tooMany`,{count:maxItems});function reportAttachmentError(error,fallbackMessage=t(`jskit.assistant.attachments.error.uploadFailed`),{notify=true}={}){const message=attachmentErrorText(error,fallbackMessage);status.value=message;if(notify)try{onError(error||new Error(message),fallbackMessage)}catch{}return message}function clearStatus(){status.value=``}function failRow(row,failureStage,error,fallbackMessage){row.error=attachmentErrorText(error,fallbackMessage);row.failureStage=failureStage;row.phase=`failed`;reportAttachmentError(error,fallbackMessage,{notify:false})}function canonicalRow(attachment={}){const identity=attachmentIdentity(attachment);return identity?rowsById.get(identity)||queueItems.value.find(row=>attachmentIdentity(row)===identity||row.attachmentId===identity):null}const{cleanupReceipt,waitForAttachmentCleanup}=createReceiptCleanup({deleteAttachment,deletesUnsentUploads:typeof deleteAttachment===`function`,reportAttachmentError});const{dragActive,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,resetDragState}=useAttachmentDropTarget({uploadFiles,reportAttachmentError});function removeReadyReceipt(row){const removed=attachments.value.filter(attachment=>attachment.clientId===row.clientId);attachments.value=attachments.value.filter(attachment=>attachment.clientId!==row.clientId);return removed}async function handOffUploadedAttachment(row,receipt,waiter=row.waiter){const token=Symbol(`${row.clientId}-handoff`);row.activeHandoffToken=token;row.phase=`delivering`;if(!attachments.value.some(attachment=>attachment.clientId===row.clientId))attachments.value.push(receipt);try{const accepted=(await onUploaded([receipt]))?.accepted===true;if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){removeReadyReceipt(row);if(!accepted)await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;row.error=``;row.failureStage=``;if(accepted){removeReadyReceipt(row);row.retained=false;rowsById.delete(row.clientId);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);settleWaiter(row,receipt,waiter);return receipt}row.phase=`ready`;settleWaiter(row,receipt,waiter);return receipt}catch(error){if(row.activeHandoffToken!==token||!row.retained||row.phase===`cancelled`){await cleanupReceipt(row.sessionId,receipt);settleWaiter(row,null,waiter);return null}row.activeHandoffToken=null;removeReadyReceipt(row);failRow(row,`handoff`,error,t(`jskit.assistant.attachments.error.unusable`));settleWaiter(row,null,waiter);return null}}async function finishUploadAttempt(attempt,uploaded,uploadError=null){activeAttempts.delete(attempt.token);activeUploadCount.value=activeAttempts.size;pumpQueue();const{row}=attempt;const isCurrentAttempt=row.activeToken===attempt.token;const uploadSucceeded=Boolean(!uploadError&&uploaded&&uploaded.ok!==false&&String(uploaded.attachmentId||``).trim());if(!isCurrentAttempt||!row.retained||disposed){if(uploadSucceeded)await cleanupReceipt(attempt.sessionId,uploaded);settleWaiter(row,null,attempt.waiter);pumpQueue();return}row.activeToken=null;if(uploadSucceeded){const receipt=attachmentReceipt(row,uploaded);row.receipt=receipt;row.attachmentId=receipt.attachmentId;row.path=String(receipt.path||``);row.bytesSent=row.totalBytes;row.progress=100;row.error=``;row.failureStage=``;await handOffUploadedAttachment(row,receipt,attempt.waiter)}else{failRow(row,`upload`,uploadError||new Error(attachmentUploadError(uploaded)||t(`jskit.assistant.attachments.error.uploadFailed`)),t(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,attempt.waiter)}pumpQueue()}function startUpload(row){const token=Symbol(row.clientId);const abortController=new AbortController;const attempt={abortController,cancel:null,row,sessionId:row.sessionId,settled:null,token,waiter:row.waiter};row.activeToken=token;row.phase=`uploading`;row.error=``;activeAttempts.set(token,attempt);activeUploadCount.value=activeAttempts.size;try{const transport=attachmentUploadResult(uploadAttachment(row.sessionId,row.file,{onProgress:(progress,total)=>updateRowProgress(row,progress,total),signal:abortController.signal}));attempt.cancel=transport.cancel;attempt.settled=transport.promise.then(uploaded=>finishUploadAttempt(attempt,uploaded),error=>finishUploadAttempt(attempt,null,error))}catch(error){attempt.settled=finishUploadAttempt(attempt,null,error)}}function pumpQueue(){if(disposed)return;while(activeAttempts.size<uploadConcurrency&&uploadQueue.length>0){const row=uploadQueue.shift();if(!row?.retained||row.phase!==`queued`)continue;startUpload(row)}}function cancelAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`preparing`,`queued`,`uploading`].includes(row.phase))return false;const token=row.activeToken;row.activeToken=null;row.activeHandoffToken=null;row.phase=`cancelled`;row.error=``;const receipt=row.receipt;removeReadyReceipt(row);if(receipt)cleanupReceipt(row.sessionId,receipt);row.receipt=null;row.failureStage=``;settleWaiter(row,null);const attempt=token?activeAttempts.get(token):null;try{row.producerAbortController?.abort();attempt?.abortController.abort();attempt?.cancel?.()}catch{}row.producerAbortController=null;row.producerToken=null;pumpQueue();return true}function retryAttachment(attachment={}){const row=canonicalRow(attachment);if(!row||!row.retained||![`failed`,`cancelled`].includes(row.phase)||row.sessionId!==assistantAttachmentSessionId(sessionId)||!assistantAttachmentUploadAllowed(canUpload))return Promise.resolve(null);if(row.phase===`cancelled`&&retainedItemCount.value>=maxItems){reportAttachmentError(tooMany());return Promise.resolve(null)}if(row.failureStage===`handoff`&&row.receipt){row.error=``;row.phase=`uploading`;const waiter=createWaiter(row);handOffUploadedAttachment(row,row.receipt,waiter);return waiter.promise}if(row.producer&&!row.file){const waiter=createWaiter(row);startAttachmentProducer(row);return waiter.promise}if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t(`jskit.assistant.attachments.error.uploadFailed`));return Promise.resolve(null)}row.bytesSent=0;row.progress=null;row.error=``;row.failureStage=``;row.phase=`queued`;const waiter=createWaiter(row);uploadQueue.push(row);pumpQueue();return waiter.promise}function detachRow(row){if([`preparing`,`queued`,`uploading`].includes(row.phase))cancelAttachment(row);row.retained=false;rowsById.delete(row.clientId);settleWaiter(row,null)}function removeAttachment(attachment={}){const row=canonicalRow(attachment);if(!row)return[];const removedReceipts=removeReadyReceipt(row);const removed=removedReceipts.length>0?removedReceipts:[row];const receiptToClean=removedReceipts[0]||row.receipt;detachRow(row);queueItems.value=queueItems.value.filter(candidate=>candidate.clientId!==row.clientId);if(receiptToClean)cleanupReceipt(row.sessionId,receiptToClean);return removed}function clearAttachments({accepted=true,attachmentIds=null}={}){if(!accepted)return abandonAttachments();const selectedIds=Array.isArray(attachmentIds)?new Set(attachmentIds):null;const cleared=attachments.value.filter(attachment=>!selectedIds||selectedIds.has(attachment.attachmentId));const readyIds=new Set(cleared.map(attachment=>attachment.clientId));const remaining=[];for(const row of[...queueItems.value]){if(selectedIds&&!readyIds.has(row.clientId)){remaining.push(row);continue}if(readyIds.has(row.clientId)){row.retained=false;rowsById.delete(row.clientId);continue}detachRow(row);if(row.receipt)cleanupReceipt(row.sessionId,row.receipt)}attachments.value=attachments.value.filter(attachment=>!readyIds.has(attachment.clientId));queueItems.value=remaining;return cleared}async function abandonAttachments({onlySessionId=``}={}){const normalizedSessionId=String(onlySessionId||``).trim();const rows=queueItems.value.filter(row=>!normalizedSessionId||row.sessionId===normalizedSessionId);const rowIds=new Set(rows.map(row=>row.clientId));const readyReceipts=rows.map(row=>row.receipt).filter(Boolean);const attempts=[...activeAttempts.values()].filter(attempt=>rowIds.has(attempt.row.clientId));for(const row of rows)detachRow(row);queueItems.value=queueItems.value.filter(row=>!rowIds.has(row.clientId));attachments.value=attachments.value.filter(attachment=>!rowIds.has(attachment.clientId));const readyCleanup=readyReceipts.map(attachment=>cleanupReceipt(attachment.sessionId,attachment));await Promise.allSettled([...readyCleanup,...attempts.map(attempt=>attempt.settled).filter(Boolean)]);await waitForAttachmentCleanup();return rows}async function disposeAttachments(){if(disposed){await waitForAttachmentCleanup();return[]}disposed=true;stopSessionWatch();return abandonAttachments()}function createQueueRow(options){const row=buildQueueRow(options);rowsById.set(row.clientId,row);queueItems.value.push(row);createWaiter(row);return row}function queuePreparedFile(row,file,waiter=row.waiter){const preparedFile=assistantAttachmentFiles([file])[0];if(!preparedFile)throw Object.assign(new Error(`The prepared attachment did not produce a file.`),{messageCode:`assistant.attachments.error.noFile`,messageParams:{}});row.file=preparedFile;row.fileName=attachmentFileName(preparedFile);row.size=Number(preparedFile.size)||0;row.totalBytes=row.size;if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null,waiter);return false}row.phase=`queued`;uploadQueue.push(row);pumpQueue();return true}function startAttachmentProducer(row){const token=Symbol(`${row.clientId}-producer`);const waiter=row.waiter;const abortController=new AbortController;row.file=null;row.producerAbortController=abortController;row.producerToken=token;row.phase=`preparing`;row.error=``;row.failureStage=``;row.producerSettled=Promise.resolve().then(()=>row.producer({signal:abortController.signal})).then(file=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;try{queuePreparedFile(row,file,waiter)}catch(error){failRow(row,`preparing`,error,t(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter)}return file},error=>{if(row.producerToken!==token||!row.retained||disposed){settleWaiter(row,null,waiter);return null}row.producerAbortController=null;row.producerToken=null;if(error?.name===`AbortError`){row.phase=`cancelled`;row.error=``}else failRow(row,`preparing`,error,t(`jskit.assistant.attachments.error.preparationFailed`));settleWaiter(row,null,waiter);return null})}function uploadFileProducer({fileName=t(`jskit.assistant.attachments.preparingName`),produce}={}){const currentSessionId=assistantAttachmentSessionId(sessionId);if(!canAddFiles.value||typeof produce!==`function`){if(atCapacity.value)reportAttachmentError(tooMany());return Promise.resolve(null)}status.value=``;const row=createQueueRow({currentSessionId,fileName,phase:`preparing`,producer:produce});const waiter=row.waiter;startAttachmentProducer(row);return waiter.promise}async function uploadFiles(files=[]){const uploadableFiles=assistantAttachmentFiles(files);const currentSessionId=assistantAttachmentSessionId(sessionId);if(uploadableFiles.length<1||!currentSessionId||disposed||!assistantAttachmentUploadAllowed(canUpload))return[];status.value=``;const availableSlots=Math.max(0,maxItems-retainedItemCount.value);const acceptedFiles=uploadableFiles.slice(0,availableSlots);if(acceptedFiles.length<uploadableFiles.length)reportAttachmentError(tooMany());const waiters=[];for(const file of acceptedFiles){const row=createQueueRow({currentSessionId,file});const waiter=row.waiter;waiters.push(waiter.promise);if(row.size>maxBytes){failRow(row,`validation`,tooLarge(row),t(`jskit.assistant.attachments.error.uploadFailed`));settleWaiter(row,null)}else uploadQueue.push(row)}pumpQueue();return(await Promise.all(waiters)).filter(attachment=>attachment&&attachments.value.some(candidate=>candidate.clientId===attachment.clientId))}const stopSessionWatch=watch(()=>assistantAttachmentSessionId(sessionId),(nextSessionId,previousSessionId)=>{if(nextSessionId!==previousSessionId&&previousSessionId)abandonAttachments({onlySessionId:previousSessionId})},{flush:`sync`});if(getCurrentScope())onScopeDispose(()=>{disposeAttachments()});return{maxBytes,maxItems,abandonAttachments,aggregateProgress,attachments,atCapacity,canAddFiles,cancelAttachment,canSubmit,clearAttachments,clearStatus,disposeAttachments,dragActive,hasUnresolved,handleDragEnter,handleDragLeave,handleDragOver,handleDrop,handlePaste,queueItems,removeAttachment,resetDragState,retryAttachment,status,uploading,uploadFiles,uploadFileProducer,waitForAttachmentCleanup}}export{en_default as a,attachmentSizeText as i,assistantAttachmentFilesFromDropEvent as n,assistantAttachmentFilesFromPasteEvent as r,useAssistantAttachments as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Et as unref,gt as reactive,ht as proxyRefs,it as watch,u as computed}from"./runtime-core.esm-bundler-Bi1P1jMa.js";import{r as useShellWebErrorRuntime}from"./error-BQ7r64JO.js";import{N as useQueryClient,a as ensureAccessModeCompatibility,c as normalizePermissions,d as resolveEnabled,f as resolvePermissionAccess,i as emptyRecord,l as resolveAccessModeEnabled,m as resolveEnabledRef,n as useOperationRealtime,o as normalizeAccessMode,p as resolveQueryKey,r as asPlainObject,s as normalizeOwnershipFilter,t as useEndpointResource,u as resolveApiSuffix}from"./useEndpointResource-CmMwteuX.js";import{o as normalizeLowerText,u as normalizeText}from"./normalize-BD25VwNK.js";import{n as validateSchemaPayload}from"./validators-HqYRjxEO.js";import{c as normalizePermissionList,n as getHttpWebClient,r as buildValidationFailure,s as hasPermission}from"./httpClient-Bwitq9Xf.js";import{n as resolveScopedRouteBase}from"./surface-CBlx7sF_.js";import{r as useJskitText}from"./i18n-BuXRXGaO.js";import{n as ROUTE_VISIBILITY_WORKSPACE}from"./visibility-Cq31Xy7I.js";import"./i18n-BkxO7BMl.js";import{r as toUiFieldErrors}from"./errorMessageHelpers-BjIt31kK.js";import{m as useWebPlacementContext,r as resolveSurfaceDefinitionFromPlacementContext}from"./placement-1lT0lW3-.js";import{n as useSurfaceRouteContext,t as usePaths}from"./usePaths-CvUbx5-V.js";import{t as useUiFeedback}from"./useUiFeedback-CWb6o71Z.js";var{t:t$3,text:text$1}=useJskitText();var SILENT_FIELD_BAG=Object.freeze({apply(){}});var SILENT_FEEDBACK=Object.freeze({error(){}});function validateOperationInput({input,rawPayload={},fieldBag=SILENT_FIELD_BAG,feedback=SILENT_FEEDBACK,validationMessage=``}){if(!input)return{ok:true,parsedInput:rawPayload};try{return{ok:true,parsedInput:validateSchemaPayload(input,rawPayload,{phase:`input`,context:`operation input`})}}catch(error){if(!error?.fieldErrors||typeof error.fieldErrors!==`object`)throw error;const fieldErrorCodes=error.fieldErrorCodes||error.details?.fieldErrorCodes;const failure={...buildValidationFailure({error:text$1(validationMessage)||t$3(`jskit.http.feedback.validationFailed`),code:`validation_failed`,fieldErrors:error?.fieldErrors}),...fieldErrorCodes?{fieldErrorCodes}:{}};fieldBag.apply(toUiFieldErrors(failure));feedback.error(failure,failure.error);return{ok:false,failure,parsedInput:null}}}var{t:t$2,text}=useJskitText();function useCommandCore({model,resource,writeMethod=`POST`,canRun,fieldBag,feedback,input,buildRawPayload=emptyRecord,buildCommandPayload,buildCommandOptions=emptyRecord,onRunSuccess,onRunError,suppressSuccessMessage=false,messages={}}){const queryClient=useQueryClient();const normalizedWriteMethod=String(writeMethod||`POST`).trim().toUpperCase();const running=resource.isSaving;const fieldErrors=fieldBag.errors;const message=feedback.message;const messageType=feedback.messageType;async function run(context={}){if(!canRun.value||running.value)return null;feedback.clear();fieldBag.clear();const rawPayload=buildRawPayload(model,{queryClient,resource,context});const validationResult=validateOperationInput({input,rawPayload,fieldBag,feedback,validationMessage:text(messages.validation)||t$2(`jskit.http.feedback.validationFailed`)});if(!validationResult.ok)return null;const{parsedInput}=validationResult;const payload=typeof buildCommandPayload===`function`?buildCommandPayload(parsedInput,{rawPayload,queryClient,resource,context}):normalizedWriteMethod===`DELETE`?void 0:parsedInput;const options=buildCommandOptions(parsedInput,{rawPayload,queryClient,resource,context});try{const response=await resource.save(payload,options);if(onRunSuccess)await onRunSuccess(response,{parsed:parsedInput,rawPayload,payload,options,queryClient,resource,context});if(!suppressSuccessMessage)feedback.success(text(messages.success)||t$2(`jskit.http.feedback.completed`));return response}catch(error){fieldBag.apply(toUiFieldErrors(error));if(onRunError)await onRunError(error,{parsed:parsedInput,rawPayload,payload,options,queryClient,resource,context});feedback.error(error,text(messages.error)||t$2(`jskit.http.feedback.actionFailed`));throw error}}return{running,fieldErrors,message,messageType,run}}var{t:t$1}=useJskitText();function asPermissionList(value){if(Array.isArray(value))return value;if(value===void 0||value===null||value===``)return[];return[value]}function useAccess({enabled=true,access=`always`,hasPermissionRequirements=false}={}){const normalizedAccessMode=normalizeAccessMode(access);const accessRequired=resolveAccessModeEnabled(normalizedAccessMode,{hasPermissionRequirements:hasPermissionRequirements===true});const{context:placementContext}=useWebPlacementContext();const queryEnabled=computed(()=>resolveEnabledRef(enabled)&&accessRequired);const hasPlacementPermissions=computed(()=>{const source=placementContext.value;if(!source||typeof source!==`object`)return false;return Object.hasOwn(source,`permissions`)});const placementPermissions=computed(()=>normalizePermissionList(placementContext.value?.permissions));const permissions=computed(()=>{if(!queryEnabled.value||!hasPlacementPermissions.value)return[];return placementPermissions.value});const permissionsUnavailableError=computed(()=>{if(!queryEnabled.value||hasPlacementPermissions.value)return``;return t$1(`jskit.http.access.permissionsUnavailable`)});const awaitingPlacementPermissions=computed(()=>queryEnabled.value&&!hasPlacementPermissions.value);function can(permission){return hasPermission(permissions.value,permission)}function canAny(requiredPermissions){const list=asPermissionList(requiredPermissions);if(list.length<1)return true;for(const entry of list)if(can(entry))return true;return false}function canAll(requiredPermissions){const list=asPermissionList(requiredPermissions);if(list.length<1)return true;for(const entry of list)if(!can(entry))return false;return true}return{accessMode:normalizedAccessMode,accessRequired,permissions,permissionsUnavailableError,awaitingPlacementPermissions,can,canAny,canAll}}function toRouteParamValue(value){if(Array.isArray(value))return toRouteParamValue(value[0]);if(value==null)return``;return String(value).trim()}function extractRouteParamNames(pathTemplate=``){const normalizedTemplate=String(pathTemplate||``).trim();if(!normalizedTemplate)return[];const names=[];const seen=new Set;const pattern=/:([A-Za-z][A-Za-z0-9_]*)/g;let match=null;while((match=pattern.exec(normalizedTemplate))!=null){const name=String(match[1]||``).trim();if(!name||seen.has(name))continue;seen.add(name);names.push(name)}return names}var{t}=useJskitText();function resolveScopedRouteParamNames(placementContext=null,surfaceId=``){const routeBase=resolveSurfaceDefinitionFromPlacementContext(placementContext,surfaceId)?.routeBase||`/`;return extractRouteParamNames(resolveScopedRouteBase(routeBase))}function useScopeRuntime({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,accessMode=`auto`,hasPermissionRequirements=false}={}){const normalizedOwnershipFilter=normalizeOwnershipFilter(ownershipFilter);const normalizedAccessMode=ensureAccessModeCompatibility({accessMode,hasPermissionRequirements,caller:`useScopeRuntime`});const accessRequired=resolveAccessModeEnabled(normalizedAccessMode,{hasPermissionRequirements});const routeContext=useSurfaceRouteContext();const paths=usePaths({routeContext});const resolvedSurfaceId=computed(()=>{const explicitSurfaceId=normalizeLowerText(surfaceId);if(explicitSurfaceId)return explicitSurfaceId;return normalizeLowerText(routeContext.currentSurfaceId.value)});const scopedRouteParamNames=computed(()=>resolveScopedRouteParamNames(routeContext.placementContext.value,resolvedSurfaceId.value));const routeScopeParams=computed(()=>{const source=paths.routeParams.value;const next={};for(const paramName of scopedRouteParamNames.value){const paramValue=toRouteParamValue(source[paramName]);if(paramValue)next[paramName]=paramValue}return Object.freeze(next)});const missingScopedRouteParamNames=computed(()=>scopedRouteParamNames.value.filter(paramName=>!routeScopeParams.value[paramName]));const requiresScopedRouteParams=computed(()=>scopedRouteParamNames.value.length>0);const hasRequiredRouteScope=computed(()=>missingScopedRouteParamNames.value.length<1);const scopeParamValue=computed(()=>{const[primaryScopeParamName=``]=scopedRouteParamNames.value;return primaryScopeParamName?routeScopeParams.value[primaryScopeParamName]||``:``});const routeScopeError=computed(()=>{if(!requiresScopedRouteParams.value||hasRequiredRouteScope.value)return``;const missingParams=missingScopedRouteParamNames.value.join(`, `);return t(`jskit.http.access.routeParamsRequired`,{params:missingParams,surface:resolvedSurfaceId.value||`<unknown>`})});const accessRuntime=useAccess({enabled:computed(()=>accessRequired&&hasRequiredRouteScope.value),access:normalizedAccessMode,hasPermissionRequirements});function resolveApiPath(apiSuffix=``,context={}){if(routeScopeError.value)return``;const suffix=resolveApiSuffix(apiSuffix,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter,...asPlainObject(context)});return paths.api(suffix,{surface:resolvedSurfaceId.value,params:routeScopeParams.value})}function requireRouteScope(caller=`useScopeRuntime`){if(routeScopeError.value)throw new Error(`${caller}: ${routeScopeError.value}`)}return{normalizedOwnershipFilter,requiresScopedRouteParams:requiresScopedRouteParams.value,resolvedSurfaceId,accessMode:normalizedAccessMode,accessRequired,routeContext,scopedRouteParamNames,routeScopeParams,scopeParamValue,hasRequiredRouteScope,routeScopeError,access:accessRuntime,resolveApiPath,requireRouteScope}}function normalizePermissionSets(permissionSets={}){const source=permissionSets&&typeof permissionSets===`object`&&!Array.isArray(permissionSets)?permissionSets:{};const normalized={};for(const[key,value]of Object.entries(source))normalized[key]=normalizePermissions(value);return normalized}function hasAnyPermissions(permissionSets={}){for(const list of Object.values(permissionSets))if(Array.isArray(list)&&list.length>0)return true;return false}function useOperationScope({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,access=`auto`,apiSuffix=``,model,readEnabled=true,queryKeyFactory,permissionSets={},realtime}){const normalizedPermissionSets=normalizePermissionSets(permissionSets);const scopeRuntime=useScopeRuntime({ownershipFilter,surfaceId,accessMode:access,hasPermissionRequirements:hasAnyPermissions(normalizedPermissionSets)});const normalizedOwnershipFilter=scopeRuntime.normalizedOwnershipFilter;const routeContext=scopeRuntime.routeContext;const scopeParamValue=scopeRuntime.scopeParamValue;const hasRequiredRouteScope=scopeRuntime.hasRequiredRouteScope;const accessRuntime=scopeRuntime.access;const apiPath=computed(()=>scopeRuntime.resolveApiPath(apiSuffix,{model}));const queryEnabled=computed(()=>resolveEnabled(readEnabled,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter,model}));const queryKey=computed(()=>resolveQueryKey(queryKeyFactory,{surfaceId:routeContext.currentSurfaceId.value,scopeParamValue:scopeParamValue.value,ownershipFilter:normalizedOwnershipFilter}));const realtimeBinding=useOperationRealtime({realtime,queryKey:typeof queryKeyFactory===`function`?queryKey:null,enabled:computed(()=>hasRequiredRouteScope.value&&Boolean(apiPath.value))});function queryCanRun(accessGate=true){return computed(()=>queryEnabled.value&&hasRequiredRouteScope.value&&Boolean(apiPath.value)&&Boolean(unref(accessGate)))}function permissionGate(key=``){const list=normalizedPermissionSets[String(key||``)]||[];return computed(()=>resolvePermissionAccess(accessRuntime,list))}function loadError(baseError=``){return computed(()=>{if(scopeRuntime.routeScopeError.value)return scopeRuntime.routeScopeError.value;const permissionsError=String(accessRuntime.permissionsUnavailableError.value||``).trim();if(permissionsError)return permissionsError;if(baseError===void 0||baseError===null||baseError===``)return``;return String(unref(baseError)||``).trim()})}function isLoading(baseLoading=false){return computed(()=>Boolean(unref(baseLoading))||accessRuntime.awaitingPlacementPermissions.value)}return{scopeRuntime,routeContext,normalizedOwnershipFilter,scopeParamValue,hasRequiredRouteScope,access:accessRuntime,apiPath,queryEnabled,queryKey,queryCanRun,realtime:realtimeBinding,permissionGate,loadError,isLoading}}function normalizeFieldErrorKeys(keys){return Array.isArray(keys)?keys.map(entry=>String(entry||``).trim()).filter(Boolean):[]}function useFieldErrorBag(keys=[]){const normalizedKeys=normalizeFieldErrorKeys(keys);const hasFixedKeys=normalizedKeys.length>0;const errors=reactive(Object.fromEntries(normalizedKeys.map(key=>[key,``])));function clear(){const keysToClear=hasFixedKeys?normalizedKeys:Object.keys(errors);for(const key of keysToClear)errors[key]=``}function apply(source={}){const fieldErrorMap=source&&typeof source===`object`?source:{};if(hasFixedKeys){for(const key of normalizedKeys)errors[key]=String(fieldErrorMap[key]||``);return}clear();for(const[field,message]of Object.entries(fieldErrorMap)){const key=String(field||``).trim();if(!key)continue;errors[key]=String(message||``)}}function set(field,message){const key=String(field||``).trim();if(!key)return;if(hasFixedKeys&&!(key in errors))return;errors[key]=String(message||``)}return{errors,clear,apply,set}}function normalizeMessage(value){return String(value||``).trim()}function noRetryAction(){return null}function setupOperationErrorReporting({enabled=true,source=`http-web.operation`,loadError=null,notFoundError=null,loadActionFactory=noRetryAction,notFoundActionFactory=noRetryAction,loadChannel=``,notFoundChannel=``,loadSeverity=`error`,notFoundSeverity=`warning`,dedupeWindowMs=2e3}={}){if(!enabled)return;const runtime=useShellWebErrorRuntime();const normalizedSource=normalizeMessage(source)||`http-web.operation`;function watchMessage(value,{kind=`load`,channel=``,intent=`resource-load`,severity=`error`,actionFactory=noRetryAction}={}){let lastMessage=``;let lastPresentationId=``;watch(()=>normalizeMessage(value.value),nextMessage=>{if(!nextMessage){lastMessage=``;if(lastPresentationId){runtime.dismiss(lastPresentationId);lastPresentationId=``}return}if(nextMessage===lastMessage)return;lastMessage=nextMessage;const action=actionFactory({message:nextMessage,kind});const reportResult=runtime.report({source:normalizedSource,message:nextMessage,intent,severity,channel,action,dedupeKey:`${normalizedSource}:${kind}:${nextMessage}`,dedupeWindowMs});const nextPresentationId=String(reportResult?.presentationId||``).trim();if(nextPresentationId){if(lastPresentationId&&lastPresentationId!==nextPresentationId)runtime.dismiss(lastPresentationId);lastPresentationId=nextPresentationId}},{immediate:true})}if(loadError)watchMessage(loadError,{kind:`load`,channel:loadChannel,intent:`resource-load`,severity:loadSeverity,actionFactory:loadActionFactory});if(notFoundError)watchMessage(notFoundError,{kind:`not-found`,channel:notFoundChannel,intent:`resource-load`,severity:notFoundSeverity,actionFactory:notFoundActionFactory})}function setupRouteChangeCleanup({enabled=true,route,feedback,onClear}){if(!enabled)return;watch(()=>route?.fullPath,()=>{feedback.clear();onClear()})}var CRUD_API_ACCESS_AUTHENTICATED=`authenticated`;var CRUD_API_ACCESS_PUBLIC=`public`;var CRUD_API_ACCESS_VALUES=Object.freeze([CRUD_API_ACCESS_AUTHENTICATED,CRUD_API_ACCESS_PUBLIC]);var publicCrudClients=new WeakSet;function normalizeCrudApiAccess(value=``){const normalized=normalizeText(value).toLowerCase()||`authenticated`;if(CRUD_API_ACCESS_VALUES.includes(normalized))return normalized;throw new TypeError(`CRUD resource apiAccess must be one of: ${CRUD_API_ACCESS_VALUES.join(`, `)}. Received: ${String(value||``)||`(empty)`}`)}function resolveCrudHttpClient(resource=null,{client=getHttpWebClient()}={}){if(normalizeCrudApiAccess(resource?.apiAccess)!==`public`)return client;if(publicCrudClients.has(client))return client;const publicClient=Object.freeze({request(url,options={}){const requestOptions=options&&typeof options===`object`&&!Array.isArray(options)?options:{};return client.request(url,{...requestOptions,csrf:false})}});publicCrudClients.add(publicClient);return publicClient}function useCommand({ownershipFilter=ROUTE_VISIBILITY_WORKSPACE,surfaceId=``,access=`auto`,apiSuffix=``,runPermissions=[],writeMethod=`POST`,client,resource:commandResource=null,transport,placementSource=`http-web.command`,fallbackRunError=`jskit.http.feedback.actionFailed`,fieldErrorKeys,clearOnRouteChange=true,model,input,buildRawPayload,buildCommandPayload,buildCommandOptions,onRunSuccess,onRunError,suppressSuccessMessage=false,messages={},realtime}){const operationScope=useOperationScope({ownershipFilter,surfaceId,access,apiSuffix,model,readEnabled:false,permissionSets:{run:runPermissions},realtime});const routeContext=operationScope.routeContext;const canRun=operationScope.permissionGate(`run`);const endpointResource=useEndpointResource({path:operationScope.apiPath,enabled:false,client:resolveCrudHttpClient(commandResource,{client}),writeMethod,transport,fallbackSaveError:fallbackRunError});const feedback=useUiFeedback({source:`${placementSource}.feedback`});const fieldBag=useFieldErrorBag(fieldErrorKeys);const command=useCommandCore({model,resource:endpointResource,writeMethod,canRun,fieldBag,feedback,input,buildRawPayload,buildCommandPayload,buildCommandOptions,onRunSuccess,onRunError,suppressSuccessMessage:Boolean(suppressSuccessMessage),messages:{validation:`jskit.http.feedback.fixInvalidValues`,success:`jskit.http.feedback.completed`,error:String(fallbackRunError||`jskit.http.feedback.actionFailed`),...messages&&typeof messages===`object`?messages:{}}});setupRouteChangeCleanup({enabled:clearOnRouteChange,route:routeContext.route,feedback,onClear:fieldBag.clear});const loadError=operationScope.loadError();const isLoading=operationScope.isLoading();setupOperationErrorReporting({source:`${placementSource}.load`,loadError});return proxyRefs({canRun,isLoading,loadError,isRunning:command.running,fieldErrors:command.fieldErrors,message:command.message,messageType:command.messageType,run:command.run,resource:endpointResource})}export{useCommand as t};
|