specrails-desktop 2.11.7 → 2.11.8
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/cli/dist/specrails-desktop.js +41 -10
- package/client/dist/assets/{ActivityFeedPage-CjaTeSEy.js → ActivityFeedPage-D12zOZGQ.js} +1 -1
- package/client/dist/assets/AgentsPage-CNyxiSCU.js +86 -0
- package/client/dist/assets/AnalyticsPage-DxuypQg1.js +1 -0
- package/client/dist/assets/{BarChart-26Ov3eDx.js → BarChart-CWDs7Ffl.js} +2 -2
- package/client/dist/assets/CodePage-AN1T4w99.js +2 -0
- package/client/dist/assets/{DesktopAnalyticsPage-BLioEDw-.js → DesktopAnalyticsPage-CPdWVhzT.js} +1 -1
- package/client/dist/assets/{DocsDialog-w7AelI_u.js → DocsDialog-C1MnXtzC.js} +2 -2
- package/client/dist/assets/DocsPage-BSqJ-G6V.js +11 -0
- package/client/dist/assets/{ExportDropdown-DlchZhDG.js → ExportDropdown-DpI605_7.js} +1 -1
- package/client/dist/assets/IntegrationsPage-KaZLo4KU.js +3 -0
- package/client/dist/assets/JobDetailPage-QN9NOcrX.js +16 -0
- package/client/dist/assets/JobsPage-C-fLmFs9.js +1 -0
- package/client/dist/assets/{dist-js-tJGlm77v.js → dist-js-EZlD2frS.js} +1 -1
- package/client/dist/assets/{dist-js-DaFKJPgY.js → dist-js-jOe3QgTk.js} +1 -1
- package/client/dist/assets/{index-Clyz7rFj.js → index-wK8zASrE.js} +46 -46
- package/client/dist/assets/{lib-B7C231WR.js → lib-CiLTp9yY.js} +1 -1
- package/client/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/dist/agent-refine-manager.js +54 -11
- package/server/dist/artifact-registry.js +83 -6
- package/server/dist/attachment-manager.js +16 -0
- package/server/dist/browser-capture-manager.js +33 -4
- package/server/dist/browser-network.js +35 -1
- package/server/dist/browser-playwright.js +112 -5
- package/server/dist/chat-manager.js +21 -0
- package/server/dist/code-explorer-router.js +22 -1
- package/server/dist/contract-refine-runner.js +87 -5
- package/server/dist/desktop-db.js +9 -1
- package/server/dist/desktop-router.js +111 -6
- package/server/dist/explore-stdin-session.js +43 -3
- package/server/dist/file-summary-manager.js +92 -7
- package/server/dist/framework-manager.js +56 -12
- package/server/dist/framework-migration.js +14 -2
- package/server/dist/index.js +28 -4
- package/server/dist/interactive-job-session.js +74 -18
- package/server/dist/jira/jira-adf.js +13 -2
- package/server/dist/jira/jira-backlog-config.js +4 -1
- package/server/dist/jira/jira-client.js +75 -9
- package/server/dist/jira/jira-sync-manager.js +34 -6
- package/server/dist/mobile/mobile-devices.js +78 -0
- package/server/dist/mobile/mobile-gateway.js +8 -1
- package/server/dist/mobile/mobile-redact.js +32 -2
- package/server/dist/mobile/mobile-router.js +25 -0
- package/server/dist/mobile/mobile-signal-reconnect.js +13 -3
- package/server/dist/mobile/mobile-webrtc-peer.js +28 -7
- package/server/dist/mobile/mobile-webrtc.js +13 -1
- package/server/dist/mobile/mobile-ws.js +18 -4
- package/server/dist/path-resolver.js +19 -2
- package/server/dist/plugin-manager.js +92 -31
- package/server/dist/proposal-manager.js +59 -8
- package/server/dist/queue-manager.js +179 -30
- package/server/dist/schemas/file-summary.v1.json +62 -0
- package/server/dist/smash-runner.js +49 -5
- package/server/dist/spec-launcher-manager.js +65 -8
- package/server/dist/ssrf-guard.js +142 -0
- package/server/dist/telemetry-receiver.js +28 -17
- package/server/dist/terminal-manager.js +4 -1
- package/server/dist/ticket-store.js +79 -10
- package/server/dist/user-mcp-config.js +5 -0
- package/server/dist/util/cli-prompt.js +21 -6
- package/server/dist/util/win-spawn.js +73 -10
- package/server/dist/webhook-manager.js +11 -0
- package/server/dist/workspace-manager.js +7 -3
- package/client/dist/assets/AgentsPage-BWzkbBYn.js +0 -86
- package/client/dist/assets/AnalyticsPage-CAyfZ8Yi.js +0 -1
- package/client/dist/assets/CodePage-V82YTNl3.js +0 -2
- package/client/dist/assets/DocsPage-vZcAHvLq.js +0 -11
- package/client/dist/assets/IntegrationsPage-CCyZ11D7.js +0 -3
- package/client/dist/assets/JobDetailPage-CaT9c75p.js +0 -16
- package/client/dist/assets/JobsPage-CoqWNWN1.js +0 -1
- package/client/dist/assets/useProjectCache-BJDa0Nwo.js +0 -1
- /package/client/dist/assets/{format-command-2VNoNnMv.js → format-command-CZsy-vHq.js} +0 -0
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
import{i as e,r as t}from"./index-
|
|
1
|
+
import{i as e,r as t}from"./index-wK8zASrE.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-wK8zASrE.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};
|