@kky42/pievo-server 2.1.0 → 2.3.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.
Files changed (89) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/LoopView-DjVHUyrR.js +59 -0
  3. package/.output/public/assets/{Modal-B3xpEtcf.js → Modal-CCRvx959.js} +1 -1
  4. package/.output/public/assets/{SignIn-9vsaKv_p.js → SignIn-Qxw5zDFq.js} +1 -1
  5. package/.output/public/assets/{actionUi-DDDfD0WX.js → actionUi-CXxhzYe2.js} +1 -1
  6. package/.output/public/assets/app-D1cij_NJ.css +2 -0
  7. package/.output/public/assets/{artifactView-BV-yQVrj.js → artifactView-Cd5wWPil.js} +1 -1
  8. package/.output/public/assets/index-BRN_CQ8U.js +12 -0
  9. package/.output/public/assets/{invite._token-5zhVSA26.js → invite._token-BIxr8DlP.js} +1 -1
  10. package/.output/public/assets/{invite._token-C3t4JfAY.js → invite._token-j2BTCeG1.js} +1 -1
  11. package/.output/public/assets/lifecycleUi-Qy_8beQK.js +1 -0
  12. package/.output/public/assets/{loopApi-C_Dtw-nL.js → loopApi-CT1mMhlb.js} +1 -1
  13. package/.output/public/assets/loops._loopId-BRBQzioy.js +4 -0
  14. package/.output/public/assets/loops._loopId_.runs._runId-CMnOJkem.js +3 -0
  15. package/.output/public/assets/{notifyFns-CF12Yboc.js → notifyFns-DYD4EKaG.js} +1 -1
  16. package/.output/public/assets/{preload-helper--VCqDT5m.js → preload-helper-DFkkpP6W.js} +1 -1
  17. package/.output/public/assets/{routes-DsdcURfk.js → routes-3nuEJGdo.js} +1 -1
  18. package/.output/public/assets/{routes-WVPuW976.js → routes-DORLim-C.js} +1 -1
  19. package/.output/public/assets/{t._teamId-BdVLnwih.js → t._teamId-F5f4K8kd.js} +1 -1
  20. package/.output/public/assets/{t._teamId-C9uEyAh_.js → t._teamId-XfE_S1Fo.js} +1 -1
  21. package/.output/public/assets/ui-Dhsx6SW0.js +1 -0
  22. package/.output/server/_libs/d3-shape.mjs +130 -1
  23. package/.output/server/_libs/react-is.mjs +48 -0
  24. package/.output/server/_libs/recharts+victory-vendor.mjs +2210 -782
  25. package/.output/server/_ssr/{DashboardView-DJMpoucm.mjs → DashboardView-BF7PciP7.mjs} +11 -8
  26. package/.output/server/_ssr/{LoopPlaybook-WFNer22Y.mjs → LoopPlaybook-DC7QVvPY.mjs} +2 -2
  27. package/.output/server/_ssr/{LoopView-Dsc6oik9.mjs → LoopView-DwSrm9Ja.mjs} +418 -224
  28. package/.output/server/_ssr/{Modal-Bc_5TYGr.mjs → Modal-MaCG52Pv.mjs} +2 -2
  29. package/.output/server/_ssr/{SignIn-2qr-vtR5.mjs → SignIn-RmpWm9uy.mjs} +3 -3
  30. package/.output/server/_ssr/{actionUi-BKF6xI3d.mjs → actionUi-BN55TNYE.mjs} +2 -2
  31. package/.output/server/_ssr/{adapters-Bwuh6uek.mjs → adapters-BoLkOf1T.mjs} +12 -6
  32. package/.output/server/_ssr/{artifactFiles-Cp1IBHne.mjs → artifactFiles-BCaIIrrT.mjs} +3 -3
  33. package/.output/server/_ssr/{artifactView-DX4P3Krh.mjs → artifactView-iuPsp5aa.mjs} +2 -2
  34. package/.output/server/_ssr/artifacts-jQ-bfdhI.mjs +2 -0
  35. package/.output/server/_ssr/{auth-uQ19WsD1.mjs → auth-30Z4lV1w.mjs} +9 -9
  36. package/.output/server/_ssr/{boot-DPoPmSLh.mjs → boot-3BNKujyp.mjs} +392 -193
  37. package/.output/server/_ssr/boot-CsEFT53K.mjs +2 -0
  38. package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-CqcLCApi.mjs → bun-sqlite-dialect-BW9W1_Ps-_7tfuNRi.mjs} +2 -2
  39. package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-AuWb61y8.mjs → d1-sqlite-dialect-BLC8LXE6-ucDUbeBk.mjs} +2 -2
  40. package/.output/server/_ssr/db-CXownd1H.mjs +2 -0
  41. package/.output/server/_ssr/{dist-CtYTvPCD.mjs → dist-Cd6nlLlO.mjs} +2 -2
  42. package/.output/server/_ssr/{factory-BtqxMS8a.mjs → factory-CWWwV7XZ.mjs} +2 -2
  43. package/.output/server/_ssr/{invite._token-DtAfQyfP.mjs → invite._token-BKlz0R2f.mjs} +5 -5
  44. package/.output/server/_ssr/{invite._token-BlbVjz-o.mjs → invite._token-CWl6kipD.mjs} +2 -2
  45. package/.output/server/_ssr/{invite._token-DBttmaDb.mjs → invite._token-SdWXemIc.mjs} +6 -6
  46. package/.output/server/_ssr/{kysely-adapter-bSpTlW7Z.mjs → kysely-adapter-C8iS51DB.mjs} +1 -1
  47. package/.output/server/_ssr/{lifecycleUi-Djb44Aj3.mjs → lifecycleUi-DgBQAYzp.mjs} +2 -1
  48. package/.output/server/_ssr/logger-Gy-47z3k.mjs +2 -0
  49. package/.output/server/_ssr/{loopApi-7MTSs6hy.mjs → loopApi-8_KgBapr.mjs} +6 -2
  50. package/.output/server/_ssr/{loopApi-BXRBFGWh.mjs → loopApi-ABi9SgWS.mjs} +23 -13
  51. package/.output/server/_ssr/{loops._loopId-6Q0DMXU0.mjs → loops._loopId-SON_t43g.mjs} +4 -4
  52. package/.output/server/_ssr/{loops._loopId-C0x0SE8F.mjs → loops._loopId-p1KWsvMM.mjs} +13 -18
  53. package/.output/server/_ssr/{loops._loopId_.runs._runId-CkM0-ckn.mjs → loops._loopId_.runs._runId-PUGBrD5q.mjs} +22 -16
  54. package/.output/server/_ssr/{loops._loopId_.runs._runId-BOJBJu_a.mjs → loops._loopId_.runs._runId-Ymy4lwee.mjs} +4 -4
  55. package/.output/server/_ssr/{machineFns-CQuvvdXx.mjs → machineFns-BZ9puxDt.mjs} +3 -3
  56. package/.output/server/_ssr/{node-sqlite-dialect-ZOyD6D7F.mjs → node-sqlite-dialect-D_3JmkMo.mjs} +2 -2
  57. package/.output/server/_ssr/{notifyFns-BOeYZDRp.mjs → notifyFns-BUCePuF3.mjs} +3 -3
  58. package/.output/server/_ssr/{notifyFns-UFZ2j7Fv.mjs → notifyFns-DuPR1zd7.mjs} +6 -6
  59. package/.output/server/_ssr/{router-jnPelPNh.mjs → router-Czxvra6l.mjs} +44 -37
  60. package/.output/server/_ssr/{routes-CXnbFjB_.mjs → routes-ClZEdsnB.mjs} +6 -6
  61. package/.output/server/_ssr/{routes-Bx0bRxt9.mjs → routes-ComqHvCL.mjs} +2 -2
  62. package/.output/server/_ssr/{routes-CMAUcUsZ.mjs → routes-D5jJJ-30.mjs} +5 -5
  63. package/.output/server/_ssr/runDiff--qLtU4FI.mjs +2 -0
  64. package/.output/server/_ssr/ssr.mjs +52 -48
  65. package/.output/server/_ssr/store-40eVzW1S.mjs +2 -0
  66. package/.output/server/_ssr/{t._teamId-Bsm4WrJl.mjs → t._teamId-BgHV_KFP.mjs} +6 -6
  67. package/.output/server/_ssr/{t._teamId-D9nCEa2h.mjs → t._teamId-DDERNgfn.mjs} +2 -2
  68. package/.output/server/_ssr/{t._teamId-36z-mmyw.mjs → t._teamId-DRJvKHZn.mjs} +5 -5
  69. package/.output/server/_ssr/{teamFns-DAx4a1z4.mjs → teamFns-Bp81UO-x.mjs} +3 -3
  70. package/.output/server/_ssr/{teamFns-BBIbatdZ.mjs → teamFns-bm82twd5.mjs} +2 -2
  71. package/.output/server/_ssr/tokens-CbfoRC_s.mjs +2 -0
  72. package/.output/server/_ssr/{ui-B6mE5-5v.mjs → ui-Ww2tTM2u.mjs} +9 -2
  73. package/.output/server/{_tanstack-start-manifest_v-5iQOchGB.mjs → _tanstack-start-manifest_v-DwKENYCN.mjs} +28 -28
  74. package/.output/server/index.mjs +114 -114
  75. package/package.json +1 -1
  76. package/.output/public/assets/LoopView-Pbp2YtUu.js +0 -55
  77. package/.output/public/assets/app-CStTBRt2.css +0 -2
  78. package/.output/public/assets/index-DT_reRxT.js +0 -12
  79. package/.output/public/assets/lifecycleUi-CMFw5Nlj.js +0 -1
  80. package/.output/public/assets/loops._loopId-6JlPOCsY.js +0 -4
  81. package/.output/public/assets/loops._loopId_.runs._runId-wFUMHN9w.js +0 -3
  82. package/.output/public/assets/ui-Gb1413-F.js +0 -1
  83. package/.output/server/_ssr/artifacts-9G_Ai7vO.mjs +0 -2
  84. package/.output/server/_ssr/boot-Zz5AJgfy.mjs +0 -2
  85. package/.output/server/_ssr/db-BMANvbZu.mjs +0 -2
  86. package/.output/server/_ssr/logger-CR1a0flR.mjs +0 -2
  87. package/.output/server/_ssr/runDiff-CDPvl_cY.mjs +0 -2
  88. package/.output/server/_ssr/store-DDOk2Ty_.mjs +0 -2
  89. package/.output/server/_ssr/tokens-7KEKpLnu.mjs +0 -2
