@holdpoint/live-daemon 0.1.0-alpha.3 → 0.1.0-alpha.5

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.
@@ -154,6 +154,10 @@ conditions:
154
154
  operator: file_contains
155
155
  path: package.json
156
156
  contains: '"test"'
157
+ - id: has-typecheck-script
158
+ operator: file_contains
159
+ path: package.json
160
+ contains: '"typecheck"'
157
161
 
158
162
  patterns:
159
163
  changelog-files: "(^|/)CHANGELOG\\\\.md$"
@@ -166,7 +170,7 @@ checks:
166
170
  cmd: "pnpm lint --max-warnings 0"
167
171
  - id: node-typecheck
168
172
  label: "TypeScript type check"
169
- conditionId: is-node
173
+ conditionId: has-typecheck-script
170
174
  cmd: "pnpm typecheck"
171
175
  - id: node-test
172
176
  label: "Unit tests (Node)"
@@ -325,9 +329,15 @@ checks:
325
329
  - id: no-todos
326
330
  label: "No TODO/FIXME left in changed code"
327
331
  cmd: >-
328
- ! grep -rEn "TODO|FIXME|HACK|XXX" --include="*.ts" --include="*.tsx"
329
- --include="*.js" --include="*.jsx" --include="*.py" --include="*.go"
330
- --include="*.rs" .
332
+ ! grep -rEn "TODO|FIXME|HACK|XXX"
333
+ --include="*.ts" --include="*.tsx"
334
+ --include="*.js" --include="*.jsx"
335
+ --include="*.py" --include="*.go" --include="*.rs"
336
+ --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.git
337
+ --exclude-dir=.next --exclude-dir=.turbo --exclude-dir=build
338
+ --exclude-dir=.venv --exclude-dir=venv --exclude-dir=__pycache__
339
+ --exclude-dir=target --exclude-dir=vendor
340
+ .
331
341
 
332
342
  # ── Holdpoint-internal ─────────────────────────────────────────────
333
343
  - id: holdpoint-suggest
