pisper 0.5.50 → 0.5.51
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/package.json +7 -7
- package/web/.vite/manifest.json +162 -159
- package/web/assets/{AppOverlays-DrS2NA9w.js → AppOverlays-DlB6SVT6.js} +1 -1
- package/web/assets/{AppSelect-CRjRgr38.js → AppSelect-kDqZkETY.js} +1 -1
- package/web/assets/{AssetsPage-C2GY8596.js → AssetsPage-mZkZgR9g.js} +1 -1
- package/web/assets/{ChannelsPage-FPSrQa1G.js → ChannelsPage-Dau7vaaV.js} +1 -1
- package/web/assets/{ChatDockView-BJGa8Bm8.js → ChatDockView-Cq7J6Xmn.js} +1 -1
- package/web/assets/{ChatHistoryPage-BBmrFY5U.js → ChatHistoryPage-BpoHAiYo.js} +1 -1
- package/web/assets/{ChatPage-DfQGtuLo.js → ChatPage-CCMsSvJV.js} +3 -3
- package/web/assets/{ConfigPage-D27UB6Ni.js → ConfigPage-BGZoCXnB.js} +1 -1
- package/web/assets/{MarkdownMessage-BQ_6o9-O.js → MarkdownMessage-Dbgb5XkJ.js} +1 -1
- package/web/assets/{MemoryPage-D46RKJLE.js → MemoryPage-BiAbcHbL.js} +1 -1
- package/web/assets/{PageHeader-DH1jtT2l.js → PageHeader-9ctH9v28.js} +1 -1
- package/web/assets/PluginsPage-D-D22LWb.js +1 -0
- package/web/assets/{PreviewPages-BBwzd5LJ.js → PreviewPages-DUZgwvOb.js} +1 -1
- package/web/assets/{SchedulesPage-AyePMsz_.js → SchedulesPage-C3sS9Ej3.js} +1 -1
- package/web/assets/{SkillsPage-Cb3i7xyX.js → SkillsPage-BeeTZyfc.js} +1 -1
- package/web/assets/{TerminalPanel-B06cwdRZ.js → TerminalPanel-a4jiIuSs.js} +1 -1
- package/web/assets/{WelcomeEffects-CsxWSguh.js → WelcomeEffects-Xo1Z1Nf4.js} +1 -1
- package/web/assets/{WorkflowsPage-Byq1cQot.js → WorkflowsPage-BCdz4ise.js} +1 -1
- package/web/assets/{WorkspacePicker-BNVaK0c9.js → WorkspacePicker-Ctf1A8lp.js} +1 -1
- package/web/assets/client-store-ohgbeJNh.js +1 -0
- package/web/assets/{collapsible-C4owDMcF.js → collapsible-U8Wh2f7S.js} +1 -1
- package/web/assets/{config-search-CsGhOXIG.js → config-search-CdRsMMUS.js} +1 -1
- package/web/assets/{dist-VQXpFPjV.js → dist-Dq4VqZgU.js} +1 -1
- package/web/assets/{dist-CyztUDRL.js → dist-cR3ayBwn.js} +1 -1
- package/web/assets/{es2015-BpePoPbM.js → es2015-DycjrqX-.js} +1 -1
- package/web/assets/{field-BAyGDYW_.js → field-t72VAR-1.js} +1 -1
- package/web/assets/index-Bd5A8V1V.js +40 -0
- package/web/assets/index-DUhopGVK.css +2 -0
- package/web/assets/{progress-BqaId9J2.js → progress-DQDjWjzV.js} +1 -1
- package/web/assets/{scroll-area-DkxdCF8r.js → scroll-area-C1DpxpHg.js} +1 -1
- package/web/assets/{separator-0_agp17Z.js → separator-Br2F2Mir.js} +1 -1
- package/web/assets/tool-labels-v0OysnpI.js +1 -0
- package/web/assets/{tooltip-D9uQM6ab.js → tooltip-DfGEs0yi.js} +1 -1
- package/web/assets/use-i18n-jYw5s_Yn.js +1 -0
- package/web/assets/{use-mobile-A2egKMjY.js → use-mobile-C1OVAMOm.js} +1 -1
- package/web/assets/web-preview-panel-uBOnhY4Z.js +556 -0
- package/web/assets/{welcome-brand-CYtVVlIL.js → welcome-brand-R7Xflzvb.js} +1 -1
- package/web/index.html +10 -10
- package/web/assets/PluginsPage-B4cG171E.js +0 -1
- package/web/assets/client-store-BSV7t02b.js +0 -1
- package/web/assets/index-CAWCOpxG.js +0 -40
- package/web/assets/index-DT-gaDrM.css +0 -2
- package/web/assets/tool-labels-BJhLig5u.js +0 -1
- package/web/assets/use-i18n-yjKc6F2w.js +0 -1
- package/web/assets/web-preview-panel-BOmJGqhe.js +0 -556
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./api-B6CluO7V.js";import{t as i}from"./button-XhIEgIsg.js";import{t as a}from"./use-i18n-yjKc6F2w.js";import{t as o}from"./AppSelect-CRjRgr38.js";import{t as s}from"./WorkspacePicker-BNVaK0c9.js";import{t as c}from"./message-circle-Bc_EzZop.js";import{t as l}from"./play-N6mg4pFl.js";import{t as u}from"./send-DcLH_sg0.js";import{t as d}from"./trash-2-mhzzyC6i.js";import{t as f}from"./x-bw26XDZM.js";import{At as p,B as m,Dt as h,Nt as g,Pt as _,bt as v,ht as y,i as b,l as x,n as S,o as C,r as w,s as T,t as E,xt as D}from"./index-CAWCOpxG.js";import{t as O}from"./field-BAyGDYW_.js";import{t as k}from"./StarOrbit-BlI6MhVr.js";import{t as A}from"./usePagePrimaryAction-Bw0OFTDZ.js";import{n as j,t as M}from"./pick-system-directory-BnIFt85A.js";var N=e(t(),1),P=n(),F={browser:{name:`通知`,Icon:_},feishu:{name:`飞书`,Icon:g},weixin:{name:`微信`,Icon:c},qq:{name:`QQ`,Icon:c},telegram:{name:`Telegram`,Icon:u}},ee={interval:`每隔一段时间`,daily:`每天`,weekly:`每周`,monthly:`每月`},te={minutes:`分钟`,hours:`小时`,days:`天`},ne=[...new Set([`Asia/Hong_Kong`,`UTC`,...typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[]])],I=[`full-access`];function L(e){return e(`schedules:schedulesPage.fullAccessHelp`)}function re(e,t){return t(e===`daily`?`schedules:schedulesPage.daily`:e===`weekly`?`schedules:schedulesPage.weekly`:e===`monthly`?`schedules:schedulesPage.monthly`:`schedules:schedulesPage.atIntervals`)}function ie(e,t){return t(e===`hours`?`schedules:schedulesPage.hours`:e===`days`?`schedules:schedulesPage.days`:`schedules:schedulesPage.minutes`)}function R(e,t){return t(e===`feishu`?`schedules:schedulesPage.feishu`:e===`weixin`?`schedules:schedulesPage.weChat`:e===`qq`?`schedules:schedulesPage.qq`:e===`telegram`?`schedules:schedulesPage.telegram`:`schedules:schedulesPage.browserNotification`)}function ae({value:e,onChange:t}){let{t:n}=a();return(0,P.jsxs)(O,{variant:`control`,children:[n(`schedules:schedulesPage.executionMode`),(0,P.jsx)(o,{value:e,onChange:e=>t(e.target.value),children:I.map(e=>(0,P.jsx)(`option`,{value:e,children:n(`schedules:schedulesPage.fullAccess`)},e))}),(0,P.jsx)(`small`,{children:L(n)})]})}function z(e){return Object.fromEntries((e?.inputs||[]).map(e=>[e.name,e.defaultValue??``]))}function B(e,t,n,r,i){if(e===`prompt`)return!!t.trim();let a=i.find(e=>e.id===n);return a?a.inputs.every(e=>{let t=Object.hasOwn(r,e.name)?r[e.name]:e.defaultValue;return!e.required||t!=null&&t!==``}):!1}function V({targetType:e,prompt:t,workflowId:n,workflowInputs:r,workflows:i,onChange:s}){let{t:c}=a(),l=i.find(e=>e.id===n);return(0,P.jsxs)(`div`,{className:`grid gap-[10px]`,children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.executionTarget`),(0,P.jsxs)(o,{value:e,onChange:e=>{let t=e.target.value,a=i[0];s(t===`workflow`?{targetType:t,workflowId:n||a?.id||``,workflowInputs:n?r:z(a)}:{targetType:t})},children:[(0,P.jsx)(`option`,{value:`prompt`,children:`Prompt`}),(0,P.jsx)(`option`,{value:`workflow`,children:c(`schedules:schedulesPage.workflow`)})]})]}),e===`prompt`?(0,P.jsxs)(O,{variant:`control`,children:[`Prompt`,(0,P.jsx)(`textarea`,{value:t,onChange:e=>s({prompt:e.target.value}),placeholder:c(`schedules:schedulesPage.describeTheWorkTheAgentShouldCompleteEachTime`)})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.workflow`),(0,P.jsxs)(o,{value:n,onChange:e=>{let t=i.find(t=>t.id===e.target.value);s({workflowId:e.target.value,workflowInputs:z(t)})},children:[(0,P.jsx)(`option`,{value:``,children:c(`schedules:schedulesPage.selectPublishedWorkflow`)}),i.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.revision]},e.id))]}),(0,P.jsx)(`small`,{children:l?.description||(i.length?c(`schedules:schedulesPage.workflowUsesItsOwnRuntimeSettings`):c(`schedules:schedulesPage.noPublishedWorkflows`))})]}),l?.inputs.length?(0,P.jsxs)(`div`,{className:`grid gap-[8px]`,children:[(0,P.jsxs)(`div`,{className:`schedule-workflow-inputs-heading [&_strong]:text-[12px] [&_small]:text-[var(--text-muted)] [&_small]:text-[11px] [&_small]:text-right max-[650px]:items-start max-[650px]:flex-col max-[650px]:gap-[2px] max-[650px]:[&_small]:text-left flex [align-items:baseline] justify-between gap-[12px]`,children:[(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.workflowInputs`)}),(0,P.jsx)(`small`,{children:c(`schedules:schedulesPage.workflowInputsHelp`)})]}),(0,P.jsx)(`div`,{className:`schedule-workflow-inputs [&_input[type='checkbox']]:w-[16px] [&_input[type='checkbox']]:h-[16px] [&_input[type='checkbox']]:[justify-self:end] max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(2,minmax(0,1fr))] gap-[8px]`,children:l.inputs.map(e=>(0,P.jsxs)(O,{variant:`control`,className:e.type===`boolean`?`grid grid-cols-[minmax(0,1fr)_auto] items-center`:void 0,children:[e.label,e.required?` *`:``,e.type===`boolean`?(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r[e.name],onChange:t=>s({workflowInputs:{...r,[e.name]:t.target.checked}})}):(0,P.jsx)(`input`,{type:e.type===`number`?`number`:`text`,required:e.required,value:String(r[e.name]??``),onChange:t=>s({workflowInputs:{...r,[e.name]:t.target.value}})}),e.description&&(0,P.jsx)(`small`,{children:e.description})]},e.id))})]}):null]})]})}function H({value:e,onChange:t}){let{t:n}=a(),[r,o]=(0,N.useState)(``),[c,l]=(0,N.useState)(!1),u=async()=>{if(o(``),!M()){l(!0);return}try{let n=await j(e);n&&t(n)}catch(e){o(e instanceof Error?e.message:String(e))}};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(O,{variant:`control`,children:[n(`schedules:schedulesPage.workingDirectory`),(0,P.jsxs)(`span`,{className:`schedule-workspace-input [&_input]:min-w-0 [&_input]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] grid grid-cols-[minmax(0,1fr)_auto] gap-[6px]`,children:[(0,P.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),placeholder:n(`schedules:schedulesPage.enterTheProjectSAbsolutePath`)}),(0,P.jsxs)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:()=>void u(),children:[(0,P.jsx)(h,{size:13}),n(`schedules:schedulesPage.browseDirectories`)]})]}),(0,P.jsx)(`small`,{children:n(`schedules:schedulesPage.theScheduledAgentWillRunInThisDirectory`)})]}),r&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),r]}),(0,P.jsx)(s,{open:c,initialPath:e,description:n(`common:workspacePicker.selectWorkspaceForSchedule`),onOpenChange:l,onSelect:e=>t(e)})]})}function U(e){return{id:e.id,name:e.name,targetType:e.targetType||`prompt`,prompt:e.prompt,workflowId:e.workflowId||``,workflowInputs:e.workflowInputs||{},enabled:e.enabled,frequency:e.frequency,intervalValue:e.intervalValue||1,intervalUnit:e.intervalUnit||`hours`,time:e.time,timezone:e.timezone,dayOfWeek:e.dayOfWeek,dayOfMonth:e.dayOfMonth,cwd:e.cwd,executionMode:e.executionMode||`full-access`,model:e.model,notifications:e.notifications||[],notifyOn:e.notifyOn||`always`}}function W(e,t=`zh-CN`){return!e.enabled||!e.nextRunAt?t===`en-US`?`Paused`:`已暂停`:new Intl.DateTimeFormat(t,{timeZone:e.timezone,dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.nextRunAt))}function G({notify:e,registerPrimaryAction:t,openNotificationSettings:n,requestConfirm:s}){let{t:c,language:u}=a(),[f,h]=(0,N.useState)({tasks:[],runs:[],notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1},qq:{enabled:!1},telegram:{enabled:!1}},workflows:[],defaultCwd:``}),[g,_]=(0,N.useState)(``),[D,j]=(0,N.useState)(null),[M,I]=(0,N.useState)(!0),[L,z]=(0,N.useState)(!1),[G,J]=(0,N.useState)(``),[oe,Y]=(0,N.useState)(!1);A(t,()=>Y(!0));let X=(0,N.useCallback)(async()=>{try{let e=await r(`/api/schedules`);h(e),_(t=>e.tasks.some(e=>e.id===t)?t:e.tasks[0]?.id||``)}catch(e){J(e instanceof Error?e.message:String(e))}finally{I(!1)}},[]);(0,N.useEffect)(()=>{X()},[X]),(0,N.useEffect)(()=>{let e=window.setInterval(X,f.tasks.some(e=>e.lastStatus===`running`)?2e3:1e4);return()=>window.clearInterval(e)},[f.tasks,X]);let Z=f.tasks.find(e=>e.id===g),Q=f.workflows||[];(0,N.useEffect)(()=>{j(e=>Z?e?.id===Z.id?e:U(Z):null)},[Z]);let se=(0,N.useMemo)(()=>f.runs.filter(e=>e.taskId===g).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()).slice(0,20),[f.runs,g]),$=e=>j(t=>t&&{...t,...e}),ce=e=>{D&&$({notifications:D.notifications.includes(e)?D.notifications.filter(t=>t!==e):[...D.notifications,e]})};return M?(0,P.jsxs)(w,{children:[(0,P.jsx)(v,{className:`animate-spin`,size:23}),(0,P.jsx)(`h2`,{children:c(`schedules:schedulesPage.loadingScheduledTasks`)})]}):(0,P.jsxs)(P.Fragment,{children:[G&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),G]}),(0,P.jsxs)(`div`,{className:`split-list-detail grid min-h-[100%] min-w-0 grid-cols-[minmax(0,310px)_minmax(0,1fr)] gap-[12px] overflow-x-hidden max-[900px]:grid-cols-1 max-[650px]:gap-[8px]`,children:[(0,P.jsxs)(E,{className:`selection-list [.config-layout_>_&]:max-h-[calc(100dvh_-_280px)] [.config-layout_>_&]:overflow-y-auto max-[900px]:max-h-[300px] min-h-0 overflow-auto`,children:[(0,P.jsx)(C,{title:c(`schedules:schedulesPage.taskQueue`)}),f.tasks.length?f.tasks.map(e=>(0,P.jsx)(`div`,{className:`schedule-list-item hover:bg-[var(--accent-soft)] [&.active]:bg-[var(--accent-soft)] [&_>_button]:grid [&_>_button]:min-w-0 [&_>_button]:min-h-[68px] [&_>_button]:grid-cols-[minmax(0,1fr)_auto] [&_>_button]:items-center [&_>_button]:gap-[8px] [&_>_button]:border-0 [&_>_button]:bg-transparent [&_>_button]:p-[6px_2px] [&_>_button]:text-left [&_>_button_>_span]:flex [&_>_button_>_span]:min-w-0 [&_>_button_>_span]:flex-col [&_>_button_>_span]:gap-[5px] [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_em]:flex [&_em]:items-center [&_em]:gap-[4px] [&_em]:text-[var(--text-muted)] [&_em]:text-[13px] [&_em]:[font-style:normal] grid grid-cols-[minmax(0,1fr)_auto] items-center gap-[5px] [border-top:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] [padding:3px_5px] ${g===e.id?`active`:``}`,children:(0,P.jsxs)(`button`,{onClick:()=>_(e.id),children:[(0,P.jsxs)(`span`,{children:[(0,P.jsxs)(`div`,{className:`schedule-item-head [.schedule-list-item_&]:flex [.schedule-list-item_&]:min-w-0 [.schedule-list-item_&]:items-center [.schedule-list-item_&]:gap-[6px] [.schedule-list-item_&_strong]:flex-1 [.schedule-list-item_&_strong]:min-w-0`,children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(x,{tone:e.enabled?`green`:`gray`,children:e.enabled?c(`schedules:schedulesPage.enabled`):c(`schedules:schedulesPage.pause`)})]}),(0,P.jsx)(`small`,{children:e.targetType===`workflow`?Q.find(t=>t.id===e.workflowId)?.name||c(`schedules:schedulesPage.workflowUnavailable`):e.prompt})]}),(0,P.jsx)(`em`,{children:W(e,u)})]})},e.id)):(0,P.jsxs)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center`,children:[(0,P.jsx)(k,{size:38}),(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.theTimelineIsStillUnlit`)}),(0,P.jsx)(`span`,{children:c(`schedules:schedulesPage.createATaskAndLetItSetOutAutomaticallyAtTheAppointedTime`)})]})]}),Z&&D?(0,P.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,P.jsxs)(E,{children:[(0,P.jsxs)(S,{className:`max-[650px]:flex-wrap max-[650px]:items-start`,children:[(0,P.jsx)(`h2`,{className:`min-w-0 break-words`,children:D.name}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-[5px] max-[650px]:w-full`,children:[(0,P.jsx)(T,{value:D.enabled,onChange:e=>$({enabled:e}),ariaLabel:D.name}),(0,P.jsxs)(i,{size:`lg`,disabled:L||Z.lastStatus===`running`,onClick:async()=>{if(Z){z(!0),J(``);try{await r(`/api/schedules/${encodeURIComponent(Z.id)}/run`,{method:`POST`,body:`{}`}),await X(),e(c(`schedules:schedulesPage.scheduledTaskStarted`))}catch(e){J(e instanceof Error?e.message:String(e))}finally{z(!1)}}},children:[Z.lastStatus===`running`?(0,P.jsx)(v,{className:`animate-spin`,size:14}):(0,P.jsx)(l,{size:14}),Z.lastStatus===`running`?c(`schedules:schedulesPage.running`):c(`schedules:schedulesPage.runNow`)]}),(0,P.jsx)(i,{variant:`destructive`,size:`icon`,title:c(`schedules:schedulesPage.deleteTask`),"aria-label":c(`schedules:schedulesPage.deleteTask`),onClick:async()=>{if(Z&&await s({title:c(`schedules:schedulesPage.deleteScheduledTask`),message:c(`schedules:schedulesPage.deleteScheduledTaskNameAndItsRunHistory`,{name:Z.name}),confirmLabel:c(`schedules:schedulesPage.delete`)}))try{await r(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`DELETE`}),await X(),e(c(`schedules:schedulesPage.scheduledTaskDeleted`))}catch(e){J(e instanceof Error?e.message:String(e))}},children:(0,P.jsx)(d,{size:14})})]})]}),(0,P.jsx)(V,{targetType:D.targetType,prompt:D.prompt,workflowId:D.workflowId,workflowInputs:D.workflowInputs,workflows:Q,onChange:$}),D.targetType===`prompt`&&(0,P.jsx)(H,{value:D.cwd,onChange:e=>$({cwd:e})}),(0,P.jsxs)(`div`,{className:`form-grid grid gap-[9px] three [.form-grid&]:grid-cols-[repeat(3,minmax(0,1fr))] max-[650px]:[.form-grid&]:grid-cols-[1fr]`,children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.frequency`),(0,P.jsx)(o,{value:D.frequency,onChange:e=>$({frequency:e.target.value}),children:Object.keys(ee).map(e=>(0,P.jsx)(`option`,{value:e,children:re(e,c)},e))})]}),D.frequency===`interval`?(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.runInterval`),(0,P.jsxs)(`span`,{className:`schedule-interval-input [&_input]:w-full [&_input]:min-w-0 [&_input]:h-full [&_input]:border-0 [&_input]:[outline:0] [&_input]:bg-transparent [&_input]:p-[0_9px] [&_input]:text-[var(--text)] [&_select]:h-full [&_select]:border-0 [&_select]:[border-left:1px_solid_var(--stroke)] [&_select]:[outline:0] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text-tertiary)] [&_select]:text-[12px] [&_[data-slot='select-trigger']]:w-auto [&_[data-slot='select-trigger']]:min-w-[74px] [&_[data-slot='select-trigger']]:[border-left:1px_solid_var(--stroke)] [&_[data-slot='select-trigger']]:rounded-[0] [&_[data-slot='select-trigger']]:bg-[var(--solid)] [&_[data-slot='select-trigger']]:text-[var(--text-tertiary)] grid h-[31px] grid-cols-[minmax(0,1fr)_auto] overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--surface-subtle)]`,children:[(0,P.jsx)(`input`,{type:`number`,min:`1`,value:D.intervalValue,onChange:e=>$({intervalValue:Number(e.target.value)})}),(0,P.jsx)(o,{value:D.intervalUnit,onChange:e=>$({intervalUnit:e.target.value}),children:Object.keys(te).map(e=>(0,P.jsx)(`option`,{value:e,children:ie(e,c)},e))})]})]}):(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.time`),(0,P.jsx)(`input`,{type:`time`,value:D.time,onChange:e=>$({time:e.target.value})})]}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.timeZone`),(0,P.jsx)(o,{value:D.timezone,onChange:e=>$({timezone:e.target.value}),children:ne.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),D.targetType===`prompt`&&(0,P.jsx)(ae,{value:D.executionMode,onChange:e=>$({executionMode:e})})]}),(0,P.jsxs)(`div`,{className:`schedule-notification-section [&_>_div:first-child]:flex [&_>_div:first-child]:items-center [&_>_div:first-child]:justify-between [&_>_div:first-child]:gap-[8px] [&_>_div:first-child_strong]:text-[13px] [&_>_p]:mt-[4px] [&_>_p]:text-[var(--text-muted)] [&_>_p]:text-[13px] [margin-top:13px] [border-top:1px_solid_var(--stroke-soft)] [padding-top:12px]`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.notificationChannels`)}),(0,P.jsx)(`button`,{type:`button`,className:`text-button hover:text-[var(--text)] border-0 bg-transparent text-[var(--text-soft)] text-[12px] font-[600] [text-decoration:underline] [text-underline-offset:2px]`,onClick:n,children:c(`schedules:schedulesPage.editTemplates`)})]}),(0,P.jsx)(`p`,{children:c(`schedules:schedulesPage.notificationChannelsHelp`)}),(0,P.jsx)(`div`,{className:`schedule-notification-targets [&_>_button]:grid [&_>_button]:min-h-[52px] [&_>_button]:grid-cols-[auto_minmax(0,1fr)_auto] [&_>_button]:items-center [&_>_button]:gap-[7px] [&_>_button]:[border:1px_solid_var(--stroke)] [&_>_button]:rounded-[var(--r-sm)] [&_>_button]:bg-[var(--surface-subtle)] [&_>_button]:p-[7px_8px] [&_>_button]:text-left [&_>_button_>_span]:flex [&_>_button_>_span]:min-w-0 [&_>_button_>_span]:flex-col [&_>_button_>_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:overflow-hidden [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_>_button_>_svg:last-child]:text-[var(--control-muted)] [&_>_button.selected]:border-[var(--focus)] [&_>_button.selected]:bg-[var(--accent-soft)] [&_>_button.selected]:text-[var(--star-strong)] [&_>_button.selected_>_svg:last-child]:text-[var(--success)] max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(5,minmax(0,1fr))] gap-[7px] [margin-top:9px]`,children:Object.entries(F).map(([e,t])=>{let n=t.Icon,r=D.notifications.includes(e);return(0,P.jsxs)(`button`,{type:`button`,className:r?`selected`:``,onClick:()=>ce(e),children:[(0,P.jsx)(n,{size:15}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:R(e,c)}),(0,P.jsx)(`small`,{children:f.notificationTargets[e].enabled?c(`schedules:schedulesPage.configured`):c(`schedules:schedulesPage.notConfigured`)})]}),(0,P.jsx)(p,{size:15})]},e)})}),(0,P.jsx)(`div`,{className:`flex items-center gap-[6px] [margin-top:9px]`,children:(0,P.jsx)(`button`,{type:`button`,className:`schedule-notification-chip [&.selected]:border-[var(--control-selected-border)] [&.selected]:bg-[var(--control-selected-bg)] [&.selected]:text-[var(--control-selected-text)] [&.selected]:shadow-[var(--sh-1)] dark:bg-[var(--surface-subtle)] inline-flex h-[32px] items-center gap-[4px] [border:1px_solid_var(--stroke)] rounded-[var(--r-pill)] bg-[var(--surface-subtle)] text-[var(--text-muted)] [padding:0_10px] text-[13px] font-[600] ${D.notifyOn===`failure`?`selected`:``}`,onClick:()=>$({notifyOn:D.notifyOn===`failure`?`always`:`failure`}),children:D.notifyOn===`failure`?c(`schedules:schedulesPage.failuresOnly`):c(`schedules:schedulesPage.completionAndFailure`)})})]}),(0,P.jsxs)(`div`,{className:`form-footer [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] flex items-center justify-between gap-[10px] [margin-top:10px]`,children:[(0,P.jsx)(`span`,{children:Z.lastRunAt?c(`schedules:schedulesPage.lastRunTime`,{time:m(Z.lastRunAt,u)}):c(`schedules:schedulesPage.nextRunTime`,{time:W(Z,u)})}),(0,P.jsxs)(i,{size:`lg`,disabled:L||!B(D.targetType,D.prompt,D.workflowId,D.workflowInputs,Q),onClick:async()=>{if(!(!Z||!D)){z(!0),J(``);try{let t=await r(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`PATCH`,body:JSON.stringify(D)});h(t.state),j(U(t.task)),e(c(`schedules:schedulesPage.scheduledTaskSaved`))}catch(e){J(e instanceof Error?e.message:String(e))}finally{z(!1)}}},children:[L?(0,P.jsx)(v,{className:`animate-spin`,size:14}):null,c(L?`schedules:schedulesPage.saving`:`schedules:schedulesPage.saveTask`)]})]})]}),(0,P.jsxs)(E,{children:[(0,P.jsx)(C,{title:c(`schedules:schedulesPage.recentRuns`)}),se.length?se.map(e=>(0,P.jsxs)(`div`,{className:`schedule-run-row [&_>_svg]:text-[var(--text-muted)] [&.completed_>_svg]:text-[var(--success)] [&.failed_>_svg]:text-[var(--danger)] [&.running_>_svg]:text-[var(--star-strong)] [&_>_span]:flex [&_>_span]:min-w-0 [&_>_span]:flex-col [&_>_span]:gap-[4px] [&_strong]:[display:-webkit-box] [&_strong]:overflow-hidden [&_strong]:text-[12px] [&_strong]:leading-[1.4] [&_strong]:[-webkit-box-orient:vertical] [&_strong]:[-webkit-line-clamp:2] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_a]:text-[var(--text-soft)] [&_a]:text-[13px] [&_a]:[text-decoration:underline] [&_a]:[text-underline-offset:2px] [&_>_em]:text-[var(--text-secondary)] [&_>_em]:text-[12px] [&_>_em]:[font-style:normal] [&_>_em]:whitespace-nowrap grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] [border-top:1px_solid_var(--stroke-soft)] [padding:10px_2px] ${e.status}`,children:[e.status===`running`?(0,P.jsx)(v,{className:`animate-spin`,size:15}):e.status===`completed`?(0,P.jsx)(p,{size:15}):(0,P.jsx)(y,{size:15}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:e.status===`running`?c(`schedules:schedulesPage.running2`):e.status===`completed`?e.summary||c(`schedules:schedulesPage.taskCompleted`):e.status===`interrupted`?c(`schedules:schedulesPage.taskInterrupted`):e.error||c(`schedules:schedulesPage.taskFailed`)}),(0,P.jsxs)(`small`,{children:[m(e.startedAt,u),` ·`,` `,e.trigger===`manual`?c(`schedules:schedulesPage.manualRun`):c(`schedules:schedulesPage.scheduledTrigger`),e.durationMs?` · ${c(`schedules:schedulesPage.countSec`,{count:Math.round(e.durationMs/1e3)})}`:``]})]}),(0,P.jsx)(`em`,{children:new Intl.DateTimeFormat(u,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e.startedAt))})]},e.id)):(0,P.jsxs)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center compact`,children:[(0,P.jsx)(k,{size:32}),(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.noRunHistory`)})]})]})]}):(0,P.jsx)(K,{notificationTargets:f.notificationTargets,workflows:Q,defaultCwd:f.defaultCwd,onCreated:t=>{h(t.state),_(t.task.id),e(c(`schedules:schedulesPage.scheduledTaskCreated`))}})]}),oe&&(0,P.jsx)(q,{notificationTargets:f.notificationTargets,workflows:Q,defaultCwd:f.defaultCwd,onClose:()=>Y(!1),onCreated:t=>{Y(!1),h(t.state),_(t.task.id),e(c(`schedules:schedulesPage.scheduledTaskCreated`))}})]})}function K({notificationTargets:e,workflows:t,defaultCwd:n,onCreated:s}){let{t:c}=a(),[l,u]=(0,N.useState)(``),[d,f]=(0,N.useState)(`prompt`),[p,m]=(0,N.useState)(``),[h,g]=(0,N.useState)(``),[_,x]=(0,N.useState)({}),[C,w]=(0,N.useState)(n||``),[T,k]=(0,N.useState)(`daily`),[A,j]=(0,N.useState)(`09:00`),[M,F]=(0,N.useState)(`Asia/Hong_Kong`),[I,L]=(0,N.useState)(1),[R,z]=(0,N.useState)(`hours`),[U,W]=(0,N.useState)(`full-access`),[G,K]=(0,N.useState)(!1),[q,J]=(0,N.useState)(``);return(0,P.jsxs)(E,{children:[(0,P.jsx)(S,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{children:c(`schedules:schedulesPage.newScheduledTask`)}),(0,P.jsx)(`p`,{children:c(`schedules:schedulesPage.youCanContinueEditingTheRunTimeAndNotificationChannelsAfterCreation`)})]})}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.taskName`),(0,P.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:c(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,P.jsx)(V,{targetType:d,prompt:p,workflowId:h,workflowInputs:_,workflows:t,onChange:e=>{e.targetType&&f(e.targetType),e.prompt!==void 0&&m(e.prompt),e.workflowId!==void 0&&g(e.workflowId),e.workflowInputs!==void 0&&x(e.workflowInputs)}}),d===`prompt`&&(0,P.jsx)(H,{value:C,onChange:w}),(0,P.jsxs)(`div`,{className:`form-grid grid gap-[9px] three [.form-grid&]:grid-cols-[repeat(3,minmax(0,1fr))] max-[650px]:[.form-grid&]:grid-cols-[1fr]`,children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.frequency`),(0,P.jsx)(o,{value:T,onChange:e=>k(e.target.value),children:Object.keys(ee).map(e=>(0,P.jsx)(`option`,{value:e,children:re(e,c)},e))})]}),T===`interval`?(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.runInterval`),(0,P.jsxs)(`span`,{className:`schedule-interval-input [&_input]:w-full [&_input]:min-w-0 [&_input]:h-full [&_input]:border-0 [&_input]:[outline:0] [&_input]:bg-transparent [&_input]:p-[0_9px] [&_input]:text-[var(--text)] [&_select]:h-full [&_select]:border-0 [&_select]:[border-left:1px_solid_var(--stroke)] [&_select]:[outline:0] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text-tertiary)] [&_select]:text-[12px] [&_[data-slot='select-trigger']]:w-auto [&_[data-slot='select-trigger']]:min-w-[74px] [&_[data-slot='select-trigger']]:[border-left:1px_solid_var(--stroke)] [&_[data-slot='select-trigger']]:rounded-[0] [&_[data-slot='select-trigger']]:bg-[var(--solid)] [&_[data-slot='select-trigger']]:text-[var(--text-tertiary)] grid h-[31px] grid-cols-[minmax(0,1fr)_auto] overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--surface-subtle)]`,children:[(0,P.jsx)(`input`,{type:`number`,min:`1`,value:I,onChange:e=>L(Number(e.target.value))}),(0,P.jsx)(o,{value:R,onChange:e=>z(e.target.value),children:Object.keys(te).map(e=>(0,P.jsx)(`option`,{value:e,children:ie(e,c)},e))})]})]}):(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.time`),(0,P.jsx)(`input`,{type:`time`,value:A,onChange:e=>j(e.target.value)})]}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.timeZone`),(0,P.jsx)(o,{value:M,onChange:e=>F(e.target.value),children:ne.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),d===`prompt`&&(0,P.jsx)(ae,{value:U,onChange:W})]}),q&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),q]}),(0,P.jsxs)(`div`,{className:`form-footer [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] flex items-center justify-between gap-[10px] [margin-top:10px]`,children:[(0,P.jsx)(`span`,{children:c(`schedules:schedulesPage.enabledAutomaticallyAfterCreation`)}),(0,P.jsxs)(i,{size:`lg`,disabled:G||!l.trim()||!B(d,p,h,_,t),onClick:async()=>{K(!0),J(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);s(await r(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:l,targetType:d,prompt:p,workflowId:h,workflowInputs:_,cwd:C,enabled:!0,frequency:T,time:A,timezone:M,intervalValue:I,intervalUnit:R,executionMode:U,notifications:t,notifyOn:`always`})}))}catch(e){J(e instanceof Error?e.message:String(e))}finally{K(!1)}},children:[G?(0,P.jsx)(v,{className:`animate-spin`,size:14}):(0,P.jsx)(D,{size:14}),c(G?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})}function q({notificationTargets:e,workflows:t,defaultCwd:n,onClose:o,onCreated:s}){let{t:c}=a(),[l,u]=(0,N.useState)(``),[d,p]=(0,N.useState)(`prompt`),[m,h]=(0,N.useState)(``),[g,_]=(0,N.useState)(``),[x,C]=(0,N.useState)({}),[w,T]=(0,N.useState)(n||``),[E,k]=(0,N.useState)(`full-access`),[A,j]=(0,N.useState)(!1),[M,F]=(0,N.useState)(``);return(0,P.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>e.target===e.currentTarget&&o(),children:(0,P.jsxs)(`form`,{className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,onSubmit:async t=>{t.preventDefault(),j(!0),F(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);s(await r(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:l,targetType:d,prompt:m,workflowId:g,workflowInputs:x,cwd:w,enabled:!0,frequency:`daily`,time:`09:00`,timezone:`Asia/Hong_Kong`,executionMode:E,notifications:t,notifyOn:`always`})}))}catch(e){F(e instanceof Error?e.message:String(e))}finally{j(!1)}},children:[(0,P.jsxs)(S,{children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{children:c(`schedules:schedulesPage.newScheduledTask`)}),(0,P.jsx)(`p`,{children:c(`schedules:schedulesPage.youCanContinueSettingTheRunTimeAndNotificationChannelsAfterCreation`)})]}),(0,P.jsx)(i,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":c(`schedules:schedulesPage.closeDialog`),onClick:o,children:(0,P.jsx)(f,{size:17})})]}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.taskName`),(0,P.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:c(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,P.jsx)(V,{targetType:d,prompt:m,workflowId:g,workflowInputs:x,workflows:t,onChange:e=>{e.targetType&&p(e.targetType),e.prompt!==void 0&&h(e.prompt),e.workflowId!==void 0&&_(e.workflowId),e.workflowInputs!==void 0&&C(e.workflowInputs)}}),d===`prompt`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(H,{value:w,onChange:T}),(0,P.jsx)(ae,{value:E,onChange:k})]}),M&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),M]}),(0,P.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,P.jsx)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:o,children:c(`schedules:schedulesPage.cancel`)}),(0,P.jsxs)(i,{size:`lg`,disabled:A||!l.trim()||!B(d,m,g,x,t),children:[A?(0,P.jsx)(v,{className:`animate-spin`,size:14}):(0,P.jsx)(D,{size:14}),c(A?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})})}export{G as SchedulesPage};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./api-B6CluO7V.js";import{t as i}from"./button-XhIEgIsg.js";import{t as a}from"./use-i18n-jYw5s_Yn.js";import{t as o}from"./AppSelect-kDqZkETY.js";import{t as s}from"./WorkspacePicker-Ctf1A8lp.js";import{t as c}from"./message-circle-Bc_EzZop.js";import{t as l}from"./play-N6mg4pFl.js";import{t as u}from"./send-DcLH_sg0.js";import{t as d}from"./trash-2-mhzzyC6i.js";import{t as f}from"./x-bw26XDZM.js";import{At as p,B as m,Dt as h,Nt as g,Pt as _,bt as v,ht as y,i as b,l as x,n as S,o as C,r as w,s as T,t as E,xt as D}from"./index-Bd5A8V1V.js";import{t as O}from"./field-t72VAR-1.js";import{t as k}from"./StarOrbit-BlI6MhVr.js";import{t as A}from"./usePagePrimaryAction-Bw0OFTDZ.js";import{n as j,t as M}from"./pick-system-directory-BnIFt85A.js";var N=e(t(),1),P=n(),F={browser:{name:`通知`,Icon:_},feishu:{name:`飞书`,Icon:g},weixin:{name:`微信`,Icon:c},qq:{name:`QQ`,Icon:c},telegram:{name:`Telegram`,Icon:u}},ee={interval:`每隔一段时间`,daily:`每天`,weekly:`每周`,monthly:`每月`},te={minutes:`分钟`,hours:`小时`,days:`天`},ne=[...new Set([`Asia/Hong_Kong`,`UTC`,...typeof Intl.supportedValuesOf==`function`?Intl.supportedValuesOf(`timeZone`):[]])],I=[`full-access`];function L(e){return e(`schedules:schedulesPage.fullAccessHelp`)}function re(e,t){return t(e===`daily`?`schedules:schedulesPage.daily`:e===`weekly`?`schedules:schedulesPage.weekly`:e===`monthly`?`schedules:schedulesPage.monthly`:`schedules:schedulesPage.atIntervals`)}function ie(e,t){return t(e===`hours`?`schedules:schedulesPage.hours`:e===`days`?`schedules:schedulesPage.days`:`schedules:schedulesPage.minutes`)}function R(e,t){return t(e===`feishu`?`schedules:schedulesPage.feishu`:e===`weixin`?`schedules:schedulesPage.weChat`:e===`qq`?`schedules:schedulesPage.qq`:e===`telegram`?`schedules:schedulesPage.telegram`:`schedules:schedulesPage.browserNotification`)}function ae({value:e,onChange:t}){let{t:n}=a();return(0,P.jsxs)(O,{variant:`control`,children:[n(`schedules:schedulesPage.executionMode`),(0,P.jsx)(o,{value:e,onChange:e=>t(e.target.value),children:I.map(e=>(0,P.jsx)(`option`,{value:e,children:n(`schedules:schedulesPage.fullAccess`)},e))}),(0,P.jsx)(`small`,{children:L(n)})]})}function z(e){return Object.fromEntries((e?.inputs||[]).map(e=>[e.name,e.defaultValue??``]))}function B(e,t,n,r,i){if(e===`prompt`)return!!t.trim();let a=i.find(e=>e.id===n);return a?a.inputs.every(e=>{let t=Object.hasOwn(r,e.name)?r[e.name]:e.defaultValue;return!e.required||t!=null&&t!==``}):!1}function V({targetType:e,prompt:t,workflowId:n,workflowInputs:r,workflows:i,onChange:s}){let{t:c}=a(),l=i.find(e=>e.id===n);return(0,P.jsxs)(`div`,{className:`grid gap-[10px]`,children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.executionTarget`),(0,P.jsxs)(o,{value:e,onChange:e=>{let t=e.target.value,a=i[0];s(t===`workflow`?{targetType:t,workflowId:n||a?.id||``,workflowInputs:n?r:z(a)}:{targetType:t})},children:[(0,P.jsx)(`option`,{value:`prompt`,children:`Prompt`}),(0,P.jsx)(`option`,{value:`workflow`,children:c(`schedules:schedulesPage.workflow`)})]})]}),e===`prompt`?(0,P.jsxs)(O,{variant:`control`,children:[`Prompt`,(0,P.jsx)(`textarea`,{value:t,onChange:e=>s({prompt:e.target.value}),placeholder:c(`schedules:schedulesPage.describeTheWorkTheAgentShouldCompleteEachTime`)})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.workflow`),(0,P.jsxs)(o,{value:n,onChange:e=>{let t=i.find(t=>t.id===e.target.value);s({workflowId:e.target.value,workflowInputs:z(t)})},children:[(0,P.jsx)(`option`,{value:``,children:c(`schedules:schedulesPage.selectPublishedWorkflow`)}),i.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.revision]},e.id))]}),(0,P.jsx)(`small`,{children:l?.description||(i.length?c(`schedules:schedulesPage.workflowUsesItsOwnRuntimeSettings`):c(`schedules:schedulesPage.noPublishedWorkflows`))})]}),l?.inputs.length?(0,P.jsxs)(`div`,{className:`grid gap-[8px]`,children:[(0,P.jsxs)(`div`,{className:`schedule-workflow-inputs-heading [&_strong]:text-[12px] [&_small]:text-[var(--text-muted)] [&_small]:text-[11px] [&_small]:text-right max-[650px]:items-start max-[650px]:flex-col max-[650px]:gap-[2px] max-[650px]:[&_small]:text-left flex [align-items:baseline] justify-between gap-[12px]`,children:[(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.workflowInputs`)}),(0,P.jsx)(`small`,{children:c(`schedules:schedulesPage.workflowInputsHelp`)})]}),(0,P.jsx)(`div`,{className:`schedule-workflow-inputs [&_input[type='checkbox']]:w-[16px] [&_input[type='checkbox']]:h-[16px] [&_input[type='checkbox']]:[justify-self:end] max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(2,minmax(0,1fr))] gap-[8px]`,children:l.inputs.map(e=>(0,P.jsxs)(O,{variant:`control`,className:e.type===`boolean`?`grid grid-cols-[minmax(0,1fr)_auto] items-center`:void 0,children:[e.label,e.required?` *`:``,e.type===`boolean`?(0,P.jsx)(`input`,{type:`checkbox`,checked:!!r[e.name],onChange:t=>s({workflowInputs:{...r,[e.name]:t.target.checked}})}):(0,P.jsx)(`input`,{type:e.type===`number`?`number`:`text`,required:e.required,value:String(r[e.name]??``),onChange:t=>s({workflowInputs:{...r,[e.name]:t.target.value}})}),e.description&&(0,P.jsx)(`small`,{children:e.description})]},e.id))})]}):null]})]})}function H({value:e,onChange:t}){let{t:n}=a(),[r,o]=(0,N.useState)(``),[c,l]=(0,N.useState)(!1),u=async()=>{if(o(``),!M()){l(!0);return}try{let n=await j(e);n&&t(n)}catch(e){o(e instanceof Error?e.message:String(e))}};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(O,{variant:`control`,children:[n(`schedules:schedulesPage.workingDirectory`),(0,P.jsxs)(`span`,{className:`schedule-workspace-input [&_input]:min-w-0 [&_input]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] grid grid-cols-[minmax(0,1fr)_auto] gap-[6px]`,children:[(0,P.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),placeholder:n(`schedules:schedulesPage.enterTheProjectSAbsolutePath`)}),(0,P.jsxs)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:()=>void u(),children:[(0,P.jsx)(h,{size:13}),n(`schedules:schedulesPage.browseDirectories`)]})]}),(0,P.jsx)(`small`,{children:n(`schedules:schedulesPage.theScheduledAgentWillRunInThisDirectory`)})]}),r&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),r]}),(0,P.jsx)(s,{open:c,initialPath:e,description:n(`common:workspacePicker.selectWorkspaceForSchedule`),onOpenChange:l,onSelect:e=>t(e)})]})}function U(e){return{id:e.id,name:e.name,targetType:e.targetType||`prompt`,prompt:e.prompt,workflowId:e.workflowId||``,workflowInputs:e.workflowInputs||{},enabled:e.enabled,frequency:e.frequency,intervalValue:e.intervalValue||1,intervalUnit:e.intervalUnit||`hours`,time:e.time,timezone:e.timezone,dayOfWeek:e.dayOfWeek,dayOfMonth:e.dayOfMonth,cwd:e.cwd,executionMode:e.executionMode||`full-access`,model:e.model,notifications:e.notifications||[],notifyOn:e.notifyOn||`always`}}function W(e,t=`zh-CN`){return!e.enabled||!e.nextRunAt?t===`en-US`?`Paused`:`已暂停`:new Intl.DateTimeFormat(t,{timeZone:e.timezone,dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.nextRunAt))}function G({notify:e,registerPrimaryAction:t,openNotificationSettings:n,requestConfirm:s}){let{t:c,language:u}=a(),[f,h]=(0,N.useState)({tasks:[],runs:[],notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1},qq:{enabled:!1},telegram:{enabled:!1}},workflows:[],defaultCwd:``}),[g,_]=(0,N.useState)(``),[D,j]=(0,N.useState)(null),[M,I]=(0,N.useState)(!0),[L,z]=(0,N.useState)(!1),[G,J]=(0,N.useState)(``),[oe,Y]=(0,N.useState)(!1);A(t,()=>Y(!0));let X=(0,N.useCallback)(async()=>{try{let e=await r(`/api/schedules`);h(e),_(t=>e.tasks.some(e=>e.id===t)?t:e.tasks[0]?.id||``)}catch(e){J(e instanceof Error?e.message:String(e))}finally{I(!1)}},[]);(0,N.useEffect)(()=>{X()},[X]),(0,N.useEffect)(()=>{let e=window.setInterval(X,f.tasks.some(e=>e.lastStatus===`running`)?2e3:1e4);return()=>window.clearInterval(e)},[f.tasks,X]);let Z=f.tasks.find(e=>e.id===g),Q=f.workflows||[];(0,N.useEffect)(()=>{j(e=>Z?e?.id===Z.id?e:U(Z):null)},[Z]);let se=(0,N.useMemo)(()=>f.runs.filter(e=>e.taskId===g).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime()).slice(0,20),[f.runs,g]),$=e=>j(t=>t&&{...t,...e}),ce=e=>{D&&$({notifications:D.notifications.includes(e)?D.notifications.filter(t=>t!==e):[...D.notifications,e]})};return M?(0,P.jsxs)(w,{children:[(0,P.jsx)(v,{className:`animate-spin`,size:23}),(0,P.jsx)(`h2`,{children:c(`schedules:schedulesPage.loadingScheduledTasks`)})]}):(0,P.jsxs)(P.Fragment,{children:[G&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),G]}),(0,P.jsxs)(`div`,{className:`split-list-detail grid min-h-[100%] min-w-0 grid-cols-[minmax(0,310px)_minmax(0,1fr)] gap-[12px] overflow-x-hidden max-[900px]:grid-cols-1 max-[650px]:gap-[8px]`,children:[(0,P.jsxs)(E,{className:`selection-list [.config-layout_>_&]:max-h-[calc(100dvh_-_280px)] [.config-layout_>_&]:overflow-y-auto max-[900px]:max-h-[300px] min-h-0 overflow-auto`,children:[(0,P.jsx)(C,{title:c(`schedules:schedulesPage.taskQueue`)}),f.tasks.length?f.tasks.map(e=>(0,P.jsx)(`div`,{className:`schedule-list-item hover:bg-[var(--accent-soft)] [&.active]:bg-[var(--accent-soft)] [&_>_button]:grid [&_>_button]:min-w-0 [&_>_button]:min-h-[68px] [&_>_button]:grid-cols-[minmax(0,1fr)_auto] [&_>_button]:items-center [&_>_button]:gap-[8px] [&_>_button]:border-0 [&_>_button]:bg-transparent [&_>_button]:p-[6px_2px] [&_>_button]:text-left [&_>_button_>_span]:flex [&_>_button_>_span]:min-w-0 [&_>_button_>_span]:flex-col [&_>_button_>_span]:gap-[5px] [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap [&_small]:overflow-hidden [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_em]:flex [&_em]:items-center [&_em]:gap-[4px] [&_em]:text-[var(--text-muted)] [&_em]:text-[13px] [&_em]:[font-style:normal] grid grid-cols-[minmax(0,1fr)_auto] items-center gap-[5px] [border-top:1px_solid_var(--stroke-soft)] rounded-[var(--r-sm)] [padding:3px_5px] ${g===e.id?`active`:``}`,children:(0,P.jsxs)(`button`,{onClick:()=>_(e.id),children:[(0,P.jsxs)(`span`,{children:[(0,P.jsxs)(`div`,{className:`schedule-item-head [.schedule-list-item_&]:flex [.schedule-list-item_&]:min-w-0 [.schedule-list-item_&]:items-center [.schedule-list-item_&]:gap-[6px] [.schedule-list-item_&_strong]:flex-1 [.schedule-list-item_&_strong]:min-w-0`,children:[(0,P.jsx)(`strong`,{children:e.name}),(0,P.jsx)(x,{tone:e.enabled?`green`:`gray`,children:e.enabled?c(`schedules:schedulesPage.enabled`):c(`schedules:schedulesPage.pause`)})]}),(0,P.jsx)(`small`,{children:e.targetType===`workflow`?Q.find(t=>t.id===e.workflowId)?.name||c(`schedules:schedulesPage.workflowUnavailable`):e.prompt})]}),(0,P.jsx)(`em`,{children:W(e,u)})]})},e.id)):(0,P.jsxs)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center`,children:[(0,P.jsx)(k,{size:38}),(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.theTimelineIsStillUnlit`)}),(0,P.jsx)(`span`,{children:c(`schedules:schedulesPage.createATaskAndLetItSetOutAutomaticallyAtTheAppointedTime`)})]})]}),Z&&D?(0,P.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,P.jsxs)(E,{children:[(0,P.jsxs)(S,{className:`max-[650px]:flex-wrap max-[650px]:items-start`,children:[(0,P.jsx)(`h2`,{className:`min-w-0 break-words`,children:D.name}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-[5px] max-[650px]:w-full`,children:[(0,P.jsx)(T,{value:D.enabled,onChange:e=>$({enabled:e}),ariaLabel:D.name}),(0,P.jsxs)(i,{size:`lg`,disabled:L||Z.lastStatus===`running`,onClick:async()=>{if(Z){z(!0),J(``);try{await r(`/api/schedules/${encodeURIComponent(Z.id)}/run`,{method:`POST`,body:`{}`}),await X(),e(c(`schedules:schedulesPage.scheduledTaskStarted`))}catch(e){J(e instanceof Error?e.message:String(e))}finally{z(!1)}}},children:[Z.lastStatus===`running`?(0,P.jsx)(v,{className:`animate-spin`,size:14}):(0,P.jsx)(l,{size:14}),Z.lastStatus===`running`?c(`schedules:schedulesPage.running`):c(`schedules:schedulesPage.runNow`)]}),(0,P.jsx)(i,{variant:`destructive`,size:`icon`,title:c(`schedules:schedulesPage.deleteTask`),"aria-label":c(`schedules:schedulesPage.deleteTask`),onClick:async()=>{if(Z&&await s({title:c(`schedules:schedulesPage.deleteScheduledTask`),message:c(`schedules:schedulesPage.deleteScheduledTaskNameAndItsRunHistory`,{name:Z.name}),confirmLabel:c(`schedules:schedulesPage.delete`)}))try{await r(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`DELETE`}),await X(),e(c(`schedules:schedulesPage.scheduledTaskDeleted`))}catch(e){J(e instanceof Error?e.message:String(e))}},children:(0,P.jsx)(d,{size:14})})]})]}),(0,P.jsx)(V,{targetType:D.targetType,prompt:D.prompt,workflowId:D.workflowId,workflowInputs:D.workflowInputs,workflows:Q,onChange:$}),D.targetType===`prompt`&&(0,P.jsx)(H,{value:D.cwd,onChange:e=>$({cwd:e})}),(0,P.jsxs)(`div`,{className:`form-grid grid gap-[9px] three [.form-grid&]:grid-cols-[repeat(3,minmax(0,1fr))] max-[650px]:[.form-grid&]:grid-cols-[1fr]`,children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.frequency`),(0,P.jsx)(o,{value:D.frequency,onChange:e=>$({frequency:e.target.value}),children:Object.keys(ee).map(e=>(0,P.jsx)(`option`,{value:e,children:re(e,c)},e))})]}),D.frequency===`interval`?(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.runInterval`),(0,P.jsxs)(`span`,{className:`schedule-interval-input [&_input]:w-full [&_input]:min-w-0 [&_input]:h-full [&_input]:border-0 [&_input]:[outline:0] [&_input]:bg-transparent [&_input]:p-[0_9px] [&_input]:text-[var(--text)] [&_select]:h-full [&_select]:border-0 [&_select]:[border-left:1px_solid_var(--stroke)] [&_select]:[outline:0] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text-tertiary)] [&_select]:text-[12px] [&_[data-slot='select-trigger']]:w-auto [&_[data-slot='select-trigger']]:min-w-[74px] [&_[data-slot='select-trigger']]:[border-left:1px_solid_var(--stroke)] [&_[data-slot='select-trigger']]:rounded-[0] [&_[data-slot='select-trigger']]:bg-[var(--solid)] [&_[data-slot='select-trigger']]:text-[var(--text-tertiary)] grid h-[31px] grid-cols-[minmax(0,1fr)_auto] overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--surface-subtle)]`,children:[(0,P.jsx)(`input`,{type:`number`,min:`1`,value:D.intervalValue,onChange:e=>$({intervalValue:Number(e.target.value)})}),(0,P.jsx)(o,{value:D.intervalUnit,onChange:e=>$({intervalUnit:e.target.value}),children:Object.keys(te).map(e=>(0,P.jsx)(`option`,{value:e,children:ie(e,c)},e))})]})]}):(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.time`),(0,P.jsx)(`input`,{type:`time`,value:D.time,onChange:e=>$({time:e.target.value})})]}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.timeZone`),(0,P.jsx)(o,{value:D.timezone,onChange:e=>$({timezone:e.target.value}),children:ne.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),D.targetType===`prompt`&&(0,P.jsx)(ae,{value:D.executionMode,onChange:e=>$({executionMode:e})})]}),(0,P.jsxs)(`div`,{className:`schedule-notification-section [&_>_div:first-child]:flex [&_>_div:first-child]:items-center [&_>_div:first-child]:justify-between [&_>_div:first-child]:gap-[8px] [&_>_div:first-child_strong]:text-[13px] [&_>_p]:mt-[4px] [&_>_p]:text-[var(--text-muted)] [&_>_p]:text-[13px] [margin-top:13px] [border-top:1px_solid_var(--stroke-soft)] [padding-top:12px]`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.notificationChannels`)}),(0,P.jsx)(`button`,{type:`button`,className:`text-button hover:text-[var(--text)] border-0 bg-transparent text-[var(--text-soft)] text-[12px] font-[600] [text-decoration:underline] [text-underline-offset:2px]`,onClick:n,children:c(`schedules:schedulesPage.editTemplates`)})]}),(0,P.jsx)(`p`,{children:c(`schedules:schedulesPage.notificationChannelsHelp`)}),(0,P.jsx)(`div`,{className:`schedule-notification-targets [&_>_button]:grid [&_>_button]:min-h-[52px] [&_>_button]:grid-cols-[auto_minmax(0,1fr)_auto] [&_>_button]:items-center [&_>_button]:gap-[7px] [&_>_button]:[border:1px_solid_var(--stroke)] [&_>_button]:rounded-[var(--r-sm)] [&_>_button]:bg-[var(--surface-subtle)] [&_>_button]:p-[7px_8px] [&_>_button]:text-left [&_>_button_>_span]:flex [&_>_button_>_span]:min-w-0 [&_>_button_>_span]:flex-col [&_>_button_>_span]:gap-[3px] [&_strong]:text-[13px] [&_small]:overflow-hidden [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_>_button_>_svg:last-child]:text-[var(--control-muted)] [&_>_button.selected]:border-[var(--focus)] [&_>_button.selected]:bg-[var(--accent-soft)] [&_>_button.selected]:text-[var(--star-strong)] [&_>_button.selected_>_svg:last-child]:text-[var(--success)] max-[650px]:grid-cols-[1fr] grid grid-cols-[repeat(5,minmax(0,1fr))] gap-[7px] [margin-top:9px]`,children:Object.entries(F).map(([e,t])=>{let n=t.Icon,r=D.notifications.includes(e);return(0,P.jsxs)(`button`,{type:`button`,className:r?`selected`:``,onClick:()=>ce(e),children:[(0,P.jsx)(n,{size:15}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:R(e,c)}),(0,P.jsx)(`small`,{children:f.notificationTargets[e].enabled?c(`schedules:schedulesPage.configured`):c(`schedules:schedulesPage.notConfigured`)})]}),(0,P.jsx)(p,{size:15})]},e)})}),(0,P.jsx)(`div`,{className:`flex items-center gap-[6px] [margin-top:9px]`,children:(0,P.jsx)(`button`,{type:`button`,className:`schedule-notification-chip [&.selected]:border-[var(--control-selected-border)] [&.selected]:bg-[var(--control-selected-bg)] [&.selected]:text-[var(--control-selected-text)] [&.selected]:shadow-[var(--sh-1)] dark:bg-[var(--surface-subtle)] inline-flex h-[32px] items-center gap-[4px] [border:1px_solid_var(--stroke)] rounded-[var(--r-pill)] bg-[var(--surface-subtle)] text-[var(--text-muted)] [padding:0_10px] text-[13px] font-[600] ${D.notifyOn===`failure`?`selected`:``}`,onClick:()=>$({notifyOn:D.notifyOn===`failure`?`always`:`failure`}),children:D.notifyOn===`failure`?c(`schedules:schedulesPage.failuresOnly`):c(`schedules:schedulesPage.completionAndFailure`)})})]}),(0,P.jsxs)(`div`,{className:`form-footer [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] flex items-center justify-between gap-[10px] [margin-top:10px]`,children:[(0,P.jsx)(`span`,{children:Z.lastRunAt?c(`schedules:schedulesPage.lastRunTime`,{time:m(Z.lastRunAt,u)}):c(`schedules:schedulesPage.nextRunTime`,{time:W(Z,u)})}),(0,P.jsxs)(i,{size:`lg`,disabled:L||!B(D.targetType,D.prompt,D.workflowId,D.workflowInputs,Q),onClick:async()=>{if(!(!Z||!D)){z(!0),J(``);try{let t=await r(`/api/schedules/${encodeURIComponent(Z.id)}`,{method:`PATCH`,body:JSON.stringify(D)});h(t.state),j(U(t.task)),e(c(`schedules:schedulesPage.scheduledTaskSaved`))}catch(e){J(e instanceof Error?e.message:String(e))}finally{z(!1)}}},children:[L?(0,P.jsx)(v,{className:`animate-spin`,size:14}):null,c(L?`schedules:schedulesPage.saving`:`schedules:schedulesPage.saveTask`)]})]})]}),(0,P.jsxs)(E,{children:[(0,P.jsx)(C,{title:c(`schedules:schedulesPage.recentRuns`)}),se.length?se.map(e=>(0,P.jsxs)(`div`,{className:`schedule-run-row [&_>_svg]:text-[var(--text-muted)] [&.completed_>_svg]:text-[var(--success)] [&.failed_>_svg]:text-[var(--danger)] [&.running_>_svg]:text-[var(--star-strong)] [&_>_span]:flex [&_>_span]:min-w-0 [&_>_span]:flex-col [&_>_span]:gap-[4px] [&_strong]:[display:-webkit-box] [&_strong]:overflow-hidden [&_strong]:text-[12px] [&_strong]:leading-[1.4] [&_strong]:[-webkit-box-orient:vertical] [&_strong]:[-webkit-line-clamp:2] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_a]:text-[var(--text-soft)] [&_a]:text-[13px] [&_a]:[text-decoration:underline] [&_a]:[text-underline-offset:2px] [&_>_em]:text-[var(--text-secondary)] [&_>_em]:text-[12px] [&_>_em]:[font-style:normal] [&_>_em]:whitespace-nowrap grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] [border-top:1px_solid_var(--stroke-soft)] [padding:10px_2px] ${e.status}`,children:[e.status===`running`?(0,P.jsx)(v,{className:`animate-spin`,size:15}):e.status===`completed`?(0,P.jsx)(p,{size:15}):(0,P.jsx)(y,{size:15}),(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:e.status===`running`?c(`schedules:schedulesPage.running2`):e.status===`completed`?e.summary||c(`schedules:schedulesPage.taskCompleted`):e.status===`interrupted`?c(`schedules:schedulesPage.taskInterrupted`):e.error||c(`schedules:schedulesPage.taskFailed`)}),(0,P.jsxs)(`small`,{children:[m(e.startedAt,u),` ·`,` `,e.trigger===`manual`?c(`schedules:schedulesPage.manualRun`):c(`schedules:schedulesPage.scheduledTrigger`),e.durationMs?` · ${c(`schedules:schedulesPage.countSec`,{count:Math.round(e.durationMs/1e3)})}`:``]})]}),(0,P.jsx)(`em`,{children:new Intl.DateTimeFormat(u,{hour:`2-digit`,minute:`2-digit`}).format(new Date(e.startedAt))})]},e.id)):(0,P.jsxs)(`div`,{className:`channel-route-empty [&_strong]:mt-[9px] [&_strong]:text-[var(--text)] [&_strong]:text-[12px] [&_span]:mt-[4px] [&_span]:text-[13px] [&.compact]:min-h-[110px] [.workflow-assets-panel_&]:min-h-[150px] [.workflow-assets-panel_&]:border-0 [.workflow-assets-panel_&]:bg-transparent grid min-h-[185px] place-content-center justify-items-center text-[var(--text-muted)] text-center compact`,children:[(0,P.jsx)(k,{size:32}),(0,P.jsx)(`strong`,{children:c(`schedules:schedulesPage.noRunHistory`)})]})]})]}):(0,P.jsx)(K,{notificationTargets:f.notificationTargets,workflows:Q,defaultCwd:f.defaultCwd,onCreated:t=>{h(t.state),_(t.task.id),e(c(`schedules:schedulesPage.scheduledTaskCreated`))}})]}),oe&&(0,P.jsx)(q,{notificationTargets:f.notificationTargets,workflows:Q,defaultCwd:f.defaultCwd,onClose:()=>Y(!1),onCreated:t=>{Y(!1),h(t.state),_(t.task.id),e(c(`schedules:schedulesPage.scheduledTaskCreated`))}})]})}function K({notificationTargets:e,workflows:t,defaultCwd:n,onCreated:s}){let{t:c}=a(),[l,u]=(0,N.useState)(``),[d,f]=(0,N.useState)(`prompt`),[p,m]=(0,N.useState)(``),[h,g]=(0,N.useState)(``),[_,x]=(0,N.useState)({}),[C,w]=(0,N.useState)(n||``),[T,k]=(0,N.useState)(`daily`),[A,j]=(0,N.useState)(`09:00`),[M,F]=(0,N.useState)(`Asia/Hong_Kong`),[I,L]=(0,N.useState)(1),[R,z]=(0,N.useState)(`hours`),[U,W]=(0,N.useState)(`full-access`),[G,K]=(0,N.useState)(!1),[q,J]=(0,N.useState)(``);return(0,P.jsxs)(E,{children:[(0,P.jsx)(S,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{children:c(`schedules:schedulesPage.newScheduledTask`)}),(0,P.jsx)(`p`,{children:c(`schedules:schedulesPage.youCanContinueEditingTheRunTimeAndNotificationChannelsAfterCreation`)})]})}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.taskName`),(0,P.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:c(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,P.jsx)(V,{targetType:d,prompt:p,workflowId:h,workflowInputs:_,workflows:t,onChange:e=>{e.targetType&&f(e.targetType),e.prompt!==void 0&&m(e.prompt),e.workflowId!==void 0&&g(e.workflowId),e.workflowInputs!==void 0&&x(e.workflowInputs)}}),d===`prompt`&&(0,P.jsx)(H,{value:C,onChange:w}),(0,P.jsxs)(`div`,{className:`form-grid grid gap-[9px] three [.form-grid&]:grid-cols-[repeat(3,minmax(0,1fr))] max-[650px]:[.form-grid&]:grid-cols-[1fr]`,children:[(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.frequency`),(0,P.jsx)(o,{value:T,onChange:e=>k(e.target.value),children:Object.keys(ee).map(e=>(0,P.jsx)(`option`,{value:e,children:re(e,c)},e))})]}),T===`interval`?(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.runInterval`),(0,P.jsxs)(`span`,{className:`schedule-interval-input [&_input]:w-full [&_input]:min-w-0 [&_input]:h-full [&_input]:border-0 [&_input]:[outline:0] [&_input]:bg-transparent [&_input]:p-[0_9px] [&_input]:text-[var(--text)] [&_select]:h-full [&_select]:border-0 [&_select]:[border-left:1px_solid_var(--stroke)] [&_select]:[outline:0] [&_select]:bg-[var(--solid)] [&_select]:p-[0_8px] [&_select]:text-[var(--text-tertiary)] [&_select]:text-[12px] [&_[data-slot='select-trigger']]:w-auto [&_[data-slot='select-trigger']]:min-w-[74px] [&_[data-slot='select-trigger']]:[border-left:1px_solid_var(--stroke)] [&_[data-slot='select-trigger']]:rounded-[0] [&_[data-slot='select-trigger']]:bg-[var(--solid)] [&_[data-slot='select-trigger']]:text-[var(--text-tertiary)] grid h-[31px] grid-cols-[minmax(0,1fr)_auto] overflow-hidden [border:1px_solid_var(--stroke)] rounded-[var(--r-xs)] bg-[var(--surface-subtle)]`,children:[(0,P.jsx)(`input`,{type:`number`,min:`1`,value:I,onChange:e=>L(Number(e.target.value))}),(0,P.jsx)(o,{value:R,onChange:e=>z(e.target.value),children:Object.keys(te).map(e=>(0,P.jsx)(`option`,{value:e,children:ie(e,c)},e))})]})]}):(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.time`),(0,P.jsx)(`input`,{type:`time`,value:A,onChange:e=>j(e.target.value)})]}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.timeZone`),(0,P.jsx)(o,{value:M,onChange:e=>F(e.target.value),children:ne.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),d===`prompt`&&(0,P.jsx)(ae,{value:U,onChange:W})]}),q&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),q]}),(0,P.jsxs)(`div`,{className:`form-footer [&_>_span]:text-[var(--text-muted)] [&_>_span]:text-[13px] flex items-center justify-between gap-[10px] [margin-top:10px]`,children:[(0,P.jsx)(`span`,{children:c(`schedules:schedulesPage.enabledAutomaticallyAfterCreation`)}),(0,P.jsxs)(i,{size:`lg`,disabled:G||!l.trim()||!B(d,p,h,_,t),onClick:async()=>{K(!0),J(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);s(await r(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:l,targetType:d,prompt:p,workflowId:h,workflowInputs:_,cwd:C,enabled:!0,frequency:T,time:A,timezone:M,intervalValue:I,intervalUnit:R,executionMode:U,notifications:t,notifyOn:`always`})}))}catch(e){J(e instanceof Error?e.message:String(e))}finally{K(!1)}},children:[G?(0,P.jsx)(v,{className:`animate-spin`,size:14}):(0,P.jsx)(D,{size:14}),c(G?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})}function q({notificationTargets:e,workflows:t,defaultCwd:n,onClose:o,onCreated:s}){let{t:c}=a(),[l,u]=(0,N.useState)(``),[d,p]=(0,N.useState)(`prompt`),[m,h]=(0,N.useState)(``),[g,_]=(0,N.useState)(``),[x,C]=(0,N.useState)({}),[w,T]=(0,N.useState)(n||``),[E,k]=(0,N.useState)(`full-access`),[A,j]=(0,N.useState)(!1),[M,F]=(0,N.useState)(``);return(0,P.jsx)(`div`,{className:`modal-backdrop max-[650px]:p-[8px] fixed z-[70] inset-0 grid place-items-center overflow-y-auto bg-[var(--modal-overlay)] [backdrop-filter:blur(3px)] [padding:20px] [overscroll-behavior:contain] [animation:fade-in_var(--d1)_var(--ease-out)]`,onMouseDown:e=>e.target===e.currentTarget&&o(),children:(0,P.jsxs)(`form`,{className:`modal !w-[min(430px,100%)] max-h-[calc(100dvh_-_40px)] overflow-y-auto [overscroll-behavior:contain] [border:1px_solid_var(--surface-highlight)] rounded-[var(--r-md)] bg-[var(--solid)] p-[18px] shadow-[0_26px_70px_-25px_var(--shadow-strong)] [animation:modal-in_var(--d2)_var(--ease-out)] max-[650px]:max-h-[calc(100dvh_-_16px)]`,onSubmit:async t=>{t.preventDefault(),j(!0),F(``);try{let t=Object.entries(e).filter(([,e])=>e.enabled).map(([e])=>e);s(await r(`/api/schedules`,{method:`POST`,body:JSON.stringify({name:l,targetType:d,prompt:m,workflowId:g,workflowInputs:x,cwd:w,enabled:!0,frequency:`daily`,time:`09:00`,timezone:`Asia/Hong_Kong`,executionMode:E,notifications:t,notifyOn:`always`})}))}catch(e){F(e instanceof Error?e.message:String(e))}finally{j(!1)}},children:[(0,P.jsxs)(S,{children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h2`,{children:c(`schedules:schedulesPage.newScheduledTask`)}),(0,P.jsx)(`p`,{children:c(`schedules:schedulesPage.youCanContinueSettingTheRunTimeAndNotificationChannelsAfterCreation`)})]}),(0,P.jsx)(i,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":c(`schedules:schedulesPage.closeDialog`),onClick:o,children:(0,P.jsx)(f,{size:17})})]}),(0,P.jsxs)(O,{variant:`control`,children:[c(`schedules:schedulesPage.taskName`),(0,P.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:c(`schedules:schedulesPage.forExampleDailyCodeReview`)})]}),(0,P.jsx)(V,{targetType:d,prompt:m,workflowId:g,workflowInputs:x,workflows:t,onChange:e=>{e.targetType&&p(e.targetType),e.prompt!==void 0&&h(e.prompt),e.workflowId!==void 0&&_(e.workflowId),e.workflowInputs!==void 0&&C(e.workflowInputs)}}),d===`prompt`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(H,{value:w,onChange:T}),(0,P.jsx)(ae,{value:E,onChange:k})]}),M&&(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{size:13}),M]}),(0,P.jsxs)(`div`,{className:`flex justify-end gap-[8px] [margin-top:18px]`,children:[(0,P.jsx)(i,{type:`button`,variant:`outline`,size:`lg`,className:`bg-surface-subtle`,onClick:o,children:c(`schedules:schedulesPage.cancel`)}),(0,P.jsxs)(i,{size:`lg`,disabled:A||!l.trim()||!B(d,m,g,x,t),children:[A?(0,P.jsx)(v,{className:`animate-spin`,size:14}):(0,P.jsx)(D,{size:14}),c(A?`schedules:schedulesPage.creating`:`schedules:schedulesPage.createTask`)]})]})]})})}export{G as SchedulesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./api-B6CluO7V.js";import{n as i,t as a}from"./button-XhIEgIsg.js";import{t as o}from"./use-i18n-yjKc6F2w.js";import{t as s}from"./file-code-corner-BKkXAMHR.js";import{t as c}from"./image-Dh7-wI1d.js";import{t as l}from"./save-CVL5N6eP.js";import{t as u}from"./trash-2-mhzzyC6i.js";import{t as d}from"./wrench-BqeVhocX.js";import{bt as f,c as p,gt as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./index-CAWCOpxG.js";import{t as x}from"./usePagePrimaryAction-Bw0OFTDZ.js";var S=i(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),C=e(t(),1),w=n(),T=[`all`,`global`,`project`,`design`,`code`,`docs`,`privileged`];function E(e,t=``){return t?`${e}${e.includes(`?`)?`&`:`?`}sessionId=${encodeURIComponent(t)}`:e}function D(e,t){return t(e===`global`?`skills:skillsPage.global`:e===`project`?`skills:skillsPage.project`:e===`design`?`skills:skillsPage.design`:e===`code`?`skills:skillsPage.code`:e===`docs`?`skills:skillsPage.documents`:e===`privileged`?`skills:skillsPage.highPrivilege`:`skills:skillsPage.all`)}function O(e){let t=`${e?.name||``} ${e?.description||``}`.toLowerCase();return/image|visual|design|figma|svg|图片|视觉|设计/.test(t)?c:/doc|pdf|文档|说明/.test(t)?s:/install|package|market|安装|包/.test(t)?S:/code|test|plugin|skill|代码|测试|插件|技能/.test(t)?d:m}function k(e,t){if(t===`all`)return!0;if(t===`global`)return e.sourceInfo?.scope!==`project`;if(t===`project`)return e.sourceInfo?.scope===`project`;let n=`${e.name} ${e.description} ${(e.allowedTools||[]).join(` `)}`.toLowerCase();return t===`design`?/image|visual|design|figma|svg|图片|视觉|设计/.test(n):t===`code`?/code|test|plugin|代码|测试|插件/.test(n):t===`docs`?/doc|pdf|文档|说明/.test(n):t!==`privileged`||(e.allowedTools||[]).some(e=>[`bash`,`write`,`edit`].includes(e))}function A({notify:e,query:t=``,activeSessionId:n=``,registerPrimaryAction:i,requestText:s,requestConfirm:c}){let{t:d}=o(),[m,A]=(0,C.useState)(null),[j,M]=(0,C.useState)(``),[N,P]=(0,C.useState)(`all`),[F,I]=(0,C.useState)(!1),[L,R]=(0,C.useState)(!0),[,z]=(0,C.useState)(``),B=(0,C.useCallback)(async()=>{z(``);try{let e=await r(E(`/api/skills`,n));return A(e),M(t=>e.skills.some(e=>e.id===t)?t:e.skills[0]?.id||``),e}catch(e){return z(e instanceof Error?e.message:String(e)),null}finally{R(!1)}},[n]);(0,C.useEffect)(()=>{B()},[B]);let V=(0,C.useCallback)(async()=>{let t=await s?.({title:d(`skills:skillsPage.importGlobalSkill`),message:d(`skills:skillsPage.globalSkillSourceHelp`),inputLabel:d(`skills:skillsPage.skillSource`),placeholder:`E:\\path\\to\\skill, npm:@scope/package, or https://github.com/...`,maxLength:2e3,confirmLabel:d(`skills:skillsPage.continue`)});if(t?.trim()&&await c?.({title:d(`skills:skillsPage.importGlobalSkill`),message:d(`skills:skillsPage.skillsProvideInstructionsToTheAgentAndMayIncludeExecutableScriptsConfirmThatYouTrustTheSource`),confirmLabel:d(`skills:skillsPage.import`),tone:`danger`})!==!1){I(!0),z(``);try{let i=await r(E(`/api/skills/install`,n),{method:`POST`,body:JSON.stringify({source:t})});A(i),M(i.installed?.[0]?.id||i.skills[0]?.id||``),e(d(`skills:skillsPage.skillInstalledAndLoadedIntoTheAgentRuntime`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);z(n),e(n,`error`)}finally{I(!1)}}},[n,e,c,s,d]);if(x(i,V),L&&!m)return(0,w.jsx)(`div`,{className:`skills-page flex min-h-[100%] flex-col gap-[12px]`,children:(0,w.jsxs)(v,{children:[(0,w.jsx)(f,{className:`animate-spin`,size:23}),(0,w.jsx)(`h2`,{children:d(`skills:skillsPage.loadingSkills`)}),(0,w.jsx)(`p`,{children:d(`skills:skillsPage.scanningSkillDirectoriesAndConfiguredPackages`)})]})});let H=m?.skills||[],U=H.filter(e=>k(e,N)&&`${e.name} ${e.description}`.toLowerCase().includes(t.toLowerCase())),W=H.filter(e=>e.sourceInfo?.scope!==`project`),G=H.filter(e=>e.sourceInfo?.scope===`project`),K=U.filter(e=>e.sourceInfo?.scope!==`project`),q=U.filter(e=>e.sourceInfo?.scope===`project`),J=H.find(e=>e.id===j)||U[0]||H[0]||null,Y=(m?.packages||[]).map(e=>({source:e.source,description:e.scope===`project`?d(`skills:skillsPage.projectScopedConfiguration`):d(`skills:skillsPage.userScopedConfiguration`),status:e.installed?d(`skills:skillsPage.locallyReady`):d(`skills:skillsPage.notMaterialized`),tone:e.installed?`green`:`gray`})).filter(e=>`${e.source} ${e.description}`.toLowerCase().includes(t.toLowerCase())),X=async(e,t)=>{if(e){I(!0),z(``);try{let i=await r(E(`/api/skills/${encodeURIComponent(e.id)}`,n),{method:`PATCH`,body:JSON.stringify(t)});A(e=>{if(!e)return e;let t=e.skills.map(e=>e.id===i.id?i:e);return{...e,skills:t,counts:{...e.counts,enabled:t.filter(e=>e.enabled).length,modelInvocable:t.filter(e=>e.enabled&&e.modelInvocationEnabled).length}}})}catch(e){z(e instanceof Error?e.message:String(e))}finally{I(!1)}}},Z=async()=>{I(!0),z(``);try{A(await r(E(`/api/skills/reload`,n),{method:`POST`,body:`{}`})),e(d(`skills:skillsPage.skillSettingsSavedAndReloaded`),`success`)}catch(e){z(e instanceof Error?e.message:String(e))}finally{I(!1)}},Q=async()=>{if(J?.removable&&await c?.({title:d(`skills:skillsPage.uninstallSkill`),message:d(`skills:skillsPage.thisRemovesTheSkillDirectoryInstalledByPisperItDoesNotUninstallTheOriginalNpmOrGitPackage`),confirmLabel:d(`skills:skillsPage.uninstall`),tone:`danger`})!==!1){I(!0),z(``);try{await r(E(`/api/skills/${encodeURIComponent(J.id)}`,n),{method:`DELETE`});let t=await B();M(t?.skills[0]?.id||``),e(d(`skills:skillsPage.skillUninstalled`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);z(n),e(n,`error`)}finally{I(!1)}}},$=(e,t,n,r,i=``)=>(0,w.jsxs)(`section`,{className:`skill-scope [.skill-scope_+_&]:[border-top:1px_solid_var(--stroke)] [.skill-scope_+_&]:pt-[14px]`,children:[(0,w.jsxs)(`div`,{className:`skill-scope-head [&_>_div]:min-w-0 [&_small]:block [&_small]:overflow-hidden [&_small]:text-[var(--text-muted)] [&_small]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_small]:text-[11px] [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_>_span]:min-w-[24px] [&_>_span]:text-[var(--text-secondary)] [&_>_span]:text-[12px] [&_>_span]:font-[600] [&_>_span]:text-right flex min-w-0 items-start justify-between gap-[10px]`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(_,{title:e}),i&&(0,w.jsx)(`small`,{title:i,children:i})]}),(0,w.jsx)(`span`,{children:t.length})]}),t.length?t.map(e=>{let t=O(e);return(0,w.jsxs)(`div`,{className:`skill-row grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] border-0 [border-top:1px_solid_var(--stroke-soft)] bg-transparent p-[10px_8px] text-left hover:rounded-[var(--r-sm)] hover:bg-[var(--accent-soft)] [&.selected]:rounded-[var(--r-sm)] [&.selected]:bg-[var(--accent-soft)] [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] grid-cols-[minmax(0,1fr)_auto] [padding-block:4px] ${J?.id===e.id?`selected`:``}`,children:[(0,w.jsxs)(`button`,{className:`skill-row-main [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:min-w-0 [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-[9px] border-0 bg-transparent [padding:6px_4px] text-left`,onClick:()=>M(e.id),children:[(0,w.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,w.jsx)(t,{size:15})}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{children:e.name}),(0,w.jsx)(`small`,{className:`line-clamp-2`,title:e.description,children:e.description})]})]}),(0,w.jsx)(y,{value:e.enabled,disabled:F,ariaLabel:d(`skills:skillsPage.toggleSkillName`,{name:e.name}),onChange:t=>void X(e,{enabled:t})})]},e.id)}):(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-secondary)] text-[12px] leading-[1.55] skills-empty-copy !m-[8px_2px_4px]`,children:n.length?d(`skills:skillsPage.noSkillsMatchTheCurrentFilter`):r})]});return(0,w.jsxs)(`div`,{className:`skills-page flex min-h-[100%] flex-col gap-[12px]`,children:[(0,w.jsx)(p,{options:T.map(e=>D(e,d)),value:D(N,d),onChange:e=>P(T.find(t=>D(t,d)===e)||`all`)}),(0,w.jsxs)(`div`,{className:`skills-layout max-[1150px]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:grid-cols-[1fr] grid min-h-0 flex-1 grid-cols-[minmax(240px,.85fr)_minmax(290px,1.05fr)_minmax(280px,1fr)] gap-[12px]`,children:[(0,w.jsxs)(b,{className:`flex flex-col gap-[16px]`,children:[N!==`project`&&$(d(`skills:skillsPage.globalSkills`),K,W,d(`skills:skillsPage.noGlobalSkills`),m?.locations?.global||`~/.pisper/agent/skills`),N!==`global`&&$(d(`skills:skillsPage.projectSkills`),q,G,d(`skills:skillsPage.noProjectSkills`),m?.locations?.project||(m?.cwd?`${m.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``))]}),(0,w.jsxs)(b,{children:[(0,w.jsxs)(g,{children:[(0,w.jsx)(_,{title:d(`skills:skillsPage.configuredSkillPackages`)}),(0,w.jsx)(`span`,{className:`text-[var(--text-secondary)] text-[12px] font-[600]`,children:d(`skills:skillsPage.countSkillPackages`,{count:Y.length})})]}),Y.length?Y.map(e=>(0,w.jsxs)(`div`,{className:`market-row [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap grid min-h-[48px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[8px] [border-top:1px_solid_var(--stroke-soft)] [padding:6px_2px]`,children:[(0,w.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,w.jsx)(S,{size:15})}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{title:e.source,children:e.source}),(0,w.jsx)(`small`,{children:e.description})]}),(0,w.jsx)(h,{tone:e.tone,children:e.status})]},e.source)):(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-secondary)] text-[12px] leading-[1.55] skills-empty-copy !m-[8px_2px_4px]`,children:d(`skills:skillsPage.noSkillPackagesAreConfiguredYetAfterYouInstallASkillItsSourceWillAppearHere`)})]}),(0,w.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,w.jsxs)(b,{children:[(0,w.jsx)(_,{title:d(`skills:skillsPage.selectedSkill`)}),(0,w.jsx)(`h2`,{children:J?.name||d(`skills:skillsPage.noSkillAvailable`)}),(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-secondary)] text-[12px] leading-[1.55]`,children:J?.description||d(`skills:skillsPage.addGlobalOrProjectSkill`)}),[[d(`skills:skillsPage.triggerMode`),J?.modelInvocationEnabled?d(`skills:skillsPage.automaticManual`):d(`skills:skillsPage.manualOnly`)],[d(`skills:skillsPage.permissions`),J?.allowedTools?.length?J.allowedTools.join(`, `):d(`skills:skillsPage.usesChatToolPermissions`)],[d(`skills:skillsPage.scope`),J?.sourceInfo?.scope===`project`?d(`skills:skillsPage.project`):d(`skills:skillsPage.global`)],[d(`skills:skillsPage.version`),J?.version||`latest`],[d(`skills:skillsPage.source`),J?.source||`—`]].map(e=>(0,w.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,w.jsx)(`span`,{children:e[0]}),(0,w.jsx)(`strong`,{children:e[1]})]},e[0])),(0,w.jsxs)(a,{variant:J?.removable?`destructive`:`default`,size:`lg`,className:`w-full`,disabled:F,onClick:J?.removable?Q:Z,children:[J?.removable?(0,w.jsx)(u,{size:14}):(0,w.jsx)(l,{size:14}),J?.removable?d(`skills:skillsPage.uninstallSkill`):d(`skills:skillsPage.saveSettings`)]})]}),(0,w.jsxs)(b,{children:[(0,w.jsx)(_,{title:d(`skills:skillsPage.triggerConditions`)}),[[d(`skills:skillsPage.allowAutomaticModelInvocation`),!!J?.modelInvocationEnabled,!1,e=>void X(J,{modelInvocationEnabled:e})],[d(`skills:skillsPage.supportManualSkillCommand`),!!J?.command,!0],[d(`skills:skillsPage.projectScopedSkill`),J?.sourceInfo?.scope===`project`,!0],[d(`skills:skillsPage.declaresRequiredTools`),!!J?.allowedTools?.length,!0]].map(([e,t,n,r])=>(0,w.jsxs)(`label`,{className:`check-row [&_input]:[accent-color:var(--star-strong)] flex items-center gap-[7px] [border-top:1px_solid_var(--stroke-soft)] [padding:8px_2px] text-[12px]`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!J||F||n,onChange:e=>r?.(e.target.checked)}),(0,w.jsx)(`span`,{children:e})]},e))]})]})]})]})}export{A as SkillsPage};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./api-B6CluO7V.js";import{n as i,t as a}from"./button-XhIEgIsg.js";import{t as o}from"./use-i18n-jYw5s_Yn.js";import{t as s}from"./file-code-corner-BKkXAMHR.js";import{t as c}from"./image-Dh7-wI1d.js";import{t as l}from"./save-CVL5N6eP.js";import{t as u}from"./trash-2-mhzzyC6i.js";import{t as d}from"./wrench-BqeVhocX.js";import{bt as f,c as p,gt as m,l as h,n as g,o as _,r as v,s as y,t as b}from"./index-Bd5A8V1V.js";import{t as x}from"./usePagePrimaryAction-Bw0OFTDZ.js";var S=i(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),C=e(t(),1),w=n(),T=[`all`,`global`,`project`,`design`,`code`,`docs`,`privileged`];function E(e,t=``){return t?`${e}${e.includes(`?`)?`&`:`?`}sessionId=${encodeURIComponent(t)}`:e}function D(e,t){return t(e===`global`?`skills:skillsPage.global`:e===`project`?`skills:skillsPage.project`:e===`design`?`skills:skillsPage.design`:e===`code`?`skills:skillsPage.code`:e===`docs`?`skills:skillsPage.documents`:e===`privileged`?`skills:skillsPage.highPrivilege`:`skills:skillsPage.all`)}function O(e){let t=`${e?.name||``} ${e?.description||``}`.toLowerCase();return/image|visual|design|figma|svg|图片|视觉|设计/.test(t)?c:/doc|pdf|文档|说明/.test(t)?s:/install|package|market|安装|包/.test(t)?S:/code|test|plugin|skill|代码|测试|插件|技能/.test(t)?d:m}function k(e,t){if(t===`all`)return!0;if(t===`global`)return e.sourceInfo?.scope!==`project`;if(t===`project`)return e.sourceInfo?.scope===`project`;let n=`${e.name} ${e.description} ${(e.allowedTools||[]).join(` `)}`.toLowerCase();return t===`design`?/image|visual|design|figma|svg|图片|视觉|设计/.test(n):t===`code`?/code|test|plugin|代码|测试|插件/.test(n):t===`docs`?/doc|pdf|文档|说明/.test(n):t!==`privileged`||(e.allowedTools||[]).some(e=>[`bash`,`write`,`edit`].includes(e))}function A({notify:e,query:t=``,activeSessionId:n=``,registerPrimaryAction:i,requestText:s,requestConfirm:c}){let{t:d}=o(),[m,A]=(0,C.useState)(null),[j,M]=(0,C.useState)(``),[N,P]=(0,C.useState)(`all`),[F,I]=(0,C.useState)(!1),[L,R]=(0,C.useState)(!0),[,z]=(0,C.useState)(``),B=(0,C.useCallback)(async()=>{z(``);try{let e=await r(E(`/api/skills`,n));return A(e),M(t=>e.skills.some(e=>e.id===t)?t:e.skills[0]?.id||``),e}catch(e){return z(e instanceof Error?e.message:String(e)),null}finally{R(!1)}},[n]);(0,C.useEffect)(()=>{B()},[B]);let V=(0,C.useCallback)(async()=>{let t=await s?.({title:d(`skills:skillsPage.importGlobalSkill`),message:d(`skills:skillsPage.globalSkillSourceHelp`),inputLabel:d(`skills:skillsPage.skillSource`),placeholder:`E:\\path\\to\\skill, npm:@scope/package, or https://github.com/...`,maxLength:2e3,confirmLabel:d(`skills:skillsPage.continue`)});if(t?.trim()&&await c?.({title:d(`skills:skillsPage.importGlobalSkill`),message:d(`skills:skillsPage.skillsProvideInstructionsToTheAgentAndMayIncludeExecutableScriptsConfirmThatYouTrustTheSource`),confirmLabel:d(`skills:skillsPage.import`),tone:`danger`})!==!1){I(!0),z(``);try{let i=await r(E(`/api/skills/install`,n),{method:`POST`,body:JSON.stringify({source:t})});A(i),M(i.installed?.[0]?.id||i.skills[0]?.id||``),e(d(`skills:skillsPage.skillInstalledAndLoadedIntoTheAgentRuntime`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);z(n),e(n,`error`)}finally{I(!1)}}},[n,e,c,s,d]);if(x(i,V),L&&!m)return(0,w.jsx)(`div`,{className:`skills-page flex min-h-[100%] flex-col gap-[12px]`,children:(0,w.jsxs)(v,{children:[(0,w.jsx)(f,{className:`animate-spin`,size:23}),(0,w.jsx)(`h2`,{children:d(`skills:skillsPage.loadingSkills`)}),(0,w.jsx)(`p`,{children:d(`skills:skillsPage.scanningSkillDirectoriesAndConfiguredPackages`)})]})});let H=m?.skills||[],U=H.filter(e=>k(e,N)&&`${e.name} ${e.description}`.toLowerCase().includes(t.toLowerCase())),W=H.filter(e=>e.sourceInfo?.scope!==`project`),G=H.filter(e=>e.sourceInfo?.scope===`project`),K=U.filter(e=>e.sourceInfo?.scope!==`project`),q=U.filter(e=>e.sourceInfo?.scope===`project`),J=H.find(e=>e.id===j)||U[0]||H[0]||null,Y=(m?.packages||[]).map(e=>({source:e.source,description:e.scope===`project`?d(`skills:skillsPage.projectScopedConfiguration`):d(`skills:skillsPage.userScopedConfiguration`),status:e.installed?d(`skills:skillsPage.locallyReady`):d(`skills:skillsPage.notMaterialized`),tone:e.installed?`green`:`gray`})).filter(e=>`${e.source} ${e.description}`.toLowerCase().includes(t.toLowerCase())),X=async(e,t)=>{if(e){I(!0),z(``);try{let i=await r(E(`/api/skills/${encodeURIComponent(e.id)}`,n),{method:`PATCH`,body:JSON.stringify(t)});A(e=>{if(!e)return e;let t=e.skills.map(e=>e.id===i.id?i:e);return{...e,skills:t,counts:{...e.counts,enabled:t.filter(e=>e.enabled).length,modelInvocable:t.filter(e=>e.enabled&&e.modelInvocationEnabled).length}}})}catch(e){z(e instanceof Error?e.message:String(e))}finally{I(!1)}}},Z=async()=>{I(!0),z(``);try{A(await r(E(`/api/skills/reload`,n),{method:`POST`,body:`{}`})),e(d(`skills:skillsPage.skillSettingsSavedAndReloaded`),`success`)}catch(e){z(e instanceof Error?e.message:String(e))}finally{I(!1)}},Q=async()=>{if(J?.removable&&await c?.({title:d(`skills:skillsPage.uninstallSkill`),message:d(`skills:skillsPage.thisRemovesTheSkillDirectoryInstalledByPisperItDoesNotUninstallTheOriginalNpmOrGitPackage`),confirmLabel:d(`skills:skillsPage.uninstall`),tone:`danger`})!==!1){I(!0),z(``);try{await r(E(`/api/skills/${encodeURIComponent(J.id)}`,n),{method:`DELETE`});let t=await B();M(t?.skills[0]?.id||``),e(d(`skills:skillsPage.skillUninstalled`),`success`)}catch(t){let n=t instanceof Error?t.message:String(t);z(n),e(n,`error`)}finally{I(!1)}}},$=(e,t,n,r,i=``)=>(0,w.jsxs)(`section`,{className:`skill-scope [.skill-scope_+_&]:[border-top:1px_solid_var(--stroke)] [.skill-scope_+_&]:pt-[14px]`,children:[(0,w.jsxs)(`div`,{className:`skill-scope-head [&_>_div]:min-w-0 [&_small]:block [&_small]:overflow-hidden [&_small]:text-[var(--text-muted)] [&_small]:font-[ui-monospace,_SFMono-Regular,_Consolas,_'Liberation_Mono',_monospace] [&_small]:text-[11px] [&_small]:text-ellipsis [&_small]:whitespace-nowrap [&_>_span]:min-w-[24px] [&_>_span]:text-[var(--text-secondary)] [&_>_span]:text-[12px] [&_>_span]:font-[600] [&_>_span]:text-right flex min-w-0 items-start justify-between gap-[10px]`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(_,{title:e}),i&&(0,w.jsx)(`small`,{title:i,children:i})]}),(0,w.jsx)(`span`,{children:t.length})]}),t.length?t.map(e=>{let t=O(e);return(0,w.jsxs)(`div`,{className:`skill-row grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[9px] border-0 [border-top:1px_solid_var(--stroke-soft)] bg-transparent p-[10px_8px] text-left hover:rounded-[var(--r-sm)] hover:bg-[var(--accent-soft)] [&.selected]:rounded-[var(--r-sm)] [&.selected]:bg-[var(--accent-soft)] [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] grid-cols-[minmax(0,1fr)_auto] [padding-block:4px] ${J?.id===e.id?`selected`:``}`,children:[(0,w.jsxs)(`button`,{className:`skill-row-main [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:min-w-0 [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-[9px] border-0 bg-transparent [padding:6px_4px] text-left`,onClick:()=>M(e.id),children:[(0,w.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,w.jsx)(t,{size:15})}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{children:e.name}),(0,w.jsx)(`small`,{className:`line-clamp-2`,title:e.description,children:e.description})]})]}),(0,w.jsx)(y,{value:e.enabled,disabled:F,ariaLabel:d(`skills:skillsPage.toggleSkillName`,{name:e.name}),onChange:t=>void X(e,{enabled:t})})]},e.id)}):(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-secondary)] text-[12px] leading-[1.55] skills-empty-copy !m-[8px_2px_4px]`,children:n.length?d(`skills:skillsPage.noSkillsMatchTheCurrentFilter`):r})]});return(0,w.jsxs)(`div`,{className:`skills-page flex min-h-[100%] flex-col gap-[12px]`,children:[(0,w.jsx)(p,{options:T.map(e=>D(e,d)),value:D(N,d),onChange:e=>P(T.find(t=>D(t,d)===e)||`all`)}),(0,w.jsxs)(`div`,{className:`skills-layout max-[1150px]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:grid-cols-[1fr] grid min-h-0 flex-1 grid-cols-[minmax(240px,.85fr)_minmax(290px,1.05fr)_minmax(280px,1fr)] gap-[12px]`,children:[(0,w.jsxs)(b,{className:`flex flex-col gap-[16px]`,children:[N!==`project`&&$(d(`skills:skillsPage.globalSkills`),K,W,d(`skills:skillsPage.noGlobalSkills`),m?.locations?.global||`~/.pisper/agent/skills`),N!==`global`&&$(d(`skills:skillsPage.projectSkills`),q,G,d(`skills:skillsPage.noProjectSkills`),m?.locations?.project||(m?.cwd?`${m.cwd.replace(/[\\/]$/,``)}/.pisper/skills`:``))]}),(0,w.jsxs)(b,{children:[(0,w.jsxs)(g,{children:[(0,w.jsx)(_,{title:d(`skills:skillsPage.configuredSkillPackages`)}),(0,w.jsx)(`span`,{className:`text-[var(--text-secondary)] text-[12px] font-[600]`,children:d(`skills:skillsPage.countSkillPackages`,{count:Y.length})})]}),Y.length?Y.map(e=>(0,w.jsxs)(`div`,{className:`market-row [&_>_span:nth-child(2)]:flex [&_>_span:nth-child(2)]:flex-col [&_>_span:nth-child(2)]:gap-[3px] [&_strong]:text-[13px] [&_small]:text-[var(--text-muted)] [&_small]:text-[13px] [&_strong]:overflow-hidden [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap grid min-h-[48px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-[8px] [border-top:1px_solid_var(--stroke-soft)] [padding:6px_2px]`,children:[(0,w.jsx)(`span`,{className:`list-icon [.chat-resource-list_&]:grid [.chat-resource-list_&]:w-[28px] [.chat-resource-list_&]:h-[28px] [.chat-resource-list_&]:place-items-center [.chat-resource-list_&]:rounded-[var(--r-sm)] [.chat-resource-list_&]:bg-[var(--surface-subtle)] [.chat-resource-list_&]:text-[var(--star-strong)] [.session-workflow-summary_&]:grid [.session-workflow-summary_&]:w-[28px] [.session-workflow-summary_&]:h-[28px] [.session-workflow-summary_&]:place-items-center [.session-workflow-summary_&]:rounded-[var(--r-sm)] [.session-workflow-summary_&]:bg-[var(--surface-subtle)] [.session-workflow-summary_&]:text-[var(--star-strong)] grid w-[27px] h-[27px] place-items-center rounded-[var(--r-sm)] bg-[var(--accent-soft)] text-[var(--star-strong)] [.workflow-template-gallery_&]:grid [.workflow-template-gallery_&]:w-[32px] [.workflow-template-gallery_&]:h-[32px] [.workflow-template-gallery_&]:place-items-center [.workflow-template-gallery_&]:rounded-[var(--r-sm)] [.workflow-template-gallery_&]:bg-[var(--surface-subtle)] [.workflow-template-gallery_&]:text-[var(--star-strong)]`,children:(0,w.jsx)(S,{size:15})}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{title:e.source,children:e.source}),(0,w.jsx)(`small`,{children:e.description})]}),(0,w.jsx)(h,{tone:e.tone,children:e.status})]},e.source)):(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-secondary)] text-[12px] leading-[1.55] skills-empty-copy !m-[8px_2px_4px]`,children:d(`skills:skillsPage.noSkillPackagesAreConfiguredYetAfterYouInstallASkillItsSourceWillAppearHere`)})]}),(0,w.jsxs)(`div`,{className:`detail-stack flex min-w-0 flex-col gap-[12px] [.mcp-layout_>_&]:min-h-0 max-[1150px]:[.memory-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.memory-layout_>_&]:grid max-[1150px]:[.memory-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.mcp-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.mcp-layout_>_&]:grid max-[1150px]:[.mcp-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[1150px]:[.skills-layout_>_&]:[grid-column:1/-1] max-[1150px]:[.skills-layout_>_&]:grid max-[1150px]:[.skills-layout_>_&]:grid-cols-[repeat(2,minmax(0,1fr))] max-[650px]:[.memory-layout_>_&]:[grid-column:auto] max-[650px]:[.memory-layout_>_&]:grid-cols-[1fr] max-[650px]:[.mcp-layout_>_&]:[grid-column:auto] max-[650px]:[.mcp-layout_>_&]:grid-cols-[1fr] max-[650px]:[.skills-layout_>_&]:[grid-column:auto] max-[650px]:[.skills-layout_>_&]:grid-cols-[1fr]`,children:[(0,w.jsxs)(b,{children:[(0,w.jsx)(_,{title:d(`skills:skillsPage.selectedSkill`)}),(0,w.jsx)(`h2`,{children:J?.name||d(`skills:skillsPage.noSkillAvailable`)}),(0,w.jsx)(`p`,{className:`muted-copy m-[8px_0_14px] text-[var(--text-secondary)] text-[12px] leading-[1.55]`,children:J?.description||d(`skills:skillsPage.addGlobalOrProjectSkill`)}),[[d(`skills:skillsPage.triggerMode`),J?.modelInvocationEnabled?d(`skills:skillsPage.automaticManual`):d(`skills:skillsPage.manualOnly`)],[d(`skills:skillsPage.permissions`),J?.allowedTools?.length?J.allowedTools.join(`, `):d(`skills:skillsPage.usesChatToolPermissions`)],[d(`skills:skillsPage.scope`),J?.sourceInfo?.scope===`project`?d(`skills:skillsPage.project`):d(`skills:skillsPage.global`)],[d(`skills:skillsPage.version`),J?.version||`latest`],[d(`skills:skillsPage.source`),J?.source||`—`]].map(e=>(0,w.jsxs)(`div`,{className:`key-value [&:first-of-type]:mt-[7px] [&_span]:text-[var(--text-muted)] [&_button]:flex [&_button]:items-center [&_button]:gap-[4px] [&_button]:border-0 [&_button]:bg-transparent [&_button]:text-[var(--text-soft)] [&_button]:text-[12px] [&_strong]:min-w-0 [&_strong]:overflow-hidden [&_strong]:text-[13px] [&_strong]:text-ellipsis [&_strong]:whitespace-nowrap flex min-h-[31px] items-center justify-between gap-[10px] [border-top:1px_solid_var(--stroke-soft)] text-[13px]`,children:[(0,w.jsx)(`span`,{children:e[0]}),(0,w.jsx)(`strong`,{children:e[1]})]},e[0])),(0,w.jsxs)(a,{variant:J?.removable?`destructive`:`default`,size:`lg`,className:`w-full`,disabled:F,onClick:J?.removable?Q:Z,children:[J?.removable?(0,w.jsx)(u,{size:14}):(0,w.jsx)(l,{size:14}),J?.removable?d(`skills:skillsPage.uninstallSkill`):d(`skills:skillsPage.saveSettings`)]})]}),(0,w.jsxs)(b,{children:[(0,w.jsx)(_,{title:d(`skills:skillsPage.triggerConditions`)}),[[d(`skills:skillsPage.allowAutomaticModelInvocation`),!!J?.modelInvocationEnabled,!1,e=>void X(J,{modelInvocationEnabled:e})],[d(`skills:skillsPage.supportManualSkillCommand`),!!J?.command,!0],[d(`skills:skillsPage.projectScopedSkill`),J?.sourceInfo?.scope===`project`,!0],[d(`skills:skillsPage.declaresRequiredTools`),!!J?.allowedTools?.length,!0]].map(([e,t,n,r])=>(0,w.jsxs)(`label`,{className:`check-row [&_input]:[accent-color:var(--star-strong)] flex items-center gap-[7px] [border-top:1px_solid_var(--stroke-soft)] [padding:8px_2px] text-[12px]`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:t,disabled:!J||F||n,onChange:e=>r?.(e.target.checked)}),(0,w.jsx)(`span`,{children:e})]},e))]})]})]})]})}export{A as SkillsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./api-B6CluO7V.js";import{n as i,t as a}from"./button-XhIEgIsg.js";import{t as o}from"./chevron-down-DT6AXwTP.js";import{t as s}from"./square-terminal-DpCa0gzM.js";import{t as c}from"./x-bw26XDZM.js";import{U as l,xt as u}from"./index-CAWCOpxG.js";var d=i(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),f=i(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),p=e(t(),1),m=2,h=1,ee=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(m,Math.floor(u/e.css.cell.width)),rows:Math.max(h,Math.floor(l/e.css.cell.height))}}},g=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=te.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function _(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var te=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!_(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},ne=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function re(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ie=class{constructor(e=re,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||ne;this._linkProvider=this._terminal.registerLinkProvider(new g(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},ae=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,se=(e,t)=>{for(var n in t)ae(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&ae(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ce=`Terminal input`,b={get:()=>ce,set:e=>ce=e},le=`Too much output to announce, navigate to rows manually to read`,x={get:()=>le,set:e=>le=e};function ue(e){return e.replace(/\r?\n/g,`\r`)}function S(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function de(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function fe(e,t,n,r){e.stopPropagation(),e.clipboardData&&pe(e.clipboardData.getData(`text/plain`),t,n,r)}function pe(e,t,n,r){e=ue(e),e=S(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function C(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function me(e,t,n,r,i){C(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function w(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function he(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var T=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ge=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},_e=``,ve=` `,ye=class e{constructor(){this.fg=0,this.bg=0,this.extended=new be}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},be=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},E=class e extends ye{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new be,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?w(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},xe=`di$target`,Se=`di$dependencies`,Ce=new Map;function we(e){return e[Se]||[]}function D(e){if(Ce.has(e))return Ce.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Te(t,e,r)};return t._id=e,Ce.set(e,t),t}function Te(e,t,n){t[xe]===t?t[Se].push({id:e,index:n}):(t[Se]=[{id:e,index:n}],t[xe]=t)}var O=D(`BufferService`),Ee=D(`CoreMouseService`),De=D(`CoreService`),Oe=D(`CharsetService`),ke=D(`InstantiationService`),Ae=D(`LogService`),k=D(`OptionsService`),je=D(`OscLinkService`),Me=D(`UnicodeService`),Ne=D(`DecorationService`),Pe=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new E,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Fe(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Pe=v([y(0,O),y(1,k),y(2,je)],Pe);function Fe(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./api-B6CluO7V.js";import{n as i,t as a}from"./button-XhIEgIsg.js";import{t as o}from"./chevron-down-DT6AXwTP.js";import{t as s}from"./square-terminal-DpCa0gzM.js";import{t as c}from"./x-bw26XDZM.js";import{U as l,xt as u}from"./index-Bd5A8V1V.js";var d=i(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),f=i(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),p=e(t(),1),m=2,h=1,ee=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(m,Math.floor(u/e.css.cell.width)),rows:Math.max(h,Math.floor(l/e.css.cell.height))}}},g=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=te.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function _(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var te=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!_(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},ne=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function re(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ie=class{constructor(e=re,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||ne;this._linkProvider=this._terminal.registerLinkProvider(new g(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},ae=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,se=(e,t)=>{for(var n in t)ae(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&ae(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ce=`Terminal input`,b={get:()=>ce,set:e=>ce=e},le=`Too much output to announce, navigate to rows manually to read`,x={get:()=>le,set:e=>le=e};function ue(e){return e.replace(/\r?\n/g,`\r`)}function S(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function de(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function fe(e,t,n,r){e.stopPropagation(),e.clipboardData&&pe(e.clipboardData.getData(`text/plain`),t,n,r)}function pe(e,t,n,r){e=ue(e),e=S(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function C(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function me(e,t,n,r,i){C(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function w(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function he(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var T=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ge=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},_e=``,ve=` `,ye=class e{constructor(){this.fg=0,this.bg=0,this.extended=new be}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},be=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},E=class e extends ye{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new be,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?w(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},xe=`di$target`,Se=`di$dependencies`,Ce=new Map;function we(e){return e[Se]||[]}function D(e){if(Ce.has(e))return Ce.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Te(t,e,r)};return t._id=e,Ce.set(e,t),t}function Te(e,t,n){t[xe]===t?t[Se].push({id:e,index:n}):(t[Se]=[{id:e,index:n}],t[xe]=t)}var O=D(`BufferService`),Ee=D(`CoreMouseService`),De=D(`CoreService`),Oe=D(`CharsetService`),ke=D(`InstantiationService`),Ae=D(`LogService`),k=D(`OptionsService`),je=D(`OscLinkService`),Me=D(`UnicodeService`),Ne=D(`DecorationService`),Pe=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new E,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Fe(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Pe=v([y(0,O),y(1,k),y(2,je)],Pe);function Fe(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Ie=D(`CharSizeService`),Le=D(`CoreBrowserService`),Re=D(`MouseService`),ze=D(`RenderService`),Be=D(`SelectionService`),Ve=D(`CharacterJoinerService`),He=D(`ThemeService`),Ue=D(`LinkProviderService`),We=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Xe.isErrorNoTelemetry(e)?new Xe(e.message+`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./utils-C8uzG5AZ.js";/* empty css */import{t as i}from"./welcome-brand-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./vendor-react-CHuvPdJE.js";import{t as r}from"./utils-C8uzG5AZ.js";/* empty css */import{t as i}from"./welcome-brand-R7Xflzvb.js";var a=e(t(),1),o=n();function s({text:e,className:t,delay:n=45}){let i=e.split(/(\s+)/);return(0,o.jsx)(`span`,{className:r(`rb-blur-text`,t),"aria-label":e,children:i.map((e,t)=>/^\s+$/.test(e)?e:(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`rb-blur-text-word`,style:{"--rb-delay":`${t*n}ms`},children:e},`${e}-${t}`))})}function c({children:e,className:t,targetSelector:n=`[data-target-cursor]`}){let i=(0,a.useRef)(null),s=(0,a.useRef)(null),c=(0,a.useRef)(null),l=(0,a.useCallback)(()=>window.matchMedia(`(pointer: fine)`).matches&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,[]),u=(0,a.useCallback)(e=>{let t=i.current,n=c.current;if(!t||!n)return;let r=t.getBoundingClientRect(),a=e.getBoundingClientRect();n.style.transform=`translate3d(${a.left-r.left-7}px, ${a.top-r.top-7}px, 0)`,n.style.width=`${a.width+14}px`,n.style.height=`${a.height+14}px`,n.dataset.visible=`true`},[]),d=(0,a.useCallback)(e=>{if(!l())return;let t=i.current,r=s.current,a=c.current;if(!t||!r||!a)return;let o=t.getBoundingClientRect();r.style.transform=`translate3d(${e.clientX-o.left}px, ${e.clientY-o.top}px, 0)`,r.dataset.visible=`true`;let d=e.target?.closest(n);d&&t.contains(d)?u(d):a.dataset.visible=`false`},[l,u,n]),f=(0,a.useCallback)(()=>{s.current&&(s.current.dataset.visible=`false`),c.current&&(c.current.dataset.visible=`false`)},[]),p=(0,a.useCallback)(e=>{let t=e.target?.closest(n);t&&i.current?.contains(t)&&u(t)},[u,n]),m=(0,a.useCallback)(e=>{let t=e.relatedTarget;t instanceof Element&&i.current?.contains(t)||c.current&&(c.current.dataset.visible=`false`)},[]);return(0,o.jsxs)(`div`,{ref:i,className:r(`rb-target-cursor`,t),onPointerMove:d,onPointerLeave:f,onFocusCapture:p,onBlurCapture:m,children:[e,(0,o.jsx)(`span`,{ref:s,className:`rb-target-cursor-dot`,"aria-hidden":`true`}),(0,o.jsxs)(`span`,{ref:c,className:`rb-target-cursor-frame`,"aria-hidden":`true`,children:[(0,o.jsx)(`i`,{}),(0,o.jsx)(`i`,{}),(0,o.jsx)(`i`,{}),(0,o.jsx)(`i`,{})]})]})}var l=36e5,u=320;function d(e){let[t,n]=(0,a.useState)(0),[r,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(e.length<2||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=0,r=0,a=0,o=l,s=()=>{a=Date.now(),t=window.setTimeout(()=>{i(!0),r=window.setTimeout(()=>{n(t=>(t+1)%e.length),i(!1)},u),o=l,s()},o)},c=()=>{document.hidden?(o=Math.max(0,o-(Date.now()-a)),window.clearTimeout(t)):s()};return s(),document.addEventListener(`visibilitychange`,c),()=>{window.clearTimeout(t),window.clearTimeout(r),document.removeEventListener(`visibilitychange`,c)}},[e.length]),{title:e[t]||e[0]||``,leaving:r}}function f({children:e,titles:t}){let{title:n,leaving:r}=d(t);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 bg-[radial-gradient(560px_380px_at_50%_24%,rgba(168,85,247,.1),transparent_70%),radial-gradient(420px_300px_at_66%_62%,rgba(236,72,153,.07),transparent_72%)]`}),(0,o.jsxs)(c,{className:`relative z-[1] grid w-full max-w-[680px] place-items-center [padding:12px_20px_30px]`,children:[(0,o.jsx)(`div`,{className:`[animation:transcript-stage-enter_.5s_var(--ease-out)_both]`,children:(0,o.jsx)(i,{})}),(0,o.jsx)(`h2`,{className:`text-[var(--accent-strong)] [animation:transcript-stage-enter_.55s_var(--ease-out)_both] [animation-delay:70ms]`,children:(0,o.jsx)(`span`,{className:`block [transition:opacity_.32s_ease,filter_.32s_ease,transform_.32s_ease] ${r?`translate-y-[4px] opacity-0 blur-[6px]`:`opacity-100 blur-0`}`,children:(0,o.jsx)(s,{text:n},n)})}),e]})]})}export{f as default};
|