orc-ai 0.1.46 → 0.1.47
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/dist/index.js +197 -196
- package/dist/web/assets/{Agents-CEplG_Sq.js → Agents-DD4xAdLQ.js} +1 -1
- package/dist/web/assets/{Attention-uaY9cxXL.js → Attention-V6qCS20I.js} +1 -1
- package/dist/web/assets/{Audit-0_Lq85as.js → Audit-bBVclx9F.js} +1 -1
- package/dist/web/assets/{Dashboard-91bBlQtq.js → Dashboard-CIh2K0FF.js} +1 -1
- package/dist/web/assets/{DocumentWorkspace-CEuyRR-0.js → DocumentWorkspace-PsD0kzUF.js} +1 -1
- package/dist/web/assets/{FileEditor-BpERbLFO.js → FileEditor-RVlQIVWn.js} +1 -1
- package/dist/web/assets/{JobWebhooks-BNsw4f8L.js → JobWebhooks-CoFraeFc.js} +1 -1
- package/dist/web/assets/{Jobs-CstMK6Au.js → Jobs-DjI_YMAA.js} +1 -1
- package/dist/web/assets/{Knowledge-C1c4cYt7.js → Knowledge-DMAOn0iH.js} +1 -1
- package/dist/web/assets/{PackageCatalog-CUpbmrk6.js → PackageCatalog-X1ZZB-P7.js} +1 -1
- package/dist/web/assets/{Pager-CMNYL7a8.js → Pager-CMh30dp4.js} +1 -1
- package/dist/web/assets/{Rules-BzCjRHp4.js → Rules-BNiDiUnr.js} +1 -1
- package/dist/web/assets/{Sessions-DCf-0TTj.js → Sessions-N3CCkXrg.js} +1 -1
- package/dist/web/assets/{Settings-CE5nbRxA.js → Settings-C_-DKk-Q.js} +2 -2
- package/dist/web/assets/{Skills-Cb8Febl5.js → Skills-BpRge1yJ.js} +1 -1
- package/dist/web/assets/{SourceEditor-B8cxr2bP.js → SourceEditor-DcZduN5g.js} +1 -1
- package/dist/web/assets/{Tasks-B_Suxhgp.js → Tasks-wCQWVIFY.js} +1 -1
- package/dist/web/assets/{Terminals-66sm3KPd.js → Terminals-BX77_gra.js} +3 -3
- package/dist/web/assets/{Webhooks-DJDJPR0E.js → Webhooks-2tiGvHyx.js} +1 -1
- package/dist/web/assets/{abnfDiagram-VCTEODGH-B1RsHL1G.js → abnfDiagram-VCTEODGH-D6z8wrMR.js} +1 -1
- package/dist/web/assets/{arc-BtMvHy1E.js → arc-BG4KWrJo.js} +1 -1
- package/dist/web/assets/{architectureDiagram-5GKGNRK7-qYguZMXe.js → architectureDiagram-5GKGNRK7-Cl_LN0pI.js} +1 -1
- package/dist/web/assets/{blockDiagram-I7D4REHJ-lcIeJPyV.js → blockDiagram-I7D4REHJ-DDcSWANX.js} +1 -1
- package/dist/web/assets/{c4Diagram-7LVT6UL2-siCkttsR.js → c4Diagram-7LVT6UL2-1TklobpM.js} +1 -1
- package/dist/web/assets/channel-6li7uxlb.js +1 -0
- package/dist/web/assets/{chunk-2Q5K7J3B-Bb9unDvJ.js → chunk-2Q5K7J3B-1ZXhRK9s.js} +1 -1
- package/dist/web/assets/{chunk-5VM5RSS4-B2Tru9pc.js → chunk-5VM5RSS4--PtYqixL.js} +1 -1
- package/dist/web/assets/{chunk-F27PBJKO-p10gy9Kh.js → chunk-F27PBJKO-CnodLCYk.js} +1 -1
- package/dist/web/assets/{chunk-IMKFNOWR-CI_ZhF8b.js → chunk-IMKFNOWR-Dtujfpt3.js} +1 -1
- package/dist/web/assets/{chunk-JWPE2WC7-CiKCO1WC.js → chunk-JWPE2WC7-BhzEb4oh.js} +1 -1
- package/dist/web/assets/{chunk-POPQ4Y6H-B0NwzhXy.js → chunk-POPQ4Y6H-CCRH8Odz.js} +1 -1
- package/dist/web/assets/{chunk-SVP7TREG-CFHs67JZ.js → chunk-SVP7TREG-DvO1oor5.js} +1 -1
- package/dist/web/assets/{chunk-TICWLB2K-B6cRPr6B.js → chunk-TICWLB2K-HSsE-7e0.js} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-BhUdR4ez.js → chunk-XXDRQBXY-CyZDfwNW.js} +1 -1
- package/dist/web/assets/classDiagram-ZZMXUADV-DQx2YVEE.js +1 -0
- package/dist/web/assets/classDiagram-v2-VYDZK3BY-DQx2YVEE.js +1 -0
- package/dist/web/assets/{cose-bilkent-JH36ORCC-BLNLFXT9.js → cose-bilkent-JH36ORCC-COSptbUK.js} +1 -1
- package/dist/web/assets/{cynefin-OW5HDTMX-CC6vxsqb.js → cynefin-OW5HDTMX-BjeQd0nx.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-5FMLGOSQ-NHgsACsz.js → cynefinDiagram-5FMLGOSQ-D2tfpg5R.js} +1 -1
- package/dist/web/assets/{dagre-GXQ25YYZ-BzNLhViX.js → dagre-GXQ25YYZ-LPFS53FJ.js} +1 -1
- package/dist/web/assets/{diagram-S7CK7UJ4-Ce8mHvZR.js → diagram-S7CK7UJ4-CJfymrr7.js} +1 -1
- package/dist/web/assets/{diagram-UQ7AKVKN-DK0OXoqx.js → diagram-UQ7AKVKN-BxKvn9Ur.js} +1 -1
- package/dist/web/assets/{diagram-VSXAHHWV-CmDaKtQF.js → diagram-VSXAHHWV-Nqep4NOh.js} +1 -1
- package/dist/web/assets/{diagram-VX7I27RA-BNgg2pZL.js → diagram-VX7I27RA-DLNoOSxD.js} +1 -1
- package/dist/web/assets/{diagram-Z3DM3KII-tnf8OHw6.js → diagram-Z3DM3KII-CY3P-ZPA.js} +1 -1
- package/dist/web/assets/{download-B2osOPIu.js → download-zED8Kwne.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-PWID7BFC-DZtIeMeM.js → ebnfDiagram-PWID7BFC-ChViZVtc.js} +1 -1
- package/dist/web/assets/{erDiagram-RLTQ6QDP-BKT2FPVm.js → erDiagram-RLTQ6QDP-ul1XVJVK.js} +1 -1
- package/dist/web/assets/{flowDiagram-HODETNUW-CHw5_r1-.js → flowDiagram-HODETNUW-CP6v5LZZ.js} +1 -1
- package/dist/web/assets/{folder-open-r4oRmXj_.js → folder-open-BUB_WGMS.js} +1 -1
- package/dist/web/assets/{ganttDiagram-EL5Y4UJY-FRHAZrPD.js → ganttDiagram-EL5Y4UJY-DL4TffYj.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-WWUBYQGX-C-9oXRCW.js → gitGraphDiagram-WWUBYQGX-D6vY0fsS.js} +1 -1
- package/dist/web/assets/{highlighted-body-KPVGNVTW-BlZHz_IK.js → highlighted-body-KPVGNVTW-Cu3NJ2kc.js} +1 -1
- package/dist/web/assets/{index-CPDfUOSb.js → index-CVKguVuJ.js} +5 -5
- package/dist/web/assets/{infoDiagram-27XIBGKW-LEo2tjDb.js → infoDiagram-27XIBGKW-BlFz7M9s.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-5VMMS53U-Ba64R0rC.js → ishikawaDiagram-5VMMS53U-DmwD3lCC.js} +1 -1
- package/dist/web/assets/{journeyDiagram-3NMN7TZE-C_FG60vM.js → journeyDiagram-3NMN7TZE-S4Kc25zO.js} +1 -1
- package/dist/web/assets/{kanban-definition-UXKFOSKX-CKlB_XGP.js → kanban-definition-UXKFOSKX-CjO1NhtQ.js} +1 -1
- package/dist/web/assets/{layout-DsU5WrOP.js → layout-Dq9Y2uvt.js} +1 -1
- package/dist/web/assets/{linear-DoH6cWq9.js → linear-nLdM3nNe.js} +1 -1
- package/dist/web/assets/{list-tW8hNOu0.js → list-CE13IgiY.js} +1 -1
- package/dist/web/assets/{mermaid-HWGCJPDP-IhRguDrF.js → mermaid-HWGCJPDP-pjgtNVt2.js} +6 -6
- package/dist/web/assets/{mindmap-definition-YA3MSWOX-BXbWjYkv.js → mindmap-definition-YA3MSWOX-DsxpW-uk.js} +1 -1
- package/dist/web/assets/{pegDiagram-XKGWAZYB-L5o1n60H.js → pegDiagram-XKGWAZYB-DOKdX_Ft.js} +1 -1
- package/dist/web/assets/{pencil-CLmacXp-.js → pencil-CKDsHvse.js} +1 -1
- package/dist/web/assets/{pieDiagram-E7YTZNPT-BSxLWjVr.js → pieDiagram-E7YTZNPT-iifNLjuz.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-AXDQQJYC-fbNWnHcC.js → quadrantDiagram-AXDQQJYC-Ca9EdnrG.js} +1 -1
- package/dist/web/assets/{railroadDiagram-O6MQD6OU-k469-ESt.js → railroadDiagram-O6MQD6OU-DNcc2r4p.js} +1 -1
- package/dist/web/assets/{refresh-cw-DYPDY5a5.js → refresh-cw-CBpDF1Q6.js} +1 -1
- package/dist/web/assets/{requirementDiagram-BXWQKSXE-BJc6qLWt.js → requirementDiagram-BXWQKSXE-Bo2W4Z-S.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-P5KCCOFB-D5RMyDjd.js → sankeyDiagram-P5KCCOFB-BX_lnGu7.js} +1 -1
- package/dist/web/assets/{save-BORlB0Do.js → save-BK4gikTj.js} +1 -1
- package/dist/web/assets/{scroll-area-RE2Hf4_G.js → scroll-area-BrMwE434.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-WJ2MYXX4-u6tAqqXs.js → sequenceDiagram-WJ2MYXX4-pXgbZI8i.js} +1 -1
- package/dist/web/assets/{sizeCapture-INFHLROL-BcjbbEkn.js → sizeCapture-INFHLROL-Cc-w7K4o.js} +1 -1
- package/dist/web/assets/{stateDiagram-D77RDMKH-BWP6t7i0.js → stateDiagram-D77RDMKH-BRg29_UM.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-MP3YSRHH-IRoE1WuW.js +1 -0
- package/dist/web/assets/{swimlanes-42K2YHIH-DdI2UlDa.js → swimlanes-42K2YHIH-D1YPvrQr.js} +1 -1
- package/dist/web/assets/swimlanesDiagram-VR7AAH4N-C2iXhtwv.js +8 -0
- package/dist/web/assets/{timeline-definition-24CTP7MA-7BSoVurH.js → timeline-definition-24CTP7MA-CvilnfxW.js} +1 -1
- package/dist/web/assets/{upload-72JIkIbE.js → upload-BKVutGgF.js} +1 -1
- package/dist/web/assets/{useJobs-ZHuwYAWh.js → useJobs-DSLKgV8L.js} +1 -1
- package/dist/web/assets/{useKnowledge-0BbApxye.js → useKnowledge-BbtBJLNm.js} +1 -1
- package/dist/web/assets/{useMemories-Dki5Nw7-.js → useMemories-CPw6917_.js} +1 -1
- package/dist/web/assets/useProjectScope-Gvzzt8hR.js +1 -0
- package/dist/web/assets/{vennDiagram-4TSXK5OY-Bdk8Zt1C.js → vennDiagram-4TSXK5OY-yNMm3LJf.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-VM6X3IG4-CTL5nTPT.js → wardleyDiagram-VM6X3IG4-CMCWNcNe.js} +1 -1
- package/dist/web/assets/{xychartDiagram-S5SC5T6Z-BxW9n9dP.js → xychartDiagram-S5SC5T6Z-CMMtcXgw.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/channel-pL6mjuc4.js +0 -1
- package/dist/web/assets/classDiagram-ZZMXUADV-DH4gAk6Y.js +0 -1
- package/dist/web/assets/classDiagram-v2-VYDZK3BY-DH4gAk6Y.js +0 -1
- package/dist/web/assets/stateDiagram-v2-MP3YSRHH-CKpYvAls.js +0 -1
- package/dist/web/assets/swimlanesDiagram-VR7AAH4N-DZk36Yj2.js +0 -8
- package/dist/web/assets/useProjectScope-ZTvfXwS1.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as b,j as e,X as J,Y as X,Z,_ as M,$ as B,B as k,l as I,a0 as ee,a1 as K,a as te,u as U,a2 as ae,b as T,E as G,V as ne,L as se,a3 as re,a4 as ie,a5 as oe,a6 as de,a7 as le,a8 as ce,a9 as ue,aa as _,d as D}from"./index-
|
|
1
|
+
import{r as b,j as e,X as J,Y as X,Z,_ as M,$ as B,B as k,l as I,a0 as ee,a1 as K,a as te,u as U,a2 as ae,b as T,E as G,V as ne,L as se,a3 as re,a4 as ie,a5 as oe,a6 as de,a7 as le,a8 as ce,a9 as ue,aa as _,d as D}from"./index-CVKguVuJ.js";import{p as ge,i as q}from"./public-api-BvD4z7ja.js";const z={specialist:`---
|
|
2
2
|
name: Specialist
|
|
3
3
|
description: Describe when to use this specialist
|
|
4
4
|
---
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as y,j as t,V as N,r as v,a as k,b,d as f,B as c,T as S}from"./index-
|
|
1
|
+
import{g as y,j as t,V as N,r as v,a as k,b,d as f,B as c,T as S}from"./index-CVKguVuJ.js";function A({request:e}){var g;const[r,d]=v.useState(""),[i,l]=v.useState([]),u=k(),n=b({mutationFn:s=>f.humanRequests.respond(e.id,e.version,s),onSettled:()=>u.invalidateQueries({queryKey:["human-requests"]})}),p=b({mutationFn:()=>f.humanRequests.cancel(e.id,e.version),onSettled:()=>u.invalidateQueries({queryKey:["human-requests"]})}),o=e.status==="pending",a=(g=e.input.action)==null?void 0:g.input,m=a!=null&&a.item&&typeof a.item=="object"?a.item:void 0,h=typeof(a==null?void 0:a.threadId)=="string",x=h?{...Object.fromEntries(Object.entries(a??{}).filter(([s])=>!["threadId","turnId","itemId","startedAtMs","item","availableDecisions","proposedExecpolicyAmendment","commandActions","kind"].includes(s))),...m!=null&&m.changes?{changes:m.changes}:{}}:a;return t.jsxs("article",{"data-testid":`attention-request-${e.id}`,className:"rounded-lg border border-border bg-surface p-5 space-y-4",children:[t.jsxs("div",{className:"flex flex-wrap justify-between gap-2 text-xs text-outline",children:[t.jsxs("span",{children:[e.input.kind==="question"?"Question":"Approval"," ·"," ",e.input.origin.backend]}),t.jsx("span",{children:o?"Waiting for you":e.status==="unavailable"?"Agent unavailable":"Answered · waiting for agent delivery"})]}),t.jsx("h2",{className:"text-base font-medium whitespace-pre-wrap",children:e.input.prompt}),t.jsxs("p",{className:"text-xs text-outline break-all",children:["Session ",e.input.origin.session_id]}),e.input.action&&t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsxs("p",{children:["Host: ",t.jsx("strong",{children:e.input.action.host})," · Folder: ",e.input.action.cwd]}),t.jsxs("pre",{"data-testid":"attention-action",className:"whitespace-pre-wrap break-all rounded-md bg-background p-3 text-xs",children:[e.input.action.tool,`
|
|
2
2
|
`,JSON.stringify(x&&Object.keys(x).length?x:a,null,2)]}),h&&t.jsxs("details",{className:"text-xs text-outline",children:[t.jsx("summary",{className:"cursor-pointer",children:"Full request details"}),t.jsx("pre",{className:"whitespace-pre-wrap break-all mt-2",children:JSON.stringify(a,null,2)})]}),t.jsx("p",{className:"text-outline",children:"Your approval lets this agent continue with its existing permissions."})]}),o&&e.input.kind==="question"&&t.jsxs("form",{className:"space-y-3",onSubmit:s=>{s.preventDefault(),n.mutate({kind:"question",answer:r,...i.length?{selected_choices:i}:{}})},children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:e.input.choices.map(s=>t.jsxs(c,{variant:(e.input.multi_select?i.includes(s):r===s)?"default":"outline",type:"button",className:"h-auto min-h-9 flex-col items-start whitespace-normal text-left",disabled:n.isPending,"data-testid":`attention-choice-${s}`,onClick:()=>{if(e.input.multi_select){const j=i.includes(s)?i.filter(w=>w!==s):[...i,s];l(j),d(j.join(", "))}else d(s)},children:[t.jsx("span",{children:s}),Object.keys(e.input.choice_descriptions).includes(s)&&e.input.choice_descriptions[s]&&t.jsx("span",{className:"text-xs font-normal opacity-75 max-w-sm",children:e.input.choice_descriptions[s]})]},s))}),t.jsxs("label",{htmlFor:`answer-${e.id}`,className:"block text-sm space-y-2",children:[t.jsx("span",{children:"Your answer"}),t.jsx(S,{id:`answer-${e.id}`,"data-testid":"attention-answer",value:r,onChange:s=>{d(s.target.value),l([])},maxLength:16e3,disabled:n.isPending})]}),t.jsx(c,{"data-testid":"attention-send",type:"submit",disabled:!r.trim()||n.isPending,children:n.isPending?"Sending…":"Send answer"})]}),o&&e.input.kind==="approval"&&t.jsxs("div",{className:"flex gap-3",children:[t.jsx(c,{"data-testid":"attention-approve",disabled:n.isPending,onClick:()=>n.mutate({kind:"approval",approved:!0}),children:"Approve"}),t.jsx(c,{"data-testid":"attention-deny",variant:"outline",disabled:n.isPending,onClick:()=>n.mutate({kind:"approval",approved:!1}),children:"Deny"})]}),e.response&&t.jsx("p",{"data-testid":"attention-response",className:"text-sm whitespace-pre-wrap",children:e.response.kind==="question"?e.response.answer:e.response.approved?"Approved":"Denied"}),e.delivery_error&&t.jsx("p",{role:"status",className:"text-sm text-error",children:e.delivery_error}),(o||e.status==="unavailable")&&t.jsx(c,{"data-testid":"attention-cancel",variant:"ghost",disabled:n.isPending||p.isPending,onClick:()=>p.mutate(),children:o?"Cancel request":"Dismiss"}),p.error&&t.jsx("p",{role:"alert",children:p.error.message}),n.error&&t.jsx("p",{role:"alert","data-testid":"attention-error",className:"text-sm text-destructive",children:n.error.message})]})}function C(){var r,d,i;const e=y();return t.jsxs("div",{"data-testid":"attention-view",className:"max-w-4xl",children:[t.jsx(N,{title:"Attention needed",meta:"Questions and approvals from your agents"}),e.isLoading&&t.jsx("p",{role:"status",children:"Loading requests…"}),e.error&&t.jsx("p",{role:"alert",children:e.error.message}),((r=e.data)==null?void 0:r.length)===0&&t.jsx("p",{"data-testid":"attention-empty",className:"text-outline",children:"Nothing needs your attention."}),((d=e.data)==null?void 0:d.length)===100&&t.jsx("p",{className:"text-sm text-outline mb-4",children:"Showing the first 100 requests, with pending requests first. Resolving or dismissing entries reveals more."}),t.jsx("div",{className:"space-y-4",children:(i=e.data)==null?void 0:i.map(l=>t.jsx(A,{request:l},l.id))})]})}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ac as T,j as e,a4 as L,a5 as P,a6 as R,a7 as $,a8 as O,E as w,S,ad as A,ae as h,r as k,af as I,f as V,m as z,a1 as H,a2 as B,ag as U,ah as F,t as J,v as G,w as v,x as c,y as M,z as x,V as Y}from"./index-
|
|
1
|
+
import{ac as T,j as e,a4 as L,a5 as P,a6 as R,a7 as $,a8 as O,E as w,S,ad as A,ae as h,r as k,af as I,f as V,m as z,a1 as H,a2 as B,ag as U,ah as F,t as J,v as G,w as v,x as c,y as M,z as x,V as Y}from"./index-CVKguVuJ.js";import{P as Z}from"./Pager-CMh30dp4.js";import{S as y}from"./scroll-area-BrMwE434.js";import{u as q}from"./useProjectScope-Gvzzt8hR.js";const K={file:"text-outline",task:"text-outline",decision:"text-outline",error:"text-error",git:"text-outline",rule:"text-outline",plan:"text-outline"},Q="text-outline";function W(n){return K[n]??Q}function X({sessionId:n,open:a,onClose:r}){const{data:t,isLoading:u,error:p,refetch:j}=T(n??"");return e.jsx(L,{open:a,onOpenChange:o=>!o&&r(),children:e.jsxs(P,{side:"right",className:"w-[540px] max-w-[90vw]",children:[e.jsx(R,{children:e.jsx($,{children:u?"Loading...":t?`${t.agent??"Session"} ${t.agent_version?`v${t.agent_version}`:""}`:"Session Detail"})}),e.jsxs(O,{children:[e.jsx("p",{className:"mb-4 text-sm text-outline",children:"This audit record contains summaries and events. Open Sessions to read native agent conversations or resume them."}),p?e.jsx(w,{message:p.message,onRetry:()=>j()}):u?e.jsx("div",{className:"space-y-4",children:[...Array(4)].map((o,i)=>e.jsx(S,{className:"h-8 w-full bg-surface-highest"},i))}):t?e.jsxs("div",{className:"space-y-6",children:[t.summary&&e.jsx("div",{className:"font-body text-xs text-on-surface leading-relaxed",children:e.jsx(A,{children:t.summary})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(h,{label:"ID",children:e.jsx("span",{className:"font-mono text-xs break-all",children:t.id})}),e.jsx(h,{label:"Project ID",children:t.project_id??"—"}),e.jsx(h,{label:"Job Run ID",children:t.job_run_id??"—"}),e.jsx(h,{label:"Tokens Used",children:t.tokens_used!=null?t.tokens_used.toLocaleString():"—"}),e.jsx(h,{label:"Created",children:new Date(t.created_at).toLocaleString()})]}),t.events.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-label text-xs font-medium text-outline mb-3",children:["Events (",t.events.length,")"]}),e.jsx(y,{className:"h-[300px]",children:e.jsx("div",{className:"space-y-1",children:[...t.events].sort((o,i)=>new Date(o.created_at).getTime()-new Date(i.created_at).getTime()).map(o=>e.jsx(ee,{event:o},o.id))})})]}),t.snapshot&&e.jsxs("div",{children:[e.jsx("div",{className:"font-label text-xs font-medium text-outline mb-3",children:"Snapshot"}),e.jsx(y,{className:"h-[200px]",children:e.jsx("pre",{className:"font-mono text-xs text-on-surface-variant whitespace-pre-wrap break-words bg-background border-l border-border p-3",children:t.snapshot})})]})]}):e.jsx("div",{className:"font-body text-xs text-outline py-8 text-center",children:"Session not found"})]})]})})}function ee({event:n}){const[a,r]=k.useState(!1),t=n.data!=null;return e.jsxs("div",{className:"border-b border-border/65",children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-surface-high transition-colors",onClick:()=>t&&r(!a),"aria-expanded":t?a:void 0,children:[t?a?e.jsx(I,{size:10,className:"text-outline flex-shrink-0"}):e.jsx(V,{size:10,className:"text-outline flex-shrink-0"}):e.jsx("span",{className:"w-[10px] flex-shrink-0"}),e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 text-[10px] font-label font-medium ${W(n.type)}`,children:n.type}),e.jsx("span",{className:"flex-1 font-body text-xs text-outline truncate",children:se(n.data)}),e.jsx("span",{className:"font-label text-[10px] text-outline flex-shrink-0",children:new Date(n.created_at).toLocaleTimeString()})]}),a&&t&&e.jsx("div",{className:"px-3 pb-2",children:e.jsx("pre",{className:"font-mono text-xs text-on-surface-variant whitespace-pre-wrap break-words bg-background border-l border-border/65 p-2 max-h-48 overflow-auto",children:JSON.stringify(n.data,null,2)})})]})}function se(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){const a=n;if(typeof a.path=="string")return a.path;if(typeof a.content=="string")return a.content.length>80?`${a.content.slice(0,80)}...`:a.content;if(typeof a.message=="string")return a.message;if(typeof a.summary=="string")return a.summary;const r=Object.keys(a);return r.length<=3?r.join(", "):`${r.length} fields`}return String(n)}const b=25,m="font-label text-xs font-medium text-outline";function te({projectId:n}){const a=z("sm"),[r,t]=H("order","desc",["asc","desc"]),[u,p]=k.useState({order:r,page:0}),j=u.order===r?u.page:0,o=s=>p({order:r,page:s}),{selectedId:i,openDetail:g,closeDetail:_}=B("/audit","sessionId"),{data:l,isLoading:D,error:N,refetch:E}=U({...n==="all"?{}:{project_id:n},limit:b,offset:j*b,order:r});if(N)return e.jsx(w,{message:N.message,onRetry:()=>E()});const f=(l==null?void 0:l.sessions)??[],C=(l==null?void 0:l.total)??0;return e.jsxs("section",{"data-testid":"logged-sessions",children:[e.jsx("div",{className:"mb-4 flex justify-end",children:e.jsxs("select",{"aria-label":"Sort audit by date","data-testid":"audit-date-sort",value:r,onChange:s=>{o(0),t(s.target.value)},className:"min-h-11 rounded-md border border-control-border bg-background px-3 text-sm text-on-surface",children:[e.jsx("option",{value:"desc",children:"Created: newest first"}),e.jsx("option",{value:"asc",children:"Created: oldest first"})]})}),D?e.jsx("div",{className:"space-y-2",children:[...Array(5)].map((s,d)=>e.jsx(S,{className:"h-10 w-full bg-surface-highest"},d))}):f.length===0?e.jsx(F,{message:"No audit records"}):e.jsxs("div",{className:"min-w-0 overflow-hidden",children:[a?e.jsxs(J,{children:[e.jsx(G,{children:e.jsxs(v,{className:"border-b border-border hover:bg-transparent",children:[e.jsx(c,{className:m,children:"Agent"}),e.jsx(c,{className:`${m} w-24`,children:"Version"}),e.jsx(c,{className:m,children:"Summary"}),e.jsx(c,{className:`${m} w-24`,children:"Project"}),e.jsx(c,{className:`${m} w-28`,children:"Tokens Used"}),e.jsx(c,{className:`${m} w-36`,children:"Created"})]})}),e.jsx(M,{children:f.map(s=>e.jsxs(v,{"data-testid":"session-row","data-session-id":s.id,className:"border-b border-border/65 hover:bg-surface-high cursor-pointer",onClick:()=>g(s.id),children:[e.jsx(x,{className:"font-label text-xs text-primary",children:e.jsx("button",{type:"button",className:"text-left font-medium hover:underline",onClick:d=>{d.stopPropagation(),g(s.id)},children:s.agent??"Session"})}),e.jsx(x,{className:"font-label text-xs text-outline",children:s.agent_version??"—"}),e.jsx(x,{className:"font-body text-xs text-on-surface-variant max-w-sm truncate",children:s.summary??"—"}),e.jsx(x,{className:"font-label text-xs text-outline",children:s.project_id?s.project_id.slice(-6):"—"}),e.jsx(x,{className:"font-label text-xs text-outline text-right",children:s.tokens_used!=null?s.tokens_used.toLocaleString():"—"}),e.jsx(x,{className:"font-label text-xs text-outline",children:new Date(s.created_at).toLocaleString()})]},s.id))})]}):e.jsx("div",{className:"divide-y divide-border",children:f.map(s=>{var d;return e.jsxs("article",{"data-testid":"session-row","data-session-id":s.id,className:"py-4 space-y-3",children:[e.jsx("button",{type:"button",className:"min-h-11 text-sm text-left font-medium text-primary break-words",onClick:()=>g(s.id),children:s.agent??"Session"}),e.jsx("p",{className:"text-sm leading-relaxed text-on-surface break-words",children:s.summary??"No summary recorded"}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-2 text-xs text-outline",children:[e.jsxs("span",{children:["Version ",s.agent_version??"—"]}),e.jsxs("span",{children:[((d=s.tokens_used)==null?void 0:d.toLocaleString())??"—"," tokens"]}),e.jsx("span",{children:s.project_id?`Project ${s.project_id.slice(-6)}`:"Unassigned"}),e.jsx("span",{children:new Date(s.created_at).toLocaleString()})]})]},s.id)})}),e.jsx(Z,{page:j,pageSize:b,total:C,onPage:o})]}),e.jsx(X,{sessionId:i,open:!!i,onClose:_})]})}function ie({projectId:n}){const a=q(n);return e.jsxs("div",{children:[e.jsx(Y,{title:"Audit"}),e.jsx("p",{className:"mb-4 text-sm text-outline",children:"Recorded summaries and events. Open Sessions to read conversations or resume a coding agent."}),e.jsx(te,{projectId:a},a)]})}export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as E,m as U,n as V,o as q,p as I,q as J,j as t,E as Q,S as H,s as T,P as S,t as z,v as W,w as L,x as m,y as O,z as v,A as F,D,R as G}from"./index-
|
|
1
|
+
import{i as E,m as U,n as V,o as q,p as I,q as J,j as t,E as Q,S as H,s as T,P as S,t as z,v as W,w as L,x as m,y as O,z as v,A as F,D,R as G}from"./index-CVKguVuJ.js";import{u as K}from"./useJobs-DSLKgV8L.js";import{u as X}from"./useMemories-CPw6917_.js";import{u as Y}from"./useProjectScope-Gvzzt8hR.js";function l(o,p){return o.isLoading?"…":o.error?"—":p}function es({projectId:o}){var f,_;const p=E(),a=Y(o),$=U("sm"),i=s=>{const e=new URL(s,window.location.origin);e.searchParams.set("project",a),p({pathname:e.pathname,search:e.search,hash:e.hash})},d=a==="all"||a==="unassigned"?void 0:{project_id:a},c=V(d),{data:b,isLoading:A}=c,u=K(d),{data:N}=u,h=X({project_id:d==null?void 0:d.project_id,limit:1},{enabled:a!=="unassigned"}),P=a==="unassigned"?0:((f=h.data)==null?void 0:f.total)??0,{data:n}=q(),j=I(!0),g=(j.data??[]).filter(s=>a==="all"||(a==="unassigned"?s.project_id===null:s.project_id===a)),w=a==="unassigned"?(N??[]).filter(s=>s.project_id===null):N??[],k=a==="unassigned"?(b??[]).filter(s=>s.project_id===null):b??[],r=k.reduce((s,e)=>(s[e.status]=(s[e.status]??0)+1,s),{}),y=[...k].sort((s,e)=>new Date(e.updated_at).getTime()-new Date(s.updated_at).getTime()).slice(0,8),x=w.filter(s=>s.enabled),R=a==="all"?"All Projects":a==="unassigned"?"Unassigned":((_=n==null?void 0:n.find(s=>s.id===a))==null?void 0:_.name)??"",M=[{label:"Doing",value:l(c,r.doing??0),sub:"in progress",path:"/tasks?view=table&status=doing"},{label:"Review",value:l(c,r.review??0),sub:"awaiting review",path:"/tasks?view=table&status=review"},{label:"Blocked",value:l(c,r.blocked??0),sub:"needs attention",path:"/tasks?view=table&status=blocked"},{label:"Todo",value:l(c,(r.todo??0)+(r.queued??0)),sub:"pending",path:"/tasks?view=board"},{label:"Done",value:l(c,r.done??0),sub:"completed",path:"/tasks?view=table&status=done"}],B=[{label:"Active jobs",value:l(u,x.length),sub:`of ${w.length} total`,path:"/jobs"},{label:"Memories",value:l(h,P),sub:"in this scope",path:J},{label:"Projects",value:(n??[]).filter(s=>s.status==="active").length,sub:"active across workspace",path:"/projects"}];return t.jsxs("div",{"data-activity-preview":!0,"data-testid":"activity-preview",className:"activity-preview",children:[t.jsxs("div",{className:"activity-heading",children:[t.jsxs("div",{children:[t.jsx("h1",{"data-testid":"view-title",children:"Activity"}),t.jsx("p",{"data-testid":"view-meta",children:R||"All projects"})]}),t.jsx("button",{type:"button",className:"activity-primary",onClick:()=>i("/tasks"),children:"View tasks"})]}),[c,u,h,j].some(s=>s.isLoading)&&t.jsx("p",{role:"status",className:"activity-muted mb-4",children:"Loading activity…"}),[{name:"Tasks",query:c},{name:"Jobs",query:u},{name:"Memories",query:h},{name:"Sessions",query:j}].filter(({query:s})=>s.error).map(({name:s,query:e})=>{var C;return t.jsx(Q,{message:`${s}: ${((C=e.error)==null?void 0:C.message)??"Could not load activity"}`,onRetry:()=>e.refetch()},s)}),t.jsx("section",{className:"activity-metrics","aria-label":"Task summary",children:M.map(s=>t.jsxs("button",{type:"button","data-testid":"stat-card","data-stat-label":s.label,className:"activity-metric",onClick:()=>i(s.path),children:[t.jsx("span",{className:"activity-metric-label",children:s.label}),t.jsx("span",{"data-testid":"stat-card-value",className:"activity-metric-value",children:s.value}),t.jsx("span",{className:"activity-metric-sub",children:s.sub})]},s.label))}),t.jsx("section",{className:"activity-resources","aria-label":"Workspace summary",children:B.map(s=>t.jsxs("button",{type:"button","data-testid":"stat-card","data-stat-label":s.label,onClick:()=>i(s.path),children:[t.jsx("span",{children:s.label}),t.jsx("span",{"data-testid":"stat-card-value",className:"activity-resource-value",children:s.value}),t.jsx("span",{className:"activity-resource-sub",children:s.sub})]},s.label))}),t.jsxs("section",{className:"activity-section",children:[t.jsxs("div",{className:"activity-section-heading",children:[t.jsx("h2",{children:"Recent tasks"}),t.jsx("button",{type:"button",className:"activity-text-action",onClick:()=>i("/tasks"),children:"View all"})]}),A?t.jsx("div",{className:"space-y-2",children:[0,1,2,3].map(s=>t.jsx(H,{className:"h-10 w-full"},s))}):y.length===0?t.jsx("p",{className:"activity-empty",children:"No tasks"}):$?t.jsxs(z,{className:"activity-task-table",children:[t.jsx(W,{children:t.jsxs(L,{children:[t.jsx(m,{children:"Task"}),t.jsx(m,{className:"w-36",children:"Status"}),t.jsx(m,{className:"w-28",children:"Priority"}),t.jsx(m,{className:"w-28",children:"Updated"})]})}),t.jsx(O,{children:y.map(s=>t.jsxs(L,{onClick:()=>i(`/tasks/${s.id}`),children:[t.jsx(v,{children:t.jsx("button",{type:"button",className:"activity-task-title",onClick:e=>{e.stopPropagation(),i(`/tasks/${s.id}`)},children:s.title})}),t.jsx(v,{children:t.jsx("span",{className:"activity-status","data-status":s.status,children:t.jsx(T,{status:s.status})})}),t.jsx(v,{children:t.jsx("span",{className:"activity-priority",children:t.jsx(S,{priority:s.priority})})}),t.jsx(v,{className:"activity-muted",children:new Date(s.updated_at).toLocaleDateString()})]},s.id))})]}):t.jsx("div",{className:"activity-task-list",children:y.map(s=>t.jsxs("article",{className:"activity-task-mobile",children:[t.jsx("button",{type:"button",className:"activity-task-title",onClick:()=>i(`/tasks/${s.id}`),children:s.title}),t.jsxs("div",{className:"activity-task-meta",children:[t.jsx("span",{className:"activity-status","data-status":s.status,children:t.jsx(T,{status:s.status})}),t.jsx("span",{className:"activity-priority",children:t.jsx(S,{priority:s.priority})}),t.jsx("span",{children:new Date(s.updated_at).toLocaleDateString()})]})]},s.id))})]}),t.jsxs("div",{className:"activity-secondary",children:[x.length>0&&t.jsxs("section",{className:"activity-section",children:[t.jsxs("div",{className:"activity-section-heading",children:[t.jsx("h2",{children:"Active jobs"}),t.jsx("button",{type:"button",className:"activity-text-action",onClick:()=>i("/jobs"),children:"View all"})]}),t.jsx("div",{className:"activity-row-list",children:x.slice(0,5).map(s=>t.jsxs("button",{type:"button",className:"activity-row",onClick:()=>i(`/jobs/${s.id}`),children:[t.jsxs("span",{className:"activity-row-heading",children:[t.jsx("span",{children:s.name}),t.jsx("span",{className:"activity-muted",children:s.trigger_type})]}),s.last_run_at&&t.jsxs("span",{className:"activity-row-description",children:["Last run ",new Date(s.last_run_at).toLocaleString()]})]},s.id))})]}),g.length>0&&t.jsxs("section",{className:"activity-section",children:[t.jsxs("div",{className:"activity-section-heading",children:[t.jsx("h2",{children:"Agent sessions"}),t.jsx("button",{type:"button",className:"activity-text-action",onClick:()=>i("/sessions"),children:"View all"})]}),t.jsx("div",{className:"activity-row-list",children:g.slice(0,5).map(s=>t.jsxs("div",{className:"activity-row",children:[t.jsxs("button",{type:"button",className:"w-full text-left","data-testid":"activity-session-link","data-session-id":s.id,onClick:()=>i(`/sessions?session=${encodeURIComponent(s.id)}`),children:[t.jsxs("span",{className:"activity-row-heading",children:[t.jsx("span",{children:s.name??s.agent}),t.jsx("span",{className:"activity-muted",children:F(s.last_activity_at)})]}),t.jsxs("span",{className:"activity-row-description inline-flex items-center gap-2",children:[t.jsx("span",{className:`size-1.5 rounded-full ${D[s.status].dot}`}),s.agent," · ",D[s.status].label,s.task?` · ${s.task.title}`:""]})]}),t.jsx(G,{session:s})]},s.id))})]})]}),a==="all"&&(n??[]).length>0&&t.jsxs("section",{className:"activity-section",children:[t.jsxs("div",{className:"activity-section-heading",children:[t.jsx("h2",{children:"Projects"}),t.jsx("button",{type:"button",className:"activity-text-action",onClick:()=>i("/projects"),children:"View all"})]}),t.jsx("div",{className:"activity-projects",children:(n??[]).filter(s=>s.status==="active").slice(0,6).map(s=>t.jsxs("button",{type:"button",className:"activity-row",onClick:()=>i(`/projects/${s.id}`),children:[t.jsx("span",{className:"activity-row-heading",children:s.name}),s.description&&t.jsx("span",{className:"activity-row-description",children:s.description})]},s.id))})]})]})}export{es as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as A,i as G,r as o,j as e,M as Y,B as g}from"./index-
|
|
1
|
+
import{h as A,i as G,r as o,j as e,M as Y,B as g}from"./index-CVKguVuJ.js";const i=new Map,M=new Set;typeof window<"u"&&window.addEventListener("beforeunload",t=>{i.size&&(t.preventDefault(),t.returnValue="")});function H(t){return M.has(t)?!1:i.has(t)?window.confirm("Discard unsaved changes to this document?")?(i.delete(t),!0):!1:!0}function K({documentId:t,content:s,path:D,onSave:d,testId:N,wikiLinks:C,navigation:k,expanded:R,onExpandedChange:E,layout:F,pageTitle:q,hideFrontmatter:T}){const[V]=A(),W=G(),v=V.get("editorMode"),x=v==="edit"||v==="split"?v:"read",p=o.useRef(i.get(t)??{original:s,content:s}),[w,f]=o.useState(p.current.content),[u,j]=o.useState(p.current.original),[r,z]=o.useState(!1),[y,b]=o.useState(null),S=o.useRef(!1),l=o.useRef(p.current.content),c=w!==u;o.useEffect(()=>{i.has(t)||(f(s),l.current=s,j(s))},[s,t]);function O(a){l.current=a,f(a),a===u?i.delete(t):i.set(t,{original:u,content:a})}async function h(){if(!d||!c||S.current)return;S.current=!0,M.add(t),z(!0),b(null);const a=l.current;try{const n=await d(a,u),m=typeof n=="string"?n:a;j(m),l.current===a?(i.delete(t),l.current=m,f(m)):i.set(t,{original:m,content:l.current})}catch(n){b(n instanceof Error?n.message:"Could not save document")}finally{S.current=!1,M.delete(t),z(!1)}}function P(a){const n=new URLSearchParams(window.location.search);n.set("editorMode",a),n.toString()!==new URLSearchParams(window.location.search).toString()&&W({search:n.toString(),hash:window.location.hash})}function U(){H(t)&&(f(s),j(s),l.current=s,b(null))}const B=d?r?"Saving…":c?"Unsaved changes":"Saved":"Read-only",L=e.jsxs(e.Fragment,{children:[y&&e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:[y," Your draft has been kept."]}),c&&s!==u&&e.jsx("p",{role:"status",className:"text-sm text-outline",children:"The document changed elsewhere. Your draft is preserved; saving will check for conflicts."})]});return F==="page"?e.jsx("div",{className:"min-w-0","data-testid":"document-workspace",children:e.jsx(Y,{path:D,value:w,onChange:O,onSave:()=>void h(),readOnly:!d||r,testId:N,wikiLinks:C,initialMode:"read",mode:x,onModeChange:P,expanded:R,onExpandedChange:E,layout:"page",pageTitle:q,hideFrontmatter:T,notice:y||c&&s!==u?L:void 0,actions:(x!=="read"||c||r)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"data-testid":"document-save-status",role:"status",className:"text-xs text-outline",children:B}),d&&(c||r)&&e.jsxs(e.Fragment,{children:[e.jsx(g,{type:"button",size:"sm",variant:"ghost","data-testid":"document-discard",disabled:r,onClick:U,children:"Discard"}),e.jsx(g,{type:"button",size:"sm","data-testid":"document-save",disabled:r,onClick:()=>void h(),children:"Save"})]})]})})}):e.jsx("div",{className:"min-w-0 space-y-3","data-testid":"document-workspace",children:e.jsx(Y,{path:D,value:w,onChange:O,onSave:()=>void h(),readOnly:!d||r,testId:N,wikiLinks:C,initialMode:"read",mode:x,onModeChange:P,expanded:R,onExpandedChange:E,layout:F,header:e.jsxs("div",{className:"space-y-2",children:[k&&e.jsx("div",{className:"mb-3 min-w-0",children:k}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{"data-testid":"document-save-status",role:"status",className:"min-w-0 flex-1 text-sm text-outline",children:B}),d&&e.jsxs(e.Fragment,{children:[e.jsx(g,{type:"button",variant:"ghost","data-testid":"document-discard",disabled:!c||r,onClick:U,children:"Discard changes"}),e.jsx(g,{type:"button","data-testid":"document-save",disabled:!c||r,onClick:()=>void h(),children:"Save changes"})]})]}),L]})})})}export{K as D,H as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as U,r as t,a as $,j as n,k as K,M as A,l as T,d as P}from"./index-
|
|
1
|
+
import{h as U,r as t,a as $,j as n,k as K,M as A,l as T,d as P}from"./index-CVKguVuJ.js";import{S as V}from"./save-BK4gikTj.js";const c=new Map;typeof window<"u"&&window.addEventListener("beforeunload",s=>{c.size!==0&&(s.preventDefault(),s.returnValue="")});function H({terminalId:s,path:i,content:u,readOnly:v,onDirty:w}){const[Q,z]=U(),p=Q.get("editorMode"),D=p==="read"||p==="split"?p:"edit",a=`${s}:${i}`,d=t.useRef(c.get(a)??{original:u,content:u}),o=t.useRef(d.current.original),l=t.useRef(d.current.content),[S,g]=t.useState(d.current.content!==d.current.original),[C,j]=t.useState(!1),[E,h]=t.useState(null),[k,b]=t.useState(d.current.content),R=$(),y=t.useRef(()=>{}),x=t.useRef(!1),m=t.useRef(!1),f=t.useRef(w);f.current=w;async function M(){if(x.current||v||l.current===o.current)return;x.current=!0,j(!0),h(null);const e=l.current;try{await P.git.saveFile(s,i,e,o.current),o.current=e;const r=l.current!==e;g(r),m.current&&f.current(r),r?c.set(a,{original:e,content:l.current}):c.delete(a),R.invalidateQueries({queryKey:["checkout-files",s,i]}),R.invalidateQueries({queryKey:["git",s]})}catch(r){h(r instanceof Error?r.message:"Could not save file")}finally{x.current=!1,j(!1)}}y.current=()=>void M(),t.useEffect(()=>(m.current=!0,f.current(d.current.content!==d.current.original),()=>{m.current=!1}),[]),t.useEffect(()=>{x.current||c.has(a)||u===o.current||(o.current=u,l.current=u,b(u),g(!1),m.current&&f.current(!1))},[u,a]);function N(e){l.current=e,b(e);const r=e!==o.current;g(r),f.current(r),r?c.set(a,{original:o.current,content:e}):c.delete(a)}function L(){window.confirm("Discard your edits and reload the file from disk?")&&P.git.files(s,i).then(e=>{if(e.content===null||e.binary||e.truncated)throw new Error("File is no longer editable");o.current=e.content,l.current=e.content,c.delete(a),b(e.content),g(!1),f.current(!1),h(null)}).catch(e=>h(e instanceof Error?e.message:"Could not reload file"))}const F=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-surface-highest px-2 py-1",children:[n.jsxs("button",{type:"button","data-testid":"file-save",disabled:!S||C||v,onClick:()=>void M(),className:"flex min-h-11 items-center gap-1 rounded px-2 py-1 text-sm text-primary hover:bg-surface-highest disabled:opacity-40",title:"Save (Ctrl/Cmd+S)",children:[n.jsx(V,{size:14}),C?"Saving…":"Save"]}),n.jsx("span",{"data-testid":"file-save-status",className:"min-w-0 flex-1 truncate text-sm text-on-surface-variant",children:v?"Read-only preview":S?"Unsaved changes":"Saved"})]}),E&&n.jsxs("div",{role:"alert",className:"shrink-0 border-b border-error/30 p-2 text-xs text-error",children:[E,n.jsx("button",{type:"button","data-testid":"file-reload",onClick:L,className:"ml-2 underline",children:"Reload from disk"})]})]});return n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"file-editor",children:[!K(i)&&F,n.jsx("div",{"data-testid":"file-preview",className:"min-h-0 flex-1 overflow-hidden",children:K(i)?n.jsx(A,{path:i,value:k,onChange:N,onSave:()=>y.current(),readOnly:v,height:"100%",testId:"file-editor-input",header:F,mode:D,onModeChange:e=>z(r=>{const q=new URLSearchParams(r);return q.set("editorMode",e),q})}):n.jsx(T,{path:i,value:k,onChange:N,onSave:()=>y.current(),readOnly:v,height:"100%",testId:"file-editor-input"})})]})}export{H as FileEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as S,a as f,b as v,d as j,r as h,j as e,B as b,_ as w,$ as _,L as k,E as R,ab as $}from"./index-CPDfUOSb.js";import{a as F}from"./useJobs-ZHuwYAWh.js";function L(t){return S({queryKey:["webhooks",t],queryFn:()=>j.webhooks.list(t),select:s=>s.webhooks})}function D(t){return S({queryKey:["webhook-deliveries",t],queryFn:()=>j.webhooks.deliveries(t),select:s=>s.deliveries,enabled:!!t,refetchInterval:3e3})}function U(){const t=f();return v({mutationFn:s=>j.webhooks.create(s),onSuccess:()=>t.invalidateQueries({queryKey:["webhooks"]})})}function E(){const t=f();return v({mutationFn:({id:s,...a})=>j.webhooks.update(s,a),onSuccess:()=>t.invalidateQueries({queryKey:["webhooks"]})})}function G(){const t=f();return v({mutationFn:s=>j.webhooks.delete(s),onSuccess:()=>t.invalidateQueries({queryKey:["webhooks"]})})}function P(){return v({mutationFn:t=>j.webhooks.rotate(t)})}function q(t){return[...new Set(t.split(",").map(s=>s.trim()).filter(Boolean))]}function I(t,s,a){return new URL(`/webhooks/${encodeURIComponent(t)}`,new URL(s,a)).href}function z(t){return["localhost","127.0.0.1","[::1]"].includes(new URL(t).hostname)}function N({id:t,testId:s,value:a,onChange:i,placeholder:d}){const[n,r]=h.useState(a.join(", "));return e.jsx(_,{id:t,"data-testid":s,value:n,placeholder:d,onChange:l=>{r(l.target.value),i(l.target.value)}})}function J({projectId:t,onCreated:s}){const a=U(),[i,d]=h.useState(""),[n,r]=h.useState("github"),[l,m]=h.useState(null),u=h.useId();return l?e.jsxs("div",{"data-testid":"webhook-created",className:"space-y-3",children:[e.jsx(W,{hook:l,secret:l.secret}),e.jsx(b,{type:"button",variant:"outline","data-testid":"webhook-setup-done",onClick:()=>{s==null||s(l),m(null),d("")},children:"I've copied the setup details"})]}):e.jsxs("div",{className:"space-y-3","data-testid":"webhook-create-form",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{htmlFor:`${u}-name`,children:"Webhook name"}),e.jsx(_,{id:`${u}-name`,"data-testid":"webhook-name",value:i,onChange:c=>d(c.target.value),maxLength:100,placeholder:"GitHub repository events"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{htmlFor:`${u}-provider`,children:"Provider"}),e.jsxs("select",{id:`${u}-provider`,"data-testid":"webhook-provider",className:"w-full min-h-11 rounded-md border border-control-border bg-background px-3 text-sm",value:n,onChange:c=>r(c.target.value),children:[e.jsx("option",{value:"github",children:"GitHub"}),e.jsx("option",{value:"generic",children:"Other service (HMAC)"})]})]}),e.jsx("p",{className:"text-xs text-outline",children:"Create the event source here. Connect jobs and choose their event filters in Jobs. No job is required to create a webhook."}),a.error&&e.jsx("p",{role:"alert",className:"text-sm text-error",children:a.error.message}),e.jsx(b,{type:"button","data-testid":"webhook-create",disabled:!i.trim()||a.isPending,onClick:()=>a.mutate({name:i.trim(),provider:n,project_id:t??null},{onSuccess:m}),children:a.isPending?"Creating...":"Create webhook"})]})}function A({value:t,onChange:s,projectId:a}){const{data:i,error:d,isLoading:n,refetch:r}=L(a),l=i==null?void 0:i.filter(o=>o.project_id===null||o.project_id===a),[m,u]=h.useState(!1);function c(o){t.some(p=>p.webhook_id===o)||s([...t,{webhook_id:o,events:[],actions:[]}])}function y(o,p,x){s(t.map(g=>g.webhook_id===o?{...g,[p]:q(x)}:g))}return e.jsxs("section",{className:"space-y-3 border-y border-border py-4","data-testid":"job-webhook-picker",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Which webhook should trigger this job?"}),d?e.jsx(R,{message:d.message,onRetry:()=>r()}):e.jsxs(e.Fragment,{children:[e.jsx(w,{htmlFor:"job-webhook-source",children:"Configured webhooks"}),e.jsxs("select",{id:"job-webhook-source","data-testid":"job-webhook-select",className:"w-full min-h-11 rounded-md border border-control-border bg-background px-3 text-sm",value:"",disabled:n,onChange:o=>{o.target.value&&c(o.target.value)},children:[e.jsx("option",{value:"",children:n?"Loading webhooks...":"Select an existing webhook"}),(l??[]).filter(o=>!t.some(p=>p.webhook_id===o.id)).map(o=>e.jsxs("option",{value:o.id,children:[o.name,o.enabled?"":" (disabled)"]},o.id))]}),!n&&!(l!=null&&l.length)&&e.jsx("p",{className:"text-xs text-outline",children:"No webhooks configured for this project yet. Create one below or on the Webhooks page."})]}),t.map(o=>{var p;return e.jsxs("div",{className:"space-y-2 border-t border-border pt-3","data-testid":"job-webhook-binding","data-webhook-id":o.webhook_id,children:[e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:((p=l==null?void 0:l.find(x=>x.id===o.webhook_id))==null?void 0:p.name)??o.webhook_id}),e.jsx(b,{type:"button",variant:"ghost",size:"sm","data-testid":"job-webhook-remove",onClick:()=>s(t.filter(x=>x.webhook_id!==o.webhook_id)),children:"Disconnect"})]}),e.jsx(w,{htmlFor:`events-${o.webhook_id}`,children:"Events for this job"}),e.jsx(N,{id:`events-${o.webhook_id}`,testId:"webhook-events",value:o.events,onChange:x=>y(o.webhook_id,"events",x),placeholder:"pull_request, push (blank accepts all)"}),e.jsx(w,{htmlFor:`actions-${o.webhook_id}`,children:"Actions for this job (optional)"}),e.jsx(N,{id:`actions-${o.webhook_id}`,testId:"webhook-actions",value:o.actions,onChange:x=>y(o.webhook_id,"actions",x),placeholder:"opened, synchronize (blank accepts all)"})]},o.webhook_id)}),e.jsx(b,{type:"button",size:"sm",variant:"outline","data-testid":"webhook-add",onClick:()=>u(!m),children:m?"Close new webhook":"Create a webhook"}),m&&e.jsx(J,{projectId:a,onCreated:o=>{c(o.id),u(!1)}})]})}function K({job:t}){const s=F(),[a,i]=h.useState(t.webhooks??[]);return e.jsxs("section",{className:"space-y-3","data-testid":"job-webhooks",children:[!t.enabled&&e.jsx("p",{className:"text-sm text-outline",children:"Job disabled. Configure connections now and enable it from Jobs when ready."}),e.jsx(A,{value:a,onChange:i,projectId:t.project_id??void 0}),s.error&&e.jsx("p",{role:"alert",className:"text-sm text-error",children:s.error.message}),e.jsx(b,{type:"button",size:"sm","data-testid":"job-webhooks-save",disabled:s.isPending,onClick:()=>s.mutate({id:t.id,webhooks:a,trigger_type:"webhook"}),children:"Save connections"}),s.isSuccess&&e.jsx("p",{role:"status",className:"text-xs text-outline",children:"Connections saved."}),e.jsx(k,{className:"inline-block text-sm underline",to:`/webhooks?project=${encodeURIComponent(t.project_id??"all")}`,children:"Manage configured webhooks and deliveries"})]})}function C({label:t,value:s,secret:a=!1}){const[i,d]=h.useState(!1),[n,r]=h.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-outline",children:t}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all text-xs","data-testid":a?"webhook-secret":"webhook-url",children:s}),e.jsx(b,{type:"button",size:"sm",variant:"outline","aria-label":`Copy ${t}`,onClick:async()=>{try{await navigator.clipboard.writeText(s),d(!0),r(!1)}catch{r(!0)}},children:i?"Copied":"Copy"})]}),n&&e.jsx("p",{role:"alert",className:"text-xs text-error",children:"Select and copy the value above; clipboard access is unavailable."})]})}function W({hook:t,secret:s}){const a=I(t.token,$(),window.location.origin);return e.jsxs("div",{className:"space-y-3","data-testid":"webhook-setup",children:[e.jsx(C,{label:"Payload URL",value:a}),z(a)&&e.jsx("p",{className:"text-sm text-warning",children:"This address is local. For external providers, use your publicly reachable ORC address with the same /webhooks/ path."}),s?e.jsxs(e.Fragment,{children:[e.jsx(C,{label:"Signing secret",value:s,secret:!0}),e.jsx("p",{className:"text-xs text-outline",children:"Copy the signing secret before leaving. It is shown once."})]}):e.jsx("p",{className:"text-xs text-outline",children:"The signing secret is hidden. Generate a replacement only if you need to reconnect the sender."}),t.provider==="github"?e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-outline",children:[e.jsx("li",{children:"In your repository, open GitHub Settings - Webhooks - Add webhook."}),e.jsx("li",{children:"Paste the Payload URL, select application/json, and enter the signing secret."}),e.jsx("li",{children:"Select the events needed by your connected jobs. Each job has its own filters."}),e.jsx("li",{children:"Send an event and inspect Recent deliveries below."})]}):e.jsx("p",{className:"text-sm text-outline",children:"Send JSON, signed with HMAC-SHA256 of the raw body. Set X-Orc-Signature-256 to sha256=<hex signature>, X-Orc-Event to the event name and X-Orc-Delivery to a unique delivery ID."})]})}function Q({hook:t}){var u;const s=E(),a=P(),[i,d]=h.useState(!1),[n,r]=h.useState(!1),[l,m]=h.useState();return e.jsxs("article",{className:"space-y-3 border-b border-border pb-5","data-testid":"webhook-endpoint","data-webhook-id":t.id,children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:t.name}),e.jsxs("span",{className:"text-xs text-outline",children:[t.provider," - ",t.enabled?"Enabled":"Disabled"]}),e.jsx(b,{type:"button",variant:"outline",size:"sm",disabled:s.isPending,onClick:()=>s.mutate({id:t.id,enabled:!t.enabled}),children:t.enabled?"Disable":"Enable"})]}),e.jsxs("div",{className:"space-y-1","data-testid":"webhook-connected-jobs",children:[e.jsxs("p",{className:"text-xs text-outline",children:["Connected jobs (",t.subscriptions.length,")"]}),t.subscriptions.length?t.subscriptions.map(c=>e.jsxs("div",{className:"text-sm",children:[e.jsx(k,{className:"underline","data-testid":"webhook-job-link",to:`/jobs/${c.job_id}?project=all`,children:c.name}),e.jsxs("span",{className:"text-xs text-outline",children:[" ","- ",c.enabled?"Enabled":"Disabled","; events:"," ",c.events.join(", ")||"all","; actions: ",c.actions.join(", ")||"all"]})]},c.job_id)):e.jsx("p",{className:"text-sm text-outline",children:"No connected jobs. Select this webhook when creating or editing a job."})]}),e.jsx(W,{hook:t,secret:l}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(b,{type:"button",variant:"outline",size:"sm","data-testid":"webhook-deliveries-toggle",onClick:()=>d(!i),children:i?"Hide deliveries":"Recent deliveries"}),e.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(!n),children:"New signing secret"})]}),n&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"The sender's existing secret will stop working. Update it after generating the replacement."}),e.jsx(b,{type:"button",variant:"outline",size:"sm",disabled:a.isPending,onClick:()=>a.mutate(t.id,{onSuccess:c=>{m(c.secret),r(!1)}}),children:"Generate replacement secret"})]}),(s.error||a.error)&&e.jsx("p",{role:"alert",className:"text-sm text-error",children:(u=s.error??a.error)==null?void 0:u.message}),i&&e.jsx(H,{id:t.id})]})}function H({id:t}){const{data:s,isLoading:a,error:i,refetch:d}=D(t);return e.jsxs("section",{className:"space-y-2","data-testid":"webhook-deliveries",children:[e.jsx("h4",{className:"text-sm font-medium",children:"Recent deliveries"}),i?e.jsx(R,{message:i.message,onRetry:()=>d()}):a?e.jsx("p",{role:"status",children:"Loading deliveries..."}):s!=null&&s.length?s.map(n=>e.jsxs("div",{className:"space-y-1 border-t border-border py-2 text-xs","data-testid":"webhook-delivery",children:[e.jsxs("div",{className:"flex flex-wrap justify-between gap-2",children:[e.jsxs("span",{children:[n.event,n.action?` / ${n.action}`:""]}),e.jsx("span",{children:n.status})]}),e.jsxs("p",{className:"text-outline",children:[n.repository," ",new Date(n.created_at).toLocaleString()]}),n.status==="ignored"&&e.jsx("p",{className:"text-outline",children:"No enabled connected job matched this event."}),n.error&&e.jsx("p",{className:"text-error",children:n.error}),n.runs.map(r=>e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(k,{className:"underline",to:`/jobs/${r.job_id}?project=all`,children:["Job run: ",r.status]}),r.task_id&&e.jsx(k,{className:"underline",to:`/tasks/${r.task_id}?project=all`,children:"Created task"}),r.session_id&&e.jsx(k,{className:"underline",to:`/audit/${r.session_id}?project=all`,children:"Agent session"})]},r.job_run_id))]},n.id)):e.jsx("p",{className:"text-sm text-outline",children:"No events received yet. Register the endpoint with your provider, then send an event."})]})}export{K as J,J as W,G as a,Q as b,A as c,L as u};
|
|
1
|
+
import{u as S,a as f,b as v,d as j,r as h,j as e,B as b,_ as w,$ as _,L as k,E as R,ab as $}from"./index-CVKguVuJ.js";import{a as F}from"./useJobs-DSLKgV8L.js";function L(t){return S({queryKey:["webhooks",t],queryFn:()=>j.webhooks.list(t),select:s=>s.webhooks})}function D(t){return S({queryKey:["webhook-deliveries",t],queryFn:()=>j.webhooks.deliveries(t),select:s=>s.deliveries,enabled:!!t,refetchInterval:3e3})}function U(){const t=f();return v({mutationFn:s=>j.webhooks.create(s),onSuccess:()=>t.invalidateQueries({queryKey:["webhooks"]})})}function E(){const t=f();return v({mutationFn:({id:s,...a})=>j.webhooks.update(s,a),onSuccess:()=>t.invalidateQueries({queryKey:["webhooks"]})})}function G(){const t=f();return v({mutationFn:s=>j.webhooks.delete(s),onSuccess:()=>t.invalidateQueries({queryKey:["webhooks"]})})}function P(){return v({mutationFn:t=>j.webhooks.rotate(t)})}function q(t){return[...new Set(t.split(",").map(s=>s.trim()).filter(Boolean))]}function I(t,s,a){return new URL(`/webhooks/${encodeURIComponent(t)}`,new URL(s,a)).href}function z(t){return["localhost","127.0.0.1","[::1]"].includes(new URL(t).hostname)}function N({id:t,testId:s,value:a,onChange:i,placeholder:d}){const[n,r]=h.useState(a.join(", "));return e.jsx(_,{id:t,"data-testid":s,value:n,placeholder:d,onChange:l=>{r(l.target.value),i(l.target.value)}})}function J({projectId:t,onCreated:s}){const a=U(),[i,d]=h.useState(""),[n,r]=h.useState("github"),[l,m]=h.useState(null),u=h.useId();return l?e.jsxs("div",{"data-testid":"webhook-created",className:"space-y-3",children:[e.jsx(W,{hook:l,secret:l.secret}),e.jsx(b,{type:"button",variant:"outline","data-testid":"webhook-setup-done",onClick:()=>{s==null||s(l),m(null),d("")},children:"I've copied the setup details"})]}):e.jsxs("div",{className:"space-y-3","data-testid":"webhook-create-form",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{htmlFor:`${u}-name`,children:"Webhook name"}),e.jsx(_,{id:`${u}-name`,"data-testid":"webhook-name",value:i,onChange:c=>d(c.target.value),maxLength:100,placeholder:"GitHub repository events"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{htmlFor:`${u}-provider`,children:"Provider"}),e.jsxs("select",{id:`${u}-provider`,"data-testid":"webhook-provider",className:"w-full min-h-11 rounded-md border border-control-border bg-background px-3 text-sm",value:n,onChange:c=>r(c.target.value),children:[e.jsx("option",{value:"github",children:"GitHub"}),e.jsx("option",{value:"generic",children:"Other service (HMAC)"})]})]}),e.jsx("p",{className:"text-xs text-outline",children:"Create the event source here. Connect jobs and choose their event filters in Jobs. No job is required to create a webhook."}),a.error&&e.jsx("p",{role:"alert",className:"text-sm text-error",children:a.error.message}),e.jsx(b,{type:"button","data-testid":"webhook-create",disabled:!i.trim()||a.isPending,onClick:()=>a.mutate({name:i.trim(),provider:n,project_id:t??null},{onSuccess:m}),children:a.isPending?"Creating...":"Create webhook"})]})}function A({value:t,onChange:s,projectId:a}){const{data:i,error:d,isLoading:n,refetch:r}=L(a),l=i==null?void 0:i.filter(o=>o.project_id===null||o.project_id===a),[m,u]=h.useState(!1);function c(o){t.some(p=>p.webhook_id===o)||s([...t,{webhook_id:o,events:[],actions:[]}])}function y(o,p,x){s(t.map(g=>g.webhook_id===o?{...g,[p]:q(x)}:g))}return e.jsxs("section",{className:"space-y-3 border-y border-border py-4","data-testid":"job-webhook-picker",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Which webhook should trigger this job?"}),d?e.jsx(R,{message:d.message,onRetry:()=>r()}):e.jsxs(e.Fragment,{children:[e.jsx(w,{htmlFor:"job-webhook-source",children:"Configured webhooks"}),e.jsxs("select",{id:"job-webhook-source","data-testid":"job-webhook-select",className:"w-full min-h-11 rounded-md border border-control-border bg-background px-3 text-sm",value:"",disabled:n,onChange:o=>{o.target.value&&c(o.target.value)},children:[e.jsx("option",{value:"",children:n?"Loading webhooks...":"Select an existing webhook"}),(l??[]).filter(o=>!t.some(p=>p.webhook_id===o.id)).map(o=>e.jsxs("option",{value:o.id,children:[o.name,o.enabled?"":" (disabled)"]},o.id))]}),!n&&!(l!=null&&l.length)&&e.jsx("p",{className:"text-xs text-outline",children:"No webhooks configured for this project yet. Create one below or on the Webhooks page."})]}),t.map(o=>{var p;return e.jsxs("div",{className:"space-y-2 border-t border-border pt-3","data-testid":"job-webhook-binding","data-webhook-id":o.webhook_id,children:[e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:((p=l==null?void 0:l.find(x=>x.id===o.webhook_id))==null?void 0:p.name)??o.webhook_id}),e.jsx(b,{type:"button",variant:"ghost",size:"sm","data-testid":"job-webhook-remove",onClick:()=>s(t.filter(x=>x.webhook_id!==o.webhook_id)),children:"Disconnect"})]}),e.jsx(w,{htmlFor:`events-${o.webhook_id}`,children:"Events for this job"}),e.jsx(N,{id:`events-${o.webhook_id}`,testId:"webhook-events",value:o.events,onChange:x=>y(o.webhook_id,"events",x),placeholder:"pull_request, push (blank accepts all)"}),e.jsx(w,{htmlFor:`actions-${o.webhook_id}`,children:"Actions for this job (optional)"}),e.jsx(N,{id:`actions-${o.webhook_id}`,testId:"webhook-actions",value:o.actions,onChange:x=>y(o.webhook_id,"actions",x),placeholder:"opened, synchronize (blank accepts all)"})]},o.webhook_id)}),e.jsx(b,{type:"button",size:"sm",variant:"outline","data-testid":"webhook-add",onClick:()=>u(!m),children:m?"Close new webhook":"Create a webhook"}),m&&e.jsx(J,{projectId:a,onCreated:o=>{c(o.id),u(!1)}})]})}function K({job:t}){const s=F(),[a,i]=h.useState(t.webhooks??[]);return e.jsxs("section",{className:"space-y-3","data-testid":"job-webhooks",children:[!t.enabled&&e.jsx("p",{className:"text-sm text-outline",children:"Job disabled. Configure connections now and enable it from Jobs when ready."}),e.jsx(A,{value:a,onChange:i,projectId:t.project_id??void 0}),s.error&&e.jsx("p",{role:"alert",className:"text-sm text-error",children:s.error.message}),e.jsx(b,{type:"button",size:"sm","data-testid":"job-webhooks-save",disabled:s.isPending,onClick:()=>s.mutate({id:t.id,webhooks:a,trigger_type:"webhook"}),children:"Save connections"}),s.isSuccess&&e.jsx("p",{role:"status",className:"text-xs text-outline",children:"Connections saved."}),e.jsx(k,{className:"inline-block text-sm underline",to:`/webhooks?project=${encodeURIComponent(t.project_id??"all")}`,children:"Manage configured webhooks and deliveries"})]})}function C({label:t,value:s,secret:a=!1}){const[i,d]=h.useState(!1),[n,r]=h.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-outline",children:t}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all text-xs","data-testid":a?"webhook-secret":"webhook-url",children:s}),e.jsx(b,{type:"button",size:"sm",variant:"outline","aria-label":`Copy ${t}`,onClick:async()=>{try{await navigator.clipboard.writeText(s),d(!0),r(!1)}catch{r(!0)}},children:i?"Copied":"Copy"})]}),n&&e.jsx("p",{role:"alert",className:"text-xs text-error",children:"Select and copy the value above; clipboard access is unavailable."})]})}function W({hook:t,secret:s}){const a=I(t.token,$(),window.location.origin);return e.jsxs("div",{className:"space-y-3","data-testid":"webhook-setup",children:[e.jsx(C,{label:"Payload URL",value:a}),z(a)&&e.jsx("p",{className:"text-sm text-warning",children:"This address is local. For external providers, use your publicly reachable ORC address with the same /webhooks/ path."}),s?e.jsxs(e.Fragment,{children:[e.jsx(C,{label:"Signing secret",value:s,secret:!0}),e.jsx("p",{className:"text-xs text-outline",children:"Copy the signing secret before leaving. It is shown once."})]}):e.jsx("p",{className:"text-xs text-outline",children:"The signing secret is hidden. Generate a replacement only if you need to reconnect the sender."}),t.provider==="github"?e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-outline",children:[e.jsx("li",{children:"In your repository, open GitHub Settings - Webhooks - Add webhook."}),e.jsx("li",{children:"Paste the Payload URL, select application/json, and enter the signing secret."}),e.jsx("li",{children:"Select the events needed by your connected jobs. Each job has its own filters."}),e.jsx("li",{children:"Send an event and inspect Recent deliveries below."})]}):e.jsx("p",{className:"text-sm text-outline",children:"Send JSON, signed with HMAC-SHA256 of the raw body. Set X-Orc-Signature-256 to sha256=<hex signature>, X-Orc-Event to the event name and X-Orc-Delivery to a unique delivery ID."})]})}function Q({hook:t}){var u;const s=E(),a=P(),[i,d]=h.useState(!1),[n,r]=h.useState(!1),[l,m]=h.useState();return e.jsxs("article",{className:"space-y-3 border-b border-border pb-5","data-testid":"webhook-endpoint","data-webhook-id":t.id,children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:t.name}),e.jsxs("span",{className:"text-xs text-outline",children:[t.provider," - ",t.enabled?"Enabled":"Disabled"]}),e.jsx(b,{type:"button",variant:"outline",size:"sm",disabled:s.isPending,onClick:()=>s.mutate({id:t.id,enabled:!t.enabled}),children:t.enabled?"Disable":"Enable"})]}),e.jsxs("div",{className:"space-y-1","data-testid":"webhook-connected-jobs",children:[e.jsxs("p",{className:"text-xs text-outline",children:["Connected jobs (",t.subscriptions.length,")"]}),t.subscriptions.length?t.subscriptions.map(c=>e.jsxs("div",{className:"text-sm",children:[e.jsx(k,{className:"underline","data-testid":"webhook-job-link",to:`/jobs/${c.job_id}?project=all`,children:c.name}),e.jsxs("span",{className:"text-xs text-outline",children:[" ","- ",c.enabled?"Enabled":"Disabled","; events:"," ",c.events.join(", ")||"all","; actions: ",c.actions.join(", ")||"all"]})]},c.job_id)):e.jsx("p",{className:"text-sm text-outline",children:"No connected jobs. Select this webhook when creating or editing a job."})]}),e.jsx(W,{hook:t,secret:l}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(b,{type:"button",variant:"outline",size:"sm","data-testid":"webhook-deliveries-toggle",onClick:()=>d(!i),children:i?"Hide deliveries":"Recent deliveries"}),e.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(!n),children:"New signing secret"})]}),n&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"The sender's existing secret will stop working. Update it after generating the replacement."}),e.jsx(b,{type:"button",variant:"outline",size:"sm",disabled:a.isPending,onClick:()=>a.mutate(t.id,{onSuccess:c=>{m(c.secret),r(!1)}}),children:"Generate replacement secret"})]}),(s.error||a.error)&&e.jsx("p",{role:"alert",className:"text-sm text-error",children:(u=s.error??a.error)==null?void 0:u.message}),i&&e.jsx(H,{id:t.id})]})}function H({id:t}){const{data:s,isLoading:a,error:i,refetch:d}=D(t);return e.jsxs("section",{className:"space-y-2","data-testid":"webhook-deliveries",children:[e.jsx("h4",{className:"text-sm font-medium",children:"Recent deliveries"}),i?e.jsx(R,{message:i.message,onRetry:()=>d()}):a?e.jsx("p",{role:"status",children:"Loading deliveries..."}):s!=null&&s.length?s.map(n=>e.jsxs("div",{className:"space-y-1 border-t border-border py-2 text-xs","data-testid":"webhook-delivery",children:[e.jsxs("div",{className:"flex flex-wrap justify-between gap-2",children:[e.jsxs("span",{children:[n.event,n.action?` / ${n.action}`:""]}),e.jsx("span",{children:n.status})]}),e.jsxs("p",{className:"text-outline",children:[n.repository," ",new Date(n.created_at).toLocaleString()]}),n.status==="ignored"&&e.jsx("p",{className:"text-outline",children:"No enabled connected job matched this event."}),n.error&&e.jsx("p",{className:"text-error",children:n.error}),n.runs.map(r=>e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(k,{className:"underline",to:`/jobs/${r.job_id}?project=all`,children:["Job run: ",r.status]}),r.task_id&&e.jsx(k,{className:"underline",to:`/tasks/${r.task_id}?project=all`,children:"Created task"}),r.session_id&&e.jsx(k,{className:"underline",to:`/audit/${r.session_id}?project=all`,children:"Agent session"})]},r.job_run_id))]},n.id)):e.jsx("p",{className:"text-sm text-outline",children:"No events received yet. Register the endpoint with your provider, then send an event."})]})}export{K as J,J as W,G as a,Q as b,A as c,L as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ae,r as o,ai as ge,j as e,_ as d,T as G,$ as f,a4 as pe,a5 as je,a6 as fe,a7 as Ne,a8 as ye,E as H,S as U,ae as P,aj as ve,B as g,af as ke,f as _e,s as we,L as Q,m as Se,ak as Ce,a2 as De,V as ee,al as Te,am as $e,ah as Pe,an as te,t as Ee,v as Re,w as se,x as L,y as Je,z as O,a9 as ze,o as Ie,aa as ne,X as re,Y as le,Z as ie,ao as V,ap as q,aq as M,ar as W,as as B,at as oe}from"./index-
|
|
1
|
+
import{c as ae,r as o,ai as ge,j as e,_ as d,T as G,$ as f,a4 as pe,a5 as je,a6 as fe,a7 as Ne,a8 as ye,E as H,S as U,ae as P,aj as ve,B as g,af as ke,f as _e,s as we,L as Q,m as Se,ak as Ce,a2 as De,V as ee,al as Te,am as $e,ah as Pe,an as te,t as Ee,v as Re,w as se,x as L,y as Je,z as O,a9 as ze,o as Ie,aa as ne,X as re,Y as le,Z as ie,ao as V,ap as q,aq as M,ar as W,as as B,at as oe}from"./index-CVKguVuJ.js";import{J as Le,c as de}from"./JobWebhooks-CoFraeFc.js";import{S as Oe}from"./scroll-area-BrMwE434.js";import{b as Ae,c as Fe,d as ce,a as K,e as Be,u as Ve,f as qe,g as Me,h as We}from"./useJobs-DSLKgV8L.js";import{P as X}from"./pencil-CKDsHvse.js";import{u as He}from"./useProjectScope-Gvzzt8hR.js";/**
|
|
2
2
|
* @license lucide-react v1.27.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ve,bO as _,bJ as q,bL as re,bI as O,bQ as W,bS as tt,bT as ps,bN as Oe,bK as _t,bP as fs,bM as gs,j as e,W as B,r as m,f as Ee,B as y,L as St,d as M,cy as Pe,o as ke,$ as U,T as xe,ao as he,ap as pe,aq as fe,ar as ge,as as J,at as le,an as Re,a9 as ze,cp as Ct,cz as Ge,M as Dt,aa as $t,X as Et,Y as Pt,Z as Rt,_ as ie,ai as bs,cA as st,cB as js,a as ys,cC as vs,h as zt,m as Lt,cD as ks,cE as Ns,cF as ws,cG as _s,cH as at,a4 as Mt,a5 as Tt,a6 as At,a7 as Ft,a8 as It,al as $e,cI as Ss,aE as Cs,cq as Ds,i as $s,a0 as Kt,b$ as Es,a1 as Ae,V as Ps,aD as Bt,ah as nt,E as Qe,S as Ye,t as Rs,v as zs,w as it,x as de,y as Ls,z as ce,cJ as Ms,q as Ts,ae as ue,cK as rt,cL as Ce,cM as Ut,cN as As,cO as Fs,cP as Is,cQ as Ks,cR as Bs,cS as Us,cT as Os,cU as qs}from"./index-
|
|
1
|
+
import{c as ve,bO as _,bJ as q,bL as re,bI as O,bQ as W,bS as tt,bT as ps,bN as Oe,bK as _t,bP as fs,bM as gs,j as e,W as B,r as m,f as Ee,B as y,L as St,d as M,cy as Pe,o as ke,$ as U,T as xe,ao as he,ap as pe,aq as fe,ar as ge,as as J,at as le,an as Re,a9 as ze,cp as Ct,cz as Ge,M as Dt,aa as $t,X as Et,Y as Pt,Z as Rt,_ as ie,ai as bs,cA as st,cB as js,a as ys,cC as vs,h as zt,m as Lt,cD as ks,cE as Ns,cF as ws,cG as _s,cH as at,a4 as Mt,a5 as Tt,a6 as At,a7 as Ft,a8 as It,al as $e,cI as Ss,aE as Cs,cq as Ds,i as $s,a0 as Kt,b$ as Es,a1 as Ae,V as Ps,aD as Bt,ah as nt,E as Qe,S as Ye,t as Rs,v as zs,w as it,x as de,y as Ls,z as ce,cJ as Ms,q as Ts,ae as ue,cK as rt,cL as Ce,cM as Ut,cN as As,cO as Fs,cP as Is,cQ as Ks,cR as Bs,cS as Us,cT as Os,cU as qs}from"./index-CVKguVuJ.js";import{D as Hs,c as Ws}from"./DocumentWorkspace-PsD0kzUF.js";import{d as Vs,c as V,e as Gs,f as Le,a as Ot,g as Qs,K as Ys,h as Js,i as qt,j as Xs,k as Zs,l as ea,m as ta,n as sa,o as aa,p as na,b as ia}from"./useKnowledge-BbtBJLNm.js";import{U as Ht}from"./upload-BKVutGgF.js";import{w as ra}from"./wiki-links-Y6CQL1QZ.js";import{E as la,F as oa,A as da}from"./folder-open-BUB_WGMS.js";import{P as Wt}from"./pencil-CKDsHvse.js";import{D as ca}from"./download-zED8Kwne.js";import{R as ua}from"./refresh-cw-CBpDF1Q6.js";import{u as ma}from"./useProjectScope-Gvzzt8hR.js";import{a as xa,u as ha,b as pa,c as fa,d as ga,e as ba,f as ja,g as ya}from"./useMemories-CPw6917_.js";/**
|
|
2
2
|
* @license lucide-react v1.27.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ua,a1 as we,r as z,j as t,l as Fe,k as Ca,u as ve,a4 as Pa,a5 as Sa,a6 as Aa,a7 as Ma,a8 as Fa,B as _,d as V,X as Ee,Y as Le,Z as De,au as Qe,_ as re,$ as he,T as We,b as je,aa as Xe,i as ma,a0 as $a,b_ as Ia,a3 as Ea,a as La,h as Da,a2 as Oa,V as za,aD as Ra,b$ as Ba,c0 as Ua}from"./index-
|
|
1
|
+
import{c as ua,a1 as we,r as z,j as t,l as Fe,k as Ca,u as ve,a4 as Pa,a5 as Sa,a6 as Aa,a7 as Ma,a8 as Fa,B as _,d as V,X as Ee,Y as Le,Z as De,au as Qe,_ as re,$ as he,T as We,b as je,aa as Xe,i as ma,a0 as $a,b_ as Ia,a3 as Ea,a as La,h as Da,a2 as Oa,V as za,aD as Ra,b$ as Ba,c0 as Ua}from"./index-CVKguVuJ.js";import{p as $e,i as ra,a as Ta,s as qa}from"./public-api-BvD4z7ja.js";import{r as pa}from"./primitive-files-BwTyowra.js";import{U as Ka}from"./upload-BKVutGgF.js";/**
|
|
2
2
|
* @license lucide-react v1.27.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,C as c,f as o}from"./index-
|
|
1
|
+
import{j as t,C as c,f as o}from"./index-CVKguVuJ.js";const i="inline-flex min-h-11 items-center gap-1 font-label text-xs text-primary hover:text-on-surface disabled:opacity-40 disabled:hover:text-primary";function h({page:e,pageSize:s,total:a,onPage:n}){const r=Math.max(1,Math.ceil(a/s));if(a<=s)return null;const l=e*s+1,x=Math.min(a,(e+1)*s);return t.jsxs("div",{"data-testid":"pager",className:"flex flex-wrap gap-2 items-center justify-between border-t border-surface-highest px-3 py-2",children:[t.jsxs("span",{className:"font-label text-xs text-outline",children:[l,"–",x," of ",a]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("button",{type:"button","data-testid":"pager-prev",className:i,disabled:e===0,onClick:()=>n(e-1),children:[t.jsx(c,{className:"h-3 w-3"}),"Prev"]}),t.jsxs("span",{className:"font-label text-xs text-outline",children:["Page ",e+1," / ",r]}),t.jsxs("button",{type:"button","data-testid":"pager-next",className:i,disabled:e>=r-1,onClick:()=>n(e+1),children:["Next",t.jsx(o,{className:"h-3 w-3"})]})]})]})}export{h as P};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Jt=Object.defineProperty;var jt=(n,B,e)=>B in n?Jt(n,B,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[B]=e;var F=(n,B,e)=>jt(n,typeof B!="symbol"?B+"":B,e);import{bI as W,bJ as pB,bK as KB,bL as LB,bM as At,bN as lB,bO as eB,bP as Lt,bQ as vB,bR as Ut,bS as Qe,bT as Ye,r as S,j as c,_ as Y,$ as rB,B as dB,a as Kt,u as qt,o as Qt,a1 as Ve,b as me,d as te,bU as Yt,bV as Vt,bW as ze,bX as Xe,a4 as zt,a5 as Xt,a6 as Zt,a7 as Wt,bY as $t,a8 as Bs,V as es}from"./index-
|
|
1
|
+
var Jt=Object.defineProperty;var jt=(n,B,e)=>B in n?Jt(n,B,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[B]=e;var F=(n,B,e)=>jt(n,typeof B!="symbol"?B+"":B,e);import{bI as W,bJ as pB,bK as KB,bL as LB,bM as At,bN as lB,bO as eB,bP as Lt,bQ as vB,bR as Ut,bS as Qe,bT as Ye,r as S,j as c,_ as Y,$ as rB,B as dB,a as Kt,u as qt,o as Qt,a1 as Ve,b as me,d as te,bU as Yt,bV as Vt,bW as ze,bX as Xe,a4 as zt,a5 as Xt,a6 as Zt,a7 as Wt,bY as $t,a8 as Bs,V as es}from"./index-CVKguVuJ.js";import{u as ts}from"./useJobs-DSLKgV8L.js";function Fe(n,B,e,t=[]){return Object.entries(n).map(([s,C])=>({native:s,event:C,block:B.includes(s),context:e.includes(s),rewrite_command:t.includes(s)}))}const ss={PreToolUse:"pre_tool",PostToolUse:"post_tool",PostToolUseFailure:"post_tool_failure",PostToolBatch:"post_tool_batch",SessionStart:"session_start",SessionEnd:"session_end",UserPromptSubmit:"prompt_submit",UserPromptExpansion:"prompt_expansion",Stop:"stop",StopFailure:"stop_failure",SubagentStart:"subagent_start",SubagentStop:"subagent_stop",PreCompact:"pre_compact",PostCompact:"post_compact",PermissionRequest:"permission_request",PermissionDenied:"permission_denied",Notification:"notification",Setup:"setup",TeammateIdle:"teammate_idle",TaskCreated:"task_created",TaskCompleted:"task_completed",Elicitation:"elicitation",ElicitationResult:"elicitation_result",ConfigChange:"config_change",WorktreeRemove:"worktree_remove",InstructionsLoaded:"instructions_loaded",CwdChanged:"cwd_changed",FileChanged:"file_changed",DirectoryAdded:"directory_added",MessageDisplay:"message_display"},ne={claude:Fe(ss,["PreToolUse","PermissionRequest","UserPromptSubmit","UserPromptExpansion","Stop","SubagentStop","TaskCreated","ConfigChange"],["PreToolUse","PostToolUse","PostToolUseFailure","UserPromptSubmit","SessionStart","SubagentStart","UserPromptExpansion","PostToolBatch","Stop","SubagentStop"],["PreToolUse"]),cursor:Fe({sessionStart:"session_start",sessionEnd:"session_end",preToolUse:"pre_tool",postToolUse:"post_tool",postToolUseFailure:"post_tool_failure",subagentStart:"subagent_start",subagentStop:"subagent_stop",beforeShellExecution:"before_shell",afterShellExecution:"after_shell",beforeMCPExecution:"before_mcp",afterMCPExecution:"after_mcp",beforeReadFile:"before_read",afterFileEdit:"after_edit",beforeSubmitPrompt:"prompt_submit",preCompact:"pre_compact",stop:"stop",afterAgentResponse:"agent_response",afterAgentThought:"agent_thought",beforeTabFileRead:"before_tab_read",afterTabFileEdit:"after_tab_edit",workspaceOpen:"workspace_open"},["preToolUse","beforeShellExecution","beforeMCPExecution","beforeReadFile","beforeTabFileRead","beforeSubmitPrompt","subagentStart"],["sessionStart"]),gemini:Fe({BeforeTool:"pre_tool",AfterTool:"post_tool",BeforeAgent:"prompt_submit",AfterAgent:"stop",BeforeModel:"before_model",AfterModel:"after_model",BeforeToolSelection:"before_tool_selection",SessionStart:"session_start",SessionEnd:"session_end",PreCompress:"pre_compact",Notification:"notification"},["BeforeTool","BeforeAgent","AfterAgent","BeforeModel"],["SessionStart","BeforeAgent","BeforeTool","AfterTool","AfterAgent"]),codex:Fe({PreToolUse:"pre_tool",PermissionRequest:"permission_request",PostToolUse:"post_tool",PreCompact:"pre_compact",PostCompact:"post_compact",UserPromptSubmit:"prompt_submit",SubagentStart:"subagent_start",SubagentStop:"subagent_stop",SessionStart:"session_start",SessionEnd:"session_end",Stop:"stop",Interrupt:"interrupt"},["PreToolUse"],["PreToolUse","PostToolUse","UserPromptSubmit","SessionStart","SubagentStart"])};function bt(n,B){if(["claude","codex"].includes(n)&&["runtime:permission_request","runtime:question_request"].includes(B))return{native:"",event:B,block:!0,context:!0,rewrite_command:!1};const e=ne[n];return e==null?void 0:e.find(t=>t.event===B||`native:${t.native}`===B)}/*!
|
|
2
2
|
* re2js
|
|
3
3
|
* RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as fe,i as Je,a as Ke,o as Ae,r as l,u as le,j as e,B as H,aa as ce,X as de,Y as xe,Z as ue,au as me,_ as ee,$ as W,av as Oe,d as z,aw as Qe,E as Ue,s as Fe,ax as Ge,L as Ve,ay as We,az as Ye,aA as Xe,p as He,aB as Ze,a4 as et,a5 as tt,a6 as st,a7 as at,D as ae,aC as he,A as ne,R as pe,aD as Be,C as nt,f as rt,a8 as it,S as ot,aE as lt,ad as ct,m as dt,aF as xt,aG as ut,ah as mt,t as ht,v as pt,w as qe,x as B,y as gt,z as I,V as ft}from"./index-
|
|
1
|
+
import{h as fe,i as Je,a as Ke,o as Ae,r as l,u as le,j as e,B as H,aa as ce,X as de,Y as xe,Z as ue,au as me,_ as ee,$ as W,av as Oe,d as z,aw as Qe,E as Ue,s as Fe,ax as Ge,L as Ve,ay as We,az as Ye,aA as Xe,p as He,aB as Ze,a4 as et,a5 as tt,a6 as st,a7 as at,D as ae,aC as he,A as ne,R as pe,aD as Be,C as nt,f as rt,a8 as it,S as ot,aE as lt,ad as ct,m as dt,aF as xt,aG as ut,ah as mt,t as ht,v as pt,w as qe,x as B,y as gt,z as I,V as ft}from"./index-CVKguVuJ.js";import{P as jt}from"./pencil-CKDsHvse.js";import{R as Ie}from"./refresh-cw-CBpDF1Q6.js";import{P as vt}from"./Pager-CMh30dp4.js";import{u as bt}from"./useProjectScope-Gvzzt8hR.js";function yt({projectId:s}){var je,ve,be,ye,Ne,we,ke,Se,Ce,_e;const[d]=fe(),u=Je(),f=Ke(),p=Ae(),[h,x]=l.useState({key:"",offset:0}),[r,i]=l.useState(null),[w,k]=l.useState(!1),[c,$]=l.useState(!1),[b,o]=l.useState(""),[m,g]=l.useState(""),[A,L]=l.useState(s),[E,T]=l.useState(""),[R,J]=l.useState(""),[O,P]=l.useState(""),[D,U]=l.useState(""),[n,v]=l.useState(0),q=d.get("q")??"",F=d.get("agent")??"",t=d.get("ended")!=="0",N=JSON.stringify([s,q,F]),_=h.key===N?h.offset:0,C=a=>x({key:N,offset:a}),y=le({queryKey:["sessions","archive",s,q,F,_],queryFn:()=>z.sessions.archive({q,...s==="all"?{}:{project_id:s},...["claude","codex"].includes(F)?{agent:F}:{},offset:_,limit:20}),enabled:t,refetchInterval:1e4}),te=le({queryKey:["sessions","archive-transcript",r==null?void 0:r.id,r==null?void 0:r.revision,n],queryFn:()=>z.sessions.archiveTranscript(r==null?void 0:r.id,{revision:r==null?void 0:r.revision,offset:n,limit:50}),enabled:!!r});async function re(a){$(!0),o(""),g("");try{await a(),await f.invalidateQueries({queryKey:["sessions"]})}catch(S){o(S instanceof Error?S.message:"Request failed")}finally{$(!1)}}async function Me(a){var Te,$e;if(!(a!=null&&a.length))return;const S=($e=(Te=p.data)==null?void 0:Te.find(K=>K.id===A))==null?void 0:$e.name;if(!S){o("Select a project before uploading");return}await re(async()=>{var Pe,Ee,Re,De;let K=localStorage.getItem("orc_session_upload_source");K||(K=crypto.randomUUID(),localStorage.setItem("orc_session_upload_source",K));let Le=0;const Y=[];for(const se of Array.from(a))try{if(se.size>60*1024*1024)throw new Error("File exceeds 60 MiB");const X=await se.text(),ie=X.split(/\r?\n/).filter(Z=>Z.trim()).map(Z=>JSON.parse(Z)),Q=((Pe=ie[0])==null?void 0:Pe.type)==="session_meta",j=Q?ie[0].payload:ie.find(Z=>Z.sessionId),ze=await z.sessions.archiveUpload({project:S,source_id:K,agent:Q?"codex":"claude",session_id:Q?j==null?void 0:j.id:j==null?void 0:j.sessionId,title:se.name.slice(0,200),metadata:{cwd:(j==null?void 0:j.cwd)??"",subdirectory:"",...Q&&((Ee=j==null?void 0:j.git)!=null&&Ee.repository_url)?{repository:j.git.repository_url}:{},...Q&&((Re=j==null?void 0:j.git)!=null&&Re.branch)?{branch:j.git.branch}:{},...Q&&((De=j==null?void 0:j.git)!=null&&De.commit_hash)?{commit:j.git.commit_hash}:{}},bundle:{version:1,files:[{path:"session.jsonl",content:X}]}});["created","updated","unchanged","stale"].includes(ze.outcome)&&Le++}catch(X){Y.push(`${se.name}: ${X instanceof Error?X.message:"Upload failed"}`)}g(`${Le} of ${a.length} sessions synchronized${Y.length?`; ${Y.length} need attention`:""}.`),Y.length&&o(Y.join(`
|
|
2
2
|
`))})}return t?e.jsxs("section",{className:"mt-8 space-y-3","data-testid":"session-archive",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-medium",children:"Archived sessions"}),e.jsx("p",{className:"text-xs text-outline",children:"Uploaded history stays available after the source computer is offline."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(H,{variant:"outline","data-testid":"archive-index",disabled:c,onClick:()=>void re(async()=>{const a=await z.sessions.archiveIndex(s==="all"||s==="unassigned"?void 0:s);g(`${a.indexed} sessions indexed; ${a.failed} failed; ${a.skipped} skipped.`)}),children:"Index discovered sessions"}),e.jsx(H,{"data-testid":"archive-upload-open",onClick:()=>{L(s),k(!0)},children:"Upload sessions"})]})]}),m&&e.jsx("p",{role:"status","data-testid":"archive-feedback",className:"text-sm",children:m}),(b||y.error)&&e.jsx("p",{role:"alert",className:"whitespace-pre-wrap text-sm text-error",children:b||((je=y.error)==null?void 0:je.message)}),((ve=y.data)==null?void 0:ve.degraded)&&e.jsx("p",{role:"status","data-testid":"archive-degraded",className:"text-xs text-outline",children:y.data.degraded}),!!((be=y.data)!=null&&be.pending_chunks)&&e.jsxs("p",{className:"text-xs text-outline",children:[y.data.pending_chunks," passages waiting for embeddings"]}),e.jsxs("div",{className:"divide-y divide-outline-variant rounded border border-outline-variant",children:[y.isLoading&&e.jsx("p",{className:"p-4 text-sm",children:"Loading archived sessions…"}),!y.isLoading&&!((ye=y.data)!=null&&ye.sessions.length)&&e.jsx("p",{className:"p-4 text-sm text-outline",children:"No archived sessions match this view."}),(Ne=y.data)==null?void 0:Ne.sessions.map(a=>e.jsxs("button",{type:"button","data-testid":"archive-session-row","data-archive-id":a.id,className:"block w-full p-3 text-left hover:bg-surface-container",onClick:()=>{i(a),v(0),T(a.metadata.repository??""),J(a.metadata.branch??""),P(a.metadata.commit??""),U(a.metadata.subdirectory)},children:[e.jsx("span",{className:"block text-sm font-medium",children:a.title}),e.jsxs("span",{className:"text-xs text-outline",children:[a.agent," · ended · ",new Date(a.updated_at).toLocaleString()," · revision"," ",a.revision," · ",a.metadata.cwd]}),a.passages.map(S=>e.jsx("span",{className:"mt-1 block text-sm text-outline",children:S.snippet},S.citation)),a.embedding_error&&e.jsx("span",{className:"block text-xs text-error",children:a.embedding_error})]},a.id))]}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(H,{variant:"ghost",disabled:_===0,onClick:()=>C(Math.max(0,_-20)),children:"Previous"}),e.jsx(H,{variant:"ghost",disabled:!((we=y.data)!=null&&we.has_more),onClick:()=>C(_+20),children:"Next"})]}),e.jsx(ce,{open:w,onOpenChange:k,children:e.jsxs(de,{children:[e.jsxs(xe,{children:[e.jsx(ue,{children:"Upload session histories"}),e.jsx(me,{children:"Select an existing project and native Claude/Codex JSONL files. This stores history without starting a terminal. For large collections, use the orc-platform sync script."})]}),e.jsx(ee,{htmlFor:"archive-project",children:"Project"}),e.jsxs("select",{id:"archive-project","data-testid":"archive-project",value:A,onChange:a=>L(a.target.value),className:"rounded border border-outline-variant bg-surface p-2",children:[e.jsx("option",{value:"all",children:"Select a project"}),(ke=p.data)==null?void 0:ke.map(a=>e.jsx("option",{value:a.id,children:a.name},a.id))]}),e.jsx(W,{"data-testid":"archive-files",type:"file",multiple:!0,accept:".jsonl",disabled:c||!((Se=p.data)!=null&&Se.some(a=>a.id===A)),onChange:a=>void Me(a.target.files)}),c&&e.jsx("p",{role:"status",children:"Uploading…"}),m&&e.jsx("p",{role:"status","data-testid":"archive-upload-feedback",children:m}),b&&e.jsx("p",{role:"alert",className:"whitespace-pre-wrap text-sm text-error",children:b})]})}),e.jsx(ce,{open:!!r,onOpenChange:a=>{a||i(null)},children:e.jsxs(de,{className:"max-h-[90vh] max-w-3xl overflow-y-auto","data-testid":"archive-detail",children:[e.jsxs(xe,{children:[e.jsx(ue,{children:r==null?void 0:r.title}),e.jsxs(me,{children:["Archived history · revision ",r==null?void 0:r.revision,". Prepare a destination checkout to continue in a terminal."]})]}),te.error&&e.jsx("p",{role:"alert",children:te.error.message}),(Ce=te.data)==null?void 0:Ce.turns.map(a=>e.jsxs("div",{className:"border-b border-outline-variant py-2","data-testid":"archive-turn",children:[e.jsx("p",{className:"text-xs text-outline",children:a.role}),e.jsx(Oe,{plain:!0,children:a.blocks.map(S=>S.type==="tool_use"?`${S.name}
|
|
3
3
|
${S.input}
|
|
4
4
|
${S.result??""}`:S.text).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as m,j as e,I as re,c as M,d as k,c1 as V,_ as p,$ as y,T as K,c2 as ie,B as w,W as oe,an as de,ao as F,ap as T,aq as A,ar as D,as as C,a9 as le,a as X,b as ce,c3 as me,c4 as he,c5 as ue,ai as xe,c6 as ge,c7 as pe,E as fe,bE as be,ab as G,c8 as I,V as ve,c9 as W,ca as q}from"./index-
|
|
1
|
+
import{r as m,j as e,I as re,c as M,d as k,c1 as V,_ as p,$ as y,T as K,c2 as ie,B as w,W as oe,an as de,ao as F,ap as T,aq as A,ar as D,as as C,a9 as le,a as X,b as ce,c3 as me,c4 as he,c5 as ue,ai as xe,c6 as ge,c7 as pe,E as fe,bE as be,ab as G,c8 as I,V as ve,c9 as W,ca as q}from"./index-CVKguVuJ.js";import{u as je,a as ye,b as Ne,c as _e}from"./useKnowledge-BbtBJLNm.js";import{D as ke}from"./download-zED8Kwne.js";import{S as Z}from"./save-BK4gikTj.js";var we=Object.defineProperty,ee=(t,n)=>we(t,"name",{value:n,configurable:!0}),z={Horizontal:"horizontal",Vertical:"vertical"},Y=z.Horizontal,Se=Object.values(z),te=m.forwardRef(ee(function(n,h){const{decorative:c,orientation:s=Y,...x}=n,g=se(s)?s:Y,b=g===z.Vertical?g:void 0,v=c?{role:"none"}:{"aria-orientation":b,role:"separator"};return e.jsx(re.div,{"data-orientation":g,...v,...x,ref:h})},"Separator"));function se(t){return Se.includes(t)}ee(se,"isValidOrientation");/**
|
|
2
2
|
* @license lucide-react v1.27.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -16,5 +16,5 @@ import{r as m,j as e,I as re,c as M,d as k,c1 as V,_ as p,$ as y,T as K,c2 as ie
|
|
|
16
16
|
*/const Ie=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Oe=M("rotate-cw",Ie);function Fe(){const[t,n]=m.useState(null),[h,c]=m.useState(""),[s,x]=m.useState(""),[g,b]=m.useState(!1);m.useEffect(()=>{let o=!1;return k.settings.get().then(d=>{if(o)return;const f=V.parse(d.chat??{});n(f),c(f.models.map(u=>`${u.agent}: ${u.id}`).join(`
|
|
17
17
|
`))}).catch(d=>{o||x(d.message)}),()=>{o=!0}},[]);async function v(){if(t){b(!0),x("");try{const o=h.split(`
|
|
18
18
|
`).filter(f=>f.trim()).map(f=>{const u=f.match(/^([a-z][a-z0-9-]*):\s*(.+)$/i);if(!u)throw new Error("Use agent: model-id on each model line.");return{agent:u[1]??"",id:u[2]??""}}),d=V.parse({...t,models:o});await k.settings.save({chat:d}),n(d),window.dispatchEvent(new Event("orc-chat-settings-changed")),x("Chat defaults saved. They apply to new conversations on every device.")}catch(o){x(o instanceof Error?o.message:"Chat settings could not be saved.")}finally{b(!1)}}}return e.jsxs("section",{"aria-labelledby":"chat-settings-title",className:"space-y-4","data-testid":"chat-settings",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"chat-settings-title",className:"text-base font-medium",children:"Chat"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Defaults for new conversations. Existing chats keep their configuration. Credentials stay on the execution host."})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"chat-default-agent",children:"Default agent"}),e.jsx(y,{id:"chat-default-agent","data-testid":"chat-default-agent",value:t.agent,onChange:o=>n({...t,agent:o.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"chat-default-model",children:"Default model"}),e.jsx(y,{id:"chat-default-model","data-testid":"chat-default-model",value:t.model,placeholder:"Agent default",onChange:o=>n({...t,model:o.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"chat-model-catalog",children:"Model picker choices"}),e.jsx(K,{id:"chat-model-catalog","data-testid":"chat-model-catalog",value:h,onChange:o=>c(o.target.value),placeholder:`codex: your-model-id
|
|
19
|
-
claude: your-model-id`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"One agent: model-id per line. Use model IDs supported by your installed agent and account."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"chat-system-prompt",children:"Instructions"}),e.jsx(K,{id:"chat-system-prompt","data-testid":"chat-system-prompt",rows:6,value:t.system,onChange:o=>n({...t,system:o.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Claude appends these to its coding system prompt. Codex and other agents receive them as turn instructions. Workspace rules remain enforced."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"chat-mcp",children:"Tools connection"}),e.jsxs("select",{id:"chat-mcp","data-testid":"chat-mcp",className:"min-h-11 w-full rounded-md border border-control-border bg-background px-3 text-base sm:text-sm",value:t.mcp,onChange:o=>n({...t,mcp:o.target.value}),children:[e.jsx("option",{value:"orc",children:"Connect ORC MCP (Claude and Codex)"}),e.jsx("option",{value:"native",children:"Use the agent’s host configuration"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The ORC connection uses server credentials internally. Host configuration may include other MCP servers; this setting does not disable them. Protected workspaces may also require ORC tools."})]}),e.jsx(ie,{config:t,onChange:n,disabled:g}),e.jsx(w,{"data-testid":"chat-settings-save",disabled:g,onClick:()=>void v(),children:g?"Saving…":"Save chat defaults"})]}),s&&e.jsx("p",{role:"status","data-testid":"chat-settings-feedback",className:"break-words text-sm text-muted-foreground",children:s})]})}const E=m.forwardRef(({className:t,orientation:n="horizontal",decorative:h=!0,...c},s)=>e.jsx(te,{ref:s,decorative:h,orientation:n,className:oe("shrink-0 bg-surface-bright ",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...c}));E.displayName=te.displayName;const P=1024*1024;function Q(t){return t===null?"":t>=1024*P?`${(t/1024/P).toFixed(1)} GB`:`${Math.round(t/P)} MB`}function Te(t){return{session_embeddings:t.session_embeddings??!1,parser:t.parser,docling_enabled:t.docling_enabled,parser_timeout_secs:String(t.parser_timeout_secs),max_upload_mb:String(Math.round(t.max_upload_bytes/P)),usage_retention_days:String(t.usage_retention_days),provider:t.embedding.provider,base_url:t.embedding.base_url??"",model:t.embedding.model??"",dimensions:t.embedding.dimensions?String(t.embedding.dimensions):"",api_key:"",clear_key:!1}}const Ae={none:"Keyword search only. Add an embedding provider for semantic and hybrid search.",ollama:"Local embeddings from Ollama, for example nomic-embed-text at http://localhost:11434.",openai:"OpenAI or any OpenAI-compatible endpoint, for example text-embedding-3-small."};function De(){var L,$,H,U;const t=je(),n=ye(),h=Ne(),c=_e(),[s,x]=m.useState(null),[g,b]=m.useState(null),[v,o]=m.useState(!1),[d,f]=m.useState(!1),[u,_]=m.useState(!1);if(m.useEffect(()=>{t.data&&x(Te(t.data))},[t.data]),t.error)return e.jsxs("section",{children:[e.jsx("h2",{className:"mb-1 text-base font-medium",children:"Knowledge"}),e.jsx("p",{role:"alert",className:"text-sm text-error",children:t.error.message})]});if(!s||!t.data)return null;const j=t.data,N=a=>j.env_overrides.includes(`ORC_KNOWLEDGE_${a}`),l=a=>{o(!1),x({...s,...a})},i=(L=n.data)==null?void 0:L.parsers.find(a=>a.id==="docling"),r=($=n.data)==null?void 0:$.docling;async function S(a){f(!0),b(null);try{return await a(),await c(),!0}catch(R){return b(R instanceof Error?R.message:"Request failed"),!1}finally{f(!1)}}async function ae(a){if(a.preventDefault(),!s)return;const R=B=>B.trim()?Number(B):null,ne={session_embeddings:s.session_embeddings,parser:s.parser,docling_enabled:s.docling_enabled,parser_timeout_secs:Number(s.parser_timeout_secs),max_upload_bytes:Number(s.max_upload_mb)*P,usage_retention_days:Number(s.usage_retention_days),embedding:{provider:s.provider,base_url:s.base_url.trim()||null,model:s.model.trim()||null,dimensions:R(s.dimensions),...s.clear_key?{api_key:null}:s.api_key?{api_key:s.api_key}:{}}};await S(()=>k.kb.updateSettings(ne))&&o(!0)}return e.jsxs("section",{"data-testid":"settings-knowledge","aria-labelledby":"settings-knowledge-title",children:[e.jsx("h2",{id:"settings-knowledge-title",className:"mb-1 text-base font-medium text-on-surface",children:"Knowledge"}),e.jsxs("p",{className:"mb-4 text-sm text-muted-foreground",children:["How ORC parses uploads and searches knowledge bases. Saved on the server in"," ",e.jsx("code",{className:"text-primary",children:"~/.orc/config.json"}),"; files live in"," ",e.jsx("code",{className:"break-all text-primary",children:j.root}),"."]}),e.jsx(E,{className:"mb-4 bg-outline-variant"}),j.env_overrides.length>0&&e.jsxs("p",{className:"mb-4 text-sm text-warning","data-testid":"settings-knowledge-env",children:["Set by environment, these win over saved values: ",j.env_overrides.join(", ")]}),e.jsxs("form",{onSubmit:ae,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Parsers"}),(H=n.data)==null?void 0:H.parsers.map(a=>e.jsxs("div",{"data-testid":`settings-parser-${a.id}`,className:"rounded-md border border-outline-variant p-3 text-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:a.label}),e.jsxs("span",{className:"text-xs text-outline",children:[a.installed?`v${a.version}`:"not installed",a.size_bytes?` · ${Q(a.size_bytes)}${a.installed?"":" download"}`:""]})]}),e.jsx("p",{className:"mt-1 text-outline",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-outline",children:["Formats: ",a.capabilities.formats.join(", ")]}),a.detail&&e.jsx("p",{className:"mt-1 text-xs text-outline",children:a.detail}),a.id==="docling"&&e.jsxs("div",{className:"mt-3 space-y-2",children:[(r==null?void 0:r.state)==="installing"&&e.jsxs("div",{role:"status","data-testid":"settings-docling-progress",className:"text-xs text-outline",children:[r.step,e.jsx("pre",{className:"mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap font-mono",children:r.log.slice(-8).join(`
|
|
19
|
+
claude: your-model-id`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"One agent: model-id per line. Use model IDs supported by your installed agent and account."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"chat-system-prompt",children:"Instructions"}),e.jsx(K,{id:"chat-system-prompt","data-testid":"chat-system-prompt",rows:6,value:t.system,onChange:o=>n({...t,system:o.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Claude appends these to its coding system prompt. Codex and other agents receive them as turn instructions. Workspace rules remain enforced."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"chat-mcp",children:"Tools connection"}),e.jsxs("select",{id:"chat-mcp","data-testid":"chat-mcp",className:"min-h-11 w-full rounded-md border border-control-border bg-background px-3 text-base sm:text-sm",value:t.mcp,onChange:o=>n({...t,mcp:o.target.value}),children:[e.jsx("option",{value:"orc",children:"Connect ORC MCP (Claude and Codex)"}),e.jsx("option",{value:"native",children:"Use the agent’s host configuration"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The ORC connection uses server credentials internally and serves meta tools that search, describe and invoke every ORC tool on demand. Host configuration may include other MCP servers; this setting does not disable them. Protected workspaces may also require ORC tools."})]}),e.jsx(ie,{config:t,onChange:n,disabled:g}),e.jsx(w,{"data-testid":"chat-settings-save",disabled:g,onClick:()=>void v(),children:g?"Saving…":"Save chat defaults"})]}),s&&e.jsx("p",{role:"status","data-testid":"chat-settings-feedback",className:"break-words text-sm text-muted-foreground",children:s})]})}const E=m.forwardRef(({className:t,orientation:n="horizontal",decorative:h=!0,...c},s)=>e.jsx(te,{ref:s,decorative:h,orientation:n,className:oe("shrink-0 bg-surface-bright ",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...c}));E.displayName=te.displayName;const P=1024*1024;function Q(t){return t===null?"":t>=1024*P?`${(t/1024/P).toFixed(1)} GB`:`${Math.round(t/P)} MB`}function Te(t){return{session_embeddings:t.session_embeddings??!1,parser:t.parser,docling_enabled:t.docling_enabled,parser_timeout_secs:String(t.parser_timeout_secs),max_upload_mb:String(Math.round(t.max_upload_bytes/P)),usage_retention_days:String(t.usage_retention_days),provider:t.embedding.provider,base_url:t.embedding.base_url??"",model:t.embedding.model??"",dimensions:t.embedding.dimensions?String(t.embedding.dimensions):"",api_key:"",clear_key:!1}}const Ae={none:"Keyword search only. Add an embedding provider for semantic and hybrid search.",ollama:"Local embeddings from Ollama, for example nomic-embed-text at http://localhost:11434.",openai:"OpenAI or any OpenAI-compatible endpoint, for example text-embedding-3-small."};function De(){var L,$,H,U;const t=je(),n=ye(),h=Ne(),c=_e(),[s,x]=m.useState(null),[g,b]=m.useState(null),[v,o]=m.useState(!1),[d,f]=m.useState(!1),[u,_]=m.useState(!1);if(m.useEffect(()=>{t.data&&x(Te(t.data))},[t.data]),t.error)return e.jsxs("section",{children:[e.jsx("h2",{className:"mb-1 text-base font-medium",children:"Knowledge"}),e.jsx("p",{role:"alert",className:"text-sm text-error",children:t.error.message})]});if(!s||!t.data)return null;const j=t.data,N=a=>j.env_overrides.includes(`ORC_KNOWLEDGE_${a}`),l=a=>{o(!1),x({...s,...a})},i=(L=n.data)==null?void 0:L.parsers.find(a=>a.id==="docling"),r=($=n.data)==null?void 0:$.docling;async function S(a){f(!0),b(null);try{return await a(),await c(),!0}catch(R){return b(R instanceof Error?R.message:"Request failed"),!1}finally{f(!1)}}async function ae(a){if(a.preventDefault(),!s)return;const R=B=>B.trim()?Number(B):null,ne={session_embeddings:s.session_embeddings,parser:s.parser,docling_enabled:s.docling_enabled,parser_timeout_secs:Number(s.parser_timeout_secs),max_upload_bytes:Number(s.max_upload_mb)*P,usage_retention_days:Number(s.usage_retention_days),embedding:{provider:s.provider,base_url:s.base_url.trim()||null,model:s.model.trim()||null,dimensions:R(s.dimensions),...s.clear_key?{api_key:null}:s.api_key?{api_key:s.api_key}:{}}};await S(()=>k.kb.updateSettings(ne))&&o(!0)}return e.jsxs("section",{"data-testid":"settings-knowledge","aria-labelledby":"settings-knowledge-title",children:[e.jsx("h2",{id:"settings-knowledge-title",className:"mb-1 text-base font-medium text-on-surface",children:"Knowledge"}),e.jsxs("p",{className:"mb-4 text-sm text-muted-foreground",children:["How ORC parses uploads and searches knowledge bases. Saved on the server in"," ",e.jsx("code",{className:"text-primary",children:"~/.orc/config.json"}),"; files live in"," ",e.jsx("code",{className:"break-all text-primary",children:j.root}),"."]}),e.jsx(E,{className:"mb-4 bg-outline-variant"}),j.env_overrides.length>0&&e.jsxs("p",{className:"mb-4 text-sm text-warning","data-testid":"settings-knowledge-env",children:["Set by environment, these win over saved values: ",j.env_overrides.join(", ")]}),e.jsxs("form",{onSubmit:ae,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Parsers"}),(H=n.data)==null?void 0:H.parsers.map(a=>e.jsxs("div",{"data-testid":`settings-parser-${a.id}`,className:"rounded-md border border-outline-variant p-3 text-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:a.label}),e.jsxs("span",{className:"text-xs text-outline",children:[a.installed?`v${a.version}`:"not installed",a.size_bytes?` · ${Q(a.size_bytes)}${a.installed?"":" download"}`:""]})]}),e.jsx("p",{className:"mt-1 text-outline",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-outline",children:["Formats: ",a.capabilities.formats.join(", ")]}),a.detail&&e.jsx("p",{className:"mt-1 text-xs text-outline",children:a.detail}),a.id==="docling"&&e.jsxs("div",{className:"mt-3 space-y-2",children:[(r==null?void 0:r.state)==="installing"&&e.jsxs("div",{role:"status","data-testid":"settings-docling-progress",className:"text-xs text-outline",children:[r.step,e.jsx("pre",{className:"mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap font-mono",children:r.log.slice(-8).join(`
|
|
20
20
|
`)})]}),(r==null?void 0:r.state)==="failed"&&e.jsx("p",{role:"alert",className:"text-xs text-error",children:r.error}),a.installed?e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox","data-testid":"settings-docling-enabled",checked:s.docling_enabled,onChange:R=>l({docling_enabled:R.target.checked})}),"Use automatically for PDFs and images"]}),e.jsxs(w,{type:"button",size:"sm",variant:"ghost",className:"text-error","data-testid":"settings-docling-remove",onClick:()=>_(!0),children:[e.jsx(de,{size:14}),"Remove"]})]}):e.jsxs(w,{type:"button",size:"sm",variant:"outline","data-testid":"settings-docling-install",disabled:d||(r==null?void 0:r.state)==="installing",onClick:()=>S(()=>k.kb.installDocling()),children:[e.jsx(ke,{size:14}),(r==null?void 0:r.state)==="installing"?"Installing…":`Install Docling (${Q((i==null?void 0:i.size_bytes)??null)||"about 2 GB"})`]})]})]},a.id)),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"settings-kb-parser",className:"text-sm text-muted-foreground",children:"Default parser"}),e.jsxs(F,{value:s.parser,onValueChange:a=>l({parser:a}),disabled:N("PARSER"),children:[e.jsx(T,{id:"settings-kb-parser","data-testid":"settings-kb-parser",children:e.jsx(A,{})}),e.jsxs(D,{children:[e.jsx(C,{value:"auto",children:"Automatic: Docling for PDFs and images when enabled"}),(U=n.data)==null?void 0:U.parsers.map(a=>e.jsx(C,{value:a.id,disabled:!a.installed,children:a.label},a.id))]})]}),e.jsx("p",{className:"text-xs text-outline",children:"Knowledge bases can override it. Changing parsers applies to new uploads; reparse a document to apply it to existing ones."})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-timeout",className:"text-sm text-muted-foreground",children:"Parse timeout (s)"}),e.jsx(y,{id:"settings-kb-timeout",type:"number",min:10,value:s.parser_timeout_secs,onChange:a=>l({parser_timeout_secs:a.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-max-upload",className:"text-sm text-muted-foreground",children:"Max upload (MB)"}),e.jsx(y,{id:"settings-kb-max-upload",type:"number",min:1,value:s.max_upload_mb,onChange:a=>l({max_upload_mb:a.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-retention",className:"text-sm text-muted-foreground",children:"Read log (days)"}),e.jsx(y,{id:"settings-kb-retention",type:"number",min:1,value:s.usage_retention_days,onChange:a=>l({usage_retention_days:a.target.value})})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Semantic search"}),e.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[e.jsx("input",{type:"checkbox","data-testid":"settings-session-embeddings",checked:s.session_embeddings,onChange:a=>l({session_embeddings:a.target.checked})}),e.jsxs("span",{children:["Search coding sessions with embeddings",e.jsx("span",{className:"block text-xs text-outline",children:"Uses the provider below for session passages. Keyword search and transcript reading remain available when off. Enabling sends session text to this provider and indexes discovered project sessions."})]})]}),h.data&&e.jsxs("p",{className:"text-xs text-outline","data-testid":"settings-embedding-status",children:[h.data.embedding.ready?`Ready · ${h.data.embedding.model} · ${h.data.embedding.vector_backend}`:h.data.embedding.detail??"Not configured",h.data.embedding.pending_chunks?` · ${h.data.embedding.pending_chunks} passages waiting`:""]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-provider",className:"text-sm text-muted-foreground",children:"Embedding provider"}),e.jsxs(F,{value:s.provider,onValueChange:a=>l({provider:a}),disabled:N("EMBEDDING_PROVIDER"),children:[e.jsx(T,{id:"settings-kb-provider","data-testid":"settings-kb-provider",children:e.jsx(A,{})}),e.jsxs(D,{children:[e.jsx(C,{value:"none",children:"None"}),e.jsx(C,{value:"ollama",children:"Ollama"}),e.jsx(C,{value:"openai",children:"OpenAI-compatible"})]})]}),e.jsx("p",{className:"text-xs text-outline",children:Ae[s.provider]})]}),s.provider!=="none"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-model",className:"text-sm text-muted-foreground",children:"Model"}),e.jsx(y,{id:"settings-kb-model","data-testid":"settings-kb-model",value:s.model,disabled:N("EMBEDDING_MODEL"),onChange:a=>l({model:a.target.value}),placeholder:s.provider==="ollama"?"nomic-embed-text":"text-embedding-3-small"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-dimensions",className:"text-sm text-muted-foreground",children:"Dimensions"}),e.jsx(y,{id:"settings-kb-dimensions",type:"number",value:s.dimensions,onChange:a=>l({dimensions:a.target.value}),placeholder:"Model default"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-base-url",className:"text-sm text-muted-foreground",children:"Base URL"}),e.jsx(y,{id:"settings-kb-base-url","data-testid":"settings-kb-base-url",value:s.base_url,disabled:N("EMBEDDING_URL"),onChange:a=>l({base_url:a.target.value}),placeholder:s.provider==="ollama"?"http://localhost:11434":"https://api.openai.com/v1"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(p,{htmlFor:"settings-kb-api-key",className:"text-sm text-muted-foreground",children:s.provider==="ollama"?"Token (hosted or proxied Ollama)":"API key"}),e.jsx(y,{id:"settings-kb-api-key",type:"password",autoComplete:"off","data-testid":"settings-kb-api-key",value:s.api_key,disabled:s.clear_key||N("EMBEDDING_API_KEY"),onChange:a=>l({api_key:a.target.value}),placeholder:j.embedding.api_key_set?"Saved. Type to replace":"Not set"}),j.embedding.api_key_set&&e.jsxs("label",{className:"flex items-center gap-2 text-xs text-outline",children:[e.jsx("input",{type:"checkbox","data-testid":"settings-kb-api-key-clear",checked:s.clear_key,onChange:a=>l({clear_key:a.target.checked,api_key:""})}),"Remove the saved key"]}),e.jsxs("p",{className:"text-xs text-outline",children:["Stored encrypted with the key in ",e.jsx("code",{children:"~/.orc/secret.key"})," and never sent back to the browser. Sent as a bearer token to the base URL."]})]}),e.jsx("p",{className:"text-xs text-outline",children:"Changing the model re-embeds every passage in the background; keyword search keeps working meanwhile."})]})]}),g&&e.jsx("p",{role:"alert","data-testid":"settings-knowledge-error",className:"text-sm text-error",children:g}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(w,{type:"submit","data-testid":"settings-knowledge-save",disabled:d,children:"Save knowledge settings"}),v&&e.jsx("span",{role:"status",className:"text-sm text-muted-foreground",children:"Saved"})]})]}),e.jsx(le,{open:u,title:"Remove Docling",description:"Deletes the Docling runtime and models from this machine. Documents it parsed keep their text; reparse them to use the basic parser.",confirmLabel:"Remove",isPending:d,onCancel:()=>_(!1),onConfirm:async()=>{_(!1),await S(()=>k.kb.uninstallDocling())}})]})}function Me(){const t=X();return ce({mutationFn:async()=>{const n=await k.system.restart(),h=Date.now()+6e4;for(;Date.now()<h;){await new Promise(c=>setTimeout(c,500));try{if((await k.health.check(AbortSignal.timeout(2e3))).instance_id!==n.instance_id)return}catch(c){if(c instanceof me&&c.status===401)throw c}}throw new Error("ORC has not reconnected yet. Check the server and try again when it is online.")},onSuccess:()=>t.invalidateQueries()})}function ze(){const{data:t}=he(),n=Me();return e.jsxs("section",{"aria-labelledby":"server-title",children:[e.jsx("h2",{id:"server-title",className:"mb-1 text-base font-medium",children:"ORC server"}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:"Restart ORC to reload server and host information. This closes active terminals and may interrupt running work. Your settings are kept, and this dashboard reconnects automatically. Switching hosts applies to new actions without a restart."}),e.jsx(E,{className:"mb-4"}),e.jsxs(w,{variant:"outline","data-testid":"settings-restart",disabled:!(t!=null&&t.restart_supported)||n.isPending,onClick:()=>n.mutate(),children:[e.jsx(Oe,{className:n.isPending?"mr-2 size-4 animate-spin":"mr-2 size-4"}),n.isPending?"Restarting and reconnecting…":"Restart ORC server"]}),t&&!t.restart_supported&&e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"This server does not support restart from the dashboard."}),n.isPending&&e.jsx("p",{role:"status","data-testid":"settings-restart-status",className:"mt-2 text-sm text-muted-foreground",children:"Waiting for ORC to restart…"}),n.isSuccess&&e.jsx("p",{role:"status","data-testid":"settings-restart-status",className:"mt-2 text-sm text-muted-foreground",children:"ORC restarted. Reconnected."}),n.isError&&e.jsx("p",{role:"alert","data-testid":"settings-restart-error",className:"mt-2 text-sm text-error",children:n.error.message})]})}const O="__local__";function J(t){return t?t instanceof Error?t.message:String(t):null}function Le(){var i;const{data:t,error:n,refetch:h}=ue(),{data:c}=xe(),s=ge(),x=pe(),[g,b]=m.useState(O),[v,o]=m.useState("");if(m.useEffect(()=>{t&&(b(t.host??O),o(t.remote_port===null?"":String(t.remote_port)))},[t]),n)return e.jsxs("section",{children:[e.jsx("h2",{className:"mb-3 text-base font-semibold",children:"Execution host"}),e.jsx(fe,{message:n.message,onRetry:()=>void h()})]});if(!t)return e.jsx("p",{role:"status","data-testid":"page-loading",className:"text-sm text-muted-foreground",children:"Loading execution host…"});const d=g===O?null:g,f=t.host&&!t.hosts.includes(t.host)?[t.host,...t.hosts]:t.hosts,u=Number(v),_=v.trim()===""||Number.isInteger(u)&&u>=1&&u<=65535,j=t.locked||!t.supported,N=c==null?void 0:c.backends.find(r=>r.name==="claude"),l=((i=x.data)==null?void 0:i.host)===d?x.data:void 0;return e.jsxs("section",{"data-testid":"ssh-settings",children:[e.jsx("h2",{className:"font-headline font-semibold text-base text-on-surface mb-1",children:"Execution host"}),e.jsxs("p",{className:"font-body text-sm text-muted-foreground mb-4",children:["Run every agent, terminal, git and file action on a host from"," ",e.jsx("code",{className:"text-primary",children:"~/.ssh/config"}),". Agents there reach orc through a reverse tunnel on the remote port. Terminals already open keep their host."]}),e.jsx(E,{className:"bg-surface-highest mb-4"}),e.jsxs("div",{className:"space-y-4",children:[t.locked&&e.jsx("p",{"data-testid":"ssh-locked",className:"font-body text-sm text-tertiary",children:"Fixed by ORC_SSH_HOST in orc's environment."}),!t.supported&&e.jsx("p",{"data-testid":"ssh-unsupported",className:"font-body text-sm text-error",children:t.unsupported_reason}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"ssh-host",className:"font-label text-sm text-muted-foreground",children:"Host"}),e.jsxs(F,{value:g,onValueChange:b,disabled:j,children:[e.jsx(T,{id:"ssh-host","aria-label":"Execution host","data-testid":"ssh-host-picker",className:"bg-surface-highest border-control-border text-on-surface font-body text-sm",children:e.jsx(A,{})}),e.jsxs(D,{className:"bg-surface-highest border-outline-variant max-h-72",children:[e.jsx(C,{value:O,"data-testid":"ssh-host-option-local",className:"font-label text-sm",children:"Local (this machine)"}),f.map(r=>e.jsx(C,{value:r,"data-testid":`ssh-host-option-${r}`,className:"font-label text-sm",children:r},r))]})]}),f.length===0&&e.jsx("p",{"data-testid":"page-empty",className:"font-body text-sm text-muted-foreground",children:"No Host entries found in ~/.ssh/config on the machine running orc."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"ssh-remote-port",className:"font-label text-sm text-muted-foreground",children:"Tunnel port override"}),e.jsx(y,{id:"ssh-remote-port","aria-invalid":!!(d&&!_),"data-testid":"ssh-remote-port",value:v,placeholder:"Automatic",onChange:r=>o(r.target.value),disabled:j||!d,inputMode:"numeric",className:"bg-surface-highest border-outline-variant text-on-surface font-body text-sm"}),d&&!_&&e.jsx("p",{className:"text-sm text-error",children:"Enter a remote port from 1 to 65535."}),e.jsx("p",{className:"font-body text-sm text-muted-foreground",children:"Leave empty to let SSH choose an available port automatically."})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(w,{"data-testid":"ssh-save",disabled:j||d!==null&&!_||s.isPending,onClick:()=>s.mutate({host:d,remotePort:d&&v.trim()?u:null}),className:"font-label text-sm bg-primary text-primary-foreground hover:bg-primary/90",children:[e.jsx(Z,{size:12,className:"mr-1.5"})," Use Host"]}),e.jsxs(w,{"data-testid":"ssh-test",variant:"ghost",disabled:!d||!t.supported||x.isPending,onClick:()=>d&&x.mutate(d),className:"font-label text-sm text-muted-foreground hover:text-on-surface",children:[e.jsx(Pe,{size:12,className:"mr-1.5"})," ",x.isPending?"Testing…":"Test"]})]}),J(s.error??x.error)&&e.jsx("p",{"data-testid":"ssh-error",className:"font-body text-sm text-error",children:J(s.error??x.error)}),l&&e.jsx("div",{"data-testid":"ssh-test-result",className:"font-body text-sm space-y-1",children:l.ok?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-secondary",children:["Connected to ",l.host," (",l.os,", ",l.shell,")"]}),e.jsx("p",{className:"text-muted-foreground",children:Object.entries(l.binaries).map(([r,S])=>`${S?"●":"○"} ${r}`).join(" ")}),l.binaries.claude&&l.claude_logged_in===!1&&e.jsxs("p",{className:l.api_key_forwarded?"text-muted-foreground":"text-error",children:["claude is not logged in on ",l.host,"."," ",l.api_key_forwarded?"ANTHROPIC_API_KEY from orc's environment will be forwarded.":"Set ANTHROPIC_API_KEY in orc's environment or run claude login there."]})]}):e.jsx("p",{className:"text-error",children:l.error})}),t.host&&N&&!N.available&&e.jsxs("p",{"data-testid":"ssh-claude-error",className:"font-body text-sm text-error",children:["claude backend: ",N.error]})]})]})}function Ve(){const{theme:t}=be(),[n,h]=m.useState(G),[c,s]=m.useState(()=>localStorage.getItem(I)??""),[x,g]=m.useState(!1),[b,v]=m.useState(""),[o,d]=m.useState(""),[f,u]=m.useState(!1),_=X(),j=async()=>{d(""),u(!0);try{const i=n.trim();if(i&&!i.startsWith("/")&&!/^https?:\/\//i.test(i))throw new Error("Use a relative API path or an http(s) server URL.");const r=await k.settings.save({theme:t,terminal_font:c.trim()});W(r.theme??t),s(r.terminal_font??""),r.terminal_font?localStorage.setItem(I,r.terminal_font):localStorage.removeItem(I);const S=(i||"/api")!==G();localStorage.setItem("orc_api_url",i||"/api"),S&&window.dispatchEvent(new Event(q)),_.invalidateQueries(),g(!0),v("Workspace preferences saved on the server. API address saved in this browser."),setTimeout(()=>g(!1),2e3)}catch(i){d(i instanceof Error?i.message:"Browser settings could not be saved.")}finally{u(!1)}},N=async()=>{d(""),u(!0);try{const i=await k.settings.save({terminal_font:""});localStorage.removeItem("orc_api_url"),localStorage.setItem(I,i.terminal_font??""),h("/api"),s(i.terminal_font??""),window.dispatchEvent(new Event(q)),_.invalidateQueries(),g(!1),v("Connection and terminal font restored to their defaults. Appearance and execution host were kept.")}catch(i){d(i instanceof Error?i.message:"Browser settings could not be reset.")}finally{u(!1)}};async function l(i){d(""),u(!0);try{const r=await k.settings.save({theme:i});W(r.theme??i)}catch(r){d(r instanceof Error?r.message:"Appearance could not be saved.")}finally{u(!1)}}return e.jsxs("div",{children:[e.jsx(ve,{title:"Settings"}),e.jsxs("div",{className:"max-w-lg space-y-8",children:[e.jsxs("section",{"aria-labelledby":"appearance-title",children:[e.jsx("h2",{id:"appearance-title",className:"mb-1 text-base font-medium",children:"Appearance"}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:"Choose a workspace theme. Your choice is saved on the server immediately."}),e.jsx("fieldset",{className:"flex flex-wrap gap-2","aria-label":"Theme",children:["dark","light"].map(i=>e.jsx(w,{variant:t===i?"secondary":"outline","aria-pressed":t===i,"data-testid":`settings-theme-${i}`,disabled:f,onClick:()=>void l(i),children:i==="dark"?"Dark":"Light"},i))})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"font-headline font-medium text-base text-on-surface mb-1",children:"API connection"}),e.jsxs("p",{className:"font-body text-sm text-muted-foreground mb-4",children:["Connect this workspace to an ORC server. The default"," ",e.jsx("code",{className:"text-primary",children:"/api"})," uses the current server or the configured development proxy."]}),e.jsx(E,{className:"bg-outline-variant mb-4"}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"settings-api-url",className:"font-label text-sm text-muted-foreground",children:"API base URL"}),e.jsx(y,{id:"settings-api-url","data-testid":"settings-api-url",value:n,onChange:i=>h(i.target.value),placeholder:"/api or http://localhost:7700",className:"bg-background text-on-surface font-body text-sm"}),e.jsxs("p",{className:"font-body text-sm text-muted-foreground",children:["Use ",e.jsx("code",{children:"/api"})," (dev proxy) or a direct URL when CORS is enabled."]})]})})]}),e.jsx(Le,{}),e.jsx(ze,{}),e.jsx(Fe,{}),e.jsx(De,{}),e.jsxs("section",{children:[e.jsx("h2",{className:"font-headline font-medium text-base text-on-surface mb-1",children:"Terminal"}),e.jsx("p",{className:"font-body text-sm text-muted-foreground mb-4",children:"Prompt and agent status icons need a Nerd Font installed on this machine. Common ones are tried automatically; set the exact family name if your icons show as empty boxes. Applies to terminals opened after saving."}),e.jsx(E,{className:"bg-outline-variant mb-4"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"settings-terminal-font",className:"font-label text-sm text-muted-foreground",children:"Terminal font family"}),e.jsx(y,{id:"settings-terminal-font",value:c,onChange:i=>s(i.target.value),placeholder:"e.g. MesloLGS NF",className:"bg-background text-on-surface font-body text-sm"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 pt-2",children:[e.jsx(w,{"data-testid":"settings-save",disabled:f,onClick:()=>void j(),className:"font-label text-sm ",children:x?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{size:12,className:"mr-1.5"})," Saved"]}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{size:12,className:"mr-1.5"})," Save settings"]})}),e.jsx(w,{variant:"ghost",disabled:f,onClick:()=>void N(),className:"font-label text-sm text-muted-foreground hover:text-on-surface",children:"Reset to defaults"})]}),o&&e.jsx("p",{role:"alert",className:"text-sm text-error",children:o}),b&&!o&&e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:b}),e.jsxs("section",{children:[e.jsx(E,{className:"bg-outline-variant mb-4"}),e.jsx("div",{className:"font-label text-sm text-muted-foreground mb-2",children:"Storage"}),e.jsxs("p",{className:"font-body text-sm text-muted-foreground",children:["Workspace preferences and SSH selection are persisted in the server's"," ",e.jsx("code",{children:"~/.orc/config.json"}),". The API address and optionally remembered login are stored in this browser."]})]})]})]})}export{Ve as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ae=a=>{throw TypeError(a)};var ve=(a,t,i)=>t.has(a)||Ae("Cannot "+i);var j=(a,t,i)=>(ve(a,t,"read from private field"),i?i.call(a):t.get(a)),D=(a,t,i)=>t.has(a)?Ae("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,i),I=(a,t,i,r)=>(ve(a,t,"write to private field"),r?r.call(a,i):t.set(a,i),i),Q=(a,t,i)=>(ve(a,t,"access private method"),i);import{cb as rt,cc as ke,cd as nt,ce as lt,cf as Ye,a as A,cg as ot,ch as ct,r as N,ci as dt,cj as ut,ck as mt,cl as ht,cm as He,cn as xt,co as pt,c as Le,j as e,cp as ft,u as Z,b as $,d as L,aa as me,X as he,Y as xe,Z as pe,B as C,at as fe,ak as Je,_ as de,$ as Y,am as Xe,a1 as ue,a2 as gt,E as Ze,V as yt,al as bt,aD as jt,S as We,ah as vt,t as kt,v as St,w as $e,x as G,aE as Nt,cq as wt,y as Ct,z as V,e as Rt,a4 as Lt,a5 as It,a6 as Ot,a7 as Et,a8 as _t,ae as Te,l as et,M as qt}from"./index-
|
|
1
|
+
var Ae=a=>{throw TypeError(a)};var ve=(a,t,i)=>t.has(a)||Ae("Cannot "+i);var j=(a,t,i)=>(ve(a,t,"read from private field"),i?i.call(a):t.get(a)),D=(a,t,i)=>t.has(a)?Ae("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,i),I=(a,t,i,r)=>(ve(a,t,"write to private field"),r?r.call(a,i):t.set(a,i),i),Q=(a,t,i)=>(ve(a,t,"access private method"),i);import{cb as rt,cc as ke,cd as nt,ce as lt,cf as Ye,a as A,cg as ot,ch as ct,r as N,ci as dt,cj as ut,ck as mt,cl as ht,cm as He,cn as xt,co as pt,c as Le,j as e,cp as ft,u as Z,b as $,d as L,aa as me,X as he,Y as xe,Z as pe,B as C,at as fe,ak as Je,_ as de,$ as Y,am as Xe,a1 as ue,a2 as gt,E as Ze,V as yt,al as bt,aD as jt,S as We,ah as vt,t as kt,v as St,w as $e,x as G,aE as Nt,cq as wt,y as Ct,z as V,e as Rt,a4 as Lt,a5 as It,a6 as Ot,a7 as Et,a8 as _t,ae as Te,l as et,M as qt}from"./index-CVKguVuJ.js";import{D as Pt,c as ze}from"./DocumentWorkspace-PsD0kzUF.js";import{u as Kt}from"./useProjectScope-Gvzzt8hR.js";import{r as Dt}from"./primitive-files-BwTyowra.js";import{D as Be}from"./download-zED8Kwne.js";function Me(a,t){const i=new Set(t);return a.filter(r=>!i.has(r))}function Qt(a,t,i){const r=a.slice(0);return r[t]=i,r}var J,_,X,B,P,H,se,ae,ie,re,R,Se,Ne,tt,we,Ce,Re,Ve,Ft=(Ve=class extends rt{constructor(t,i,r){super();D(this,R);D(this,J);D(this,_);D(this,X);D(this,B);D(this,P);D(this,H);D(this,se);D(this,ae);D(this,ie);D(this,re,[]);I(this,J,t),I(this,B,r),I(this,X,[]),I(this,P,[]),I(this,_,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&j(this,P).forEach(t=>{t.subscribe(i=>{Q(this,R,Ce).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,j(this,P).forEach(t=>{t.destroy()})}setQueries(t,i){I(this,X,t),I(this,B,i),ke.batch(()=>{const r=j(this,P),o=Q(this,R,we).call(this,j(this,X));o.forEach(y=>y.observer.setOptions(y.defaultedQueryOptions));const n=o.map(y=>y.observer),s=n.map(y=>y.getCurrentResult()),u=r.length!==n.length,d=n.some((y,p)=>y!==r[p]),h=u||d,g=h?!0:s.some((y,p)=>{const w=j(this,_)[p];return!w||!nt(y,w)});!h&&!g||(h&&(I(this,re,o),I(this,P,n)),I(this,_,s),this.hasListeners()&&(h&&(Me(r,n).forEach(y=>{y.destroy()}),Me(n,r).forEach(y=>{y.subscribe(p=>{Q(this,R,Ce).call(this,y,p)})})),Q(this,R,Re).call(this)))})}getCurrentResult(){return j(this,_)}getQueries(){return j(this,P).map(t=>t.getCurrentQuery())}getObservers(){return j(this,P)}getOptimisticResult(t,i){const r=Q(this,R,we).call(this,t),o=r.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions)),n=r.map(s=>s.defaultedQueryOptions.queryHash);return[o,s=>Q(this,R,Ne).call(this,s??o,i,n),()=>Q(this,R,Se).call(this,o,r)]}},J=new WeakMap,_=new WeakMap,X=new WeakMap,B=new WeakMap,P=new WeakMap,H=new WeakMap,se=new WeakMap,ae=new WeakMap,ie=new WeakMap,re=new WeakMap,R=new WeakSet,Se=function(t,i){return i.map((r,o)=>{const n=t[o];return r.defaultedQueryOptions.notifyOnChangeProps?n:r.observer.trackResult(n,s=>{i.forEach(u=>{u.observer.trackProp(s)})})})},Ne=function(t,i,r){if(i){const o=j(this,ie),n=r!==void 0&&o!==void 0&&(o.length!==r.length||r.some((s,u)=>s!==o[u]));return(!j(this,H)||j(this,_)!==j(this,ae)||n||i!==j(this,se))&&(I(this,se,i),I(this,ae,j(this,_)),r!==void 0&&I(this,ie,r),I(this,H,lt(j(this,H),i(t)))),j(this,H)}return t},tt=function(){var t;return((t=j(this,B))==null?void 0:t.combine)!==void 0&&j(this,P).some((i,r)=>{var o;return i.options.suspense&&((o=j(this,_)[r])==null?void 0:o.data)===void 0})},we=function(t){const i=new Map;j(this,P).forEach(o=>{const n=o.options.queryHash;if(!n)return;const s=i.get(n);s?s.push(o):i.set(n,[o])});const r=[];return t.forEach(o=>{var d;const n=j(this,J).defaultQueryOptions(o),u=((d=i.get(n.queryHash))==null?void 0:d.shift())??new Ye(j(this,J),n);r.push({defaultedQueryOptions:n,observer:u})}),r},Ce=function(t,i){const r=j(this,P).indexOf(t);r!==-1&&(I(this,_,Qt(j(this,_),r,i)),Q(this,R,Re).call(this))},Re=function(){var t;if(this.hasListeners()){const i=Q(this,R,Se).call(this,j(this,_),j(this,re)),r=Q(this,R,tt).call(this),o=j(this,H),n=r?o:Q(this,R,Ne).call(this,i,(t=j(this,B))==null?void 0:t.combine);(r||o!==n)&&ke.batch(()=>{this.listeners.forEach(s=>{s(j(this,_))})})}},Ve);function At({queries:a,...t},i){const r=A(i),o=ot(),n=ct(),s=N.useMemo(()=>a.map(c=>{const m=r.defaultQueryOptions(c);return m._optimisticResults=o?"isRestoring":"optimistic",m}),[a,r,o]);s.forEach(c=>{dt(c);const m=r.getQueryCache().get(c.queryHash);ut(c,n,m)}),mt(n);const[u]=N.useState(()=>new Ft(r,s,t)),[d,h,g]=u.getOptimisticResult(s,t.combine),y=!o&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(c=>y?u.subscribe(ke.batchCalls(c)):ht,[u,y]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),N.useEffect(()=>{u.setQueries(s,t)},[s,t,u]);const w=d.some((c,m)=>He(s[m],c))?d.flatMap((c,m)=>{const v=s[m];if(v&&He(v,c)){const x=new Ye(r,v);return xt(v,x,n)}return[]}):[];if(w.length>0)throw Promise.all(w);const f=d.find((c,m)=>{const v=s[m];return v&&pt({result:c,errorResetBoundary:n,throwOnError:v.throwOnError,query:r.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(f!=null&&f.error)throw f.error;return h(g())}/**
|
|
2
2
|
* @license lucide-react v1.27.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Fn,aH as x,aI as g,aJ as Ue,aK as Re,aL as ce,aM as ve,aN as Et,aO as Tt,aP as pe,aQ as N,aR as Wn,aS as Nn,aT as Ge,aU as qn,aV as je,aW as It,aX as Je,aY as J,aZ as U,a_ as Fe,a$ as We,b0 as $n,b1 as Ke,b2 as Vn,b3 as zn,b4 as Pt,b5 as Ot,b6 as Ft,b7 as M,b8 as Hn,b9 as Un,ba as oe,bb as Wt,bc as T,bd as Gn,be as S,bf as jn,bg as Nt,bh as Jn,bi as f,bj as Kn,bk as _n,bl as Qn,bm as Yn,bn as Zn,bo as Xn,bp as er,bq as tr,br as nr,bs as rr,bt as or,bu as ir,bv as sr,bw as lr,bx as cr,by as ar,bz as qt,bA as ur,bB as hr,bC as fr,bD as dr,bE as mr,r as v,bF as ne,k as Ee,bG as ct,bH as gr,j as E,aD as pr,ad as yr}from"./index-
|
|
1
|
+
import{c as Fn,aH as x,aI as g,aJ as Ue,aK as Re,aL as ce,aM as ve,aN as Et,aO as Tt,aP as pe,aQ as N,aR as Wn,aS as Nn,aT as Ge,aU as qn,aV as je,aW as It,aX as Je,aY as J,aZ as U,a_ as Fe,a$ as We,b0 as $n,b1 as Ke,b2 as Vn,b3 as zn,b4 as Pt,b5 as Ot,b6 as Ft,b7 as M,b8 as Hn,b9 as Un,ba as oe,bb as Wt,bc as T,bd as Gn,be as S,bf as jn,bg as Nt,bh as Jn,bi as f,bj as Kn,bk as _n,bl as Qn,bm as Yn,bn as Zn,bo as Xn,bp as er,bq as tr,br as nr,bs as rr,bt as or,bu as ir,bv as sr,bw as lr,bx as cr,by as ar,bz as qt,bA as ur,bB as hr,bC as fr,bD as dr,bE as mr,r as v,bF as ne,k as Ee,bG as ct,bH as gr,j as E,aD as pr,ad as yr}from"./index-CVKguVuJ.js";/**
|
|
2
2
|
* @license lucide-react v1.27.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as an,r as u,cr as M,cs as ke,j as a,P as ln,ct as ft,an as cn,u as Bn,a as $n,n as un,b as Fn,d as ht,L as Un,h as Kn,a2 as Xn,cu as Yn,cv as qn,V as Bt,E as Vn,B as Hn,al as Wn,aD as Gn,$ as Jn,ao as $t,ap as Ft,aq as Ut,ar as Kt,as as at,S as Xt,bU as Qn,bV as Zn,bW as er,bX as tr,ah as nr,t as rr,v as sr,w as Yt,x as te,y as or,z as ne,s as ar,cw as ir,a9 as lr,cx as cr}from"./index-
|
|
1
|
+
import{c as an,r as u,cr as M,cs as ke,j as a,P as ln,ct as ft,an as cn,u as Bn,a as $n,n as un,b as Fn,d as ht,L as Un,h as Kn,a2 as Xn,cu as Yn,cv as qn,V as Bt,E as Vn,B as Hn,al as Wn,aD as Gn,$ as Jn,ao as $t,ap as Ft,aq as Ut,ar as Kt,as as at,S as Xt,bU as Qn,bV as Zn,bW as er,bX as tr,ah as nr,t as rr,v as sr,w as Yt,x as te,y as or,z as ne,s as ar,cw as ir,a9 as lr,cx as cr}from"./index-CVKguVuJ.js";import{u as ur}from"./useProjectScope-Gvzzt8hR.js";import{L as dr}from"./list-CE13IgiY.js";/**
|
|
2
2
|
* @license lucide-react v1.27.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|