@@ -388,4 +398,4 @@ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHid
388
398
  For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ry=`DialogDescriptionWarning`,iy=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ty(ry).contentName}}.`;return C.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},ay=Av,oy=Iv,sy=Rv,cy=Hv,ly=qv,uy=Yv,dy=Zv,fy=[{value:``,label:`Always (no filter)`},{value:`frontend`,label:`Frontend files`},{value:`backend`,label:`Backend / API files`},{value:`socket`,label:`WebSocket files`},{value:`visual`,label:`Visual / Storybook`},{value:`python`,label:`Python files`},{value:`go`,label:`Go files`},{value:`rust`,label:`Rust files`},{value:`java`,label:`Java / Kotlin files`},{value:`ruby`,label:`Ruby files`},{value:`database`,label:`Database / migrations`},{value:`prisma`,label:`Prisma schema`},{value:`testing`,label:`Test files`},{value:`infra`,label:`Infrastructure (Docker, Terraform, K8s)`},{value:`ci`,label:`CI / CD pipelines`},{value:`docs`,label:`Documentation`},{value:`structural`,label:`Structural / config files`}],py=fy.slice(1).map(e=>e.value),my={frontend:`border-blue-500/30 bg-blue-500/10 text-blue-400`,backend:`border-green-500/30 bg-green-500/10 text-green-400`,socket:`border-orange-500/30 bg-orange-500/10 text-orange-400`,visual:`border-pink-500/30 bg-pink-500/10 text-pink-400`,python:`border-amber-500/30 bg-amber-500/10 text-amber-400`,go:`border-cyan-500/30 bg-cyan-500/10 text-cyan-400`,rust:`border-red-500/30 bg-red-500/10 text-red-400`,java:`border-orange-400/30 bg-orange-400/10 text-orange-300`,ruby:`border-rose-500/30 bg-rose-500/10 text-rose-400`,database:`border-emerald-500/30 bg-emerald-500/10 text-emerald-400`,prisma:`border-purple-500/30 bg-purple-500/10 text-purple-400`,testing:`border-lime-500/30 bg-lime-500/10 text-lime-400`,infra:`border-stone-500/30 bg-stone-500/10 text-stone-400`,ci:`border-yellow-500/30 bg-yellow-500/10 text-yellow-400`,docs:`border-sky-500/30 bg-sky-500/10 text-sky-400`,structural:`border-violet-500/30 bg-violet-500/10 text-violet-400`},hy={frontend:`Frontend`,backend:`Backend`,socket:`WebSocket`,visual:`Visual`,python:`Python`,go:`Go`,rust:`Rust`,java:`Java / Kotlin`,ruby:`Ruby`,database:`Database`,prisma:`Prisma`,testing:`Tests`,infra:`Infrastructure`,ci:`CI / CD`,docs:`Docs`,structural:`Structural`};function gy(e){return my[e]??`border-sky-500/30 bg-sky-500/10 text-sky-400`}function _y(e){return hy[e]??e}function vy({children:e}){return(0,j.jsx)(`label`,{className:`mb-1.5 block text-xs font-medium text-stone`,children:e})}function yy(e){return(0,j.jsx)(`input`,{...e,className:`w-full rounded-md border border-node-border bg-canvas px-3 py-2 text-sm text-bone placeholder-stone/40 focus:border-accent focus:outline-none`})}function by(e){return(0,j.jsx)(`textarea`,{rows:4,...e,className:`w-full resize-none rounded-md border border-node-border bg-canvas px-3 py-2 font-mono text-sm text-bone placeholder-stone/40 focus:border-accent focus:outline-none`})}function xy(e){return(0,j.jsx)(`select`,{...e,className:`w-full rounded-md border border-node-border bg-canvas px-3 py-2 text-sm text-bone focus:border-accent focus:outline-none`})}function Sy({value:e,onChange:t}){return(0,j.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-node-border`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>t(`task`),className:`flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors ${e===`task`?`bg-green-500/20 text-green-400`:`text-stone hover:text-bone`}`,children:[(0,j.jsx)(me,{className:`h-3.5 w-3.5`}),`Automated (cmd)`]}),(0,j.jsx)(`div`,{className:`w-px bg-node-border`}),(0,j.jsxs)(`button`,{type:`button`,onClick:()=>t(`prompt`),className:`flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors ${e===`prompt`?`bg-amber-500/20 text-amber-400`:`text-stone hover:text-bone`}`,children:[(0,j.jsx)(ce,{className:`h-3.5 w-3.5`}),`Manual (prompt)`]})]})}function Cy({value:e,onChange:t}){let n=e!==``&&!py.includes(e);return(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsxs)(xy,{value:n?`__custom__`:e,onChange:r=>{let i=r.target.value;t(i===`__custom__`?n?e:``:i)},children:[fy.map(e=>(0,j.jsx)(`option`,{value:e.value,children:e.label},e.value)),(0,j.jsx)(`option`,{value:`__custom__`,children:`Custom regex…`})]}),n&&(0,j.jsx)(yy,{value:e,onChange:e=>t(e.target.value),placeholder:`e.g. \\.test\\.ts$`,className:`font-mono`})]})}function wy({open:e,onOpenChange:t,title:n,description:r,children:i}){return(0,j.jsx)(ay,{open:e,onOpenChange:t,children:(0,j.jsxs)(oy,{children:[(0,j.jsx)(sy,{className:`fixed inset-0 z-40 bg-black/60 backdrop-blur-sm`}),(0,j.jsxs)(cy,{className:`fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-xl border border-node-border bg-node p-6 shadow-2xl focus:outline-none`,children:[(0,j.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(ly,{className:`text-base font-semibold text-bone`,children:n}),r&&(0,j.jsx)(uy,{className:`mt-0.5 text-xs text-stone/70`,children:r})]}),(0,j.jsx)(dy,{className:`mt-0.5 shrink-0 rounded p-1 text-stone/70 hover:bg-node-border hover:text-bone`,children:(0,j.jsx)(ge,{className:`h-4 w-4`})})]}),i]})]})})}function Ty({open:e,onOpenChange:t,check:n}){let{updateCheck:r,deleteCheck:i}=zg(),[a,o]=C.useState(n.label),[s,c]=C.useState(n.cmd===void 0?`prompt`:`task`),[l,u]=C.useState(n.cmd??``),[d,f]=C.useState(n.prompt??``),[p,m]=C.useState(n.when??``),[h,g]=C.useState(n.conditionId??``),[_,v]=C.useState(!1);return C.useEffect(()=>{e&&(o(n.label),c(n.cmd===void 0?`prompt`:`task`),u(n.cmd??``),f(n.prompt??``),m(n.when??``),g(n.conditionId??``),v(!1))},[e,n]),(0,j.jsx)(wy,{open:e,onOpenChange:t,title:`Edit Check`,description:`ID: ${n.id}`,children:(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Label`}),(0,j.jsx)(yy,{value:a,onChange:e=>o(e.target.value),placeholder:`Check label…`,autoFocus:!0})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Type`}),(0,j.jsx)(Sy,{value:s,onChange:c})]}),s===`task`?(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Command`}),(0,j.jsx)(yy,{value:l,onChange:e=>u(e.target.value),placeholder:`pnpm test --run`,className:`font-mono`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-stone/50`,children:`Runs automatically — blocks on failure`})]}):(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Prompt`}),(0,j.jsx)(by,{value:d,onChange:e=>f(e.target.value),placeholder:`Describe what the agent must verify before finishing…`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`File filter (when)`}),(0,j.jsx)(Cy,{value:p,onChange:m})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(vy,{children:[`Condition ID `,(0,j.jsx)(`span`,{className:`text-stone/50`,children:`(optional)`})]}),(0,j.jsx)(yy,{value:h,onChange:e=>g(e.target.value),placeholder:`e.g. has-openapi`})]}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-t border-node-border pt-4`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>{if(!_){v(!0),setTimeout(()=>v(!1),3e3);return}i(n.id),t(!1)},className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${_?`bg-red-500 text-white`:`border border-red-500/30 text-red-400 hover:bg-red-500/10`}`,children:[(0,j.jsx)(he,{className:`h-3.5 w-3.5`}),_?`Confirm delete`:`Delete`]}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(dy,{className:`rounded-md border border-node-border px-3 py-1.5 text-sm text-stone hover:border-accent hover:text-white`,children:`Cancel`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>{let e={label:a};p&&(e.when=p),h&&(e.conditionId=h),s===`task`?e.cmd=l:e.prompt=d,r(n.id,e),t(!1)},disabled:!a.trim(),className:`rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40`,children:`Save`})]})]})]})})}function Ey({open:e,onOpenChange:t,initialType:n=`task`,initialWhen:r}){let{addCheck:i}=zg(),[a,o]=C.useState(``),[s,c]=C.useState(n),[l,u]=C.useState(``),[d,f]=C.useState(``),[p,m]=C.useState(r??``),[h,g]=C.useState(``);return C.useEffect(()=>{e&&(o(``),c(n),u(``),f(``),m(r??``),g(``))},[e,n,r]),(0,j.jsx)(wy,{open:e,onOpenChange:t,title:`Add Check`,children:(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Label`}),(0,j.jsx)(yy,{value:a,onChange:e=>o(e.target.value),placeholder:`Check label…`,autoFocus:!0})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Type`}),(0,j.jsx)(Sy,{value:s,onChange:c})]}),s===`task`?(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Command`}),(0,j.jsx)(yy,{value:l,onChange:e=>u(e.target.value),placeholder:`pnpm test --run`,className:`font-mono`})]}):(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`Prompt`}),(0,j.jsx)(by,{value:d,onChange:e=>f(e.target.value),placeholder:`Describe what the agent must verify before finishing…`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(vy,{children:`File filter (when)`}),(0,j.jsx)(Cy,{value:p,onChange:m})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(vy,{children:[`Condition ID `,(0,j.jsx)(`span`,{className:`text-stone/50`,children:`(optional)`})]}),(0,j.jsx)(yy,{value:h,onChange:e=>g(e.target.value),placeholder:`e.g. has-openapi`})]}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-node-border pt-4`,children:[(0,j.jsx)(dy,{className:`rounded-md border border-node-border px-3 py-1.5 text-sm text-stone hover:border-accent hover:text-white`,children:`Cancel`}),(0,j.jsxs)(`button`,{type:`button`,onClick:()=>{i({label:a,...p?{when:p}:{},...s===`task`?{cmd:l}:{prompt:d},...h?{conditionId:h}:{}}),t(!1)},disabled:!a.trim(),className:`flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,j.jsx)(ue,{className:`h-3.5 w-3.5`}),`Add Check`]})]})]})})}function Dy({check:e}){let[t,n]=C.useState(!1),r=e.cmd!==void 0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{"data-testid":`check-card`,className:`group relative overflow-hidden rounded-lg border bg-node transition-colors ${r?`border-green-500/25 hover:border-green-500/45`:`border-amber-500/25 hover:border-amber-500/45`}`,children:[(0,j.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1 ${r?`bg-green-500`:`bg-amber-500`}`}),(0,j.jsxs)(`div`,{className:`p-3 pl-4`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex items-start justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`text-sm font-medium leading-snug text-bone`,children:e.label}),(0,j.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,j.jsx)(`button`,{onClick:()=>n(!0),className:`rounded p-0.5 text-stone/50 opacity-0 transition-opacity hover:bg-node-border hover:text-bone group-hover:opacity-100`,title:`Edit check`,"aria-label":`Edit check`,children:(0,j.jsx)(le,{className:`h-3.5 w-3.5`})})})]}),r?(0,j.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,j.jsx)(me,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-green-500/50`}),(0,j.jsx)(`code`,{className:`break-all text-xs text-stone`,children:e.cmd})]}):(0,j.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,j.jsx)(ce,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500/50`}),(0,j.jsx)(`p`,{className:`line-clamp-3 text-xs text-stone`,children:e.prompt})]}),(0,j.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5`,children:[e.when&&(0,j.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-xs ${gy(e.when)}`,children:_y(e.when)}),e.conditionId&&(0,j.jsxs)(`span`,{className:`rounded border border-yellow-500/30 bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-400`,children:[`if: `,e.conditionId]}),(0,j.jsx)(`span`,{className:`ml-auto font-mono text-xs text-stone/40`,children:e.id})]})]})]}),(0,j.jsx)(Ty,{open:t,onOpenChange:n,check:e})]})}function Oy({when:e,checks:t,onAdd:n}){return(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`mb-2.5 flex items-center gap-2`,children:[e?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`rounded border px-2 py-0.5 text-xs font-medium ${gy(e)}`,children:_y(e)}),(0,j.jsx)(`span`,{className:`text-xs text-stone/40`,children:`files only`})]}):(0,j.jsx)(`span`,{className:`text-xs font-medium text-stone/60`,children:`Always`}),(0,j.jsx)(`div`,{className:`h-px flex-1 bg-node-border`}),(0,j.jsxs)(`button`,{onClick:n,className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-xs text-stone/50 hover:text-bone`,title:`Add check${e?` when: ${e}`:``}`,children:[(0,j.jsx)(ue,{className:`h-3 w-3`}),`Add`]})]}),(0,j.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:t.map(e=>(0,j.jsx)(Dy,{check:e},e.id))})]})}function ky({title:e,description:t,icon:n,accentClass:r,checks:i,onAdd:a}){let o=new Map;for(let e of i){let t=e.when??`__always__`;o.has(t)||o.set(t,[]),o.get(t).push(e)}return(0,j.jsxs)(`section`,{children:[(0,j.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-lg ${r}`,children:n}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-sm font-semibold text-bone`,children:e}),(0,j.jsx)(`p`,{className:`text-xs text-stone/50`,children:t})]})]}),(0,j.jsxs)(`button`,{onClick:()=>a(void 0),className:`flex shrink-0 items-center gap-1.5 rounded-md border border-accent/30 bg-accent/10 px-2.5 py-1.5 text-xs font-medium text-accent hover:bg-accent/20`,children:[(0,j.jsx)(ue,{className:`h-3 w-3`}),`Add`]})]}),(0,j.jsx)(`div`,{className:`space-y-5`,children:o.size===0?(0,j.jsx)(`p`,{className:`text-xs text-stone/40`,children:`No checks in this category yet.`}):[...o.entries()].map(([e,t])=>(0,j.jsx)(Oy,{when:e===`__always__`?void 0:e,checks:t,onAdd:()=>a(e===`__always__`?void 0:e)},e))})]})}function Ay(){let{config:e}=zg(),[t,n]=C.useState(null),r=e?.checks??[],i=e?.conditions??[],a=r.filter(e=>e.cmd!==void 0),o=r.filter(e=>e.prompt!==void 0);return r.length===0?(0,j.jsxs)(`div`,{className:`flex h-full items-center justify-center`,children:[(0,j.jsxs)(`div`,{className:`text-center`,children:[(0,j.jsx)(_e,{className:`mx-auto mb-3 h-10 w-10 text-stone/30`}),(0,j.jsx)(`p`,{className:`text-sm text-stone/70`,children:`No checks configured yet.`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-stone/50`,children:`Load a template from the toolbar or add your first check.`}),(0,j.jsxs)(`button`,{onClick:()=>n({type:`task`}),className:`mx-auto mt-4 flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:opacity-90`,children:[(0,j.jsx)(ue,{className:`h-3.5 w-3.5`}),`Add first check`]})]}),t&&(0,j.jsx)(Ey,{open:!0,onOpenChange:e=>!e&&n(null),initialType:t.type,...t.when===void 0?{}:{initialWhen:t.when}})]}):(0,j.jsxs)(`div`,{className:`w-full h-full overflow-y-auto bg-canvas p-6`,children:[(0,j.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-10`,children:[(0,j.jsx)(ky,{title:`Automated Checks`,description:`Commands that run automatically — the agent is blocked until all pass`,icon:(0,j.jsx)(me,{className:`h-4 w-4 text-green-400`}),accentClass:`bg-green-500/10`,checks:a,onAdd:e=>n({type:`task`,...e===void 0?{}:{when:e}})}),(0,j.jsx)(ky,{title:`Manual Checks`,description:`Instructions the agent must read and act on before finishing`,icon:(0,j.jsx)(fe,{className:`h-4 w-4 text-amber-400`}),accentClass:`bg-amber-500/10`,checks:o,onAdd:e=>n({type:`prompt`,...e===void 0?{}:{when:e}})}),i.length>0&&(0,j.jsxs)(`section`,{children:[(0,j.jsxs)(`div`,{className:`mb-3 flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-lg bg-yellow-500/10`,children:(0,j.jsx)(pe,{className:`h-4 w-4 text-yellow-400`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-sm font-semibold text-bone`,children:`Conditions`}),(0,j.jsx)(`p`,{className:`text-xs text-stone/50`,children:`Gate checks on project-level conditions (e.g. file exists)`})]})]}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-yellow-500/30 bg-yellow-500/10 px-2.5 py-1 text-xs text-yellow-300`,children:[(0,j.jsx)(`span`,{className:`font-mono font-semibold`,children:e.id}),(0,j.jsx)(`span`,{className:`text-yellow-600`,children:`·`}),(0,j.jsx)(`span`,{className:`text-yellow-400/80`,children:e.operator}),e.path&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`text-yellow-600`,children:`·`}),(0,j.jsx)(`span`,{className:`font-mono text-yellow-400/60`,children:e.path})]})]},e.id))})]})]}),t&&(0,j.jsx)(Ey,{open:!0,onOpenChange:e=>!e&&n(null),initialType:t.type,...t.when===void 0?{}:{initialWhen:t.when}})]})}function jy(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function My(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Ny({status:e}){switch(e){case`pass`:return(0,j.jsx)(D,{className:`h-4 w-4 text-green-400`});case`fail`:return(0,j.jsx)(te,{className:`h-4 w-4 text-red-400`});case`skip`:return(0,j.jsx)(A,{className:`h-4 w-4 text-stone/50`});case`shown`:return(0,j.jsx)(ae,{className:`h-4 w-4 text-amber-400`})}}function Py(e){switch(e){case`pass`:return`Passed`;case`fail`:return`Failed`;case`skip`:return`Skipped`;case`shown`:return`Shown to agent`}}function Fy({summary:e}){return(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.passed>0&&(0,j.jsxs)(`span`,{className:`flex items-center gap-1 rounded border border-green-500/30 bg-green-500/10 px-1.5 py-0.5 text-xs text-green-400`,children:[(0,j.jsx)(D,{className:`h-3 w-3`}),e.passed]}),e.failed>0&&(0,j.jsxs)(`span`,{className:`flex items-center gap-1 rounded border border-red-500/30 bg-red-500/10 px-1.5 py-0.5 text-xs text-red-400`,children:[(0,j.jsx)(te,{className:`h-3 w-3`}),e.failed]}),e.skipped>0&&(0,j.jsxs)(`span`,{className:`flex items-center gap-1 rounded border border-stone/30 bg-stone/10 px-1.5 py-0.5 text-xs text-stone`,children:[(0,j.jsx)(A,{className:`h-3 w-3`}),e.skipped]}),e.shown>0&&(0,j.jsxs)(`span`,{className:`flex items-center gap-1 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-400`,children:[(0,j.jsx)(ae,{className:`h-3 w-3`}),e.shown]})]})}function Iy({run:e}){let[t,n]=C.useState(!1),r=e.summary.failed>0;return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-lg border bg-node transition-colors ${r?`border-red-500/30`:`border-node-border`}`,children:[(0,j.jsxs)(`button`,{className:`flex w-full items-center gap-3 p-4 text-left hover:bg-node-border/30`,onClick:()=>n(e=>!e),"aria-expanded":t,children:[(0,j.jsx)(`div`,{className:`h-2.5 w-2.5 flex-shrink-0 rounded-full ${r?`bg-red-500`:`bg-green-500`}`}),(0,j.jsxs)(`div`,{className:`flex flex-1 flex-wrap items-center gap-2 min-w-0`,children:[e.shortSha?(0,j.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-sm text-bone`,children:[(0,j.jsx)(se,{className:`h-3.5 w-3.5 text-stone/50`}),e.shortSha]}):(0,j.jsx)(`span`,{className:`font-mono text-sm text-stone/50`,children:`uncommitted`}),(0,j.jsx)(Fy,{summary:e.summary}),(0,j.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-xs text-stone/50`,children:[(0,j.jsx)(ne,{className:`h-3 w-3`}),(0,j.jsx)(`span`,{title:My(e.timestamp),children:jy(e.timestamp)})]})]}),(0,j.jsx)(`svg`,{className:`h-4 w-4 flex-shrink-0 text-stone/40 transition-transform ${t?`rotate-180`:``}`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,j.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),t&&(0,j.jsxs)(`div`,{className:`border-t border-node-border p-4 pt-3 space-y-4`,children:[e.files.length>0&&(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 text-xs font-medium text-stone/60`,children:[(0,j.jsx)(oe,{className:`h-3.5 w-3.5`}),`Changed files (`,e.files.length,`)`]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[e.files.slice(0,20).map(e=>(0,j.jsx)(`span`,{className:`rounded border border-node-border bg-canvas px-1.5 py-0.5 font-mono text-xs text-stone/70`,children:e},e)),e.files.length>20&&(0,j.jsxs)(`span`,{className:`text-xs text-stone/40`,children:[`+`,e.files.length-20,` more`]})]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`p`,{className:`mb-2 text-xs font-medium text-stone/60`,children:[`Check results (`,e.results.length,`)`]}),(0,j.jsx)(`div`,{className:`space-y-1.5`,children:e.results.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(Ny,{status:e.status}),(0,j.jsx)(`span`,{className:`flex-1 text-sm text-bone`,children:e.label}),(0,j.jsx)(`span`,{className:`text-xs ${e.status===`pass`?`text-green-400`:e.status===`fail`?`text-red-400`:e.status===`shown`?`text-amber-400`:`text-stone/50`}`,children:Py(e.status)}),(0,j.jsx)(`span`,{className:`font-mono text-xs text-stone/30`,children:e.id})]}),e.status===`fail`&&e.output&&(0,j.jsx)(`pre`,{className:`ml-6 max-h-32 overflow-auto rounded bg-canvas p-2 font-mono text-xs text-red-300/80 whitespace-pre-wrap`,children:e.output.trim().split(`
389
399
  `).slice(0,15).join(`
390
400
  `)}),e.status===`skip`&&e.skipReason&&(0,j.jsx)(`p`,{className:`ml-6 text-xs text-stone/50`,children:e.skipReason})]},`${e.id}-${t}`))})]})]})]})}function Ly(){let[e,t]=C.useState(null),[n,r]=C.useState(!0),[i,a]=C.useState(null),o=C.useMemo(()=>new URLSearchParams(window.location.search).get(`project`),[]),s=o?`/__holdpoint/initial-reports?project=${encodeURIComponent(o)}`:`/__holdpoint/initial-reports`,c=C.useCallback(()=>{r(!0),a(null),fetch(s,{credentials:`include`}).then(e=>{if(e.status===404)return null;if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t(e),r(!1)}).catch(e=>{a(e instanceof Error?e.message:`Failed to load reports`),r(!1)})},[s]);if(C.useEffect(()=>{c()},[c]),n)return(0,j.jsx)(`div`,{className:`w-full flex h-full items-center justify-center`,children:(0,j.jsx)(de,{className:`h-6 w-6 animate-spin text-stone/40`})});if(i)return(0,j.jsx)(`div`,{className:`w-full flex h-full items-center justify-center`,children:(0,j.jsxs)(`div`,{className:`text-center`,children:[(0,j.jsx)(te,{className:`mx-auto mb-3 h-10 w-10 text-red-400/60`}),(0,j.jsx)(`p`,{className:`text-sm text-stone/70`,children:`Failed to load history`}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-stone/50`,children:i}),(0,j.jsxs)(`button`,{onClick:c,className:`mx-auto mt-4 flex items-center gap-1.5 rounded-md border border-node-border px-3 py-1.5 text-sm text-stone hover:border-accent hover:text-bone`,children:[(0,j.jsx)(de,{className:`h-3.5 w-3.5`}),`Retry`]})]})});let l=e?.runs??[];return l.length===0?(0,j.jsx)(`div`,{className:`w-full flex h-full items-center justify-center`,children:(0,j.jsxs)(`div`,{className:`text-center`,children:[(0,j.jsx)(se,{className:`mx-auto mb-3 h-10 w-10 text-stone/30`}),(0,j.jsx)(`p`,{className:`text-sm text-stone/70`,children:`No check runs recorded yet.`}),(0,j.jsxs)(`p`,{className:`mt-1 text-xs text-stone/50 max-w-xs`,children:[`Run`,` `,(0,j.jsx)(`code`,{className:`rounded bg-node-border px-1 py-0.5 font-mono`,children:`holdpoint check`}),` in your project — results will appear here.`]}),(0,j.jsxs)(`button`,{onClick:c,className:`mx-auto mt-4 flex items-center gap-1.5 rounded-md border border-node-border px-3 py-1.5 text-sm text-stone hover:border-accent hover:text-bone`,children:[(0,j.jsx)(de,{className:`h-3.5 w-3.5`}),`Refresh`]})]})}):(0,j.jsx)(`div`,{className:`w-full h-full overflow-y-auto bg-canvas p-6`,children:(0,j.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,j.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-base font-semibold text-bone`,children:`Check History`}),(0,j.jsxs)(`p`,{className:`mt-0.5 text-xs text-stone/50`,children:[l.length,` run`,l.length===1?``:`s`,` recorded`]})]}),(0,j.jsxs)(`button`,{onClick:c,className:`flex items-center gap-1.5 rounded-md border border-node-border px-3 py-1.5 text-sm text-stone hover:border-accent hover:text-bone`,title:`Refresh history`,children:[(0,j.jsx)(de,{className:`h-3.5 w-3.5`}),`Refresh`]})]}),(0,j.jsx)(`div`,{className:`space-y-3`,children:l.map((e,t)=>(0,j.jsx)(Iy,{run:e},`${e.sha??`uncommitted`}-${t}`))})]})})}function Ry(){let{loadFromYaml:e}=zg(),[t,n]=C.useState(`list`),r=C.useMemo(()=>new URLSearchParams(window.location.search).get(`project`),[]),i=r?`/__holdpoint/initial-yaml?project=${encodeURIComponent(r)}`:`/__holdpoint/initial-yaml`;return C.useEffect(()=>{fetch(i,{credentials:`include`}).then(e=>e.ok?e.text():null).then(t=>{t&&zg.getState().config===null&&e(t)}).catch(()=>{})},[i]),C.useEffect(()=>{},[]),(0,j.jsxs)(`div`,{className:`flex h-screen flex-col bg-canvas`,children:[(0,j.jsx)(Vg,{viewMode:t,onViewChange:n}),(0,j.jsx)(`div`,{className:`flex flex-1 overflow-hidden`,children:t===`list`?(0,j.jsx)(Ay,{}):(0,j.jsx)(Ly,{})})]})}ve.createRoot(document.getElementById(`root`)).render((0,j.jsx)(C.StrictMode,{children:(0,j.jsx)(Ry,{})}));
391
- //# sourceMappingURL=index-34-pmyiJ.js.map
401
+ //# sourceMappingURL=index-BWqskf4N.js.map