specrails-desktop 2.11.9 → 2.12.0
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/client/dist/assets/{ActivityFeedPage-D12zOZGQ.js → ActivityFeedPage-B9-UAGS7.js} +1 -1
- package/client/dist/assets/{AgentsPage-CNyxiSCU.js → AgentsPage-Bz9rophT.js} +1 -1
- package/client/dist/assets/{AnalyticsPage-DxuypQg1.js → AnalyticsPage-D3ynQwGd.js} +1 -1
- package/client/dist/assets/{BarChart-CWDs7Ffl.js → BarChart-Cwp6VuED.js} +1 -1
- package/client/dist/assets/{CodePage-AN1T4w99.js → CodePage-CO_TLOvi.js} +1 -1
- package/client/dist/assets/{DesktopAnalyticsPage-CPdWVhzT.js → DesktopAnalyticsPage-BMDqiAbw.js} +1 -1
- package/client/dist/assets/{DocsDialog-C1MnXtzC.js → DocsDialog-B-chJn-f.js} +1 -1
- package/client/dist/assets/{DocsPage-BSqJ-G6V.js → DocsPage-BcJwYo20.js} +1 -1
- package/client/dist/assets/{ExportDropdown-DpI605_7.js → ExportDropdown-I_8R48Yq.js} +1 -1
- package/client/dist/assets/{IntegrationsPage-KaZLo4KU.js → IntegrationsPage-Bd4l3L6u.js} +1 -1
- package/client/dist/assets/{JobDetailPage-QN9NOcrX.js → JobDetailPage-Dt3jLjS4.js} +1 -1
- package/client/dist/assets/{JobsPage-C-fLmFs9.js → JobsPage-DcWpJbBc.js} +1 -1
- package/client/dist/assets/{dist-js-EZlD2frS.js → dist-js-CtdZvl0R.js} +1 -1
- package/client/dist/assets/{dist-js-jOe3QgTk.js → dist-js-DXfIbU9U.js} +1 -1
- package/client/dist/assets/explore-8gMBVmkp.js +1 -0
- package/client/dist/assets/explore-BkWTnLi3.js +1 -0
- package/client/dist/assets/explore-COaUKI0t.js +1 -0
- package/client/dist/assets/explore-CQUCw9ci.js +1 -0
- package/client/dist/assets/explore-DUU36tcH.js +1 -0
- package/client/dist/assets/explore-Dbac0ErD.js +1 -0
- package/client/dist/assets/explore-DlKgN7D-.js +1 -0
- package/client/dist/assets/explore-vdBm_Re8.js +1 -0
- package/client/dist/assets/index-BEGU2TCx.js +143 -0
- package/client/dist/assets/index-B_Zqeoa5.css +2 -0
- package/client/dist/assets/{lib-CiLTp9yY.js → lib-BBoUS-5a.js} +1 -1
- package/client/dist/index.html +3 -3
- package/package.json +1 -1
- package/server/dist/attachment-manager.js +22 -0
- package/server/dist/browser-capture-manager.js +10 -0
- package/server/dist/browser-context-pool.js +96 -0
- package/server/dist/browser-playwright.js +14 -0
- package/server/dist/contract-refine-runner.js +18 -8
- package/server/dist/jira/jira-materializer.js +12 -2
- package/server/dist/jira/jira-status-resolver.js +61 -13
- package/server/dist/project-registry.js +12 -0
- package/server/dist/project-router-tickets.js +27 -5
- package/server/dist/queue-manager.js +14 -0
- package/server/dist/workspace-manager.js +80 -0
- package/client/dist/assets/explore-BE5UmlbD.js +0 -1
- package/client/dist/assets/explore-BmTaI8dX.js +0 -1
- package/client/dist/assets/explore-CCwkqoWq.js +0 -1
- package/client/dist/assets/explore-CMdEoPDx.js +0 -1
- package/client/dist/assets/explore-CtdCL4QU.js +0 -1
- package/client/dist/assets/explore-DHjxSkqQ.js +0 -1
- package/client/dist/assets/explore-__BeALjE.js +0 -1
- package/client/dist/assets/explore-hFc3HFcp.js +0 -1
- package/client/dist/assets/index-Cc3LCzBq.css +0 -2
- package/client/dist/assets/index-wK8zASrE.js +0 -142
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{$t as t,Bt as n,C as r,Dt as i,Et as a,L as o,N as s,O as c,Q as l,R as u,Rt as d,S as f,T as p,Tt as m,Y as h,cn as g,dt as _,en as v,ft as y,k as b,nn as x,q as S,st as C,t as w,w as T,zt as E}from"./index-wK8zASrE.js";var D=e(g(),1),O=E(),k=[`todo`,`in_progress`,`done`,`cancelled`],A={todo:`todo`,in_progress:`inProgress`,done:`done`,cancelled:`cancelled`};function j({state:e,onChanged:n}){let{t:r}=v(`jira`),i=e.connection,[a,o]=(0,D.useState)(i.enabled),[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),[p,m]=(0,D.useState)([]),[h,g]=(0,D.useState)([]),[_,y]=(0,D.useState)(i.discardStatus??``),[b,x]=(0,D.useState)(i.statusMap??{}),S=e.outbox??{pending:0,inflight:0,done:0,dead:0},C=(0,D.useCallback)(async()=>{try{let{ops:e}=await f.listOutbox(`dead`);m(e)}catch{m([])}},[]);(0,D.useEffect)(()=>{C()},[C]),(0,D.useEffect)(()=>{let e=!1;return f.listStatuses().then(({statuses:t})=>{e||g(t)}).catch(()=>{e||g([])}),()=>{e=!0}},[]);async function w(e){let i=_;y(e);try{await f.patchConnection({discardStatus:e||null}),n()}catch(e){y(i),t.error(N(e,r))}}async function T(e,i){let a=b,o={...b,[e]:i||void 0};x(o);let s=Object.fromEntries(Object.entries(o).filter(([,e])=>e));try{await f.patchConnection({statusMap:Object.keys(s).length?s:null}),n()}catch(e){x(a),t.error(N(e,r))}}async function E(){let e=!a;o(e),d(!0);try{await f.setEnabled(e)}catch(n){o(!e),t.error(N(n,r))}finally{d(!1)}}async function j(){l(!0);try{let e=await f.syncNow();t.success(r(`status.syncedToast`,{count:e.upserted}))}catch(e){t.error(N(e,r))}finally{l(!1)}}async function P(){if(window.confirm(r(`status.disconnectConfirm`))){d(!0);try{await f.disconnect(),t.success(r(`status.disconnectedToast`)),n()}catch(e){t.error(N(e,r))}finally{d(!1)}}}async function F(e){try{await f.retryOutbox(e),await C()}catch(e){t.error(N(e,r))}}let I=S.pending+S.inflight;return(0,O.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:r(`status.connected`,{key:i.jiraProjectKey})}),(0,O.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i.baseUrl,` · `,i.deployment===`cloud`?r(`review.cloud`):r(`review.dc`)]})]}),(0,O.jsx)(`a`,{href:`${i.baseUrl}/browse/${i.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:r(`badge.openInJira`)})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`status.enabledLabel`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(a?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,O.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":a,"aria-label":r(`status.enabledLabel`),disabled:u,onClick:E,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${a?`bg-accent-success`:`bg-input`}`,children:(0,O.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${a?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`wizard.step3Title`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`mapping.intro`)}),(0,O.jsx)(`div`,{className:`space-y-2`,children:k.map(e=>(0,O.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`mapping.${A[e]}`)}),(0,O.jsxs)(`select`,{value:b[e]??``,onChange:t=>void T(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,O.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!h.some(t=>t.name===b[e])&&(0,O.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`discard.configLabel`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`discard.configHelp`)}),(0,O.jsxs)(`select`,{value:_,onChange:e=>void w(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,O.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),_&&!h.some(e=>e.name===_)&&(0,O.jsx)(`option`,{value:_,children:_})]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(s,{variant:`outline`,size:`sm`,onClick:j,disabled:c,children:r(c?`status.syncing`:`status.syncNow`)}),(0,O.jsx)(s,{variant:`ghost`,size:`sm`,onClick:P,disabled:u,className:`text-destructive`,children:r(`status.disconnect`)})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`outbox.title`)}),S.dead>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-accent-warning`,children:r(`outbox.dead`,{count:S.dead})}):I>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.pending`,{count:I})}):(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.allSynced`)}),p.length>0&&(0,O.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`outbox.deadHelp`)}),p.map(e=>(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border border-border/60 px-2 py-1`,children:[(0,O.jsxs)(`span`,{className:`truncate text-xs`,children:[M(e,r),` · `,e.deadReason??e.lastError??``]}),(0,O.jsx)(s,{variant:`outline`,size:`sm`,onClick:()=>F(e.id),children:r(`outbox.retry`)})]},e.id))]})]})]})}function M(e,t){return e.opType===`transition`?t(`outbox.opTransition`):e.opType===`comment`?t(`outbox.opComment`):t(`outbox.opCreate`)}function N(e,t){return e instanceof Error?e.message:t(`errors.generic`)}function P({activeProjectId:e}){let{t}=v(`integrations`),[n,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(!0),[s,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),m=(0,D.useCallback)(async()=>{try{i(await f.getConnection())}catch{i({connected:!1})}finally{o(!1)}},[]);if((0,D.useEffect)(()=>{!r||!e||(o(!0),m())},[e,m]),!r)return null;let g=!!(n?.connected&&n.connection);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,"data-testid":`jira-integration-card`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,O.jsx)(`div`,{className:`grid place-items-center w-9 h-9 rounded-md bg-accent-info/15 text-accent-info shrink-0`,children:(0,O.jsx)(h,{className:`w-4 h-4`})}),(0,O.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:t(`jiraCard.title`)}),g&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,"data-testid":`jira-connected-badge`,children:[(0,O.jsx)(y,{className:`w-3 h-3`}),` `,t(`jiraCard.connected`)]})]}),(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:t(`jiraCard.category`)})]})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:g&&n?.connection?t(`jiraCard.connectedDescription`,{key:n.connection.jiraProjectKey}):t(`jiraCard.description`)}),(0,O.jsxs)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:[(0,O.jsx)(`li`,{children:t(`jiraCard.bullet1`)}),(0,O.jsx)(`li`,{children:t(`jiraCard.bullet2`)}),(0,O.jsx)(`li`,{children:t(`jiraCard.bullet3`)})]}),(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`jiraCard.requires`)}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:a?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`…`}):g?(0,O.jsx)(`button`,{type:`button`,onClick:()=>d(!0),"data-testid":`jira-manage-btn`,className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-muted/30 inline-flex items-center gap-1.5`,children:t(`jiraCard.manage`)}):(0,O.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),"data-testid":`jira-connect-btn`,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90 inline-flex items-center gap-1.5`,children:[(0,O.jsx)(h,{className:`w-3.5 h-3.5`}),t(`jiraCard.connect`)]})}),(0,O.jsx)(T,{open:s,onOpenChange:l,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(b,{children:t(`jiraCard.modalTitle`)})}),(0,O.jsx)(w,{onConnected:()=>{l(!1),m()},onSkip:()=>l(!1)})]})}),(0,O.jsx)(T,{open:u,onOpenChange:d,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(b,{children:t(`jiraCard.manageTitle`)})}),n?.connected&&n.connection&&(0,O.jsx)(j,{state:n,onChanged:()=>{m().then(()=>d(!1))}})]})})]})}function F(){let{t:e}=v(`integrations`),{activeProjectId:t,projects:s}=a(),c=s.find(e=>e.id===t),l=c?m(c).includes(`claude`):!0,{registerHandler:u,unregisterHandler:f}=d(),p=(0,D.useRef)(t);(0,D.useEffect)(()=>{p.current=t},[t]);let[h,g]=(0,D.useState)(null),[_,y]=(0,D.useState)(null),{data:b,isLoading:x,isFirstLoad:C,refresh:w}=i({namespace:`plugins`,projectId:t,initialValue:[],fetcher:(0,D.useCallback)(async()=>{let e=await fetch(`${n()}/plugins`);if(!e.ok)throw Error(`HTTP ${e.status}`);return(await e.json()).plugins??[]},[])});(0,D.useEffect)(()=>(u(`integrations-page`,e=>{let t=e;t.type&&(t.projectId&&t.projectId!==p.current||t.type.startsWith(`plugin.`)&&w())}),()=>f(`integrations-page`)),[u,f,w]),(0,D.useEffect)(()=>{g(!x&&!b?`Failed to load plugins`:null)},[x,b]);let T=(0,D.useMemo)(()=>(b??[]).filter(e=>e.status!==`orphan`),[b]),E=(0,D.useMemo)(()=>(b??[]).filter(e=>e.status===`orphan`),[b]);return t?(0,O.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,O.jsxs)(`div`,{className:`flex-shrink-0 border-b border-border px-6 pt-4 pb-3 flex items-center gap-2`,children:[(0,O.jsx)(S,{className:`w-4 h-4 text-accent-primary`}),(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsx)(`h1`,{className:`text-lg font-semibold`,children:e(`page.title`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`page.subtitle`)})]})]}),(0,O.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:C&&x?(0,O.jsx)(G,{}):h&&l?(0,O.jsx)(K,{onRetry:w}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,O.jsx)(P,{activeProjectId:t}),l&&T.map(e=>(0,O.jsx)(I,{plugin:e,isInstalling:_===e.name,onInstall:()=>y(e.name),onCloseInstall:()=>{y(null),w()}},e.name))]}),l&&E.length>0&&(0,O.jsxs)(`div`,{className:`mt-10`,children:[(0,O.jsxs)(`h2`,{className:`text-sm font-semibold text-muted-foreground mb-3 flex items-center gap-2`,children:[(0,O.jsx)(o,{className:`w-3.5 h-3.5`}),` `,e(`page.deprecated`)]}),(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:E.map(e=>(0,O.jsx)(V,{plugin:e,onRemoved:w},e.name))})]}),!r&&(!l||T.length===0)&&(0,O.jsx)(q,{})]})})]}):(0,O.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground text-sm`,children:e(`page.selectProject`)})}function I({plugin:e,isInstalling:t,onInstall:n,onCloseInstall:r}){let{t:i}=v(`integrations`),[a,s]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,children:[(0,O.jsx)(`div`,{className:`flex items-start gap-2`,children:(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:[`v`,e.version]}),e.status===`installed`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,children:[(0,O.jsx)(y,{className:`w-3 h-3`}),` `,i(`card.statusActive`)]}),e.status===`deactivated`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1`,children:[(0,O.jsx)(_,{className:`w-3 h-3`}),` `,i(`card.statusDeactivated`)]}),e.status===`degraded`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning flex items-center gap-1`,children:[(0,O.jsx)(o,{className:`w-3 h-3`}),` `,i(`card.statusDegraded`)]}),e.updateAvailable&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/20 text-accent-info flex items-center gap-1`,children:[(0,O.jsx)(C,{className:`w-3 h-3`}),` `,i(`card.updateAvailable`)]})]}),e.category&&(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:e.category})]})}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.description}),e.whatItDoes.length>0&&(0,O.jsx)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:e.whatItDoes.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))}),e.requirements.length>0&&(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:i(`card.requires`,{list:e.requirements.map(e=>`${e.name}${e.minVersion?` ≥ ${e.minVersion}`:``}`).join(`, `)})}),e.healthReason&&e.status===`degraded`&&(0,O.jsx)(`div`,{className:`text-[11px] text-accent-warning`,children:e.healthReason}),e.status===`deactivated`&&(0,O.jsx)(`div`,{className:`text-[11px] text-muted-foreground leading-relaxed`,children:(0,O.jsx)(x,{t:i,i18nKey:`card.deactivatedHint`,components:{strong:(0,O.jsx)(`strong`,{})}})}),e.marketplaceConflicts&&e.marketplaceConflicts.length>0&&(0,O.jsx)(B,{pluginName:e.name,conflicts:e.marketplaceConflicts}),e.marketplaceCachedButDisabled&&e.marketplaceCachedButDisabled.length>0&&(0,O.jsx)(R,{keys:e.marketplaceCachedButDisabled}),e.updateAvailable&&(0,O.jsx)(z,{pluginName:e.name}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:e.status===`not-installed`?(0,O.jsx)(`button`,{type:`button`,onClick:n,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90`,children:i(`card.install`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(L,{pluginName:e.name,active:e.status===`installed`}),(0,O.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(u,{className:`w-3 h-3`}),` `,i(`card.uninstall`)]})]})}),t&&(0,O.jsx)(H,{pluginName:e.name,onClose:r}),a&&(0,O.jsx)(U,{pluginName:e.name,onClose:()=>s(!1),onUninstalled:()=>{s(!1)}})]})}function L({pluginName:e,active:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(`button`,{type:`button`,disabled:i,onClick:async()=>{a(!0),s(null);try{let r=`${n()}/plugins/${e}/${t?`deactivate`:`activate`}`,i=await fetch(r,{method:`POST`});if(!i.ok)throw Error((await i.json()).error??`HTTP ${i.status}`)}catch(e){s(e.message)}finally{a(!1)}},role:`switch`,"aria-checked":t,className:`relative inline-flex items-center h-5 w-9 rounded-full transition-colors disabled:opacity-50 ${t?`bg-accent-success`:`bg-muted`}`,title:r(t?`toggle.titleActive`:`toggle.titleDeactivated`),children:(0,O.jsx)(`span`,{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?`translate-x-4`:`translate-x-0.5`}`})}),(0,O.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(t?`card.statusActive`:`common:states.off`)}),o&&(0,O.jsx)(`span`,{className:`text-[10px] text-destructive`,children:o})]})}function R({keys:e}){let{t}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(o,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`cachedNotice.body`,components:{strong:(0,O.jsx)(`strong`,{}),code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsx)(`div`,{className:`pl-5 space-y-0.5`,children:e.map(e=>(0,O.jsxs)(`pre`,{className:`text-[10px] bg-muted/40 rounded px-1.5 py-0.5 inline-block font-mono`,children:[`/plugin uninstall `,e]},e))}),(0,O.jsx)(`div`,{className:`pl-5 text-[10px] text-muted-foreground`,children:t(`cachedNotice.runInstruction`)})]})}function z({pluginName:e}){let{t}=v(`integrations`),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-accent-info/30 bg-accent-info/5 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(C,{className:`w-3 h-3 text-accent-info mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`update.body`,components:{code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsxs)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0),o(null);try{let t=await fetch(`${n()}/plugins/${e}/update`,{method:`POST`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){o(e.message)}finally{i(!1)}},className:`text-[10px] px-2 py-0.5 rounded border border-accent-info/40 hover:bg-accent-info/10 disabled:opacity-50 flex items-center gap-1`,children:[r&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t,i18nKey:`update.button`,components:{code:(0,O.jsx)(`code`,{})}})]}),a&&(0,O.jsx)(`div`,{className:`text-destructive text-[10px]`,children:a})]})}function B({pluginName:e,conflicts:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(null),[s,c]=(0,D.useState)(null),u=async e=>{a(e),c(null);try{let t=await fetch(`${n()}/plugins/_marketplace/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:e})});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){c(e.message)}finally{a(null)}};return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(o,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t:r,i18nKey:`conflict.body`,values:{name:e},components:{strong:(0,O.jsx)(`strong`,{})}})})]}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-1`,children:t.map(e=>(0,O.jsxs)(`button`,{type:`button`,disabled:i===e,onClick:()=>u(e),className:`text-[10px] px-2 py-0.5 rounded border border-yellow-500/40 aurora-light:border-accent-warning/40 hover:bg-yellow-500/10 aurora-light:hover:bg-accent-warning/10 disabled:opacity-50 flex items-center gap-1`,children:[i===e&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t:r,i18nKey:`conflict.disableButton`,values:{key:e},components:{code:(0,O.jsx)(`code`,{})}})]},e))}),s&&(0,O.jsx)(`div`,{className:`text-destructive`,children:s})]})}function V({plugin:e,onRemoved:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-4 flex flex-col gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-yellow-500/20 aurora-light:bg-accent-warning/15 text-yellow-500 aurora-light:text-accent-warning`,children:r(`orphan.badge`)})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),(0,O.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,O.jsxs)(`button`,{type:`button`,disabled:i,onClick:async()=>{a(!0);try{await fetch(`${n()}/plugins/${e.name}`,{method:`DELETE`}),t()}finally{a(!1)}},className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(u,{className:`w-3 h-3`}),` `,r(`orphan.removeButton`)]})})]})}function H({pluginName:e,onClose:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(null),[s,c]=(0,D.useState)(null),[u,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(null),[h,g]=(0,D.useState)([]),[b,x]=(0,D.useState)(null),[S,w]=(0,D.useState)([]),{registerHandler:T,unregisterHandler:E}=d(),k=(0,D.useCallback)(()=>{a(null),c(null),fetch(`${n()}/plugins/${e}/preview-install`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>a(e)).catch(e=>c(e.message))},[e]);(0,D.useEffect)(()=>{k()},[k]),(0,D.useEffect)(()=>(T(`install-${e}`,t=>{let n=t;if(n.type===`plugin.install_progress`&&n.name===e&&n.line&&g(e=>[...e,n.line]),n.type===`plugin.prereq_install_progress`&&n.line&&w(e=>[...e,n.line]),n.type===`plugin.prereq_installed`){x(null);let e=n.reason;e&&w(t=>[...t,`► ${e}`]),n.ok&&k()}}),()=>E(`install-${e}`)),[e,T,E,k]);let A=async e=>{x(e),w([r(`installDialog.installingPrereq`,{name:e})]);try{await fetch(`${n()}/plugins/_prerequisites/${e}/install`,{method:`POST`})}catch(e){w(t=>[...t,r(`installDialog.prereqStartFailed`,{message:e.message})]),x(null)}},j=(i?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum);return(0,O.jsxs)(W,{onClose:t,title:r(`installDialog.title`,{name:e}),children:[s&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:s}),!i&&!s&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(l,{className:`w-3 h-3 animate-spin`}),` `,r(`installDialog.computingChanges`)]}),i&&(0,O.jsxs)(O.Fragment,{children:[i.platformNote&&(0,O.jsxs)(`div`,{className:`flex items-start gap-2 p-2.5 rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 text-[11px] leading-relaxed`,children:[(0,O.jsx)(o,{className:`w-3.5 h-3.5 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:i.platformNote})]}),(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.filesHeading`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-0.5 font-mono`,children:i.files.map((e,t)=>(0,O.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path,e.summary&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e.summary]})]},t))})]}),i.requirements.length>0&&(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.prerequisites`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-1`,children:i.requirements.map(e=>{let t=e.installed&&e.executable&&e.meetsMinimum,n=e.name===`uv`;return(0,O.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t?(0,O.jsx)(y,{className:`w-3 h-3 text-accent-success`}):(0,O.jsx)(_,{className:`w-3 h-3 text-accent-warning`}),(0,O.jsxs)(`span`,{children:[e.name,e.minVersion?` ≥ ${e.minVersion}`:``]}),e.version&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]}),!t&&n&&(0,O.jsxs)(`button`,{type:`button`,disabled:b===e.name,onClick:()=>A(e.name),className:`ml-auto text-[10px] px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 flex items-center gap-1`,children:[b===e.name&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),r(`installDialog.autoInstall`)]})]},e.name)})}),S.length>0&&(0,O.jsx)(`pre`,{className:`mt-2 text-[11px] bg-muted/40 rounded p-2 max-h-24 overflow-auto font-mono`,children:S.join(`
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{$t as t,Bt as n,C as r,Dt as i,Et as a,L as o,N as s,O as c,Q as l,R as u,Rt as d,S as f,T as p,Tt as m,Y as h,cn as g,dt as _,en as v,ft as y,k as b,nn as x,q as S,st as C,t as w,w as T,zt as E}from"./index-BEGU2TCx.js";var D=e(g(),1),O=E(),k=[`todo`,`in_progress`,`done`,`cancelled`],A={todo:`todo`,in_progress:`inProgress`,done:`done`,cancelled:`cancelled`};function j({state:e,onChanged:n}){let{t:r}=v(`jira`),i=e.connection,[a,o]=(0,D.useState)(i.enabled),[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),[p,m]=(0,D.useState)([]),[h,g]=(0,D.useState)([]),[_,y]=(0,D.useState)(i.discardStatus??``),[b,x]=(0,D.useState)(i.statusMap??{}),S=e.outbox??{pending:0,inflight:0,done:0,dead:0},C=(0,D.useCallback)(async()=>{try{let{ops:e}=await f.listOutbox(`dead`);m(e)}catch{m([])}},[]);(0,D.useEffect)(()=>{C()},[C]),(0,D.useEffect)(()=>{let e=!1;return f.listStatuses().then(({statuses:t})=>{e||g(t)}).catch(()=>{e||g([])}),()=>{e=!0}},[]);async function w(e){let i=_;y(e);try{await f.patchConnection({discardStatus:e||null}),n()}catch(e){y(i),t.error(N(e,r))}}async function T(e,i){let a=b,o={...b,[e]:i||void 0};x(o);let s=Object.fromEntries(Object.entries(o).filter(([,e])=>e));try{await f.patchConnection({statusMap:Object.keys(s).length?s:null}),n()}catch(e){x(a),t.error(N(e,r))}}async function E(){let e=!a;o(e),d(!0);try{await f.setEnabled(e)}catch(n){o(!e),t.error(N(n,r))}finally{d(!1)}}async function j(){l(!0);try{let e=await f.syncNow();t.success(r(`status.syncedToast`,{count:e.upserted}))}catch(e){t.error(N(e,r))}finally{l(!1)}}async function P(){if(window.confirm(r(`status.disconnectConfirm`))){d(!0);try{await f.disconnect(),t.success(r(`status.disconnectedToast`)),n()}catch(e){t.error(N(e,r))}finally{d(!1)}}}async function F(e){try{await f.retryOutbox(e),await C()}catch(e){t.error(N(e,r))}}let I=S.pending+S.inflight;return(0,O.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:r(`status.connected`,{key:i.jiraProjectKey})}),(0,O.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i.baseUrl,` · `,i.deployment===`cloud`?r(`review.cloud`):r(`review.dc`)]})]}),(0,O.jsx)(`a`,{href:`${i.baseUrl}/browse/${i.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:r(`badge.openInJira`)})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`status.enabledLabel`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(a?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,O.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":a,"aria-label":r(`status.enabledLabel`),disabled:u,onClick:E,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${a?`bg-accent-success`:`bg-input`}`,children:(0,O.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${a?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`wizard.step3Title`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`mapping.intro`)}),(0,O.jsx)(`div`,{className:`space-y-2`,children:k.map(e=>(0,O.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`mapping.${A[e]}`)}),(0,O.jsxs)(`select`,{value:b[e]??``,onChange:t=>void T(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,O.jsx)(`option`,{value:``,children:r(`mapping.auto`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!h.some(t=>t.name===b[e])&&(0,O.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`discard.configLabel`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:r(`discard.configHelp`)}),(0,O.jsxs)(`select`,{value:_,onChange:e=>void w(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,O.jsx)(`option`,{value:``,children:r(`discard.configNone`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),_&&!h.some(e=>e.name===_)&&(0,O.jsx)(`option`,{value:_,children:_})]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(s,{variant:`outline`,size:`sm`,onClick:j,disabled:c,children:r(c?`status.syncing`:`status.syncNow`)}),(0,O.jsx)(s,{variant:`ghost`,size:`sm`,onClick:P,disabled:u,className:`text-destructive`,children:r(`status.disconnect`)})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:r(`outbox.title`)}),S.dead>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-accent-warning`,children:r(`outbox.dead`,{count:S.dead})}):I>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.pending`,{count:I})}):(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`outbox.allSynced`)}),p.length>0&&(0,O.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`outbox.deadHelp`)}),p.map(e=>(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border border-border/60 px-2 py-1`,children:[(0,O.jsxs)(`span`,{className:`truncate text-xs`,children:[M(e,r),` · `,e.deadReason??e.lastError??``]}),(0,O.jsx)(s,{variant:`outline`,size:`sm`,onClick:()=>F(e.id),children:r(`outbox.retry`)})]},e.id))]})]})]})}function M(e,t){return e.opType===`transition`?t(`outbox.opTransition`):e.opType===`comment`?t(`outbox.opComment`):t(`outbox.opCreate`)}function N(e,t){return e instanceof Error?e.message:t(`errors.generic`)}function P({activeProjectId:e}){let{t}=v(`integrations`),[n,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(!0),[s,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),m=(0,D.useCallback)(async()=>{try{i(await f.getConnection())}catch{i({connected:!1})}finally{o(!1)}},[]);if((0,D.useEffect)(()=>{!r||!e||(o(!0),m())},[e,m]),!r)return null;let g=!!(n?.connected&&n.connection);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,"data-testid":`jira-integration-card`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,O.jsx)(`div`,{className:`grid place-items-center w-9 h-9 rounded-md bg-accent-info/15 text-accent-info shrink-0`,children:(0,O.jsx)(h,{className:`w-4 h-4`})}),(0,O.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:t(`jiraCard.title`)}),g&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,"data-testid":`jira-connected-badge`,children:[(0,O.jsx)(y,{className:`w-3 h-3`}),` `,t(`jiraCard.connected`)]})]}),(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:t(`jiraCard.category`)})]})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:g&&n?.connection?t(`jiraCard.connectedDescription`,{key:n.connection.jiraProjectKey}):t(`jiraCard.description`)}),(0,O.jsxs)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:[(0,O.jsx)(`li`,{children:t(`jiraCard.bullet1`)}),(0,O.jsx)(`li`,{children:t(`jiraCard.bullet2`)}),(0,O.jsx)(`li`,{children:t(`jiraCard.bullet3`)})]}),(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`jiraCard.requires`)}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:a?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`…`}):g?(0,O.jsx)(`button`,{type:`button`,onClick:()=>d(!0),"data-testid":`jira-manage-btn`,className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-muted/30 inline-flex items-center gap-1.5`,children:t(`jiraCard.manage`)}):(0,O.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),"data-testid":`jira-connect-btn`,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90 inline-flex items-center gap-1.5`,children:[(0,O.jsx)(h,{className:`w-3.5 h-3.5`}),t(`jiraCard.connect`)]})}),(0,O.jsx)(T,{open:s,onOpenChange:l,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(b,{children:t(`jiraCard.modalTitle`)})}),(0,O.jsx)(w,{onConnected:()=>{l(!1),m()},onSkip:()=>l(!1)})]})}),(0,O.jsx)(T,{open:u,onOpenChange:d,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(b,{children:t(`jiraCard.manageTitle`)})}),n?.connected&&n.connection&&(0,O.jsx)(j,{state:n,onChanged:()=>{m().then(()=>d(!1))}})]})})]})}function F(){let{t:e}=v(`integrations`),{activeProjectId:t,projects:s}=a(),c=s.find(e=>e.id===t),l=c?m(c).includes(`claude`):!0,{registerHandler:u,unregisterHandler:f}=d(),p=(0,D.useRef)(t);(0,D.useEffect)(()=>{p.current=t},[t]);let[h,g]=(0,D.useState)(null),[_,y]=(0,D.useState)(null),{data:b,isLoading:x,isFirstLoad:C,refresh:w}=i({namespace:`plugins`,projectId:t,initialValue:[],fetcher:(0,D.useCallback)(async()=>{let e=await fetch(`${n()}/plugins`);if(!e.ok)throw Error(`HTTP ${e.status}`);return(await e.json()).plugins??[]},[])});(0,D.useEffect)(()=>(u(`integrations-page`,e=>{let t=e;t.type&&(t.projectId&&t.projectId!==p.current||t.type.startsWith(`plugin.`)&&w())}),()=>f(`integrations-page`)),[u,f,w]),(0,D.useEffect)(()=>{g(!x&&!b?`Failed to load plugins`:null)},[x,b]);let T=(0,D.useMemo)(()=>(b??[]).filter(e=>e.status!==`orphan`),[b]),E=(0,D.useMemo)(()=>(b??[]).filter(e=>e.status===`orphan`),[b]);return t?(0,O.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,O.jsxs)(`div`,{className:`flex-shrink-0 border-b border-border px-6 pt-4 pb-3 flex items-center gap-2`,children:[(0,O.jsx)(S,{className:`w-4 h-4 text-accent-primary`}),(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsx)(`h1`,{className:`text-lg font-semibold`,children:e(`page.title`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`page.subtitle`)})]})]}),(0,O.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:C&&x?(0,O.jsx)(G,{}):h&&l?(0,O.jsx)(K,{onRetry:w}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,O.jsx)(P,{activeProjectId:t}),l&&T.map(e=>(0,O.jsx)(I,{plugin:e,isInstalling:_===e.name,onInstall:()=>y(e.name),onCloseInstall:()=>{y(null),w()}},e.name))]}),l&&E.length>0&&(0,O.jsxs)(`div`,{className:`mt-10`,children:[(0,O.jsxs)(`h2`,{className:`text-sm font-semibold text-muted-foreground mb-3 flex items-center gap-2`,children:[(0,O.jsx)(o,{className:`w-3.5 h-3.5`}),` `,e(`page.deprecated`)]}),(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:E.map(e=>(0,O.jsx)(V,{plugin:e,onRemoved:w},e.name))})]}),!r&&(!l||T.length===0)&&(0,O.jsx)(q,{})]})})]}):(0,O.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground text-sm`,children:e(`page.selectProject`)})}function I({plugin:e,isInstalling:t,onInstall:n,onCloseInstall:r}){let{t:i}=v(`integrations`),[a,s]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,children:[(0,O.jsx)(`div`,{className:`flex items-start gap-2`,children:(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:[`v`,e.version]}),e.status===`installed`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,children:[(0,O.jsx)(y,{className:`w-3 h-3`}),` `,i(`card.statusActive`)]}),e.status===`deactivated`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1`,children:[(0,O.jsx)(_,{className:`w-3 h-3`}),` `,i(`card.statusDeactivated`)]}),e.status===`degraded`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning flex items-center gap-1`,children:[(0,O.jsx)(o,{className:`w-3 h-3`}),` `,i(`card.statusDegraded`)]}),e.updateAvailable&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/20 text-accent-info flex items-center gap-1`,children:[(0,O.jsx)(C,{className:`w-3 h-3`}),` `,i(`card.updateAvailable`)]})]}),e.category&&(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:e.category})]})}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.description}),e.whatItDoes.length>0&&(0,O.jsx)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:e.whatItDoes.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))}),e.requirements.length>0&&(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:i(`card.requires`,{list:e.requirements.map(e=>`${e.name}${e.minVersion?` ≥ ${e.minVersion}`:``}`).join(`, `)})}),e.healthReason&&e.status===`degraded`&&(0,O.jsx)(`div`,{className:`text-[11px] text-accent-warning`,children:e.healthReason}),e.status===`deactivated`&&(0,O.jsx)(`div`,{className:`text-[11px] text-muted-foreground leading-relaxed`,children:(0,O.jsx)(x,{t:i,i18nKey:`card.deactivatedHint`,components:{strong:(0,O.jsx)(`strong`,{})}})}),e.marketplaceConflicts&&e.marketplaceConflicts.length>0&&(0,O.jsx)(B,{pluginName:e.name,conflicts:e.marketplaceConflicts}),e.marketplaceCachedButDisabled&&e.marketplaceCachedButDisabled.length>0&&(0,O.jsx)(R,{keys:e.marketplaceCachedButDisabled}),e.updateAvailable&&(0,O.jsx)(z,{pluginName:e.name}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:e.status===`not-installed`?(0,O.jsx)(`button`,{type:`button`,onClick:n,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90`,children:i(`card.install`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(L,{pluginName:e.name,active:e.status===`installed`}),(0,O.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(u,{className:`w-3 h-3`}),` `,i(`card.uninstall`)]})]})}),t&&(0,O.jsx)(H,{pluginName:e.name,onClose:r}),a&&(0,O.jsx)(U,{pluginName:e.name,onClose:()=>s(!1),onUninstalled:()=>{s(!1)}})]})}function L({pluginName:e,active:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(`button`,{type:`button`,disabled:i,onClick:async()=>{a(!0),s(null);try{let r=`${n()}/plugins/${e}/${t?`deactivate`:`activate`}`,i=await fetch(r,{method:`POST`});if(!i.ok)throw Error((await i.json()).error??`HTTP ${i.status}`)}catch(e){s(e.message)}finally{a(!1)}},role:`switch`,"aria-checked":t,className:`relative inline-flex items-center h-5 w-9 rounded-full transition-colors disabled:opacity-50 ${t?`bg-accent-success`:`bg-muted`}`,title:r(t?`toggle.titleActive`:`toggle.titleDeactivated`),children:(0,O.jsx)(`span`,{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?`translate-x-4`:`translate-x-0.5`}`})}),(0,O.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(t?`card.statusActive`:`common:states.off`)}),o&&(0,O.jsx)(`span`,{className:`text-[10px] text-destructive`,children:o})]})}function R({keys:e}){let{t}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(o,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`cachedNotice.body`,components:{strong:(0,O.jsx)(`strong`,{}),code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsx)(`div`,{className:`pl-5 space-y-0.5`,children:e.map(e=>(0,O.jsxs)(`pre`,{className:`text-[10px] bg-muted/40 rounded px-1.5 py-0.5 inline-block font-mono`,children:[`/plugin uninstall `,e]},e))}),(0,O.jsx)(`div`,{className:`pl-5 text-[10px] text-muted-foreground`,children:t(`cachedNotice.runInstruction`)})]})}function z({pluginName:e}){let{t}=v(`integrations`),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-accent-info/30 bg-accent-info/5 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(C,{className:`w-3 h-3 text-accent-info mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`update.body`,components:{code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsxs)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0),o(null);try{let t=await fetch(`${n()}/plugins/${e}/update`,{method:`POST`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){o(e.message)}finally{i(!1)}},className:`text-[10px] px-2 py-0.5 rounded border border-accent-info/40 hover:bg-accent-info/10 disabled:opacity-50 flex items-center gap-1`,children:[r&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t,i18nKey:`update.button`,components:{code:(0,O.jsx)(`code`,{})}})]}),a&&(0,O.jsx)(`div`,{className:`text-destructive text-[10px]`,children:a})]})}function B({pluginName:e,conflicts:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(null),[s,c]=(0,D.useState)(null),u=async e=>{a(e),c(null);try{let t=await fetch(`${n()}/plugins/_marketplace/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:e})});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){c(e.message)}finally{a(null)}};return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(o,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t:r,i18nKey:`conflict.body`,values:{name:e},components:{strong:(0,O.jsx)(`strong`,{})}})})]}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-1`,children:t.map(e=>(0,O.jsxs)(`button`,{type:`button`,disabled:i===e,onClick:()=>u(e),className:`text-[10px] px-2 py-0.5 rounded border border-yellow-500/40 aurora-light:border-accent-warning/40 hover:bg-yellow-500/10 aurora-light:hover:bg-accent-warning/10 disabled:opacity-50 flex items-center gap-1`,children:[i===e&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t:r,i18nKey:`conflict.disableButton`,values:{key:e},components:{code:(0,O.jsx)(`code`,{})}})]},e))}),s&&(0,O.jsx)(`div`,{className:`text-destructive`,children:s})]})}function V({plugin:e,onRemoved:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-4 flex flex-col gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-yellow-500/20 aurora-light:bg-accent-warning/15 text-yellow-500 aurora-light:text-accent-warning`,children:r(`orphan.badge`)})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),(0,O.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,O.jsxs)(`button`,{type:`button`,disabled:i,onClick:async()=>{a(!0);try{await fetch(`${n()}/plugins/${e.name}`,{method:`DELETE`}),t()}finally{a(!1)}},className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(u,{className:`w-3 h-3`}),` `,r(`orphan.removeButton`)]})})]})}function H({pluginName:e,onClose:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(null),[s,c]=(0,D.useState)(null),[u,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(null),[h,g]=(0,D.useState)([]),[b,x]=(0,D.useState)(null),[S,w]=(0,D.useState)([]),{registerHandler:T,unregisterHandler:E}=d(),k=(0,D.useCallback)(()=>{a(null),c(null),fetch(`${n()}/plugins/${e}/preview-install`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>a(e)).catch(e=>c(e.message))},[e]);(0,D.useEffect)(()=>{k()},[k]),(0,D.useEffect)(()=>(T(`install-${e}`,t=>{let n=t;if(n.type===`plugin.install_progress`&&n.name===e&&n.line&&g(e=>[...e,n.line]),n.type===`plugin.prereq_install_progress`&&n.line&&w(e=>[...e,n.line]),n.type===`plugin.prereq_installed`){x(null);let e=n.reason;e&&w(t=>[...t,`► ${e}`]),n.ok&&k()}}),()=>E(`install-${e}`)),[e,T,E,k]);let A=async e=>{x(e),w([r(`installDialog.installingPrereq`,{name:e})]);try{await fetch(`${n()}/plugins/_prerequisites/${e}/install`,{method:`POST`})}catch(e){w(t=>[...t,r(`installDialog.prereqStartFailed`,{message:e.message})]),x(null)}},j=(i?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum);return(0,O.jsxs)(W,{onClose:t,title:r(`installDialog.title`,{name:e}),children:[s&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:s}),!i&&!s&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(l,{className:`w-3 h-3 animate-spin`}),` `,r(`installDialog.computingChanges`)]}),i&&(0,O.jsxs)(O.Fragment,{children:[i.platformNote&&(0,O.jsxs)(`div`,{className:`flex items-start gap-2 p-2.5 rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 text-[11px] leading-relaxed`,children:[(0,O.jsx)(o,{className:`w-3.5 h-3.5 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:i.platformNote})]}),(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.filesHeading`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-0.5 font-mono`,children:i.files.map((e,t)=>(0,O.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path,e.summary&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e.summary]})]},t))})]}),i.requirements.length>0&&(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.prerequisites`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-1`,children:i.requirements.map(e=>{let t=e.installed&&e.executable&&e.meetsMinimum,n=e.name===`uv`;return(0,O.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t?(0,O.jsx)(y,{className:`w-3 h-3 text-accent-success`}):(0,O.jsx)(_,{className:`w-3 h-3 text-accent-warning`}),(0,O.jsxs)(`span`,{children:[e.name,e.minVersion?` ≥ ${e.minVersion}`:``]}),e.version&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]}),!t&&n&&(0,O.jsxs)(`button`,{type:`button`,disabled:b===e.name,onClick:()=>A(e.name),className:`ml-auto text-[10px] px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 flex items-center gap-1`,children:[b===e.name&&(0,O.jsx)(l,{className:`w-2.5 h-2.5 animate-spin`}),r(`installDialog.autoInstall`)]})]},e.name)})}),S.length>0&&(0,O.jsx)(`pre`,{className:`mt-2 text-[11px] bg-muted/40 rounded p-2 max-h-24 overflow-auto font-mono`,children:S.join(`
|
|
2
2
|
`)})]}),h.length>0&&(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.progress`)}),(0,O.jsx)(`pre`,{className:`text-[11px] bg-muted/40 rounded p-2 max-h-32 overflow-auto font-mono`,children:h.join(`
|
|
3
3
|
`)})]}),p&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:p})]}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,O.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:r(`common:actions.cancel`)}),(0,O.jsxs)(`button`,{type:`button`,disabled:!i||!j||u,onClick:async()=>{f(!0),m(null);try{let r=await fetch(`${n()}/plugins/${e}/install`,{method:`POST`});if(!r.ok)throw Error((await r.json()).error??`HTTP ${r.status}`);setTimeout(t,1500)}catch(e){m(e.message)}finally{f(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white disabled:opacity-50 flex items-center gap-1.5`,children:[u?(0,O.jsx)(l,{className:`w-3 h-3 animate-spin`}):(0,O.jsx)(C,{className:`w-3 h-3`}),r(`card.install`)]})]})]})}function U({pluginName:e,onClose:t,onUninstalled:r}){let{t:i}=v(`integrations`),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(null);return(0,O.jsxs)(W,{onClose:t,title:i(`uninstallDialog.title`,{name:e}),children:[(0,O.jsx)(`p`,{className:`text-xs`,children:(0,O.jsx)(x,{t:i,i18nKey:`uninstallDialog.body`,components:{code:(0,O.jsx)(`code`,{})}})}),s&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:s}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,O.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:i(`common:actions.cancel`)}),(0,O.jsxs)(`button`,{type:`button`,disabled:a,onClick:async()=>{o(!0);try{let t=await fetch(`${n()}/plugins/${e}`,{method:`DELETE`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`);r()}catch(e){c(e.message)}finally{o(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-destructive text-white disabled:opacity-50 flex items-center gap-1.5`,children:[a&&(0,O.jsx)(l,{className:`w-3 h-3 animate-spin`}),i(`card.uninstall`)]})]})]})}function W({title:e,onClose:t,children:n}){return(0,O.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,role:`dialog`,tabIndex:-1,onClick:t,children:(0,O.jsxs)(`div`,{className:`bg-card border border-border rounded-lg shadow-xl w-full max-w-md p-5 flex flex-col gap-3`,onClick:e=>e.stopPropagation(),children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e}),n]})})}function G(){return(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Array.from({length:3},(e,t)=>(0,O.jsx)(`div`,{className:`rounded-lg border border-border bg-card p-4 h-40 animate-pulse`},t))})}function K({onRetry:e}){let{t}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground`,children:[(0,O.jsx)(o,{className:`w-5 h-5 text-destructive`}),(0,O.jsx)(`p`,{children:t(`page.loadError`)}),(0,O.jsx)(`button`,{type:`button`,onClick:e,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:t(`common:actions.retry`)})]})}function q(){let{t:e}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-2 text-sm text-muted-foreground`,children:[(0,O.jsx)(S,{className:`w-6 h-6`}),(0,O.jsx)(`p`,{children:e(`page.empty`)})]})}export{F as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{$t as t,Bt as n,Et as r,G as i,H as a,M as o,N as s,Ot as ee,P as c,Q as l,Rt as u,V as d,an as f,b as p,cn as m,ct as h,dt as g,en as _,ft as v,gt as y,ht as b,in as x,kt as S,l as C,m as w,mt as T,o as E,p as D,rn as O,st as te,u as ne,ut as k,wt as A,x as j,y as M,zt as N}from"./index-wK8zASrE.js";import{t as P}from"./lib-CiLTp9yY.js";import{t as re}from"./format-command-CZsy-vHq.js";var F=A(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ie=A(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),I=e(m(),1),L=N();function ae({phases:e,phaseDefinitions:t}){return t.length===0?null:(0,L.jsx)(`div`,{className:`flex items-center`,children:t.map((n,r)=>{let i=e[n.key]??`idle`,a=r<t.length-1?e[t[r+1].key]??`idle`:null;return(0,L.jsxs)(`div`,{className:`flex items-center`,children:[(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 cursor-default px-4`,children:[(0,L.jsx)(R,{state:i}),(0,L.jsx)(`span`,{className:c(`text-xs font-medium transition-colors`,i===`running`?`text-blue-400 aurora-light:text-accent-info`:i===`done`?`text-emerald-400 aurora-light:text-accent-success`:i===`error`?`text-red-400 aurora-light:text-destructive`:`text-muted-foreground/40`),children:n.label})]})}),(0,L.jsxs)(p,{side:`bottom`,className:`max-w-[200px]`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:n.label}),(0,L.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:n.description})]})]}),a!==null&&(0,L.jsx)(`div`,{className:c(`h-px w-12 -mt-5 shrink-0 transition-all duration-300`,a===`done`||i===`done`?`bg-emerald-500/30 aurora-light:bg-accent-success/40`:a===`running`?`bg-blue-400/40 aurora-light:bg-accent-info/40`:`bg-border/30`)})]},n.key)})})}function R({state:e}){return(0,L.jsxs)(`div`,{className:c(`flex items-center justify-center w-10 h-10 rounded-full transition-all duration-300`,e===`running`?`bg-blue-500/10 aurora-light:bg-accent-info/10 ring-1 ring-blue-400/30 aurora-light:ring-accent-info/30 animate-pulse`:e===`done`?`bg-emerald-500/10 aurora-light:bg-accent-success/10`:e===`error`?`bg-red-500/10 aurora-light:bg-destructive/10`:`bg-muted/20`),children:[e===`running`&&(0,L.jsx)(l,{className:`w-6 h-6 text-blue-400 aurora-light:text-accent-info animate-spin`}),e===`done`&&(0,L.jsx)(v,{className:`w-6 h-6 text-emerald-400 aurora-light:text-accent-success`}),e===`error`&&(0,L.jsx)(g,{className:`w-6 h-6 text-red-400 aurora-light:text-destructive`}),e===`idle`&&(0,L.jsx)(k,{className:`w-6 h-6 text-muted-foreground/20`})]})}function z(e,t){let n=(typeof t==`number`?t:new Date(t).getTime())-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`—`;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function oe(e){let t=new Set;for(let n of e)if(n.event_type===`log`)try{let e=(JSON.parse(n.payload).line??``).match(/(?:Writing|Editing|Created?|Updated?)\s+(?:file:\s*)?([\w./\-]+\.\w+)/i);e&&t.add(e[1])}catch{}return Array.from(t).slice(0,20)}var se=new Set([`editing`,`writing`,`reading`,`searching`,`running`]);function B(e){return e.length>40?`${e.slice(0,39)}…`:e}function V(e){return typeof e!=`string`||e.length===0?``:B(e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??``)}function H(e){return typeof e!=`string`||e.length===0?``:B(e.trim().split(/\s+/)[0]??``)}function ce(e){if(typeof e!=`string`)return``;try{let t=JSON.parse(e)?.command;if(Array.isArray(t))return H(t.filter(e=>typeof e==`string`).join(` `));if(typeof t==`string`)return H(t)}catch{}return``}function U(e,t){let n=t??{},r=V(n.file_path??n.path);switch(e){case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:return{step:!0,actionKey:`editing`,actionArg:r};case`Write`:case`create`:return{step:!0,actionKey:`writing`,actionArg:r};case`Read`:return{step:!0,actionKey:`reading`,actionArg:r};case`Grep`:case`Glob`:case`search`:return{step:!0,actionKey:`searching`,actionArg:B(String(n.pattern??n.query??``))};case`Bash`:case`shell`:return{step:!0,actionKey:`running`,actionArg:H(n.command)};default:return{step:!0,actionKey:`working`}}}function W(e){let t=e.event_type,n={};try{let t=JSON.parse(e.payload);t&&typeof t==`object`&&!Array.isArray(t)&&(n=t)}catch{}if(t===`assistant`){let e=n.message?.content;if(Array.isArray(e)){let t=e.filter(e=>e?.type===`tool_use`);if(t.length>0){let e=t[t.length-1];return{...U(e.name,e.input),stepCount:t.length}}if(e.some(e=>e?.type===`text`))return{step:!0,actionKey:`thinking`}}return{step:!0}}if(t===`tool_use`)return U(n.name,n.input);if(t===`item.completed`){let e=n.item,t=e?.type;return t===`agent_message`?{step:!0,actionKey:`thinking`}:t===`agent_reasoning`?{step:!0,actionKey:`reasoning`}:t===`function_call`||t===`local_shell_call`||t===`command_execution`?{step:!0,actionKey:`running`,actionArg:H(e?.command)||ce(e?.arguments)||(typeof e?.name==`string`?B(e.name):``)||(t===`local_shell_call`?`shell`:``)}:{step:!0}}return{step:!1}}var G={steps:0,actionKey:``,actionArg:``,lastSeenIdx:0};function K(e,t){if(t.type===`reset`)return G;if(t.type===`consume`){let{events:n}=t,r=e.lastSeenIdx>n.length?n.length:e.lastSeenIdx;if(n.length<=r)return r===e.lastSeenIdx?e:{...e,lastSeenIdx:r};let{steps:i,actionKey:a,actionArg:o}=e;for(let e=r;e<n.length;e++){let t=W(n[e]);t.step&&(i+=t.stepCount??1),t.actionKey&&(a=t.actionKey,o=t.actionArg??``)}return{steps:i,actionKey:a,actionArg:o,lastSeenIdx:n.length}}return e}function le({job:e,events:t,defaultOpen:n=!0,pipelineTotals:r,phases:i,phaseDefinitions:a}){let{t:o}=_(`jobs`),[s,ee]=(0,I.useState)(n),u=(0,I.useMemo)(()=>oe(t),[t]),d=e.status===`running`,f=e.status===`completed`,[p,m]=(0,I.useState)(()=>Date.now());(0,I.useEffect)(()=>{if(!d)return;let e=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(e)},[d]);let[h,b]=(0,I.useReducer)(K,G),x=(0,I.useRef)(e.id);(0,I.useEffect)(()=>{x.current!==e.id&&(x.current=e.id,b({type:`reset`})),b({type:`consume`,events:t})},[e.id,t]);let[S,C]=(0,I.useState)(!0);(0,I.useEffect)(()=>{if(!d)return;C(!0);let e=window.setTimeout(()=>C(!1),8e3);return()=>window.clearTimeout(e)},[d,e.id]);let w=e.finished_at?z(e.started_at,e.finished_at):d?z(e.started_at,p):`—`,T=!!e.total_cost_usd_estimated,E=e.total_cost_usd==null?null:`${T?`~`:``}$${e.total_cost_usd.toFixed(4)}`,D=e.num_turns==null?null:String(e.num_turns),O=e.tokens_in==null?null:(e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0),te=O==null?null:`${(O/1e3).toFixed(1)}k`,ne=(0,I.useMemo)(()=>!i||!a?null:a.find(e=>i[e.key]===`running`)?.label??null,[i,a]),k=d&&h.steps===0?`connecting`:h.actionKey||`thinking`,A=se.has(k)&&h.actionArg!==``,j=se.has(k)&&!A?`working`:k,M=A?o(`statusPanel.activity.${j}`,{arg:h.actionArg}):o(`statusPanel.activity.${j}`),N=ne??(d&&h.steps===0?o(`statusPanel.activity.starting`):null),P=h.steps>0?o(`statusPanel.steps`,{count:h.steps}):null,re=o(d?`statusPanel.inProgress`:f?`statusPanel.completed`:`statusPanel.failed`),F=d?`border-accent-info/20 bg-accent-info/5`:f?`border-emerald-500/20 aurora-light:border-accent-success/30 bg-emerald-500/5 aurora-light:bg-accent-success/5`:`border-red-500/20 aurora-light:border-destructive/30 bg-red-500/5 aurora-light:bg-destructive/5`,ie=d?l:f?v:g,ae=d?`w-4 h-4 text-accent-info shrink-0 animate-spin`:f?`w-4 h-4 text-emerald-400 aurora-light:text-accent-success shrink-0`:`w-4 h-4 text-red-400 aurora-light:text-destructive shrink-0`;return(0,L.jsxs)(`div`,{className:c(`mx-4 my-2 rounded-xl border transition-colors duration-500`,F),children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>ee(!s),className:`w-full flex items-center gap-3 px-4 py-3`,children:[(0,L.jsx)(ie,{className:ae,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold flex-1 text-left`,children:re}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`tabular-nums`,children:w}),d?P&&(0,L.jsx)(`span`,{className:`tabular-nums`,children:P}):(0,L.jsxs)(L.Fragment,{children:[E&&(0,L.jsx)(`span`,{className:`tabular-nums text-yellow-400 aurora-light:text-accent-warning`,children:E}),u.length>0&&(0,L.jsx)(`span`,{children:o(`statusPanel.filesCount`,{count:u.length})})]})]}),(0,L.jsx)(y,{className:c(`w-4 h-4 text-muted-foreground/40 transition-transform duration-150 shrink-0`,s&&`rotate-180`)})]}),s&&(0,L.jsx)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/20`,children:d?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneInProgress`)}),(0,L.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 sm:items-stretch`,children:[(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 sm:w-44 shrink-0`,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[o(`statusPanel.duration`),(0,L.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent-info animate-pulse`,title:o(`statusPanel.liveTooltip`),"aria-label":o(`statusPanel.liveTooltip`)})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-accent-info`,children:w})]}),(0,L.jsxs)(`div`,{className:`flex-1 flex items-center gap-2 bg-muted/10 rounded-lg px-3 py-2 min-w-0`,children:[(0,L.jsx)(l,{className:`w-3.5 h-3.5 text-accent-info shrink-0 animate-spin`,"aria-hidden":`true`}),N&&(0,L.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info shrink-0`,children:N}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground truncate flex-1 min-w-0`,children:M}),P&&(0,L.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60 tabular-nums shrink-0`,children:[`· `,P]})]})]}),S&&(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground/40 leading-snug`,children:o(`statusPanel.explainer`)}),(0,L.jsx)(`p`,{className:`pt-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider border-t border-accent-info/10 mt-1`,children:o(`statusPanel.zoneFinalPending`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,L.jsx)(Y,{label:o(`statusPanel.cost`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.costTooltip`)}),(0,L.jsx)(Y,{label:o(`statusPanel.turns`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)}),(0,L.jsx)(Y,{label:o(`statusPanel.tokens`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneFinal`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[(0,L.jsx)(q,{label:o(`statusPanel.duration`),value:w}),(0,L.jsx)(J,{label:o(`statusPanel.cost`),value:E,valueClass:`text-yellow-400 aurora-light:text-accent-warning`,naCaption:o(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:o(`statusPanel.turns`),value:D,naCaption:o(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:o(`statusPanel.tokens`),value:te,naCaption:o(`statusPanel.notAvailable`)})]}),r&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.pipelineTotal`,{count:r.jobCount})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,L.jsx)(q,{label:o(`statusPanel.totalCost`),value:`$${r.totalCostUsd.toFixed(4)}`,valueClass:`text-yellow-400 aurora-light:text-accent-warning`}),(0,L.jsx)(q,{label:o(`statusPanel.totalTokens`),value:`${((r.totalTokensIn+r.totalTokensOut+r.totalTokensCacheRead+r.totalTokensCacheCreate)/1e3).toFixed(1)}k`})]})]}),u.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.filesModified`)}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,L.jsx)(`code`,{className:`text-[10px] font-mono bg-muted/30 px-2 py-0.5 rounded text-cyan-400/80 aurora-light:text-accent-info`,children:e},e))})]})]})})]})}function q({label:e,value:t,valueClass:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,n),children:t})]})}function J({label:e,value:t,valueClass:n,naCaption:r}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,t==null?`text-muted-foreground`:n),children:t??`—`}),t==null&&(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:r})]})}function Y({label:e,caption:t,tooltip:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 ring-1 ring-accent-info/10`,title:n,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[e,(0,L.jsx)(F,{className:`w-2.5 h-2.5 text-muted-foreground/30`,"aria-hidden":`true`})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-muted-foreground/40`,children:`—`}),(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:t})]})}var X=4;function ue({tickets:e,onTicketClick:t}){let{t:n}=_(`jobs`),[r,i]=(0,I.useState)(!1);if(e.length===0)return null;let a=e.length>=X&&!r?e.slice(0,1):e,o=e.length-a.length;return(0,L.jsxs)(`div`,{className:`rounded-xl border border-border/40 bg-card/40 px-4 py-3 space-y-1.5`,children:[a.map(e=>(0,L.jsx)(Z,{ticket:e,onClick:()=>t(e.id)},e.id)),o>0&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showMore`,{count:o}),(0,L.jsx)(y,{className:`w-3 h-3`})]}),r&&e.length>=X&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!1),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showLess`),(0,L.jsx)(T,{className:`w-3 h-3`})]})]})}function Z({ticket:e,onClick:t}){let{t:n}=_(`jobs`),r=e.title==null,i=`inline-flex items-center px-1.5 py-0.5 rounded-md text-[11px] font-mono tabular-nums shrink-0`;return r?(0,L.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,L.jsx)(`span`,{className:c(i,`text-muted-foreground bg-muted/20 select-none`),title:n(`ticketHeader.deletedTooltip`),children:n(`ticketHeader.deletedTicket`,{id:e.id})})}):(0,L.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center gap-2 min-w-0 w-full text-left group`,title:e.title??void 0,children:[(0,L.jsxs)(`span`,{className:c(i,`text-accent-primary bg-accent-primary/10 group-hover:bg-accent-primary/20 transition-colors`),children:[`#`,e.id]}),(0,L.jsx)(`span`,{className:`text-lg font-semibold text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title})]})}function Q(e){let t=e.trimStart();return!!(/^#{1,6}\s/.test(t)||/^[-*+]\s/.test(t)||/^\d+\.\s/.test(t)||/^\|.+\|/.test(t)||t.startsWith("```")||t.startsWith(`> `)||/\*\*[^*]+\*\*/.test(e)||/`[^`]+`/.test(e)||/\[.+\]\(.+\)/.test(e)||/^(-{3,}|_{3,}|\*{3,})$/.test(t)||/^- \[[ x]\]\s/.test(t))}function de(e,t){let n=`${e.id??t}`,r=e.timestamp;if(e.event_type===`log`)try{let t=JSON.parse(e.payload).line??``;return t.trim()?t.startsWith(`▸`)||t.match(/^(architect|developer|reviewer|ship|analyst)\s*:/i)?{id:n,content:t,type:`phase`,timestamp:r}:e.source===`stderr`?{id:n,content:t,type:`stderr`,timestamp:r}:Q(t)?{id:n,content:t,type:`assistant`,timestamp:r}:{id:n,content:t,type:`plain`,timestamp:r}:null}catch{return null}if(e.event_type!==`log`&&e.event_type!==`result`)return null;if(e.event_type===`result`)try{let t=JSON.parse(e.payload),i=[];return t.duration_ms&&i.push(`${(t.duration_ms/1e3).toFixed(1)}s`),t.total_cost_usd&&i.push(`$${t.total_cost_usd.toFixed(4)}`),t.num_turns&&i.push(S.t(`jobs:logViewer.turns`,{count:t.num_turns})),{id:n,content:`▸ ${S.t(`jobs:logViewer.completed`)}${i.length?` — ${i.join(` · `)}`:``}`,type:`result`,timestamp:r}}catch{return null}return null}function $(e){let t=`none`,n=[];for(let r of e){let e=r.type;if(e!==`plain`&&e!==`log`){t=`none`,n.push(r);continue}let i=r.content;i.startsWith(`--- `)?(t=`saw_minus`,n.push({...r,type:`diff-meta`})):t===`saw_minus`&&i.startsWith(`+++ `)?(t=`active`,n.push({...r,type:`diff-meta`})):t===`active`&&i.startsWith(`@@ `)?n.push({...r,type:`diff-hunk`}):t===`active`&&i.startsWith(`+`)&&!i.startsWith(`+++`)?n.push({...r,type:`diff-add`}):t===`active`&&i.startsWith(`-`)&&!i.startsWith(`---`)?n.push({...r,type:`diff-remove`}):(t===`active`&&(i.startsWith(` `)||i===``)||(t=`none`),n.push(r))}return n}function fe(e){let t=[{key:`__preamble__`,header:null,lines:[]}];for(let n of e)n.type===`phase`?t.push({key:n.id,header:n,lines:[]}):t[t.length-1].lines.push(n);return t.filter(e=>e.header!==null||e.lines.length>0)}function pe({events:e,isLoading:n}){let{t:r,i18n:i}=_(`jobs`),[o,ee]=(0,I.useState)(``),[c,l]=(0,I.useState)(!0),[u,d]=(0,I.useState)(new Set),f=(0,I.useRef)(null),p=(0,I.useRef)(null),{processedLines:m,groups:g,totalLines:v}=(0,I.useMemo)(()=>{let t=e.map((e,t)=>de(e,t)).filter(e=>e!==null),n=[];for(let e of t){let t=n.length>0?n[n.length-1]:null;e.type===`assistant`&&t?.type===`assistant`?t.content+=`
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{$t as t,Bt as n,Et as r,G as i,H as a,M as o,N as s,Ot as ee,P as c,Q as l,Rt as u,V as d,an as f,b as p,cn as m,ct as h,dt as g,en as _,ft as v,gt as y,ht as b,in as x,kt as S,l as C,m as w,mt as T,o as E,p as D,rn as O,st as te,u as ne,ut as k,wt as A,x as j,y as M,zt as N}from"./index-BEGU2TCx.js";import{t as P}from"./lib-BBoUS-5a.js";import{t as re}from"./format-command-CZsy-vHq.js";var F=A(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ie=A(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),I=e(m(),1),L=N();function ae({phases:e,phaseDefinitions:t}){return t.length===0?null:(0,L.jsx)(`div`,{className:`flex items-center`,children:t.map((n,r)=>{let i=e[n.key]??`idle`,a=r<t.length-1?e[t[r+1].key]??`idle`:null;return(0,L.jsxs)(`div`,{className:`flex items-center`,children:[(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{asChild:!0,children:(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 cursor-default px-4`,children:[(0,L.jsx)(R,{state:i}),(0,L.jsx)(`span`,{className:c(`text-xs font-medium transition-colors`,i===`running`?`text-blue-400 aurora-light:text-accent-info`:i===`done`?`text-emerald-400 aurora-light:text-accent-success`:i===`error`?`text-red-400 aurora-light:text-destructive`:`text-muted-foreground/40`),children:n.label})]})}),(0,L.jsxs)(p,{side:`bottom`,className:`max-w-[200px]`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:n.label}),(0,L.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:n.description})]})]}),a!==null&&(0,L.jsx)(`div`,{className:c(`h-px w-12 -mt-5 shrink-0 transition-all duration-300`,a===`done`||i===`done`?`bg-emerald-500/30 aurora-light:bg-accent-success/40`:a===`running`?`bg-blue-400/40 aurora-light:bg-accent-info/40`:`bg-border/30`)})]},n.key)})})}function R({state:e}){return(0,L.jsxs)(`div`,{className:c(`flex items-center justify-center w-10 h-10 rounded-full transition-all duration-300`,e===`running`?`bg-blue-500/10 aurora-light:bg-accent-info/10 ring-1 ring-blue-400/30 aurora-light:ring-accent-info/30 animate-pulse`:e===`done`?`bg-emerald-500/10 aurora-light:bg-accent-success/10`:e===`error`?`bg-red-500/10 aurora-light:bg-destructive/10`:`bg-muted/20`),children:[e===`running`&&(0,L.jsx)(l,{className:`w-6 h-6 text-blue-400 aurora-light:text-accent-info animate-spin`}),e===`done`&&(0,L.jsx)(v,{className:`w-6 h-6 text-emerald-400 aurora-light:text-accent-success`}),e===`error`&&(0,L.jsx)(g,{className:`w-6 h-6 text-red-400 aurora-light:text-destructive`}),e===`idle`&&(0,L.jsx)(k,{className:`w-6 h-6 text-muted-foreground/20`})]})}function z(e,t){let n=(typeof t==`number`?t:new Date(t).getTime())-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`—`;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function oe(e){let t=new Set;for(let n of e)if(n.event_type===`log`)try{let e=(JSON.parse(n.payload).line??``).match(/(?:Writing|Editing|Created?|Updated?)\s+(?:file:\s*)?([\w./\-]+\.\w+)/i);e&&t.add(e[1])}catch{}return Array.from(t).slice(0,20)}var se=new Set([`editing`,`writing`,`reading`,`searching`,`running`]);function B(e){return e.length>40?`${e.slice(0,39)}…`:e}function V(e){return typeof e!=`string`||e.length===0?``:B(e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??``)}function H(e){return typeof e!=`string`||e.length===0?``:B(e.trim().split(/\s+/)[0]??``)}function ce(e){if(typeof e!=`string`)return``;try{let t=JSON.parse(e)?.command;if(Array.isArray(t))return H(t.filter(e=>typeof e==`string`).join(` `));if(typeof t==`string`)return H(t)}catch{}return``}function U(e,t){let n=t??{},r=V(n.file_path??n.path);switch(e){case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:return{step:!0,actionKey:`editing`,actionArg:r};case`Write`:case`create`:return{step:!0,actionKey:`writing`,actionArg:r};case`Read`:return{step:!0,actionKey:`reading`,actionArg:r};case`Grep`:case`Glob`:case`search`:return{step:!0,actionKey:`searching`,actionArg:B(String(n.pattern??n.query??``))};case`Bash`:case`shell`:return{step:!0,actionKey:`running`,actionArg:H(n.command)};default:return{step:!0,actionKey:`working`}}}function W(e){let t=e.event_type,n={};try{let t=JSON.parse(e.payload);t&&typeof t==`object`&&!Array.isArray(t)&&(n=t)}catch{}if(t===`assistant`){let e=n.message?.content;if(Array.isArray(e)){let t=e.filter(e=>e?.type===`tool_use`);if(t.length>0){let e=t[t.length-1];return{...U(e.name,e.input),stepCount:t.length}}if(e.some(e=>e?.type===`text`))return{step:!0,actionKey:`thinking`}}return{step:!0}}if(t===`tool_use`)return U(n.name,n.input);if(t===`item.completed`){let e=n.item,t=e?.type;return t===`agent_message`?{step:!0,actionKey:`thinking`}:t===`agent_reasoning`?{step:!0,actionKey:`reasoning`}:t===`function_call`||t===`local_shell_call`||t===`command_execution`?{step:!0,actionKey:`running`,actionArg:H(e?.command)||ce(e?.arguments)||(typeof e?.name==`string`?B(e.name):``)||(t===`local_shell_call`?`shell`:``)}:{step:!0}}return{step:!1}}var G={steps:0,actionKey:``,actionArg:``,lastSeenIdx:0};function K(e,t){if(t.type===`reset`)return G;if(t.type===`consume`){let{events:n}=t,r=e.lastSeenIdx>n.length?n.length:e.lastSeenIdx;if(n.length<=r)return r===e.lastSeenIdx?e:{...e,lastSeenIdx:r};let{steps:i,actionKey:a,actionArg:o}=e;for(let e=r;e<n.length;e++){let t=W(n[e]);t.step&&(i+=t.stepCount??1),t.actionKey&&(a=t.actionKey,o=t.actionArg??``)}return{steps:i,actionKey:a,actionArg:o,lastSeenIdx:n.length}}return e}function le({job:e,events:t,defaultOpen:n=!0,pipelineTotals:r,phases:i,phaseDefinitions:a}){let{t:o}=_(`jobs`),[s,ee]=(0,I.useState)(n),u=(0,I.useMemo)(()=>oe(t),[t]),d=e.status===`running`,f=e.status===`completed`,[p,m]=(0,I.useState)(()=>Date.now());(0,I.useEffect)(()=>{if(!d)return;let e=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(e)},[d]);let[h,b]=(0,I.useReducer)(K,G),x=(0,I.useRef)(e.id);(0,I.useEffect)(()=>{x.current!==e.id&&(x.current=e.id,b({type:`reset`})),b({type:`consume`,events:t})},[e.id,t]);let[S,C]=(0,I.useState)(!0);(0,I.useEffect)(()=>{if(!d)return;C(!0);let e=window.setTimeout(()=>C(!1),8e3);return()=>window.clearTimeout(e)},[d,e.id]);let w=e.finished_at?z(e.started_at,e.finished_at):d?z(e.started_at,p):`—`,T=!!e.total_cost_usd_estimated,E=e.total_cost_usd==null?null:`${T?`~`:``}$${e.total_cost_usd.toFixed(4)}`,D=e.num_turns==null?null:String(e.num_turns),O=e.tokens_in==null?null:(e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0),te=O==null?null:`${(O/1e3).toFixed(1)}k`,ne=(0,I.useMemo)(()=>!i||!a?null:a.find(e=>i[e.key]===`running`)?.label??null,[i,a]),k=d&&h.steps===0?`connecting`:h.actionKey||`thinking`,A=se.has(k)&&h.actionArg!==``,j=se.has(k)&&!A?`working`:k,M=A?o(`statusPanel.activity.${j}`,{arg:h.actionArg}):o(`statusPanel.activity.${j}`),N=ne??(d&&h.steps===0?o(`statusPanel.activity.starting`):null),P=h.steps>0?o(`statusPanel.steps`,{count:h.steps}):null,re=o(d?`statusPanel.inProgress`:f?`statusPanel.completed`:`statusPanel.failed`),F=d?`border-accent-info/20 bg-accent-info/5`:f?`border-emerald-500/20 aurora-light:border-accent-success/30 bg-emerald-500/5 aurora-light:bg-accent-success/5`:`border-red-500/20 aurora-light:border-destructive/30 bg-red-500/5 aurora-light:bg-destructive/5`,ie=d?l:f?v:g,ae=d?`w-4 h-4 text-accent-info shrink-0 animate-spin`:f?`w-4 h-4 text-emerald-400 aurora-light:text-accent-success shrink-0`:`w-4 h-4 text-red-400 aurora-light:text-destructive shrink-0`;return(0,L.jsxs)(`div`,{className:c(`mx-4 my-2 rounded-xl border transition-colors duration-500`,F),children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>ee(!s),className:`w-full flex items-center gap-3 px-4 py-3`,children:[(0,L.jsx)(ie,{className:ae,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold flex-1 text-left`,children:re}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`tabular-nums`,children:w}),d?P&&(0,L.jsx)(`span`,{className:`tabular-nums`,children:P}):(0,L.jsxs)(L.Fragment,{children:[E&&(0,L.jsx)(`span`,{className:`tabular-nums text-yellow-400 aurora-light:text-accent-warning`,children:E}),u.length>0&&(0,L.jsx)(`span`,{children:o(`statusPanel.filesCount`,{count:u.length})})]})]}),(0,L.jsx)(y,{className:c(`w-4 h-4 text-muted-foreground/40 transition-transform duration-150 shrink-0`,s&&`rotate-180`)})]}),s&&(0,L.jsx)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/20`,children:d?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneInProgress`)}),(0,L.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 sm:items-stretch`,children:[(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 sm:w-44 shrink-0`,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[o(`statusPanel.duration`),(0,L.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent-info animate-pulse`,title:o(`statusPanel.liveTooltip`),"aria-label":o(`statusPanel.liveTooltip`)})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-accent-info`,children:w})]}),(0,L.jsxs)(`div`,{className:`flex-1 flex items-center gap-2 bg-muted/10 rounded-lg px-3 py-2 min-w-0`,children:[(0,L.jsx)(l,{className:`w-3.5 h-3.5 text-accent-info shrink-0 animate-spin`,"aria-hidden":`true`}),N&&(0,L.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info shrink-0`,children:N}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground truncate flex-1 min-w-0`,children:M}),P&&(0,L.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60 tabular-nums shrink-0`,children:[`· `,P]})]})]}),S&&(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground/40 leading-snug`,children:o(`statusPanel.explainer`)}),(0,L.jsx)(`p`,{className:`pt-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider border-t border-accent-info/10 mt-1`,children:o(`statusPanel.zoneFinalPending`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,L.jsx)(Y,{label:o(`statusPanel.cost`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.costTooltip`)}),(0,L.jsx)(Y,{label:o(`statusPanel.turns`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)}),(0,L.jsx)(Y,{label:o(`statusPanel.tokens`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneFinal`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[(0,L.jsx)(q,{label:o(`statusPanel.duration`),value:w}),(0,L.jsx)(J,{label:o(`statusPanel.cost`),value:E,valueClass:`text-yellow-400 aurora-light:text-accent-warning`,naCaption:o(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:o(`statusPanel.turns`),value:D,naCaption:o(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:o(`statusPanel.tokens`),value:te,naCaption:o(`statusPanel.notAvailable`)})]}),r&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.pipelineTotal`,{count:r.jobCount})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,L.jsx)(q,{label:o(`statusPanel.totalCost`),value:`$${r.totalCostUsd.toFixed(4)}`,valueClass:`text-yellow-400 aurora-light:text-accent-warning`}),(0,L.jsx)(q,{label:o(`statusPanel.totalTokens`),value:`${((r.totalTokensIn+r.totalTokensOut+r.totalTokensCacheRead+r.totalTokensCacheCreate)/1e3).toFixed(1)}k`})]})]}),u.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.filesModified`)}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,L.jsx)(`code`,{className:`text-[10px] font-mono bg-muted/30 px-2 py-0.5 rounded text-cyan-400/80 aurora-light:text-accent-info`,children:e},e))})]})]})})]})}function q({label:e,value:t,valueClass:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,n),children:t})]})}function J({label:e,value:t,valueClass:n,naCaption:r}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,t==null?`text-muted-foreground`:n),children:t??`—`}),t==null&&(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:r})]})}function Y({label:e,caption:t,tooltip:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 ring-1 ring-accent-info/10`,title:n,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[e,(0,L.jsx)(F,{className:`w-2.5 h-2.5 text-muted-foreground/30`,"aria-hidden":`true`})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-muted-foreground/40`,children:`—`}),(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:t})]})}var X=4;function ue({tickets:e,onTicketClick:t}){let{t:n}=_(`jobs`),[r,i]=(0,I.useState)(!1);if(e.length===0)return null;let a=e.length>=X&&!r?e.slice(0,1):e,o=e.length-a.length;return(0,L.jsxs)(`div`,{className:`rounded-xl border border-border/40 bg-card/40 px-4 py-3 space-y-1.5`,children:[a.map(e=>(0,L.jsx)(Z,{ticket:e,onClick:()=>t(e.id)},e.id)),o>0&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showMore`,{count:o}),(0,L.jsx)(y,{className:`w-3 h-3`})]}),r&&e.length>=X&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!1),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showLess`),(0,L.jsx)(T,{className:`w-3 h-3`})]})]})}function Z({ticket:e,onClick:t}){let{t:n}=_(`jobs`),r=e.title==null,i=`inline-flex items-center px-1.5 py-0.5 rounded-md text-[11px] font-mono tabular-nums shrink-0`;return r?(0,L.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,L.jsx)(`span`,{className:c(i,`text-muted-foreground bg-muted/20 select-none`),title:n(`ticketHeader.deletedTooltip`),children:n(`ticketHeader.deletedTicket`,{id:e.id})})}):(0,L.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center gap-2 min-w-0 w-full text-left group`,title:e.title??void 0,children:[(0,L.jsxs)(`span`,{className:c(i,`text-accent-primary bg-accent-primary/10 group-hover:bg-accent-primary/20 transition-colors`),children:[`#`,e.id]}),(0,L.jsx)(`span`,{className:`text-lg font-semibold text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title})]})}function Q(e){let t=e.trimStart();return!!(/^#{1,6}\s/.test(t)||/^[-*+]\s/.test(t)||/^\d+\.\s/.test(t)||/^\|.+\|/.test(t)||t.startsWith("```")||t.startsWith(`> `)||/\*\*[^*]+\*\*/.test(e)||/`[^`]+`/.test(e)||/\[.+\]\(.+\)/.test(e)||/^(-{3,}|_{3,}|\*{3,})$/.test(t)||/^- \[[ x]\]\s/.test(t))}function de(e,t){let n=`${e.id??t}`,r=e.timestamp;if(e.event_type===`log`)try{let t=JSON.parse(e.payload).line??``;return t.trim()?t.startsWith(`▸`)||t.match(/^(architect|developer|reviewer|ship|analyst)\s*:/i)?{id:n,content:t,type:`phase`,timestamp:r}:e.source===`stderr`?{id:n,content:t,type:`stderr`,timestamp:r}:Q(t)?{id:n,content:t,type:`assistant`,timestamp:r}:{id:n,content:t,type:`plain`,timestamp:r}:null}catch{return null}if(e.event_type!==`log`&&e.event_type!==`result`)return null;if(e.event_type===`result`)try{let t=JSON.parse(e.payload),i=[];return t.duration_ms&&i.push(`${(t.duration_ms/1e3).toFixed(1)}s`),t.total_cost_usd&&i.push(`$${t.total_cost_usd.toFixed(4)}`),t.num_turns&&i.push(S.t(`jobs:logViewer.turns`,{count:t.num_turns})),{id:n,content:`▸ ${S.t(`jobs:logViewer.completed`)}${i.length?` — ${i.join(` · `)}`:``}`,type:`result`,timestamp:r}}catch{return null}return null}function $(e){let t=`none`,n=[];for(let r of e){let e=r.type;if(e!==`plain`&&e!==`log`){t=`none`,n.push(r);continue}let i=r.content;i.startsWith(`--- `)?(t=`saw_minus`,n.push({...r,type:`diff-meta`})):t===`saw_minus`&&i.startsWith(`+++ `)?(t=`active`,n.push({...r,type:`diff-meta`})):t===`active`&&i.startsWith(`@@ `)?n.push({...r,type:`diff-hunk`}):t===`active`&&i.startsWith(`+`)&&!i.startsWith(`+++`)?n.push({...r,type:`diff-add`}):t===`active`&&i.startsWith(`-`)&&!i.startsWith(`---`)?n.push({...r,type:`diff-remove`}):(t===`active`&&(i.startsWith(` `)||i===``)||(t=`none`),n.push(r))}return n}function fe(e){let t=[{key:`__preamble__`,header:null,lines:[]}];for(let n of e)n.type===`phase`?t.push({key:n.id,header:n,lines:[]}):t[t.length-1].lines.push(n);return t.filter(e=>e.header!==null||e.lines.length>0)}function pe({events:e,isLoading:n}){let{t:r,i18n:i}=_(`jobs`),[o,ee]=(0,I.useState)(``),[c,l]=(0,I.useState)(!0),[u,d]=(0,I.useState)(new Set),f=(0,I.useRef)(null),p=(0,I.useRef)(null),{processedLines:m,groups:g,totalLines:v}=(0,I.useMemo)(()=>{let t=e.map((e,t)=>de(e,t)).filter(e=>e!==null),n=[];for(let e of t){let t=n.length>0?n[n.length-1]:null;e.type===`assistant`&&t?.type===`assistant`?t.content+=`
|
|
2
2
|
`+e.content:n.push({...e})}let r=$(n);return{processedLines:r,groups:fe(r),totalLines:r.length}},[e,i.language]),b=(0,I.useMemo)(()=>{if(!o)return v;let e=o.toLowerCase();return m.filter(t=>t.content.toLowerCase().includes(e)).length},[o,m,v]),x=(0,I.useCallback)(()=>{let e=p.current;e&&(e.scrollTop=e.scrollHeight)},[]);(0,I.useEffect)(()=>{c&&x()},[e.length,c,x]);function S(){let e=p.current;e&&l(e.scrollHeight-e.scrollTop-e.clientHeight<50)}function C(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return n?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`logViewer.loading`)})}):v===0?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`logViewer.empty`)})}):(0,L.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex items-center gap-2`,children:[(0,L.jsxs)(`div`,{className:`relative flex-1 max-w-xs`,children:[(0,L.jsx)(a,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,L.jsx)(E,{placeholder:r(`logViewer.filterPlaceholder`),value:o,onChange:e=>ee(e.target.value),className:`pl-7 h-7`})]}),(0,L.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:()=>{let e=m.map(e=>e.content).join(`
|
|
3
3
|
`);navigator.clipboard.writeText(e).then(()=>{t.success(r(`logViewer.copySuccess`))}).catch(()=>{t.error(r(`logViewer.copyFailed`))})},children:(0,L.jsx)(h,{className:`w-3.5 h-3.5`})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(`logViewer.lineCount`,{filtered:b,total:v})})]}),(0,L.jsxs)(`div`,{ref:p,className:`flex-1 overflow-y-auto p-2 text-xs relative`,onScroll:S,children:[g.map(e=>(0,L.jsx)(me,{group:e,filter:o,collapsed:u.has(e.key),onToggle:()=>C(e.key)},e.key)),(0,L.jsx)(`div`,{ref:f})]}),!c&&(0,L.jsxs)(s,{size:`sm`,variant:`secondary`,onClick:()=>{l(!0),x()},className:`absolute bottom-16 right-6 h-7 gap-1 shadow-lg`,children:[(0,L.jsx)(y,{className:`w-3 h-3`}),r(`logViewer.jumpToBottom`)]})]})}var me=(0,I.memo)(function({group:e,filter:t,collapsed:n,onToggle:r}){let{t:i}=_(`jobs`),a=t?e.lines.filter(e=>e.content.toLowerCase().includes(t.toLowerCase())):e.lines;if(e.header===null)return a.length===0?null:(0,L.jsx)(`div`,{children:a.map((e,t)=>(0,L.jsx)(ge,{line:e,even:t%2==0},e.id))});let o=e.header.content;return(0,L.jsxs)(`div`,{className:`mt-3 rounded-md overflow-hidden border border-border/20`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:r,className:c(`flex items-center gap-2 w-full text-left px-3 py-2`,`bg-primary/5 border-b border-primary/20`,`hover:bg-primary/10 transition-colors duration-150 cursor-pointer`),children:[(0,L.jsx)(b,{className:c(`w-3 h-3 text-primary/60 shrink-0 transition-transform duration-150`,!n&&`rotate-90`)}),(0,L.jsx)(`span`,{className:`flex-1 text-[12px] font-semibold text-foreground leading-none`,children:o}),e.header.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 font-mono tabular-nums shrink-0`,children:new Date(e.header.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:i(`logViewer.phaseLines`,{count:e.lines.length})})]}),!n&&(0,L.jsx)(`div`,{className:`bg-muted/5`,children:a.length===0?(0,L.jsx)(`p`,{className:`px-4 py-2 text-[10px] text-muted-foreground/40 italic`,children:i(t?`logViewer.noMatchingLines`:`logViewer.noOutput`)}):a.map((e,t)=>(0,L.jsx)(ge,{line:e,even:t%2==0},e.id))})]})}),he=[P],ge=(0,I.memo)(function({line:e,even:t}){let n=e.type===`assistant`,r=e.type===`diff-add`,i=e.type===`diff-remove`,a=e.type===`diff-meta`,o=e.type===`diff-hunk`;return(0,L.jsxs)(`div`,{className:c(`flex items-start gap-2 group px-2 py-0.5 rounded-sm`,!(r||i||a||o)&&(t?`bg-muted/20`:`bg-transparent`),e.type===`result`&&`bg-emerald-500/5 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/40 aurora-light:border-accent-success/40 mt-2 py-2`,r&&`bg-emerald-500/8 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/50 aurora-light:border-accent-success/50`,i&&`bg-red-500/8 aurora-light:bg-destructive/10 border-l-2 border-red-500/50 aurora-light:border-destructive/50`,a&&`bg-accent-primary/5 border-l-2 border-accent-primary/30`,o&&`bg-accent-info/5 border-l-2 border-accent-info/30`),children:[e.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0 mt-0.5 w-[52px] font-mono tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),n?(0,L.jsx)(`div`,{className:`flex-1 min-w-0 prose prose-invert prose-xs max-w-none
|
|
4
4
|
prose-p:my-1 prose-p:leading-relaxed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{$ as t,$t as n,Bt as r,D as i,Dt as a,E as o,Et as s,I as c,M as l,N as u,O as d,Ot as f,R as p,T as m,b as h,cn as g,dt as _,en as v,ft as y,in as b,k as x,lt as S,m as C,n as w,p as ee,u as T,w as E,wt as D,x as O,y as k,zt as A}from"./index-wK8zASrE.js";import{t as j}from"./ExportDropdown-DpI605_7.js";import{t as te}from"./format-command-CZsy-vHq.js";var ne=D(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),M=e(g(),1),N=A();function P(e){if(e==null)return`—`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function F(e){return e==null?`—`:e===0?`$0`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function I(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function L({label:e,a:t,b:n,highlight:r}){return(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-b border-border/20 last:border-0 text-xs`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`a`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:t}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`b`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:n})]})}function R(e,t,n=!0){return e==null||t==null||e===t?null:n?e<t?`a`:`b`:e>t?`a`:`b`}function re({jobIds:e,onClose:t}){let{t:n}=v(`jobs`),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(!0),[l,u]=(0,M.useState)(null);(0,M.useEffect)(()=>{let t=new AbortController;return fetch(`${r()}/jobs/compare?jobIds=${e.join(`,`)}`,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{a(e),s(!1)}).catch(e=>{e.name!==`AbortError`&&(u(e.message),s(!1))}),()=>t.abort()},[e]);function d(e,t){return(0,N.jsxs)(`div`,{className:`text-center space-y-1`,children:[(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:n(`comparison.jobN`,{n:t+1})}),(0,N.jsx)(`code`,{className:`text-[10px] text-foreground/70 block truncate max-w-[160px] mx-auto`,children:e.command}),(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-[10px]`,children:[e.status===`completed`?(0,N.jsx)(y,{className:`w-3 h-3 text-emerald-400 aurora-light:text-accent-success`}):(0,N.jsx)(_,{className:`w-3 h-3 text-rose-400 aurora-light:text-destructive`}),(0,N.jsx)(`span`,{className:`capitalize text-muted-foreground`,children:n(`statusLabel.${e.status}`,{defaultValue:e.status})})]}),(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-mono`,children:e.id.slice(0,8)})]})}return(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,N.jsxs)(`div`,{className:`w-full max-w-lg rounded-xl border border-border/30 bg-popover p-5 shadow-xl space-y-4 mx-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`comparison.title`)}),(0,N.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,N.jsx)(c,{className:`w-4 h-4`})})]}),o&&(0,N.jsx)(`div`,{className:`space-y-2`,children:[0,1,2,3].map(e=>(0,N.jsx)(`div`,{className:`h-8 bg-muted/20 rounded animate-pulse`},e))}),l&&(0,N.jsx)(`p`,{className:`text-xs text-red-400 aurora-light:text-destructive`,children:n(`comparison.loadFailed`,{error:l})}),i&&(()=>{let[e,t]=i.jobs,r=R(e.durationMs,t.durationMs,!0),a=R(e.totalCostUsd,t.totalCostUsd,!0),o=R(e.tokensOut==null?null:e.tokensOut,t.tokensOut==null?null:t.tokensOut,!0);return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-3 border-b border-border/30 mb-1`,children:[(0,N.jsx)(`div`,{}),d(e,0),d(t,1)]}),(0,N.jsx)(L,{label:n(`comparison.duration`),a:P(e.durationMs),b:P(t.durationMs),highlight:r}),(0,N.jsx)(L,{label:n(`comparison.cost`),a:F(e.totalCostUsd),b:F(t.totalCostUsd),highlight:a}),(0,N.jsx)(L,{label:n(`comparison.tokensOut`),a:I(e.tokensOut),b:I(t.tokensOut),highlight:o}),(0,N.jsx)(L,{label:n(`comparison.tokensIn`),a:I(e.tokensIn),b:I(t.tokensIn),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.cacheRead`),a:I(e.tokensCacheRead),b:I(t.tokensCacheRead),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.model`),a:e.model??`—`,b:t.model??`—`,highlight:null}),(0,N.jsx)(L,{label:n(`comparison.phasesDone`),a:e.phasesCompleted.length>0?e.phasesCompleted.join(`, `):`—`,b:t.phasesCompleted.length>0?t.phasesCompleted.join(`, `):`—`,highlight:null})]})})(),i&&(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60 text-center`,children:n(`comparison.betterValueHint`)})]})})}var ie={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.done`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queuedToRun`},zombie_terminated:{variant:`failed`,labelKey:`statusLabel.zombie`,tooltipKey:`statusTooltip.zombie`},skipped:{variant:`warning`,labelKey:`statusLabel.skipped`,tooltipKey:`statusTooltip.skipped`}},ae=[`running`,`completed`,`failed`,`canceled`,`zombie_terminated`,`queued`,`skipped`],oe={critical:{className:`bg-red-500/15 aurora-light:bg-destructive/10 text-red-400 aurora-light:text-destructive border-red-500/30 aurora-light:border-destructive/30`,labelKey:`recent.priority.critical`},high:{className:`bg-orange-500/15 aurora-light:bg-accent-warning/10 text-orange-400 aurora-light:text-accent-warning border-orange-500/30 aurora-light:border-accent-warning/30`,labelKey:`recent.priority.high`},normal:{className:``,labelKey:`recent.priority.normal`},low:{className:`bg-gray-500/15 aurora-light:bg-muted text-gray-400 aurora-light:text-muted-foreground border-gray-500/30 aurora-light:border-border`,labelKey:`recent.priority.low`}};function se(e){return e==null||e===0?null:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function ce(e,t){if(!t)return null;let n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return null;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function le(e){return e==null||e===0?null:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ue(e){try{return T(new Date(e),{addSuffix:!0,locale:f()})}catch{return e}}var z=10;function B({jobs:e,isLoading:a,onJobsCleared:c,onProposalClick:f,onProposalDelete:g}){let{t:_}=v(`jobs`),y=b(),{activeProjectId:C,projects:w}=s(),ee=w.find(e=>e.id===C)?.provider,[T,D]=(0,M.useState)(null),[A,j]=(0,M.useState)(``),[P,F]=(0,M.useState)(``),[I,L]=(0,M.useState)(!1),[R,B]=(0,M.useState)(``),[V,H]=(0,M.useState)(``),[U,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(null),[q,J]=(0,M.useState)(z),[Y,de]=(0,M.useState)(!1),[X,Z]=(0,M.useState)([]),[fe,Q]=(0,M.useState)(null);(0,M.useEffect)(()=>{J(z)},[e.length]);function pe(){de(e=>!e),Z([])}function me(e){Z(t=>{if(t.includes(e))return t.filter(t=>t!==e);if(t.length>=2)return t;let n=[...t,e];return n.length===2&&Q(n),n})}let $=e.filter(e=>!(T&&e.status!==T||A&&e.started_at<A||P&&e.started_at>`${P}T23:59:59`)),he=e.filter(e=>!(R&&e.started_at<R||V&&e.started_at>`${V}T23:59:59`)).length;async function ge(e){W(!0);try{let t={};e===`range`&&(R&&(t.from=R),V&&(t.to=V));let i=await fetch(`${r()}/jobs`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(i.ok){let e=await i.json();n.success(_(`recent.toast.cleared`,{count:e.deleted})),L(!1),B(``),H(``),c?.()}else n.error(_(`recent.toast.clearFailed`))}catch{n.error(_(`recent.toast.networkError`))}finally{W(!1)}}return a?(0,N.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-1`,children:[0,1,2].map(e=>(0,N.jsx)(`div`,{className:`h-9 bg-muted/30 rounded-md animate-pulse`},e))}):e.length===0?(0,N.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border/40 bg-card/50 p-8 text-center space-y-2`,children:[(0,N.jsx)(S,{className:`w-8 h-8 text-muted-foreground/30 mx-auto`}),(0,N.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:_(`recent.emptyTitle`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:_(`recent.emptyDescription`)})]}):(0,N.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>D(null),className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${T===null?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:_(`recent.filterAll`,{count:e.length})}),ae.map(t=>{let n=e.filter(e=>e.status===t).length;return n===0?null:(0,N.jsx)(`button`,{type:`button`,onClick:()=>D(T===t?null:t),className:`px-2 py-0.5 rounded text-[10px] font-medium capitalize transition-colors ${T===t?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:_(`recent.filterStatus`,{status:_(`statusName.${t}`),count:n})},t)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:A,onChange:e=>j(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:_(`recent.fromDate`)}),(0,N.jsx)(`input`,{type:`date`,value:P,onChange:e=>F(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:_(`recent.toDate`)}),(A||P)&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>{j(``),F(``)},className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:_(`recent.clear`)}),(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 transition-colors ${Y?`text-foreground bg-accent`:`text-muted-foreground hover:text-foreground`}`,onClick:pe,children:(0,N.jsx)(ne,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(h,{children:_(Y?`recent.exitCompareMode`:`recent.compareTwoJobs`)})]}),(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>L(!0),children:(0,N.jsx)(p,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(h,{children:_(`recent.clearJobs`)})]})]})]}),Y&&(0,N.jsxs)(`div`,{className:`flex items-center justify-between rounded-md bg-accent/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[X.length===0&&_(`recent.selectTwoToCompare`),X.length===1&&_(`recent.selectOneMore`),X.length===2&&_(`recent.readyToCompare`)]}),X.length===2&&(0,N.jsx)(`button`,{type:`button`,className:`text-[10px] font-medium text-foreground hover:underline`,onClick:()=>Q(X),children:_(`recent.compareAction`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:[(0,N.jsx)(`span`,{className:`w-14`,children:_(`recent.colStatus`)}),(0,N.jsx)(`span`,{className:`flex-1 min-w-0`,children:_(`recent.colCommand`)}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:_(`recent.colDuration`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:_(`recent.colTokens`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:_(`recent.colCost`)}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:_(`recent.colStarted`)})]})]}),(0,N.jsx)(`div`,{className:`space-y-0.5`,children:$.slice(0,q).map(e=>{let n=ie[e.status]??ie.queued,r=se(e.total_cost_usd),i=ce(e.started_at,e.finished_at),a=le((e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0)||null),o=e.id.startsWith(`proposal:`),s=o?e.id.replace(`proposal:`,``):null,c=X.includes(e.id),u=Y&&!o&&X.length===2&&!c;return(0,N.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer group ${c?`bg-accent/70 ring-1 ring-border`:u?`opacity-40 cursor-not-allowed`:`hover:bg-accent/50`}`,onClick:()=>{if(Y&&!o){me(e.id);return}o&&s?f?.(s):y(`/jobs/${e.id}`)},children:[(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(`div`,{children:(0,N.jsx)(l,{variant:n.variant,children:_(n.labelKey)})})}),(0,N.jsx)(h,{children:_(n.tooltipKey)})]}),e.priority&&e.priority!==`normal`&&(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border ${oe[e.priority].className}`,children:_(oe[e.priority].labelKey)}),e.profile_name&&(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border border-accent-primary/40 bg-accent-primary/10 text-accent-primary/90`,children:e.profile_name})}),(0,N.jsx)(h,{children:_(`recent.profileTooltip`,{name:e.profile_name})})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0`,children:[e.pipeline_id&&(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(t,{className:`w-3 h-3 text-accent-primary/60 shrink-0`})}),(0,N.jsxs)(h,{children:[_(`recent.pipelinePart`),e.depends_on_job_id&&` ${_(`recent.pipelineDependsOn`)}`,e.skip_reason&&` — ${e.skip_reason}`]})]}),(0,N.jsx)(`code`,{className:`text-xs text-foreground/80 truncate`,children:te(e.command,ee)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:i??`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:a?`${a}`:`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:r??`—`}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:ue(e.started_at)}),o&&s&&(0,N.jsx)(`button`,{type:`button`,className:`w-4 h-4 md:opacity-0 md:group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all`,onClick:e=>{e.stopPropagation(),K(s)},title:_(`recent.deleteProposal`),children:(0,N.jsx)(p,{className:`w-3 h-3`})})]})]},e.id)})}),$.length>q&&(0,N.jsx)(`div`,{className:`pt-1 text-center`,children:(0,N.jsx)(`button`,{type:`button`,onClick:()=>J(e=>e+z),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1 rounded hover:bg-accent/50`,children:_(`recent.loadMore`,{count:$.length-q})})}),I&&(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:()=>L(!1),children:(0,N.jsxs)(`div`,{className:`w-80 rounded-xl border border-border/30 bg-popover p-4 shadow-lg space-y-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold`,children:_(`recent.clearModal.title`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:_(`recent.clearModal.jobsInHistory`,{count:e.length})})]}),(0,N.jsx)(u,{variant:`destructive`,size:`sm`,className:`w-full`,disabled:U,onClick:()=>ge(`all`),children:_(`recent.clearModal.clearAll`,{count:e.length})}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_(`recent.clearModal.orByRange`)}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:R,onChange:e=>B(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:_(`recent.clearModal.fromPlaceholder`)}),(0,N.jsx)(`input`,{type:`date`,value:V,onChange:e=>H(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:_(`recent.clearModal.toPlaceholder`)})]}),(0,N.jsx)(u,{variant:`outline`,size:`sm`,className:`w-full`,disabled:U||!R&&!V,onClick:()=>ge(`range`),children:R||V?_(`recent.clearModal.clearInRange`,{count:he}):_(`recent.clearModal.clearRange`)})]}),(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:()=>L(!1),children:_(`common:actions.cancel`)})]})}),(0,N.jsx)(E,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,N.jsxs)(m,{className:`max-w-sm`,children:[(0,N.jsxs)(d,{children:[(0,N.jsx)(x,{children:_(`recent.deleteProposalConfirm.title`)}),(0,N.jsx)(o,{children:_(`recent.deleteProposalConfirm.description`)})]}),(0,N.jsxs)(i,{children:[(0,N.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>K(null),children:_(`common:actions.cancel`)}),(0,N.jsx)(u,{variant:`destructive`,size:`sm`,onClick:()=>{G&&g?.(G),K(null)},children:_(`common:actions.delete`)})]})]})}),fe&&(0,N.jsx)(re,{jobIds:fe,onClose:()=>{Q(null),Z([]),de(!1)}})]})}function V(){let{t:e}=v(`jobs`),{activeProjectId:t}=s(),{recentJobs:o}=w(t),{data:c,isFirstLoad:f,refresh:p}=a({namespace:`jobs`,projectId:t,initialValue:o,fetcher:async()=>{let e=await fetch(`${r()}/jobs?limit=10`);return e.ok?(await e.json()).jobs:[]},pollInterval:1e4}),{data:h}=a({namespace:`proposals`,projectId:t,initialValue:[],fetcher:async()=>{let e=await fetch(`${r()}/propose?limit=10`);return e.ok?(await e.json()).proposals:[]},pollInterval:1e4}),g={input:`queued`,exploring:`running`,review:`running`,refining:`running`,creating_issue:`running`,created:`completed`,cancelled:`canceled`},_=h.map(e=>({id:`proposal:${e.id}`,command:`/specrails:propose-feature ${e.idea.length>60?e.idea.slice(0,57)+`...`:e.idea}`,started_at:e.created_at,status:g[e.status]??`queued`})),y=[...c,..._].sort((e,t)=>new Date(t.started_at).getTime()-new Date(e.started_at).getTime()),[b,S]=(0,M.useState)(null),T=(0,M.useCallback)(async e=>{try{let t=await fetch(`${r()}/propose/${e}`);if(!t.ok)return;S((await t.json()).proposal)}catch{}},[]),D=(0,M.useCallback)(async t=>{try{(await fetch(`${r()}/propose/${t}`,{method:`DELETE`})).ok&&(n.success(e(`page.proposalDeleted`)),p())}catch{}},[p,e]);return(0,N.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,N.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`page.title`)}),(0,N.jsx)(j,{baseUrl:`${r()}/jobs/export`,label:e(`page.exportJobs`)})]}),(0,N.jsx)(B,{jobs:y,isLoading:f,onJobsCleared:p,onProposalClick:T,onProposalDelete:D}),(0,N.jsx)(E,{open:b!==null,onOpenChange:e=>!e&&S(null),children:(0,N.jsx)(m,{className:`max-w-3xl glass-card`,children:b&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(d,{children:(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(x,{className:`flex-1 min-w-0`,children:e(`page.proposal.title`)}),(0,N.jsx)(l,{variant:b.status===`created`?`success`:b.status===`cancelled`?`destructive`:`secondary`,children:b.status})]})}),(0,N.jsx)(`div`,{className:`text-xs text-muted-foreground bg-muted/20 rounded px-2 py-1 italic`,children:b.idea}),b.result_markdown?(0,N.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto rounded-lg px-3 py-2 text-xs bg-muted/40`,children:(0,N.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80`,children:(0,N.jsx)(C,{remarkPlugins:[ee],children:b.result_markdown})})}):(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:e(`page.proposal.noContent`)}),b.issue_url&&(0,N.jsxs)(`div`,{className:`text-xs`,children:[e(`page.proposal.githubIssue`),` `,(0,N.jsx)(`a`,{href:b.issue_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-primary hover:underline`,children:b.issue_url})]}),(0,N.jsxs)(i,{children:[(0,N.jsx)(u,{variant:`destructive`,size:`sm`,onClick:()=>{D(b.id),S(null)},children:e(`common:actions.delete`)}),(0,N.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>S(null),children:e(`common:actions.close`)})]})]})})})]})}export{V as default};
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{$ as t,$t as n,Bt as r,D as i,Dt as a,E as o,Et as s,I as c,M as l,N as u,O as d,Ot as f,R as p,T as m,b as h,cn as g,dt as _,en as v,ft as y,in as b,k as x,lt as S,m as C,n as w,p as ee,u as T,w as E,wt as D,x as O,y as k,zt as A}from"./index-BEGU2TCx.js";import{t as j}from"./ExportDropdown-I_8R48Yq.js";import{t as te}from"./format-command-CZsy-vHq.js";var ne=D(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),M=e(g(),1),N=A();function P(e){if(e==null)return`—`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function F(e){return e==null?`—`:e===0?`$0`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function I(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function L({label:e,a:t,b:n,highlight:r}){return(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-b border-border/20 last:border-0 text-xs`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`a`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:t}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`b`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:n})]})}function R(e,t,n=!0){return e==null||t==null||e===t?null:n?e<t?`a`:`b`:e>t?`a`:`b`}function re({jobIds:e,onClose:t}){let{t:n}=v(`jobs`),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(!0),[l,u]=(0,M.useState)(null);(0,M.useEffect)(()=>{let t=new AbortController;return fetch(`${r()}/jobs/compare?jobIds=${e.join(`,`)}`,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{a(e),s(!1)}).catch(e=>{e.name!==`AbortError`&&(u(e.message),s(!1))}),()=>t.abort()},[e]);function d(e,t){return(0,N.jsxs)(`div`,{className:`text-center space-y-1`,children:[(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:n(`comparison.jobN`,{n:t+1})}),(0,N.jsx)(`code`,{className:`text-[10px] text-foreground/70 block truncate max-w-[160px] mx-auto`,children:e.command}),(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-[10px]`,children:[e.status===`completed`?(0,N.jsx)(y,{className:`w-3 h-3 text-emerald-400 aurora-light:text-accent-success`}):(0,N.jsx)(_,{className:`w-3 h-3 text-rose-400 aurora-light:text-destructive`}),(0,N.jsx)(`span`,{className:`capitalize text-muted-foreground`,children:n(`statusLabel.${e.status}`,{defaultValue:e.status})})]}),(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-mono`,children:e.id.slice(0,8)})]})}return(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,N.jsxs)(`div`,{className:`w-full max-w-lg rounded-xl border border-border/30 bg-popover p-5 shadow-xl space-y-4 mx-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`comparison.title`)}),(0,N.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,N.jsx)(c,{className:`w-4 h-4`})})]}),o&&(0,N.jsx)(`div`,{className:`space-y-2`,children:[0,1,2,3].map(e=>(0,N.jsx)(`div`,{className:`h-8 bg-muted/20 rounded animate-pulse`},e))}),l&&(0,N.jsx)(`p`,{className:`text-xs text-red-400 aurora-light:text-destructive`,children:n(`comparison.loadFailed`,{error:l})}),i&&(()=>{let[e,t]=i.jobs,r=R(e.durationMs,t.durationMs,!0),a=R(e.totalCostUsd,t.totalCostUsd,!0),o=R(e.tokensOut==null?null:e.tokensOut,t.tokensOut==null?null:t.tokensOut,!0);return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-3 border-b border-border/30 mb-1`,children:[(0,N.jsx)(`div`,{}),d(e,0),d(t,1)]}),(0,N.jsx)(L,{label:n(`comparison.duration`),a:P(e.durationMs),b:P(t.durationMs),highlight:r}),(0,N.jsx)(L,{label:n(`comparison.cost`),a:F(e.totalCostUsd),b:F(t.totalCostUsd),highlight:a}),(0,N.jsx)(L,{label:n(`comparison.tokensOut`),a:I(e.tokensOut),b:I(t.tokensOut),highlight:o}),(0,N.jsx)(L,{label:n(`comparison.tokensIn`),a:I(e.tokensIn),b:I(t.tokensIn),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.cacheRead`),a:I(e.tokensCacheRead),b:I(t.tokensCacheRead),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.model`),a:e.model??`—`,b:t.model??`—`,highlight:null}),(0,N.jsx)(L,{label:n(`comparison.phasesDone`),a:e.phasesCompleted.length>0?e.phasesCompleted.join(`, `):`—`,b:t.phasesCompleted.length>0?t.phasesCompleted.join(`, `):`—`,highlight:null})]})})(),i&&(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60 text-center`,children:n(`comparison.betterValueHint`)})]})})}var ie={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.done`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queuedToRun`},zombie_terminated:{variant:`failed`,labelKey:`statusLabel.zombie`,tooltipKey:`statusTooltip.zombie`},skipped:{variant:`warning`,labelKey:`statusLabel.skipped`,tooltipKey:`statusTooltip.skipped`}},ae=[`running`,`completed`,`failed`,`canceled`,`zombie_terminated`,`queued`,`skipped`],oe={critical:{className:`bg-red-500/15 aurora-light:bg-destructive/10 text-red-400 aurora-light:text-destructive border-red-500/30 aurora-light:border-destructive/30`,labelKey:`recent.priority.critical`},high:{className:`bg-orange-500/15 aurora-light:bg-accent-warning/10 text-orange-400 aurora-light:text-accent-warning border-orange-500/30 aurora-light:border-accent-warning/30`,labelKey:`recent.priority.high`},normal:{className:``,labelKey:`recent.priority.normal`},low:{className:`bg-gray-500/15 aurora-light:bg-muted text-gray-400 aurora-light:text-muted-foreground border-gray-500/30 aurora-light:border-border`,labelKey:`recent.priority.low`}};function se(e){return e==null||e===0?null:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function ce(e,t){if(!t)return null;let n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return null;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function le(e){return e==null||e===0?null:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ue(e){try{return T(new Date(e),{addSuffix:!0,locale:f()})}catch{return e}}var z=10;function B({jobs:e,isLoading:a,onJobsCleared:c,onProposalClick:f,onProposalDelete:g}){let{t:_}=v(`jobs`),y=b(),{activeProjectId:C,projects:w}=s(),ee=w.find(e=>e.id===C)?.provider,[T,D]=(0,M.useState)(null),[A,j]=(0,M.useState)(``),[P,F]=(0,M.useState)(``),[I,L]=(0,M.useState)(!1),[R,B]=(0,M.useState)(``),[V,H]=(0,M.useState)(``),[U,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(null),[q,J]=(0,M.useState)(z),[Y,de]=(0,M.useState)(!1),[X,Z]=(0,M.useState)([]),[fe,Q]=(0,M.useState)(null);(0,M.useEffect)(()=>{J(z)},[e.length]);function pe(){de(e=>!e),Z([])}function me(e){Z(t=>{if(t.includes(e))return t.filter(t=>t!==e);if(t.length>=2)return t;let n=[...t,e];return n.length===2&&Q(n),n})}let $=e.filter(e=>!(T&&e.status!==T||A&&e.started_at<A||P&&e.started_at>`${P}T23:59:59`)),he=e.filter(e=>!(R&&e.started_at<R||V&&e.started_at>`${V}T23:59:59`)).length;async function ge(e){W(!0);try{let t={};e===`range`&&(R&&(t.from=R),V&&(t.to=V));let i=await fetch(`${r()}/jobs`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(i.ok){let e=await i.json();n.success(_(`recent.toast.cleared`,{count:e.deleted})),L(!1),B(``),H(``),c?.()}else n.error(_(`recent.toast.clearFailed`))}catch{n.error(_(`recent.toast.networkError`))}finally{W(!1)}}return a?(0,N.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-1`,children:[0,1,2].map(e=>(0,N.jsx)(`div`,{className:`h-9 bg-muted/30 rounded-md animate-pulse`},e))}):e.length===0?(0,N.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border/40 bg-card/50 p-8 text-center space-y-2`,children:[(0,N.jsx)(S,{className:`w-8 h-8 text-muted-foreground/30 mx-auto`}),(0,N.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:_(`recent.emptyTitle`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:_(`recent.emptyDescription`)})]}):(0,N.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>D(null),className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${T===null?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:_(`recent.filterAll`,{count:e.length})}),ae.map(t=>{let n=e.filter(e=>e.status===t).length;return n===0?null:(0,N.jsx)(`button`,{type:`button`,onClick:()=>D(T===t?null:t),className:`px-2 py-0.5 rounded text-[10px] font-medium capitalize transition-colors ${T===t?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:_(`recent.filterStatus`,{status:_(`statusName.${t}`),count:n})},t)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:A,onChange:e=>j(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:_(`recent.fromDate`)}),(0,N.jsx)(`input`,{type:`date`,value:P,onChange:e=>F(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:_(`recent.toDate`)}),(A||P)&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>{j(``),F(``)},className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:_(`recent.clear`)}),(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 transition-colors ${Y?`text-foreground bg-accent`:`text-muted-foreground hover:text-foreground`}`,onClick:pe,children:(0,N.jsx)(ne,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(h,{children:_(Y?`recent.exitCompareMode`:`recent.compareTwoJobs`)})]}),(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>L(!0),children:(0,N.jsx)(p,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(h,{children:_(`recent.clearJobs`)})]})]})]}),Y&&(0,N.jsxs)(`div`,{className:`flex items-center justify-between rounded-md bg-accent/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[X.length===0&&_(`recent.selectTwoToCompare`),X.length===1&&_(`recent.selectOneMore`),X.length===2&&_(`recent.readyToCompare`)]}),X.length===2&&(0,N.jsx)(`button`,{type:`button`,className:`text-[10px] font-medium text-foreground hover:underline`,onClick:()=>Q(X),children:_(`recent.compareAction`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:[(0,N.jsx)(`span`,{className:`w-14`,children:_(`recent.colStatus`)}),(0,N.jsx)(`span`,{className:`flex-1 min-w-0`,children:_(`recent.colCommand`)}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:_(`recent.colDuration`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:_(`recent.colTokens`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:_(`recent.colCost`)}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:_(`recent.colStarted`)})]})]}),(0,N.jsx)(`div`,{className:`space-y-0.5`,children:$.slice(0,q).map(e=>{let n=ie[e.status]??ie.queued,r=se(e.total_cost_usd),i=ce(e.started_at,e.finished_at),a=le((e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0)||null),o=e.id.startsWith(`proposal:`),s=o?e.id.replace(`proposal:`,``):null,c=X.includes(e.id),u=Y&&!o&&X.length===2&&!c;return(0,N.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer group ${c?`bg-accent/70 ring-1 ring-border`:u?`opacity-40 cursor-not-allowed`:`hover:bg-accent/50`}`,onClick:()=>{if(Y&&!o){me(e.id);return}o&&s?f?.(s):y(`/jobs/${e.id}`)},children:[(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(`div`,{children:(0,N.jsx)(l,{variant:n.variant,children:_(n.labelKey)})})}),(0,N.jsx)(h,{children:_(n.tooltipKey)})]}),e.priority&&e.priority!==`normal`&&(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border ${oe[e.priority].className}`,children:_(oe[e.priority].labelKey)}),e.profile_name&&(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border border-accent-primary/40 bg-accent-primary/10 text-accent-primary/90`,children:e.profile_name})}),(0,N.jsx)(h,{children:_(`recent.profileTooltip`,{name:e.profile_name})})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0`,children:[e.pipeline_id&&(0,N.jsxs)(k,{children:[(0,N.jsx)(O,{asChild:!0,children:(0,N.jsx)(t,{className:`w-3 h-3 text-accent-primary/60 shrink-0`})}),(0,N.jsxs)(h,{children:[_(`recent.pipelinePart`),e.depends_on_job_id&&` ${_(`recent.pipelineDependsOn`)}`,e.skip_reason&&` — ${e.skip_reason}`]})]}),(0,N.jsx)(`code`,{className:`text-xs text-foreground/80 truncate`,children:te(e.command,ee)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:i??`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:a?`${a}`:`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:r??`—`}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:ue(e.started_at)}),o&&s&&(0,N.jsx)(`button`,{type:`button`,className:`w-4 h-4 md:opacity-0 md:group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all`,onClick:e=>{e.stopPropagation(),K(s)},title:_(`recent.deleteProposal`),children:(0,N.jsx)(p,{className:`w-3 h-3`})})]})]},e.id)})}),$.length>q&&(0,N.jsx)(`div`,{className:`pt-1 text-center`,children:(0,N.jsx)(`button`,{type:`button`,onClick:()=>J(e=>e+z),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1 rounded hover:bg-accent/50`,children:_(`recent.loadMore`,{count:$.length-q})})}),I&&(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:()=>L(!1),children:(0,N.jsxs)(`div`,{className:`w-80 rounded-xl border border-border/30 bg-popover p-4 shadow-lg space-y-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold`,children:_(`recent.clearModal.title`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:_(`recent.clearModal.jobsInHistory`,{count:e.length})})]}),(0,N.jsx)(u,{variant:`destructive`,size:`sm`,className:`w-full`,disabled:U,onClick:()=>ge(`all`),children:_(`recent.clearModal.clearAll`,{count:e.length})}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_(`recent.clearModal.orByRange`)}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:R,onChange:e=>B(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:_(`recent.clearModal.fromPlaceholder`)}),(0,N.jsx)(`input`,{type:`date`,value:V,onChange:e=>H(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:_(`recent.clearModal.toPlaceholder`)})]}),(0,N.jsx)(u,{variant:`outline`,size:`sm`,className:`w-full`,disabled:U||!R&&!V,onClick:()=>ge(`range`),children:R||V?_(`recent.clearModal.clearInRange`,{count:he}):_(`recent.clearModal.clearRange`)})]}),(0,N.jsx)(u,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:()=>L(!1),children:_(`common:actions.cancel`)})]})}),(0,N.jsx)(E,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,N.jsxs)(m,{className:`max-w-sm`,children:[(0,N.jsxs)(d,{children:[(0,N.jsx)(x,{children:_(`recent.deleteProposalConfirm.title`)}),(0,N.jsx)(o,{children:_(`recent.deleteProposalConfirm.description`)})]}),(0,N.jsxs)(i,{children:[(0,N.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>K(null),children:_(`common:actions.cancel`)}),(0,N.jsx)(u,{variant:`destructive`,size:`sm`,onClick:()=>{G&&g?.(G),K(null)},children:_(`common:actions.delete`)})]})]})}),fe&&(0,N.jsx)(re,{jobIds:fe,onClose:()=>{Q(null),Z([]),de(!1)}})]})}function V(){let{t:e}=v(`jobs`),{activeProjectId:t}=s(),{recentJobs:o}=w(t),{data:c,isFirstLoad:f,refresh:p}=a({namespace:`jobs`,projectId:t,initialValue:o,fetcher:async()=>{let e=await fetch(`${r()}/jobs?limit=10`);return e.ok?(await e.json()).jobs:[]},pollInterval:1e4}),{data:h}=a({namespace:`proposals`,projectId:t,initialValue:[],fetcher:async()=>{let e=await fetch(`${r()}/propose?limit=10`);return e.ok?(await e.json()).proposals:[]},pollInterval:1e4}),g={input:`queued`,exploring:`running`,review:`running`,refining:`running`,creating_issue:`running`,created:`completed`,cancelled:`canceled`},_=h.map(e=>({id:`proposal:${e.id}`,command:`/specrails:propose-feature ${e.idea.length>60?e.idea.slice(0,57)+`...`:e.idea}`,started_at:e.created_at,status:g[e.status]??`queued`})),y=[...c,..._].sort((e,t)=>new Date(t.started_at).getTime()-new Date(e.started_at).getTime()),[b,S]=(0,M.useState)(null),T=(0,M.useCallback)(async e=>{try{let t=await fetch(`${r()}/propose/${e}`);if(!t.ok)return;S((await t.json()).proposal)}catch{}},[]),D=(0,M.useCallback)(async t=>{try{(await fetch(`${r()}/propose/${t}`,{method:`DELETE`})).ok&&(n.success(e(`page.proposalDeleted`)),p())}catch{}},[p,e]);return(0,N.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,N.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`page.title`)}),(0,N.jsx)(j,{baseUrl:`${r()}/jobs/export`,label:e(`page.exportJobs`)})]}),(0,N.jsx)(B,{jobs:y,isLoading:f,onJobsCleared:p,onProposalClick:T,onProposalDelete:D}),(0,N.jsx)(E,{open:b!==null,onOpenChange:e=>!e&&S(null),children:(0,N.jsx)(m,{className:`max-w-3xl glass-card`,children:b&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(d,{children:(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(x,{className:`flex-1 min-w-0`,children:e(`page.proposal.title`)}),(0,N.jsx)(l,{variant:b.status===`created`?`success`:b.status===`cancelled`?`destructive`:`secondary`,children:b.status})]})}),(0,N.jsx)(`div`,{className:`text-xs text-muted-foreground bg-muted/20 rounded px-2 py-1 italic`,children:b.idea}),b.result_markdown?(0,N.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto rounded-lg px-3 py-2 text-xs bg-muted/40`,children:(0,N.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80`,children:(0,N.jsx)(C,{remarkPlugins:[ee],children:b.result_markdown})})}):(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:e(`page.proposal.noContent`)}),b.issue_url&&(0,N.jsxs)(`div`,{className:`text-xs`,children:[e(`page.proposal.githubIssue`),` `,(0,N.jsx)(`a`,{href:b.issue_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-primary hover:underline`,children:b.issue_url})]}),(0,N.jsxs)(i,{children:[(0,N.jsx)(u,{variant:`destructive`,size:`sm`,onClick:()=>{D(b.id),S(null)},children:e(`common:actions.delete`)}),(0,N.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>S(null),children:e(`common:actions.close`)})]})]})})})]})}export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t}from"./index-
|
|
1
|
+
import{i as e,r as t}from"./index-BEGU2TCx.js";var n=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=r=>{this.removeListener(e,n),t(r)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(e=>e!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let e of n)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=r=>{this.removeListener(e,n),t(r)};return this.prependListener(e,n)}},r=class{constructor(e){this.pid=e}async write(t){await e(`plugin:shell|stdin_write`,{pid:this.pid,buffer:t})}async kill(){await e(`plugin:shell|kill`,{cmd:`killChild`,pid:this.pid})}},i=class i extends n{constructor(e,t=[],r){super(),this.stdout=new n,this.stderr=new n,this.program=e,this.args=typeof t==`string`?[t]:t,this.options=r??{}}static create(e,t=[],n){return new i(e,t,n)}static sidecar(e,t=[],n){let r=new i(e,t,n);return r.options.sidecar=!0,r}async spawn(){let n=this.program,i=this.args,a=this.options;typeof i==`object`&&Object.freeze(i);let o=new t;return o.onmessage=e=>{switch(e.event){case`Error`:this.emit(`error`,e.payload);break;case`Terminated`:this.emit(`close`,e.payload);break;case`Stdout`:this.stdout.emit(`data`,e.payload);break;case`Stderr`:this.stderr.emit(`data`,e.payload);break}},await e(`plugin:shell|spawn`,{program:n,args:i,options:a,onEvent:o}).then(e=>new r(e))}async execute(){let t=this.program,n=this.args,r=this.options;return typeof n==`object`&&Object.freeze(n),await e(`plugin:shell|execute`,{program:t,args:n,options:r})}};async function a(t,n){await e(`plugin:shell|open`,{path:t,with:n})}export{r as Child,i as Command,n as EventEmitter,a as open};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./index-
|
|
1
|
+
import{i as e}from"./index-BEGU2TCx.js";function t(e){if(e!==void 0){if(typeof e==`string`)return e;if(`ok`in e&&`cancel`in e)return{OkCancelCustom:[e.ok,e.cancel]};if(`yes`in e&&`no`in e&&`cancel`in e)return{YesNoCancelCustom:[e.yes,e.no,e.cancel]};if(`ok`in e)return{OkCustom:e.ok}}}async function n(t={}){return typeof t==`object`&&Object.freeze(t),await e(`plugin:dialog|open`,{options:t})}async function r(t={}){return typeof t==`object`&&Object.freeze(t),await e(`plugin:dialog|save`,{options:t})}async function i(n,r){return await e(`plugin:dialog|message`,{message:n,title:r?.title,kind:r?.kind,buttons:t(r?.buttons)})}async function a(e,t){let n=typeof t==`string`?{title:t}:t;return n&&!n.buttons&&n.okLabel&&(n.buttons={ok:n.okLabel}),i(e,n)}async function o(e,t){let n=typeof t==`string`?{title:t}:t,r=n?.okLabel||n?.cancelLabel,a=n?.okLabel??`Yes`;return await i(e,{title:n?.title,kind:n?.kind,buttons:r?{ok:a,cancel:n.cancelLabel??`No`}:`YesNo`})===a}async function s(e,t){let n=typeof t==`string`?{title:t}:t,r=n?.okLabel||n?.cancelLabel,a=n?.okLabel??`Ok`;return await i(e,{title:n?.title,kind:n?.kind,buttons:r?{ok:a,cancel:n.cancelLabel??`Cancel`}:`OkCancel`})===a}export{o as ask,s as confirm,a as message,n as open,r as save};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dialogAriaLabel:`Explore Spec · interactif`,backAriaLabel:`Retour (Échap)`,exploreEyebrow:`EXPLORE SPEC · interactif`,editingEyebrow:`ÉDITION DE SPEC · #{{id}}`,newSpecPlaceholder:`Nouvelle spec…`,contextPill:`Contexte : {{scopes}}`,contextPillTitle:`Portée de contexte active pour cette session Explore`,contextScopeCodebase:`base de code`,contextScopeMinimal:`minimal`,saveAsDraft:`Enregistrer comme brouillon`,saveAsDraftAriaLabel:`Enregistrer l'exploration actuelle comme brouillon`,saveAsDraftDisabledTitle:`Envoyez au moins un message avant d'enregistrer`,review:`Vérifier →`,reviewAriaLabel:`Vérifier les modifications avant de créer la spec`,createSpec:`Créer la spec`,updateSpec:`Mettre à jour la spec`,createSpecAriaLabel:`Créer une spec à partir du brouillon actuel`,updateSpecAriaLabel:`Mettre à jour la spec avec le brouillon actuel`,createSpecDisabledTitle:`Un titre est requis pour valider`,editModeIntro:`Spec chargée à droite. Saisissez une amélioration pour commencer.`,startingConversation:`Démarrage de la conversation…`,suggestedRepliesAriaLabel:`Réponses suggérées`,composerPlaceholder:`Saisissez votre réponse… glissez des fichiers pour les joindre`,composerAriaLabel:`Idée de spec`,stop:`Arrêter`,send:`Envoyer`,you:`Vous`,closePrompt:{title:`Enregistrer cette exploration ?`,description:`Enregistrer comme brouillon conserve la conversation pour la reprendre plus tard depuis le tableau. Abandonner la supprime définitivement.`},toasts:{saveDraftFailed:`Échec de l'enregistrement du brouillon`,draftSaved:`Brouillon enregistré — #{{id}} {{title}}`,draftNetworkError:`Erreur réseau lors de l'enregistrement du brouillon`,updateSpecFailed:`Échec de la mise à jour de la spec`,specUpdated:`Spec mise à jour — #{{id}} {{title}}`,createSpecFailed:`Échec de la création de la spec`,specCreated:`Spec créée — #{{id}} {{title}}`,createNetworkError:`Erreur réseau lors de la création de la spec`,unsupportedFileType:`Type de fichier non pris en charge : {{name}}`,uploadFailed:`Échec de l'envoi de {{name}} : {{message}}`},fromWebsite:`Depuis un site web`,fromWebsiteTitle:`Ouvrez une vraie page web, sélectionnez une zone et transformez-la en spec`,captureResponsiveSizes_one:`Responsive · {{count}} taille`,captureResponsiveSizes_other:`Responsive · {{count}} tailles`,captureFeedbackPrompt:`Je viens de capturer une partie d'une page web (sa capture d'écran et son contenu sont joints). Brièvement : que vois-tu, et quel rapport avec ce dont nous avons parlé et avec la spec que nous élaborons ? Donne-moi ton retour.`},t={ready:`Brouillon prêt`,titleLabel:`Titre`,titlePlaceholder:`Titre concis, orienté action…`,titleAriaLabel:`Titre de la spec`,priorityLabel:`Priorité`,priorityAriaLabel:`Priorité de la spec`,labelsLabel:`Labels`,descriptionLabel:`Description`,descriptionPlaceholder:`Quel problème cela résout-il ? Qu'est-ce qui change ? Pourquoi maintenant ?`,descriptionAriaLabel:`Description de la spec`,acceptanceCriteriaLabel:`Critères d'acceptation`,attachmentsHeading_one:`Pièces jointes ({{count}})`,attachmentsHeading_other:`Pièces jointes ({{count}})`,linkedOnCreate:`liées à la création`,attachmentsListAriaLabel:`Pièces jointes accumulées`,removeLabelAriaLabel:`Retirer le label {{label}}`,addLabelAriaLabel:`Ajouter un label`,addLabelsPlaceholder:`Ajouter des labels…`,removeAttachmentAriaLabel:`Retirer {{filename}}`,criterionPlaceholder:`Résultat testable…`,criterionAriaLabel:`Critère d'acceptation {{number}}`,removeCriterionAriaLabel:`Supprimer le critère {{number}}`,addCriterion:`Ajouter un critère`,addCriterionAriaLabel:`Ajouter un critère d'acceptation`},n={low:`basse`,medium:`moyenne`,high:`haute`,critical:`critique`},r={dialogAriaLabel:`Vérifier les modifications`,eyebrow:`Vérification des modifications · explore-spec`,heading:`Confirmez avant de valider`,titleLabel:`Titre`,priorityLabel:`Priorité`,descriptionLabel:`Description`,labelsLabel:`Labels`,acceptanceCriteriaLabel:`Critères d'acceptation`,noLabels:`Aucun label`,noCriteria:`Aucun critère`,backToEdit:`Retour à l'édition`,createSpec:`Créer la spec`,updateSpec:`Mettre à jour la spec`,noPriority:`aucune priorité`,inserted:`inséré`,removed:`supprimé`,added:`ajouté`,unchanged:`inchangé`},i={connecting:`Connexion…`,thinking:`Réflexion…`,tool:`Lecture du code…`},a={ariaLabel:`Modèle de génération de spec`,placeholder:`Choisir un modèle`},o={shell:e,draftPanel:t,priority:n,reviewOverlay:r,statusPills:i,modelPicker:a};export{o as default,t as draftPanel,a as modelPicker,n as priority,r as reviewOverlay,e as shell,i as statusPills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dialogAriaLabel:`Explore Spec · 交互式`,backAriaLabel:`返回 (Esc)`,exploreEyebrow:`EXPLORE SPEC · 交互式`,editingEyebrow:`编辑 SPEC · #{{id}}`,newSpecPlaceholder:`新建 Spec…`,contextPill:`上下文:{{scopes}}`,contextPillTitle:`当前 Explore 会话的上下文范围`,contextScopeCodebase:`代码库`,contextScopeMinimal:`最小`,saveAsDraft:`保存为草稿`,saveAsDraftAriaLabel:`将当前探索保存为草稿`,saveAsDraftDisabledTitle:`请先发送至少一条消息再保存`,review:`审阅 →`,reviewAriaLabel:`创建 Spec 前审阅更改`,createSpec:`创建 Spec`,updateSpec:`更新 Spec`,createSpecAriaLabel:`从当前草稿创建 Spec`,updateSpecAriaLabel:`用当前草稿更新 Spec`,createSpecDisabledTitle:`提交前需要填写标题`,editModeIntro:`Spec 已加载在右侧。输入改进内容即可开始。`,startingConversation:`正在开始对话…`,suggestedRepliesAriaLabel:`建议回复`,composerPlaceholder:`输入回复… 拖入文件以添加附件`,composerAriaLabel:`Spec 想法`,stop:`停止`,send:`发送`,you:`你`,closePrompt:{title:`保存此次探索?`,description:`保存为草稿会保留对话,之后可从看板继续。丢弃则会将其删除。`},toasts:{saveDraftFailed:`保存草稿失败`,draftSaved:`草稿已保存 — #{{id}} {{title}}`,draftNetworkError:`保存草稿时网络错误`,updateSpecFailed:`更新 Spec 失败`,specUpdated:`Spec 已更新 — #{{id}} {{title}}`,createSpecFailed:`创建 Spec 失败`,specCreated:`Spec 已创建 — #{{id}} {{title}}`,createNetworkError:`创建 Spec 时网络错误`,unsupportedFileType:`不支持的文件类型:{{name}}`,uploadFailed:`{{name}} 上传失败:{{message}}`},fromWebsite:`从网站创建`,fromWebsiteTitle:`打开真实网页,框选一块区域,把它变成 spec`,captureResponsiveSizes_one:`响应式 · {{count}} 个尺寸`,captureResponsiveSizes_other:`响应式 · {{count}} 个尺寸`,captureFeedbackPrompt:`我刚刚截取了一个网页的一部分(截图和内容已附上)。简要说说:你看到了什么?它与我们目前的讨论以及我们正在定义的 spec 有什么关联?给我你的反馈。`},t={ready:`草稿就绪`,titleLabel:`标题`,titlePlaceholder:`简洁、面向行动的标题…`,titleAriaLabel:`Spec 标题`,priorityLabel:`优先级`,priorityAriaLabel:`Spec 优先级`,labelsLabel:`标签`,descriptionLabel:`描述`,descriptionPlaceholder:`解决什么问题?改动什么?为什么是现在?`,descriptionAriaLabel:`Spec 描述`,acceptanceCriteriaLabel:`验收标准`,attachmentsHeading_one:`附件({{count}})`,attachmentsHeading_other:`附件({{count}})`,linkedOnCreate:`创建时关联`,attachmentsListAriaLabel:`已累积的附件`,removeLabelAriaLabel:`移除标签 {{label}}`,addLabelAriaLabel:`添加标签`,addLabelsPlaceholder:`添加标签…`,removeAttachmentAriaLabel:`移除 {{filename}}`,criterionPlaceholder:`可验证的结果…`,criterionAriaLabel:`验收标准 {{number}}`,removeCriterionAriaLabel:`移除标准 {{number}}`,addCriterion:`添加标准`,addCriterionAriaLabel:`添加验收标准`},n={low:`低`,medium:`中`,high:`高`,critical:`紧急`},r={dialogAriaLabel:`审阅更改`,eyebrow:`审阅更改 · explore-spec`,heading:`提交前确认`,titleLabel:`标题`,priorityLabel:`优先级`,descriptionLabel:`描述`,labelsLabel:`标签`,acceptanceCriteriaLabel:`验收标准`,noLabels:`无标签`,noCriteria:`无标准`,backToEdit:`返回编辑`,createSpec:`创建 Spec`,updateSpec:`更新 Spec`,noPriority:`无优先级`,inserted:`插入`,removed:`删除`,added:`新增`,unchanged:`未变更`},i={connecting:`连接中…`,thinking:`思考中…`,tool:`正在阅读代码…`},a={ariaLabel:`Spec 生成模型`,placeholder:`选择模型`},o={shell:e,draftPanel:t,priority:n,reviewOverlay:r,statusPills:i,modelPicker:a};export{o as default,t as draftPanel,a as modelPicker,n as priority,r as reviewOverlay,e as shell,i as statusPills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dialogAriaLabel:`Explore Spec · interattivo`,backAriaLabel:`Indietro (Esc)`,exploreEyebrow:`EXPLORE SPEC · interattivo`,editingEyebrow:`MODIFICA SPEC · #{{id}}`,newSpecPlaceholder:`Nuova spec…`,contextPill:`Contesto: {{scopes}}`,contextPillTitle:`Ambito di contesto attivo per questa sessione Explore`,contextScopeCodebase:`codebase`,contextScopeMinimal:`minimo`,saveAsDraft:`Salva come bozza`,saveAsDraftAriaLabel:`Salva l'esplorazione corrente come bozza`,saveAsDraftDisabledTitle:`Invia almeno un messaggio prima di salvare`,review:`Rivedi →`,reviewAriaLabel:`Rivedi le modifiche prima di creare la spec`,createSpec:`Crea spec`,updateSpec:`Aggiorna spec`,createSpecAriaLabel:`Crea la spec dalla bozza corrente`,updateSpecAriaLabel:`Aggiorna la spec con la bozza corrente`,createSpecDisabledTitle:`Serve un titolo per confermare`,editModeIntro:`Spec caricata a destra. Scrivi una rifinitura per iniziare.`,startingConversation:`Avvio della conversazione…`,suggestedRepliesAriaLabel:`Risposte suggerite`,composerPlaceholder:`Scrivi la tua risposta… trascina i file per allegarli`,composerAriaLabel:`Idea per la spec`,stop:`Stop`,send:`Invia`,you:`Tu`,closePrompt:{title:`Salvare questa esplorazione?`,description:`Salva come bozza conserva la conversazione per riprenderla in seguito dalla board. Scarta la elimina.`},toasts:{saveDraftFailed:`Impossibile salvare la bozza`,draftSaved:`Bozza salvata — #{{id}} {{title}}`,draftNetworkError:`Errore di rete durante il salvataggio della bozza`,updateSpecFailed:`Impossibile aggiornare la spec`,specUpdated:`Spec aggiornata — #{{id}} {{title}}`,createSpecFailed:`Impossibile creare la spec`,specCreated:`Spec creata — #{{id}} {{title}}`,createNetworkError:`Errore di rete durante la creazione della spec`,unsupportedFileType:`Tipo di file non supportato: {{name}}`,uploadFailed:`Caricamento non riuscito per {{name}}: {{message}}`},fromWebsite:`Da un sito web`,fromWebsiteTitle:`Apri una pagina web reale, seleziona un'area e trasformala in una spec`,captureResponsiveSizes_one:`Responsive · {{count}} dimensione`,captureResponsiveSizes_other:`Responsive · {{count}} dimensioni`,captureFeedbackPrompt:`Ho appena catturato una parte di una pagina web (screenshot e contenuto sono allegati). In breve: cosa vedi e come si collega a ciò di cui abbiamo parlato e alla spec che stiamo definendo? Dammi il tuo feedback.`},t={ready:`Bozza pronta`,titleLabel:`Titolo`,titlePlaceholder:`Titolo conciso e orientato all'azione…`,titleAriaLabel:`Titolo della spec`,priorityLabel:`Priorità`,priorityAriaLabel:`Priorità della spec`,labelsLabel:`Etichette`,descriptionLabel:`Descrizione`,descriptionPlaceholder:`Quale problema risolve? Cosa cambia? Perché ora?`,descriptionAriaLabel:`Descrizione della spec`,acceptanceCriteriaLabel:`Criteri di accettazione`,attachmentsHeading_one:`Allegato ({{count}})`,attachmentsHeading_other:`Allegati ({{count}})`,linkedOnCreate:`collegati alla creazione`,attachmentsListAriaLabel:`Allegati accumulati`,removeLabelAriaLabel:`Rimuovi etichetta {{label}}`,addLabelAriaLabel:`Aggiungi etichetta`,addLabelsPlaceholder:`Aggiungi etichette…`,removeAttachmentAriaLabel:`Rimuovi {{filename}}`,criterionPlaceholder:`Risultato verificabile…`,criterionAriaLabel:`Criterio di accettazione {{number}}`,removeCriterionAriaLabel:`Rimuovi criterio {{number}}`,addCriterion:`Aggiungi criterio`,addCriterionAriaLabel:`Aggiungi criterio di accettazione`},n={low:`bassa`,medium:`media`,high:`alta`,critical:`critica`},r={dialogAriaLabel:`Rivedi le modifiche`,eyebrow:`Rivedi le modifiche · explore-spec`,heading:`Conferma prima del commit`,titleLabel:`Titolo`,priorityLabel:`Priorità`,descriptionLabel:`Descrizione`,labelsLabel:`Etichette`,acceptanceCriteriaLabel:`Criteri di accettazione`,noLabels:`Nessuna etichetta`,noCriteria:`Nessun criterio`,backToEdit:`Torna alla modifica`,createSpec:`Crea spec`,updateSpec:`Aggiorna spec`,noPriority:`nessuna priorità`,inserted:`inserito`,removed:`rimosso`,added:`aggiunto`,unchanged:`invariato`},i={connecting:`Connessione…`,thinking:`Sto pensando…`,tool:`Sto leggendo il codice…`},a={ariaLabel:`Modello per la generazione della spec`,placeholder:`Scegli un modello`},o={shell:e,draftPanel:t,priority:n,reviewOverlay:r,statusPills:i,modelPicker:a};export{o as default,t as draftPanel,a as modelPicker,n as priority,r as reviewOverlay,e as shell,i as statusPills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-CilyBKbf.js";var t=e({default:()=>c,draftPanel:()=>r,modelPicker:()=>s,priority:()=>i,reviewOverlay:()=>a,shell:()=>n,statusPills:()=>o}),n={dialogAriaLabel:`Explore Spec · interactive`,backAriaLabel:`Back (Esc)`,exploreEyebrow:`EXPLORE SPEC · interactive`,editingEyebrow:`EDITING SPEC · #{{id}}`,newSpecPlaceholder:`New spec…`,contextPill:`Context: {{scopes}}`,contextPillTitle:`Active context scope for this Explore session`,contextScopeCodebase:`codebase`,contextScopeMinimal:`minimal`,saveAsDraft:`Save as Draft`,saveAsDraftAriaLabel:`Save current exploration as draft`,saveAsDraftDisabledTitle:`Send at least one message before saving`,review:`Review →`,reviewAriaLabel:`Review changes before creating spec`,createSpec:`Create Spec`,updateSpec:`Update Spec`,createSpecAriaLabel:`Create spec from current draft`,updateSpecAriaLabel:`Update spec with current draft`,createSpecDisabledTitle:`A title is needed to commit`,editModeIntro:`Spec loaded on the right. Type a refinement to get started.`,startingConversation:`Starting conversation…`,suggestedRepliesAriaLabel:`Suggested replies`,composerPlaceholder:`Type your reply… drag files to attach`,composerAriaLabel:`Spec idea`,stop:`Stop`,send:`Send`,you:`You`,closePrompt:{title:`Save this exploration?`,description:`Save as Draft keeps the conversation so you can pick it up later from the board. Discard throws it away.`},toasts:{saveDraftFailed:`Failed to save draft`,draftSaved:`Draft saved — #{{id}} {{title}}`,draftNetworkError:`Network error saving draft`,updateSpecFailed:`Failed to update spec`,specUpdated:`Spec updated — #{{id}} {{title}}`,createSpecFailed:`Failed to create spec`,specCreated:`Spec created — #{{id}} {{title}}`,createNetworkError:`Network error creating spec`,unsupportedFileType:`Unsupported file type: {{name}}`,uploadFailed:`Upload failed for {{name}}: {{message}}`},fromWebsite:`From a website`,fromWebsiteTitle:`Open a real web page, select an area, and turn it into a spec`,captureResponsiveSizes_one:`Responsive · {{count}} size`,captureResponsiveSizes_other:`Responsive · {{count}} sizes`,captureFeedbackPrompt:`I've just captured part of a web page (its screenshot and content are attached). Briefly: what do you see, and how does it relate to what we've discussed so far and to the spec we're shaping? Give me your feedback.`},r={ready:`Draft ready`,titleLabel:`Title`,titlePlaceholder:`Concise, action-oriented title…`,titleAriaLabel:`Spec title`,priorityLabel:`Priority`,priorityAriaLabel:`Spec priority`,labelsLabel:`Labels`,descriptionLabel:`Description`,descriptionPlaceholder:`What problem is this solving? What changes? Why now?`,descriptionAriaLabel:`Spec description`,acceptanceCriteriaLabel:`Acceptance Criteria`,attachmentsHeading_one:`Attachments ({{count}})`,attachmentsHeading_other:`Attachments ({{count}})`,linkedOnCreate:`linked on Create`,attachmentsListAriaLabel:`Accumulated attachments`,removeLabelAriaLabel:`Remove label {{label}}`,addLabelAriaLabel:`Add label`,addLabelsPlaceholder:`Add labels…`,removeAttachmentAriaLabel:`Remove {{filename}}`,criterionPlaceholder:`Testable outcome…`,criterionAriaLabel:`Acceptance criterion {{number}}`,removeCriterionAriaLabel:`Remove criterion {{number}}`,addCriterion:`Add criterion`,addCriterionAriaLabel:`Add acceptance criterion`},i={low:`low`,medium:`medium`,high:`high`,critical:`critical`},a={dialogAriaLabel:`Review changes`,eyebrow:`Review changes · explore-spec`,heading:`Confirm before commit`,titleLabel:`Title`,priorityLabel:`Priority`,descriptionLabel:`Description`,labelsLabel:`Labels`,acceptanceCriteriaLabel:`Acceptance criteria`,noLabels:`No labels`,noCriteria:`No criteria`,backToEdit:`Back to edit`,createSpec:`Create Spec`,updateSpec:`Update Spec`,noPriority:`no priority`,inserted:`inserted`,removed:`removed`,added:`added`,unchanged:`unchanged`},o={connecting:`Connecting…`,thinking:`Thinking…`,tool:`Reading code…`},s={ariaLabel:`Spec generation model`,placeholder:`Pick a model`},c={shell:n,draftPanel:r,priority:i,reviewOverlay:a,statusPills:o,modelPicker:s};export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dialogAriaLabel:`Explore Spec · interactivo`,backAriaLabel:`Atrás (Esc)`,exploreEyebrow:`EXPLORE SPEC · interactivo`,editingEyebrow:`EDITANDO SPEC · #{{id}}`,newSpecPlaceholder:`Nueva spec…`,contextPill:`Contexto: {{scopes}}`,contextPillTitle:`Ámbito de contexto activo para esta sesión de Explore`,contextScopeCodebase:`codebase`,contextScopeMinimal:`mínimo`,saveAsDraft:`Guardar como borrador`,saveAsDraftAriaLabel:`Guardar la exploración actual como borrador`,saveAsDraftDisabledTitle:`Envía al menos un mensaje antes de guardar`,review:`Revisar →`,reviewAriaLabel:`Revisar los cambios antes de crear la spec`,createSpec:`Crear spec`,updateSpec:`Actualizar spec`,createSpecAriaLabel:`Crear una spec a partir del borrador actual`,updateSpecAriaLabel:`Actualizar la spec con el borrador actual`,createSpecDisabledTitle:`Se necesita un título para confirmar`,editModeIntro:`Spec cargada a la derecha. Escribe un refinamiento para empezar.`,startingConversation:`Iniciando conversación…`,suggestedRepliesAriaLabel:`Respuestas sugeridas`,composerPlaceholder:`Escribe tu respuesta… arrastra archivos para adjuntar`,composerAriaLabel:`Idea de spec`,stop:`Detener`,send:`Enviar`,you:`Tú`,closePrompt:{title:`¿Guardar esta exploración?`,description:`Guardar como borrador conserva la conversación para retomarla más tarde desde el tablero. Descartar la elimina.`},toasts:{saveDraftFailed:`No se pudo guardar el borrador`,draftSaved:`Borrador guardado — #{{id}} {{title}}`,draftNetworkError:`Error de red al guardar el borrador`,updateSpecFailed:`No se pudo actualizar la spec`,specUpdated:`Spec actualizada — #{{id}} {{title}}`,createSpecFailed:`No se pudo crear la spec`,specCreated:`Spec creada — #{{id}} {{title}}`,createNetworkError:`Error de red al crear la spec`,unsupportedFileType:`Tipo de archivo no compatible: {{name}}`,uploadFailed:`Error al subir {{name}}: {{message}}`},fromWebsite:`Desde una web`,fromWebsiteTitle:`Abre una página web real, selecciona un área y conviértela en una spec`,captureResponsiveSizes_one:`Responsive · {{count}} tamaño`,captureResponsiveSizes_other:`Responsive · {{count}} tamaños`,captureFeedbackPrompt:`Acabo de capturar parte de una web (su imagen y contenido van adjuntos). Brevemente: ¿qué ves y cómo se relaciona con lo que hemos hablado y con la spec que estamos definiendo? Dame tu feedback.`},t={ready:`Borrador listo`,titleLabel:`Título`,titlePlaceholder:`Título conciso y orientado a la acción…`,titleAriaLabel:`Título de la spec`,priorityLabel:`Prioridad`,priorityAriaLabel:`Prioridad de la spec`,labelsLabel:`Etiquetas`,descriptionLabel:`Descripción`,descriptionPlaceholder:`¿Qué problema resuelve? ¿Qué cambia? ¿Por qué ahora?`,descriptionAriaLabel:`Descripción de la spec`,acceptanceCriteriaLabel:`Criterios de aceptación`,attachmentsHeading_one:`Adjuntos ({{count}})`,attachmentsHeading_other:`Adjuntos ({{count}})`,linkedOnCreate:`se vinculan al crear`,attachmentsListAriaLabel:`Adjuntos acumulados`,removeLabelAriaLabel:`Quitar etiqueta {{label}}`,addLabelAriaLabel:`Añadir etiqueta`,addLabelsPlaceholder:`Añadir etiquetas…`,removeAttachmentAriaLabel:`Quitar {{filename}}`,criterionPlaceholder:`Resultado comprobable…`,criterionAriaLabel:`Criterio de aceptación {{number}}`,removeCriterionAriaLabel:`Quitar criterio {{number}}`,addCriterion:`Añadir criterio`,addCriterionAriaLabel:`Añadir criterio de aceptación`},n={low:`baja`,medium:`media`,high:`alta`,critical:`crítica`},r={dialogAriaLabel:`Revisar cambios`,eyebrow:`Revisar cambios · explore-spec`,heading:`Confirma antes de crear`,titleLabel:`Título`,priorityLabel:`Prioridad`,descriptionLabel:`Descripción`,labelsLabel:`Etiquetas`,acceptanceCriteriaLabel:`Criterios de aceptación`,noLabels:`Sin etiquetas`,noCriteria:`Sin criterios`,backToEdit:`Volver a editar`,createSpec:`Crear spec`,updateSpec:`Actualizar spec`,noPriority:`sin prioridad`,inserted:`insertado`,removed:`eliminado`,added:`añadido`,unchanged:`sin cambios`},i={connecting:`Conectando…`,thinking:`Pensando…`,tool:`Consultando código…`},a={ariaLabel:`Modelo de generación de specs`,placeholder:`Elige un modelo`},o={shell:e,draftPanel:t,priority:n,reviewOverlay:r,statusPills:i,modelPicker:a};export{o as default,t as draftPanel,a as modelPicker,n as priority,r as reviewOverlay,e as shell,i as statusPills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dialogAriaLabel:`Explore Spec · interativo`,backAriaLabel:`Voltar (Esc)`,exploreEyebrow:`EXPLORE SPEC · interativo`,editingEyebrow:`A EDITAR SPEC · #{{id}}`,newSpecPlaceholder:`Nova spec…`,contextPill:`Contexto: {{scopes}}`,contextPillTitle:`Âmbito de contexto ativo nesta sessão de Explore`,contextScopeCodebase:`codebase`,contextScopeMinimal:`mínimo`,saveAsDraft:`Guardar como rascunho`,saveAsDraftAriaLabel:`Guardar a exploração atual como rascunho`,saveAsDraftDisabledTitle:`Envie pelo menos uma mensagem antes de guardar`,review:`Rever →`,reviewAriaLabel:`Rever alterações antes de criar a spec`,createSpec:`Criar Spec`,updateSpec:`Atualizar Spec`,createSpecAriaLabel:`Criar spec a partir do rascunho atual`,updateSpecAriaLabel:`Atualizar a spec com o rascunho atual`,createSpecDisabledTitle:`É necessário um título para confirmar`,editModeIntro:`Spec carregada à direita. Escreva um refinamento para começar.`,startingConversation:`A iniciar conversa…`,suggestedRepliesAriaLabel:`Respostas sugeridas`,composerPlaceholder:`Escreva a sua resposta… arraste ficheiros para anexar`,composerAriaLabel:`Ideia de spec`,stop:`Parar`,send:`Enviar`,you:`Você`,closePrompt:{title:`Guardar esta exploração?`,description:`Guardar como rascunho mantém a conversa para a retomar mais tarde a partir do quadro. Descartar elimina-a.`},toasts:{saveDraftFailed:`Falha ao guardar o rascunho`,draftSaved:`Rascunho guardado — #{{id}} {{title}}`,draftNetworkError:`Erro de rede ao guardar o rascunho`,updateSpecFailed:`Falha ao atualizar a spec`,specUpdated:`Spec atualizada — #{{id}} {{title}}`,createSpecFailed:`Falha ao criar a spec`,specCreated:`Spec criada — #{{id}} {{title}}`,createNetworkError:`Erro de rede ao criar a spec`,unsupportedFileType:`Tipo de ficheiro não suportado: {{name}}`,uploadFailed:`Falha no upload de {{name}}: {{message}}`},fromWebsite:`A partir de um website`,fromWebsiteTitle:`Abra uma página web real, selecione uma área e converta-a numa spec`,captureResponsiveSizes_one:`Responsivo · {{count}} tamanho`,captureResponsiveSizes_other:`Responsivo · {{count}} tamanhos`,captureFeedbackPrompt:`Acabei de capturar parte de uma página web (a imagem e o conteúdo estão anexados). Brevemente: o que vês e como se relaciona com o que falámos e com a spec que estamos a definir? Dá-me o teu feedback.`},t={ready:`Rascunho pronto`,titleLabel:`Título`,titlePlaceholder:`Título conciso e orientado à ação…`,titleAriaLabel:`Título da spec`,priorityLabel:`Prioridade`,priorityAriaLabel:`Prioridade da spec`,labelsLabel:`Etiquetas`,descriptionLabel:`Descrição`,descriptionPlaceholder:`Que problema resolve? O que muda? Porquê agora?`,descriptionAriaLabel:`Descrição da spec`,acceptanceCriteriaLabel:`Critérios de aceitação`,attachmentsHeading_one:`Anexos ({{count}})`,attachmentsHeading_other:`Anexos ({{count}})`,linkedOnCreate:`associados ao criar`,attachmentsListAriaLabel:`Anexos acumulados`,removeLabelAriaLabel:`Remover etiqueta {{label}}`,addLabelAriaLabel:`Adicionar etiqueta`,addLabelsPlaceholder:`Adicionar etiquetas…`,removeAttachmentAriaLabel:`Remover {{filename}}`,criterionPlaceholder:`Resultado testável…`,criterionAriaLabel:`Critério de aceitação {{number}}`,removeCriterionAriaLabel:`Remover critério {{number}}`,addCriterion:`Adicionar critério`,addCriterionAriaLabel:`Adicionar critério de aceitação`},n={low:`baixa`,medium:`média`,high:`alta`,critical:`crítica`},r={dialogAriaLabel:`Rever alterações`,eyebrow:`Rever alterações · explore-spec`,heading:`Confirmar antes de submeter`,titleLabel:`Título`,priorityLabel:`Prioridade`,descriptionLabel:`Descrição`,labelsLabel:`Etiquetas`,acceptanceCriteriaLabel:`Critérios de aceitação`,noLabels:`Sem etiquetas`,noCriteria:`Sem critérios`,backToEdit:`Voltar à edição`,createSpec:`Criar Spec`,updateSpec:`Atualizar Spec`,noPriority:`sem prioridade`,inserted:`inserido`,removed:`removido`,added:`adicionado`,unchanged:`sem alterações`},i={connecting:`A ligar…`,thinking:`A pensar…`,tool:`A ler código…`},a={ariaLabel:`Modelo de geração de specs`,placeholder:`Escolha um modelo`},o={shell:e,draftPanel:t,priority:n,reviewOverlay:r,statusPills:i,modelPicker:a};export{o as default,t as draftPanel,a as modelPicker,n as priority,r as reviewOverlay,e as shell,i as statusPills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dialogAriaLabel:`Explore Spec · interaktiv`,backAriaLabel:`Zurück (Esc)`,exploreEyebrow:`EXPLORE SPEC · interaktiv`,editingEyebrow:`SPEC BEARBEITEN · #{{id}}`,newSpecPlaceholder:`Neue Spec…`,contextPill:`Kontext: {{scopes}}`,contextPillTitle:`Aktiver Kontextumfang für diese Explore-Session`,contextScopeCodebase:`Codebase`,contextScopeMinimal:`minimal`,saveAsDraft:`Als Entwurf speichern`,saveAsDraftAriaLabel:`Aktuelle Exploration als Entwurf speichern`,saveAsDraftDisabledTitle:`Vor dem Speichern mindestens eine Nachricht senden`,review:`Prüfen →`,reviewAriaLabel:`Änderungen vor dem Erstellen der Spec prüfen`,createSpec:`Spec erstellen`,updateSpec:`Spec aktualisieren`,createSpecAriaLabel:`Spec aus aktuellem Entwurf erstellen`,updateSpecAriaLabel:`Spec mit aktuellem Entwurf aktualisieren`,createSpecDisabledTitle:`Zum Committen wird ein Titel benötigt`,editModeIntro:`Spec rechts geladen. Gib eine Verfeinerung ein, um zu starten.`,startingConversation:`Unterhaltung wird gestartet…`,suggestedRepliesAriaLabel:`Antwortvorschläge`,composerPlaceholder:`Antwort eingeben… Dateien zum Anhängen hierher ziehen`,composerAriaLabel:`Spec-Idee`,stop:`Stopp`,send:`Senden`,you:`Du`,closePrompt:{title:`Diese Exploration speichern?`,description:`„Als Entwurf speichern“ behält die Unterhaltung, damit du sie später vom Board aus fortsetzen kannst. „Verwerfen“ löscht sie.`},toasts:{saveDraftFailed:`Entwurf konnte nicht gespeichert werden`,draftSaved:`Entwurf gespeichert – #{{id}} {{title}}`,draftNetworkError:`Netzwerkfehler beim Speichern des Entwurfs`,updateSpecFailed:`Spec konnte nicht aktualisiert werden`,specUpdated:`Spec aktualisiert – #{{id}} {{title}}`,createSpecFailed:`Spec konnte nicht erstellt werden`,specCreated:`Spec erstellt – #{{id}} {{title}}`,createNetworkError:`Netzwerkfehler beim Erstellen der Spec`,unsupportedFileType:`Nicht unterstützter Dateityp: {{name}}`,uploadFailed:`Upload fehlgeschlagen für {{name}}: {{message}}`},fromWebsite:`Von einer Website`,fromWebsiteTitle:`Öffne eine echte Webseite, wähle einen Bereich aus und mach daraus eine Spec`,captureResponsiveSizes_one:`Responsive · {{count}} Größe`,captureResponsiveSizes_other:`Responsive · {{count}} Größen`,captureFeedbackPrompt:`Ich habe gerade einen Teil einer Webseite erfasst (Screenshot und Inhalt sind angehängt). Kurz: Was siehst du, und wie hängt es mit unserem bisherigen Gespräch und der Spec zusammen, die wir gerade gestalten? Gib mir dein Feedback.`},t={ready:`Entwurf bereit`,titleLabel:`Titel`,titlePlaceholder:`Prägnanter, handlungsorientierter Titel…`,titleAriaLabel:`Spec-Titel`,priorityLabel:`Priorität`,priorityAriaLabel:`Spec-Priorität`,labelsLabel:`Labels`,descriptionLabel:`Beschreibung`,descriptionPlaceholder:`Welches Problem wird gelöst? Was ändert sich? Warum jetzt?`,descriptionAriaLabel:`Spec-Beschreibung`,acceptanceCriteriaLabel:`Akzeptanzkriterien`,attachmentsHeading_one:`Anhänge ({{count}})`,attachmentsHeading_other:`Anhänge ({{count}})`,linkedOnCreate:`wird beim Erstellen verknüpft`,attachmentsListAriaLabel:`Gesammelte Anhänge`,removeLabelAriaLabel:`Label {{label}} entfernen`,addLabelAriaLabel:`Label hinzufügen`,addLabelsPlaceholder:`Labels hinzufügen…`,removeAttachmentAriaLabel:`{{filename}} entfernen`,criterionPlaceholder:`Testbares Ergebnis…`,criterionAriaLabel:`Akzeptanzkriterium {{number}}`,removeCriterionAriaLabel:`Kriterium {{number}} entfernen`,addCriterion:`Kriterium hinzufügen`,addCriterionAriaLabel:`Akzeptanzkriterium hinzufügen`},n={low:`niedrig`,medium:`mittel`,high:`hoch`,critical:`kritisch`},r={dialogAriaLabel:`Änderungen prüfen`,eyebrow:`Änderungen prüfen · explore-spec`,heading:`Vor dem Commit bestätigen`,titleLabel:`Titel`,priorityLabel:`Priorität`,descriptionLabel:`Beschreibung`,labelsLabel:`Labels`,acceptanceCriteriaLabel:`Akzeptanzkriterien`,noLabels:`Keine Labels`,noCriteria:`Keine Kriterien`,backToEdit:`Zurück zum Bearbeiten`,createSpec:`Spec erstellen`,updateSpec:`Spec aktualisieren`,noPriority:`keine Priorität`,inserted:`eingefügt`,removed:`entfernt`,added:`hinzugefügt`,unchanged:`unverändert`},i={connecting:`Verbinde…`,thinking:`Denke nach…`,tool:`Lese Code…`},a={ariaLabel:`Modell für die Spec-Generierung`,placeholder:`Modell wählen`},o={shell:e,draftPanel:t,priority:n,reviewOverlay:r,statusPills:i,modelPicker:a};export{o as default,t as draftPanel,a as modelPicker,n as priority,r as reviewOverlay,e as shell,i as statusPills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={dialogAriaLabel:`Explore Spec · インタラクティブ`,backAriaLabel:`戻る (Esc)`,exploreEyebrow:`EXPLORE SPEC · インタラクティブ`,editingEyebrow:`スペック編集中 · #{{id}}`,newSpecPlaceholder:`新しいスペック…`,contextPill:`コンテキスト: {{scopes}}`,contextPillTitle:`この Explore セッションで有効なコンテキストスコープ`,contextScopeCodebase:`コードベース`,contextScopeMinimal:`最小`,saveAsDraft:`下書きとして保存`,saveAsDraftAriaLabel:`現在の探索を下書きとして保存`,saveAsDraftDisabledTitle:`保存するには少なくとも 1 件メッセージを送信してください`,review:`レビュー →`,reviewAriaLabel:`スペック作成前に変更をレビュー`,createSpec:`スペックを作成`,updateSpec:`スペックを更新`,createSpecAriaLabel:`現在の下書きからスペックを作成`,updateSpecAriaLabel:`現在の下書きでスペックを更新`,createSpecDisabledTitle:`コミットにはタイトルが必要です`,editModeIntro:`右側にスペックを読み込みました。改善内容を入力して始めましょう。`,startingConversation:`会話を開始しています…`,suggestedRepliesAriaLabel:`返信候補`,composerPlaceholder:`返信を入力… ファイルをドラッグして添付`,composerAriaLabel:`スペックのアイデア`,stop:`停止`,send:`送信`,you:`あなた`,closePrompt:{title:`この探索を保存しますか?`,description:`「下書きとして保存」は会話を保持し、後でボードから再開できます。「破棄」は完全に削除します。`},toasts:{saveDraftFailed:`下書きの保存に失敗しました`,draftSaved:`下書きを保存しました — #{{id}} {{title}}`,draftNetworkError:`下書き保存中にネットワークエラーが発生しました`,updateSpecFailed:`スペックの更新に失敗しました`,specUpdated:`スペックを更新しました — #{{id}} {{title}}`,createSpecFailed:`スペックの作成に失敗しました`,specCreated:`スペックを作成しました — #{{id}} {{title}}`,createNetworkError:`スペック作成中にネットワークエラーが発生しました`,unsupportedFileType:`未対応のファイル形式: {{name}}`,uploadFailed:`{{name}} のアップロードに失敗しました: {{message}}`},fromWebsite:`ウェブサイトから`,fromWebsiteTitle:`実際のウェブページを開き、範囲を選択してスペックに変換`,captureResponsiveSizes_one:`レスポンシブ · {{count}} サイズ`,captureResponsiveSizes_other:`レスポンシブ · {{count}} サイズ`,captureFeedbackPrompt:`ウェブページの一部をキャプチャしました(スクリーンショットと内容を添付しています)。手短に: 何が見えますか?これまでの会話や、今まとめているスペックとどう関係しますか?フィードバックをください。`},t={ready:`下書き準備完了`,titleLabel:`タイトル`,titlePlaceholder:`簡潔でアクション指向のタイトル…`,titleAriaLabel:`スペックのタイトル`,priorityLabel:`優先度`,priorityAriaLabel:`スペックの優先度`,labelsLabel:`ラベル`,descriptionLabel:`説明`,descriptionPlaceholder:`どんな課題を解決しますか?何が変わりますか?なぜ今ですか?`,descriptionAriaLabel:`スペックの説明`,acceptanceCriteriaLabel:`受け入れ基準`,attachmentsHeading_one:`添付ファイル ({{count}})`,attachmentsHeading_other:`添付ファイル ({{count}})`,linkedOnCreate:`作成時にリンクされます`,attachmentsListAriaLabel:`蓄積された添付ファイル`,removeLabelAriaLabel:`ラベル {{label}} を削除`,addLabelAriaLabel:`ラベルを追加`,addLabelsPlaceholder:`ラベルを追加…`,removeAttachmentAriaLabel:`{{filename}} を削除`,criterionPlaceholder:`テスト可能な結果…`,criterionAriaLabel:`受け入れ基準 {{number}}`,removeCriterionAriaLabel:`基準 {{number}} を削除`,addCriterion:`基準を追加`,addCriterionAriaLabel:`受け入れ基準を追加`},n={low:`低`,medium:`中`,high:`高`,critical:`緊急`},r={dialogAriaLabel:`変更をレビュー`,eyebrow:`変更をレビュー · explore-spec`,heading:`コミット前に確認`,titleLabel:`タイトル`,priorityLabel:`優先度`,descriptionLabel:`説明`,labelsLabel:`ラベル`,acceptanceCriteriaLabel:`受け入れ基準`,noLabels:`ラベルなし`,noCriteria:`基準なし`,backToEdit:`編集に戻る`,createSpec:`スペックを作成`,updateSpec:`スペックを更新`,noPriority:`優先度なし`,inserted:`挿入`,removed:`削除`,added:`追加`,unchanged:`変更なし`},i={connecting:`接続中…`,thinking:`思考中…`,tool:`コードを読み取り中…`},a={ariaLabel:`スペック生成モデル`,placeholder:`モデルを選択`},o={shell:e,draftPanel:t,priority:n,reviewOverlay:r,statusPills:i,modelPicker:a};export{o as default,t as draftPanel,a as modelPicker,n as priority,r as reviewOverlay,e as shell,i as statusPills};
|