@xopcai/xopc 0.0.151 → 0.0.152
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BuO-OVfD.js → agent-avatar-dicebear-CXe2KDZj.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Bpv3h31T.js → agents-BjLxhsVX.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B6OU3Eol.js → app-management-settings-panel-DekP2_hC.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BaP4GFvN.js → appearance-settings-Cfd5YavF.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DZKNIMRg.js → apps-page-PS-uUoSk.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CJX3zIh_.js → archive-plugin-DWglUgbp.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CI1ejk_l.js → attachment-load-BJdxo2Vn.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-CjmhICbv.js → automation-suggestion-card-B-TfxjJF.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BtZl3B8m.js → automations-page-CtNevo3y.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-CZ8nOXqK.js → binary-plugins-DwrYsL8l.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BoSfyS_j.js → block-editor-CIxjL5Kp.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CL1UiPcb.js → browser-settings-page-QncZ-2vS.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-XzDKxPZ8.js → capability-presets-api-ChR2rMfo.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-Dc_uHYgl.js → capability-presets-settings-panel-_JBmJl5A.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-mALvXpJj.js → channels-settings-Bz3tyWpH.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-logo-BSjlInHT.js → connector-logo-KsRvub5G.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Cm_E3mmI.js → connectors-page-_pT0aE0S.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DcJc91-C.js → desktop-pet-CRCERvWy.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CdeqTa3Q.js → desktop-pet-settings-vGrxshsU.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Cp3fpm0k.js → directory-picker-path-field-BGPYrtx6.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-Bwj1O3zr.js → dreaming-settings-B5pzvNgs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-D_1xpKbZ.js → extension-debug-page-BaCko1XU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CqZNCj96.js → extension-page-TTXKCMtb.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-5MWbtQaQ.js → extension-settings-page-CEMb3uXY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Co_IaS34.js → gateway-config-api-Bf37OGhQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-kmeWm2Pt.js → gateway-settings-cu-vyeNk.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-FoO-R4_U.js → goal-create-dialog-C-bL8rj8.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-CkJq7N5g.js → goal-detail-page-p5zPrlTq.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-config-api-DrtsYjXz.js → goals-config-api-D2pEoiiO.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-DRAN-R64.js → goals-page-D-H2u2-J.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-wq9TKhIZ.js → goals-settings-BVZaBqPa.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-B5zDoHbo.js → heartbeat-settings-B-AC_uwa.js} +1 -1
- package/dist/gateway/static/root/assets/{index-apLU0Hun.js → index-DSydVlxZ.js} +6 -6
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-3tC9iD21.js → keyboard-shortcuts-settings-w0yIP0UB.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CT-vDTLK.js → local-app-workbench-page-CTq0TIH4.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-B9ruF9GV.js → local-apps-page-srIyxJuy.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Ca1X8X2P.js → logs-page-MQB6-NKt.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CzuhSQAB.js → markdown-split-Du5yPuDb.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-a3R4y-EL.js → media-plugins-Cd1Rmw15.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-panel-CbTlz9Of.js → models-hub-panel-BMg_Xqd9.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BCxDy2dV.js → notes-page-DhfrFd89.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-z6sBX9B2.js → notes-workbench-CwJk-D7Y.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-CJfk6M78.js → page-tabs-HACawonJ.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-MFopTSgF.js → preview-open-alternatives-CjEZt_F5.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-DU29deIr.js → project-detail-page-Dut_micj.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Ck3DLTlZ.js → projects-page-sTRlCEZ5.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-gLsLyAyi.js → remote-access-hub-Fx81YH7S.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-D0uhU3Z8.js → save-bar-controls-CbktHUqt.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-NGOH-7wV.js → schedule-field-BGx_Nb45.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BJz5LoqG.js → schema-form-Cg-LJVvG.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-TmNoWpa_.js → sessions-page-DFnmyBpj.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BlWxQ6Ea.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-oDnUHnX_.js → settings-collapsible-section-yYK4O-5E.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-DND90dDt.js → settings-form-section-DPSA8tG8.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CEJtaoQp.js → settings-loading-skeleton-ClHNJwRL.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B1LJlRi9.js → settings-page-lPM7md10.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CsrLuDsW.js → settings-page-layout-B_-VepeK.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BPCJPHHY.js → setup-status-panel-hORJvGAQ.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C1PwLh-p.js → share-preview-page-DyzplAEL.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DCuqr7js.js → shares-settings-DO3IIgcC.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-kn1Vypcy.js → skill-reload-api-C9BqzDjZ.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-k6VIqTkK.js → skills-page-CvOIrcCJ.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BEsrEkSx.js → system-settings-panel-eIyklo0K.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-dOypdlMf.js → typed-models-lib-BgOpEx3h.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-B9Y_Ciav.js → user-context-page-BG_1IrIJ.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-fields-editor-DGC38Lx7.js → user-profile-fields-editor-CfLUK6MT.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-settings-panel-DFkZ-tan.js → user-profile-settings-panel-BmzPREhJ.js} +1 -1
- package/dist/gateway/static/root/assets/{utils-CEIYZihF.js → utils-DbFnvDPi.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DK6gaQsA.js → voice-api-key-field-1xyza74n.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DSJb9Kq7.js → work-discovery-page-Dhyk4LHJ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-DVavwV3D.js → work-item-detail-page-CxBRnWeQ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-page-foJDp0nz.js → work-page-Btq3YeCH.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BYqZpFCC.js → workflow-run-setup-panel-8HLqUALq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DgO0WAzs.js → workflows-page-D48bPgLI.js} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/product-delivery.js +63 -0
- package/dist/src/agent/code-intelligence/tool-gating.d.ts +5 -0
- package/dist/src/agent/code-intelligence/tool-gating.js +6 -0
- package/dist/src/agent/tools/automation-tool.js +1 -1
- package/dist/src/agent/tools/factory.js +2 -1
- package/dist/src/agent/tools/goal-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -1
- package/dist/src/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/status.d.ts +8 -0
- package/dist/src/gateway/hono/routes/status.js +71 -1
- package/package.json +9 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CtPhh2m9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-BQ_8x0bT.js";import{t as a}from"./messages-B0B40tpO.js";import{n as o}from"./locale-store-GfSwnwIZ.js";import{Fr as s,Ir as c,Lr as l,Mr as u,Nr as d,Pr as f,Rr as p,Vo as m,jr as h}from"./index-apLU0Hun.js";import{n as g,r as _}from"./settings-page-layout-CsrLuDsW.js";var v=n(),y=e(t(),1),b=r(),x=f(),S=x?`⌘`:`Ctrl`;function C(e){let t=(0,v.c)(53),{title:n,description:r,shortcut:l,otherShortcut:u,defaultShortcut:d,setShortcut:f,legacyRecordingEvent:m,notice:h}=e,g=o(T),_;t[0]===g?_=t[1]:(_=a(g),t[0]=g,t[1]=_);let S=_.keyboardShortcutsSettings,[C,E]=(0,y.useState)(!1),[D,O]=(0,y.useState)(null),k,A;t[2]!==m||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(p,{detail:e})),m&&window.dispatchEvent(new CustomEvent(m,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(p,{detail:e})),m&&window.dispatchEvent(new CustomEvent(m,{detail:e}))}},A=[m,C],t[2]=m,t[3]=C,t[4]=k,t[5]=A):(k=t[4],A=t[5]),(0,y.useEffect)(k,A);let j;t[6]!==S.quickCaptureShortcutConflict||t[7]!==u||t[8]!==C||t[9]!==f?(j=e=>{if(!C)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){E(!1);return}let t=c(e.nativeEvent);if(!t)return;let n=x?`meta`:`control`;if(new Set([`${n}+k`,`${n}+n`,`${n}+b`,`${n}+,`]).has(t)||t===u){O(S.quickCaptureShortcutConflict);return}f(t),O(null),E(!1)},t[6]=S.quickCaptureShortcutConflict,t[7]=u,t[8]=C,t[9]=f,t[10]=j):j=t[10];let M=j,N;t[11]===n?N=t[12]:(N=(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[11]=n,t[12]=N);let P;t[13]===r?P=t[14]:(P=(0,b.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r}),t[13]=r,t[14]=P);let F;t[15]!==N||t[16]!==P?(F=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[N,P]}),t[15]=N,t[16]=P,t[17]=F):F=t[17];let I;t[18]===l?I=t[19]:(I=s(l).map(w),t[18]=l,t[19]=I);let L;t[20]===I?L=t[21]:(L=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:I}),t[20]=I,t[21]=L);let R;t[22]!==F||t[23]!==L?(R=(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[F,L]}),t[22]=F,t[23]=L,t[24]=R):R=t[24];let z,B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=i(`rounded-lg bg-accent px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`),B=()=>{O(null),E(!0)},t[25]=z,t[26]=B):(z=t[25],B=t[26]);let V;t[27]===S.quickCaptureShortcutChange?V=t[28]:(V=(0,b.jsx)(`button`,{type:`button`,className:z,onClick:B,children:S.quickCaptureShortcutChange}),t[27]=S.quickCaptureShortcutChange,t[28]=V);let H;t[29]!==d||t[30]!==f?(H=()=>{f(d()),O(null)},t[29]=d,t[30]=f,t[31]=H):H=t[31];let U;t[32]!==S.quickCaptureShortcutReset||t[33]!==H?(U=(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:H,children:S.quickCaptureShortcutReset}),t[32]=S.quickCaptureShortcutReset,t[33]=H,t[34]=U):U=t[34];let W;t[35]!==S.quickCaptureShortcutRecording||t[36]!==M||t[37]!==C?(W=C?(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg border border-accent bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg outline-none`,onKeyDown:M,onClick:()=>E(!1),children:S.quickCaptureShortcutRecording}):null,t[35]=S.quickCaptureShortcutRecording,t[36]=M,t[37]=C,t[38]=W):W=t[38];let G;t[39]!==V||t[40]!==U||t[41]!==W?(G=(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[V,U,W]}),t[39]=V,t[40]=U,t[41]=W,t[42]=G):G=t[42];let K;t[43]===D?K=t[44]:(K=D?(0,b.jsx)(`p`,{className:`mt-2 text-sm text-danger-fg`,children:D}):null,t[43]=D,t[44]=K);let q;t[45]===h?q=t[46]:(q=h?(0,b.jsx)(`div`,{className:`mt-3 border-t border-edge pt-3`,children:h}):null,t[45]=h,t[46]=q);let J;return t[47]!==R||t[48]!==G||t[49]!==K||t[50]!==q||t[51]!==n?(J=(0,b.jsxs)(`section`,{className:`rounded-xl bg-surface-base px-4 py-3.5 sm:px-5 sm:py-4`,"aria-label":n,children:[R,G,K,q]}),t[47]=R,t[48]=G,t[49]=K,t[50]=q,t[51]=n,t[52]=J):J=t[52],J}function w(e,t){return(0,b.jsx)(L,{children:e},`${e}-${String(t)}`)}function T(e){return e.language}function E(){let e=(0,v.c)(8),t=o(A),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=l(k),s=l(O),c=u(D),f;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==i||e[6]!==c?(f=(0,b.jsx)(C,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:i,otherShortcut:c,defaultShortcut:d,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=i,e[6]=c,e[7]=f):f=e[7],f}function D(e){return e.shortcut}function O(e){return e.setShortcut}function k(e){return e.shortcut}function A(e){return e.language}function j(){let e=(0,v.c)(9),t=o(F),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=u(P),s=u(N),c=l(M),d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,b.jsx)(I,{}),e[2]=d):d=e[2];let f;return e[3]!==r.voiceInputShortcutDescription||e[4]!==r.voiceInputShortcutTitle||e[5]!==c||e[6]!==s||e[7]!==i?(f=(0,b.jsx)(C,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:i,otherShortcut:c,defaultShortcut:h,setShortcut:s,notice:d}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=c,e[6]=s,e[7]=i,e[8]=f):f=e[8],f}function M(e){return e.shortcut}function N(e){return e.setShortcut}function P(e){return e.shortcut}function F(e){return e.language}function I(){let e=a(o(e=>e.language)).keyboardShortcutsSettings,t=window.electronAPI?.system,n=m()&&window.electronAPI?.platform===`darwin`,[r,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!n||!t)return;let e=!0,r=()=>{t.getPermissions().then(t=>{e&&s(t.accessibility===`granted`)}).catch(()=>void 0)};return r(),window.addEventListener(`focus`,r),()=>{e=!1,window.removeEventListener(`focus`,r)}},[n,t]),!n||!t?null:(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,b.jsx)(`p`,{className:`max-w-[65ch] text-xs text-fg-muted`,children:r?e.voiceInputAccessibilityGranted:e.voiceInputAccessibilityDescription}),r?null:(0,b.jsx)(`button`,{type:`button`,disabled:c,className:i(`rounded-lg border border-edge-strong bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:text-fg-disabled`),onClick:async()=>{l(!0);try{s((await t.requestAccessibility()).status===`granted`)}finally{l(!1)}},children:c?e.voiceInputAccessibilityRequesting:e.voiceInputAccessibilityEnable})]})}function L(e){let t=(0,v.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,b.jsx)(`kbd`,{className:`inline-flex min-w-[1.5rem] items-center justify-center rounded-md border border-edge-subtle bg-surface-hover/60 px-1.5 py-0.5 font-mono text-xs font-medium text-fg-muted shadow-[0_1px_0_0_var(--color-edge-subtle)]`,children:n}),t[0]=n,t[1]=r),r}function R(e){let t=(0,v.c)(14),{keys:n,label:r,note:i}=e,a;t[0]===r?a=t[1]:(a=(0,b.jsx)(`span`,{className:`text-sm text-fg`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i&&(0,b.jsxs)(`span`,{className:`ml-1.5 text-xs text-fg-muted`,children:[`(`,i,`)`]}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=n.map(z),t[7]=n,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==s||t[12]!==l?(u=(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[s,l]}),t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function z(e){return(0,b.jsx)(L,{children:e},e)}function B(e){let t=(0,v.c)(11),{title:n,shortcuts:r}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=i(`rounded-xl bg-surface-base px-4 sm:px-5`),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,b.jsx)(`h2`,{className:`pb-1 pt-3.5 text-sm font-semibold text-fg sm:pt-4`,children:n}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r.map(V),t[3]=r,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,b.jsx)(`div`,{className:`grid gap-1 pb-3 sm:pb-4`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==o||t[8]!==c||t[9]!==n?(l=(0,b.jsxs)(`section`,{className:a,"aria-label":n,children:[o,c]}),t[7]=o,t[8]=c,t[9]=n,t[10]=l):l=t[10],l}function V(e){return(0,b.jsx)(R,{...e},e.label)}function H(){let e=(0,v.c)(134),t=o(K),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=l(G),c=u(W),d;if(e[2]!==r.categoryChat||e[3]!==r.categoryEditor||e[4]!==r.categoryGlobal||e[5]!==r.categoryNavigation||e[6]!==r.chatForceSend||e[7]!==r.chatNewLine||e[8]!==r.chatSend||e[9]!==r.chatVoiceInput||e[10]!==r.editorBulletList||e[11]!==r.editorHeading1||e[12]!==r.editorHeading2||e[13]!==r.editorHeading3||e[14]!==r.editorOrderedList||e[15]!==r.editorTaskList||e[16]!==r.globalNewChat||e[17]!==r.globalOpenSettings||e[18]!==r.globalToggleWindow||e[19]!==r.globalVoiceInput||e[20]!==r.globalVoiceInputMacNote||e[21]!==r.globalVoiceInputWindowsNote||e[22]!==r.navCloseDialog||e[23]!==r.navCommandPalette||e[24]!==r.navQuickCapture||e[25]!==r.navToggleFullscreen||e[26]!==r.navToggleSidebar||e[27]!==i||e[28]!==c){if(d=[],m()){let t=window.electronAPI?.platform===`darwin`?`Fn`:`Alt`,n=window.electronAPI?.platform===`darwin`?r.globalVoiceInputMacNote:r.globalVoiceInputWindowsNote,i;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(i=[S,`Shift`,`Space`],e[30]=i):i=e[30];let a;e[31]===r.globalToggleWindow?a=e[32]:(a={keys:i,label:r.globalToggleWindow},e[31]=r.globalToggleWindow,e[32]=a);let o;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(o=[t],e[33]=o):o=e[33];let s;e[34]!==r.globalVoiceInput||e[35]!==n?(s={keys:o,label:r.globalVoiceInput,note:n},e[34]=r.globalVoiceInput,e[35]=n,e[36]=s):s=e[36];let c;e[37]!==a||e[38]!==s?(c=[a,s],e[37]=a,e[38]=s,e[39]=c):c=e[39];let l;e[40]!==r.categoryGlobal||e[41]!==c?(l={title:r.categoryGlobal,shortcuts:c},e[40]=r.categoryGlobal,e[41]=c,e[42]=l):l=e[42],d.push(l)}let t=r.categoryNavigation,n;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(n=[S,`N`],e[43]=n):n=e[43];let a;e[44]===r.globalNewChat?a=e[45]:(a={keys:n,label:r.globalNewChat},e[44]=r.globalNewChat,e[45]=a);let o;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(o=[S,`K`],e[46]=o):o=e[46];let l;e[47]===r.navCommandPalette?l=e[48]:(l={keys:o,label:r.navCommandPalette},e[47]=r.navCommandPalette,e[48]=l);let u;e[49]===i?u=e[50]:(u=s(i),e[49]=i,e[50]=u);let f;e[51]!==r.navQuickCapture||e[52]!==u?(f={keys:u,label:r.navQuickCapture},e[51]=r.navQuickCapture,e[52]=u,e[53]=f):f=e[53];let p;e[54]===r.navToggleSidebar?p=e[55]:(p=m()?[{keys:[S,`B`],label:r.navToggleSidebar}]:[],e[54]=r.navToggleSidebar,e[55]=p);let h;e[56]===r.navToggleFullscreen?h=e[57]:(h=m()?[{keys:[`F11`],label:r.navToggleFullscreen}]:[],e[56]=r.navToggleFullscreen,e[57]=h);let g;e[58]===r.globalOpenSettings?g=e[59]:(g=m()?[{keys:[S,`,`],label:r.globalOpenSettings}]:[],e[58]=r.globalOpenSettings,e[59]=g);let _;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=[`Esc`],e[60]=_):_=e[60];let v;e[61]===r.navCloseDialog?v=e[62]:(v={keys:_,label:r.navCloseDialog},e[61]=r.navCloseDialog,e[62]=v);let y;e[63]!==g||e[64]!==v||e[65]!==a||e[66]!==l||e[67]!==f||e[68]!==p||e[69]!==h?(y=[a,l,f,...p,...h,...g,v],e[63]=g,e[64]=v,e[65]=a,e[66]=l,e[67]=f,e[68]=p,e[69]=h,e[70]=y):y=e[70];let b;e[71]!==r.categoryNavigation||e[72]!==y?(b={title:t,shortcuts:y},e[71]=r.categoryNavigation,e[72]=y,e[73]=b):b=e[73],d.push(b);let x=r.categoryChat,C;e[74]===Symbol.for(`react.memo_cache_sentinel`)?(C=[`Enter`],e[74]=C):C=e[74];let w;e[75]===r.chatSend?w=e[76]:(w={keys:C,label:r.chatSend},e[75]=r.chatSend,e[76]=w);let T;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(T=[`Shift`,`Enter`],e[77]=T):T=e[77];let E;e[78]===r.chatNewLine?E=e[79]:(E={keys:T,label:r.chatNewLine},e[78]=r.chatNewLine,e[79]=E);let D;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(D=[S,`Enter`],e[80]=D):D=e[80];let O;e[81]===r.chatForceSend?O=e[82]:(O={keys:D,label:r.chatForceSend},e[81]=r.chatForceSend,e[82]=O);let k;e[83]===c?k=e[84]:(k=s(c),e[83]=c,e[84]=k);let A;e[85]!==r.chatVoiceInput||e[86]!==k?(A={keys:k,label:r.chatVoiceInput},e[85]=r.chatVoiceInput,e[86]=k,e[87]=A):A=e[87];let j;e[88]!==w||e[89]!==E||e[90]!==O||e[91]!==A?(j=[w,E,O,A],e[88]=w,e[89]=E,e[90]=O,e[91]=A,e[92]=j):j=e[92];let M;e[93]!==r.categoryChat||e[94]!==j?(M={title:x,shortcuts:j},e[93]=r.categoryChat,e[94]=j,e[95]=M):M=e[95],d.push(M);let N;e[96]===Symbol.for(`react.memo_cache_sentinel`)?(N=[S,`Shift`,`1`],e[96]=N):N=e[96];let P;e[97]===r.editorHeading1?P=e[98]:(P={keys:N,label:r.editorHeading1},e[97]=r.editorHeading1,e[98]=P);let F;e[99]===Symbol.for(`react.memo_cache_sentinel`)?(F=[S,`Shift`,`2`],e[99]=F):F=e[99];let I;e[100]===r.editorHeading2?I=e[101]:(I={keys:F,label:r.editorHeading2},e[100]=r.editorHeading2,e[101]=I);let L;e[102]===Symbol.for(`react.memo_cache_sentinel`)?(L=[S,`Shift`,`3`],e[102]=L):L=e[102];let R;e[103]===r.editorHeading3?R=e[104]:(R={keys:L,label:r.editorHeading3},e[103]=r.editorHeading3,e[104]=R);let z;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(z=[S,`Shift`,`8`],e[105]=z):z=e[105];let B;e[106]===r.editorBulletList?B=e[107]:(B={keys:z,label:r.editorBulletList},e[106]=r.editorBulletList,e[107]=B);let V;e[108]===Symbol.for(`react.memo_cache_sentinel`)?(V=[S,`Shift`,`9`],e[108]=V):V=e[108];let H;e[109]===r.editorOrderedList?H=e[110]:(H={keys:V,label:r.editorOrderedList},e[109]=r.editorOrderedList,e[110]=H);let U;e[111]===Symbol.for(`react.memo_cache_sentinel`)?(U=[S,`Shift`,`0`],e[111]=U):U=e[111];let W;e[112]===r.editorTaskList?W=e[113]:(W={keys:U,label:r.editorTaskList},e[112]=r.editorTaskList,e[113]=W);let G;e[114]!==P||e[115]!==I||e[116]!==R||e[117]!==B||e[118]!==H||e[119]!==W?(G=[P,I,R,B,H,W],e[114]=P,e[115]=I,e[116]=R,e[117]=B,e[118]=H,e[119]=W,e[120]=G):G=e[120];let K;e[121]!==r.categoryEditor||e[122]!==G?(K={title:r.categoryEditor,shortcuts:G},e[121]=r.categoryEditor,e[122]=G,e[123]=K):K=e[123],d.push(K),e[2]=r.categoryChat,e[3]=r.categoryEditor,e[4]=r.categoryGlobal,e[5]=r.categoryNavigation,e[6]=r.chatForceSend,e[7]=r.chatNewLine,e[8]=r.chatSend,e[9]=r.chatVoiceInput,e[10]=r.editorBulletList,e[11]=r.editorHeading1,e[12]=r.editorHeading2,e[13]=r.editorHeading3,e[14]=r.editorOrderedList,e[15]=r.editorTaskList,e[16]=r.globalNewChat,e[17]=r.globalOpenSettings,e[18]=r.globalToggleWindow,e[19]=r.globalVoiceInput,e[20]=r.globalVoiceInputMacNote,e[21]=r.globalVoiceInputWindowsNote,e[22]=r.navCloseDialog,e[23]=r.navCommandPalette,e[24]=r.navQuickCapture,e[25]=r.navToggleFullscreen,e[26]=r.navToggleSidebar,e[27]=i,e[28]=c,e[29]=d}else d=e[29];let f;e[124]!==r.pageTitle||e[125]!==r.subtitle?(f=(0,b.jsx)(g,{title:r.pageTitle,subtitle:r.subtitle}),e[124]=r.pageTitle,e[125]=r.subtitle,e[126]=f):f=e[126];let p,h;e[127]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,b.jsx)(E,{}),h=(0,b.jsx)(j,{}),e[127]=p,e[128]=h):(p=e[127],h=e[128]);let y;e[129]===d?y=e[130]:(y=d.map(U),e[129]=d,e[130]=y);let x;return e[131]!==f||e[132]!==y?(x=(0,b.jsxs)(_,{gap:`gap-6`,children:[f,p,h,y]}),e[131]=f,e[132]=y,e[133]=x):x=e[133],x}function U(e){return(0,b.jsx)(B,{...e},e.title)}function W(e){return e.shortcut}function G(e){return e.shortcut}function K(e){return e.language}export{H as KeyboardShortcutsSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-BQ_8x0bT.js";import{t as a}from"./messages-B0B40tpO.js";import{n as o}from"./locale-store-GfSwnwIZ.js";import{Fr as s,Ir as c,Lr as l,Mr as u,Nr as d,Pr as f,Rr as p,Vo as m,jr as h}from"./index-DSydVlxZ.js";import{n as g,r as _}from"./settings-page-layout-B_-VepeK.js";var v=n(),y=e(t(),1),b=r(),x=f(),S=x?`⌘`:`Ctrl`;function C(e){let t=(0,v.c)(53),{title:n,description:r,shortcut:l,otherShortcut:u,defaultShortcut:d,setShortcut:f,legacyRecordingEvent:m,notice:h}=e,g=o(T),_;t[0]===g?_=t[1]:(_=a(g),t[0]=g,t[1]=_);let S=_.keyboardShortcutsSettings,[C,E]=(0,y.useState)(!1),[D,O]=(0,y.useState)(null),k,A;t[2]!==m||t[3]!==C?(k=()=>{let e={active:C};return window.dispatchEvent(new CustomEvent(p,{detail:e})),m&&window.dispatchEvent(new CustomEvent(m,{detail:e})),()=>{let e={active:!1};window.dispatchEvent(new CustomEvent(p,{detail:e})),m&&window.dispatchEvent(new CustomEvent(m,{detail:e}))}},A=[m,C],t[2]=m,t[3]=C,t[4]=k,t[5]=A):(k=t[4],A=t[5]),(0,y.useEffect)(k,A);let j;t[6]!==S.quickCaptureShortcutConflict||t[7]!==u||t[8]!==C||t[9]!==f?(j=e=>{if(!C)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){E(!1);return}let t=c(e.nativeEvent);if(!t)return;let n=x?`meta`:`control`;if(new Set([`${n}+k`,`${n}+n`,`${n}+b`,`${n}+,`]).has(t)||t===u){O(S.quickCaptureShortcutConflict);return}f(t),O(null),E(!1)},t[6]=S.quickCaptureShortcutConflict,t[7]=u,t[8]=C,t[9]=f,t[10]=j):j=t[10];let M=j,N;t[11]===n?N=t[12]:(N=(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n}),t[11]=n,t[12]=N);let P;t[13]===r?P=t[14]:(P=(0,b.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r}),t[13]=r,t[14]=P);let F;t[15]!==N||t[16]!==P?(F=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[N,P]}),t[15]=N,t[16]=P,t[17]=F):F=t[17];let I;t[18]===l?I=t[19]:(I=s(l).map(w),t[18]=l,t[19]=I);let L;t[20]===I?L=t[21]:(L=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:I}),t[20]=I,t[21]=L);let R;t[22]!==F||t[23]!==L?(R=(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[F,L]}),t[22]=F,t[23]=L,t[24]=R):R=t[24];let z,B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=i(`rounded-lg bg-accent px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`),B=()=>{O(null),E(!0)},t[25]=z,t[26]=B):(z=t[25],B=t[26]);let V;t[27]===S.quickCaptureShortcutChange?V=t[28]:(V=(0,b.jsx)(`button`,{type:`button`,className:z,onClick:B,children:S.quickCaptureShortcutChange}),t[27]=S.quickCaptureShortcutChange,t[28]=V);let H;t[29]!==d||t[30]!==f?(H=()=>{f(d()),O(null)},t[29]=d,t[30]=f,t[31]=H):H=t[31];let U;t[32]!==S.quickCaptureShortcutReset||t[33]!==H?(U=(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:H,children:S.quickCaptureShortcutReset}),t[32]=S.quickCaptureShortcutReset,t[33]=H,t[34]=U):U=t[34];let W;t[35]!==S.quickCaptureShortcutRecording||t[36]!==M||t[37]!==C?(W=C?(0,b.jsx)(`button`,{type:`button`,className:`rounded-lg border border-accent bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg outline-none`,onKeyDown:M,onClick:()=>E(!1),children:S.quickCaptureShortcutRecording}):null,t[35]=S.quickCaptureShortcutRecording,t[36]=M,t[37]=C,t[38]=W):W=t[38];let G;t[39]!==V||t[40]!==U||t[41]!==W?(G=(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[V,U,W]}),t[39]=V,t[40]=U,t[41]=W,t[42]=G):G=t[42];let K;t[43]===D?K=t[44]:(K=D?(0,b.jsx)(`p`,{className:`mt-2 text-sm text-danger-fg`,children:D}):null,t[43]=D,t[44]=K);let q;t[45]===h?q=t[46]:(q=h?(0,b.jsx)(`div`,{className:`mt-3 border-t border-edge pt-3`,children:h}):null,t[45]=h,t[46]=q);let J;return t[47]!==R||t[48]!==G||t[49]!==K||t[50]!==q||t[51]!==n?(J=(0,b.jsxs)(`section`,{className:`rounded-xl bg-surface-base px-4 py-3.5 sm:px-5 sm:py-4`,"aria-label":n,children:[R,G,K,q]}),t[47]=R,t[48]=G,t[49]=K,t[50]=q,t[51]=n,t[52]=J):J=t[52],J}function w(e,t){return(0,b.jsx)(L,{children:e},`${e}-${String(t)}`)}function T(e){return e.language}function E(){let e=(0,v.c)(8),t=o(A),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=l(k),s=l(O),c=u(D),f;return e[2]!==r.quickCaptureShortcutDescription||e[3]!==r.quickCaptureShortcutTitle||e[4]!==s||e[5]!==i||e[6]!==c?(f=(0,b.jsx)(C,{title:r.quickCaptureShortcutTitle,description:r.quickCaptureShortcutDescription,shortcut:i,otherShortcut:c,defaultShortcut:d,setShortcut:s,legacyRecordingEvent:`quick-capture-shortcut-recording`}),e[2]=r.quickCaptureShortcutDescription,e[3]=r.quickCaptureShortcutTitle,e[4]=s,e[5]=i,e[6]=c,e[7]=f):f=e[7],f}function D(e){return e.shortcut}function O(e){return e.setShortcut}function k(e){return e.shortcut}function A(e){return e.language}function j(){let e=(0,v.c)(9),t=o(F),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=u(P),s=u(N),c=l(M),d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,b.jsx)(I,{}),e[2]=d):d=e[2];let f;return e[3]!==r.voiceInputShortcutDescription||e[4]!==r.voiceInputShortcutTitle||e[5]!==c||e[6]!==s||e[7]!==i?(f=(0,b.jsx)(C,{title:r.voiceInputShortcutTitle,description:r.voiceInputShortcutDescription,shortcut:i,otherShortcut:c,defaultShortcut:h,setShortcut:s,notice:d}),e[3]=r.voiceInputShortcutDescription,e[4]=r.voiceInputShortcutTitle,e[5]=c,e[6]=s,e[7]=i,e[8]=f):f=e[8],f}function M(e){return e.shortcut}function N(e){return e.setShortcut}function P(e){return e.shortcut}function F(e){return e.language}function I(){let e=a(o(e=>e.language)).keyboardShortcutsSettings,t=window.electronAPI?.system,n=m()&&window.electronAPI?.platform===`darwin`,[r,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!n||!t)return;let e=!0,r=()=>{t.getPermissions().then(t=>{e&&s(t.accessibility===`granted`)}).catch(()=>void 0)};return r(),window.addEventListener(`focus`,r),()=>{e=!1,window.removeEventListener(`focus`,r)}},[n,t]),!n||!t?null:(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,b.jsx)(`p`,{className:`max-w-[65ch] text-xs text-fg-muted`,children:r?e.voiceInputAccessibilityGranted:e.voiceInputAccessibilityDescription}),r?null:(0,b.jsx)(`button`,{type:`button`,disabled:c,className:i(`rounded-lg border border-edge-strong bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg transition-colors hover:bg-surface-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:text-fg-disabled`),onClick:async()=>{l(!0);try{s((await t.requestAccessibility()).status===`granted`)}finally{l(!1)}},children:c?e.voiceInputAccessibilityRequesting:e.voiceInputAccessibilityEnable})]})}function L(e){let t=(0,v.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,b.jsx)(`kbd`,{className:`inline-flex min-w-[1.5rem] items-center justify-center rounded-md border border-edge-subtle bg-surface-hover/60 px-1.5 py-0.5 font-mono text-xs font-medium text-fg-muted shadow-[0_1px_0_0_var(--color-edge-subtle)]`,children:n}),t[0]=n,t[1]=r),r}function R(e){let t=(0,v.c)(14),{keys:n,label:r,note:i}=e,a;t[0]===r?a=t[1]:(a=(0,b.jsx)(`span`,{className:`text-sm text-fg`,children:r}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i&&(0,b.jsxs)(`span`,{className:`ml-1.5 text-xs text-fg-muted`,children:[`(`,i,`)`]}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,b.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=n.map(z),t[7]=n,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==s||t[12]!==l?(u=(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[s,l]}),t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function z(e){return(0,b.jsx)(L,{children:e},e)}function B(e){let t=(0,v.c)(11),{title:n,shortcuts:r}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=i(`rounded-xl bg-surface-base px-4 sm:px-5`),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,b.jsx)(`h2`,{className:`pb-1 pt-3.5 text-sm font-semibold text-fg sm:pt-4`,children:n}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r.map(V),t[3]=r,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,b.jsx)(`div`,{className:`grid gap-1 pb-3 sm:pb-4`,children:s}),t[5]=s,t[6]=c);let l;return t[7]!==o||t[8]!==c||t[9]!==n?(l=(0,b.jsxs)(`section`,{className:a,"aria-label":n,children:[o,c]}),t[7]=o,t[8]=c,t[9]=n,t[10]=l):l=t[10],l}function V(e){return(0,b.jsx)(R,{...e},e.label)}function H(){let e=(0,v.c)(134),t=o(K),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.keyboardShortcutsSettings,i=l(G),c=u(W),d;if(e[2]!==r.categoryChat||e[3]!==r.categoryEditor||e[4]!==r.categoryGlobal||e[5]!==r.categoryNavigation||e[6]!==r.chatForceSend||e[7]!==r.chatNewLine||e[8]!==r.chatSend||e[9]!==r.chatVoiceInput||e[10]!==r.editorBulletList||e[11]!==r.editorHeading1||e[12]!==r.editorHeading2||e[13]!==r.editorHeading3||e[14]!==r.editorOrderedList||e[15]!==r.editorTaskList||e[16]!==r.globalNewChat||e[17]!==r.globalOpenSettings||e[18]!==r.globalToggleWindow||e[19]!==r.globalVoiceInput||e[20]!==r.globalVoiceInputMacNote||e[21]!==r.globalVoiceInputWindowsNote||e[22]!==r.navCloseDialog||e[23]!==r.navCommandPalette||e[24]!==r.navQuickCapture||e[25]!==r.navToggleFullscreen||e[26]!==r.navToggleSidebar||e[27]!==i||e[28]!==c){if(d=[],m()){let t=window.electronAPI?.platform===`darwin`?`Fn`:`Alt`,n=window.electronAPI?.platform===`darwin`?r.globalVoiceInputMacNote:r.globalVoiceInputWindowsNote,i;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(i=[S,`Shift`,`Space`],e[30]=i):i=e[30];let a;e[31]===r.globalToggleWindow?a=e[32]:(a={keys:i,label:r.globalToggleWindow},e[31]=r.globalToggleWindow,e[32]=a);let o;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(o=[t],e[33]=o):o=e[33];let s;e[34]!==r.globalVoiceInput||e[35]!==n?(s={keys:o,label:r.globalVoiceInput,note:n},e[34]=r.globalVoiceInput,e[35]=n,e[36]=s):s=e[36];let c;e[37]!==a||e[38]!==s?(c=[a,s],e[37]=a,e[38]=s,e[39]=c):c=e[39];let l;e[40]!==r.categoryGlobal||e[41]!==c?(l={title:r.categoryGlobal,shortcuts:c},e[40]=r.categoryGlobal,e[41]=c,e[42]=l):l=e[42],d.push(l)}let t=r.categoryNavigation,n;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(n=[S,`N`],e[43]=n):n=e[43];let a;e[44]===r.globalNewChat?a=e[45]:(a={keys:n,label:r.globalNewChat},e[44]=r.globalNewChat,e[45]=a);let o;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(o=[S,`K`],e[46]=o):o=e[46];let l;e[47]===r.navCommandPalette?l=e[48]:(l={keys:o,label:r.navCommandPalette},e[47]=r.navCommandPalette,e[48]=l);let u;e[49]===i?u=e[50]:(u=s(i),e[49]=i,e[50]=u);let f;e[51]!==r.navQuickCapture||e[52]!==u?(f={keys:u,label:r.navQuickCapture},e[51]=r.navQuickCapture,e[52]=u,e[53]=f):f=e[53];let p;e[54]===r.navToggleSidebar?p=e[55]:(p=m()?[{keys:[S,`B`],label:r.navToggleSidebar}]:[],e[54]=r.navToggleSidebar,e[55]=p);let h;e[56]===r.navToggleFullscreen?h=e[57]:(h=m()?[{keys:[`F11`],label:r.navToggleFullscreen}]:[],e[56]=r.navToggleFullscreen,e[57]=h);let g;e[58]===r.globalOpenSettings?g=e[59]:(g=m()?[{keys:[S,`,`],label:r.globalOpenSettings}]:[],e[58]=r.globalOpenSettings,e[59]=g);let _;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(_=[`Esc`],e[60]=_):_=e[60];let v;e[61]===r.navCloseDialog?v=e[62]:(v={keys:_,label:r.navCloseDialog},e[61]=r.navCloseDialog,e[62]=v);let y;e[63]!==g||e[64]!==v||e[65]!==a||e[66]!==l||e[67]!==f||e[68]!==p||e[69]!==h?(y=[a,l,f,...p,...h,...g,v],e[63]=g,e[64]=v,e[65]=a,e[66]=l,e[67]=f,e[68]=p,e[69]=h,e[70]=y):y=e[70];let b;e[71]!==r.categoryNavigation||e[72]!==y?(b={title:t,shortcuts:y},e[71]=r.categoryNavigation,e[72]=y,e[73]=b):b=e[73],d.push(b);let x=r.categoryChat,C;e[74]===Symbol.for(`react.memo_cache_sentinel`)?(C=[`Enter`],e[74]=C):C=e[74];let w;e[75]===r.chatSend?w=e[76]:(w={keys:C,label:r.chatSend},e[75]=r.chatSend,e[76]=w);let T;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(T=[`Shift`,`Enter`],e[77]=T):T=e[77];let E;e[78]===r.chatNewLine?E=e[79]:(E={keys:T,label:r.chatNewLine},e[78]=r.chatNewLine,e[79]=E);let D;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(D=[S,`Enter`],e[80]=D):D=e[80];let O;e[81]===r.chatForceSend?O=e[82]:(O={keys:D,label:r.chatForceSend},e[81]=r.chatForceSend,e[82]=O);let k;e[83]===c?k=e[84]:(k=s(c),e[83]=c,e[84]=k);let A;e[85]!==r.chatVoiceInput||e[86]!==k?(A={keys:k,label:r.chatVoiceInput},e[85]=r.chatVoiceInput,e[86]=k,e[87]=A):A=e[87];let j;e[88]!==w||e[89]!==E||e[90]!==O||e[91]!==A?(j=[w,E,O,A],e[88]=w,e[89]=E,e[90]=O,e[91]=A,e[92]=j):j=e[92];let M;e[93]!==r.categoryChat||e[94]!==j?(M={title:x,shortcuts:j},e[93]=r.categoryChat,e[94]=j,e[95]=M):M=e[95],d.push(M);let N;e[96]===Symbol.for(`react.memo_cache_sentinel`)?(N=[S,`Shift`,`1`],e[96]=N):N=e[96];let P;e[97]===r.editorHeading1?P=e[98]:(P={keys:N,label:r.editorHeading1},e[97]=r.editorHeading1,e[98]=P);let F;e[99]===Symbol.for(`react.memo_cache_sentinel`)?(F=[S,`Shift`,`2`],e[99]=F):F=e[99];let I;e[100]===r.editorHeading2?I=e[101]:(I={keys:F,label:r.editorHeading2},e[100]=r.editorHeading2,e[101]=I);let L;e[102]===Symbol.for(`react.memo_cache_sentinel`)?(L=[S,`Shift`,`3`],e[102]=L):L=e[102];let R;e[103]===r.editorHeading3?R=e[104]:(R={keys:L,label:r.editorHeading3},e[103]=r.editorHeading3,e[104]=R);let z;e[105]===Symbol.for(`react.memo_cache_sentinel`)?(z=[S,`Shift`,`8`],e[105]=z):z=e[105];let B;e[106]===r.editorBulletList?B=e[107]:(B={keys:z,label:r.editorBulletList},e[106]=r.editorBulletList,e[107]=B);let V;e[108]===Symbol.for(`react.memo_cache_sentinel`)?(V=[S,`Shift`,`9`],e[108]=V):V=e[108];let H;e[109]===r.editorOrderedList?H=e[110]:(H={keys:V,label:r.editorOrderedList},e[109]=r.editorOrderedList,e[110]=H);let U;e[111]===Symbol.for(`react.memo_cache_sentinel`)?(U=[S,`Shift`,`0`],e[111]=U):U=e[111];let W;e[112]===r.editorTaskList?W=e[113]:(W={keys:U,label:r.editorTaskList},e[112]=r.editorTaskList,e[113]=W);let G;e[114]!==P||e[115]!==I||e[116]!==R||e[117]!==B||e[118]!==H||e[119]!==W?(G=[P,I,R,B,H,W],e[114]=P,e[115]=I,e[116]=R,e[117]=B,e[118]=H,e[119]=W,e[120]=G):G=e[120];let K;e[121]!==r.categoryEditor||e[122]!==G?(K={title:r.categoryEditor,shortcuts:G},e[121]=r.categoryEditor,e[122]=G,e[123]=K):K=e[123],d.push(K),e[2]=r.categoryChat,e[3]=r.categoryEditor,e[4]=r.categoryGlobal,e[5]=r.categoryNavigation,e[6]=r.chatForceSend,e[7]=r.chatNewLine,e[8]=r.chatSend,e[9]=r.chatVoiceInput,e[10]=r.editorBulletList,e[11]=r.editorHeading1,e[12]=r.editorHeading2,e[13]=r.editorHeading3,e[14]=r.editorOrderedList,e[15]=r.editorTaskList,e[16]=r.globalNewChat,e[17]=r.globalOpenSettings,e[18]=r.globalToggleWindow,e[19]=r.globalVoiceInput,e[20]=r.globalVoiceInputMacNote,e[21]=r.globalVoiceInputWindowsNote,e[22]=r.navCloseDialog,e[23]=r.navCommandPalette,e[24]=r.navQuickCapture,e[25]=r.navToggleFullscreen,e[26]=r.navToggleSidebar,e[27]=i,e[28]=c,e[29]=d}else d=e[29];let f;e[124]!==r.pageTitle||e[125]!==r.subtitle?(f=(0,b.jsx)(g,{title:r.pageTitle,subtitle:r.subtitle}),e[124]=r.pageTitle,e[125]=r.subtitle,e[126]=f):f=e[126];let p,h;e[127]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,b.jsx)(E,{}),h=(0,b.jsx)(j,{}),e[127]=p,e[128]=h):(p=e[127],h=e[128]);let y;e[129]===d?y=e[130]:(y=d.map(U),e[129]=d,e[130]=y);let x;return e[131]!==f||e[132]!==y?(x=(0,b.jsxs)(_,{gap:`gap-6`,children:[f,p,h,y]}),e[131]=f,e[132]=y,e[133]=x):x=e[133],x}function U(e){return(0,b.jsx)(B,{...e},e.title)}function W(e){return e.shortcut}function G(e){return e.shortcut}function K(e){return e.language}export{H as KeyboardShortcutsSettingsPanel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,t as a,u as ee}from"./chunk-QUQL4437-DXsxWP7r.js";import{t as o}from"./check-BODqo66o.js";import{n as s,r as c}from"./locale-store-GfSwnwIZ.js";import{a as l,i as u}from"./vendor-swr-BIWyz7Rc.js";import{$s as d,Bo as f,Cl as p,Cs as m,Fo as h,Fs as g,Io as _,Jl as v,Ka as y,Lo as b,Ml as x,No as S,Ol as te,Po as ne,Ps as re,Ra as ie,Ro as ae,Uc as C,Wl as w,Ys as oe,_c as se,bu as ce,dl as le,fc as ue,jo as de,kc as fe,lo as T,nt as pe,tu as me,uc as he,vc as ge,ys as E,zc as D,zo as _e}from"./index-apLU0Hun.js";import{a as ve,c as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./api-CwL38LEV.js";var O=e(t(),1),Ee=`build-xopc-local-app`;function De(e){return(e.routing?.agentId??e.agentId??``).trim().toLowerCase()}function Oe(e){return e.find(e=>De(e)===`coder`)??null}function ke(e,t){let n=new URLSearchParams({skill:Ee}),r=t?.trim();return r&&n.set(`draft`,r),`/chat/${encodeURIComponent(e)}?${n.toString()}`}var k=new Set([`document`,`content`,`interaction`,`criteria`]),Ae=new Set([`passed`,`failed`,`skipped`]);function je(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.source!==`xopc-local-app-preview`||t.version!==1)return null;if(t.type===`ready`)return{type:`ready`,detail:{}};if(t.type===`criteria`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.scenarios)||e.scenarios.length>10)return null;let n=e.scenarios.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||!t.id.trim()||t.id.length>80||typeof t.name!=`string`||!t.name.trim()||t.name.length>120||t.status!==`passed`&&t.status!==`failed`||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,name:t.name,status:t.status,message:t.message.slice(0,500)}});if(n.some(e=>e===null))return null;let r=typeof e.scenarioCount==`number`&&Number.isInteger(e.scenarioCount)&&e.scenarioCount>=0&&e.scenarioCount<=10?e.scenarioCount:n.length;return{type:`criteria`,detail:{status:e.status,scenarioCount:r,scenarios:n}}}if(t.type===`acceptance`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.checks))return null;let n=e.checks.slice(0,10).map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return!k.has(t.id)||!Ae.has(t.status)||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,status:t.status,message:t.message.slice(0,500)}});if(!n.length||n.some(e=>e===null))return null;let r=typeof e.interactiveCount==`number`&&Number.isFinite(e.interactiveCount)&&e.interactiveCount>=0?Math.min(Math.floor(e.interactiveCount),1e4):0;return{type:`acceptance`,detail:{status:e.status,checks:n,interactiveCount:r}}}if(t.type!==`error`||!t.detail||typeof t.detail!=`object`)return null;let n=t.detail;return n.kind!==`script_error`&&n.kind!==`unhandled_rejection`||typeof n.message!=`string`||!n.message.trim()?null:{type:`error`,detail:{kind:n.kind,message:n.message.slice(0,500),filename:typeof n.filename==`string`?n.filename.slice(0,500):void 0,line:typeof n.line==`number`?n.line:void 0,column:typeof n.column==`number`?n.column:void 0}}}function Me(e){return e?.checks.filter(e=>e.status===`failed`).map(e=>e.message)??[]}function Ne(e){let t=e.filename?` (${e.filename}${e.line?`:${e.line}${e.column?`:${e.column}`:``}`:``})`:``;return`${e.message}${t}`}var Pe=Object.freeze({source:`xopc-local-app-host`,version:1,type:`connect`});function Fe(e,t){let n=null,r=()=>{n?.close();let r=new MessageChannel;n=r.port1,n.onmessage=e=>t(e.data),n.start(),e.contentWindow?.postMessage(Pe,`*`,[r.port2])};return e.addEventListener(`load`,r),()=>{e.removeEventListener(`load`,r),n?.close()}}var Ie=n(),A=r();function Le(e){let t=(0,Ie.c)(36),{scenarios:n,results:r,runningTarget:i,zh:a,onRunAll:ee,onRunScenario:o,onAskCoder:s}=e;if(!n.length)return null;let c=a?`产品场景`:`Product scenarios`,l;t[0]===c?l=t[1]:(l=(0,A.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:c}),t[0]=c,t[1]=l);let u=a?`${n.length} 个关键用户路径`:`${n.length} critical user journey${n.length===1?``:`s`}`,d;t[2]===u?d=t[3]:(d=(0,A.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:u}),t[2]=u,t[3]=d);let f;t[4]!==l||t[5]!==d?(f=(0,A.jsxs)(`div`,{children:[l,d]}),t[4]=l,t[5]=d,t[6]=f):f=t[6];let p=i!==null,m;t[7]===i?m=t[8]:(m=i===`all`?(0,A.jsx)(C,{className:`size-3 animate-spin`}):(0,A.jsx)(ue,{className:`size-3`}),t[7]=i,t[8]=m);let h=a?`全部重跑`:`Run all`,g;t[9]!==ee||t[10]!==p||t[11]!==m||t[12]!==h?(g=(0,A.jsxs)(E,{variant:`ghost`,className:`h-7 rounded-lg px-2 text-[11px]`,onClick:ee,disabled:p,children:[m,h]}),t[9]=ee,t[10]=p,t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==f||t[15]!==g?(_=(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[f,g]}),t[14]=f,t[15]=g,t[16]=_):_=t[16];let y=a?`产品场景验收结果`:`Product scenario acceptance results`,b;if(t[17]!==s||t[18]!==o||t[19]!==r||t[20]!==i||t[21]!==n||t[22]!==a){let e;t[24]!==s||t[25]!==o||t[26]!==r||t[27]!==i||t[28]!==a?(e=e=>{let t=r[e.id],n=i===`all`||i===e.id?`running`:t?.status??`pending`;return(0,A.jsx)(`li`,{className:`py-2.5 first:pt-1`,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(`span`,{className:`mt-0.5 shrink-0`,"aria-hidden":!0,children:n===`running`?(0,A.jsx)(C,{className:`size-3.5 animate-spin text-accent`}):n===`passed`?(0,A.jsx)(me,{className:`size-3.5 text-success`}):n===`failed`?(0,A.jsx)(v,{className:`size-3.5 text-danger`}):(0,A.jsx)(w,{className:`size-3.5 text-fg-subtle`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate text-[11px] font-medium text-fg`,children:e.name}),(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] text-fg-subtle`,children:a?`${e.stepCount} 个步骤`:`${e.stepCount} step${e.stepCount===1?``:`s`}`})]}),(0,A.jsx)(E,{variant:`ghost`,className:`size-7 shrink-0 rounded-lg p-0`,onClick:()=>o(e.id),disabled:i!==null,"aria-label":a?`重跑${e.name}`:`Rerun ${e.name}`,title:a?`单独重跑`:`Rerun scenario`,children:(0,A.jsx)(ue,{className:`size-3`})})]}),n===`running`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`正在隔离预览中执行…`:`Running in an isolated preview…`}):t?.status===`failed`?(0,A.jsxs)(`div`,{className:`mt-1.5`,children:[(0,A.jsx)(`p`,{className:`text-[11px] leading-4 text-danger`,children:t.message}),(0,A.jsxs)(E,{variant:`ghost`,className:`mt-1 h-7 rounded-lg px-2 text-[11px] text-danger hover:text-danger`,onClick:()=>s(e,t),children:[(0,A.jsx)(D,{className:`size-3`}),a?`让 Coder 修复`:`Ask Coder to fix`]})]}):t?.status===`passed`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`场景已通过`:`Scenario passed`}):(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`等待运行`:`Waiting to run`})]})]})},e.id)},t[24]=s,t[25]=o,t[26]=r,t[27]=i,t[28]=a,t[29]=e):e=t[29],b=n.map(e),t[17]=s,t[18]=o,t[19]=r,t[20]=i,t[21]=n,t[22]=a,t[23]=b}else b=t[23];let x;t[30]!==y||t[31]!==b?(x=(0,A.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,"aria-label":y,children:b}),t[30]=y,t[31]=b,t[32]=x):x=t[32];let S;return t[33]!==_||t[34]!==x?(S=(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[_,x]}),t[33]=_,t[34]=x,t[35]=S):S=t[35],S}function Re(e,t){return pe(e,t)}function ze(e,t,n){return!!(t&&n&&e.sourceHash===t&&e.status===n.status&&e.interactiveCount===n.interactiveCount&&JSON.stringify(e.checks)===JSON.stringify(n.checks))}function j(){let{appId:e}=ee(),t=e===`new`,n=s(e=>e.language)===`zh`,r=s(e=>e.language),v=i(),{mutate:w}=l(),pe=de(e=>e.moveToFront),Ee=f(e=>e.setPageHeader),De=f(e=>e.clearPageHeader),{data:k,isLoading:Ae,error:Pe,mutate:Ie}=u(!t&&e?[`local-app`,e]:null,()=>xe(e)),{data:j,isLoading:Be,mutate:M}=u(!t&&e?[`local-app-validation`,e]:null,()=>be(e)),[Ve,He]=(0,O.useState)(``),[Ue,We]=(0,O.useState)(``),[N,P]=(0,O.useState)(!1),[F,I]=(0,O.useState)(null),[Ge,Ke]=(0,O.useState)(!1),[qe,Je]=(0,O.useState)(!1),[L,Ye]=(0,O.useState)(0),[Xe,Ze]=(0,O.useState)(``),[R,Qe]=(0,O.useState)(!1),[z,$e]=(0,O.useState)(!1),[B,V]=(0,O.useState)(`booting`),[et,tt]=(0,O.useState)(null),[H,nt]=(0,O.useState)(null),[rt,it]=(0,O.useState)({}),[U,W]=(0,O.useState)(`all`),[at,ot]=(0,O.useState)(0),[st,ct]=(0,O.useState)(null),[G,lt]=(0,O.useState)(null),[ut,dt]=(0,O.useState)([]),[ft,pt]=(0,O.useState)(!1),mt=(0,O.useRef)(new Set),K=(0,O.useRef)(null),ht=(0,O.useRef)(null),gt=(0,O.useRef)(null),q=(0,O.useRef)(null),J=(0,O.useRef)(``),Y=j?.acceptanceScenarios??[],X=(0,O.useMemo)(()=>{if(!Y.length)return null;let e=Y.map(e=>rt[e.id]).filter(e=>!!e);return e.length===Y.length?{status:e.some(e=>e.status===`failed`)?`failed`:`passed`,scenarioCount:Y.length,scenarios:e}:null},[Y,rt]),Z=(0,O.useMemo)(()=>{if(!H)return null;if(!j?.acceptanceScenarioCount)return H;if(!X)return null;let e=X.scenarios.find(e=>e.status===`failed`),t={id:`criteria`,status:X.status,message:e?`${e.name}: ${e.message}`:`${X.scenarioCount} product scenario(s) passed`},n=[...H.checks,t];return{status:n.some(e=>e.status===`failed`)?`failed`:`passed`,checks:n,interactiveCount:H.interactiveCount}},[H,X,j?.acceptanceScenarioCount]),_t=(0,O.useCallback)(async(e,t)=>{let n=Oe(await y(e.projectId))??await ie(e.projectId,`coder`);mt.current.add(n.key),v(ke(n.key,t))},[v]),vt=(0,O.useCallback)(async(e=!0)=>{if(!k)return null;$e(!0);try{let t=await be(k.id);return await M(t,{revalidate:!1}),e&&(q.current=t.sourceHash??null,W(`all`),Ye(e=>e+1)),t}catch(e){return I(e instanceof Error?e.message:String(e)),null}finally{$e(!1)}},[k,M]);(0,O.useEffect)(()=>{if(!k)return;let e=!1;y(k.projectId).then(t=>{e||(mt.current=new Set(t.filter(e=>(e.routing?.agentId??e.agentId)?.toLowerCase()===`coder`).map(e=>e.key)))}).catch(()=>{});let t=e=>{let t=e.detail?.key;!t||!mt.current.has(t)||(K.current!==null&&window.clearTimeout(K.current),K.current=window.setTimeout(()=>{K.current=null,vt(!0)},750))};return window.addEventListener(`session-transcript-updated`,t),()=>{e=!0,window.removeEventListener(`session-transcript-updated`,t),K.current!==null&&window.clearTimeout(K.current)}},[k,vt]),(0,O.useEffect)(()=>{dt(k?.acceptanceRuns??[])},[k?.acceptanceRuns]),(0,O.useEffect)(()=>{q.current=null},[k?.id]),(0,O.useEffect)(()=>{!j?.sourceHash||q.current||(q.current=j.sourceHash,W(`all`),Ye(e=>e+1))},[j?.sourceHash]),(0,O.useLayoutEffect)(()=>{if(!k)return;V(`booting`),tt(null),nt(null),lt(null),pt(!1),J.current=``;let e=window.setTimeout(()=>V(e=>e===`failed`?e:`timeout`),7e3),t=ht.current?Fe(ht.current,t=>{let n=je(t);if(n){if(n.type===`ready`){V(e=>e===`failed`?e:`healthy`);return}if(n.type===`acceptance`){window.clearTimeout(e),nt(n.detail),lt(q.current);return}n.type!==`criteria`&&(window.clearTimeout(e),tt(n.detail),V(`failed`))}}):()=>{};return()=>{window.clearTimeout(e),t()}},[k,L]),(0,O.useLayoutEffect)(()=>{if(!k||j?.status!==`healthy`||!Y.length){ct(null);return}let e=U===`all`?Y:Y.filter(e=>e.id===U);if(!e.length)return;ct(U),it(e=>{if(U===`all`)return{};let t={...e};return delete t[U],t});let t=t=>{it(n=>{let r={...n};for(let n of e)r[n.id]={id:n.id,name:n.name,status:`failed`,message:t};return r}),ct(null)},r=window.setTimeout(()=>t(n?`场景在 10 秒内未完成。`:`Scenario did not finish within 10 seconds.`),1e4),i=gt.current?Fe(gt.current,e=>{let n=je(e);n&&(n.type===`criteria`?(window.clearTimeout(r),it(e=>{let t={...e};for(let e of n.detail.scenarios)(t[e.id]?.status!==`failed`||e.status===`failed`)&&(t[e.id]=e);return t}),ct(null)):n.type===`error`&&(window.clearTimeout(r),t(Ne(n.detail))))}):()=>{};return()=>{window.clearTimeout(r),i()}},[Y,k,at,U,L,j?.status,n]),(0,O.useEffect)(()=>{if(!k||!Z||!G||G!==j?.sourceHash)return;let e=`${k.id}:${G}:${JSON.stringify(Z)}`;J.current!==e&&(J.current=e,pt(!0),ve(k.id,G,Z).then(t=>{J.current===e&&dt(e=>[t,...e.filter(e=>e.id!==t.id)].toSorted((e,t)=>t.createdAt-e.createdAt).slice(0,20))}).catch(t=>{J.current===e&&(J.current=``,I(t instanceof Error?t.message:String(t)))}).finally(()=>{J.current===e&&pt(!1)}))},[Z,G,k,j?.sourceHash]);let Q=(0,O.useCallback)(async e=>{if(k){Qe(!0),I(null);try{await _t(k,e)}catch(e){I(e instanceof Error?e.message:String(e)),Qe(!1)}}},[k,_t]);(0,O.useLayoutEffect)(()=>(Ee({startExtra:(0,A.jsx)(a,{to:`/local-apps`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`返回本地应用`:`Back to local apps`,children:(0,A.jsx)(ce,{className:`size-4`})}),main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:k?.name||(n?`创建本地应用`:`Create local app`)}),end:k?(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(E,{asChild:!0,variant:`ghost`,className:`h-9`,children:(0,A.jsxs)(a,{to:`/projects/${encodeURIComponent(k.projectId)}`,children:[(0,A.jsx)(p,{className:`size-4`}),`Project`]})}),(0,A.jsxs)(E,{className:`h-9`,onClick:()=>void Q(),disabled:R,children:[R?(0,A.jsx)(C,{className:`size-4 animate-spin`}):(0,A.jsx)(D,{className:`size-4`}),n?`继续开发`:`Continue building`]})]}):null}),()=>De()),[k,R,De,Q,Ee,n]);async function yt(e){e.preventDefault(),P(!0),I(null);try{let e=await Te({name:Ve,idea:Ue});await w(`local-apps-list`);let t=n?`请基于 APP_BRIEF.md 完成这个本地应用的首版。先检查现有草稿,再实现最小可用版本并运行校验;完成后告诉我可以如何预览。`:`Build the first usable version of this local app from APP_BRIEF.md. Inspect the existing draft, implement the smallest useful version, run validation, and tell me how to preview it.`;try{await _t(e,t)}catch{v(`/local-apps/${encodeURIComponent(e.id)}`,{replace:!0})}}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}async function bt(){if(k){P(!0),I(null);try{let e=await Ce(k.id);await Ie(e,{revalidate:!1}),await M(),await Promise.all([w(`local-apps-list`),w(`gateway-extensions-list`)]),pe(`ext:${e.extensionId}:app`),Ke(!1)}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}}async function xt(e,t=!1){P(!0),I(null);try{let n=await e();return await Ie(n,{revalidate:!1}),await M(),await Promise.all([w(`local-apps-list`),w(`gateway-extensions-list`)]),t&&pe(`ext:${n.extensionId}:app`),!0}catch(e){return I(e instanceof Error?e.message:String(e)),!1}finally{P(!1)}}async function St(e){k&&await xt(()=>we(k.id,e),e)}async function Ct(e){k&&await xt(()=>Se(k.id,e),!0)}async function wt(){k&&await xt(()=>ye(k.id))&&Je(!1)}function Tt(){let e=[...j?.issues.map(e=>e.message)??[],...et?[Ne(et)]:[],...Me(Z),...Object.values(rt).filter(e=>e.status===`failed`).map(e=>`${e.name}: ${e.message}`),...B===`timeout`?[n?`预览在 7 秒内未完成启动,可能存在白屏或阻塞。`:`The preview did not finish booting within 7 seconds and may be blank or blocked.`]:[]];if(!e.length)return;let t=e.map(e=>`- ${e}`).join(`
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{l as i,t as a,u as ee}from"./chunk-QUQL4437-DXsxWP7r.js";import{t as o}from"./check-BODqo66o.js";import{n as s,r as c}from"./locale-store-GfSwnwIZ.js";import{a as l,i as u}from"./vendor-swr-BIWyz7Rc.js";import{$s as d,Bo as f,Cl as p,Cs as m,Fo as h,Fs as g,Io as _,Jl as v,Ka as y,Lo as b,Ml as x,No as S,Ol as te,Po as ne,Ps as re,Ra as ie,Ro as ae,Uc as C,Wl as w,Ys as oe,_c as se,bu as ce,dl as le,fc as ue,jo as de,kc as fe,lo as T,nt as pe,tu as me,uc as he,vc as ge,ys as E,zc as D,zo as _e}from"./index-DSydVlxZ.js";import{a as ve,c as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./api-CwL38LEV.js";var O=e(t(),1),Ee=`build-xopc-local-app`;function De(e){return(e.routing?.agentId??e.agentId??``).trim().toLowerCase()}function Oe(e){return e.find(e=>De(e)===`coder`)??null}function ke(e,t){let n=new URLSearchParams({skill:Ee}),r=t?.trim();return r&&n.set(`draft`,r),`/chat/${encodeURIComponent(e)}?${n.toString()}`}var k=new Set([`document`,`content`,`interaction`,`criteria`]),Ae=new Set([`passed`,`failed`,`skipped`]);function je(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.source!==`xopc-local-app-preview`||t.version!==1)return null;if(t.type===`ready`)return{type:`ready`,detail:{}};if(t.type===`criteria`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.scenarios)||e.scenarios.length>10)return null;let n=e.scenarios.map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||!t.id.trim()||t.id.length>80||typeof t.name!=`string`||!t.name.trim()||t.name.length>120||t.status!==`passed`&&t.status!==`failed`||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,name:t.name,status:t.status,message:t.message.slice(0,500)}});if(n.some(e=>e===null))return null;let r=typeof e.scenarioCount==`number`&&Number.isInteger(e.scenarioCount)&&e.scenarioCount>=0&&e.scenarioCount<=10?e.scenarioCount:n.length;return{type:`criteria`,detail:{status:e.status,scenarioCount:r,scenarios:n}}}if(t.type===`acceptance`&&t.detail&&typeof t.detail==`object`){let e=t.detail;if(e.status!==`passed`&&e.status!==`failed`||!Array.isArray(e.checks))return null;let n=e.checks.slice(0,10).map(e=>{if(!e||typeof e!=`object`)return null;let t=e;return!k.has(t.id)||!Ae.has(t.status)||typeof t.message!=`string`||!t.message.trim()?null:{id:t.id,status:t.status,message:t.message.slice(0,500)}});if(!n.length||n.some(e=>e===null))return null;let r=typeof e.interactiveCount==`number`&&Number.isFinite(e.interactiveCount)&&e.interactiveCount>=0?Math.min(Math.floor(e.interactiveCount),1e4):0;return{type:`acceptance`,detail:{status:e.status,checks:n,interactiveCount:r}}}if(t.type!==`error`||!t.detail||typeof t.detail!=`object`)return null;let n=t.detail;return n.kind!==`script_error`&&n.kind!==`unhandled_rejection`||typeof n.message!=`string`||!n.message.trim()?null:{type:`error`,detail:{kind:n.kind,message:n.message.slice(0,500),filename:typeof n.filename==`string`?n.filename.slice(0,500):void 0,line:typeof n.line==`number`?n.line:void 0,column:typeof n.column==`number`?n.column:void 0}}}function Me(e){return e?.checks.filter(e=>e.status===`failed`).map(e=>e.message)??[]}function Ne(e){let t=e.filename?` (${e.filename}${e.line?`:${e.line}${e.column?`:${e.column}`:``}`:``})`:``;return`${e.message}${t}`}var Pe=Object.freeze({source:`xopc-local-app-host`,version:1,type:`connect`});function Fe(e,t){let n=null,r=()=>{n?.close();let r=new MessageChannel;n=r.port1,n.onmessage=e=>t(e.data),n.start(),e.contentWindow?.postMessage(Pe,`*`,[r.port2])};return e.addEventListener(`load`,r),()=>{e.removeEventListener(`load`,r),n?.close()}}var Ie=n(),A=r();function Le(e){let t=(0,Ie.c)(36),{scenarios:n,results:r,runningTarget:i,zh:a,onRunAll:ee,onRunScenario:o,onAskCoder:s}=e;if(!n.length)return null;let c=a?`产品场景`:`Product scenarios`,l;t[0]===c?l=t[1]:(l=(0,A.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:c}),t[0]=c,t[1]=l);let u=a?`${n.length} 个关键用户路径`:`${n.length} critical user journey${n.length===1?``:`s`}`,d;t[2]===u?d=t[3]:(d=(0,A.jsx)(`p`,{className:`mt-0.5 text-[11px] text-fg-subtle`,children:u}),t[2]=u,t[3]=d);let f;t[4]!==l||t[5]!==d?(f=(0,A.jsxs)(`div`,{children:[l,d]}),t[4]=l,t[5]=d,t[6]=f):f=t[6];let p=i!==null,m;t[7]===i?m=t[8]:(m=i===`all`?(0,A.jsx)(C,{className:`size-3 animate-spin`}):(0,A.jsx)(ue,{className:`size-3`}),t[7]=i,t[8]=m);let h=a?`全部重跑`:`Run all`,g;t[9]!==ee||t[10]!==p||t[11]!==m||t[12]!==h?(g=(0,A.jsxs)(E,{variant:`ghost`,className:`h-7 rounded-lg px-2 text-[11px]`,onClick:ee,disabled:p,children:[m,h]}),t[9]=ee,t[10]=p,t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==f||t[15]!==g?(_=(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[f,g]}),t[14]=f,t[15]=g,t[16]=_):_=t[16];let y=a?`产品场景验收结果`:`Product scenario acceptance results`,b;if(t[17]!==s||t[18]!==o||t[19]!==r||t[20]!==i||t[21]!==n||t[22]!==a){let e;t[24]!==s||t[25]!==o||t[26]!==r||t[27]!==i||t[28]!==a?(e=e=>{let t=r[e.id],n=i===`all`||i===e.id?`running`:t?.status??`pending`;return(0,A.jsx)(`li`,{className:`py-2.5 first:pt-1`,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(`span`,{className:`mt-0.5 shrink-0`,"aria-hidden":!0,children:n===`running`?(0,A.jsx)(C,{className:`size-3.5 animate-spin text-accent`}):n===`passed`?(0,A.jsx)(me,{className:`size-3.5 text-success`}):n===`failed`?(0,A.jsx)(v,{className:`size-3.5 text-danger`}):(0,A.jsx)(w,{className:`size-3.5 text-fg-subtle`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate text-[11px] font-medium text-fg`,children:e.name}),(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] text-fg-subtle`,children:a?`${e.stepCount} 个步骤`:`${e.stepCount} step${e.stepCount===1?``:`s`}`})]}),(0,A.jsx)(E,{variant:`ghost`,className:`size-7 shrink-0 rounded-lg p-0`,onClick:()=>o(e.id),disabled:i!==null,"aria-label":a?`重跑${e.name}`:`Rerun ${e.name}`,title:a?`单独重跑`:`Rerun scenario`,children:(0,A.jsx)(ue,{className:`size-3`})})]}),n===`running`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`正在隔离预览中执行…`:`Running in an isolated preview…`}):t?.status===`failed`?(0,A.jsxs)(`div`,{className:`mt-1.5`,children:[(0,A.jsx)(`p`,{className:`text-[11px] leading-4 text-danger`,children:t.message}),(0,A.jsxs)(E,{variant:`ghost`,className:`mt-1 h-7 rounded-lg px-2 text-[11px] text-danger hover:text-danger`,onClick:()=>s(e,t),children:[(0,A.jsx)(D,{className:`size-3`}),a?`让 Coder 修复`:`Ask Coder to fix`]})]}):t?.status===`passed`?(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`场景已通过`:`Scenario passed`}):(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-fg-muted`,children:a?`等待运行`:`Waiting to run`})]})]})},e.id)},t[24]=s,t[25]=o,t[26]=r,t[27]=i,t[28]=a,t[29]=e):e=t[29],b=n.map(e),t[17]=s,t[18]=o,t[19]=r,t[20]=i,t[21]=n,t[22]=a,t[23]=b}else b=t[23];let x;t[30]!==y||t[31]!==b?(x=(0,A.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,"aria-label":y,children:b}),t[30]=y,t[31]=b,t[32]=x):x=t[32];let S;return t[33]!==_||t[34]!==x?(S=(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[_,x]}),t[33]=_,t[34]=x,t[35]=S):S=t[35],S}function Re(e,t){return pe(e,t)}function ze(e,t,n){return!!(t&&n&&e.sourceHash===t&&e.status===n.status&&e.interactiveCount===n.interactiveCount&&JSON.stringify(e.checks)===JSON.stringify(n.checks))}function j(){let{appId:e}=ee(),t=e===`new`,n=s(e=>e.language)===`zh`,r=s(e=>e.language),v=i(),{mutate:w}=l(),pe=de(e=>e.moveToFront),Ee=f(e=>e.setPageHeader),De=f(e=>e.clearPageHeader),{data:k,isLoading:Ae,error:Pe,mutate:Ie}=u(!t&&e?[`local-app`,e]:null,()=>xe(e)),{data:j,isLoading:Be,mutate:M}=u(!t&&e?[`local-app-validation`,e]:null,()=>be(e)),[Ve,He]=(0,O.useState)(``),[Ue,We]=(0,O.useState)(``),[N,P]=(0,O.useState)(!1),[F,I]=(0,O.useState)(null),[Ge,Ke]=(0,O.useState)(!1),[qe,Je]=(0,O.useState)(!1),[L,Ye]=(0,O.useState)(0),[Xe,Ze]=(0,O.useState)(``),[R,Qe]=(0,O.useState)(!1),[z,$e]=(0,O.useState)(!1),[B,V]=(0,O.useState)(`booting`),[et,tt]=(0,O.useState)(null),[H,nt]=(0,O.useState)(null),[rt,it]=(0,O.useState)({}),[U,W]=(0,O.useState)(`all`),[at,ot]=(0,O.useState)(0),[st,ct]=(0,O.useState)(null),[G,lt]=(0,O.useState)(null),[ut,dt]=(0,O.useState)([]),[ft,pt]=(0,O.useState)(!1),mt=(0,O.useRef)(new Set),K=(0,O.useRef)(null),ht=(0,O.useRef)(null),gt=(0,O.useRef)(null),q=(0,O.useRef)(null),J=(0,O.useRef)(``),Y=j?.acceptanceScenarios??[],X=(0,O.useMemo)(()=>{if(!Y.length)return null;let e=Y.map(e=>rt[e.id]).filter(e=>!!e);return e.length===Y.length?{status:e.some(e=>e.status===`failed`)?`failed`:`passed`,scenarioCount:Y.length,scenarios:e}:null},[Y,rt]),Z=(0,O.useMemo)(()=>{if(!H)return null;if(!j?.acceptanceScenarioCount)return H;if(!X)return null;let e=X.scenarios.find(e=>e.status===`failed`),t={id:`criteria`,status:X.status,message:e?`${e.name}: ${e.message}`:`${X.scenarioCount} product scenario(s) passed`},n=[...H.checks,t];return{status:n.some(e=>e.status===`failed`)?`failed`:`passed`,checks:n,interactiveCount:H.interactiveCount}},[H,X,j?.acceptanceScenarioCount]),_t=(0,O.useCallback)(async(e,t)=>{let n=Oe(await y(e.projectId))??await ie(e.projectId,`coder`);mt.current.add(n.key),v(ke(n.key,t))},[v]),vt=(0,O.useCallback)(async(e=!0)=>{if(!k)return null;$e(!0);try{let t=await be(k.id);return await M(t,{revalidate:!1}),e&&(q.current=t.sourceHash??null,W(`all`),Ye(e=>e+1)),t}catch(e){return I(e instanceof Error?e.message:String(e)),null}finally{$e(!1)}},[k,M]);(0,O.useEffect)(()=>{if(!k)return;let e=!1;y(k.projectId).then(t=>{e||(mt.current=new Set(t.filter(e=>(e.routing?.agentId??e.agentId)?.toLowerCase()===`coder`).map(e=>e.key)))}).catch(()=>{});let t=e=>{let t=e.detail?.key;!t||!mt.current.has(t)||(K.current!==null&&window.clearTimeout(K.current),K.current=window.setTimeout(()=>{K.current=null,vt(!0)},750))};return window.addEventListener(`session-transcript-updated`,t),()=>{e=!0,window.removeEventListener(`session-transcript-updated`,t),K.current!==null&&window.clearTimeout(K.current)}},[k,vt]),(0,O.useEffect)(()=>{dt(k?.acceptanceRuns??[])},[k?.acceptanceRuns]),(0,O.useEffect)(()=>{q.current=null},[k?.id]),(0,O.useEffect)(()=>{!j?.sourceHash||q.current||(q.current=j.sourceHash,W(`all`),Ye(e=>e+1))},[j?.sourceHash]),(0,O.useLayoutEffect)(()=>{if(!k)return;V(`booting`),tt(null),nt(null),lt(null),pt(!1),J.current=``;let e=window.setTimeout(()=>V(e=>e===`failed`?e:`timeout`),7e3),t=ht.current?Fe(ht.current,t=>{let n=je(t);if(n){if(n.type===`ready`){V(e=>e===`failed`?e:`healthy`);return}if(n.type===`acceptance`){window.clearTimeout(e),nt(n.detail),lt(q.current);return}n.type!==`criteria`&&(window.clearTimeout(e),tt(n.detail),V(`failed`))}}):()=>{};return()=>{window.clearTimeout(e),t()}},[k,L]),(0,O.useLayoutEffect)(()=>{if(!k||j?.status!==`healthy`||!Y.length){ct(null);return}let e=U===`all`?Y:Y.filter(e=>e.id===U);if(!e.length)return;ct(U),it(e=>{if(U===`all`)return{};let t={...e};return delete t[U],t});let t=t=>{it(n=>{let r={...n};for(let n of e)r[n.id]={id:n.id,name:n.name,status:`failed`,message:t};return r}),ct(null)},r=window.setTimeout(()=>t(n?`场景在 10 秒内未完成。`:`Scenario did not finish within 10 seconds.`),1e4),i=gt.current?Fe(gt.current,e=>{let n=je(e);n&&(n.type===`criteria`?(window.clearTimeout(r),it(e=>{let t={...e};for(let e of n.detail.scenarios)(t[e.id]?.status!==`failed`||e.status===`failed`)&&(t[e.id]=e);return t}),ct(null)):n.type===`error`&&(window.clearTimeout(r),t(Ne(n.detail))))}):()=>{};return()=>{window.clearTimeout(r),i()}},[Y,k,at,U,L,j?.status,n]),(0,O.useEffect)(()=>{if(!k||!Z||!G||G!==j?.sourceHash)return;let e=`${k.id}:${G}:${JSON.stringify(Z)}`;J.current!==e&&(J.current=e,pt(!0),ve(k.id,G,Z).then(t=>{J.current===e&&dt(e=>[t,...e.filter(e=>e.id!==t.id)].toSorted((e,t)=>t.createdAt-e.createdAt).slice(0,20))}).catch(t=>{J.current===e&&(J.current=``,I(t instanceof Error?t.message:String(t)))}).finally(()=>{J.current===e&&pt(!1)}))},[Z,G,k,j?.sourceHash]);let Q=(0,O.useCallback)(async e=>{if(k){Qe(!0),I(null);try{await _t(k,e)}catch(e){I(e instanceof Error?e.message:String(e)),Qe(!1)}}},[k,_t]);(0,O.useLayoutEffect)(()=>(Ee({startExtra:(0,A.jsx)(a,{to:`/local-apps`,className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`返回本地应用`:`Back to local apps`,children:(0,A.jsx)(ce,{className:`size-4`})}),main:(0,A.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:k?.name||(n?`创建本地应用`:`Create local app`)}),end:k?(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(E,{asChild:!0,variant:`ghost`,className:`h-9`,children:(0,A.jsxs)(a,{to:`/projects/${encodeURIComponent(k.projectId)}`,children:[(0,A.jsx)(p,{className:`size-4`}),`Project`]})}),(0,A.jsxs)(E,{className:`h-9`,onClick:()=>void Q(),disabled:R,children:[R?(0,A.jsx)(C,{className:`size-4 animate-spin`}):(0,A.jsx)(D,{className:`size-4`}),n?`继续开发`:`Continue building`]})]}):null}),()=>De()),[k,R,De,Q,Ee,n]);async function yt(e){e.preventDefault(),P(!0),I(null);try{let e=await Te({name:Ve,idea:Ue});await w(`local-apps-list`);let t=n?`请基于 APP_BRIEF.md 完成这个本地应用的首版。先检查现有草稿,再实现最小可用版本并运行校验;完成后告诉我可以如何预览。`:`Build the first usable version of this local app from APP_BRIEF.md. Inspect the existing draft, implement the smallest useful version, run validation, and tell me how to preview it.`;try{await _t(e,t)}catch{v(`/local-apps/${encodeURIComponent(e.id)}`,{replace:!0})}}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}async function bt(){if(k){P(!0),I(null);try{let e=await Ce(k.id);await Ie(e,{revalidate:!1}),await M(),await Promise.all([w(`local-apps-list`),w(`gateway-extensions-list`)]),pe(`ext:${e.extensionId}:app`),Ke(!1)}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}}async function xt(e,t=!1){P(!0),I(null);try{let n=await e();return await Ie(n,{revalidate:!1}),await M(),await Promise.all([w(`local-apps-list`),w(`gateway-extensions-list`)]),t&&pe(`ext:${n.extensionId}:app`),!0}catch(e){return I(e instanceof Error?e.message:String(e)),!1}finally{P(!1)}}async function St(e){k&&await xt(()=>we(k.id,e),e)}async function Ct(e){k&&await xt(()=>Se(k.id,e),!0)}async function wt(){k&&await xt(()=>ye(k.id))&&Je(!1)}function Tt(){let e=[...j?.issues.map(e=>e.message)??[],...et?[Ne(et)]:[],...Me(Z),...Object.values(rt).filter(e=>e.status===`failed`).map(e=>`${e.name}: ${e.message}`),...B===`timeout`?[n?`预览在 7 秒内未完成启动,可能存在白屏或阻塞。`:`The preview did not finish booting within 7 seconds and may be blank or blocked.`]:[]];if(!e.length)return;let t=e.map(e=>`- ${e}`).join(`
|
|
2
2
|
`);Q(n?`请修复当前本地应用草稿的校验问题,保持扩展 ID 和已安装版本不变。修复后运行完整校验。\n\n${t}`:`Fix the current local-app draft validation issues without changing the extension id or installed release. Run the full validation afterward.\n\n${t}`)}function Et(){W(`all`),ot(e=>e+1)}function Dt(e){W(e),ot(e=>e+1)}function Ot(e,t){Q(n?`请修复本地应用的产品场景“${e.name}”。当前失败信息:${t.message}\n\n保持扩展 ID 和场景原意不变;优先修复应用行为,不要通过弱化断言来绕过问题。修复后运行完整校验。`:`Fix the local-app product scenario "${e.name}". Current failure: ${t.message}\n\nPreserve the extension id and the scenario intent. Fix the app behavior instead of weakening the assertion. Run the full validation afterward.`)}let kt=ut.findIndex(e=>ze(e,G,Z)),$=kt>=0?ut[kt]:null,At=kt>=0?ut[kt+1]??null:ut[0]??null,jt=Me(Z),Mt=(At?At.checks.filter(e=>e.status===`failed`).map(e=>e.message):[]).filter(e=>!jt.includes(e)).length;async function Nt(){let e=await vt(!1);if(e?.status===`healthy`&&e.sourceHash!==G){q.current=e.sourceHash??null,Ye(e=>e+1);return}e?.status===`healthy`&&B===`healthy`&&Z?.status===`passed`&&$&&$.sourceHash===e.sourceHash&&Ke(!0)}return t?(0,A.jsx)(`div`,{className:`flex min-h-0 flex-1 bg-surface-panel p-3 sm:p-5 xl:p-6`,children:(0,A.jsxs)(`div`,{className:`mx-auto grid w-full max-w-6xl overflow-hidden rounded-2xl border border-edge-subtle bg-surface-base shadow-surface lg:grid-cols-[minmax(280px,0.8fr)_minmax(0,1.5fr)]`,children:[(0,A.jsxs)(`form`,{onSubmit:yt,className:`flex flex-col border-b border-edge-subtle p-5 lg:border-b-0 lg:border-r`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-accent`,children:[(0,A.jsx)(oe,{className:`size-4`}),n?`告诉 Coder 你的想法`:`Tell Coder your idea`]}),(0,A.jsx)(`h2`,{className:`mt-4 text-xl font-semibold tracking-tight text-fg`,children:n?`你想创建什么?`:`What do you want to create?`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`我们会建立一个 Coder Project,并把应用上下文和开发 Skill 带入对话。`:`We will create a Coder Project and carry the app context and development skill into chat.`}),(0,A.jsxs)(`label`,{className:`mt-6 text-xs font-medium text-fg-muted`,children:[n?`应用名称`:`App name`,(0,A.jsx)(`input`,{value:Ve,onChange:e=>He(e.target.value),required:!0,className:`mt-2 w-full rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:阅读清单`:`e.g. Reading list`})]}),(0,A.jsxs)(`label`,{className:`mt-4 text-xs font-medium text-fg-muted`,children:[n?`描述你的想法`:`Describe your idea`,(0,A.jsx)(`textarea`,{value:Ue,onChange:e=>We(e.target.value),required:!0,rows:7,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`我想要一个可以记录待读文章、标记进度并按主题筛选的小工具…`:`I want a small tool that tracks articles, reading progress, and topics…`})]}),F?(0,A.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:F}):null,(0,A.jsxs)(E,{type:`submit`,variant:`primary`,className:`mt-5 h-10`,disabled:N||!Ve.trim()||!Ue.trim(),children:[N?(0,A.jsx)(C,{className:`size-4 animate-spin`}):(0,A.jsx)(D,{className:`size-4`}),n?`进入 Coder 对话`:`Continue with Coder`]})]}),(0,A.jsx)(`div`,{className:`hidden min-h-[620px] place-items-center bg-surface-panel p-8 lg:grid`,children:(0,A.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,A.jsx)(`div`,{className:`mx-auto flex size-16 items-center justify-center rounded-2xl border border-edge bg-surface-base text-accent shadow-surface`,children:(0,A.jsx)(fe,{className:`size-7`})}),(0,A.jsx)(`h3`,{className:`mt-5 text-base font-semibold text-fg`,children:n?`创建后,这里就是实时预览`:`Your live preview appears here`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n?`你可以先体验草稿,再决定是否把它添加到左侧导航。`:`Try the draft first, then decide whether to add it to the sidebar.`})]})})]})}):Ae?(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_260px]`,children:[(0,A.jsx)(T,{className:`rounded-xl`}),(0,A.jsx)(T,{className:`rounded-xl`}),(0,A.jsx)(T,{className:`rounded-xl`})]}):Pe||!k?(0,A.jsx)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:Pe instanceof Error?Pe.message:n?`找不到应用`:`App not found`}):(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-3 overflow-hidden bg-surface-panel p-3 lg:grid-cols-[280px_minmax(0,1fr)_300px]`,children:[(0,A.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.12em] text-accent`,children:[(0,A.jsx)(oe,{className:`size-4`}),n?`创作对话`:`Build conversation`]}),(0,A.jsx)(`div`,{className:`mt-4 rounded-xl bg-surface-panel p-3 text-sm leading-6 text-fg`,children:k.idea}),(0,A.jsxs)(`div`,{className:`mt-4 rounded-xl bg-accent-soft p-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium text-accent-fg`,children:[(0,A.jsx)(me,{className:`size-4`}),n?`草稿已准备好`:`Draft is ready`]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`继续迭代会进入对应 Project,由 Coder 读取应用上下文和专属 skill。`:`Continue in the Project where Coder has the app context and dedicated skill.`})]}),(0,A.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),Q(Xe)},children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-fg-muted`,htmlFor:`local-app-change-request`,children:n?`下一步想改什么?`:`What should change next?`}),(0,A.jsx)(`textarea`,{id:`local-app-change-request`,value:Xe,onChange:e=>Ze(e.target.value),rows:4,className:`mt-2 w-full resize-none rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm leading-6 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`,placeholder:n?`例如:增加月视图,并支持按标签筛选`:`e.g. Add a monthly view and tag filters`}),(0,A.jsxs)(E,{type:`submit`,className:`mt-2 w-full`,disabled:R||!Xe.trim(),children:[R?(0,A.jsx)(C,{className:`size-4 animate-spin`}):(0,A.jsx)(D,{className:`size-4`}),n?`让 Coder 修改`:`Ask Coder to update`]})]}),(0,A.jsxs)(E,{variant:`ghost`,className:`mt-2 w-full`,onClick:()=>void Q(),disabled:R,children:[(0,A.jsx)(p,{className:`size-4`}),n?`打开已有开发对话`:`Open development chat`]})]}),(0,A.jsxs)(`section`,{className:`flex min-h-0 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-base shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-edge-subtle px-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${j?.status===`failed`||B===`failed`||B===`timeout`||Z?.status===`failed`?`bg-danger`:j?.status===`healthy`&&B===`healthy`&&Z?.status===`passed`&&$?.sourceHash===j.sourceHash&&!ft?`bg-success`:`bg-fg-subtle`}`}),B===`failed`||B===`timeout`?n?`预览运行异常`:`Preview runtime issue`:j?.status===`failed`||Z?.status===`failed`?n?`自动验收未通过`:`Acceptance needs attention`:B===`booting`||!Z?n?`自动验收中`:`Running acceptance`:ft||$?.sourceHash!==j?.sourceHash?n?`正在保存验收快照`:`Saving acceptance snapshot`:n?`草稿已通过验收`:`Draft accepted`]}),(0,A.jsxs)(E,{variant:`ghost`,className:`h-8 px-2`,onClick:()=>void vt(!0),disabled:z,children:[z?(0,A.jsx)(C,{className:`size-3.5 animate-spin`}):(0,A.jsx)(ue,{className:`size-3.5`}),n?`重新验收`:`Run again`]})]}),(0,A.jsx)(`iframe`,{ref:ht,title:`${k.name} preview`,src:c(k.previewUrl),sandbox:`allow-scripts`,className:`min-h-0 w-full flex-1 bg-white`,onError:()=>{tt({kind:`script_error`,message:`Preview document failed to load`}),V(`failed`)}},L),j?.status===`healthy`&&j.acceptanceScenarioCount>0?(0,A.jsx)(`iframe`,{ref:gt,title:`${k.name} acceptance runner`,src:`${c(k.previewUrl)}?xopcAcceptance=1${U===`all`?``:`&xopcScenario=${encodeURIComponent(U)}`}`,sandbox:`allow-scripts`,"aria-hidden":`true`,tabIndex:-1,className:`pointer-events-none fixed left-[-200vw] top-0 h-[720px] w-[1024px] opacity-0`},`criteria-${L}-${at}`):null]}),(0,A.jsxs)(`aside`,{className:`min-h-0 overflow-y-auto rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n?`发布状态`:`Release status`}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:k.installationState===`not_installed`?n?`尚未安装`:`Not installed`:k.enabled?n?`版本 ${k.activeVersion} 正在使用`:`Version ${k.activeVersion} is active`:n?`已禁用,版本仍保留`:`Disabled, release retained`})]}),(0,A.jsx)(`span`,{className:`mt-1 size-2.5 rounded-full ${k.enabled?`bg-success`:`bg-fg-subtle`}`,"aria-hidden":!0})]}),(0,A.jsxs)(`dl`,{className:`mt-4 grid grid-cols-2 gap-3 text-xs`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`当前草稿`:`Draft`}),(0,A.jsxs)(`dd`,{className:`mt-1 font-medium text-fg`,children:[`v`,k.draftVersion]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`已安装`:`Installed`}),(0,A.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:k.activeVersion?`v${k.activeVersion}`:`—`})]})]}),(0,A.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(te,{className:`size-4 text-accent`}),n?`草稿检查`:`Draft checks`]}),Be||z?(0,A.jsx)(C,{className:`size-3.5 animate-spin text-fg-muted`}):j?.status===`healthy`?(0,A.jsx)(me,{className:`size-4 text-success`}):(0,A.jsx)(re,{className:`size-4 text-danger`})]}),j?(0,A.jsxs)(`div`,{className:`mt-2`,children:[(0,A.jsx)(`p`,{className:`text-xs leading-5 ${j.status===`healthy`?`text-fg-muted`:`text-danger`}`,children:j.status===`healthy`?j.hasDraftChanges?n?`${j.changedFileCount} 个文件有改动,可以安装新版本。`:`${j.changedFileCount} changed files are ready for a new release.`:n?`草稿与当前安装版本一致。`:`Draft matches the installed release.`:j.issues[0]?.message}),j.changedFiles.length?(0,A.jsx)(`ul`,{className:`mt-2 space-y-1`,children:j.changedFiles.slice(0,4).map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,j.changedFileCount>4?(0,A.jsx)(`p`,{className:`mt-1 text-[10px] text-fg-subtle`,children:n?`还有 ${j.changedFileCount-4} 个文件`:`${j.changedFileCount-4} more files`}):null,(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${B===`healthy`?`bg-success`:B===`booting`?`bg-fg-subtle`:`bg-danger`}`}),n?`预览运行`:`Preview runtime`]}),(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 ${B===`failed`||B===`timeout`?`text-danger`:`text-fg-muted`}`,children:et?Ne(et):B===`healthy`?n?`已成功启动,未发现未捕获异常。`:`Started successfully with no uncaught errors.`:B===`timeout`?n?`7 秒内未完成启动,可能出现白屏或阻塞。`:`Did not finish booting within 7 seconds.`:n?`正在等待应用启动。`:`Waiting for the app to start.`})]}),(0,A.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3`,children:[(0,A.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg`,children:[(0,A.jsx)(`span`,{className:`size-2 rounded-full ${Z?.status===`passed`?`bg-success`:Z?.status===`failed`?`bg-danger`:`bg-fg-subtle`}`}),n?`自动验收`:`Automatic acceptance`]}),Z?(0,A.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Z.checks.map(e=>(0,A.jsxs)(`li`,{className:`flex items-start gap-2 text-[11px] leading-4 ${e.status===`failed`?`text-danger`:`text-fg-muted`}`,children:[(0,A.jsx)(`span`,{className:`mt-1 size-1.5 shrink-0 rounded-full ${e.status===`failed`?`bg-danger`:e.status===`passed`?`bg-success`:`bg-fg-subtle`}`}),(0,A.jsx)(`span`,{children:e.message})]},e.id))}):(0,A.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:j?.acceptanceScenarioCount?n?`正在检查页面基础质量和 ${j.acceptanceScenarioCount} 个产品场景。`:`Checking page quality and ${j.acceptanceScenarioCount} product scenario(s).`:n?`正在检查页面内容和基础交互。`:`Checking rendered content and basic interaction.`}),ft?(0,A.jsxs)(`p`,{className:`mt-2 flex items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(C,{className:`size-3 animate-spin`}),n?`正在保存当前源码对应的验收快照…`:`Saving the acceptance snapshot for this source…`]}):$?(0,A.jsx)(`p`,{className:`mt-2 text-[11px] leading-4 text-fg-muted`,children:At?n?`相比上次:已修复 ${Mt} 项,仍有 ${jt.length} 项。`:`Since the previous run: ${Mt} fixed, ${jt.length} remaining.`:n?`首个验收快照已保存。`:`First acceptance snapshot saved.`}):null,(0,A.jsx)(Le,{scenarios:Y,results:rt,runningTarget:st,zh:n,onRunAll:Et,onRunScenario:Dt,onAskCoder:Ot})]}),j.status===`failed`||B===`failed`||B===`timeout`||Z?.status===`failed`?(0,A.jsxs)(E,{className:`mt-3 w-full`,onClick:Tt,disabled:R,children:[(0,A.jsx)(D,{className:`size-4`}),n?`让 Coder 修复`:`Ask Coder to fix`]}):null]}):(0,A.jsx)(T,{className:`mt-2 h-12 rounded-lg`})]}),(0,A.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(d,{className:`size-4 text-accent`}),n?`权限`:`Permissions`]}),(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(j?.permissions??k.permissions).map(e=>(0,A.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] text-fg-muted`,children:e},e))})]}),(0,A.jsx)(E,{variant:`primary`,className:`mt-5 w-full`,onClick:()=>void Nt(),disabled:N||Be||z||ft||j?.status===`failed`||B!==`healthy`||Z?.status!==`passed`||!$||$.sourceHash!==j?.sourceHash||k.installationState===`installed`&&j?.hasDraftChanges===!1,children:k.installationState===`installed`?n?`安装当前更新`:`Install current update`:n?`添加到左侧导航`:`Add to sidebar`}),k.installationState===`installed`?(0,A.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,A.jsxs)(E,{className:`min-w-0 flex-1`,onClick:()=>void St(!k.enabled),disabled:N,children:[k.enabled?(0,A.jsx)(ge,{className:`size-4`}):(0,A.jsx)(se,{className:`size-4`}),k.enabled?n?`禁用`:`Disable`:n?`启用`:`Enable`]}),(0,A.jsx)(E,{variant:`ghost`,className:`text-danger hover:text-danger`,onClick:()=>Je(!0),disabled:N,"aria-label":n?`卸载应用`:`Uninstall app`,children:(0,A.jsx)(g,{className:`size-4`})})]}):null,(0,A.jsxs)(`div`,{className:`mt-6 border-t border-edge-subtle pt-4`,children:[(0,A.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-semibold text-fg`,children:[(0,A.jsx)(le,{className:`size-4`}),n?`版本历史`:`Release history`]}),k.releases.length?(0,A.jsx)(`ul`,{className:`mt-2 divide-y divide-edge-subtle`,children:k.releases.map(e=>(0,A.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-fg`,children:[`v`,e.version,e.isActive?(0,A.jsx)(`span`,{className:`rounded-full bg-success-soft px-1.5 py-0.5 text-[10px] text-success`,children:n?`当前`:`Active`}):null]}),(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-fg-subtle`,children:Re(e.createdAt,r)})]}),e.isActive?null:(0,A.jsxs)(E,{variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:()=>void Ct(e.id),disabled:N,children:[(0,A.jsx)(he,{className:`size-3.5`}),n?`恢复`:`Restore`]})]},e.id))}):(0,A.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n?`安装首个版本后,可以从这里恢复。`:`Install the first version to enable recovery.`})]}),F?(0,A.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-danger`,role:`alert`,children:F}):null]}),(0,A.jsx)(S,{open:Ge,onOpenChange:Ke,children:(0,A.jsxs)(ae,{children:[(0,A.jsx)(b,{className:`fixed inset-0 z-50 bg-black/45`}),(0,A.jsxs)(h,{className:`fixed left-1/2 top-1/2 z-50 flex h-[min(560px,calc(100vh-32px))] w-[min(520px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-2xl focus:outline-none`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(_e,{className:`text-base font-semibold text-fg`,children:n?`确认安装到 XOPC`:`Confirm installation`}),(0,A.jsx)(_,{className:`mt-1 text-sm text-fg-muted`,children:n?`当前草稿会成为左侧导航中的可用版本。`:`The current draft will become the version available in the sidebar.`})]}),(0,A.jsx)(ne,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(m,{className:`size-4`})})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,A.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:k.name}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:k.extensionId})]}),(0,A.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`本次迭代`:`This iteration`}),(0,A.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-3 text-xs`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`文件变化`:`Changed files`}),(0,A.jsx)(`dd`,{className:`mt-1 font-medium text-fg`,children:j?.changedFileCount??0})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{className:`text-fg-subtle`,children:n?`自动验收`:`Acceptance`}),(0,A.jsxs)(`dd`,{className:`mt-1 flex items-center gap-1.5 font-medium text-success`,children:[(0,A.jsx)(me,{className:`size-3.5`}),n?`已通过并保存`:`Passed and saved`]})]})]}),j?.changedFiles.length?(0,A.jsx)(`ul`,{className:`mt-3 space-y-1`,children:j.changedFiles.slice(0,5).map(e=>(0,A.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-[11px] text-fg-muted`,children:[(0,A.jsx)(`span`,{className:`w-4 shrink-0 font-medium text-fg-subtle`,children:e.status===`added`?`+`:e.status===`deleted`?`−`:`•`}),(0,A.jsx)(`span`,{className:`truncate font-mono`,children:e.path})]},e.path))}):null,(0,A.jsx)(`h4`,{className:`mt-5 text-xs font-semibold text-fg`,children:n?`请求权限`:`Requested permissions`}),(0,A.jsx)(`ul`,{className:`mt-2 space-y-2`,children:(j?.permissions??k.permissions).map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,A.jsx)(o,{className:`size-4 text-success`}),e,k.installationState===`installed`&&j?.permissionDelta.added.includes(e)?(0,A.jsx)(`span`,{className:`rounded-full bg-warning-soft px-2 py-0.5 text-[10px] text-warning`,children:n?`新增`:`New`}):null]},e))}),k.installationState===`installed`&&j?.permissionDelta.added.length?(0,A.jsx)(`p`,{className:`mt-4 rounded-xl bg-warning-soft p-3 text-xs leading-5 text-warning`,children:n?`此更新增加了权限,请确认这些能力符合你的修改意图。`:`This update adds permissions. Confirm they match the change you requested.`}):null,(0,A.jsx)(`p`,{className:`mt-5 rounded-xl bg-accent-soft p-3 text-xs leading-5 text-accent-fg`,children:n?`Phase 1 应用只能使用界面主题和本地存储,不能访问网络或运行系统命令。`:`Phase 1 apps can use theme and local storage only. They cannot access the network or run system commands.`})]}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,A.jsx)(ne,{asChild:!0,children:(0,A.jsx)(E,{children:n?`取消`:`Cancel`})}),(0,A.jsxs)(E,{variant:`primary`,onClick:()=>void bt(),disabled:N,children:[N?(0,A.jsx)(C,{className:`size-4 animate-spin`}):(0,A.jsx)(x,{className:`size-4`}),n?`确认安装`:`Install`]})]})]})]})}),(0,A.jsx)(S,{open:qe,onOpenChange:Je,children:(0,A.jsxs)(ae,{children:[(0,A.jsx)(b,{className:`fixed inset-0 z-50 bg-black/45`}),(0,A.jsxs)(h,{className:`fixed left-1/2 top-1/2 z-50 flex h-[min(420px,calc(100vh-32px))] w-[min(500px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-base shadow-2xl focus:outline-none`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between border-b border-edge-subtle p-5`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(_e,{className:`text-base font-semibold text-fg`,children:n?`卸载当前应用?`:`Uninstall this app?`}),(0,A.jsx)(_,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:n?`应用会从侧栏移除,但 Project、源码、版本历史和本地数据都会保留。`:`The app leaves the sidebar, while its Project, source, release history, and local data remain.`})]}),(0,A.jsx)(ne,{className:`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover`,children:(0,A.jsx)(m,{className:`size-4`})})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:(0,A.jsxs)(`div`,{className:`rounded-xl bg-surface-panel p-4`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:k.name}),(0,A.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`之后可从任意保留版本重新安装。`:`You can reinstall any retained release later.`})]})}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-edge-subtle p-4`,children:[(0,A.jsx)(ne,{asChild:!0,children:(0,A.jsx)(E,{children:n?`取消`:`Cancel`})}),(0,A.jsxs)(E,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>void wt(),disabled:N,children:[N?(0,A.jsx)(C,{className:`size-4 animate-spin`}):(0,A.jsx)(g,{className:`size-4`}),n?`卸载但保留 Project`:`Uninstall and keep Project`]})]})]})]})})]})}export{j as LocalAppWorkbenchPage};
|
package/dist/gateway/static/root/assets/{local-apps-page-B9ruF9GV.js → local-apps-page-srIyxJuy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-QUQL4437-DXsxWP7r.js";import{n as a}from"./locale-store-GfSwnwIZ.js";import{i as o}from"./vendor-swr-BIWyz7Rc.js";import{Bo as s,Ys as c,du as l,lo as u,yc as d,ys as f,yu as p}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-QUQL4437-DXsxWP7r.js";import{n as a}from"./locale-store-GfSwnwIZ.js";import{i as o}from"./vendor-swr-BIWyz7Rc.js";import{Bo as s,Ys as c,du as l,lo as u,yc as d,ys as f,yu as p}from"./index-DSydVlxZ.js";import{i as m}from"./api-CwL38LEV.js";var h=n(),g=e(t(),1),_=r();function v(){let e=(0,h.c)(24),t=a(S)===`zh`,n=s(x),r=s(b),{data:u,isLoading:v,error:C}=o(`local-apps-list`,m),w,T;e[0]!==r||e[1]!==n||e[2]!==t?(w=()=>(n({startExtra:null,main:(0,_.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t?`应用工坊`:`App Workshop`}),end:(0,_.jsx)(f,{asChild:!0,variant:`primary`,className:`h-9`,children:(0,_.jsxs)(i,{to:`/local-apps/new`,children:[(0,_.jsx)(d,{className:`size-4`}),t?`创建应用`:`Create app`]})})}),()=>r()),T=[r,n,t],e[0]=r,e[1]=n,e[2]=t,e[3]=w,e[4]=T):(w=e[3],T=e[4]),(0,g.useLayoutEffect)(w,T);let E;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,_.jsx)(c,{className:`size-4`}),e[5]=E):E=e[5];let D=t?`从想法开始`:`Start with an idea`,O;e[6]===D?O=e[7]:(O=(0,_.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-accent`,children:[E,D]}),e[6]=D,e[7]=O);let k=t?`把自己的工具放进 XOPC`:`Put your own tools inside XOPC`,A;e[8]===k?A=e[9]:(A=(0,_.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:k}),e[8]=k,e[9]=A);let j=t?`每个应用都会自动创建一个由 Coder 负责的 Project,可预览、安装到侧栏,并持续迭代。`:`Every app gets a Coder-owned Project for previewing, installing in the sidebar, and ongoing iteration.`,M;e[10]===j?M=e[11]:(M=(0,_.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:j}),e[10]=j,e[11]=M);let N;e[12]!==O||e[13]!==A||e[14]!==M?(N=(0,_.jsxs)(`div`,{className:`mb-6 max-w-2xl`,children:[O,A,M]}),e[12]=O,e[13]=A,e[14]=M,e[15]=N):N=e[15];let P;e[16]!==u||e[17]!==C||e[18]!==v||e[19]!==t?(P=v?(0,_.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:3}).map(y)}):C?(0,_.jsx)(`p`,{className:`rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,children:C instanceof Error?C.message:String(C)}):u?.length?(0,_.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:u.map(e=>(0,_.jsxs)(i,{to:`/local-apps/${encodeURIComponent(e.id)}`,className:`group flex min-h-44 flex-col rounded-xl border border-edge-subtle bg-surface-base p-4 shadow-surface transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,_.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,_.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,children:(0,_.jsx)(l,{className:`size-5`})}),(0,_.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:e.installationState===`not_installed`?t?`草稿`:`Draft`:e.enabled?t?`已在侧栏`:`In sidebar`:t?`已禁用`:`Disabled`})]}),(0,_.jsx)(`h3`,{className:`mt-4 truncate text-sm font-semibold text-fg`,children:e.name}),(0,_.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.description||e.idea}),(0,_.jsxs)(`div`,{className:`mt-auto flex items-center justify-end pt-3 text-xs font-medium text-accent`,children:[t?`打开工作台`:`Open workbench`,(0,_.jsx)(p,{className:`ml-1 size-3.5 transition-transform group-hover:translate-x-0.5`})]})]},e.id))}):(0,_.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-edge bg-surface-base px-6 py-14 text-center`,children:[(0,_.jsx)(l,{className:`mx-auto size-8 text-fg-subtle`}),(0,_.jsx)(`h3`,{className:`mt-4 text-sm font-semibold text-fg`,children:t?`还没有本地应用`:`No local apps yet`}),(0,_.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-sm text-fg-muted`,children:t?`描述你想解决的问题,XOPC 会创建应用骨架和可持续开发的 Project。`:`Describe the problem and XOPC will create an app scaffold and an ongoing Project.`}),(0,_.jsx)(f,{asChild:!0,variant:`primary`,className:`mt-5`,children:(0,_.jsxs)(i,{to:`/local-apps/new`,children:[(0,_.jsx)(d,{className:`size-4`}),t?`创建第一个应用`:`Create your first app`]})})]}),e[16]=u,e[17]=C,e[18]=v,e[19]=t,e[20]=P):P=e[20];let F;return e[21]!==P||e[22]!==N?(F=(0,_.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-panel px-3 py-8 sm:px-5 xl:px-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto max-w-6xl`,children:[N,P]})}),e[21]=P,e[22]=N,e[23]=F):F=e[23],F}function y(e,t){return(0,_.jsx)(u,{className:`h-44 rounded-xl`},t)}function b(e){return e.clearPageHeader}function x(e){return e.setPageHeader}function S(e){return e.language}export{v as LocalAppsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i}from"./chunk-QUQL4437-DXsxWP7r.js";import{t as a}from"./cn-BQ_8x0bT.js";import{t as o}from"./copy-to-clipboard-HOJ79TWv.js";import{t as s}from"./messages-B0B40tpO.js";import{l as c,n as l,r as u,s as d}from"./locale-store-GfSwnwIZ.js";import{$o as f,Cs as p,El as m,Fl as h,Fo as g,Jc as _,Kl as v,Lo as y,No as b,Po as x,Ro as S,Rs as C,Yo as w,Zo as T,_s as E,ac as D,as as O,au as k,ba as A,bl as j,da as M,es as N,fc as P,is as F,lo as I,ms as L,os as R,rs as z,ts as B,yl as ee,ys as V,zo as te}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i}from"./chunk-QUQL4437-DXsxWP7r.js";import{t as a}from"./cn-BQ_8x0bT.js";import{t as o}from"./copy-to-clipboard-HOJ79TWv.js";import{t as s}from"./messages-B0B40tpO.js";import{l as c,n as l,r as u,s as d}from"./locale-store-GfSwnwIZ.js";import{$o as f,Cs as p,El as m,Fl as h,Fo as g,Jc as _,Kl as v,Lo as y,No as b,Po as x,Ro as S,Rs as C,Yo as w,Zo as T,_s as E,ac as D,as as O,au as k,ba as A,bl as j,da as M,es as N,fc as P,is as F,lo as I,ms as L,os as R,rs as z,ts as B,yl as ee,ys as V,zo as te}from"./index-DSydVlxZ.js";import{r as H}from"./segmented-styles-BL8oLBEp.js";var U=e(t(),1),W=n();function G(e){let t=new URLSearchParams;if(!e)return``;e.level?.length&&t.set(`level`,e.level.join(`,`)),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.q&&t.set(`q`,e.q),e.module&&t.set(`module`,e.module),e.requestId&&t.set(`requestId`,e.requestId),e.sessionKey&&t.set(`sessionKey`,e.sessionKey),e.sessionId&&t.set(`sessionId`,e.sessionId),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let n=t.toString();return n?`?${n}`:``}async function K(e){return d(u(`/api/logs${G(e)}`))}async function q(){return(await d(u(`/api/logs/files`))).files??[]}async function J(){return(await d(u(`/api/logs/modules`))).modules??[]}async function Y(){let e=await d(u(`/api/logs/stats`));return{byLevel:e.byLevel??{},runtime:e.runtime}}async function ne(){return(await d(u(`/api/logs/dir`))).dir??``}async function X(){return(await d(u(`/api/logs/level`))).level??`info`}async function Z(e,t){return d(u(`/api/logs/level`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({level:e,...t==null?{}:{duration:String(t)}})})}async function re(e){let t=new URLSearchParams;e?.from&&t.set(`from`,e.from),e?.to&&t.set(`to`,e.to),e?.limit!=null&&t.set(`limit`,String(e.limit));let n=t.toString();return(await d(u(`/api/logs/errors/summary${n?`?${n}`:``}`))).items??[]}var ie=500,ae=class{_token;_callbacks;_abort;constructor(e,t){this._token=e,this._callbacks=t}connect(e,t){this.disconnect();let n=new AbortController;this._abort=n,this._consume(n,e,t)}async _consume(e,t,n){let r=new URL(u(`/api/logs/stream`));t?.length?r.searchParams.set(`levels`,t.join(`,`)):r.searchParams.set(`levels`,`trace,debug,info,warn,error,fatal`),n&&r.searchParams.set(`module`,n);try{let t=new Headers({Accept:`text/event-stream`});this._token&&t.set(`Authorization`,`Bearer ${this._token}`);let n=await fetch(r.toString(),{headers:t,signal:e.signal});if(!n.ok||!n.body)throw Error(`Log stream failed: ${n.status}`);let i=n.body.getReader(),a=new TextDecoder,o=``;for(;!e.signal.aborted;){let{done:e,value:t}=await i.read();if(e)break;o+=a.decode(t,{stream:!0});let n=o.indexOf(`
|
|
2
2
|
|
|
3
3
|
`);for(;n>=0;)this._dispatchChunk(o.slice(0,n)),o=o.slice(n+2),n=o.indexOf(`
|
|
4
4
|
|
package/dist/gateway/static/root/assets/{markdown-split-CzuhSQAB.js → markdown-split-Du5yPuDb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{Xi as r}from"./index-
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{Xi as r}from"./index-DSydVlxZ.js";import{t as i}from"./markdown-editor-BvUebh3C.js";var a=t();e();var o=n();function s(e){let t=(0,a.c)(12),{initialContent:n,onSave:s,isDark:c,wordWrap:l,onToggleWordWrap:u}=e,d=c===void 0?!1:c,f=l===void 0?!1:l,p;t[0]===s?p=t[1]:(p=e=>{s?.(e)},t[0]=s,t[1]=p);let m=r(p,500),h;t[2]===m?h=t[3]:(h=e=>{m(e)},t[2]=m,t[3]=h);let g=h,_;t[4]===u?_=t[5]:(_=[{key:`Alt-z`,run:()=>(u?.(),!0)}],t[4]=u,t[5]=_);let v=_,y;return t[6]!==g||t[7]!==n||t[8]!==d||t[9]!==v||t[10]!==f?(y=(0,o.jsx)(`div`,{className:`h-full min-w-0 overflow-hidden`,children:(0,o.jsx)(i,{initialContent:n,onChange:g,isDark:d,lineWrap:f,keyBindings:v})}),t[6]=g,t[7]=n,t[8]=d,t[9]=v,t[10]=f,t[11]=y):y=t[11],y}export{s as MarkdownSplit};
|
package/dist/gateway/static/root/assets/{media-plugins-a3R4y-EL.js → media-plugins-Cd1Rmw15.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-B0B40tpO.js";import{ro as i}from"./index-
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-B0B40tpO.js";import{ro as i}from"./index-DSydVlxZ.js";import{t as a}from"./preview-open-alternatives-CjEZt_F5.js";import{t as o}from"./use-blob-object-url-D4BFuzZB.js";var s=t();e();var c=n();function l(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`audio`}),t[0]=e,t[1]=n),n}function u(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`video`}),t[0]=e,t[1]=n),n}function d(e){let t=(0,s.c)(8),{props:n,kind:r}=e,a;bb0:{if(!n.binaryBuffer){a=null;break bb0}let e;if(t[0]!==r||t[1]!==n.binaryBuffer||t[2]!==n.descriptor.fileName||t[3]!==n.descriptor.mimeType){let a=i(n.descriptor.fileName)??n.descriptor.mimeType;e=new Blob([n.binaryBuffer],{type:a||`${r}/*`}),t[0]=r,t[1]=n.binaryBuffer,t[2]=n.descriptor.fileName,t[3]=n.descriptor.mimeType,t[4]=e}else e=t[4];a=e}let l=o(a);if(!l)return null;let u;return t[5]!==r||t[6]!==l?(u=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface-base p-4 dark:bg-surface-hover/20`,children:r===`audio`?(0,c.jsx)(`audio`,{src:l,controls:!0,className:`w-full max-w-2xl`}):(0,c.jsx)(`video`,{src:l,controls:!0,playsInline:!0,className:`max-h-full max-w-full rounded-md bg-black`})}),t[5]=r,t[6]=l,t[7]=u):u=t[7],u}function f(e){let t=(0,s.c)(12),n;t[0]===e.language?n=t[1]:(n=r(e.language),t[0]=e.language,t[1]=n);let i=n,o=e.descriptor.context===`workspace`,l=o?`${i.workspace.cannotPreviewType} ${i.workspace.openElsewhereHint}`:i.chat.attachmentPreviewOpenElsewhereHint,u=o?i.workspace.openSystemApp:void 0,d=o?i.workspace.chooseApp:void 0,f;return t[2]!==i.chat.attachmentPreviewDownloadFull||t[3]!==e.actions.canChooseOpenWithApp||t[4]!==e.actions.canOpenWithSystemApp||t[5]!==e.actions.onChooseOpenWithApp||t[6]!==e.actions.onDownload||t[7]!==e.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,c.jsx)(a,{message:l,downloadLabel:i.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:e.actions.onOpenWithSystemApp,canOpenWithSystemApp:e.actions.canOpenWithSystemApp,chooseAppLabel:d,onChooseOpenWithApp:e.actions.onChooseOpenWithApp,canChooseOpenWithApp:e.actions.canChooseOpenWithApp})}),t[2]=i.chat.attachmentPreviewDownloadFull,t[3]=e.actions.canChooseOpenWithApp,t[4]=e.actions.canOpenWithSystemApp,t[5]=e.actions.onChooseOpenWithApp,t[6]=e.actions.onDownload,t[7]=e.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}export{l as AudioPreviewPluginView,f as UnsupportedPreviewPluginView,u as VideoPreviewPluginView};
|