@kky42/pievo-server 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/app-vKFxjMMk.css +2 -0
- package/.output/public/assets/{index-C4UaIr-9.js → index-DSF-1ahT.js} +3 -3
- package/.output/public/assets/{invite._token-CnyCmLfD.js → invite._token-Cl9Oarnq.js} +1 -1
- package/.output/public/assets/loops._loopId-B-dYxc9i.js +4 -0
- package/.output/public/assets/{loops._loopId_.runs._runId-DTwSFHkl.js → loops._loopId_.runs._runId-DepMp3Me.js} +1 -1
- package/.output/public/assets/{routes-G3WYRyPN.js → routes-BB4aDC1D.js} +1 -1
- package/.output/public/assets/{t._teamId-CGv7Oq6A.js → t._teamId-D552b9PT.js} +1 -1
- package/.output/server/_ssr/{CodeField-tm4rr6G3.mjs → CodeField-B7oOmmwH.mjs} +3 -3
- package/.output/server/_ssr/{DashboardView-CmDqjCiq.mjs → DashboardView-D3E-zevQ.mjs} +3 -3
- package/.output/server/_ssr/{LoopPlaybook-BBn-xXpG.mjs → LoopPlaybook-DJlWGia5.mjs} +2 -2
- package/.output/server/_ssr/{LoopView-DdyJYOCY.mjs → LoopView-BtMANpb_.mjs} +2 -2
- package/.output/server/_ssr/{SignIn-RJN_0GFZ.mjs → SignIn-CjFonm71.mjs} +2 -2
- package/.output/server/_ssr/{adapters-CJUhP66K.mjs → adapters-vbuo_-wD.mjs} +3 -4
- package/.output/server/_ssr/{artifactFiles-zP43a-_v.mjs → artifactFiles-BGod8IWQ.mjs} +3 -3
- package/.output/server/_ssr/artifacts-CduiDAM2.mjs +2 -0
- package/.output/server/_ssr/{auth-D2SlCxwE.mjs → auth-Ca-um-e8.mjs} +9 -9
- package/.output/server/_ssr/{boot-BHTcCXzm.mjs → boot-C0f0HGCw.mjs} +1 -1
- package/.output/server/_ssr/{boot-aI3l2EYT.mjs → boot-CkFZynUz.mjs} +43 -191
- package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-B-3PhI3u.mjs → bun-sqlite-dialect-BW9W1_Ps-CG9VPNj0.mjs} +2 -2
- package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-Dm_NrETM.mjs → d1-sqlite-dialect-BLC8LXE6-DBf7xVin.mjs} +2 -2
- package/.output/server/_ssr/db-Cs0gnPZZ.mjs +2 -0
- package/.output/server/_ssr/{dist-DW3TO9NM.mjs → dist-CwI9FwLx.mjs} +2 -2
- package/.output/server/_ssr/{factory-Voe90MEY.mjs → factory-L3gsmDL7.mjs} +2 -2
- package/.output/server/_ssr/{invite._token-CeD9PCvh.mjs → invite._token-CN2p7Gt3.mjs} +4 -4
- package/.output/server/_ssr/{invite._token-D80GP0-u.mjs → invite._token-KLCPnHk-.mjs} +3 -3
- package/.output/server/_ssr/{kysely-adapter-DSLWmYjO.mjs → kysely-adapter-Czkfz-W-.mjs} +1 -1
- package/.output/server/_ssr/logger-Cj1GFV_8.mjs +2 -0
- package/.output/server/_ssr/{loopApi-ByX_X17-.mjs → loopApi-CVf9RC6s.mjs} +12 -13
- package/.output/server/_ssr/{loops._loopId-BODmoHPu.mjs → loops._loopId-CbuhuTAp.mjs} +11 -35
- package/.output/server/_ssr/{loops._loopId-u8Dr2J5f.mjs → loops._loopId-gNSxIQBe.mjs} +3 -3
- package/.output/server/_ssr/{loops._loopId_.runs._runId-DaKJdso2.mjs → loops._loopId_.runs._runId-0MahUyHy.mjs} +4 -4
- package/.output/server/_ssr/{loops._loopId_.runs._runId-kGL-CMG6.mjs → loops._loopId_.runs._runId-BptlCXat.mjs} +3 -3
- package/.output/server/_ssr/{machineFns-MMSoHs7N.mjs → machineFns-D5rQWyLl.mjs} +3 -3
- package/.output/server/_ssr/{node-sqlite-dialect-Y22MTyEv.mjs → node-sqlite-dialect-Dr9_QokR.mjs} +2 -2
- package/.output/server/_ssr/{notifyFns-Bmqhlrkc.mjs → notifyFns-BobPaLWi.mjs} +3 -3
- package/.output/server/_ssr/{notifyFns-CdrijMGW.mjs → notifyFns-c7ZY2TWF.mjs} +2 -2
- package/.output/server/_ssr/{router-CdxedJtm.mjs → router-B8JTBtGd.mjs} +29 -29
- package/.output/server/_ssr/{routes-Bhay1OjL.mjs → routes-B-MWifFy.mjs} +5 -5
- package/.output/server/_ssr/{routes-ROFun1nJ.mjs → routes-BJCWMIzb.mjs} +4 -4
- package/.output/server/_ssr/{runDiff-DWwt7qXb.mjs → runDiff-C0w1D4a3.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +48 -48
- package/.output/server/_ssr/store-LYphMSJ-.mjs +2 -0
- package/.output/server/_ssr/{t._teamId-DTKU7GOp.mjs → t._teamId-FYVEIAGw.mjs} +5 -5
- package/.output/server/_ssr/{t._teamId-CGba9PRq.mjs → t._teamId-fw8RfHyI.mjs} +4 -4
- package/.output/server/_ssr/{teamFns-BMDqynoT.mjs → teamFns-Dz41U7gA.mjs} +3 -3
- package/.output/server/_ssr/{tokens-BHjz7Lvx.mjs → tokens-3ZFpqsuf.mjs} +1 -1
- package/.output/server/{_tanstack-start-manifest_v-BwejIUux.mjs → _tanstack-start-manifest_v-C9p30TZH.mjs} +10 -10
- package/.output/server/drizzle/0011_steep_marvel_zombies.sql +3 -0
- package/.output/server/drizzle/meta/0011_snapshot.json +1872 -0
- package/.output/server/drizzle/meta/_journal.json +7 -0
- package/.output/server/index.mjs +90 -90
- package/drizzle/0011_steep_marvel_zombies.sql +3 -0
- package/drizzle/meta/0011_snapshot.json +1872 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/.output/public/assets/app-BKySt9Ta.css +0 -2
- package/.output/public/assets/loops._loopId-DdWM2f1F.js +0 -5
- package/.output/server/_ssr/artifacts-CwCDal_d.mjs +0 -2
- package/.output/server/_ssr/db-7gZ8_zkc.mjs +0 -2
- package/.output/server/_ssr/logger-Dbz2vUU-.mjs +0 -2
- package/.output/server/_ssr/store-D75hcTob.mjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";import{a as r,c as i,p as a}from"./preload-helper-ycaoAemE.js";import{l as o}from"./ui-Dp88qUWh.js";import{c as s,n as c,s as l}from"./index-
|
|
1
|
+
import{n as e,s as t,t as n}from"./jsx-runtime-BseJUIpC.js";import{a as r,c as i,p as a}from"./preload-helper-ycaoAemE.js";import{l as o}from"./ui-Dp88qUWh.js";import{c as s,n as c,s as l}from"./index-DSF-1ahT.js";import{t as u}from"./SignIn-CbMeIAJZ.js";var d=t(e()),f=n();function p({children:e}){return(0,f.jsxs)(`div`,{className:`mx-auto mt-32 max-w-sm text-center`,children:[(0,f.jsx)(r,{size:52}),(0,f.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold tracking-tight text-display`,children:`Team invite`}),e]})}function m(){let e=c.useLoaderData(),{data:t,isPending:n}=i(),r=a(),[m,h]=(0,d.useState)(`idle`),[g,_]=(0,d.useState)(null),v=(0,d.useRef)(!1),y=e.auth.enabled,b=y?!!t:!1;return(0,d.useEffect)(()=>{!y||n||!b||v.current||(v.current=!0,h(`redeeming`),(async()=>{let t=await l({data:e.token});if(t.ok){s(t.teamId),r({to:`/t/$teamId`,params:{teamId:t.teamId}});return}_(t.error),h(`error`)})())},[y,n,b,e.token,r]),y?!n&&!b?(0,f.jsx)(u,{callbackURL:`/invite/${e.token}`}):m===`error`?(0,f.jsxs)(p,{children:[(0,f.jsx)(`p`,{className:`mt-3 text-sm text-accent`,children:g}),(0,f.jsx)(`button`,{className:`${o} mt-6`,onClick:()=>void r({to:`/`}),children:`Go to the dashboard`})]}):(0,f.jsx)(p,{children:(0,f.jsx)(`p`,{className:`mt-2 text-sm text-secondary`,children:`Joining the team…`})}):(0,f.jsxs)(p,{children:[(0,f.jsx)(`p`,{className:`mt-2 text-sm text-secondary`,children:`This Pievo server runs in open mode (a single shared workspace), so team invites don't apply here.`}),(0,f.jsx)(`button`,{className:`${o} mt-6`,onClick:()=>void r({to:`/`}),children:`Go to the dashboard`})]})}export{m as component};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeField-dOzyFQNH.js","assets/jsx-runtime-BseJUIpC.js","assets/LoopView-d0XYkzpx.js","assets/Modal-D_od-AuP.js","assets/loopApi-5s2-kCnu.js","assets/ui-Dp88qUWh.js","assets/artifactView-DekEs5ME.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 ee,r as c,u as l,v as u,x as d,y as te}from"./loopApi-5s2-kCnu.js";import{c as f,f as ne,p as re,t as ie}from"./preload-helper-ycaoAemE.js";import{a as ae,o as oe,r as se,s as ce}from"./notifyFns-b_jCi5XK.js";import{C as le,D as ue,E as de,M as p,N as fe,O as pe,S as m,_ as h,b as me,c as he,d as ge,g as _e,i as ve,j as ye,l as be,m as g,n as xe,o as _,p as v,r as y,s as Se,t as Ce,v as b,w as we,x as Te}from"./ui-Dp88qUWh.js";import{i as Ee,n as De,r as Oe,t as ke}from"./lifecycleUi-DGVOf5yS.js";import{c as Ae,r as x}from"./index-DSF-1ahT.js";import{a as S,i as je,n as C,o as w,t as T}from"./artifactView-DekEs5ME.js";import{t as Me}from"./SignIn-CbMeIAJZ.js";import{i as Ne,n as Pe,r as Fe,t as Ie}from"./actionUi-ChGGALzg.js";var E=t(e(),1);function Le(e){if(!e)return null;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n>0?t.slice(0,n):null}function Re({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 D=n(),O=e=>e.split(`/`).pop()||e;function ze(e){let t=e.match(/\.([a-z0-9]+)$/i);return t?t[1].toLowerCase():`file`}function Be({loopId:e,taskFile:t,taskFileContent:n,taskFileSyncedAt:r,running:i}){let[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(null),l=(0,E.useRef)(0),u=(0,E.useCallback)(async()=>{let t=++l.current;try{let n=await ee({data:{loopId:e}});t===l.current&&o(n)}catch{t===l.current&&o(e=>e??[])}},[e]);(0,E.useEffect)(()=>{o(null),c(null),u()},[e,u]),(0,E.useEffect)(()=>{let e=setInterval(()=>void u(),i?4e3:12e3);return()=>clearInterval(e)},[i,u]);let d=(0,E.useMemo)(()=>S(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,ne=w(f);return(0,D.jsxs)(`section`,{id:`files`,className:`min-w-0`,children:[(0,D.jsxs)(`div`,{className:`mb-2.5 flex items-end justify-between gap-3 border-b border-hairline pb-1.5`,children:[(0,D.jsxs)(`h2`,{className:`text-label font-semibold text-secondary`,children:[`Files`,a?` (${d.length})`:``]}),(0,D.jsx)(`span`,{className:`text-caption font-medium text-disabled`,children:`Spec + synced artifacts`})]}),d.length===0?(0,D.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,D.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,D.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,D.jsx)(`ul`,{className:`py-1.5`,children:d.map(e=>{let t=e.path===te,n=w(e),r=!n&&e.kind===`artifact`?e.file.meta:null,i=r?.title?.trim()||``,a=i&&i!==O(e.path)?i:O(e.path),o=e.path.includes(`/`)||a!==O(e.path);return(0,D.jsx)(`li`,{children:(0,D.jsxs)(`button`,{type:`button`,onClick:()=>c(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,D.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(`span`,{className:`block truncate font-mono text-label ${t?`text-display`:`text-primary`}`,title:e.path,children:a}),o&&(0,D.jsx)(`span`,{className:`block truncate font-mono text-micro text-disabled`,title:e.path,children:e.path})]}),n?(0,D.jsx)(`span`,{className:`shrink-0 rounded-full bg-interactive-soft px-2 text-caption font-medium text-interactive`,children:`Task`}):r?.type?(0,D.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,D.jsx)(`span`,{className:`shrink-0 font-mono text-micro text-disabled`,children:ze(e.path)})]})},e.path)})})}),(0,D.jsx)(`div`,{className:`min-w-0 overflow-y-auto`,children:ne&&f?(0,D.jsx)(k,{path:f.path,content:n,syncedAt:r}):f?.kind===`artifact`?(0,D.jsx)(A,{loopId:e,file:f.file}):null})]})]})}function k({path:e,content:t,syncedAt:n}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C,{path:e,meta:n?`Task file · synced ${we(n)}`:`Task file`}),t==null?(0,D.jsx)(`div`,{className:`px-5 py-6 text-body text-disabled`,children:`(syncs from the machine on the next run)`}):(0,D.jsx)(je,{content:t})]})}function A({loopId:e,file:t}){let n=[t.size==null?``:de(t.size),`synced ${we(t.updatedAt)}`].filter(Boolean).join(` · `);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(C,{path:t.path,meta:n}),(0,D.jsx)(T,{loopId:e,file:t})]})}var Ve=[`claude-code`,`codex`];function j(e){return{executor:`claude`,workdir:e.workdir.trim(),model:e.model.trim(),reasoningEffort:e.reasoningEffort.trim(),allowControl:e.allowControl}}var M=(0,E.lazy)(()=>ie(()=>import(`./CodeField-dOzyFQNH.js`),__vite__mapDeps([0,1])));function N(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??``,stateSchema:e?.stateSchema?JSON.stringify(e.stateSchema):``,ui:e?.ui??``,agent:e?.agent??`claude-code`,workdir:t?.workdir??``,model:t?.model??``,reasoningEffort:t?.reasoningEffort??``,allowControl:!!t?.allowControl}}var P=`mt-1 text-caption leading-snug text-disabled`,F={"claude-code":`Claude Code`,codex:`Codex`};function I({label:e,value:t,onChange:n,mono:r,ph:i,hint:a}){let o=(0,E.useId)();return(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{htmlFor:o,className:g,children:e}),(0,D.jsx)(`input`,{id:o,type:`text`,className:r?`${v} font-mono`:v,value:t,placeholder:i,onChange:e=>n(e.target.value)}),a&&(0,D.jsx)(`div`,{className:P,children:a})]})}function L({title:e,hint:t}){return(0,D.jsxs)(`div`,{className:`mb-1 mt-7 border-b border-hairline pb-1.5`,children:[(0,D.jsx)(`h2`,{className:h,children:e}),t&&(0,D.jsx)(`div`,{className:`mt-0.5 text-caption text-disabled`,children:t})]})}function R({minHeight:e}){return(0,D.jsx)(`div`,{className:`rounded-control border border-wire bg-raised`,style:{minHeight:e}})}var He=(0,E.forwardRef)(function({initial:e,channels:t},n){let[r,i]=(0,E.useState)(()=>N(e)),a=(e,t)=>i(n=>({...n,[e]:t})),[o,s]=(0,E.useState)(null),[ee,c]=(0,E.useState)([]),l=t??ee;return(0,E.useEffect)(()=>{t||se().then(c).catch(()=>{})},[t]),(0,E.useImperativeHandle)(n,()=>({read(){let e,t=r.stateSchema.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:j(r),stateSchema:e}}})),(0,D.jsxs)(`div`,{className:`grid gap-x-10 lg:grid-cols-[minmax(300px,380px)_minmax(0,1fr)]`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(L,{title:`Basics`}),(0,D.jsx)(I,{label:`Name`,value:r.name,onChange:e=>a(`name`,e)}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Schedule mode`}),(0,D.jsxs)(`select`,{"aria-label":`Schedule mode`,className:b,value:r.scheduleMode,onChange:e=>a(`scheduleMode`,e.target.value),children:[(0,D.jsx)(`option`,{value:`cron`,children:`Cron`}),(0,D.jsx)(`option`,{value:`continuous`,children:`Continuous`})]}),r.scheduleMode===`cron`?(0,D.jsxs)(`div`,{className:`${v} flex cursor-default select-none items-center justify-between gap-2 bg-raised`,title:r.cron,children:[(0,D.jsx)(`span`,{className:`truncate text-primary`,children:me(r.cron)}),(0,D.jsx)(`span`,{className:`shrink-0 font-mono text-caption text-secondary`,children:r.cron})]}):(0,D.jsx)(I,{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,D.jsx)(`div`,{className:P,children:`Cron is retained while continuous mode is active, so switching back restores it.`})]}),(0,D.jsx)(I,{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,D.jsx)(L,{title:`Notifications`}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Notify`}),(0,D.jsx)(`select`,{"aria-label":`Notify`,className:b,value:r.notify,onChange:e=>a(`notify`,e.target.value),children:[`auto`,`always`,`never`].map(e=>(0,D.jsx)(`option`,{children:e},e))}),(0,D.jsx)(`div`,{className:P,children:`auto pushes only when a run found something; never silences everything.`})]}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Push channel`}),(0,D.jsxs)(`select`,{"aria-label":`Push channel`,className:b,value:r.channelId,onChange:e=>a(`channelId`,e.target.value),children:[(0,D.jsx)(`option`,{value:``,children:`none (dashboard only)`}),l.map(e=>(0,D.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,D.jsx)(L,{title:`Execution`,hint:`Which coding agent on the machine runs this loop.`}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`label`,{className:g,children:`Coding agent`}),(0,D.jsx)(`select`,{"aria-label":`Coding agent`,className:b,value:r.agent,onChange:e=>a(`agent`,e.target.value),children:Ve.map(e=>(0,D.jsx)(`option`,{value:e,children:F[e]??e},e))}),(0,D.jsx)(`div`,{className:P,children:`Which coding agent executes this loop on the bound machine.`})]}),(0,D.jsx)(I,{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,D.jsx)(I,{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,D.jsx)(I,{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,D.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-center gap-2 text-body text-primary`,children:[(0,D.jsx)(`input`,{type:`checkbox`,className:`accent-[color:var(--color-display)]`,checked:r.allowControl,onChange:e=>a(`allowControl`,e.target.checked)}),`Allow self-rescheduling`]})]}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(L,{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,D.jsx)(`label`,{className:g,children:`Metrics schema · JSON array`}),(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(R,{minHeight:`90px`}),children:(0,D.jsx)(M,{lang:`json`,value:r.stateSchema,onChange:e=>{a(`stateSchema`,e),s(null)},minHeight:`90px`,invalid:!!o,placeholder:`[{"key":"mrr","label":"MRR","unit":"$"},{"key":"paid"}]`})}),o?(0,D.jsx)(`div`,{className:`mt-1 text-caption leading-snug text-accent`,children:o}):(0,D.jsx)(`div`,{className:P,children:`Per-run metrics the agent reports; they feed the dashboard charts.`}),(0,D.jsx)(`label`,{className:g,children:`Dashboard template · HTML`}),(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(R,{minHeight:`240px`}),children:(0,D.jsx)(M,{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,D.jsxs)(`div`,{className:P,children:[`Agent-authored HTML with `,`{{bindings}}`,` and loop-chart / loop-embed / loop-calendar / loop-kanban elements.`]})]})]})}),Ue={"claude-code":`Claude Code`,codex:`Codex`},We=[{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 a finish line`,seed:`Give this loop a goal, and finish it once the goal is met: `}],Ge=(0,E.lazy)(()=>ie(()=>import(`./LoopView-d0XYkzpx.js`).then(e=>({default:e.LoopView})),__vite__mapDeps([2,1,3,4,5,6])));function z({id:e}){let t=re(),[n,ee]=(0,E.useState)(null),[f,ie]=(0,E.useState)([]),[oe,le]=(0,E.useState)(null),[de,p]=(0,E.useState)(null),[m,h]=(0,E.useState)(!1),[ge,g]=(0,E.useState)(!1),[v,b]=(0,E.useState)(``),[x,S]=(0,E.useState)(!1),[je,C]=(0,E.useState)(!1),[w,T]=(0,E.useState)(null),Me=(0,E.useRef)(null),[O,ze]=(0,E.useState)(!1),[k,A]=(0,E.useState)(null),[Ve,j]=(0,E.useState)(!1),[M,N]=Ne(),P=(0,E.useRef)(null),F=(0,E.useRef)(!1),[I,L]=(0,E.useState)([]),R=(0,E.useCallback)(async(n=!1)=>{try{let t=await l({data:e});ee(t),F.current=t.summary.deleteRequestedAt!=null,le(null)}catch(e){F.current?t({to:`/`}):n||le(String(e))}},[e]);(0,E.useEffect)(()=>{ee(null),h(!1),g(!1),b(``),S(!1),C(!1),T(null),j(!1),L([]),R(),se().then(ie).catch(()=>{})},[e,R]);let z=!!n?.summary.running;(0,E.useEffect)(()=>{if(m)return;let e=setInterval(()=>void R(!0),z||F.current?3e3:8e3);return()=>clearInterval(e)},[m,z,R]);async function V(){await R()}async function Je(){p(null),A(`run`);try{let t=await a({data:e});if(t?.error)return p(`Run failed: ${t.error}`);N({label:t.coalesced?`Already queued`:`Queued`,hold:4e3}),await V()}finally{A(null)}}async function Ye(){p(null),A(`evolve`);try{let t=await s({data:e});if(t?.error)return p(`Evolve failed: ${t.error}`);N({label:t.coalesced?`Evolve already queued`:`Evolve queued`,hold:4e3}),await V()}finally{A(null)}}async function H(n){p(null),A(`lifecycle`);try{let a=n===`pause`?await u({data:e}):n===`start`?await d({data:e}):n===`stop`?await r({data:e}):n===`reopen`?await i({data:{id:e,patch:{enabled:!0}}}):await c({data:e});if(a.error)return p(`${n[0].toUpperCase()+n.slice(1)} failed: ${a.error}`);if(j(!1),a.deleted){F.current=!1,t({to:`/`});return}n===`delete`&&(F.current=!0),await V(),N({label:n===`start`?`Started`:n===`reopen`?`Reopened`:n===`pause`?`Paused`:n===`stop`?`Stop requested`:`Deleting`})}finally{A(null)}}async function Xe(){let t=P.current?.read();if(t){p(null),A(`save`);try{let n=await i({data:{id:e,patch:t}});if(n.error)return p(`Save failed: ${n.error}`);h(!1),await V(),N({label:`Saved`})}finally{A(null)}}}async function Ze(){let t=v.trim();if(t){p(null),A(`edit`);try{let n=await te({data:{id:e,instruction:t}});if(n.error)return p(`Couldn't queue the edit: ${n.error}`);T(n.runId??null),C(!0),g(!1),b(``),await V()}finally{A(null)}}}let U=(0,D.jsxs)(ne,{to:`/`,className:`inline-flex items-center gap-1.5 text-meta font-medium text-secondary transition-colors hover:text-display`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Loops`]});if(oe)return(0,D.jsx)(B,{back:U,children:(0,D.jsx)(Fe,{title:`Couldn't load this loop.`,detail:oe,onRetry:()=>void R()})});if(!n)return(0,D.jsx)(B,{back:U,children:(0,D.jsx)(xe,{})});let{job:W,summary:G,runs:Qe}=n,$e=!!W.ui,et=!!k,tt=n.machine.online,K=n.machine.presence===`asleep`,nt=tt?void 0:K?`Machine asleep - requests will stay queued until it wakes`:`Machine offline - requests will stay queued until it reconnects`,q=pe(G),J=Oe(G),rt=Ee(n),it=De(n.machine.daemonProtocol),at=ue(G)&&!q,ot=n.machine.name?`“${n.machine.name}”`:`the bound machine`,Y=je&&w?Qe.find(e=>e.id===w):void 0,st=!!Y&&!Y.queued&&!Y.running,ct=()=>{C(!1),T(null)},lt=Le(W.taskFile),ut=async()=>{try{await navigator.clipboard.writeText(Re({loopId:e,loopName:G.name,instruction:v})),S(!0),setTimeout(()=>S(!1),4e3)}catch{p(`Could not copy the prompt - try again or copy it manually.`)}},dt=M&&(0,D.jsx)(`div`,{className:`mb-2.5`,children:(0,D.jsx)(Pe,{label:M.label,tone:M.tone,onUndo:M.undo})}),X=J===`deleting`,ft=!G.enabled&&!q&&!X,pt=G.enabled&&!q&&!X,Z=et||X,Q=pt||ft,mt=Q&&!!G.running&&it.supported,ht=G.running&&!it.supported?ke:G.running?void 0:`No run is currently running`,gt=(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,D.jsx)(`button`,{className:be,disabled:Z||!Q,onClick:()=>void Je(),title:Q?nt??(W.exec?`Spends credits`:void 0):`Unavailable for a completed or deleting loop`,"aria-label":W.exec?`Run once - spends credits`:`Run once`,children:k===`run`?`Queuing…`:`Run once`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!(Q||q),title:`Dispatch or copy a prompt for an owner-requested edit`,onClick:()=>g(!0),children:`Agent edit`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!Q,title:Q?nt??`Spends credits`:`Unavailable for a completed or deleting loop`,onClick:()=>void Ye(),children:k===`evolve`?`Evolving…`:`Evolve once`}),(0,D.jsx)(`button`,{className:_,disabled:Z,onClick:()=>h(!0),children:`Settings`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!ft,onClick:()=>void H(`start`),children:`Start`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!pt,onClick:()=>void H(`pause`),children:`Pause`}),(0,D.jsx)(`button`,{className:he,disabled:Z||!mt,title:ht,onClick:()=>void H(`stop`),children:`Stop`}),(0,D.jsx)(`button`,{className:_,disabled:Z||!q,onClick:()=>void H(`reopen`),children:`Reopen`}),(0,D.jsx)(`button`,{className:he,disabled:Z,onClick:()=>j(!0),children:X?`Deleting…`:`Delete`})]}),Ve&&!X&&(0,D.jsx)(`div`,{className:`mt-3`,children:(0,D.jsx)(Ie,{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:et,onConfirm:()=>void H(`delete`),onCancel:()=>j(!1)})}),X&&(0,D.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.`}),ge&&!X&&(0,D.jsxs)(`div`,{className:`mt-4 border-t border-hairline pt-4`,onKeyDown:e=>{e.key===`Escape`&&k!==`edit`&&(e.stopPropagation(),g(!1))},children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,D.jsx)(`span`,{className:`text-body font-medium text-display`,children:`Edit with your coding agent`}),(0,D.jsxs)(`span`,{className:`text-meta text-secondary`,children:[`One agent pass on `,ot,` · spends credits`]})]}),(0,D.jsx)(`textarea`,{ref:Me,autoFocus:!0,value:v,onChange:e=>b(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&v.trim()&&k!==`edit`&&Ze()},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`}),!v.trim()&&(0,D.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:We.map(e=>(0,D.jsx)(`button`,{type:`button`,onClick:()=>{b(e.seed),Me.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,D.jsxs)(`div`,{className:`mt-3.5 flex flex-wrap items-center gap-x-2.5 gap-y-2`,children:[(0,D.jsx)(`button`,{className:Se,disabled:k===`edit`||!v.trim(),title:nt,onClick:()=>void Ze(),children:k===`edit`?`Dispatching…`:`Dispatch to your coding agent`}),(0,D.jsx)(`button`,{type:`button`,className:_,disabled:k===`edit`,onClick:()=>void ut(),children:x?`✓ Prompt copied`:`Copy prompt`}),(0,D.jsx)(`button`,{className:_,disabled:k===`edit`,onClick:()=>g(!1),children:`Cancel`}),(0,D.jsx)(`span`,{className:`hidden text-caption text-disabled sm:inline`,children:`⌘↩ dispatch · esc cancel`})]}),(0,D.jsx)(`div`,{className:`mt-2 text-caption leading-snug text-disabled`,children:x?(0,D.jsxs)(`span`,{className:`text-secondary`,children:[`✓ Copied · run your coding agent`,` `,lt?(0,D.jsxs)(D.Fragment,{children:[`in `,(0,D.jsx)(`code`,{className:`break-all font-mono text-primary`,children:lt})]}):`in the loop’s local directory on this machine`,` `,`and paste the prompt to adjust the loop yourself.`]}):(0,D.jsx)(D.Fragment,{children:`Prefer to adjust it yourself? Copy prompt drops a ready-to-paste prompt for your own coding agent - no dispatch, no credits.`})})]})]}),_t=de&&(0,D.jsx)(Ce,{message:de,onDismiss:()=>p(null),className:`mb-2.5`}),$=n.team&&!n.team.isActive?n.team:null,vt=e=>{Ae(e),t({to:`/t/$teamId`,params:{teamId:e}})},yt=$&&(0,D.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,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta font-medium text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full bg-interactive`}),`Viewing a loop in `,$.name]}),(0,D.jsx)(`span`,{className:`text-meta text-secondary`,children:`- not your active team.`}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>vt($.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`})]}),bt=!tt&&(0,D.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,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta font-medium text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full ${K?`bg-rubik-yellow`:`bg-disabled`}`}),`Machine `,n.machine.name?`“${n.machine.name}” `:``,K?`seems to be asleep or offline`:`offline`]}),(0,D.jsxs)(`span`,{className:`text-meta text-secondary`,children:[K?`- queued work starts automatically when it reconnects.`:`- manual run, evolve, and edit requests remain safely queued.`,n.machine.lastSeen?` Last seen ${ye(n.machine.lastSeen)}.`:``]}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>ze(!0),className:`ml-auto cursor-pointer text-meta font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`Reconnect`})]});if(m)return(0,D.jsxs)(B,{back:U,children:[(0,D.jsx)(Ke,{name:G.name,onBack:()=>h(!1)}),(0,D.jsxs)(`div`,{className:`mt-5 rounded-card border border-hairline bg-surface px-6 pb-6 pt-2 shadow-card`,children:[(0,D.jsx)(He,{ref:P,initial:W,channels:f}),(0,D.jsxs)(`div`,{className:`mt-7 border-t border-hairline pt-4`,children:[_t,(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[(0,D.jsx)(`button`,{className:be,disabled:k===`save`,onClick:Xe,children:k===`save`?`Saving…`:`Save`}),(0,D.jsx)(`button`,{className:_,disabled:k===`save`,onClick:()=>h(!1),children:`Cancel`})]})]})]})]});let xt=Ue[W.agent??`claude-code`]??W.agent??`Claude Code`,St=W.exec?.model?.trim()||`default`,Ct=W.exec?.reasoningEffort?.trim()||`default`,wt=Qe[0],Tt=wt?.reportIncident?wt:void 0,Et=(0,D.jsx)(`span`,{className:`text-wire`,children:`·`});return(0,D.jsxs)(B,{back:U,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.jsx)(`h1`,{className:`text-[28px] font-semibold leading-tight tracking-[-0.015em] text-display`,children:G.name}),J===`completed`?(0,D.jsx)(y,{tone:`success`,dot:`green`,children:`Completed`}):(0,D.jsx)(y,{tone:J===`stopping`?`running`:void 0,dot:J===`stopping`?`pulse`:void 0,children:rt}),G.queued&&J===`active`?(0,D.jsx)(y,{tone:`outline`,children:`Queued`}):null,at&&(0,D.jsx)(y,{tone:`success`,title:G.goal??void 0,children:`Goal`}),(0,D.jsx)(y,{tone:`outline`,title:`Recorded coding agent`,children:xt}),(0,D.jsx)(y,{tone:`outline`,title:`Model: ${St}`,children:(0,D.jsxs)(`span`,{className:`max-w-72 truncate`,children:[`Model: `,St]})}),(0,D.jsx)(y,{tone:`outline`,title:`Reasoning: ${Ct}`,children:(0,D.jsxs)(`span`,{className:`max-w-72 truncate`,children:[`Reasoning: `,Ct]})}),$&&(0,D.jsx)(y,{tone:`outline`,title:`This loop belongs to another of your teams`,children:$.name})]}),(0,D.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta text-secondary`,children:[(0,D.jsx)(`span`,{className:`text-primary`,title:W.cron,children:W.scheduleMode===`continuous`?`continuous · ${W.continuousDelayMinutes}m delay`:me(W.cron)}),Et,(0,D.jsxs)(`span`,{children:[`next `,we(G.nextRun)]}),G.nextRun&&G.enabled&&!q&&(0,D.jsxs)(`span`,{className:`text-disabled`,children:[`(`,fe(G.nextRun),`)`]}),Et,(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:tt?`Machine online`:K?`Machine asleep`:`Machine offline`,children:[(0,D.jsx)(`span`,{className:`size-1.5 rounded-full ${tt?`bg-rubik-green`:K?`bg-rubik-yellow`:`bg-disabled`}`}),n.machine.name||`machine`]}),Et,(0,D.jsx)(`span`,{title:`Breaking daemon/server lifecycle protocol`,children:it.label}),Et,(0,D.jsx)(`code`,{className:`font-mono text-label text-disabled`,children:G.id})]}),at&&G.goal&&(0,D.jsxs)(`div`,{className:`mt-2 text-body leading-snug text-secondary`,children:[`Working toward: `,(0,D.jsx)(`span`,{className:`text-primary`,children:G.goal})]}),J===`completed`&&(0,D.jsxs)(`div`,{className:`mt-2 text-body leading-snug text-success`,children:[`Completed`,G.completedAt?` · ${we(G.completedAt)}`:``,G.completionReason&&(0,D.jsxs)(`span`,{className:`text-secondary`,children:[` - `,G.completionReason]})]}),Tt?.reportIncident&&(0,D.jsx)(`div`,{className:`mt-2 text-body leading-snug text-secondary`,children:Tt.outcome===`error`?`Last run failed · Terminal report rejected`:`Last run telemetry warning · Terminal report rejected`})]})}),(0,D.jsxs)(`div`,{className:`mt-5 border-t border-hairline pt-4`,children:[yt,bt,_t,dt,gt]})]}),je&&(0,D.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,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[!Y||Y.queued?(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 text-body text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full bg-disabled`}),(0,D.jsx)(`span`,{className:`font-medium text-primary`,children:`Edit queued`}),(0,D.jsxs)(`span`,{children:[`waiting for `,ot,` and higher-priority work…`]})]}):Y.running?(0,D.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2.5 text-body text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full`,style:_e}),(0,D.jsx)(`span`,{className:`shrink-0 font-medium text-primary`,children:`Applying your edit`})]}):(0,D.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-body`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-2.5 shrink-0 rounded-[2px]`,style:{background:Te(Y)}}),(0,D.jsx)(`span`,{className:`font-medium`,style:{color:Te(Y)},children:Y.canceled?`Edit canceled`:Y.outcome===`error`?`Edit failed`:`Edit applied`}),Y.error&&(0,D.jsxs)(`span`,{className:`truncate text-secondary`,children:[`· `,Y.error]})]}),(0,D.jsxs)(`div`,{className:`ml-auto flex items-center gap-3.5`,children:[Y&&(0,D.jsx)(ne,{to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:Y.id},className:`text-label font-medium text-interactive underline underline-offset-2 transition-colors hover:text-display`,children:`View run →`}),(0,D.jsx)(`button`,{type:`button`,onClick:ct,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:st?`Done`:`Hide`})]})]}),st&&Y.message&&(0,D.jsx)(`div`,{className:`mt-3.5`,children:(0,D.jsx)(ve,{children:Y.message})})]}),$e&&(0,D.jsxs)(`section`,{className:`mt-6 min-w-0 rounded-card border border-hairline bg-surface px-6 py-5 shadow-card`,children:[(0,D.jsx)(`div`,{className:`mb-3.5 border-b border-hairline pb-1.5 text-label font-semibold text-secondary`,children:`Dashboard`}),(0,D.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,D.jsx)(E.Suspense,{fallback:(0,D.jsx)(xe,{className:`py-4`}),children:(0,D.jsx)(Ge,{html:W.ui,runs:Qe,loopId:e,taskFile:W.taskFile})})})]}),(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.jsx)(Be,{loopId:e,taskFile:W.taskFile,taskFileContent:n.taskFileContent,taskFileSyncedAt:n.taskFileSyncedAt,running:z}),(0,D.jsx)(qe,{loopId:e,summary:G,runs:Qe,older:I,onMore:async()=>{let t=(I.length?ce(G.runs??[],I):G.runs??[])[0];if(!t)return 0;let n=await o({data:{loopId:e,beforeTs:t.ts,limit:16}});return n.length&&L(e=>ce(e,n)),n.length},onPickRun:n=>t({to:`/loops/$loopId/runs/$runId`,params:{loopId:e,runId:n.id}})})]}),(0,D.jsx)(ae,{open:O,onClose:()=>ze(!1)})]})}function Ke({name:e,onBack:t}){return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`button`,{type:`button`,onClick:t,className:ge,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to loop`]}),(0,D.jsxs)(`h1`,{className:`mt-2.5 text-[24px] font-semibold leading-tight tracking-[-0.015em] text-display`,children:[`Settings · `,e]}),(0,D.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 Agent edit instead.`})]})}function B({back:e,children:t}){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:e}),t]})}function qe({loopId:e,summary:t,runs:n,older:r,onMore:i,onPickRun:a}){let o=(0,E.useMemo)(()=>r.length?ce(t.runs??[],r):t.runs??[],[t.runs,r]);return(0,D.jsxs)(`section`,{className:`min-w-0`,children:[(0,D.jsx)(`div`,{className:`mb-2.5 flex items-end justify-between gap-3 border-b border-hairline pb-1.5`,children:(0,D.jsxs)(`h2`,{className:h,children:[`Runs (`,t.runCount,`)`]})}),t.runCount===0?(0,D.jsx)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 py-10 text-center text-body text-disabled`,children:`Never run`}):(0,D.jsxs)(`div`,{className:`rounded-card border border-hairline bg-surface px-5 pb-4 pt-5 shadow-card`,children:[(0,D.jsx)(oe,{job:t,runs:o,total:t.runCount,onLoadMore:i,onPickRun:a}),(0,D.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,D.jsx)(`li`,{children:(0,D.jsxs)(ne,{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,D.jsx)(`span`,{className:`mt-1 inline-block size-2.5 shrink-0 rounded-[2px]`,style:{background:Te(t)},title:m(t),"aria-label":m(t)}),(0,D.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,D.jsxs)(`span`,{className:`flex items-baseline justify-between gap-2`,children:[(0,D.jsx)(`span`,{className:`font-mono text-label text-secondary`,children:p(t.ts)}),(0,D.jsx)(`span`,{className:`shrink-0 font-mono text-caption text-disabled`,children:le(t.durationMs)})]}),(0,D.jsx)(`span`,{className:`mt-0.5 block`,children:t.queued?(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-disabled`}),(0,D.jsx)(`span`,{children:`Queued`})]}):t.running?(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-meta text-secondary`,children:[(0,D.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full`,style:_e}),(0,D.jsx)(`span`,{children:`Running`})]}):t.error?(0,D.jsx)(`span`,{className:`line-clamp-2 text-meta text-secondary`,children:t.error}):(0,D.jsx)(`span`,{className:`line-clamp-2 text-meta text-primary`,children:t.message||m(t)})})]})]})},t.id))})]})]})}function V(){let{loopId:e}=x.useParams(),{auth:t}=x.useLoaderData()??{auth:{enabled:!1}},{data:n,isPending:r}=f();return t?.enabled&&!r&&!n?(0,D.jsx)(Me,{callbackURL:`/loops/${e}`}):(0,D.jsx)(z,{id:e})}export{V as component};
|
|
@@ -1,3 +1,3 @@
|
|
|
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-5s2-kCnu.js";import{c as s,f as c}from"./preload-helper-ycaoAemE.js";import{C 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-Dp88qUWh.js";import"./lifecycleUi-DGVOf5yS.js";import{t as b}from"./index-
|
|
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-5s2-kCnu.js";import{c as s,f as c}from"./preload-helper-ycaoAemE.js";import{C 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-Dp88qUWh.js";import"./lifecycleUi-DGVOf5yS.js";import{t as b}from"./index-DSF-1ahT.js";import{t as x}from"./SignIn-CbMeIAJZ.js";import{r as S}from"./actionUi-ChGGALzg.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
2
|
`)?e.slice(0,-1):e,n=!1;return t.split(`
|
|
3
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?`+`:`−`}${u(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=l(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,u]=(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),u(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&&u(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:y(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:l(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!==2,title:E.running&&n.machine.daemonProtocol!==2?"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:[(0,D.jsx)(R,{k:`State`,children:(0,D.jsx)(p,{run:E,colorText:!0})}),E.status&&(0,D.jsx)(R,{k:`Status`,children:E.status}),E.durationMs!=null&&(0,D.jsx)(R,{k:`Duration`,children:l(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:[d((E.usage.inputTokens??0)+(E.usage.cacheReadTokens??0)+(E.usage.cacheCreationTokens??0)),` in · `,d(E.usage.outputTokens??0),` out`]})}),E.state!=null&&(0,D.jsx)(R,{k:`Run state`,children:(0,D.jsx)(`code`,{className:`block break-all font-mono text-label text-secondary`,children:JSON.stringify(E.state)})}),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 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BseJUIpC.js";import{c as t}from"./preload-helper-ycaoAemE.js";import{a as n,o as r}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BseJUIpC.js";import{c as t}from"./preload-helper-ycaoAemE.js";import{a as n,o as r}from"./index-DSF-1ahT.js";import{t as i}from"./SignIn-CbMeIAJZ.js";var a=e();function o(){let e=n.useLoaderData(),{data:o,isPending:s}=t();return e?.auth?.enabled&&!s&&!o||e?.mode===`signin`?(0,a.jsx)(i,{}):(0,a.jsx)(r,{initial:e.initial})}export{o as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BseJUIpC.js";import{c as t}from"./preload-helper-ycaoAemE.js";import{i as n,o as r}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BseJUIpC.js";import{c as t}from"./preload-helper-ycaoAemE.js";import{i as n,o as r}from"./index-DSF-1ahT.js";import{t as i}from"./SignIn-CbMeIAJZ.js";var a=e();function o(){let e=n.useLoaderData(),{data:o,isPending:s}=t();return e?.auth?.enabled&&!s&&!o||e?.mode===`signin`?(0,a.jsx)(i,{}):(0,a.jsx)(r,{teamId:e.teamId,initial:e.initial},e.teamId)}export{o as component};
|
|
@@ -4,11 +4,11 @@ import { t as ReactCodeMirror } from "../_libs/uiw__react-codemirror.mjs";
|
|
|
4
4
|
import { t as createTheme } from "../_libs/uiw__codemirror-themes.mjs";
|
|
5
5
|
import { n as javascript, t as html } from "../_libs/@codemirror/lang-html+[...].mjs";
|
|
6
6
|
import { t as json } from "../_libs/@codemirror/lang-json+[...].mjs";
|
|
7
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/CodeField-
|
|
7
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/CodeField-B7oOmmwH.js
|
|
8
8
|
var import_jsx_runtime = require_jsx_runtime();
|
|
9
9
|
/**
|
|
10
|
-
* CodeMirror-backed code field for the manual settings form (
|
|
11
|
-
*
|
|
10
|
+
* CodeMirror-backed code field for the manual settings form (metrics JSON /
|
|
11
|
+
* dashboard HTML). Lives in its OWN lazy chunk - LoopForm
|
|
12
12
|
* `lazy()`-imports it, so CodeMirror never rides in the base client bundle
|
|
13
13
|
* (same discipline as the recharts-bearing LoopView chunk).
|
|
14
14
|
*
|
|
@@ -4,12 +4,12 @@ import { A as selectCls, C as labelCls, E as rel, N as useHydrated, S as isCompl
|
|
|
4
4
|
import { d as useNavigate } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
5
5
|
import { _ as mintClaim, g as loadOlderRuns, l as getConfig, m as listMyTeams, n as claimStatus, p as listJobs } from "./loopApi-BfMnXaKT.mjs";
|
|
6
6
|
import { n as ModalHead, r as ModalSection, t as Modal } from "./Modal-DpKZHLZK.mjs";
|
|
7
|
-
import { i as PievoLogo, n as GitHubIcon, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-
|
|
7
|
+
import { i as PievoLogo, n as GitHubIcon, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-DJlWGia5.mjs";
|
|
8
8
|
import { t as setActiveTeamCookie } from "./teamCookie-B7hLOIie.mjs";
|
|
9
9
|
import { a as getTeamDetail, d as revokeTeamInvite, f as setTeamMemberRole, i as deleteTeam, l as removeTeamMember, n as createTeam, o as leaveTeam, r as createTeamInvite, s as listManagedTeams, t as addTeamMember, u as renameTeam } from "./teamFns-D4I-0dEB.mjs";
|
|
10
10
|
import { r as deriveLoopLifecycle } from "./lifecycleUi-BhRsBvJ7.mjs";
|
|
11
|
-
import { a as listChannels, c as testChannel, i as deleteChannel, n as Timeline, o as listMachines, r as createChannel, s as mergeRuns, t as MachinesModal } from "./notifyFns-
|
|
12
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/DashboardView-
|
|
11
|
+
import { a as listChannels, c as testChannel, i as deleteChannel, n as Timeline, o as listMachines, r as createChannel, s as mergeRuns, t as MachinesModal } from "./notifyFns-c7ZY2TWF.mjs";
|
|
12
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/DashboardView-D3E-zevQ.js
|
|
13
13
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
14
14
|
var import_jsx_runtime = require_jsx_runtime();
|
|
15
15
|
function LoopCard({ job, onOpen, onPickRun }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as __toESM } from "../_runtime.mjs";
|
|
2
2
|
import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
|
-
import { A as defu, H as getBaseURL, T as createFetch, Zt as toKebabCase, _ as capitalizeFirstLetter, dt as isSafeUrlScheme } from "./boot-
|
|
4
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/LoopPlaybook-
|
|
3
|
+
import { A as defu, H as getBaseURL, T as createFetch, Zt as toKebabCase, _ as capitalizeFirstLetter, dt as isSafeUrlScheme } from "./boot-CkFZynUz.mjs";
|
|
4
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/LoopPlaybook-DJlWGia5.js
|
|
5
5
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
6
6
|
var import_jsx_runtime = require_jsx_runtime();
|
|
7
7
|
var PROTO_POLLUTION_PATTERNS = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as __toESM } from "../_runtime.mjs";
|
|
2
2
|
import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
|
-
import { pt as isTaskPath } from "./boot-
|
|
3
|
+
import { pt as isTaskPath } from "./boot-CkFZynUz.mjs";
|
|
4
4
|
import { T as md, _ as fmt, j as tsShort, v as fnum } from "./ui-Dej2qjuS.mjs";
|
|
5
5
|
import { s as getArtifacts } from "./loopApi-BfMnXaKT.mjs";
|
|
6
6
|
import { t as artifactKind } from "./artifactKind-BW0isV8L.mjs";
|
|
@@ -9,7 +9,7 @@ import { i as isMarkdown, r as ViewerHead, t as ArtifactBody } from "./artifactV
|
|
|
9
9
|
import { n as ModalHead, t as Modal } from "./Modal-DpKZHLZK.mjs";
|
|
10
10
|
import { n as import_lib, t as esm_default } from "../_libs/html-react-parser+[...].mjs";
|
|
11
11
|
import { a as Area, c as Tooltip, i as XAxis, l as ResponsiveContainer, n as LineChart, o as Line, r as YAxis, s as CartesianGrid, t as AreaChart } from "../_libs/recharts+victory-vendor.mjs";
|
|
12
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/LoopView-
|
|
12
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/LoopView-BtMANpb_.js
|
|
13
13
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
14
14
|
var import_jsx_runtime = require_jsx_runtime();
|
|
15
15
|
/** Parse a `<loop-chart series="key:label:unit, ...">` attribute into StateField[]. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as __toESM } from "../_runtime.mjs";
|
|
2
2
|
import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
3
|
import { l as btnPrimary } from "./ui-Dej2qjuS.mjs";
|
|
4
|
-
import { i as PievoLogo, n as GitHubIcon, o as signIn, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-
|
|
5
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/SignIn-
|
|
4
|
+
import { i as PievoLogo, n as GitHubIcon, o as signIn, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-DJlWGia5.mjs";
|
|
5
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/SignIn-CjFonm71.js
|
|
6
6
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
7
7
|
var import_jsx_runtime = require_jsx_runtime();
|
|
8
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Ct as listRuns, S as countRuns, Z as getMachine, at as hasRunningRun, it as hasPendingRun, jt as machinePresence } from "./boot-
|
|
2
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/adapters-
|
|
1
|
+
import { Ct as listRuns, S as countRuns, Z as getMachine, at as hasRunningRun, it as hasPendingRun, jt as machinePresence } from "./boot-CkFZynUz.mjs";
|
|
2
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/adapters-vbuo_-wD.js
|
|
3
3
|
/**
|
|
4
4
|
* Map the new relational rows (Loop + Run) onto the shapes the UI already
|
|
5
5
|
* renders (JobSummary / JobDetail / RunSummary / JobFull), so the dashboard
|
|
@@ -62,7 +62,7 @@ async function toJobSummary(loop) {
|
|
|
62
62
|
cron: loop.cron,
|
|
63
63
|
scheduleMode: loop.scheduleMode,
|
|
64
64
|
continuousDelayMinutes: loop.continuousDelayMinutes,
|
|
65
|
-
kind:
|
|
65
|
+
kind: `exec:${loop.agent}`,
|
|
66
66
|
model: loop.model ?? null,
|
|
67
67
|
reasoningEffort: loop.reasoningEffort ?? null,
|
|
68
68
|
hasUi: !!loop.ui,
|
|
@@ -96,7 +96,6 @@ function toJobFull(loop) {
|
|
|
96
96
|
completionReason: loop.completionReason ?? null,
|
|
97
97
|
pauseCause: loop.pauseCause ?? null,
|
|
98
98
|
taskFile: loop.taskFile ?? void 0,
|
|
99
|
-
workflow: loop.workflow ?? void 0,
|
|
100
99
|
stateSchema: loop.stateSchema ?? void 0,
|
|
101
100
|
ui: loop.ui ?? void 0,
|
|
102
101
|
channelId: loop.channelId ?? null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as getArtifactFile, Gt as safeRelPath, V as getArtifactSync, _t as listArtifactsWithMeta } from "./boot-
|
|
2
|
-
import { t as toArtifactSummary } from "./adapters-
|
|
3
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/artifactFiles-
|
|
1
|
+
import { B as getArtifactFile, Gt as safeRelPath, V as getArtifactSync, _t as listArtifactsWithMeta } from "./boot-CkFZynUz.mjs";
|
|
2
|
+
import { t as toArtifactSummary } from "./adapters-vbuo_-wD.mjs";
|
|
3
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/artifactFiles-BGod8IWQ.js
|
|
4
4
|
/**
|
|
5
5
|
* Server-side reads over a loop's live-synced artifacts (Phase 2). Pure helpers
|
|
6
6
|
* (no request/session context) so they're shared by the lazy server fns
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as sql, C as or, S as notInArray, _ as isNull$1, b as lte, c as asc, d as eq, f as gt, g as isNotNull, h as inArray, l as desc, m as ilike, o as count, p as gte, u as and, v as like, x as ne, y as lt } from "../_libs/drizzle-orm+postgres.mjs";
|
|
2
|
-
import { $ as getProtocol, A as defu, H as getBaseURL, I as ensureTeam, J as getHost, K as getEnvVar, L as env, Nt as normalizePathname, Ot as loginGateEnabled, Q as getOrigin, U as getBooleanEnvVar, Wt as resolveBaseURL, Xt as teamIdForUser, _ as capitalizeFirstLetter, a as BetterAuthError, f as ValidationError$1, gt as kAPIErrorHeaderSymbol, ht as isTest, k as db, l as ENV, lt as isProduction, m as betterFetch, mt as isTeamMember, n as APIError$1, nn as wildcardMatch, o as BetterCallError, ot as isDevelopment, r as BASE_ERROR_CODES, st as isDynamicBaseURLConfig, t as APIError, ut as isRequestLike, w as createDefu } from "./boot-
|
|
3
|
-
import { C as withSpan, S as shouldPublishLog, _ as logger, a as __getBetterAuthGlobal, b as runWithTransaction, c as createRandomStringGenerator, d as getAuthTables, f as getBetterAuthVersion, g as initGetModelName, h as initGetFieldName, l as generateId$2, m as import_src, n as ATTR_HOOK_TYPE, o as createAdapterFactory, p as getCurrentAdapter, r as ATTR_OPERATION_ID, s as createLogger, t as ATTR_CONTEXT, u as getAsyncLocalStorage, v as queueAfterTransactionHook, x as safeJSONParse, y as runWithAdapter } from "./factory-
|
|
2
|
+
import { $ as getProtocol, A as defu, H as getBaseURL, I as ensureTeam, J as getHost, K as getEnvVar, L as env, Nt as normalizePathname, Ot as loginGateEnabled, Q as getOrigin, U as getBooleanEnvVar, Wt as resolveBaseURL, Xt as teamIdForUser, _ as capitalizeFirstLetter, a as BetterAuthError, f as ValidationError$1, gt as kAPIErrorHeaderSymbol, ht as isTest, k as db, l as ENV, lt as isProduction, m as betterFetch, mt as isTeamMember, n as APIError$1, nn as wildcardMatch, o as BetterCallError, ot as isDevelopment, r as BASE_ERROR_CODES, st as isDynamicBaseURLConfig, t as APIError, ut as isRequestLike, w as createDefu } from "./boot-CkFZynUz.mjs";
|
|
3
|
+
import { C as withSpan, S as shouldPublishLog, _ as logger, a as __getBetterAuthGlobal, b as runWithTransaction, c as createRandomStringGenerator, d as getAuthTables, f as getBetterAuthVersion, g as initGetModelName, h as initGetFieldName, l as generateId$2, m as import_src, n as ATTR_HOOK_TYPE, o as createAdapterFactory, p as getCurrentAdapter, r as ATTR_OPERATION_ID, s as createLogger, t as ATTR_CONTEXT, u as getAsyncLocalStorage, v as queueAfterTransactionHook, x as safeJSONParse, y as runWithAdapter } from "./factory-L3gsmDL7.mjs";
|
|
4
4
|
import { randomBytes, scrypt } from "node:crypto";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1700,7 +1700,7 @@ var JOIN_TYPE_SQL = freeze({
|
|
|
1700
1700
|
Using: "using"
|
|
1701
1701
|
});
|
|
1702
1702
|
//#endregion
|
|
1703
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/auth-
|
|
1703
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/auth-Ca-um-e8.js
|
|
1704
1704
|
/**
|
|
1705
1705
|
* @internal
|
|
1706
1706
|
*/
|
|
@@ -15993,7 +15993,7 @@ var createKyselyAdapter = async (config) => {
|
|
|
15993
15993
|
if ("getConnection" in db) dialect = new MysqlDialect(db);
|
|
15994
15994
|
if ("connect" in db) dialect = new PostgresDialect({ pool: db });
|
|
15995
15995
|
if ("fileControl" in db) {
|
|
15996
|
-
const { BunSqliteDialect } = await import("./bun-sqlite-dialect-BW9W1_Ps-
|
|
15996
|
+
const { BunSqliteDialect } = await import("./bun-sqlite-dialect-BW9W1_Ps-CG9VPNj0.mjs");
|
|
15997
15997
|
dialect = new BunSqliteDialect({ database: db });
|
|
15998
15998
|
}
|
|
15999
15999
|
if ("createSession" in db) {
|
|
@@ -16009,12 +16009,12 @@ var createKyselyAdapter = async (config) => {
|
|
|
16009
16009
|
if (error !== null && typeof error === "object" && "code" in error && error.code !== "ERR_UNKNOWN_BUILTIN_MODULE") throw error;
|
|
16010
16010
|
}
|
|
16011
16011
|
if (DatabaseSync && db instanceof DatabaseSync) {
|
|
16012
|
-
const { NodeSqliteDialect } = await import("./node-sqlite-dialect-
|
|
16012
|
+
const { NodeSqliteDialect } = await import("./node-sqlite-dialect-Dr9_QokR.mjs");
|
|
16013
16013
|
dialect = new NodeSqliteDialect({ database: db });
|
|
16014
16014
|
}
|
|
16015
16015
|
}
|
|
16016
16016
|
if ("batch" in db && "exec" in db && "prepare" in db) {
|
|
16017
|
-
const { D1SqliteDialect } = await import("./d1-sqlite-dialect-BLC8LXE6-
|
|
16017
|
+
const { D1SqliteDialect } = await import("./d1-sqlite-dialect-BLC8LXE6-DBf7xVin.mjs");
|
|
16018
16018
|
dialect = new D1SqliteDialect({ database: db });
|
|
16019
16019
|
}
|
|
16020
16020
|
return {
|
|
@@ -36526,7 +36526,7 @@ async function getBaseAdapter(options, handleDirectDatabase) {
|
|
|
36526
36526
|
acc[key] = [];
|
|
36527
36527
|
return acc;
|
|
36528
36528
|
}, {});
|
|
36529
|
-
const { memoryAdapter } = await import("./dist-
|
|
36529
|
+
const { memoryAdapter } = await import("./dist-CwI9FwLx.mjs");
|
|
36530
36530
|
adapter = memoryAdapter(memoryDB)(options);
|
|
36531
36531
|
} else if (typeof options.database === "function") adapter = options.database(options);
|
|
36532
36532
|
else adapter = await handleDirectDatabase(options);
|
|
@@ -36540,10 +36540,10 @@ async function getBaseAdapter(options, handleDirectDatabase) {
|
|
|
36540
36540
|
}
|
|
36541
36541
|
async function getAdapter(options) {
|
|
36542
36542
|
return getBaseAdapter(options, async (opts) => {
|
|
36543
|
-
const { createKyselyAdapter } = await import("./kysely-adapter-
|
|
36543
|
+
const { createKyselyAdapter } = await import("./kysely-adapter-Czkfz-W-.mjs");
|
|
36544
36544
|
const { kysely, databaseType, transaction } = await createKyselyAdapter(opts);
|
|
36545
36545
|
if (!kysely) throw new BetterAuthError("Failed to initialize database adapter");
|
|
36546
|
-
const { kyselyAdapter } = await import("./kysely-adapter-
|
|
36546
|
+
const { kyselyAdapter } = await import("./kysely-adapter-Czkfz-W-.mjs");
|
|
36547
36547
|
return kyselyAdapter(kysely, {
|
|
36548
36548
|
type: databaseType || "sqlite",
|
|
36549
36549
|
debugLogs: opts.database && "debugLogs" in opts.database ? opts.database.debugLogs : false,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { G as getCliGateway, V as getArtifactSync, q as getGateway } from "./boot-
|
|
1
|
+
import { G as getCliGateway, V as getArtifactSync, q as getGateway } from "./boot-CkFZynUz.mjs";
|
|
2
2
|
export { getArtifactSync, getCliGateway, getGateway };
|