@@ -1 +0,0 @@
1
- var e="Daemon upgrade required to stop a running process. Run `npm install -g @kky42/pievo@latest`, then `pievo daemon restart`.";function t(e){if(e.deleteRequestedAt!=null)return`deleting`;let t=e.runs.find(e=>e.running);return!e.enabled&&t?.cancelRequested?`stopping`:!e.enabled&&(e.running||t)?`paused-finishing`:e.enabled?`active`:`paused`}function n(e){return e===3?{supported:!0,label:`Daemon protocol 3 · Stop supported`}:{supported:!1,label:`Daemon protocol ${e??`unknown`} · upgrade required`}}function r(n){let r=t(n.summary),i=n.summary.runs.find(e=>e.running);if(i&&n.machine.daemonProtocol!==3)return e;if(r===`stopping`&&i&&!n.machine.online)return`Stopping · waiting for ${n.machine.name||`machine`}`;switch(r){case`deleting`:return`Deleting`;case`stopping`:return`Stopping`;case`paused-finishing`:return n.summary.pauseCause?.kind===`blocked`?`Paused — blocked · current run finishing`:n.summary.pauseCause?.kind===`owner`?`Paused by owner · current run finishing`:`Paused · current run finishing`;case`paused`:return n.summary.pauseCause?.kind===`blocked`?`Paused — blocked`:n.summary.pauseCause?.kind===`failure-streak`?`Paused automatically`:n.summary.pauseCause?.kind===`owner`?`Paused by owner`:`Paused`;case`active`:return`Active`}}export{r as i,n,t as r,e as t};
@@ -1,4 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeField-dOzyFQNH.js","assets/jsx-runtime-BseJUIpC.js","assets/LoopView-Pbp2YtUu.js","assets/Modal-B3xpEtcf.js","assets/loopApi-C_Dtw-nL.js","assets/ui-Gb1413-F.js","assets/artifactView-BV-yQVrj.js"])))=>i.map(i=>d[i]);
2
- import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";import{S as r,_ as i,b as a,h as o,i as s,o as c,r as ee,u as l,v as u,x as d,y as te}from"./loopApi-C_Dtw-nL.js";import{c as f,f as p,p as ne,t as re}from"./preload-helper--VCqDT5m.js";import{a as ie,o as ae,r as oe,s as se}from"./notifyFns-CF12Yboc.js";import{A as ce,D as le,M as ue,S as m,T as de,_ as h,b as fe,c as pe,d as g,g as me,i as he,j as _,l as ge,m as v,n as _e,o as y,p as b,r as x,s as ve,t as ye,v as S,w as C,x as be}from"./ui-Gb1413-F.js";import{i as xe,n as Se,r as Ce,t as we}from"./lifecycleUi-CMFw5Nlj.js";import{c as Te,r as w}from"./index-DT_reRxT.js";import{a as T,i as Ee,n as E,o as D,t as O}from"./artifactView-BV-yQVrj.js";import{t as De}from"./SignIn-9vsaKv_p.js";import{i as Oe,n as ke,r as Ae,t as je}from"./actionUi-DDDfD0WX.js";var k=t(e(),1);function Me(e){if(!e)return null;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n>0?t.slice(0,n):null}function Ne({loopId:e,loopName:t,instruction:n}){let r=n?.trim()||`Describe the change you want to make to this loop.`;return[`I want to adjust my Pievo loop "${t}" (loop id: ${e}).`,``,`The change I want:`,r,``,`Use the installed pievo CLI/skill to apply it: run \`pievo loops\` to find the loop, then \`pievo edit ${e} ...\` to make the change, and confirm the loop now reflects it. Ask me first if anything is unclear.`].join(`
3
- `)}var A=n(),j=e=>e.split(`/`).pop()||e;function M(e){let t=e.match(/\.([a-z0-9]+)$/i);return t?t[1].toLowerCase():`file`}function Pe({loopId:e,taskFile:t,taskFileContent:n,taskFileSyncedAt:r,running:i}){let[a,o]=(0,k.useState)(null),[s,ee]=(0,k.useState)(null),l=(0,k.useRef)(0),u=(0,k.useCallback)(async()=>{let t=++l.current;try{let n=await c({data:{loopId:e}});t===l.current&&o(n)}catch{t===l.current&&o(e=>e??[])}},[e]);(0,k.useEffect)(()=>{o(null),ee(null),u()},[e,u]),(0,k.useEffect)(()=>{let e=setInterval(()=>void u(),i?4e3:12e3);return()=>clearInterval(e)},[i,u]);let d=(0,k.useMemo)(()=>T(t,a??[]),[t,a]),te=s&&d.some(e=>e.path===s)?s:d[0]?.path??null,f=d.find(e=>e.path===te)??null,p=D(f);return(0,A.jsxs)(`section`,{id:`files`,className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`mb-2.5 flex items-end justify-between gap-3 border-b border-hairline pb-1.5`,children:[(0,A.jsxs)(`h2`,{className:`text-label font-semibold text-secondary`,children:[`Files`,a?` (${d.length})`:``]}),(0,A.jsx)(`span`,{className:`text-caption font-medium text-disabled`,children:`Spec + synced artifacts`})]}),d.length===0?(0,A.jsx)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 py-10 text-center text-body text-disabled shadow-card`,children:a==null?`Loading…`:`No files yet - the task file and synced artifacts appear here.`}):(0,A.jsxs)(`div`,{className:`grid h-[min(600px,68vh)] grid-cols-1 overflow-hidden rounded-card border border-hairline bg-surface shadow-card sm:grid-cols-[210px_1fr]`,children:[(0,A.jsx)(`nav`,{className:`max-h-44 overflow-y-auto border-b border-hairline sm:max-h-none sm:border-b-0 sm:border-r`,children:(0,A.jsx)(`ul`,{className:`py-1.5`,children:d.map(e=>{let t=e.path===te,n=D(e),r=!n&&e.kind===`artifact`?e.file.meta:null,i=r?.title?.trim()||``,a=i&&i!==j(e.path)?i:j(e.path),o=e.path.includes(`/`)||a!==j(e.path);return(0,A.jsx)(`li`,{children:(0,A.jsxs)(`button`,{type:`button`,onClick:()=>ee(e.path),className:`flex w-full items-center gap-2 border-l-2 px-3 py-2 text-left transition-colors ${t?`border-display bg-raised`:`border-transparent hover:bg-raised/60`}`,children:[(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`block truncate font-mono text-label ${t?`text-display`:`text-primary`}`,title:e.path,children:a}),o&&(0,A.jsx)(`span`,{className:`block truncate font-mono text-micro text-disabled`,title:e.path,children:e.path})]}),n?(0,A.jsx)(`span`,{className:`shrink-0 rounded-full bg-interactive-soft px-2 text-caption font-medium text-interactive`,children:`Task`}):r?.type?(0,A.jsx)(`span`,{className:`shrink-0 truncate rounded-full bg-raised px-2 text-caption font-medium text-secondary`,title:`type: ${r.type}`,children:r.type}):(0,A.jsx)(`span`,{className:`shrink-0 font-mono text-micro text-disabled`,children:M(e.path)})]})},e.path)})})}),(0,A.jsx)(`div`,{className:`min-w-0 overflow-y-auto`,children:p&&f?(0,A.jsx)(N,{path:f.path,content:n,syncedAt:r}):f?.kind===`artifact`?(0,A.jsx)(P,{loopId:e,file:f.file}):null})]})]})}function N({path:e,content:t,syncedAt:n}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{path:e,meta:n?`Task file · synced ${de(n)}`:`Task file`}),t==null?(0,A.jsx)(`div`,{className:`px-5 py-6 text-body text-disabled`,children:`(syncs from the machine on the next run)`}):(0,A.jsx)(Ee,{content:t})]})}function P({loopId:e,file:t}){let n=[t.size==null?``:le(t.size),`synced ${de(t.updatedAt)}`].filter(Boolean).join(` · `);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{path:t.path,meta:n}),(0,A.jsx)(O,{loopId:e,file:t})]})}var Fe=[`claude-code`,`codex`];function F(e){return{executor:`claude`,workdir:e.workdir.trim(),model:e.model.trim(),reasoningEffort:e.reasoningEffort.trim(),allowControl:e.allowControl}}var I=(0,k.lazy)(()=>re(()=>import(`./CodeField-dOzyFQNH.js`),__vite__mapDeps([0,1])));function L(e){let t=e?.exec;return{name:e?.name??``,cron:e?.cron??`0 */3 * * *`,scheduleMode:e?.scheduleMode??`cron`,continuousDelayMinutes:String(e?.continuousDelayMinutes??1),taskFile:e?.taskFile??``,notify:e?.notify??`auto`,channelId:e?.channelId??``,metricSchema:e?.metricSchema?JSON.stringify(e.metricSchema):``,ui:e?.ui??``,agent:e?.agent??`claude-code`,workdir:t?.workdir??``,model:t?.model??``,reasoningEffort:t?.reasoningEffort??``,allowControl:!!t?.allowControl}}var R=`mt-1 text-caption leading-snug text-disabled`,z={"claude-code":`Claude Code`,codex:`Codex`};function B({label:e,value:t,onChange:n,mono:r,ph:i,hint:a}){let o=(0,k.useId)();return(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`label`,{htmlFor:o,className:v,children:e}),(0,A.jsx)(`input`,{id:o,type:`text`,className:r?`${b} font-mono`:b,value:t,placeholder:i,onChange:e=>n(e.target.value)}),a&&(0,A.jsx)(`div`,{className:R,children:a})]})}function V({title:e,hint:t}){return(0,A.jsxs)(`div`,{className:`mb-1 mt-7 border-b border-hairline pb-1.5`,children:[(0,A.jsx)(`h2`,{className:h,children:e}),t&&(0,A.jsx)(`div`,{className:`mt-0.5 text-caption text-disabled`,children:t})]})}function H({minHeight:e}){return(0,A.jsx)(`div`,{className:`rounded-control border border-wire bg-raised`,style:{minHeight:e}})}var Ie=(0,k.forwardRef)(function({initial:e,channels:t},n){let[r,i]=(0,k.useState)(()=>L(e)),a=(e,t)=>i(n=>({...n,[e]:t})),[o,s]=(0,k.useState)(null),[c,ee]=(0,k.useState)([]),l=t??c;return(0,k.useEffect)(()=>{t||oe().then(ee).catch(()=>{})},[t]),(0,k.useImperativeHandle)(n,()=>({read(){let e,t=r.metricSchema.trim();if(t)try{e=JSON.parse(t)}catch{return s(`Not valid JSON - expected an array like [{"key":"mrr","label":"MRR","unit":"$"}]`),null}return{name:r.name.trim(),cron:r.cron.trim(),scheduleMode:r.scheduleMode,continuousDelayMinutes:Math.max(1,Number.parseInt(r.continuousDelayMinutes,10)||1),taskFile:r.taskFile.trim(),notify:r.notify,channelId:r.channelId||null,ui:r.ui.trim()||void 0,agent:r.agent,exec:F(r),metricSchema:e}}})),(0,A.jsxs)(`div`,{className:`grid gap-x-10 lg:grid-cols-[minmax(300px,380px)_minmax(0,1fr)]`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(V,{title:`Basics`}),(0,A.jsx)(B,{label:`Name`,value:r.name,onChange:e=>a(`name`,e)}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`label`,{className:v,children:`Schedule mode`}),(0,A.jsxs)(`select`,{"aria-label":`Schedule mode`,className:S,value:r.scheduleMode,onChange:e=>a(`scheduleMode`,e.target.value),children:[(0,A.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,A.jsx)(`option`,{value:`continuous`,children:`Continuous`})]}),r.scheduleMode===`cron`?(0,A.jsxs)(`div`,{className:`${b} flex cursor-default select-none items-center justify-between gap-2 bg-raised`,title:r.cron,children:[(0,A.jsx)(`span`,{className:`truncate text-primary`,children:fe(r.cron)}),(0,A.jsx)(`span`,{className:`shrink-0 font-mono text-caption text-secondary`,children:r.cron})]}):(0,A.jsx)(B,{label:`Delay after each exec (minutes)`,value:r.continuousDelayMinutes,onChange:e=>a(`continuousDelayMinutes`,e),mono:!0,hint:`At least 1 minute. Done and error continue; canceled runs do not.`}),(0,A.jsx)(`div`,{className:R,children:`Cron is retained while continuous mode is active, so switching back restores it.`})]}),(0,A.jsx)(B,{label:`Task file`,value:r.taskFile,onChange:e=>a(`taskFile`,e),mono:!0,hint:`Path of the markdown file this loop tracks/maintains on the machine (optional).`}),(0,A.jsx)(V,{title:`Notifications`}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`label`,{className:v,children:`Notify`}),(0,A.jsx)(`select`,{"aria-label":`Notify`,className:S,value:r.notify,onChange:e=>a(`notify`,e.target.value),children:[`auto`,`always`,`never`].map(e=>(0,A.jsx)(`option`,{children:e},e))}),(0,A.jsx)(`div`,{className:R,children:`auto pushes only when a run found something; never silences everything.`})]}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`label`,{className:v,children:`Push channel`}),(0,A.jsxs)(`select`,{"aria-label":`Push channel`,className:S,value:r.channelId,onChange:e=>a(`channelId`,e.target.value),children:[(0,A.jsx)(`option`,{value:``,children:`none (dashboard only)`}),l.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,A.jsx)(V,{title:`Execution`,hint:`Which coding agent on the machine runs this loop.`}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`label`,{className:v,children:`Coding agent`}),(0,A.jsx)(`select`,{"aria-label":`Coding agent`,className:S,value:r.agent,onChange:e=>a(`agent`,e.target.value),children:Fe.map(e=>(0,A.jsx)(`option`,{value:e,children:z[e]??e},e))}),(0,A.jsx)(`div`,{className:R,children:`Which coding agent executes this loop on the bound machine.`})]}),(0,A.jsx)(B,{label:`Working directory`,value:r.workdir,onChange:e=>a(`workdir`,e),mono:!0,ph:`/Users/you/Workspace/project`,hint:`Project root on the machine. Empty lets the daemon use a scratch directory.`}),(0,A.jsx)(B,{label:`Model`,value:r.model,onChange:e=>a(`model`,e),ph:`default`,hint:`Optional arbitrary model id. Empty uses the coding-agent CLI default.`}),(0,A.jsx)(B,{label:`Reasoning effort`,value:r.reasoningEffort,onChange:e=>a(`reasoningEffort`,e),ph:`default`,hint:`Optional arbitrary effort value. Empty uses the coding-agent CLI default.`}),(0,A.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-center gap-2 text-body text-primary`,children:[(0,A.jsx)(`input`,{type:`checkbox`,className:`accent-[color:var(--color-display)]`,checked:r.allowControl,onChange:e=>a(`allowControl`,e.target.checked)}),`Allow self-rescheduling`]})]}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(V,{title:`Agent-authored content`,hint:`Metrics and dashboard - usually written by evolve passes; edit by hand here when you know exactly what you want.`}),(0,A.jsx)(`label`,{className:v,children:`Metrics schema · JSON array`}),(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(H,{minHeight:`90px`}),children:(0,A.jsx)(I,{lang:`json`,value:r.metricSchema,onChange:e=>{a(`metricSchema`,e),s(null)},minHeight:`90px`,invalid:!!o,placeholder:`[{"key":"mrr","label":"MRR","unit":"$"},{"key":"paid"}]`})}),o?(0,A.jsx)(`div`,{className:`mt-1 text-caption leading-snug text-accent`,children:o}):(0,A.jsx)(`div`,{className:R,children:`Per-run metrics the agent reports; they feed the dashboard charts.`}),(0,A.jsx)(`label`,{className:v,children:`Dashboard template · HTML`}),(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(H,{minHeight:`240px`}),children:(0,A.jsx)(I,{lang:`html`,value:r.ui,onChange:e=>a(`ui`,e),minHeight:`240px`,placeholder:`<h3>{{latest.mrr}}$</h3>
4
- <loop-chart series="mrr:MRR:$"></loop-chart>`})}),(0,A.jsxs)(`div`,{className:R,children:[`Agent-authored HTML with `,`{{bindings}}`,` and loop-chart / loop-embed / loop-calendar / loop-kanban elements.`]})]})]})}),Le={"claude-code":`Claude Code`,codex:`Codex`},Re=[{label:`Change the schedule`,seed:`Change the schedule: `},{label:`Adjust what it does`,seed:`Change what this loop does: `},{label:`Improve the dashboard`,seed:`Improve the dashboard: `},{label:`Set an objective`,seed:`Give this loop a standing objective to optimize toward: `}],ze=(0,k.lazy)(()=>re(()=>import(`./LoopView-Pbp2YtUu.js`).then(e=>({default:e.LoopView})),__vite__mapDeps([2,1,3,4,5,6])));function U({id:e}){let t=ne(),[n,c]=(0,k.useState)(null),[f,re]=(0,k.useState)([]),[ae,le]=(0,k.useState)(null),[m,h]=(0,k.useState)(null),[g,_]=(0,k.useState)(!1),[v,b]=(0,k.useState)(!1),[S,C]=(0,k.useState)(``),[w,T]=(0,k.useState)(!1),[Ee,E]=(0,k.useState)(!1),[D,O]=(0,k.useState)(null),De=(0,k.useRef)(null),[j,M]=(0,k.useState)(!1),[N,P]=(0,k.useState)(null),[Fe,F]=(0,k.useState)(!1),[I,L]=Oe(),R=(0,k.useRef)(null),z=(0,k.useRef)(!1),[B,V]=(0,k.useState)([]),H=(0,k.useCallback)(async(n=!1)=>{try{let t=await l({data:e});c(t),z.current=t.summary.deleteRequestedAt!=null,le(null)}catch(e){z.current?t({to:`/`}):n||le(String(e))}},[e]);(0,k.useEffect)(()=>{c(null),_(!1),b(!1),C(``),T(!1),E(!1),O(null),F(!1),V([]),H(),oe().then(re).catch(()=>{})},[e,H]);let U=!!n?.summary.running;(0,k.useEffect)(()=>{if(g)return;let e=setInterval(()=>void H(!0),U||z.current?3e3:8e3);return()=>clearInterval(e)},[g,U,H]);async function W(){await H()}async function Ue(){h(null),P(`run`);try{let t=await a({data:e});if(t?.error)return h(`Run failed: ${t.error}`);L({label:t.coalesced?`Already queued`:`Queued`,hold:4e3}),await W()}finally{P(null)}}async function We(){h(null),P(`evolve`);try{let t=await s({data:e});if(t?.error)return h(`Evolve failed: ${t.error}`);L({label:t.coalesced?`Evolve already queued`:`Evolve queued`,hold:4e3}),await W()}finally{P(null)}}async function Ge(n){h(null),P(`lifecycle`);try{let i=n===`pause`?await u({data:e}):n===`start`?await d({data:e}):n===`stop`?await r({data:e}):await ee({data:e});if(i.error)return h(`${n[0].toUpperCase()+n.slice(1)} failed: ${i.error}`);if(F(!1),i.deleted){z.current=!1,t({to:`/`});return}n===`delete`&&(z.current=!0),await W(),L({label:n===`start`?`Started`:n===`pause`?`Paused`:n===`stop`?`Stop requested`:`Deleting`})}finally{P(null)}}async function Ke(){let t=R.current?.read();if(t){h(null),P(`save`);try{let n=await i({data:{id:e,patch:t}});if(n.error)return h(`Save failed: ${n.error}`);_(!1),await W(),L({label:`Saved`})}finally{P(null)}}}async function qe(){let t=S.trim();if(t){h(null),P(`steer`);try{let n=await te({data:{id:e,instruction:t}});if(n.error)return h(`Couldn't queue the steer pass: ${n.error}`);O(n.runId??null),E(!0),b(!1),C(``),await W()}finally{P(null)}}}let Je=(0,A.jsxs)(p,{to:`/`,className:`inline-flex items-center gap-1.5 text-meta font-medium text-secondary transition-colors hover:text-display`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Loops`]});if(ae)return(0,A.jsx)(Ve,{back:Je,children:(0,A.jsx)(Ae,{title:`Couldn't load this loop.`,detail:ae,onRetry:()=>void H()})});if(!n)return(0,A.jsx)(Ve,{back:Je,children:(0,A.jsx)(_e,{})});let{job:G,summary:K,runs:Ye}=n,Xe=!!G.ui,Ze=!!N,Qe=n.machine.online,q=n.machine.presence===`asleep`,$e=Qe?void 0:q?`Machine asleep - requests will stay queued until it wakes`:`Machine offline - requests will stay queued until it reconnects`,et=Ce(K),tt=xe(n),nt=Se(n.machine.daemonProtocol),rt=n.machine.name?`“${n.machine.name}”`:`the bound machine`,J=Ee&&D?Ye.find(e=>e.id===D):void 0,it=!!J&&!J.queued&&!J.running,at=()=>{E(!1),O(null)},ot=Me(G.taskFile),st=async()=>{try{await navigator.clipboard.writeText(Ne({loopId:e,loopName:K.name,instruction:S})),T(!0),setTimeout(()=>T(!1),4e3)}catch{h(`Could not copy the prompt - try again or copy it manually.`)}},ct=I&&(0,A.jsx)(`div`,{className:`mb-2.5`,children:(0,A.jsx)(ke,{label:I.label,tone:I.tone,onUndo:I.undo})}),Y=et===`deleting`,lt=!K.enabled&&!Y,ut=K.enabled&&!Y,X=Ze||Y,Z=ut||lt,dt=Z&&!!K.running&&nt.supported,ft=K.running&&!nt.supported?we:K.running?void 0:`No run is currently running`,pt=(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,A.jsx)(`button`,{className:ge,disabled:X||!Z,onClick:()=>void Ue(),title:Z?$e??(G.exec?`Spends credits`:void 0):`Unavailable for a deleting loop`,"aria-label":G.exec?`Run once - spends credits`:`Run once`,children:N===`run`?`Queuing…`:`Run once`}),(0,A.jsx)(`button`,{className:y,disabled:X||!Z,title:`Dispatch or copy a prompt for an owner-requested steer`,onClick:()=>b(!0),children:`Steer`}),(0,A.jsx)(`button`,{className:y,disabled:X||!Z,title:Z?$e??`Spends credits`:`Unavailable for a deleting loop`,onClick:()=>void We(),children:N===`evolve`?`Evolving…`:`Evolve once`}),(0,A.jsx)(`button`,{className:y,disabled:X,onClick:()=>_(!0),children:`Settings`}),(0,A.jsx)(`button`,{className:y,disabled:X||!lt,onClick:()=>void Ge(`start`),children:`Start`}),(0,A.jsx)(`button`,{className:y,disabled:X||!ut,onClick:()=>void Ge(`pause`),children:`Pause`}),(0,A.jsx)(`button`,{className:pe,disabled:X||!dt,title:ft,onClick:()=>void Ge(`stop`),children:`Stop`}),(0,A.jsx)(`button`,{className:pe,disabled:X,onClick:()=>F(!0),children:Y?`Deleting…`:`Delete`})]}),Fe&&!Y&&(0,A.jsx)(`div`,{className:`mt-3`,children:(0,A.jsx)(je,{prompt:`Stop this loop and delete its server data?`,note:`This stops the loop and deletes server history and synced artifacts. Local files are not deleted. If the machine is unreachable, server data is still deleted and its local process may continue running.`,cta:`Delete`,danger:!0,busy:Ze,onConfirm:()=>void Ge(`delete`),onCancel:()=>F(!1)})}),Y&&(0,A.jsx)(`div`,{className:`mt-3 rounded-md border border-wire bg-raised px-4 py-3 text-meta text-secondary`,children:`Deleting… graceful stop is waiting for execution authority to end.`}),v&&!Y&&(0,A.jsxs)(`div`,{className:`mt-4 border-t border-hairline pt-4`,onKeyDown:e=>{e.key===`Escape`&&N!==`steer`&&(e.stopPropagation(),b(!1))},children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,A.jsx)(`span`,{className:`text-body font-medium text-display`,children:`Steer with your coding agent`}),(0,A.jsxs)(`span`,{className:`text-meta text-secondary`,children:[`One agent pass on `,rt,` · spends credits`]})]}),(0,A.jsx)(`textarea`,{ref:De,autoFocus:!0,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&S.trim()&&N!==`steer`&&qe()},rows:3,placeholder:`e.g. run at 9am on weekdays instead, and also check coffee stock`,className:`mt-3 w-full resize-y rounded-control border border-wire bg-raised p-3 font-mono text-label leading-relaxed text-primary outline-none transition-shadow placeholder:text-disabled focus:border-transparent focus:shadow-focus`}),!S.trim()&&(0,A.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:Re.map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>{C(e.seed),De.current?.focus()},className:`cursor-pointer rounded-full border border-wire bg-surface px-3 py-1 text-label font-medium text-secondary transition-colors hover:bg-raised hover:text-display`,children:e.label},e.label))}),(0,A.jsxs)(`div`,{className:`mt-3.5 flex flex-wrap items-center gap-x-2.5 gap-y-2`,children:[(0,A.jsx)(`button`,{className:ve,disabled:N===`steer`||!S.trim(),title:$e,onClick:()=>void qe(),children:N===`steer`?`Dispatching…`:`Dispatch to your coding agent`}),(0,A.jsx)(`button`,{type:`button`,className:y,disabled:N===`steer`,onClick:()=>void st(),children:w?`✓ Prompt copied`:`Copy prompt`}),(0,A.jsx)(`button`,{className:y,disabled:N===`steer`,onClick:()=>b(!1),children:`Cancel`}),(0,A.jsx)(`span`,{className:`hidden text-caption text-disabled sm:inline`,children:`⌘↩ dispatch · esc cancel`})]}),(0,A.jsx)(`div`,{className:`mt-2 text-caption leading-snug text-disabled`,children:w?(0,A.jsxs)(`span`,{className:`text-secondary`,children:[`✓ Copied · run your coding agent`,` `,ot?(0,A.jsxs)(A.Fragment,{children:[`in `,(0,A.jsx)(`code`,{className:`break-all font-mono text-primary`,children:ot})]}):`in the loop’s local directory on this machine`,` `,`and paste the prompt to adjust the loop yourself.`]}):(0,A.jsx)(A.Fragment,{children:`Prefer to adjust it yourself? Copy prompt drops a ready-to-paste prompt for your own coding agent - no dispatch, no credits.`})})]})]}),mt=m&&(0,A.jsx)(ye,{message:m,onDismiss:()=>h(null),className:`mb-2.5`}),Q=n.team&&!n.team.isActive?n.team:null,ht=e=>{Te(e),t({to:`/t/$teamId`,params:{teamId:e}})},gt=Q&&(0,A.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-control border border-hairline bg-raised px-4 py-2.5`,children:[(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta font-medium text-secondary`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full bg-interactive`}),`Viewing a loop in `,Q.name]}),(0,A.jsx)(`span`,{className:`text-meta text-secondary`,children:`- not your active team.`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>ht(Q.id),className:`ml-auto cursor-pointer text-meta font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`Switch to this team`})]}),_t=n.machine.needsUpdate&&(0,A.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-control border border-warn/40 bg-warn/10 px-4 py-2.5`,children:[(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta font-medium text-primary`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full bg-warn`}),`Daemon update required`]}),(0,A.jsxs)(`span`,{className:`text-meta text-secondary`,children:[`This server requires v`,n.machine.requiredDaemonVersion,`; `,n.machine.name?`“${n.machine.name}”`:`the bound machine`,` reports `,n.machine.daemonVersion?`v${n.machine.daemonVersion}`:`an unknown version`,`. Queued work will wait.`]}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>M(!0),className:`ml-auto cursor-pointer text-meta font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`Update daemon`})]}),vt=!Qe&&(0,A.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-control border border-hairline bg-raised px-4 py-2.5`,children:[(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta font-medium text-secondary`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full ${q?`bg-rubik-yellow`:`bg-disabled`}`}),`Machine `,n.machine.name?`“${n.machine.name}” `:``,q?`seems to be asleep or offline`:`offline`]}),(0,A.jsxs)(`span`,{className:`text-meta text-secondary`,children:[q?`- queued work starts automatically when it reconnects.`:`- manual run, evolve, and steer requests remain safely queued.`,n.machine.lastSeen?` Last seen ${ce(n.machine.lastSeen)}.`:``]}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>M(!0),className:`ml-auto cursor-pointer text-meta font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`Reconnect`})]});if(g)return(0,A.jsxs)(Ve,{back:Je,children:[(0,A.jsx)(Be,{name:K.name,onBack:()=>_(!1)}),(0,A.jsxs)(`div`,{className:`mt-5 rounded-card border border-hairline bg-surface px-6 pb-6 pt-2 shadow-card`,children:[(0,A.jsx)(Ie,{ref:R,initial:G,channels:f}),(0,A.jsxs)(`div`,{className:`mt-7 border-t border-hairline pt-4`,children:[mt,(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[(0,A.jsx)(`button`,{className:ge,disabled:N===`save`,onClick:Ke,children:N===`save`?`Saving…`:`Save`}),(0,A.jsx)(`button`,{className:y,disabled:N===`save`,onClick:()=>_(!1),children:`Cancel`})]})]})]})]});let yt=Le[G.agent??`claude-code`]??G.agent??`Claude Code`,bt=G.exec?.model?.trim()||`default`,xt=G.exec?.reasoningEffort?.trim()||`default`,St=Ye[0],Ct=St?.reportIncident?St:void 0,$=(0,A.jsx)(`span`,{className:`text-wire`,children:`·`});return(0,A.jsxs)(Ve,{back:Je,children:[(0,A.jsxs)(`header`,{className:`rounded-card border border-hairline bg-surface px-6 pb-5 pt-[22px] shadow-card`,children:[(0,A.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-4`,children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`h1`,{className:`text-[28px] font-semibold leading-tight tracking-[-0.015em] text-display`,children:K.name}),(0,A.jsx)(x,{tone:et===`stopping`?`running`:void 0,dot:et===`stopping`?`pulse`:void 0,children:tt}),K.queued&&et===`active`?(0,A.jsx)(x,{tone:`outline`,children:`Queued`}):null,K.goal&&(0,A.jsx)(x,{tone:`success`,title:K.goal??void 0,children:`Objective`}),(0,A.jsx)(x,{tone:`outline`,title:`Recorded coding agent`,children:yt}),(0,A.jsx)(x,{tone:`outline`,title:`Model: ${bt}`,children:(0,A.jsxs)(`span`,{className:`max-w-72 truncate`,children:[`Model: `,bt]})}),(0,A.jsx)(x,{tone:`outline`,title:`Reasoning: ${xt}`,children:(0,A.jsxs)(`span`,{className:`max-w-72 truncate`,children:[`Reasoning: `,xt]})}),Q&&(0,A.jsx)(x,{tone:`outline`,title:`This loop belongs to another of your teams`,children:Q.name})]}),(0,A.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta text-secondary`,children:[(0,A.jsx)(`span`,{className:`text-primary`,title:G.cron,children:G.scheduleMode===`continuous`?`continuous · ${G.continuousDelayMinutes}m delay`:fe(G.cron)}),$,(0,A.jsxs)(`span`,{children:[`next `,de(K.nextRun)]}),K.nextRun&&K.enabled&&(0,A.jsxs)(`span`,{className:`text-disabled`,children:[`(`,ue(K.nextRun),`)`]}),$,(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:Qe?`Machine online`:q?`Machine asleep`:`Machine offline`,children:[(0,A.jsx)(`span`,{className:`size-1.5 rounded-full ${Qe?`bg-rubik-green`:q?`bg-rubik-yellow`:`bg-disabled`}`}),n.machine.name||`machine`]}),$,(0,A.jsx)(`span`,{title:`Breaking daemon/server lifecycle protocol`,children:nt.label}),$,(0,A.jsx)(`code`,{className:`font-mono text-label text-disabled`,children:K.id})]}),K.goal&&(0,A.jsxs)(`div`,{className:`mt-2 text-body leading-snug text-secondary`,children:[`Working toward: `,(0,A.jsx)(`span`,{className:`text-primary`,children:K.goal})]}),Ct?.reportIncident&&(0,A.jsx)(`div`,{className:`mt-2 text-body leading-snug text-secondary`,children:Ct.phase===`error`?`Last run failed · Terminal report rejected`:`Last run telemetry warning · Terminal report rejected`})]})}),(0,A.jsxs)(`div`,{className:`mt-5 border-t border-hairline pt-4`,children:[gt,_t,vt,mt,ct,pt]})]}),Ee&&(0,A.jsxs)(`section`,{className:`mt-6 rounded-card border border-hairline bg-surface px-6 py-5 shadow-card`,style:{animation:`fadeIn 0.2s ease-out`},"aria-live":`polite`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[!J||J.queued?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 text-body text-secondary`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full bg-disabled`}),(0,A.jsx)(`span`,{className:`font-medium text-primary`,children:`Steer queued`}),(0,A.jsxs)(`span`,{children:[`waiting for `,rt,` and higher-priority work…`]})]}):J.running?(0,A.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2.5 text-body text-secondary`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full`,style:me}),(0,A.jsx)(`span`,{className:`shrink-0 font-medium text-primary`,children:`Applying your steer`})]}):(0,A.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-body`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-2.5 shrink-0 rounded-[2px]`,style:{background:be(J)}}),(0,A.jsx)(`span`,{className:`font-medium`,style:{color:be(J)},children:J.canceled?`Steer canceled`:J.phase===`error`?`Steer failed`:`Steer applied`}),J.error&&(0,A.jsxs)(`span`,{className:`truncate text-secondary`,children:[`· `,J.error]})]}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-3.5`,children:[J&&(0,A.jsx)(p,{to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:J.id},className:`text-label font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`View run →`}),(0,A.jsx)(`button`,{type:`button`,onClick:at,className:`inline-flex cursor-pointer items-center gap-1.5 border-none bg-transparent p-0 text-meta font-medium text-secondary transition-colors hover:text-display`,children:it?`Done`:`Hide`})]})]}),it&&J.message&&(0,A.jsx)(`div`,{className:`mt-3.5`,children:(0,A.jsx)(he,{children:J.message})})]}),Xe&&(0,A.jsxs)(`section`,{className:`mt-6 min-w-0 rounded-card border border-hairline bg-surface px-6 py-5 shadow-card`,children:[(0,A.jsx)(`div`,{className:`mb-3.5 border-b border-hairline pb-1.5 text-label font-semibold text-secondary`,children:`Dashboard`}),(0,A.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(_e,{className:`py-4`}),children:(0,A.jsx)(ze,{html:G.ui,runs:Ye,loopId:e,taskFile:G.taskFile})})})]}),(0,A.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(300px,360px)]`,children:[(0,A.jsx)(Pe,{loopId:e,taskFile:G.taskFile,taskFileContent:n.taskFileContent,taskFileSyncedAt:n.taskFileSyncedAt,running:U}),(0,A.jsx)(He,{loopId:e,summary:K,runs:Ye,older:B,onMore:async()=>{let t=(B.length?se(K.runs??[],B):K.runs??[])[0];if(!t)return 0;let n=await o({data:{loopId:e,beforeTs:t.ts,limit:16}});return n.length&&V(e=>se(e,n)),n.length},onPickRun:n=>t({to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:n.id}})})]}),(0,A.jsx)(ie,{open:j,onClose:()=>M(!1)})]})}function Be({name:e,onBack:t}){return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`button`,{type:`button`,onClick:t,className:g,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to loop`]}),(0,A.jsxs)(`h1`,{className:`mt-2.5 text-[24px] font-semibold leading-tight tracking-[-0.015em] text-display`,children:[`Settings · `,e]}),(0,A.jsx)(`p`,{className:`mt-1.5 max-w-[640px] text-meta leading-snug text-secondary`,children:`Loop configuration, notifications, and push channel, saved directly - no agent pass or credits. For changes in plain words, use Steer instead.`})]})}function Ve({back:e,children:t}){return(0,A.jsxs)(`main`,{className:`mx-auto max-w-[1360px] px-8 pb-24 pt-10`,children:[(0,A.jsx)(`div`,{className:`mb-5`,children:e}),t]})}function He({loopId:e,summary:t,runs:n,older:r,onMore:i,onPickRun:a}){let o=(0,k.useMemo)(()=>r.length?se(t.runs??[],r):t.runs??[],[t.runs,r]);return(0,A.jsxs)(`section`,{className:`min-w-0`,children:[(0,A.jsx)(`div`,{className:`mb-2.5 flex items-end justify-between gap-3 border-b border-hairline pb-1.5`,children:(0,A.jsxs)(`h2`,{className:h,children:[`Runs (`,t.runCount,`)`]})}),t.runCount===0?(0,A.jsx)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 py-10 text-center text-body text-disabled`,children:`Never run`}):(0,A.jsxs)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 pb-4 pt-5 shadow-card`,children:[(0,A.jsx)(ae,{job:t,runs:o,total:t.runCount,onLoadMore:i,onPickRun:a}),(0,A.jsx)(`ul`,{className:`mt-5 max-h-[clamp(280px,46vh,520px)] divide-y divide-hairline overflow-y-auto border-t border-hairline`,children:n.map(t=>(0,A.jsx)(`li`,{children:(0,A.jsxs)(p,{to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:t.id},className:`flex items-start gap-2.5 py-2.5 transition-colors hover:bg-raised`,children:[(0,A.jsx)(`span`,{className:`mt-1 inline-block size-2.5 shrink-0 rounded-[2px]`,style:{background:be(t)},title:m(t),"aria-label":m(t)}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`span`,{className:`flex items-baseline justify-between gap-2`,children:[(0,A.jsx)(`span`,{className:`font-mono text-label text-secondary`,children:_(t.ts)}),(0,A.jsx)(`span`,{className:`shrink-0 font-mono text-caption text-disabled`,children:C(t.durationMs)})]}),(0,A.jsx)(`span`,{className:`mt-0.5 block`,children:t.queued?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta text-secondary`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-disabled`}),(0,A.jsx)(`span`,{children:`Queued`})]}):t.running?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta text-secondary`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full`,style:me}),(0,A.jsx)(`span`,{children:`Running`})]}):t.error?(0,A.jsx)(`span`,{className:`line-clamp-2 text-meta text-secondary`,children:t.error}):(0,A.jsx)(`span`,{className:`line-clamp-2 text-meta text-primary`,children:t.message||m(t)})})]})]})},t.id))})]})]})}function W(){let{loopId:e}=w.useParams(),{auth:t}=w.useLoaderData()??{auth:{enabled:!1}},{data:n,isPending:r}=f();return t?.enabled&&!r&&!n?(0,A.jsx)(De,{callbackURL:`/loops/${e}`}):(0,A.jsx)(U,{id:e})}export{W as component};
@@ -1,3 +0,0 @@
1
- import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";import{C as r,d as i,h as a,u as o}from"./loopApi-C_Dtw-nL.js";import{c as s,f as c}from"./preload-helper--VCqDT5m.js";import{D as l,E as u,T as d,_ as f,a as p,c as m,g as h,n as g,o as _,r as v,w as y}from"./ui-Gb1413-F.js";import"./lifecycleUi-CMFw5Nlj.js";import{t as b}from"./index-DT_reRxT.js";import{t as x}from"./SignIn-9vsaKv_p.js";import{r as S}from"./actionUi-DDDfD0WX.js";var C=t(e(),1);function w(e,t){return e.startsWith(`@@`)?{kind:`hunk`,text:e,gutter:``}:t?e.startsWith(`+`)?{kind:`add`,text:e.slice(1),gutter:`+`}:e.startsWith(`-`)?{kind:`del`,text:e.slice(1),gutter:`-`}:e.startsWith(` `)?{kind:`context`,text:e.slice(1),gutter:``}:{kind:`context`,text:e,gutter:``}:e.startsWith(`---`)||e.startsWith(`+++`)||e.startsWith(`diff `)||e.startsWith(`index `)||e.startsWith(`Index:`)||e.startsWith(`===`)?{kind:`meta`,text:e,gutter:``}:{kind:`context`,text:e,gutter:``}}function T(e){if(!e)return[];let t=e.endsWith(`
2
- `)?e.slice(0,-1):e,n=!1;return t.split(`
3
- `).map(e=>{let t=w(e,n);return t.kind===`hunk`&&(n=!0),t})}function E(e){let t=0,n=0;for(let r of e)r.kind===`add`?t++:r.kind===`del`&&n++;return{added:t,removed:n}}var D=n(),O={added:`Added`,modified:`Changed`,removed:`Removed`},k={added:`text-success`,modified:`text-secondary`,removed:`text-accent`};function A(e){return e==null||e===0?``:`${e>0?`+`:`−`}${l(e)}`}var j={add:`bg-[color:var(--color-diff-add-bg)] text-primary`,del:`bg-[color:var(--color-diff-del-bg)] text-primary`,hunk:`bg-[color:var(--color-diff-hunk-bg)] text-disabled`,meta:`text-disabled`,context:`text-secondary`},M={add:`text-success`,del:`text-accent`,hunk:`text-disabled`,meta:`text-disabled`,context:`text-disabled`};function N({lines:e}){return(0,D.jsx)(`div`,{className:`min-w-0 max-h-[420px] overflow-auto border-t border-hairline bg-raised font-mono text-label leading-[1.55]`,children:(0,D.jsx)(`div`,{className:`min-w-max`,children:e.map((e,t)=>(0,D.jsxs)(`div`,{className:`flex ${j[e.kind]}`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`w-6 shrink-0 select-none pl-2.5 text-center ${M[e.kind]}`,children:e.gutter}),(0,D.jsx)(`span`,{className:`whitespace-pre pr-4`,children:e.text||`\xA0`})]},t))})})}function P({f:e,lines:t}){let n=A(e.sizeDelta),r=t?E(t):null;return(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2.5 gap-y-1 text-meta`,children:[(0,D.jsx)(`span`,{className:`shrink-0 text-caption font-medium ${k[e.status]}`,children:O[e.status]}),(0,D.jsx)(`span`,{className:`min-w-0 break-all font-mono text-primary`,children:e.path}),r&&(r.added>0||r.removed>0)&&(0,D.jsxs)(`span`,{className:`shrink-0 font-mono text-caption`,children:[r.added>0&&(0,D.jsxs)(`span`,{className:`text-success`,children:[`+`,r.added]}),r.added>0&&r.removed>0&&` `,r.removed>0&&(0,D.jsxs)(`span`,{className:`text-accent`,children:[`−`,r.removed]})]}),n&&(0,D.jsx)(`span`,{className:`shrink-0 font-mono text-caption text-disabled`,children:n}),e.binary&&(0,D.jsx)(`span`,{className:`shrink-0 text-caption text-secondary`,children:`Binary`}),e.tooLarge&&(0,D.jsx)(`span`,{className:`shrink-0 text-caption text-secondary`,children:`Too large to diff`})]})}var F=40;function I({files:e}){return(0,D.jsx)(`div`,{className:`space-y-1.5`,children:e.map(e=>{if(!e.diff)return(0,D.jsx)(`div`,{className:`rounded-control border border-hairline bg-surface px-3.5 py-2`,children:(0,D.jsx)(P,{f:e,lines:null})},e.path);let t=T(e.diff);return(0,D.jsxs)(`details`,{open:t.length<=F,className:`group min-w-0 overflow-hidden rounded-control border border-hairline bg-surface`,children:[(0,D.jsxs)(`summary`,{className:`flex cursor-pointer select-none items-center gap-2 px-3.5 py-2 marker:content-['']`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-micro text-disabled transition-transform group-open:rotate-90`,children:`▸`}),(0,D.jsx)(P,{f:e,lines:t})]}),(0,D.jsx)(N,{lines:t})]},e.path)})})}function L({label:e,count:t,children:n}){return(0,D.jsxs)(`section`,{className:`min-w-0 rounded-card border border-hairline bg-surface px-6 py-5 shadow-card`,children:[(0,D.jsxs)(`div`,{className:`mb-3.5 border-b border-hairline pb-1.5 ${f}`,children:[e,t!=null&&(0,D.jsxs)(`span`,{className:`text-disabled`,children:[` (`,t,`)`]})]}),n]})}function R({k:e,children:t}){return(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`div`,{className:`mb-0.5 text-label font-medium text-secondary`,children:e}),(0,D.jsx)(`div`,{className:`min-w-0 text-body text-primary`,children:t})]})}function z({run:e}){let[t,n]=(0,C.useState)(null);return(0,C.useEffect)(()=>{if(e.queued||e.running)return;let t=!0;return i({data:{runId:e.id}}).then(e=>t&&n(e)).catch(()=>t&&n({hasSnapshot:!1,files:[]})),()=>{t=!1}},[e.id,e.queued,e.running]),e.queued||e.running?(0,D.jsx)(L,{label:`Changes`,children:(0,D.jsx)(`div`,{className:`text-body text-disabled`,children:`File changes appear once the run finishes.`})}):t?t.hasSnapshot?(0,D.jsx)(L,{label:`Changes`,count:t.files.length,children:t.files.length===0?(0,D.jsx)(`div`,{className:`text-body text-disabled`,children:`No files changed since the previous run.`}):(0,D.jsx)(I,{files:t.files})}):(0,D.jsx)(L,{label:`Changes`,children:(0,D.jsx)(`div`,{className:`text-body text-disabled`,children:`No file snapshot was recorded for this run.`})}):(0,D.jsx)(L,{label:`Changes`,children:(0,D.jsx)(g,{})})}function B({run:e}){let t=y(Math.max(0,Date.now()-Date.parse(e.ts)));return(0,D.jsx)(L,{label:`Activity`,children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5 text-body text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:h}),(0,D.jsxs)(`span`,{children:[`Run in progress`,t?` for ${t}`:``,`.`]})]})})}function V({id:e}){let[t,n]=(0,C.useState)(!1);return(0,D.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard?.writeText(e),n(!0),setTimeout(()=>n(!1),1200)},title:`Copy session id`,className:`inline-flex max-w-full cursor-pointer items-center gap-1.5 border-none bg-transparent p-0 text-left font-mono text-label text-secondary transition-colors hover:text-display`,children:[(0,D.jsx)(`span`,{className:`truncate`,children:e}),(0,D.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-micro text-disabled`,children:t?`✓ copied`:`copy`})]})}var H=64;function U({loopId:e,runId:t}){let[n,i]=(0,C.useState)(null),[s,l]=(0,C.useState)(null),[f,h]=(0,C.useState)(!1),[b,x]=(0,C.useState)(null),w=(0,C.useCallback)(async()=>{try{i(await o({data:e})),x(null)}catch(e){x(String(e))}},[e]),T=(0,C.useCallback)(async()=>{try{i(await o({data:e}))}catch{}},[e]);(0,C.useEffect)(()=>{i(null),l(null),h(!1),x(null),w()},[e,t,w]);let E=n?.runs.find(e=>e.id===t)??s;(0,C.useEffect)(()=>{if(!n||E||f)return;let r=!0;return(async()=>{try{let i=n.runs.length?n.runs[n.runs.length-1].ts:new Date().toISOString();for(let n=0;n<H&&r;n++){let n=await a({data:{loopId:e,beforeTs:i,limit:100}});if(!n.length)break;let o=n.find(e=>e.id===t);if(o){r&&l(o);return}i=n[0].ts}}finally{r&&h(!0)}})(),()=>{r=!1}},[n,E,f,e,t]);let O=!!(E?.queued||E?.running);(0,C.useEffect)(()=>{if(!O)return;let e=setInterval(()=>void T(),3e3);return()=>clearInterval(e)},[O,T]);async function k(){if(!E||!confirm(`Stop this run? If it is running, Pievo will ask the daemon to terminate it.`))return;let e=await r({data:E.id});if(e?.error){alert(`Stop failed: ${e.error}`);return}await w()}if(b)return(0,D.jsx)(S,{title:`Couldn't load this run.`,detail:b,onRetry:()=>void w()});if(!n||!E&&!f)return(0,D.jsx)(g,{});if(!E)return(0,D.jsxs)(`div`,{className:`rounded-card border border-hairline bg-surface px-6 py-10 text-center shadow-card`,children:[(0,D.jsx)(`div`,{className:`text-[14px] text-secondary`,children:`This run is no longer available.`}),(0,D.jsx)(c,{to:`/loops/$loopId`,params:{loopId:e},className:`mt-3 inline-block text-label font-medium text-interactive underline underline-offset-2 hover:text-display`,children:`← Back to the loop`})]});let A=n.summary.name,j=E.role||null;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`header`,{className:`rounded-card border border-hairline bg-surface px-6 pb-5 pt-[22px] shadow-card`,children:[(0,D.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-4`,children:(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,D.jsxs)(`h1`,{className:`text-[26px] font-medium leading-tight tracking-tight text-display`,children:[`Run · `,A]}),(0,D.jsx)(p,{run:E,colorText:!0})]}),(0,D.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-x-2.5 gap-y-1.5 text-meta text-secondary`,children:[(0,D.jsx)(`span`,{className:`text-primary`,children:d(E.ts)}),(0,D.jsx)(`span`,{className:`text-wire`,children:`·`}),j&&(0,D.jsx)(v,{children:j}),E.durationMs!=null&&(0,D.jsx)(v,{tone:`ink`,children:y(E.durationMs)}),(0,D.jsx)(`code`,{className:`font-mono text-disabled`,children:E.id})]})]})}),(0,D.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2.5 border-t border-hairline pt-4`,children:[(0,D.jsx)(c,{to:`/loops/$loopId`,params:{loopId:e},className:_,children:`View the whole loop →`}),(E.queued||E.running)&&(0,D.jsx)(`button`,{type:`button`,onClick:k,className:m,disabled:!!E.running&&n.machine.daemonProtocol!==3,title:E.running&&n.machine.daemonProtocol!==3?"Daemon upgrade required to stop a running process. Run `npm install -g @kky42/pievo@latest`, then `pievo daemon restart`.":void 0,children:`Stop run`})]})]}),(0,D.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(300px,360px)]`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[E.queued?(0,D.jsx)(L,{label:`Activity`,children:(0,D.jsx)(`div`,{className:`text-body text-secondary`,children:`Queued; it starts when this loop is free and the machine polls.`})}):E.running?(0,D.jsx)(B,{run:E}):null,E.reportIncident&&(0,D.jsx)(L,{label:`Terminal report rejected`,children:(0,D.jsxs)(`div`,{className:`space-y-3 text-body text-primary`,children:[(0,D.jsx)(`div`,{className:`font-medium`,children:E.reportIncident.code}),(0,D.jsx)(`div`,{className:`break-words text-secondary`,children:E.reportIncident.reason}),(0,D.jsxs)(`dl`,{className:`grid min-w-0 grid-cols-[max-content_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-label`,children:[(0,D.jsx)(`dt`,{className:`text-secondary`,children:`Fault domain`}),(0,D.jsx)(`dd`,{children:E.reportIncident.faultDomain}),(0,D.jsx)(`dt`,{className:`text-secondary`,children:`Recommended action`}),(0,D.jsx)(`dd`,{className:`break-words`,children:E.reportIncident.recommendedAction}),(0,D.jsx)(`dt`,{className:`text-secondary`,children:`Report ID`}),(0,D.jsx)(`dd`,{className:`break-all font-mono`,children:E.reportIncident.reportId})]})]})}),E.message&&(0,D.jsx)(L,{label:`Report`,children:(0,D.jsx)(`div`,{className:`whitespace-pre-wrap break-words rounded-control border border-hairline bg-raised px-4 py-3.5 text-body leading-relaxed text-primary`,children:E.message})}),(0,D.jsx)(z,{run:E}),E.control&&E.control.length>0&&(0,D.jsx)(L,{label:`Control actions`,count:E.control.length,children:(0,D.jsx)(`ul`,{className:`space-y-1.5`,children:E.control.map((e,t)=>(0,D.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 font-mono text-label`,children:[(0,D.jsx)(`span`,{className:`text-display`,children:e.command}),(0,D.jsx)(`span`,{className:`min-w-0 break-all text-secondary`,children:JSON.stringify(e.args)}),(0,D.jsx)(`span`,{"aria-hidden":!0,className:`text-wire`,children:`→`}),(0,D.jsx)(`span`,{className:`text-primary`,children:e.result}),e.detail&&(0,D.jsxs)(`span`,{className:`text-disabled`,children:[`(`,e.detail,`)`]})]},t))})}),E.finalText&&(0,D.jsx)(L,{label:`Final output`,children:(0,D.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-body text-primary`,children:E.finalText})})]}),(0,D.jsx)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:(0,D.jsx)(L,{label:`Details`,children:(0,D.jsxs)(`div`,{className:`space-y-3.5`,children:[E.status&&(0,D.jsx)(R,{k:`Status`,children:E.status}),E.durationMs!=null&&(0,D.jsx)(R,{k:`Duration`,children:y(E.durationMs)}),E.exitCode!=null&&(0,D.jsx)(R,{k:`Exit code`,children:E.exitCode}),E.usage&&(0,D.jsx)(R,{k:`Token usage`,children:(0,D.jsxs)(`span`,{className:`text-disabled`,children:[u((E.usage.inputTokens??0)+(E.usage.cacheReadTokens??0)+(E.usage.cacheCreationTokens??0)),` in · `,u(E.usage.outputTokens??0),` out`]})}),E.metrics!=null&&(0,D.jsx)(R,{k:`Run metrics`,children:(0,D.jsx)(`code`,{className:`block break-all font-mono text-label text-secondary`,children:JSON.stringify(E.metrics)})}),E.error&&(0,D.jsx)(R,{k:`Error`,children:(0,D.jsx)(`span`,{className:`break-words`,style:{color:`var(--color-run-error)`},children:E.error})}),E.sessionId&&(0,D.jsx)(R,{k:`Session`,children:(0,D.jsx)(V,{id:E.sessionId})})]})})})]})]})}function W(){let{loopId:e,runId:t}=b.useParams(),{auth:n}=b.useLoaderData()??{auth:{enabled:!1}},{data:r,isPending:i}=s();return(0,D.jsxs)(`main`,{className:`mx-auto max-w-[1360px] px-8 pb-24 pt-10`,children:[(0,D.jsx)(`div`,{className:`mb-5`,children:(0,D.jsxs)(c,{to:`/loops/$loopId`,params:{loopId:e},className:`inline-flex items-center gap-1.5 text-label font-medium text-secondary transition-colors hover:text-display`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to loop`]})}),n?.enabled&&!i&&!r?(0,D.jsx)(x,{callbackURL:`/loops/${e}/runs/${t}`}):(0,D.jsx)(U,{loopId:e,runId:t})]})}export{W as component};
@@ -1 +0,0 @@
1
- import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";var r=t(e(),1),i=e=>e?new Date(e).toLocaleString():`—`,a=e=>{if(!e)return``;let t=Math.round((Date.now()-Date.parse(e))/1e3);if(t<60)return`${t}s ago`;let n=Math.round(t/60);if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`},o=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function s(e){let t=(e||``).trim().split(/\s+/);if(t.length!==5)return e;let[n,r,i,a,s]=t,c=i===`*`&&a===`*`,l=r.match(/^\*\/(\d+)$/);if(l&&c&&s===`*`)return`every ${l[1]}h`;let u=n.match(/^\*\/(\d+)$/);if(u&&r===`*`&&c&&s===`*`)return`every ${u[1]}m`;if(r===`*`&&/^\d+$/.test(n)&&c&&s===`*`)return`hourly :${n.padStart(2,`0`)}`;if(/^\d+$/.test(n)&&/^\d+$/.test(r)&&c){let e=`${r.padStart(2,`0`)}:${n.padStart(2,`0`)}`;if(s===`*`)return`daily ${e}`;if(/^[0-6]$/.test(s))return`${o[Number(s)]} ${e}`}return e}var c=e=>{if(!e)return``;let t=Math.round((Date.parse(e)-Date.now())/1e3);if(t<=0)return`due`;let n=Math.round(t/60);if(n<60)return`in ${n}m`;let r=Math.round(n/60);return r<24?`in ${r}h`:`in ${Math.round(r/24)}d`},l=e=>{let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()}`},u=e=>{if(!e)return`—`;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getMonth()+1)}/${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`},d=e=>Math.abs(e)>=1e3?`${Math.round(e/100)/10}k`:`${Math.round(e*100)/100}`,f=e=>e?`${Math.round(e/1e3)}s`:``;function p(e){let t=Math.abs(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}var m={kept:{c:`var(--color-run-kept)`,label:`Kept`},"no-change":{c:`var(--color-run-no-change)`,label:`No change`},blocked:{c:`var(--color-run-blocked)`,label:`Blocked`},error:{c:`var(--color-run-error)`,label:`Error`},warning:{c:`var(--color-run-warning)`,label:`Missing status`},canceled:{c:`var(--color-run-canceled)`,label:`Canceled`},queued:{c:`var(--color-run-queued)`,label:`Queued`},"active-exec":{c:`var(--color-run-active-exec)`,label:`Running…`},"active-steer":{c:`var(--color-run-active-steer)`,label:`Steering…`},"active-evolve":{c:`var(--color-run-active-evolve)`,label:`Evolving…`}},h=e=>e===`kept`||e===`no-change`||e===`blocked`?m[e]:void 0,g=e=>e.role===`steer`?`steer`:e.role===`evolve`?`evolve`:`exec`,_=e=>g(e)===`steer`?`Steered`:g(e)===`evolve`?`Improved`:`Kept`;function v(e){return e.running?m[`active-${g(e)}`].c:e.status===`blocked`?m.blocked.c:e.queued?m.queued.c:e.phase===`error`?m.error.c:e.canceled||e.phase===`canceled`?m.canceled.c:e.phase===`done`&&!h(e.status)?m.warning.c:(h(e.status)??m[`no-change`]).c}function y(e){return e.running||e.status===`blocked`||e.phase===`error`?1:e.queued?.7:e.canceled||e.phase===`canceled`?.5:e.phase===`done`&&!h(e.status)?.9:e.status===`no-change`?.55:1}function b(e){return e.queued?m.queued.label:e.running?e.cancelRequested?`Stopping…`:m[`active-${g(e)}`].label:e.status===`blocked`?m.blocked.label:e.phase===`error`?e.cancelRequested?`Failed while stopping`:m.error.label:e.canceled||e.phase===`canceled`?(e.error,`Canceled`):e.cancelRequested&&e.phase===`done`?`Succeeded while stopping`:e.status===`kept`?_(e):e.status===`no-change`?m[`no-change`].label:e.phase===`done`?m.warning.label:m[`no-change`].label}var x=e=>{let t=e.runs??[];return t.length?t[t.length-1]:null},S=n(),C=()=>()=>{},w=()=>(0,r.useSyncExternalStore)(C,()=>!0,()=>!1),T=`focus-visible:outline-none focus-visible:shadow-focus`,E=`inline-flex cursor-pointer items-center gap-1.5 rounded-control px-4 py-2 text-body font-medium transition-colors duration-150 disabled:cursor-default disabled:opacity-40 ${T}`,D=`${E} border border-wire bg-surface text-primary hover:bg-raised`,O=`${E} border border-display bg-display text-paper hover:opacity-85`,k=`${E} border border-transparent bg-rubik-red text-white hover:opacity-85`,A=`${E} border border-display bg-transparent text-display hover:bg-[color:var(--color-display)]/8`,j=`inline-flex shrink-0 cursor-pointer items-center gap-1 rounded-full border border-wire bg-surface px-3 py-1 text-label font-medium text-primary transition-colors duration-150 hover:bg-raised disabled:cursor-default disabled:opacity-40 ${T}`,M=`inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full border border-display bg-display px-4 py-2 text-body font-medium text-paper transition-colors duration-150 hover:opacity-85 disabled:cursor-default disabled:opacity-40 ${T}`,N=`inline-flex cursor-pointer items-center gap-1.5 border-none bg-transparent p-0 text-meta font-medium text-secondary transition-colors hover:text-display`,P=`text-label font-semibold text-secondary`,F=`mb-1.5 mt-3 block text-label font-medium text-secondary`,I=`w-full rounded-control border border-wire bg-surface px-3 py-2.5 text-sm text-primary outline-none transition-shadow focus:border-transparent focus:shadow-focus`,L=`${I} lp-select cursor-pointer`,R={animation:`runPulse 1.1s ease-in-out infinite`},z={background:`var(--color-rubik-yellow)`,...R};function B({message:e,onDismiss:t,className:n=`mb-2`}){return(0,S.jsxs)(`div`,{className:`flex items-start gap-2 text-body text-accent ${n}`,children:[(0,S.jsx)(`span`,{className:`mt-[5px] size-2 shrink-0 rounded-full bg-rubik-red`,"aria-hidden":!0}),(0,S.jsx)(`span`,{children:e}),t&&(0,S.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto shrink-0 cursor-pointer border-none bg-transparent p-0 text-label text-secondary transition-colors hover:text-display`,children:`Dismiss`})]})}function V({children:e}){return(0,S.jsx)(`pre`,{className:`max-h-[300px] overflow-auto whitespace-pre-wrap rounded-control border border-hairline bg-raised px-4 py-3.5 font-mono text-meta leading-relaxed text-secondary`,children:e})}var H={neutral:`bg-raised text-secondary`,ink:`bg-raised text-primary`,outline:`border border-hairline text-secondary`,running:`bg-running-soft text-running`,success:`bg-success-soft text-success`,accent:`bg-accent-soft text-accent`,warn:`bg-warn-soft text-warn`};function U({tone:e=`neutral`,dot:t,title:n,children:r}){return(0,S.jsxs)(`span`,{title:n,className:`inline-flex h-[22px] items-center gap-1.5 rounded-full px-2.5 text-caption font-medium ${H[e]}`,children:[t&&(0,S.jsx)(`span`,{className:`size-1.5 rounded-full`,style:t===`pulse`?z:{background:`var(--color-rubik-green)`}}),r]})}function W({className:e=``}){return(0,S.jsx)(`div`,{className:`text-body text-disabled ${e}`,children:`Loading…`})}function G({run:e,colorText:t}){return(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,style:t?{color:v(e)}:void 0,children:[(0,S.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:v(e),opacity:y(e)}}),b(e)]})}export{a as A,y as C,p as D,d as E,c as M,x as O,b as S,i as T,P as _,G as a,s as b,k as c,N as d,j as f,z as g,R as h,V as i,u as j,l as k,O as l,F as m,W as n,D as o,I as p,U as r,A as s,B as t,M as u,L as v,f as w,v as x,w as y};
@@ -1,2 +0,0 @@
1
- import { f as SYNC_BODY_CAP, i as BLOB_CAP } from "./boot-DPoPmSLh.mjs";
2
- export { BLOB_CAP, SYNC_BODY_CAP };
@@ -1,2 +0,0 @@
1
- import { U as getArtifactSync, Y as getGateway, q as getCliGateway } from "./boot-DPoPmSLh.mjs";
2
- export { getArtifactSync, getCliGateway, getGateway };
@@ -1,2 +0,0 @@
1
- import { j as db } from "./boot-DPoPmSLh.mjs";
2
- export { db };
@@ -1,2 +0,0 @@
1
- import { kt as logger } from "./boot-DPoPmSLh.mjs";
2
- export { logger };
@@ -1,2 +0,0 @@
1
- import { x as computeRunDiff } from "./boot-DPoPmSLh.mjs";
2
- export { computeRunDiff };
@@ -1,2 +0,0 @@
1
- import { Q as getLoop } from "./boot-DPoPmSLh.mjs";
2
- export { getLoop };
@@ -1,2 +0,0 @@
1
- import { Bt as rememberConnectKey, Pt as mintDeviceToken } from "./boot-DPoPmSLh.mjs";
2
- export { mintDeviceToken, rememberConnectKey };