@ai-development-environment/server 0.0.99 → 0.0.100
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/package.json +1 -1
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/build-manifest.json +3 -3
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/server/app/[locale]/(dashboard)/actions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/actions/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/changes/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/changes/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/comments/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/comments/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/plans/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/plans/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/usage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/usage/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/_global-error.html +1 -1
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__03lyeon._.js +1 -1
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y7gd01._.js +1 -1
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__10jrizr._.js +1 -1
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__1rcvzx1._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_0gsta10._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_0k25g0q._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_0mbr53g._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_0p8nq_k._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_1gn4tn4._.js +1 -1
- package/standalone/.next/server/chunks/ssr/src_components_workflows_workflow-editor_tsx_1eo69h2._.js +1 -1
- package/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +1 -1
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/.next/static/chunks/{436x7m1mvj6hx.js → 0a2njf53y1b_a.js} +5 -5
- package/standalone/.next/static/chunks/{3rg_-g4l65tdm.js → 0ih1_jixkezy9.js} +1 -1
- package/standalone/.next/static/chunks/{1y_k2l4tani4i.js → 1-95dtd9sp1ri.js} +1 -1
- package/standalone/.next/static/chunks/117mbxzvbdo5r.js +38 -0
- package/standalone/.next/static/chunks/{1fvp3ex0gde7v.js → 1e_b3ymyt3673.js} +1 -1
- package/standalone/.next/static/chunks/{13dmoqt_x5qg3.js → 1hlskd2wydmjh.js} +1 -1
- package/standalone/.next/static/chunks/{28xljttzejclr.js → 1s-wwfg3sdyjh.js} +4 -4
- package/standalone/.next/static/chunks/2hviq_ydapgns.js +3 -0
- package/standalone/.next/static/chunks/33pqqy7c3sgg7.js +38 -0
- package/standalone/.next/static/chunks/{3fps7kmx8mnhr.js → 3oslbazmmg72z.js} +5 -5
- package/standalone/.next/static/chunks/{19o8lqhow_wle.js → 3psu0owhqo5ri.js} +6 -6
- package/standalone/.next/static/chunks/{3_08sih2rcs9k.js → 3swi28-0k8olm.js} +1 -1
- package/standalone/.next/static/chunks/{2lod_i2dzh949.js → 42ywmggw6zx17.js} +2 -2
- package/standalone/.next/static/chunks/0lriz5ed2mmt1.js +0 -3
- package/standalone/.next/static/chunks/3-pqgzhb67rrw.js +0 -38
- package/standalone/.next/static/chunks/3plqps194w7h1.js +0 -38
- /package/standalone/.next/static/{Pro8D0Hv2IhphMUT1Ihzv → iNH0xq2KlqMDpWuRmdLMn}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{Pro8D0Hv2IhphMUT1Ihzv → iNH0xq2KlqMDpWuRmdLMn}/_clientMiddlewareManifest.js +0 -0
- /package/standalone/.next/static/{Pro8D0Hv2IhphMUT1Ihzv → iNH0xq2KlqMDpWuRmdLMn}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,159888,e=>{"use strict";let t=(0,e.i(456420).default)("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);e.s(["Braces",0,t],159888)},563707,e=>{"use strict";let t=(0,e.i(456420).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],563707)},772382,e=>{"use strict";let t=(0,e.i(456420).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],772382)},856522,e=>{"use strict";let t=(0,e.i(456420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,t],856522)},755566,e=>{"use strict";let t=(0,e.i(456420).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},853138,e=>{"use strict";var t=e.i(755566);e.s(["AlertTriangle",()=>t.default])},765649,e=>{"use strict";let t=(0,e.i(456420).default)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);e.s(["UserRound",0,t],765649)},983913,e=>{"use strict";var t=e.i(843476),r=e.i(563707),a=e.i(271645),s=e.i(519455),i=e.i(317056),n=e.i(906197),l=e.i(337822),o=e.i(975157);e.s(["SearchableSelect",0,function({value:e,onValueChange:c,options:d,placeholder:u,searchPlaceholder:m,emptyMessage:h,ariaLabel:
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,159888,e=>{"use strict";let t=(0,e.i(456420).default)("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);e.s(["Braces",0,t],159888)},563707,e=>{"use strict";let t=(0,e.i(456420).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],563707)},772382,e=>{"use strict";let t=(0,e.i(456420).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],772382)},856522,e=>{"use strict";let t=(0,e.i(456420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,t],856522)},755566,e=>{"use strict";let t=(0,e.i(456420).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},853138,e=>{"use strict";var t=e.i(755566);e.s(["AlertTriangle",()=>t.default])},765649,e=>{"use strict";let t=(0,e.i(456420).default)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);e.s(["UserRound",0,t],765649)},983913,e=>{"use strict";var t=e.i(843476),r=e.i(563707),a=e.i(271645),s=e.i(519455),i=e.i(317056),n=e.i(906197),l=e.i(337822),o=e.i(975157);e.s(["SearchableSelect",0,function({value:e,onValueChange:c,options:d,placeholder:u,searchPlaceholder:m,emptyMessage:h,ariaLabel:x,disabled:p,className:g,showSelectedDetails:b=!1,allowCustomValue:j=!1,clearLabel:f}){let[v,k]=(0,a.useState)(!1),[y,w]=(0,a.useState)(""),I=(0,a.useCallback)(e=>{e&&e.addEventListener("wheel",e=>e.stopPropagation())},[]),S=d.find(t=>t.value===e),C=S?.label??(e||u),N=y.trim(),T=j&&N.length>0&&!d.some(e=>e.value.toLowerCase()===N.toLowerCase()||e.label.toLowerCase()===N.toLowerCase());return(0,t.jsxs)(l.Popover,{onOpenChange:e=>{k(e),e||w("")},open:v,children:[(0,t.jsx)(l.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(s.Button,{"aria-expanded":v,"aria-label":x,className:(0,o.cn)("min-w-0 w-full justify-between font-normal",b&&S&&"h-auto min-h-8 py-2",g),disabled:p,role:"combobox",type:"button",variant:"outline",children:[b&&S?(0,t.jsxs)("span",{className:"min-w-0 text-left",children:[(0,t.jsx)("span",{className:"block truncate",children:S.label}),S.description&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:S.description}),S.secondaryDescription&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:S.secondaryDescription})]}):(0,t.jsx)("span",{className:"min-w-0 truncate",children:C}),(0,t.jsx)(r.ChevronsUpDown,{className:"shrink-0 opacity-50"})]})}),(0,t.jsx)(l.PopoverContent,{ref:I,align:"start",className:"z-70 max-h-[min(24rem,var(--radix-popover-content-available-height))] w-(--radix-popover-trigger-width) overflow-hidden p-0",children:(0,t.jsxs)(i.Command,{className:"min-h-0",label:m,children:[(0,t.jsx)(i.CommandInput,{"aria-label":m,autoFocus:!0,onValueChange:w,placeholder:m,value:y}),(0,t.jsxs)(i.CommandList,{className:"min-h-0 flex-1 max-h-64 overscroll-contain [scrollbar-width:thin] [&::-webkit-scrollbar]:block [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border",children:[(0,t.jsx)(i.CommandEmpty,{children:h}),(0,t.jsxs)(i.CommandGroup,{children:[f&&e&&(0,t.jsx)(i.CommandItem,{"aria-label":f,onSelect:()=>{c(""),w(""),k(!1)},value:"__clear_selection__",children:f}),T&&(0,t.jsx)(i.CommandItem,{"aria-label":N,onSelect:()=>{c(N),w(""),k(!1)},value:N,children:(0,t.jsx)(n.Item,{className:"min-w-0 flex-1 border-0 p-0",size:"xs",children:(0,t.jsx)(n.ItemContent,{className:"min-w-0",children:(0,t.jsx)(n.ItemTitle,{className:"block truncate",children:N})})})}),d.map(r=>(0,t.jsx)(i.CommandItem,{"aria-label":[r.label,r.description,r.secondaryDescription].filter(Boolean).join(", "),"aria-selected":r.value===e,className:"items-start py-2","data-checked":r.value===e,disabled:r.disabled,keywords:[r.label,r.description??"",r.secondaryDescription??"",r.keywords??""],onSelect:()=>{c(r.value),w(""),k(!1)},value:r.value,children:(0,t.jsx)(n.Item,{className:"min-w-0 flex-1 border-0 p-0",size:"xs",children:(0,t.jsxs)(n.ItemContent,{className:"min-w-0",children:[(0,t.jsx)(n.ItemTitle,{className:"block truncate",children:r.label}),r.description&&(0,t.jsx)(n.ItemDescription,{className:"block truncate",children:r.description}),r.secondaryDescription&&(0,t.jsx)(n.ItemDescription,{className:"block truncate",children:r.secondaryDescription})]})})},r.value))]})]})]})})]})}])},346194,e=>{"use strict";var t=e.i(843476),r=e.i(113030),a=e.i(948148),s=e.i(271645),i=e.i(929592),n=e.i(519455),l=e.i(776639),o=e.i(793479),c=e.i(110204),d=e.i(967489),u=e.i(987968),m=e.i(624687),h=e.i(637611);let x="__github_account_default__";e.s(["MergePullRequestButton",0,function({pullRequest:e,onMerged:p,size:g="sm",variant:b="outline",open:j,onOpenChange:f,showTrigger:v=!0,requestSource:k}){let y=(0,a.useTranslations)("pullRequests"),[w,I]=(0,s.useState)(!1),[S,C]=(0,s.useState)(null),[N,T]=(0,s.useState)(""),[E,R]=(0,s.useState)(""),[A,D]=(0,s.useState)(""),[P,M]=(0,s.useState)(x),[$,L]=(0,s.useState)(!1),[U,_]=(0,s.useState)(!1),[q,z]=(0,s.useState)(null),[F="",O=""]=e.repositoryNameWithOwner.split("/",2),G=j??w,B=e=>{e||(L(!1),C(null),z(null)),void 0===j&&I(e),f?.(e)};(0,s.useEffect)(()=>{if(!G)return;let t=!0,r=window.setTimeout(()=>{L(!0),C(null),z(null),(0,h.controlPlaneRequest)(`query GitHubPullRequestMergeOptions(
|
|
2
2
|
$owner: String!
|
|
3
3
|
$name: String!
|
|
4
4
|
$number: Int!
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
canMerge
|
|
19
19
|
blockedReason
|
|
20
20
|
}
|
|
21
|
-
}`,{owner:F,name:O,number:e.number,source:k}).then(e=>{if(!t)return;let r=e.githubPullRequestMergeOptions;C(r),T(r.availableMethods[0]??""),R(r.defaultCommitHeadline),D(r.defaultCommitBody),M(r.defaultCommitEmail??
|
|
21
|
+
}`,{owner:F,name:O,number:e.number,source:k}).then(e=>{if(!t)return;let r=e.githubPullRequestMergeOptions;C(r),T(r.availableMethods[0]??""),R(r.defaultCommitHeadline),D(r.defaultCommitBody),M(r.defaultCommitEmail??x)}).catch(e=>{t&&z(e instanceof Error?e.message:String(e))}).finally(()=>{t&&L(!1)})},0);return()=>{t=!1,window.clearTimeout(r)}},[O,G,F,e.number,k]);let H=async()=>{if(N&&S?.canMerge&&E.trim()){_(!0),z(null);try{let t=await (0,h.controlPlaneRequest)(`mutation MergeGitHubPullRequest(
|
|
22
22
|
$input: MergeGitHubPullRequestInput!
|
|
23
23
|
$source: GitHubRequestSource!
|
|
24
24
|
) {
|
|
25
25
|
mergeGitHubPullRequest(input: $input, source: $source) {
|
|
26
26
|
id state url mergedAt
|
|
27
27
|
}
|
|
28
|
-
}`,{input:{owner:F,name:O,number:e.number,method:N,commitHeadline:E,commitBody:A,authorEmail:P===
|
|
28
|
+
}`,{input:{owner:F,name:O,number:e.number,method:N,commitHeadline:E,commitBody:A,authorEmail:P===x?null:P},source:k});B(!1),await p?.(t.mergeGitHubPullRequest)}catch(e){z(e instanceof Error?e.message:String(e))}finally{_(!1)}}},J=S?.blockedReason??null;return(0,t.jsxs)(t.Fragment,{children:[v&&(0,t.jsxs)(n.Button,{onClick:e=>{e.stopPropagation(),B(!0)},size:g,type:"button",variant:b,children:[(0,t.jsx)(r.GitMerge,{}),y("merge")]}),(0,t.jsx)(l.Dialog,{onOpenChange:e=>{U||B(e)},open:G,children:(0,t.jsxs)(l.DialogContent,{className:"sm:max-w-xl",children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{children:y("mergePullRequest")}),(0,t.jsx)(l.DialogDescription,{children:y("mergePullRequestDescription",{repository:e.repositoryNameWithOwner,number:e.number})})]}),!$&&(S||q)?(0,t.jsxs)("div",{className:"space-y-4",children:[(q||J)&&(0,t.jsx)(i.Alert,{variant:"destructive",children:(0,t.jsx)(i.AlertDescription,{children:q||J})}),S&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{className:"mb-1.5 block",htmlFor:"merge-method",children:y("mergeType")}),(0,t.jsxs)(d.Select,{disabled:U||0===S.availableMethods.length,onValueChange:e=>T(e),value:N,children:[(0,t.jsx)(d.SelectTrigger,{id:"merge-method",children:(0,t.jsx)(d.SelectValue,{placeholder:y("selectMergeType")})}),(0,t.jsx)(d.SelectContent,{children:S.availableMethods.map(e=>(0,t.jsx)(d.SelectItem,{value:e,children:y(`mergeTypes.${e}`)},e))})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{className:"mb-1.5 block",htmlFor:"merge-commit-headline",children:y("commitMessage")}),(0,t.jsx)(o.Input,{disabled:U,id:"merge-commit-headline",onChange:e=>R(e.target.value),value:E})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{className:"mb-1.5 block",htmlFor:"merge-commit-body",children:y("commitDescription")}),(0,t.jsx)(m.Textarea,{className:"min-h-28",disabled:U,id:"merge-commit-body",onChange:e=>D(e.target.value),value:A})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{className:"mb-1.5 block",htmlFor:"merge-email",children:y("commitEmail")}),(0,t.jsxs)(d.Select,{disabled:U,onValueChange:M,value:P,children:[(0,t.jsx)(d.SelectTrigger,{id:"merge-email",children:(0,t.jsx)(d.SelectValue,{})}),(0,t.jsxs)(d.SelectContent,{children:[(0,t.jsx)(d.SelectItem,{value:x,children:y("githubDefaultEmail")}),S.commitEmails.map(e=>(0,t.jsx)(d.SelectItem,{value:e,children:e},e))]})]})]})]})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)(u.Spinner,{})," ",y("loadingMergeOptions")]}),(0,t.jsxs)(l.DialogFooter,{children:[(0,t.jsx)(n.Button,{disabled:U,onClick:()=>B(!1),type:"button",variant:"outline",children:y("cancelMerge")}),(0,t.jsxs)(n.Button,{disabled:$||U||!S?.canMerge||!N||!E.trim(),onClick:()=>void H(),type:"button",children:[U?(0,t.jsx)(u.Spinner,{}):(0,t.jsx)(r.GitMerge,{}),U?y("merging"):y("mergePullRequest")]})]})]})})]})}])},647776,e=>{"use strict";var t=e.i(843476),r=e.i(716327),a=e.i(482022),s=e.i(395925),i=e.i(948148),n=e.i(271645),l=e.i(487486),o=e.i(519455),c=e.i(755146),d=e.i(987968),u=e.i(746798),m=e.i(637611),h=e.i(961112);function x({pipeline:e,repositoryId:r,requestSource:a,onPipelineRetried:l,onError:c}){let h=(0,i.useTranslations)("pullRequests"),[p,g]=(0,n.useState)(!1),b=async t=>{if(t.stopPropagation(),e.canRetry&&e.checkSuiteId){g(!0);try{let t=await (0,m.controlPlaneRequest)(`mutation RetryGitHubPipeline(
|
|
29
29
|
$repositoryId: ID!
|
|
30
30
|
$checkSuiteId: ID!
|
|
31
31
|
$source: GitHubRequestSource!
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
checkSuiteId: $checkSuiteId
|
|
36
36
|
source: $source
|
|
37
37
|
) { id name status url checkSuiteId canRetry retryUnavailableReason jobs { id name status url canRetry retryUnavailableReason steps { number name status } } }
|
|
38
|
-
}`,{repositoryId:r,checkSuiteId:e.checkSuiteId,source:a});l?.(t.retryGitHubPipeline),c?.(null)}catch(e){c?.(e instanceof Error?e.message:String(e))}finally{g(!1)}}},j=(0,t.jsxs)(o.Button,{disabled:x||!e.canRetry||!e.checkSuiteId,onClick:e=>void b(e),size:"sm",variant:"outline",children:[x?(0,t.jsx)(d.Spinner,{}):(0,t.jsx)(s.RotateCcw,{}),h(x?"retrying":"retry")]});if(!e.retryUnavailableReason||x)return j;let f=h(`retryUnavailable.${e.retryUnavailableReason}`);return(0,t.jsx)(u.TooltipProvider,{children:(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{"aria-label":f,className:"inline-flex",tabIndex:0,children:j})}),(0,t.jsx)(u.TooltipContent,{children:f})]})})}function x(e){return"SUCCESS"===e?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"PENDING"===e||"EXPECTED"===e||"QUEUED"===e||"IN_PROGRESS"===e||"ACTION_REQUIRED"===e?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":"FAILURE"===e||"ERROR"===e||"CANCELLED"===e||"STALE"===e||"STARTUP_FAILURE"===e||"TIMED_OUT"===e?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"border-slate-500/30 bg-slate-500/10 text-slate-700 dark:text-slate-300"}e.s(["PipelineMenu",0,function({pipelineStatus:e,pipelines:s,pipelineRevision:d=0,headSha:u,repositoryId:m,repositoryNameWithOwner:g,repositoryUrl:b,requestSource:j,onPipelineRetried:f}){let v=(0,i.useTranslations)("pullRequests"),[k,y]=(0,n.useState)(null),w=(0,n.useMemo)(()=>u?{repositoryGithubId:m,headSha:u}:null,[u,m]),I=(0,n.useMemo)(()=>u?{repositoryGithubId:m,repositoryNameWithOwner:g??"",repositoryUrl:b??"",headSha:u,pipelineStatus:e,pipelines:s,revision:d,updatedAt:""}:null,[u,d,e,s,m,g,b]),S=(0,h.useGitHubPipelineSnapshot)(w,I),C=S?.pipelineStatus??e,N=S?.pipelines??s,T=e=>e.stopPropagation();return(0,t.jsxs)(c.DropdownMenu,{children:[(0,t.jsx)(c.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(o.Button,{className:`h-5 rounded-full px-2 py-0.5 text-xs ${x(C)}`,onClick:T,variant:"outline",children:[v(`pipelineStates.${C}`),(0,t.jsx)(r.ChevronDown,{className:"size-3"})]})}),(0,t.jsxs)(c.DropdownMenuContent,{align:"end",className:"w-80",onClick:T,children:[(0,t.jsx)(c.DropdownMenuLabel,{children:v("pipelineMenuTitle")}),(0,t.jsx)(c.DropdownMenuSeparator,{}),k&&(0,t.jsx)("p",{className:"px-2 py-1.5 text-xs text-destructive",children:k}),0===N.length?(0,t.jsx)("p",{className:"px-2 py-3 text-sm text-muted-foreground",children:v("noPipelines")}):(0,t.jsx)("div",{className:"space-y-1 p-1",children:N.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[e.url?(0,t.jsxs)("a",{className:"flex min-w-0 items-center gap-1 text-sm font-medium hover:underline",href:e.url,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)(a.ExternalLink,{className:"size-3 shrink-0"})]}):(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)(l.Badge,{className:`mt-1 ${x(e.status)}`,children:v(`pipelineStates.${e.status}`)})]}),e.checkSuiteId&&(0,t.jsx)(p,{onError:y,onPipelineRetried:f,pipeline:e,repositoryId:m,requestSource:j})]},e.id))})]})]})},"pipelineStateClass",0,x])},356505,e=>{"use strict";var t=e.i(843476),r=e.i(853138),a=e.i(482022),s=e.i(269846);let i=(0,e.i(456420).default)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);var n=e.i(948148),l=e.i(271645),o=e.i(653090),c=e.i(278015),d=e.i(762279),u=e.i(456743),m=e.i(929592),h=e.i(487486),p=e.i(519455),x=e.i(515288),g=e.i(816484),b=e.i(906197),j=e.i(980376),f=e.i(987968),v=e.i(520133),k=e.i(637611),y=e.i(741725),w=e.i(467511);let I={highest:"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300",high:"border-orange-500/30 bg-orange-500/10 text-orange-700 dark:text-orange-300",medium:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",low:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",lowest:"border-slate-500/30 bg-slate-500/10 text-slate-700 dark:text-slate-300"};function S({ticket:e}){let r=(0,n.useTranslations)("jiraTickets"),a=[[r("assignee"),(0,t.jsx)(o.JiraUser,{avatarUrl:e.assigneeAvatarUrl,name:e.assignee??r("unassigned")},"assignee")],[r("reporter"),e.reporter?(0,t.jsx)(o.JiraUser,{avatarUrl:e.reporter.avatarUrl,name:e.reporter.displayName},"reporter"):"—"],[r("created"),(0,t.jsx)(g.DateTime,{value:e.createdAt},"created")],[r("updated"),(0,t.jsx)(g.DateTime,{value:e.updatedAt},"updated")],[r("due"),(0,t.jsx)(g.DateTime,{value:e.dueAt},"due")],[r("resolved"),(0,t.jsx)(g.DateTime,{value:e.resolvedAt},"resolved")]];return(0,t.jsx)("dl",{className:"grid gap-3 rounded-lg bg-muted/50 p-4 text-sm sm:grid-cols-2",children:a.map(([e,r])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"mt-0.5 font-medium",children:r})]},e))})}function C({label:e,values:r}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"mt-1",children:r.join(", ")})]})}e.s(["JiraTicketDrawer",0,function({issueKey:e,onClose:o,onTicketChange:g}){let N=(0,n.useTranslations)("jiraTickets"),[T,E]=(0,l.useState)(null),[R,A]=(0,l.useState)(null),[D,P]=(0,l.useState)(!1),[M,$]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!e){let e=window.setTimeout(()=>E(null),0);return()=>window.clearTimeout(e)}let t=window.setTimeout(async()=>{P(!0);try{let t=await (0,k.controlPlaneRequest)(`query JiraTicket($issueKey: ID!) { jiraTicket(issueKey: $issueKey) { ${w.JIRA_TICKET_DETAIL_FIELDS} } }`,{issueKey:e});E(t.jiraTicket),A(null)}catch(e){A(e instanceof Error?e.message:String(e))}finally{P(!1)}},0);return()=>window.clearTimeout(t)},[e]);let L=e=>{E(e),g?.(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Sheet,{onOpenChange:e=>{e||o()},open:!!e,children:(0,t.jsxs)(j.SheetContent,{className:"w-[min(48rem,95vw)] overflow-y-auto sm:max-w-3xl",children:[(0,t.jsxs)(j.SheetHeader,{className:"border-b pr-12",children:[(0,t.jsx)(j.SheetTitle,{children:T?.key??e??N("ticket")}),(0,t.jsx)(j.SheetDescription,{children:T?.summary??N("loadingTicket")})]}),(0,t.jsxs)("div",{className:"space-y-6 px-4 pb-6",children:[D&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(f.Spinner,{}),N("loadingTicket")]}),R&&(0,t.jsx)(m.Alert,{variant:"destructive",children:(0,t.jsx)(m.AlertDescription,{children:R})}),T&&(0,t.jsxs)(t.Fragment,{children:[(T.cache.stale||T.commentsCache.stale)&&(0,t.jsxs)(m.Alert,{className:"border-amber-500/30 bg-amber-500/10",children:[(0,t.jsx)(r.AlertTriangle,{}),(0,t.jsx)(m.AlertDescription,{children:N("staleTicket")})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(h.Badge,{children:T.status}),T.issueType&&(0,t.jsx)(h.Badge,{children:T.issueType}),T.priority&&(0,t.jsx)(h.Badge,{className:I[T.priority.trim().toLowerCase()],children:T.priority})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(p.Button,{onClick:()=>$(!0),size:"sm",variant:"outline",children:[(0,t.jsx)(s.GitBranch,{})," ",N("worktreeAction")]}),(0,t.jsx)(p.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(v.Link,{href:`/jira/tickets/${encodeURIComponent(T.key)}`,children:[(0,t.jsx)(i,{})," ",N("openFullDetails")]})}),(0,t.jsx)(p.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)("a",{href:T.jiraUrl,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(a.ExternalLink,{})," ",N("openInJira")]})})]})]}),(0,t.jsx)(d.JiraTicketActions,{onTicketChange:L,ticket:T}),(0,t.jsx)(S,{ticket:T}),(0,t.jsx)("section",{children:(0,t.jsx)(x.Card,{size:"sm",children:(0,t.jsx)(x.CardContent,{children:(0,t.jsx)(c.JiraRichTextBlock,{content:T.descriptionContent,header:(0,t.jsx)("h3",{className:"font-semibold",children:N("descriptionTitle")}),headerClassName:"border-b pb-2",value:T.description})})})}),(T.labels.length>0||T.components.length>0||T.fixVersions.length>0||T.sprintNames.length>0)&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold",children:N("classification")}),(0,t.jsxs)("dl",{className:"grid gap-3 text-sm sm:grid-cols-2",children:[T.labels.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:N("labels")}),(0,t.jsx)("dd",{className:"mt-1 flex flex-wrap gap-1",children:T.labels.map(e=>(0,t.jsx)(h.Badge,{children:e},e))})]}),T.components.length>0&&(0,t.jsx)(C,{label:N("components"),values:T.components.map(e=>e.name)}),T.fixVersions.length>0&&(0,t.jsx)(C,{label:N("fixVersions"),values:T.fixVersions.map(e=>e.name)}),T.sprintNames.length>0&&(0,t.jsx)(C,{label:N("sprints"),values:T.sprintNames})]})]}),(T.parent||T.subtasks.length>0||T.issueLinks.length>0)&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold",children:N("relatedIssues")}),(0,t.jsx)(b.ItemGroup,{className:"gap-2",children:[...T.parent?[T.parent]:[],...T.subtasks,...T.issueLinks].map((e,r)=>(0,t.jsx)(b.Item,{asChild:!0,size:"xs",variant:"outline",children:(0,t.jsxs)(v.Link,{href:`/jira/tickets/${encodeURIComponent(e.key)}`,children:[(0,t.jsxs)(b.ItemContent,{children:[(0,t.jsxs)(b.ItemTitle,{className:"leading-tight",children:[e.key," · ",e.summary]}),(0,t.jsx)(b.ItemDescription,{className:"leading-tight",children:e.relationship})]}),(0,t.jsx)(b.ItemActions,{children:e.status&&(0,t.jsx)(h.Badge,{children:e.status})})]})},`${e.key}-${r}`))})]}),T.attachments.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold",children:N("attachments")}),(0,t.jsx)(b.ItemGroup,{className:"gap-2",children:T.attachments.map(e=>(0,t.jsx)(b.Item,{asChild:!0,variant:"outline",children:(0,t.jsxs)("a",{href:e.contentUrl??"#",rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(b.ItemContent,{children:(0,t.jsx)(b.ItemTitle,{children:e.filename})}),(0,t.jsx)(b.ItemActions,{className:"text-xs text-muted-foreground",children:e.size?`${Math.round(e.size/1024)} KB`:""})]})},e.id))})]}),(0,t.jsx)(u.JiraTicketComments,{onTicketChange:L,ticket:T})]})]})]})}),T&&(0,t.jsx)(y.TicketWorktreeDialog,{issueKey:T.key,onOpenChange:$,open:M})]})}],356505)},467511,e=>{"use strict";let t="format raw rawText markdown wikiMarkup",r="accountId displayName avatarUrl",a="source stale fetchedAt",s="relationship key summary status",i="id key summary statusId status statusCategory issueType priority assignee assigneeAccountId assigneeAvatarUrl projectKey updatedAt",n=`${i}
|
|
38
|
+
}`,{repositoryId:r,checkSuiteId:e.checkSuiteId,source:a});l?.(t.retryGitHubPipeline),c?.(null)}catch(e){c?.(e instanceof Error?e.message:String(e))}finally{g(!1)}}},j=(0,t.jsxs)(o.Button,{disabled:p||!e.canRetry||!e.checkSuiteId,onClick:e=>void b(e),size:"sm",variant:"outline",children:[p?(0,t.jsx)(d.Spinner,{}):(0,t.jsx)(s.RotateCcw,{}),h(p?"retrying":"retry")]});if(!e.retryUnavailableReason||p)return j;let f=h(`retryUnavailable.${e.retryUnavailableReason}`);return(0,t.jsx)(u.TooltipProvider,{children:(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{"aria-label":f,className:"inline-flex",tabIndex:0,children:j})}),(0,t.jsx)(u.TooltipContent,{children:f})]})})}function p(e){return"SUCCESS"===e?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"PENDING"===e||"EXPECTED"===e||"QUEUED"===e||"IN_PROGRESS"===e||"ACTION_REQUIRED"===e?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":"FAILURE"===e||"ERROR"===e||"CANCELLED"===e||"STALE"===e||"STARTUP_FAILURE"===e||"TIMED_OUT"===e?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"border-slate-500/30 bg-slate-500/10 text-slate-700 dark:text-slate-300"}e.s(["PipelineMenu",0,function({pipelineStatus:e,pipelines:s,pipelineRevision:d=0,headSha:u,repositoryId:m,repositoryNameWithOwner:g,repositoryUrl:b,requestSource:j,onPipelineRetried:f}){let v=(0,i.useTranslations)("pullRequests"),[k,y]=(0,n.useState)(null),w=(0,n.useMemo)(()=>u?{repositoryGithubId:m,headSha:u}:null,[u,m]),I=(0,n.useMemo)(()=>u?{repositoryGithubId:m,repositoryNameWithOwner:g??"",repositoryUrl:b??"",headSha:u,pipelineStatus:e,pipelines:s,revision:d,updatedAt:""}:null,[u,d,e,s,m,g,b]),S=(0,h.useGitHubPipelineSnapshot)(w,I),C=S?.pipelineStatus??e,N=S?.pipelines??s,T=e=>e.stopPropagation();return(0,t.jsxs)(c.DropdownMenu,{children:[(0,t.jsx)(c.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(o.Button,{className:`h-5 rounded-full px-2 py-0.5 text-xs ${p(C)}`,onClick:T,variant:"outline",children:[v(`pipelineStates.${C}`),(0,t.jsx)(r.ChevronDown,{className:"size-3"})]})}),(0,t.jsxs)(c.DropdownMenuContent,{align:"end",className:"w-80",onClick:T,children:[(0,t.jsx)(c.DropdownMenuLabel,{children:v("pipelineMenuTitle")}),(0,t.jsx)(c.DropdownMenuSeparator,{}),k&&(0,t.jsx)("p",{className:"px-2 py-1.5 text-xs text-destructive",children:k}),0===N.length?(0,t.jsx)("p",{className:"px-2 py-3 text-sm text-muted-foreground",children:v("noPipelines")}):(0,t.jsx)("div",{className:"space-y-1 p-1",children:N.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[e.url?(0,t.jsxs)("a",{className:"flex min-w-0 items-center gap-1 text-sm font-medium hover:underline",href:e.url,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)(a.ExternalLink,{className:"size-3 shrink-0"})]}):(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)(l.Badge,{className:`mt-1 ${p(e.status)}`,children:v(`pipelineStates.${e.status}`)})]}),e.checkSuiteId&&(0,t.jsx)(x,{onError:y,onPipelineRetried:f,pipeline:e,repositoryId:m,requestSource:j})]},e.id))})]})]})},"pipelineStateClass",0,p])},356505,e=>{"use strict";var t=e.i(843476),r=e.i(853138),a=e.i(482022),s=e.i(269846);let i=(0,e.i(456420).default)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);var n=e.i(948148),l=e.i(271645),o=e.i(653090),c=e.i(278015),d=e.i(762279),u=e.i(456743),m=e.i(929592),h=e.i(487486),x=e.i(519455),p=e.i(515288),g=e.i(816484),b=e.i(906197),j=e.i(980376),f=e.i(987968),v=e.i(520133),k=e.i(637611),y=e.i(741725),w=e.i(467511);let I={highest:"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300",high:"border-orange-500/30 bg-orange-500/10 text-orange-700 dark:text-orange-300",medium:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",low:"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300",lowest:"border-slate-500/30 bg-slate-500/10 text-slate-700 dark:text-slate-300"};function S({ticket:e}){let r=(0,n.useTranslations)("jiraTickets"),a=[[r("assignee"),(0,t.jsx)(o.JiraUser,{avatarUrl:e.assigneeAvatarUrl,name:e.assignee??r("unassigned")},"assignee")],[r("reporter"),e.reporter?(0,t.jsx)(o.JiraUser,{avatarUrl:e.reporter.avatarUrl,name:e.reporter.displayName},"reporter"):"—"],[r("created"),(0,t.jsx)(g.DateTime,{value:e.createdAt},"created")],[r("updated"),(0,t.jsx)(g.DateTime,{value:e.updatedAt},"updated")],[r("due"),(0,t.jsx)(g.DateTime,{value:e.dueAt},"due")],[r("resolved"),(0,t.jsx)(g.DateTime,{value:e.resolvedAt},"resolved")]];return(0,t.jsx)("dl",{className:"grid gap-3 rounded-lg bg-muted/50 p-4 text-sm sm:grid-cols-2",children:a.map(([e,r])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"mt-0.5 font-medium",children:r})]},e))})}function C({label:e,values:r}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"mt-1",children:r.join(", ")})]})}e.s(["JiraTicketDrawer",0,function({issueKey:e,onClose:o,onTicketChange:g}){let N=(0,n.useTranslations)("jiraTickets"),[T,E]=(0,l.useState)(null),[R,A]=(0,l.useState)(null),[D,P]=(0,l.useState)(!1),[M,$]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!e){let e=window.setTimeout(()=>E(null),0);return()=>window.clearTimeout(e)}let t=window.setTimeout(async()=>{P(!0);try{let t=await (0,k.controlPlaneRequest)(`query JiraTicket($issueKey: ID!) { jiraTicket(issueKey: $issueKey) { ${w.JIRA_TICKET_DETAIL_FIELDS} } }`,{issueKey:e});E(t.jiraTicket),A(null)}catch(e){A(e instanceof Error?e.message:String(e))}finally{P(!1)}},0);return()=>window.clearTimeout(t)},[e]);let L=e=>{E(e),g?.(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Sheet,{onOpenChange:e=>{e||o()},open:!!e,children:(0,t.jsxs)(j.SheetContent,{className:"w-[min(48rem,95vw)] overflow-y-auto sm:max-w-3xl",children:[(0,t.jsxs)(j.SheetHeader,{className:"border-b pr-12",children:[(0,t.jsx)(j.SheetTitle,{children:T?.key??e??N("ticket")}),(0,t.jsx)(j.SheetDescription,{children:T?.summary??N("loadingTicket")})]}),(0,t.jsxs)("div",{className:"space-y-6 px-4 pb-6",children:[D&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(f.Spinner,{}),N("loadingTicket")]}),R&&(0,t.jsx)(m.Alert,{variant:"destructive",children:(0,t.jsx)(m.AlertDescription,{children:R})}),T&&(0,t.jsxs)(t.Fragment,{children:[(T.cache.stale||T.commentsCache.stale)&&(0,t.jsxs)(m.Alert,{className:"border-amber-500/30 bg-amber-500/10",children:[(0,t.jsx)(r.AlertTriangle,{}),(0,t.jsx)(m.AlertDescription,{children:N("staleTicket")})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(h.Badge,{children:T.status}),T.issueType&&(0,t.jsx)(h.Badge,{children:T.issueType}),T.priority&&(0,t.jsx)(h.Badge,{className:I[T.priority.trim().toLowerCase()],children:T.priority})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(x.Button,{onClick:()=>$(!0),size:"sm",variant:"outline",children:[(0,t.jsx)(s.GitBranch,{})," ",N("worktreeAction")]}),(0,t.jsx)(x.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)(v.Link,{href:`/jira/tickets/${encodeURIComponent(T.key)}`,children:[(0,t.jsx)(i,{})," ",N("openFullDetails")]})}),(0,t.jsx)(x.Button,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsxs)("a",{href:T.jiraUrl,rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(a.ExternalLink,{})," ",N("openInJira")]})})]})]}),(0,t.jsx)(d.JiraTicketActions,{onTicketChange:L,ticket:T}),(0,t.jsx)(S,{ticket:T}),(0,t.jsx)("section",{children:(0,t.jsx)(p.Card,{size:"sm",children:(0,t.jsx)(p.CardContent,{children:(0,t.jsx)(c.JiraRichTextBlock,{content:T.descriptionContent,header:(0,t.jsx)("h3",{className:"font-semibold",children:N("descriptionTitle")}),headerClassName:"border-b pb-2",value:T.description})})})}),(T.labels.length>0||T.components.length>0||T.fixVersions.length>0||T.sprintNames.length>0)&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold",children:N("classification")}),(0,t.jsxs)("dl",{className:"grid gap-3 text-sm sm:grid-cols-2",children:[T.labels.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:N("labels")}),(0,t.jsx)("dd",{className:"mt-1 flex flex-wrap gap-1",children:T.labels.map(e=>(0,t.jsx)(h.Badge,{children:e},e))})]}),T.components.length>0&&(0,t.jsx)(C,{label:N("components"),values:T.components.map(e=>e.name)}),T.fixVersions.length>0&&(0,t.jsx)(C,{label:N("fixVersions"),values:T.fixVersions.map(e=>e.name)}),T.sprintNames.length>0&&(0,t.jsx)(C,{label:N("sprints"),values:T.sprintNames})]})]}),(T.parent||T.subtasks.length>0||T.issueLinks.length>0)&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold",children:N("relatedIssues")}),(0,t.jsx)(b.ItemGroup,{className:"gap-2",children:[...T.parent?[T.parent]:[],...T.subtasks,...T.issueLinks].map((e,r)=>(0,t.jsx)(b.Item,{asChild:!0,size:"xs",variant:"outline",children:(0,t.jsxs)(v.Link,{href:`/jira/tickets/${encodeURIComponent(e.key)}`,children:[(0,t.jsxs)(b.ItemContent,{children:[(0,t.jsxs)(b.ItemTitle,{className:"leading-tight",children:[e.key," · ",e.summary]}),(0,t.jsx)(b.ItemDescription,{className:"leading-tight",children:e.relationship})]}),(0,t.jsx)(b.ItemActions,{children:e.status&&(0,t.jsx)(h.Badge,{children:e.status})})]})},`${e.key}-${r}`))})]}),T.attachments.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-2 font-semibold",children:N("attachments")}),(0,t.jsx)(b.ItemGroup,{className:"gap-2",children:T.attachments.map(e=>(0,t.jsx)(b.Item,{asChild:!0,variant:"outline",children:(0,t.jsxs)("a",{href:e.contentUrl??"#",rel:"noreferrer",target:"_blank",children:[(0,t.jsx)(b.ItemContent,{children:(0,t.jsx)(b.ItemTitle,{children:e.filename})}),(0,t.jsx)(b.ItemActions,{className:"text-xs text-muted-foreground",children:e.size?`${Math.round(e.size/1024)} KB`:""})]})},e.id))})]}),(0,t.jsx)(u.JiraTicketComments,{onTicketChange:L,ticket:T})]})]})]})}),T&&(0,t.jsx)(y.TicketWorktreeDialog,{issueKey:T.key,onOpenChange:$,open:M})]})}],356505)},467511,e=>{"use strict";let t="format raw rawText markdown wikiMarkup",r="accountId displayName avatarUrl",a="source stale fetchedAt",s="relationship key summary status",i="id key summary statusId status statusCategory issueType priority assignee assigneeAccountId assigneeAvatarUrl projectKey updatedAt",n=`${i}
|
|
39
39
|
jiraUrl description
|
|
40
40
|
descriptionContent { ${t} }
|
|
41
41
|
reporter { ${r} }
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
content { ${t} }
|
|
62
62
|
}
|
|
63
63
|
cache { ${a} }
|
|
64
|
-
commentsCache { ${a} }`;e.s(["JIRA_CACHE_FIELDS",0,a,"JIRA_PERSON_FIELDS",0,r,"JIRA_RICH_TEXT_FIELDS",0,t,"JIRA_SUMMARY_FIELDS",0,i,"JIRA_TICKET_DETAIL_FIELDS",0,n])},799676,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(705844),s=e.i(30030),i=e.i(30207),n=e.i(934620),l=e.i(248425),o=Object.defineProperty,c=(e,t)=>o(e,"name",{value:t,configurable:!0}),d="Avatar",[u,m]=(0,s.createContextScope)(d),h=[0,()=>void 0],[p
|
|
64
|
+
commentsCache { ${a} }`;e.s(["JIRA_CACHE_FIELDS",0,a,"JIRA_PERSON_FIELDS",0,r,"JIRA_RICH_TEXT_FIELDS",0,t,"JIRA_SUMMARY_FIELDS",0,i,"JIRA_TICKET_DETAIL_FIELDS",0,n])},799676,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(705844),s=e.i(30030),i=e.i(30207),n=e.i(934620),l=e.i(248425),o=Object.defineProperty,c=(e,t)=>o(e,"name",{value:t,configurable:!0}),d="Avatar",[u,m]=(0,s.createContextScope)(d),h=[0,()=>void 0],[x,p]=u(d),g=r.forwardRef(c(function(e,a){let{__scopeAvatar:s,...i}=e,[n,o]=r.useState("idle"),[c,d]=k();return(0,t.jsx)(x,{scope:s,imageLoadingStatus:n,setImageLoadingStatus:o,imageCount:c,setImageCount:d,children:(0,t.jsx)(l.Primitive.span,{...i,ref:a})})},"Avatar")),b=r.forwardRef(c(function(e,a){let{__scopeAvatar:s,src:o,onLoadingStatusChange:c,...d}=e,u=p("AvatarImage",s);y(u.setImageCount);let m=f(o,{referrerPolicy:d.referrerPolicy,crossOrigin:d.crossOrigin,loadingStatus:u.imageLoadingStatus,setLoadingStatus:u.setImageLoadingStatus}),h=(0,i.useCallbackRef)(e=>{c?.(e)}),x=r.useRef(m);return(0,n.useLayoutEffect)(()=>{let e=x.current;x.current=m,m!==e&&h(m)},[m,h]),"loaded"===m?(0,t.jsx)(l.Primitive.img,{...d,ref:a,src:o}):null},"AvatarImage")),j=r.forwardRef(c(function(e,a){let{__scopeAvatar:s,delayMs:i,...n}=e,o=p("AvatarFallback",s),[c,d]=r.useState(void 0===i);return r.useEffect(()=>{if(void 0!==i){let e=window.setTimeout(()=>d(!0),i);return()=>window.clearTimeout(e)}},[i]),c&&"loaded"!==o.imageLoadingStatus?(0,t.jsx)(l.Primitive.span,{...n,ref:a}):null},"AvatarFallback"));function f(e,{loadingStatus:t,setLoadingStatus:r,referrerPolicy:a,crossOrigin:s}){return(0,n.useLayoutEffect)(()=>{if(!e)return void r("error");let t=new window.Image,i=c(e=>{r(v(e.currentTarget))},"handleLoad"),n=c(()=>r("error"),"handleError");return t.addEventListener("load",i),t.addEventListener("error",n),a&&(t.referrerPolicy=a),t.crossOrigin=s??null,t.src=e,r(v(t)),()=>{t.removeEventListener("load",i),t.removeEventListener("error",n),r("idle")}},[e,s,a,r]),t}function v(e){return e.complete?e.naturalWidth>0?"loaded":"error":"loading"}function k(){let e=h;if(a.IS_DEVELOPMENT){let[t]=e=r.useState(0),a=r.useRef(!1);r.useEffect(()=>{t>1&&!a.current&&(a.current=!0,console.warn("Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."))},[t])}return e}function y(e){a.IS_DEVELOPMENT&&r.useEffect(()=>(e(e=>e+1),()=>{e(e=>e-1)}),[e])}c(f,"useImageLoadingStatus"),c(v,"getImageLoadingStatus"),c(k,"useImageCount"),c(y,"useUpdateImageCount"),e.s(["Avatar",0,g,"AvatarFallback",0,j,"AvatarImage",0,b,"Fallback",0,j,"Image",0,b,"Root",0,g,"createAvatarScope",0,m],97456);var w=e.i(97456),w=w,I=e.i(975157);e.s(["Avatar",0,function({className:e,size:r="default",...a}){return(0,t.jsx)(w.Root,{className:(0,I.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),"data-size":r,"data-slot":"avatar",...a})},"AvatarFallback",0,function({className:e,...r}){return(0,t.jsx)(w.Fallback,{className:(0,I.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),"data-slot":"avatar-fallback",...r})},"AvatarImage",0,function({className:e,...r}){return(0,t.jsx)(w.Image,{className:(0,I.cn)("aspect-square size-full rounded-full object-cover",e),"data-slot":"avatar-image",...r})}],799676)},440289,e=>{"use strict";var t=e.i(637611);async function r(e){let r=Date.now()+6e5;for(;Date.now()<r;){await new Promise(e=>window.setTimeout(e,750));let r=(await (0,t.controlPlaneRequest)(`query WorktreeJob($id: ID!) {
|
|
65
65
|
agentJob(id: $id) {
|
|
66
66
|
status error
|
|
67
67
|
worktreeOperationResult { outcome preparationConflictPaths }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,106134,e=>{"use strict";var l=e.i(843476),t=e.i(154548),i=e.i(508734),s=e.i(762368),a=e.i(772382),r=e.i(580860),n=e.i(456420);let o=(0,n.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var c=e.i(895065);let d=(0,n.default)("mouse-pointer-2-off",[["path",{d:"m15.55 8.45 5.138 2.087a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063L8.45 15.551",key:"1qoshx"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"m6.816 11.528-2.779-6.84a.495.495 0 0 1 .651-.651l6.84 2.779",key:"mymuvk"}]]);var u=e.i(77071),p=e.i(566595),h=e.i(856522),x=e.i(730274),m=e.i(166794),f=e.i(573474),g=e.i(725981),j=e.i(948148),v=e.i(271645),b=e.i(929592),y=e.i(487486),w=e.i(519455),k=e.i(515288),C=e.i(257428),S=e.i(776639),N=e.i(82612),I=e.i(542450),T=e.i(793479),E=e.i(950594),F=e.i(906197),O=e.i(967489),A=e.i(302747),
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,106134,e=>{"use strict";var l=e.i(843476),t=e.i(154548),i=e.i(508734),s=e.i(762368),a=e.i(772382),r=e.i(580860),n=e.i(456420);let o=(0,n.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var c=e.i(895065);let d=(0,n.default)("mouse-pointer-2-off",[["path",{d:"m15.55 8.45 5.138 2.087a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063L8.45 15.551",key:"1qoshx"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"m6.816 11.528-2.779-6.84a.495.495 0 0 1 .651-.651l6.84 2.779",key:"mymuvk"}]]);var u=e.i(77071),p=e.i(566595),h=e.i(856522),x=e.i(730274),m=e.i(166794),f=e.i(573474),g=e.i(725981),j=e.i(948148),v=e.i(271645),b=e.i(929592),y=e.i(487486),w=e.i(519455),k=e.i(515288),C=e.i(257428),S=e.i(776639),N=e.i(82612),I=e.i(542450),T=e.i(793479),E=e.i(950594),F=e.i(906197),O=e.i(967489),A=e.i(302747),L=e.i(759684),P=e.i(980376),D=e.i(987968),R=e.i(677572),W=e.i(624687),M=e.i(746798),$=e.i(520133),q=e.i(462777),B=e.i(637611),V=e.i(672510),z=e.i(274757),G=e.i(716327),U=e.i(983913),H=e.i(814760),K=e.i(266136);let _=`query RunProviderCatalog($worktreeId: ID) {
|
|
2
2
|
runProviderCatalog(worktreeId: $worktreeId) {
|
|
3
3
|
key
|
|
4
4
|
label
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
githubActionsWorkflowRuns(source: WORKFLOW_AUTOMATION, codebaseRepositoryId: $codebaseRepositoryId, first: 25) {
|
|
46
46
|
items { id displayTitle headBranch }
|
|
47
47
|
}
|
|
48
|
-
}`,variables:{codebaseRepositoryId:l},map:e=>e.githubActionsWorkflowRuns?.items.map(e=>({value:e.id,label:e.displayTitle||e.id,description:e.headBranch??void 0}))??[]};default:return null}}(e,l),[e,l]),i=t?JSON.stringify({query:t.query,variables:t.variables}):null,[s,a]=(0,v.useState)({key:"",options:[],error:!1});return((0,v.useEffect)(()=>{if(!t||!i)return;let e=!1;return(0,B.controlPlaneRequest)(t.query,t.variables).then(l=>{e||a({key:i,options:t.map(l),error:!1})}).catch(()=>{e||a({key:i,options:[],error:!0})}),()=>{e=!0}},[t,i]),t&&i)?s.key!==i?{options:[],loading:!0,fallback:!1}:{options:s.options,loading:!1,fallback:s.error||0===s.options.length}:{options:[],loading:!1,fallback:!0}}var eF=e.i(159888);let eO=(0,n.default)("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);var eA=e.i(808562);function eP(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&"SESSION"===e.source}function eL(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"LITERAL"===e.source?e.value:e}function eD(){let e=(0,j.useTranslations)("workflows");return(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e("interpolationHelp",{token:"{{path}}",example:"{{worktree.baseBranch}}"})})}function eR({mode:e,onValueChange:t}){let i=(0,j.useTranslations)("workflows");return(0,l.jsxs)(eA.ToggleGroup,{"aria-label":i("valueModeToggle"),onValueChange:e=>{("literal"===e||"session"===e)&&t(e)},size:"sm",spacing:0,type:"single",value:e,variant:"outline",children:[(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(eA.ToggleGroupItem,{"aria-label":i("valueModeLiteral"),className:"size-7 px-0 aria-checked:bg-accent aria-checked:text-accent-foreground",value:"literal",children:(0,l.jsx)(eO,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:i("valueModeLiteral")})]}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(eA.ToggleGroupItem,{"aria-label":i("valueModeSession"),className:"size-7 px-0 aria-checked:bg-accent aria-checked:text-accent-foreground",value:"session",children:(0,l.jsx)(eF.Braces,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:i("valueModeSession")})]})]})}function eW({label:e,help:t,allowCustomSessionPath:i=!0,defaultSessionPath:s,sessionEnabled:a,interpolationEnabled:r=!1,value:n,onChange:o,sessionPaths:c,children:d}){let u=(0,j.useTranslations)("workflows"),p=(0,v.useId)(),h=eP(n)?"session":"literal",x=c.map(({path:e,description:l})=>({value:e,label:e,description:l}));return(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("div",{className:"flex items-end justify-between gap-2",children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:p,children:e}),a&&(0,l.jsx)(eR,{mode:h,onValueChange:e=>o("session"===e?{source:"SESSION",path:c.find(({path:e})=>e===s)?.path??c[0]?.path??""}:"")})]}),"session"===h?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U.SearchableSelect,{allowCustomValue:i,ariaLabel:u("sessionBindingLabel"),emptyMessage:u("noOptions"),onValueChange:e=>o({source:"SESSION",path:e}),options:x,placeholder:u("sessionPathPlaceholder"),searchPlaceholder:u("searchPlaceholder"),value:eP(n)?n.path:""}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:u("sessionBindingHelp")})]}):(0,l.jsxs)(l.Fragment,{children:[d(eL(n),o,p),t&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:t}),r&&(0,l.jsx)(eD,{})]})]})}function eM(e){return"string"==typeof e?e:""}function e$(e,l){if(!l)return null;let t=e[l];return"string"==typeof t&&t.length>0?t:null}function eq(e){return!!e.valueModes?.includes("session")}function eB(e){return!!e.valueModes?.includes("interpolation")}function eV({field:e,value:t,onChange:i}){let s=(0,j.useTranslations)("workflows"),a=(0,v.useId)(),r=e.options?.kind==="static"?e.options.options:[];return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:a,children:e.label}),(0,l.jsxs)(O.Select,{onValueChange:e=>i(e),value:eM(eL(t)),children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:a,children:(0,l.jsx)(O.SelectValue,{placeholder:s("selectPlaceholder")})}),(0,l.jsx)(O.SelectContent,{children:r.map(e=>(0,l.jsx)(O.SelectItem,{value:e.value,children:e.label??e.value},e.value))})]}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})}function ez({field:e,value:t,onChange:i,sessionPaths:s}){return(0,l.jsx)(eW,{help:e.help,interpolationEnabled:eB(e),label:e.label,onChange:i,sessionEnabled:eq(e),sessionPaths:s,value:t,children:(t,i,s)=>e.multiline?(0,l.jsx)(W.Textarea,{className:"min-h-20 text-sm",id:s,onChange:e=>i(e.target.value),placeholder:e.placeholder,value:eM(t)}):(0,l.jsx)(T.Input,{id:s,onChange:e=>i(e.target.value),placeholder:e.placeholder,value:eM(t)})})}function eG({field:e,value:t,onChange:i,sessionPaths:s}){return(0,l.jsx)(eW,{help:e.help,label:e.label,onChange:i,sessionEnabled:eq(e),sessionPaths:s,value:t,children:(t,i,s)=>(0,l.jsx)(T.Input,{id:s,max:e.maximum,min:e.minimum,onChange:e=>i(""===e.target.value?void 0:Number(e.target.value)),placeholder:e.placeholder,step:e.integer?1:void 0,type:"number",value:"number"==typeof t&&Number.isFinite(t)?String(t):""})})}function eU({field:e,value:t,onChange:i}){let s=(0,v.useId)();return(0,l.jsxs)(I.Field,{orientation:"horizontal",children:[(0,l.jsx)(C.Checkbox,{checked:!0===eL(t),id:s,onCheckedChange:e=>i(!0===e)}),(0,l.jsxs)(I.FieldContent,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:s,children:e.label}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})]})}function eH({field:e,value:t,onChange:i}){let s=Array.isArray(t)?t.map(String):[];return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(K.McpPresetPicker,{kind:e.presetKind,onChange:i,selectedIds:s,showAvailability:null==e.presetKind}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})}function eK({field:e,config:t,value:i,onChange:s,sessionPaths:a}){let r=(0,j.useTranslations)("workflows"),n=e.options?.kind==="resource"?e.options:null,o=e$(t,n?.scopeFrom),{options:c,loading:d}=eE(n?.resource??"codebase",o),u=n?.sessionPath,p=u?a.filter(({path:e})=>{let[l,t]=u.split(".");return e===u||e.startsWith(`${l}.`)&&e.endsWith(`.${t}`)}):a;return(0,l.jsx)(eW,{allowCustomSessionPath:!u,defaultSessionPath:u,help:e.help,interpolationEnabled:eB(e),label:e.label,onChange:s,sessionEnabled:eq(e),sessionPaths:p,value:i,children:(t,i)=>(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:e.label,disabled:d,emptyMessage:r("noOptions"),onValueChange:i,options:c,placeholder:e.placeholder??r("selectPlaceholder"),searchPlaceholder:r("searchPlaceholder"),value:eM(t)})})}function e_({field:e,config:t,value:i,onChange:s}){let a=(0,j.useTranslations)("workflows"),r=e.options?.kind==="resource"?e.options:null,n=e$(t,r?.scopeFrom),{options:o,loading:c}=eE(r?.resource??"codebase",n),d=Array.isArray(i)?i.map(String):[],u=o.filter(e=>!d.includes(e.value));return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(F.ItemGroup,{className:"gap-1.5",children:d.map(e=>(0,l.jsxs)(F.Item,{size:"xs",variant:"muted",children:[(0,l.jsx)(F.ItemContent,{className:"min-w-0",children:(0,l.jsx)(F.ItemTitle,{className:"block truncate text-xs",children:o.find(l=>l.value===e)?.label??e})}),(0,l.jsx)(F.ItemActions,{children:(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":a("removeRow"),className:"size-7",onClick:()=>{s(d.filter(l=>l!==e))},size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:a("removeRow")})]})})]},e))}),(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:e.label,disabled:c,emptyMessage:a("noOptions"),onValueChange:e=>{e&&!d.includes(e)&&s([...d,e])},options:u,placeholder:e.placeholder??a("addRow"),searchPlaceholder:a("searchPlaceholder"),value:""}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})}function eX({field:e,value:t,onChange:i}){let s=(0,j.useTranslations)("workflows"),a=Array.isArray(t)?t.map(String):[];return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:a.map((t,r)=>(0,l.jsxs)(E.InputGroup,{children:[(0,l.jsx)(E.InputGroupInput,{onChange:e=>{let l;return l=e.target.value,i(a.map((e,t)=>t===r?l:e))},placeholder:e.placeholder,value:t}),(0,l.jsx)(E.InputGroupAddon,{align:"inline-end",children:(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(E.InputGroupButton,{"aria-label":s("removeRow"),onClick:()=>i(a.filter((e,l)=>l!==r)),size:"icon-xs",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:s("removeRow")})]})})]},r))}),(0,l.jsxs)(w.Button,{onClick:()=>i([...a,""]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",s("addRow")]}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})}function eJ({field:e,value:t,onChange:i}){let s=(0,j.useTranslations)("workflows"),a=t&&"object"==typeof t&&!Array.isArray(t)?Object.entries(t).map(([e,l])=>[e,l]):[],r=e=>{let l={};for(let[t,i]of e)t&&(l[t]=i);i(l)};return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:a.map(([e,t],i)=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(T.Input,{className:"w-2/5",onChange:e=>r(a.map((l,t)=>t===i?[e.target.value,l[1]]:l)),placeholder:s("recordKeyPlaceholder"),value:e}),(0,l.jsx)(T.Input,{className:"min-w-0 flex-1",onChange:e=>r(a.map((l,t)=>t===i?[l[0],e.target.value]:l)),placeholder:s("recordValuePlaceholder"),value:eM(t)}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":s("removeRow"),className:"size-7 shrink-0",onClick:()=>r(a.filter((e,l)=>l!==i)),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:s("removeRow")})]})]},i))}),(0,l.jsxs)(w.Button,{onClick:()=>r([...a,["",""]]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",s("addRow")]}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})}function eQ({field:e,value:t,onChange:i}){let s=(0,v.useId)(),[a,r]=(0,v.useState)(()=>void 0===t?"":JSON.stringify(t,null,2)),[n,o]=(0,v.useState)(null),c=(0,v.useRef)(a);return(0,v.useEffect)(()=>{let e=void 0===t?"":JSON.stringify(t,null,2);e!==c.current&&(r(e),c.current=e,o(null))},[t]),(0,l.jsxs)(I.Field,{"data-invalid":!!n,children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:s,children:e.label}),(0,l.jsx)(W.Textarea,{"aria-invalid":!!n,className:"min-h-24 font-mono text-xs",id:s,onChange:e=>(e=>{if(r(e),""===e.trim()){c.current="",o(null),i(void 0);return}try{let l=JSON.parse(e);c.current=JSON.stringify(l,null,2),o(null),i(l)}catch(e){o(e instanceof Error?e.message:String(e))}})(e.target.value),placeholder:e.placeholder,value:a}),n?(0,l.jsx)(I.FieldError,{className:"text-[10px]",children:n}):(0,l.jsxs)(l.Fragment,{children:[e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})]})}function eY(e){let{field:t,value:i,onChange:s,sessionPaths:a}=e,r=(0,j.useTranslations)("workflows"),n=function(e){if(null==e)return ek;if("object"!=typeof e||Array.isArray(e))return null;if("ALL"===e.op||"ANY"===e.op){let l=e.conditions;if(!Array.isArray(l))return null;let t=[];for(let e of l){let l=eC(e);if(!l)return null;t.push(l)}return{mode:e.op,rows:t}}let l=eC(e);return l?{mode:"ALL",rows:[l]}:null}(i),o=a.map(({path:e,description:l})=>({value:e,label:e,description:l}));if(!n)return(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(eQ,{...e}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:r("conditionAdvanced")})]});let c=e=>s(function(e){if(0!==e.rows.length)return 1===e.rows.length?eS(e.rows[0]):{op:e.mode,conditions:e.rows.map(eS)}}(e)),d=(e,l)=>c({...n,rows:n.rows.map((t,i)=>i===e?{...t,...l}:t)});return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:t.label}),n.rows.length>1&&(0,l.jsxs)(O.Select,{onValueChange:e=>c({...n,mode:"ANY"===e?"ANY":"ALL"}),value:n.mode,children:[(0,l.jsx)(O.SelectTrigger,{"aria-label":r("conditionMatchMode"),className:"w-full",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"ALL",children:r("conditionMatchAll")}),(0,l.jsx)(O.SelectItem,{value:"ANY",children:r("conditionMatchAny")})]})]}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:n.rows.map((e,t)=>{var i;return(0,l.jsxs)("div",{className:"space-y-1.5 rounded-lg border p-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"min-w-0 flex-1",children:(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:r("conditionField"),emptyMessage:r("noOptions"),onValueChange:e=>d(t,{path:e}),options:o,placeholder:r("sessionPathPlaceholder"),searchPlaceholder:r("searchPlaceholder"),value:e.path})}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":r("removeRow"),className:"size-7 shrink-0",onClick:()=>c({...n,rows:n.rows.filter((e,l)=>l!==t)}),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:r("removeRow")})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(O.Select,{onValueChange:e=>d(t,{operator:e}),value:e.operator,children:[(0,l.jsx)(O.SelectTrigger,{"aria-label":r("conditionOperator"),className:"w-40 shrink-0",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsx)(O.SelectContent,{children:ey.map(e=>(0,l.jsx)(O.SelectItem,{value:e.value,children:r(`conditionOperators.${e.value}`)},e.value))})]}),ew(e.operator)&&(0,l.jsxs)(l.Fragment,{children:[eP(e.value)?(0,l.jsx)("div",{className:"min-w-0 flex-1",children:(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:r("sessionBindingLabel"),emptyMessage:r("noOptions"),onValueChange:e=>d(t,{value:{source:"SESSION",path:e}}),options:o,placeholder:r("sessionPathPlaceholder"),searchPlaceholder:r("searchPlaceholder"),value:e.value.path})}):(0,l.jsx)(T.Input,{"aria-label":r("conditionValue"),className:"min-w-0 flex-1",onChange:e=>d(t,{value:eN(e.target.value)}),placeholder:r("conditionValuePlaceholder"),value:void 0===(i=e.value)?"":"string"==typeof i?eN(i)===i?i:JSON.stringify(i):JSON.stringify(i)??""}),(0,l.jsx)(eR,{mode:eP(e.value)?"session":"literal",onValueChange:e=>d(t,{value:"session"===e?{source:"SESSION",path:""}:""})})]})]})]},t)})}),(0,l.jsxs)(w.Button,{onClick:()=>c({...n,rows:[...n.rows,{path:"",operator:"EQ",value:""}]}),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",r("addCondition")]}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:n.rows.length?r("conditionHelp"):r("conditionEmpty")}),eB(t)&&(0,l.jsx)(eD,{})]})}function eZ(e){let{field:t,value:i,onChange:s}=e,a=(0,j.useTranslations)("workflows"),r=function(e){if(null==e)return[];if(!Array.isArray(e))return null;let l=[];for(let t of e){if(!t||"object"!=typeof t||Array.isArray(t)||Object.keys(t).filter(e=>"label"!==e&&"description"!==e).length>0||"string"!=typeof t.label||void 0!==t.description&&"string"!=typeof t.description)return null;l.push({label:t.label,description:t.description??""})}return l}(i);if(!r)return(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(eQ,{...e}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("choiceOptionsAdvanced")})]});let n=e=>s(function(e){if(0!==e.length)return e.map(({label:e,description:l})=>l?{label:e,description:l}:{label:e})}(e)),o=(e,l)=>n(r.map((t,i)=>i===e?{...t,...l}:t));return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:t.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:r.map((e,t)=>(0,l.jsxs)("div",{className:"space-y-1.5 rounded-lg border p-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(T.Input,{"aria-label":a("choiceOptionLabel"),className:"min-w-0 flex-1",onChange:e=>o(t,{label:e.target.value}),placeholder:a("choiceOptionLabel"),value:e.label}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":a("removeRow"),className:"size-7 shrink-0",onClick:()=>n(r.filter((e,l)=>l!==t)),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:a("removeRow")})]})]}),(0,l.jsx)(T.Input,{"aria-label":a("choiceOptionDescription"),className:"text-xs",onChange:e=>o(t,{description:e.target.value}),placeholder:a("choiceOptionDescription"),value:e.description})]},t))}),(0,l.jsxs)(w.Button,{onClick:()=>n([...r,{label:"",description:""}]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",a("addChoiceOption")]}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:r.length?a("choiceOptionsHelp"):a("choiceOptionsEmpty")}),eB(t)&&(0,l.jsx)(eD,{})]})}function e0(e){let{field:t,value:i,onChange:s}=e,a=(0,j.useTranslations)("workflows"),r=function(e){if(null==e)return[];if(!Array.isArray(e))return null;let l=[];for(let t of e){if(!t||"object"!=typeof t||Array.isArray(t)||Object.keys(t).filter(e=>"key"!==e&&"label"!==e&&"description"!==e).length>0||"string"!=typeof t.key||void 0!==t.label&&"string"!=typeof t.label||void 0!==t.description&&"string"!=typeof t.description)return null;l.push({key:t.key,label:t.label??"",description:t.description??""})}return l}(i);if(!r)return(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(eQ,{...e}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("triggerChoicesAdvanced")})]});let n=e=>s(function(e){if(0!==e.length)return e.map(({key:e,label:l,description:t})=>t?{key:e,label:l,description:t}:{key:e,label:l})}(e)),o=(e,l)=>n(r.map((t,i)=>i===e?{...t,...l}:t));return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:t.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:r.map((e,t)=>(0,l.jsxs)("div",{className:"space-y-1.5 rounded-lg border p-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(T.Input,{"aria-label":a("triggerChoiceLabel"),className:"min-w-0 flex-1",onChange:e=>{var l;let i;return l=e.target.value,i=r[t],void o(t,{label:l,...!i.key||i.key===eb(i.label)?{key:eb(l)}:{}})},placeholder:a("triggerChoiceLabel"),value:e.label}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":a("removeRow"),className:"size-7 shrink-0",onClick:()=>n(r.filter((e,l)=>l!==t)),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:a("removeRow")})]})]}),(0,l.jsx)(T.Input,{"aria-label":a("triggerChoiceKey"),className:"font-mono text-xs",onChange:e=>o(t,{key:e.target.value}),placeholder:a("triggerChoiceKey"),value:e.key}),r.some((e,l)=>l!==t&&e.key===r[t].key)&&(0,l.jsx)(I.FieldError,{className:"text-[10px]",children:a("triggerChoiceKeyDuplicate")}),(0,l.jsx)(T.Input,{"aria-label":a("triggerChoiceDescription"),className:"text-xs",onChange:e=>o(t,{description:e.target.value}),placeholder:a("triggerChoiceDescription"),value:e.description})]},t))}),(0,l.jsxs)(w.Button,{onClick:()=>n([...r,{key:"",label:"",description:""}]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",a("addTriggerChoice")]}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:r.length?a("triggerChoicesHelp"):a("triggerChoicesEmpty")})]})}let e1={provider:"provider",model:"model",effort:"effort"};function e2({field:e,config:t,onChange:i,sessionPaths:s}){let a=(0,j.useTranslations)("workflows"),r=e.modelKeys??e1,n=(0,v.useRef)(t);(0,v.useEffect)(()=>{n.current=t},[t]);let o=e=>{let l={...n.current};for(let[t,i]of Object.entries(e))void 0===i?delete l[t]:l[t]=i;n.current=l,i(l)},c=t[r.provider],d=t[r.model],u=t[r.effort],p=eP(c)||eP(d)||eP(u),h=function(e){let[l,t]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let l=!1;return(0,B.controlPlaneRequest)(_,{worktreeId:e||null}).then(e=>{l||t(e.runProviderCatalog)}).catch(()=>{l||t([])}),()=>{l=!0}},[e]),l}(e$(t,r.scopeFrom)),x=[{key:r.provider,label:a("modelProvider"),value:c},{key:r.model,label:a("modelModel"),value:d},{key:r.effort,label:a("modelEffort"),value:u}],m=s.map(({path:e,description:l})=>({value:e,label:e,description:l}));return(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("div",{className:"flex items-end justify-between gap-2",children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(eR,{mode:p?"session":"literal",onValueChange:e=>"session"===e?o({[r.provider]:{source:"SESSION",path:""},[r.model]:{source:"SESSION",path:""},[r.effort]:{source:"SESSION",path:""}}):o({[r.provider]:void 0,[r.model]:void 0,[r.effort]:void 0})})]}),p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:x.map(({key:e,label:t,value:i})=>(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-[10px] text-muted-foreground",children:t}),(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:t,emptyMessage:a("noOptions"),onValueChange:l=>o({[e]:{source:"SESSION",path:l}}),options:m,placeholder:a("sessionPathPlaceholder"),searchPlaceholder:a("searchPlaceholder"),value:eP(i)?i.path:""})]},e))}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("sessionBindingHelp")})]}):(0,l.jsx)(H.ModelEffortPicker,{catalog:h,effort:eM(eL(u)),fullWidth:!0,model:eM(eL(d)),onEffortChange:e=>o({[r.effort]:e}),onModelChange:e=>o({[r.model]:e}),onProviderChange:e=>o({[r.provider]:e}),provider:eM(eL(c))}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})}function e5(e){switch(e.field.control){case"enum":return(0,l.jsx)(eV,{...e});case"text":return(0,l.jsx)(ez,{...e});case"number":return(0,l.jsx)(eG,{...e});case"boolean":return(0,l.jsx)(eU,{...e});case"resource":return(0,l.jsx)(eK,{...e});case"resourceMulti":return(0,l.jsx)(e_,{...e});case"stringList":return(0,l.jsx)(eX,{...e});case"record":return(0,l.jsx)(eJ,{...e});case"condition":return(0,l.jsx)(eY,{...e});case"choiceOptions":return(0,l.jsx)(eZ,{...e});case"triggerChoices":return(0,l.jsx)(e0,{...e});case"mcpPresetMulti":return(0,l.jsx)(eH,{...e});case"json":return(0,l.jsx)(eQ,{...e});default:return null}}function e3({config:e,onChange:t,defaultOpen:i,extraKeyCount:s}){let a=(0,j.useTranslations)("workflows"),[r,n]=(0,v.useState)(i),[o,c]=(0,v.useState)(()=>JSON.stringify(e,null,2)),[d,u]=(0,v.useState)(null),p=(0,v.useRef)(o);return(0,v.useEffect)(()=>{let l=JSON.stringify(e,null,2);l!==p.current&&(c(l),p.current=l,u(null))},[e]),(0,l.jsxs)(eg,{onOpenChange:n,open:r,children:[(0,l.jsx)(ej,{asChild:!0,children:(0,l.jsxs)(w.Button,{className:"w-full justify-between px-0 text-xs font-medium text-muted-foreground",type:"button",variant:"ghost",children:[(0,l.jsxs)("span",{children:[a("advancedJson"),s?` \xb7 ${a("extraKeys",{count:s})}`:""]}),(0,l.jsx)(G.ChevronDown,{className:`size-4 transition-transform ${r?"rotate-180":""}`})]})}),(0,l.jsxs)(ev,{className:"space-y-1.5 pt-1.5",children:[(0,l.jsx)(W.Textarea,{"aria-label":a("advancedJson"),"aria-invalid":!!d,className:"min-h-40 font-mono text-xs",onChange:e=>(e=>{c(e);try{let l=JSON.parse(e);if(!l||"object"!=typeof l||Array.isArray(l))throw Error(a("configMustBeObject"));p.current=JSON.stringify(l,null,2),u(null),t(l)}catch(e){u(e instanceof Error?e.message:String(e))}})(e.target.value),value:o}),d?(0,l.jsx)(I.FieldError,{className:"text-[10px]",children:d}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("advancedJsonHelp")}),(0,l.jsx)(eD,{})]})]})]})}function e6({kind:e,scope:t,config:i,onChange:s,sessionPaths:a}){let r=(0,j.useTranslations)("workflows"),n=(0,eI.getConfigDescriptor)(e,t);if(!n)return null;let o=new Set(n.fields.flatMap(e=>"model"===e.control&&e.modelKeys?[e.modelKeys.provider,e.modelKeys.model,e.modelKeys.effort]:[e.key])),c=Object.keys(i).filter(e=>!o.has(e));return(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsx)(I.FieldTitle,{className:"text-xs text-muted-foreground",children:r("configuration")}),n.fields.map(e=>e.visibleWhen&&i[e.visibleWhen.key]!==e.visibleWhen.equals?null:"model"===e.control?(0,l.jsx)(e2,{config:i,field:e,onChange:s,sessionPaths:a},e.key):(0,l.jsx)(e5,{config:i,field:e,onChange:l=>((e,l)=>{if(void 0===l){let l={...i};delete l[e],s(l);return}s({...i,[e]:l})})(e.key,l),sessionPaths:a,value:i[e.key]},e.key)),(0,l.jsx)(e3,{config:i,defaultOpen:!1,extraKeyCount:c.length,onChange:s})]})}var e7=e.i(895673),e8=e.i(349049),e4=e.i(399668),e9=e.i(619968),le=e.i(681735),ll=e.i(18718);let lt=`
|
|
48
|
+
}`,variables:{codebaseRepositoryId:l},map:e=>e.githubActionsWorkflowRuns?.items.map(e=>({value:e.id,label:e.displayTitle||e.id,description:e.headBranch??void 0}))??[]};default:return null}}(e,l),[e,l]),i=t?JSON.stringify({query:t.query,variables:t.variables}):null,[s,a]=(0,v.useState)({key:"",options:[],error:!1});return((0,v.useEffect)(()=>{if(!t||!i)return;let e=!1;return(0,B.controlPlaneRequest)(t.query,t.variables).then(l=>{e||a({key:i,options:t.map(l),error:!1})}).catch(()=>{e||a({key:i,options:[],error:!0})}),()=>{e=!0}},[t,i]),t&&i)?s.key!==i?{options:[],loading:!0,fallback:!1}:{options:s.options,loading:!1,fallback:s.error||0===s.options.length}:{options:[],loading:!1,fallback:!0}}var eF=e.i(159888);let eO=(0,n.default)("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);var eA=e.i(808562);function eL(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&"SESSION"===e.source}function eP(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"LITERAL"===e.source?e.value:e}function eD(){let e=(0,j.useTranslations)("workflows");return(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e("interpolationHelp",{token:"{{path}}",example:"{{worktree.baseBranch}}"})})}function eR({mode:e,onValueChange:t}){let i=(0,j.useTranslations)("workflows");return(0,l.jsxs)(eA.ToggleGroup,{"aria-label":i("valueModeToggle"),onValueChange:e=>{("literal"===e||"session"===e)&&t(e)},size:"sm",spacing:0,type:"single",value:e,variant:"outline",children:[(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(eA.ToggleGroupItem,{"aria-label":i("valueModeLiteral"),className:"size-7 px-0 aria-checked:bg-accent aria-checked:text-accent-foreground",value:"literal",children:(0,l.jsx)(eO,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:i("valueModeLiteral")})]}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(eA.ToggleGroupItem,{"aria-label":i("valueModeSession"),className:"size-7 px-0 aria-checked:bg-accent aria-checked:text-accent-foreground",value:"session",children:(0,l.jsx)(eF.Braces,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:i("valueModeSession")})]})]})}function eW({label:e,help:t,allowCustomSessionPath:i=!0,clearLabel:s,defaultSessionPath:a,sessionEnabled:r,interpolationEnabled:n=!1,value:o,onChange:c,sessionPaths:d,children:u}){let p=(0,j.useTranslations)("workflows"),h=(0,v.useId)(),x=eL(o)?"session":"literal",m=d.map(({path:e,description:l})=>({value:e,label:e,description:l}));return(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("div",{className:"flex items-end justify-between gap-2",children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:h,children:e}),r&&(0,l.jsx)(eR,{mode:x,onValueChange:e=>c("session"===e?{source:"SESSION",path:d.find(({path:e})=>e===a)?.path??d[0]?.path??""}:"")})]}),"session"===x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U.SearchableSelect,{allowCustomValue:i,ariaLabel:p("sessionBindingLabel"),clearLabel:s,emptyMessage:p("noOptions"),onValueChange:e=>c(e?{source:"SESSION",path:e}:void 0),options:m,placeholder:p("sessionPathPlaceholder"),searchPlaceholder:p("searchPlaceholder"),value:eL(o)?o.path:""}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:p("sessionBindingHelp")})]}):(0,l.jsxs)(l.Fragment,{children:[u(eP(o),c,h),t&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:t}),n&&(0,l.jsx)(eD,{})]})]})}function eM(e){return"string"==typeof e?e:""}function e$(e,l){if(!l)return null;let t=e[l];return"string"==typeof t&&t.length>0?t:null}function eq(e){return!!e.valueModes?.includes("session")}function eB(e){return!!e.valueModes?.includes("interpolation")}function eV({field:e,value:t,onChange:i}){let s=(0,j.useTranslations)("workflows"),a=(0,v.useId)(),r=e.options?.kind==="static"?e.options.options:[];return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:a,children:e.label}),(0,l.jsxs)(O.Select,{onValueChange:e=>i(e),value:eM(eP(t)),children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:a,children:(0,l.jsx)(O.SelectValue,{placeholder:s("selectPlaceholder")})}),(0,l.jsx)(O.SelectContent,{children:r.map(e=>(0,l.jsx)(O.SelectItem,{value:e.value,children:e.label??e.value},e.value))})]}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})}function ez({field:e,value:t,onChange:i,sessionPaths:s}){return(0,l.jsx)(eW,{help:e.help,interpolationEnabled:eB(e),label:e.label,onChange:i,sessionEnabled:eq(e),sessionPaths:s,value:t,children:(t,i,s)=>e.multiline?(0,l.jsx)(W.Textarea,{className:"min-h-20 text-sm",id:s,onChange:e=>i(e.target.value),placeholder:e.placeholder,value:eM(t)}):(0,l.jsx)(T.Input,{id:s,onChange:e=>i(e.target.value),placeholder:e.placeholder,value:eM(t)})})}function eG({field:e,value:t,onChange:i,sessionPaths:s}){return(0,l.jsx)(eW,{help:e.help,label:e.label,onChange:i,sessionEnabled:eq(e),sessionPaths:s,value:t,children:(t,i,s)=>(0,l.jsx)(T.Input,{id:s,max:e.maximum,min:e.minimum,onChange:e=>i(""===e.target.value?void 0:Number(e.target.value)),placeholder:e.placeholder,step:e.integer?1:void 0,type:"number",value:"number"==typeof t&&Number.isFinite(t)?String(t):""})})}function eU({field:e,value:t,onChange:i}){let s=(0,v.useId)();return(0,l.jsxs)(I.Field,{orientation:"horizontal",children:[(0,l.jsx)(C.Checkbox,{checked:!0===eP(t),id:s,onCheckedChange:e=>i(!0===e)}),(0,l.jsxs)(I.FieldContent,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:s,children:e.label}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})]})}function eH({field:e,value:t,onChange:i}){let s=Array.isArray(t)?t.map(String):[];return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(K.McpPresetPicker,{kind:e.presetKind,onChange:i,selectedIds:s,showAvailability:null==e.presetKind}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})}function eK({field:e,config:t,value:i,onChange:s,sessionPaths:a}){let r=(0,j.useTranslations)("workflows"),n=e.options?.kind==="resource"?e.options:null,o=e$(t,n?.scopeFrom),{options:c,loading:d}=eE(n?.resource??"codebase",o),u=n?.sessionPath,p=e.required?void 0:r("notSet"),h=u?a.filter(({path:e})=>{let[l,t]=u.split(".");return e===u||e.startsWith(`${l}.`)&&e.endsWith(`.${t}`)}):a;return(0,l.jsx)(eW,{allowCustomSessionPath:!u,clearLabel:p,defaultSessionPath:u,help:e.help,interpolationEnabled:eB(e),label:e.label,onChange:s,sessionEnabled:eq(e),sessionPaths:h,value:i,children:(t,i)=>(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:e.label,clearLabel:p,disabled:d,emptyMessage:r("noOptions"),onValueChange:e=>i(e||void 0),options:c,placeholder:e.placeholder??r("selectPlaceholder"),searchPlaceholder:r("searchPlaceholder"),value:eM(t)})})}function e_({field:e,config:t,value:i,onChange:s}){let a=(0,j.useTranslations)("workflows"),r=e.options?.kind==="resource"?e.options:null,n=e$(t,r?.scopeFrom),{options:o,loading:c}=eE(r?.resource??"codebase",n),d=Array.isArray(i)?i.map(String):[],u=o.filter(e=>!d.includes(e.value));return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(F.ItemGroup,{className:"gap-1.5",children:d.map(e=>(0,l.jsxs)(F.Item,{size:"xs",variant:"muted",children:[(0,l.jsx)(F.ItemContent,{className:"min-w-0",children:(0,l.jsx)(F.ItemTitle,{className:"block truncate text-xs",children:o.find(l=>l.value===e)?.label??e})}),(0,l.jsx)(F.ItemActions,{children:(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":a("removeRow"),className:"size-7",onClick:()=>{s(d.filter(l=>l!==e))},size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:a("removeRow")})]})})]},e))}),(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:e.label,disabled:c,emptyMessage:a("noOptions"),onValueChange:e=>{e&&!d.includes(e)&&s([...d,e])},options:u,placeholder:e.placeholder??a("addRow"),searchPlaceholder:a("searchPlaceholder"),value:""}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})}function eX({field:e,value:t,onChange:i}){let s=(0,j.useTranslations)("workflows"),a=Array.isArray(t)?t.map(String):[];return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:a.map((t,r)=>(0,l.jsxs)(E.InputGroup,{children:[(0,l.jsx)(E.InputGroupInput,{onChange:e=>{let l;return l=e.target.value,i(a.map((e,t)=>t===r?l:e))},placeholder:e.placeholder,value:t}),(0,l.jsx)(E.InputGroupAddon,{align:"inline-end",children:(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(E.InputGroupButton,{"aria-label":s("removeRow"),onClick:()=>i(a.filter((e,l)=>l!==r)),size:"icon-xs",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:s("removeRow")})]})})]},r))}),(0,l.jsxs)(w.Button,{onClick:()=>i([...a,""]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",s("addRow")]}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})}function eJ({field:e,value:t,onChange:i}){let s=(0,j.useTranslations)("workflows"),a=t&&"object"==typeof t&&!Array.isArray(t)?Object.entries(t).map(([e,l])=>[e,l]):[],r=e=>{let l={};for(let[t,i]of e)t&&(l[t]=i);i(l)};return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:a.map(([e,t],i)=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(T.Input,{className:"w-2/5",onChange:e=>r(a.map((l,t)=>t===i?[e.target.value,l[1]]:l)),placeholder:s("recordKeyPlaceholder"),value:e}),(0,l.jsx)(T.Input,{className:"min-w-0 flex-1",onChange:e=>r(a.map((l,t)=>t===i?[l[0],e.target.value]:l)),placeholder:s("recordValuePlaceholder"),value:eM(t)}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":s("removeRow"),className:"size-7 shrink-0",onClick:()=>r(a.filter((e,l)=>l!==i)),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:s("removeRow")})]})]},i))}),(0,l.jsxs)(w.Button,{onClick:()=>r([...a,["",""]]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",s("addRow")]}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})}function eQ({field:e,value:t,onChange:i}){let s=(0,v.useId)(),[a,r]=(0,v.useState)(()=>void 0===t?"":JSON.stringify(t,null,2)),[n,o]=(0,v.useState)(null),c=(0,v.useRef)(a);return(0,v.useEffect)(()=>{let e=void 0===t?"":JSON.stringify(t,null,2);e!==c.current&&(r(e),c.current=e,o(null))},[t]),(0,l.jsxs)(I.Field,{"data-invalid":!!n,children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",htmlFor:s,children:e.label}),(0,l.jsx)(W.Textarea,{"aria-invalid":!!n,className:"min-h-24 font-mono text-xs",id:s,onChange:e=>(e=>{if(r(e),""===e.trim()){c.current="",o(null),i(void 0);return}try{let l=JSON.parse(e);c.current=JSON.stringify(l,null,2),o(null),i(l)}catch(e){o(e instanceof Error?e.message:String(e))}})(e.target.value),placeholder:e.placeholder,value:a}),n?(0,l.jsx)(I.FieldError,{className:"text-[10px]",children:n}):(0,l.jsxs)(l.Fragment,{children:[e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help}),eB(e)&&(0,l.jsx)(eD,{})]})]})}function eY(e){let{field:t,value:i,onChange:s,sessionPaths:a}=e,r=(0,j.useTranslations)("workflows"),n=function(e){if(null==e)return ek;if("object"!=typeof e||Array.isArray(e))return null;if("ALL"===e.op||"ANY"===e.op){let l=e.conditions;if(!Array.isArray(l))return null;let t=[];for(let e of l){let l=eC(e);if(!l)return null;t.push(l)}return{mode:e.op,rows:t}}let l=eC(e);return l?{mode:"ALL",rows:[l]}:null}(i),o=a.map(({path:e,description:l})=>({value:e,label:e,description:l}));if(!n)return(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(eQ,{...e}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:r("conditionAdvanced")})]});let c=e=>s(function(e){if(0!==e.rows.length)return 1===e.rows.length?eS(e.rows[0]):{op:e.mode,conditions:e.rows.map(eS)}}(e)),d=(e,l)=>c({...n,rows:n.rows.map((t,i)=>i===e?{...t,...l}:t)});return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:t.label}),n.rows.length>1&&(0,l.jsxs)(O.Select,{onValueChange:e=>c({...n,mode:"ANY"===e?"ANY":"ALL"}),value:n.mode,children:[(0,l.jsx)(O.SelectTrigger,{"aria-label":r("conditionMatchMode"),className:"w-full",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"ALL",children:r("conditionMatchAll")}),(0,l.jsx)(O.SelectItem,{value:"ANY",children:r("conditionMatchAny")})]})]}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:n.rows.map((e,t)=>{var i;return(0,l.jsxs)("div",{className:"space-y-1.5 rounded-lg border p-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"min-w-0 flex-1",children:(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:r("conditionField"),emptyMessage:r("noOptions"),onValueChange:e=>d(t,{path:e}),options:o,placeholder:r("sessionPathPlaceholder"),searchPlaceholder:r("searchPlaceholder"),value:e.path})}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":r("removeRow"),className:"size-7 shrink-0",onClick:()=>c({...n,rows:n.rows.filter((e,l)=>l!==t)}),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:r("removeRow")})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(O.Select,{onValueChange:e=>d(t,{operator:e}),value:e.operator,children:[(0,l.jsx)(O.SelectTrigger,{"aria-label":r("conditionOperator"),className:"w-40 shrink-0",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsx)(O.SelectContent,{children:ey.map(e=>(0,l.jsx)(O.SelectItem,{value:e.value,children:r(`conditionOperators.${e.value}`)},e.value))})]}),ew(e.operator)&&(0,l.jsxs)(l.Fragment,{children:[eL(e.value)?(0,l.jsx)("div",{className:"min-w-0 flex-1",children:(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:r("sessionBindingLabel"),emptyMessage:r("noOptions"),onValueChange:e=>d(t,{value:{source:"SESSION",path:e}}),options:o,placeholder:r("sessionPathPlaceholder"),searchPlaceholder:r("searchPlaceholder"),value:e.value.path})}):(0,l.jsx)(T.Input,{"aria-label":r("conditionValue"),className:"min-w-0 flex-1",onChange:e=>d(t,{value:eN(e.target.value)}),placeholder:r("conditionValuePlaceholder"),value:void 0===(i=e.value)?"":"string"==typeof i?eN(i)===i?i:JSON.stringify(i):JSON.stringify(i)??""}),(0,l.jsx)(eR,{mode:eL(e.value)?"session":"literal",onValueChange:e=>d(t,{value:"session"===e?{source:"SESSION",path:""}:""})})]})]})]},t)})}),(0,l.jsxs)(w.Button,{onClick:()=>c({...n,rows:[...n.rows,{path:"",operator:"EQ",value:""}]}),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",r("addCondition")]}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:n.rows.length?r("conditionHelp"):r("conditionEmpty")}),eB(t)&&(0,l.jsx)(eD,{})]})}function eZ(e){let{field:t,value:i,onChange:s}=e,a=(0,j.useTranslations)("workflows"),r=function(e){if(null==e)return[];if(!Array.isArray(e))return null;let l=[];for(let t of e){if(!t||"object"!=typeof t||Array.isArray(t)||Object.keys(t).filter(e=>"label"!==e&&"description"!==e).length>0||"string"!=typeof t.label||void 0!==t.description&&"string"!=typeof t.description)return null;l.push({label:t.label,description:t.description??""})}return l}(i);if(!r)return(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(eQ,{...e}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("choiceOptionsAdvanced")})]});let n=e=>s(function(e){if(0!==e.length)return e.map(({label:e,description:l})=>l?{label:e,description:l}:{label:e})}(e)),o=(e,l)=>n(r.map((t,i)=>i===e?{...t,...l}:t));return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:t.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:r.map((e,t)=>(0,l.jsxs)("div",{className:"space-y-1.5 rounded-lg border p-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(T.Input,{"aria-label":a("choiceOptionLabel"),className:"min-w-0 flex-1",onChange:e=>o(t,{label:e.target.value}),placeholder:a("choiceOptionLabel"),value:e.label}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":a("removeRow"),className:"size-7 shrink-0",onClick:()=>n(r.filter((e,l)=>l!==t)),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:a("removeRow")})]})]}),(0,l.jsx)(T.Input,{"aria-label":a("choiceOptionDescription"),className:"text-xs",onChange:e=>o(t,{description:e.target.value}),placeholder:a("choiceOptionDescription"),value:e.description})]},t))}),(0,l.jsxs)(w.Button,{onClick:()=>n([...r,{label:"",description:""}]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",a("addChoiceOption")]}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:r.length?a("choiceOptionsHelp"):a("choiceOptionsEmpty")}),eB(t)&&(0,l.jsx)(eD,{})]})}function e0(e){let{field:t,value:i,onChange:s}=e,a=(0,j.useTranslations)("workflows"),r=function(e){if(null==e)return[];if(!Array.isArray(e))return null;let l=[];for(let t of e){if(!t||"object"!=typeof t||Array.isArray(t)||Object.keys(t).filter(e=>"key"!==e&&"label"!==e&&"description"!==e).length>0||"string"!=typeof t.key||void 0!==t.label&&"string"!=typeof t.label||void 0!==t.description&&"string"!=typeof t.description)return null;l.push({key:t.key,label:t.label??"",description:t.description??""})}return l}(i);if(!r)return(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(eQ,{...e}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("triggerChoicesAdvanced")})]});let n=e=>s(function(e){if(0!==e.length)return e.map(({key:e,label:l,description:t})=>t?{key:e,label:l,description:t}:{key:e,label:l})}(e)),o=(e,l)=>n(r.map((t,i)=>i===e?{...t,...l}:t));return(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:t.label}),(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:r.map((e,t)=>(0,l.jsxs)("div",{className:"space-y-1.5 rounded-lg border p-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(T.Input,{"aria-label":a("triggerChoiceLabel"),className:"min-w-0 flex-1",onChange:e=>{var l;let i;return l=e.target.value,i=r[t],void o(t,{label:l,...!i.key||i.key===eb(i.label)?{key:eb(l)}:{}})},placeholder:a("triggerChoiceLabel"),value:e.label}),(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(w.Button,{"aria-label":a("removeRow"),className:"size-7 shrink-0",onClick:()=>n(r.filter((e,l)=>l!==t)),size:"icon",type:"button",variant:"ghost",children:(0,l.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,l.jsx)(M.TooltipContent,{children:a("removeRow")})]})]}),(0,l.jsx)(T.Input,{"aria-label":a("triggerChoiceKey"),className:"font-mono text-xs",onChange:e=>o(t,{key:e.target.value}),placeholder:a("triggerChoiceKey"),value:e.key}),r.some((e,l)=>l!==t&&e.key===r[t].key)&&(0,l.jsx)(I.FieldError,{className:"text-[10px]",children:a("triggerChoiceKeyDuplicate")}),(0,l.jsx)(T.Input,{"aria-label":a("triggerChoiceDescription"),className:"text-xs",onChange:e=>o(t,{description:e.target.value}),placeholder:a("triggerChoiceDescription"),value:e.description})]},t))}),(0,l.jsxs)(w.Button,{onClick:()=>n([...r,{key:"",label:"",description:""}]),size:"sm",type:"button",variant:"outline",children:[(0,l.jsx)(u.Plus,{className:"size-3.5"})," ",a("addTriggerChoice")]}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:r.length?a("triggerChoicesHelp"):a("triggerChoicesEmpty")})]})}let e1={provider:"provider",model:"model",effort:"effort"};function e2({field:e,config:t,onChange:i,sessionPaths:s}){let a=(0,j.useTranslations)("workflows"),r=e.modelKeys??e1,n=(0,v.useRef)(t);(0,v.useEffect)(()=>{n.current=t},[t]);let o=e=>{let l={...n.current};for(let[t,i]of Object.entries(e))void 0===i?delete l[t]:l[t]=i;n.current=l,i(l)},c=t[r.provider],d=t[r.model],u=t[r.effort],p=eL(c)||eL(d)||eL(u),h=function(e){let[l,t]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let l=!1;return(0,B.controlPlaneRequest)(_,{worktreeId:e||null}).then(e=>{l||t(e.runProviderCatalog)}).catch(()=>{l||t([])}),()=>{l=!0}},[e]),l}(e$(t,r.scopeFrom)),x=[{key:r.provider,label:a("modelProvider"),value:c},{key:r.model,label:a("modelModel"),value:d},{key:r.effort,label:a("modelEffort"),value:u}],m=s.map(({path:e,description:l})=>({value:e,label:e,description:l}));return(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("div",{className:"flex items-end justify-between gap-2",children:[(0,l.jsx)(I.FieldLabel,{className:"text-xs",children:e.label}),(0,l.jsx)(eR,{mode:p?"session":"literal",onValueChange:e=>"session"===e?o({[r.provider]:{source:"SESSION",path:""},[r.model]:{source:"SESSION",path:""},[r.effort]:{source:"SESSION",path:""}}):o({[r.provider]:void 0,[r.model]:void 0,[r.effort]:void 0})})]}),p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.FieldGroup,{className:"gap-1.5",children:x.map(({key:e,label:t,value:i})=>(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{className:"text-[10px] text-muted-foreground",children:t}),(0,l.jsx)(U.SearchableSelect,{allowCustomValue:!0,ariaLabel:t,emptyMessage:a("noOptions"),onValueChange:l=>o({[e]:{source:"SESSION",path:l}}),options:m,placeholder:a("sessionPathPlaceholder"),searchPlaceholder:a("searchPlaceholder"),value:eL(i)?i.path:""})]},e))}),(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("sessionBindingHelp")})]}):(0,l.jsx)(H.ModelEffortPicker,{catalog:h,effort:eM(eP(u)),fullWidth:!0,model:eM(eP(d)),onEffortChange:e=>o({[r.effort]:e}),onModelChange:e=>o({[r.model]:e}),onProviderChange:e=>o({[r.provider]:e}),provider:eM(eP(c))}),e.help&&(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:e.help})]})}function e5(e){switch(e.field.control){case"enum":return(0,l.jsx)(eV,{...e});case"text":return(0,l.jsx)(ez,{...e});case"number":return(0,l.jsx)(eG,{...e});case"boolean":return(0,l.jsx)(eU,{...e});case"resource":return(0,l.jsx)(eK,{...e});case"resourceMulti":return(0,l.jsx)(e_,{...e});case"stringList":return(0,l.jsx)(eX,{...e});case"record":return(0,l.jsx)(eJ,{...e});case"condition":return(0,l.jsx)(eY,{...e});case"choiceOptions":return(0,l.jsx)(eZ,{...e});case"triggerChoices":return(0,l.jsx)(e0,{...e});case"mcpPresetMulti":return(0,l.jsx)(eH,{...e});case"json":return(0,l.jsx)(eQ,{...e});default:return null}}function e3({config:e,onChange:t,defaultOpen:i,extraKeyCount:s}){let a=(0,j.useTranslations)("workflows"),[r,n]=(0,v.useState)(i),[o,c]=(0,v.useState)(()=>JSON.stringify(e,null,2)),[d,u]=(0,v.useState)(null),p=(0,v.useRef)(o);return(0,v.useEffect)(()=>{let l=JSON.stringify(e,null,2);l!==p.current&&(c(l),p.current=l,u(null))},[e]),(0,l.jsxs)(eg,{onOpenChange:n,open:r,children:[(0,l.jsx)(ej,{asChild:!0,children:(0,l.jsxs)(w.Button,{className:"w-full justify-between px-0 text-xs font-medium text-muted-foreground",type:"button",variant:"ghost",children:[(0,l.jsxs)("span",{children:[a("advancedJson"),s?` \xb7 ${a("extraKeys",{count:s})}`:""]}),(0,l.jsx)(G.ChevronDown,{className:`size-4 transition-transform ${r?"rotate-180":""}`})]})}),(0,l.jsxs)(ev,{className:"space-y-1.5 pt-1.5",children:[(0,l.jsx)(W.Textarea,{"aria-label":a("advancedJson"),"aria-invalid":!!d,className:"min-h-40 font-mono text-xs",onChange:e=>(e=>{c(e);try{let l=JSON.parse(e);if(!l||"object"!=typeof l||Array.isArray(l))throw Error(a("configMustBeObject"));p.current=JSON.stringify(l,null,2),u(null),t(l)}catch(e){u(e instanceof Error?e.message:String(e))}})(e.target.value),value:o}),d?(0,l.jsx)(I.FieldError,{className:"text-[10px]",children:d}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.FieldDescription,{className:"text-[10px]",children:a("advancedJsonHelp")}),(0,l.jsx)(eD,{})]})]})]})}function e6({kind:e,scope:t,config:i,onChange:s,sessionPaths:a}){let r=(0,j.useTranslations)("workflows"),n=(0,eI.getConfigDescriptor)(e,t);if(!n)return null;let o=new Set(n.fields.flatMap(e=>"model"===e.control&&e.modelKeys?[e.modelKeys.provider,e.modelKeys.model,e.modelKeys.effort]:[e.key])),c=Object.keys(i).filter(e=>!o.has(e));return(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsx)(I.FieldTitle,{className:"text-xs text-muted-foreground",children:r("configuration")}),n.fields.map(e=>e.visibleWhen&&i[e.visibleWhen.key]!==e.visibleWhen.equals?null:"model"===e.control?(0,l.jsx)(e2,{config:i,field:e,onChange:s,sessionPaths:a},e.key):(0,l.jsx)(e5,{config:i,field:e,onChange:l=>((e,l)=>{if(void 0===l){let l={...i};delete l[e],s(l);return}s({...i,[e]:l})})(e.key,l),sessionPaths:a,value:i[e.key]},e.key)),(0,l.jsx)(e3,{config:i,defaultOpen:!1,extraKeyCount:c.length,onChange:s})]})}var e7=e.i(895673),e8=e.i(349049),e4=e.i(399668),e9=e.i(619968),le=e.i(681735),ll=e.i(18718);let lt=`
|
|
49
49
|
query WorkflowEditorCatalog($id: ID!) {
|
|
50
50
|
workflowCatalog {
|
|
51
51
|
schemaVersion globalConcurrency
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
versionCount runCount createdAt updatedAt
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
`;function li(e){return`${e}-${crypto.randomUUID()}`}function ls(e){let l=new Map;for(let t of e)l.set(t.category,[...l.get(t.category)??[],t]);return l}function la({children:e,details:t}){return(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(F.Item,{asChild:!0,className:"gap-1.5 px-1.5 py-1",size:"xs",variant:"outline",children:e})}),(0,l.jsx)(M.TooltipContent,{className:"max-w-80 text-xs leading-relaxed",side:"right",children:t})]})}function lr(){let e=(0,j.useTranslations)("workflows"),i=(0,t.useStoreApi)(),s=(0,t.useStore)(e=>e.nodesDraggable||e.nodesConnectable||e.elementsSelectable),a=e(s?"lockSteps":"unlockSteps"),r="fill-none!";return(0,l.jsx)(t.ControlButton,{"aria-label":a,onClick:()=>i.setState({elementsSelectable:!s,nodesConnectable:!s,nodesDraggable:!s}),title:a,children:s?(0,l.jsx)(d,{className:r}):(0,l.jsx)(c.MousePointer2,{className:r})})}function ln({onToggle:e,shown:i}){let s=(0,j.useTranslations)("workflows")(i?"hideSessionData":"showSessionData"),n="fill-none!";return(0,l.jsx)(t.ControlButton,{"aria-label":s,onClick:e,title:s,children:i?(0,l.jsx)(r.EyeOff,{className:n}):(0,l.jsx)(a.Eye,{className:n})})}function lo({workflowId:e}){let n=(0,j.useTranslations)("workflows"),c=(0,e4.useWorkflowLabels)(),d=(0,$.useRouter)(),M=(0,v.useRef)(null),G=(0,v.useRef)(null),[U,H]=(0,v.useState)(null),[K,_]=(0,v.useState)(()=>(0,e9.emptyDefinition)()),[X,J]=(0,v.useState)(null),[Q,Y,Z]=(0,t.useNodesState)([]),[ee,el,et]=(0,t.useEdgesState)([]),[ei,es]=(0,v.useState)(null),[ea,er]=(0,v.useState)(null),[en,eo]=(0,v.useState)(null),[ec,ed]=(0,v.useState)(!1),[eu,ep]=(0,v.useState)("palette"),[eh,ex]=(0,v.useState)(""),[em,ef]=(0,v.useState)(!0),[eg,ej]=(0,v.useState)(!1),[ev,eb]=(0,v.useState)(null),[ey,ew]=(0,v.useState)(null),[ek,eC]=(0,v.useState)([]),[eS,eN]=(0,v.useState)("QUEUE"),[eT,eE]=(0,v.useState)("WORKTREE"),[eF,eO]=(0,v.useState)(1),[eA,
|
|
60
|
+
`;function li(e){return`${e}-${crypto.randomUUID()}`}function ls(e){let l=new Map;for(let t of e)l.set(t.category,[...l.get(t.category)??[],t]);return l}function la({children:e,details:t}){return(0,l.jsxs)(M.Tooltip,{children:[(0,l.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,l.jsx)(F.Item,{asChild:!0,className:"gap-1.5 px-1.5 py-1",size:"xs",variant:"outline",children:e})}),(0,l.jsx)(M.TooltipContent,{className:"max-w-80 text-xs leading-relaxed",side:"right",children:t})]})}function lr(){let e=(0,j.useTranslations)("workflows"),i=(0,t.useStoreApi)(),s=(0,t.useStore)(e=>e.nodesDraggable||e.nodesConnectable||e.elementsSelectable),a=e(s?"lockSteps":"unlockSteps"),r="fill-none!";return(0,l.jsx)(t.ControlButton,{"aria-label":a,onClick:()=>i.setState({elementsSelectable:!s,nodesConnectable:!s,nodesDraggable:!s}),title:a,children:s?(0,l.jsx)(d,{className:r}):(0,l.jsx)(c.MousePointer2,{className:r})})}function ln({onToggle:e,shown:i}){let s=(0,j.useTranslations)("workflows")(i?"hideSessionData":"showSessionData"),n="fill-none!";return(0,l.jsx)(t.ControlButton,{"aria-label":s,onClick:e,title:s,children:i?(0,l.jsx)(r.EyeOff,{className:n}):(0,l.jsx)(a.Eye,{className:n})})}function lo({workflowId:e}){let n=(0,j.useTranslations)("workflows"),c=(0,e4.useWorkflowLabels)(),d=(0,$.useRouter)(),M=(0,v.useRef)(null),G=(0,v.useRef)(null),[U,H]=(0,v.useState)(null),[K,_]=(0,v.useState)(()=>(0,e9.emptyDefinition)()),[X,J]=(0,v.useState)(null),[Q,Y,Z]=(0,t.useNodesState)([]),[ee,el,et]=(0,t.useEdgesState)([]),[ei,es]=(0,v.useState)(null),[ea,er]=(0,v.useState)(null),[en,eo]=(0,v.useState)(null),[ec,ed]=(0,v.useState)(!1),[eu,ep]=(0,v.useState)("palette"),[eh,ex]=(0,v.useState)(""),[em,ef]=(0,v.useState)(!0),[eg,ej]=(0,v.useState)(!1),[ev,eb]=(0,v.useState)(null),[ey,ew]=(0,v.useState)(null),[ek,eC]=(0,v.useState)([]),[eS,eN]=(0,v.useState)("QUEUE"),[eT,eE]=(0,v.useState)("WORKTREE"),[eF,eO]=(0,v.useState)(1),[eA,eL]=(0,v.useState)(!0),[eP,eD]=(0,v.useState)("NON_EXCLUSIVE"),[eR,eW]=(0,v.useState)(!1),[eM,e$]=(0,v.useState)(!1),[eq,eB]=(0,v.useState)(!1),[eV,ez]=(0,v.useState)(!1),[eG,eU]=(0,v.useState)(null),eH=(0,v.useMemo)(()=>new Map(X?.steps.map(({kind:e,category:l})=>[e,l])??[]),[X]),eK=(0,v.useMemo)(()=>(0,V.computeWorkflowPathAvailability)(K,(0,le.buildPathLookup)(X)),[X,K]),e_=(0,v.useCallback)((e,l=ek)=>{let t=(0,e8.workflowFlowElements)(e,{diagnostics:l,categories:eH,provides:(0,le.providesByNodeMap)((0,V.computeWorkflowPathAvailability)(e,(0,le.buildPathLookup)(X)))});Y(t.nodes),el(t.edges)},[X,eH,ek,el,Y]);(0,v.useEffect)(()=>{let l=!1;return(0,B.controlPlaneRequest)(lt,{id:e??"__new__"}).then(e=>{if(l)return;let t=e.workflow?.draftDefinition??(0,e9.emptyDefinition)();J(e.workflowCatalog),H(e.workflow),_(t),eN(e.workflow?.overlapPolicy??"QUEUE"),eE(e.workflow?.overlapScope??"WORKTREE"),eO(e.workflow?.maxConcurrentRuns??1),eL(e.workflow?.completionNotificationsEnabled??!0),eD(e.workflow?.worktreeConcurrency??"NON_EXCLUSIVE"),eW(e.workflow?.blocksGitOperations??!1);let i=new Map(e.workflowCatalog.steps.map(({kind:e,category:l})=>[e,l])),s=(0,e8.workflowFlowElements)(t,{categories:i,provides:(0,le.providesByNodeMap)((0,V.computeWorkflowPathAvailability)(t,(0,le.buildPathLookup)(e.workflowCatalog)))});Y(s.nodes),el(s.edges)}).catch(e=>eb(e instanceof Error?e.message:String(e))).finally(()=>ef(!1)),()=>{l=!0}},[el,Y,e]);let eX=K.nodes.find(({id:e})=>e===ea)??null,eJ=K.triggers.find(({id:e})=>e===ea)??null,eQ=eX??eJ,eY=(0,v.useMemo)(()=>eX?X?.steps.find(({kind:e})=>e===eX.kind):eJ?X?.triggers.find(({kind:e})=>e===eJ.kind):void 0,[X,eX,eJ]),eZ=(0,v.useMemo)(()=>{let e=new Set,l=new Map(X?.triggers.map(e=>[e.kind,e])??[]);for(let t of K.triggers){for(let i of l.get(t.kind)?.seedPaths??[])e.add(i);for(let l of(0,V.resourceManualSeedPaths)(t.kind,t.config))e.add(l)}for(let l of eK.provides.values())for(let t of l)e.add(t);return[...e]},[eK,X,K]),e0=(0,v.useMemo)(()=>{let e=eX?eK.availableBefore.get(eX.id):void 0;return(0,z.expandSessionPaths)(e??eZ)},[eK,eZ,eX]),e1=(0,v.useMemo)(()=>{if(eX)return(0,le.displayProvidedPaths)(eX.id,eK.provides);if(eJ){let e=[...X?.triggers.find(e=>e.kind===eJ.kind)?.seedPaths??[],...(0,V.resourceManualSeedPaths)(eJ.kind,eJ.config)];return(0,z.expandSessionPaths)(e)}return[]},[eK,X,eX,eJ]),e2=(0,v.useCallback)(e=>{_(e),e_(e)},[e_]),e5=(0,v.useCallback)((e,l)=>{var t;let i=32*K.nodes.length,s=(t=l??{x:320+i,y:120+i},{id:li("node"),kind:e.kind,name:e.label,position:t,config:{},requiredPaths:[],providedPaths:[],retry:{maxAttempts:1,strategy:"EXPONENTIAL",delaySeconds:5},failurePolicy:"FAIL"});e2({...K,nodes:[...K.nodes,s]}),er(s.id)},[e2,K]),lc=(0,v.useCallback)(e=>{let l={id:li("trigger"),kind:e.kind,name:e.label,position:{x:0,y:100+140*K.triggers.length},config:{}};e2({...K,triggers:[...K.triggers,l]}),er(l.id)},[e2,K]),ld=(0,v.useCallback)(e=>{let l=new Set(e);e2({...K,nodes:K.nodes.filter(({id:e})=>!l.has(e)),triggers:K.triggers.filter(({id:e})=>!l.has(e)),edges:K.edges.filter(({source:e,target:t})=>!l.has(e)&&!l.has(t))}),ea&&l.has(ea)&&er(null)},[e2,K,ea]),lu=(0,v.useCallback)(e=>{let l=K.nodes.find(l=>l.id===e);if(!l)return;let t={...structuredClone(l),id:li("node"),name:`${l.name??l.kind} copy`,position:{x:l.position.x+36,y:l.position.y+36}};e2({...K,nodes:[...K.nodes,t]}),er(t.id)},[e2,K]),lp=(0,v.useCallback)(()=>lu(ea),[lu,ea]),lh=(0,v.useCallback)(()=>{lu(ei?.getNodes().find(({selected:e})=>e)?.id??null??ea)},[lu,ei,ea]),lx=(0,v.useMemo)(()=>({onDelete:e=>ld([e]),onDuplicate:e=>lu(e),onEdit:e=>{eo(null),er(e)}}),[lu,ld]);(0,v.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&"d"===e.key.toLowerCase()){let l=e.target;l?.matches("input, textarea, [contenteditable=true]")||(e.preventDefault(),lh())}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[lh]);let lm=(0,v.useCallback)(e=>{if(!e.source||!e.target)return;let l={id:li("edge"),source:e.source,target:e.target,sourceHandle:e.sourceHandle??"success",targetHandle:e.targetHandle??"input"};el(e=>(0,t.addEdge)(l,e)),_(e=>({...e,edges:[...e.edges,l]}))},[el]),lf=(0,v.useCallback)(e=>{et(e);let l=new Set(e.flatMap(e=>"remove"===e.type?[e.id]:[]));0!==l.size&&(_(e=>({...e,edges:e.edges.filter(({id:e})=>!l.has(e))})),eo(e=>e&&l.has(e)?null:e))},[et]),lg=(0,v.useCallback)(e=>{let l=new Set(e);el(e=>e.filter(({id:e})=>!l.has(e))),_(e=>({...e,edges:e.edges.filter(({id:e})=>!l.has(e))})),eo(e=>e&&l.has(e)?null:e)},[el]),lj=async()=>{ej(!0),eb(null),ew(null);try{if(U){let e=await (0,B.controlPlaneRequest)(`mutation SaveWorkflow($input: SaveWorkflowDraftInput!) {
|
|
61
61
|
saveWorkflowDraft(input: $input) {
|
|
62
62
|
id name description draftDefinition activeVersionId enabled overlapPolicy overlapScope maxConcurrentRuns completionNotificationsEnabled exclusiveWorktree worktreeConcurrency blocksGitOperations archivedAt
|
|
63
63
|
versionCount runCount createdAt updatedAt
|
|
64
64
|
}
|
|
65
|
-
}`,{input:{id:U.id,definition:K,overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:
|
|
65
|
+
}`,{input:{id:U.id,definition:K,overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:eP,blocksGitOperations:eR}});H(e.saveWorkflowDraft),_(e.saveWorkflowDraft.draftDefinition),ew(n("saved"))}else{let e=await (0,B.controlPlaneRequest)(`mutation CreateWorkflow($input: CreateWorkflowInput!) {
|
|
66
66
|
createWorkflow(input: $input) {
|
|
67
67
|
id name description draftDefinition activeVersionId enabled overlapPolicy overlapScope maxConcurrentRuns completionNotificationsEnabled exclusiveWorktree worktreeConcurrency blocksGitOperations archivedAt
|
|
68
68
|
versionCount runCount createdAt updatedAt
|
|
69
69
|
}
|
|
70
|
-
}`,{input:{name:K.name,description:K.description,definition:K,overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:
|
|
70
|
+
}`,{input:{name:K.name,description:K.description,definition:K,overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:eP,blocksGitOperations:eR}});H(e.createWorkflow),_(e.createWorkflow.draftDefinition),ew(n("saved")),d.replace(`/workflows/${e.createWorkflow.id}/edit`)}return!0}catch(e){return eb(e instanceof Error?e.message:String(e)),!1}finally{ej(!1)}},lv=async()=>{if(!U)return void await lj();try{let e=await (0,B.controlPlaneRequest)(`query ValidateWorkflow($id: ID!) {
|
|
71
71
|
validateWorkflowDraft(id: $id) { valid diagnostics { severity code message nodeId triggerId path } }
|
|
72
|
-
}`,{id:U.id});eC(e.validateWorkflowDraft.diagnostics),e_(K,e.validateWorkflowDraft.diagnostics),ew(e.validateWorkflowDraft.valid?n("validationPassed"):n("validationFailed"))}catch(e){eb(e instanceof Error?e.message:String(e))}},lb=async()=>{if(!U)return void eb(n("saveBeforePublish"));ej(!0);try{if(!await lj())return;await (0,B.controlPlaneRequest)("mutation PublishWorkflow($id: ID!) { publishWorkflow(id: $id) { id version contentHash } }",{id:U.id}),ew(n("published")),d.push(`/workflows/${U.id}`)}catch(e){eb(e instanceof Error?e.message:String(e))}finally{ej(!1)}},ly=async()=>{try{let e=await (0,B.controlPlaneRequest)("mutation DuplicateWorkflow($input: CreateWorkflowInput!) { createWorkflow(input: $input) { id } }",{input:{name:`${K.name} copy`,description:K.description,definition:{...K,name:`${K.name} copy`},overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:eL,blocksGitOperations:eR}});d.push(`/workflows/${e.createWorkflow.id}/edit`)}catch(e){eb(e instanceof Error?e.message:String(e))}},lw=async()=>{try{let e=U?(await (0,B.controlPlaneRequest)("query ExportWorkflow($id: ID!) { exportWorkflow(id: $id) }",{id:U.id})).exportWorkflow:{format:"aide.workflow.export",schemaVersion:1,workflow:{name:K.name,description:K.description,overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:eL,blocksGitOperations:eR,definition:K}};(0,q.downloadJson)(e,`${(0,q.exportFileStem)(K.name)}.workflow.json`)}catch(e){eb(e instanceof Error?e.message:String(e))}},lk=async e=>{try{let l=JSON.parse(await e.text()),t="aide.workflow.export"===l.format&&l.workflow&&"object"==typeof l.workflow?l.workflow.definition:l;if(!t||"object"!=typeof t)throw Error(n("invalidImport"));ez(!1),eU(null),_(t),e_(t),ew(n("importLoaded"))}catch(e){eb(e instanceof Error?e.message:String(e))}},lC=e=>{e2({...K,nodes:K.nodes.map(l=>l.id===ea?{...l,...e}:l),triggers:K.triggers.map(l=>l.id===ea?{...l,...e}:l)})},lS=(0,v.useMemo)(()=>X?.steps.filter(e=>`${e.label} ${e.kind} ${e.category} ${e.description}`.toLowerCase().includes(eh.toLowerCase()))??[],[X,eh]),lN=(0,v.useMemo)(()=>X?.triggers.filter(e=>`${e.label} ${e.kind} ${e.category} ${e.description}`.toLowerCase().includes(eh.toLowerCase()))??[],[X,eh]),lI=(0,v.useMemo)(()=>`${K.triggers.map(({id:e})=>e).join()}|${K.nodes.map(({id:e})=>e).join()}|${K.edges.map(({id:e})=>e).join()}|${K.editor.handleLayout??"SIDES"}|${eq}`,[K,eq]),lT=(0,v.useMemo)(()=>eq?Q:Q.map(e=>e.data.provides.length?{...e,data:{...e.data,provides:[]}}:e),[Q,eq]),lE=(0,v.useMemo)(()=>[...ls(lS)],[lS]),lF=(0,v.useMemo)(()=>[...ls(lN)],[lN]),lO=K.editor.displayLayout??"REGULAR";return em?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(A.Skeleton,{className:"h-8 w-52"}),(0,l.jsx)(A.Skeleton,{className:"h-4 w-96"})]}),(0,l.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[280px_minmax(0,1fr)]",children:[(0,l.jsx)(A.Skeleton,{className:"h-[min(78vh,860px)] min-h-[520px]"}),(0,l.jsx)(A.Skeleton,{className:"h-[min(78vh,860px)] min-h-[520px]"})]})]}):X?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,l.jsx)("div",{className:"flex min-w-0 items-start gap-2",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:n("editor")}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:n("editorDescription")})]})}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)("input",{accept:"application/json,.json",className:"hidden",onChange:e=>{let l=e.target.files?.[0];l&&lk(l),e.target.value=""},ref:G,type:"file"}),(0,l.jsxs)(w.Button,{onClick:()=>ed(!0),variant:"outline",children:[(0,l.jsx)(m.Settings,{})," ",n("settings")]}),"BASIC"===lO&&(0,l.jsxs)(w.Button,{"aria-pressed":eV,onClick:()=>{ez(e=>!e),er(null),eo(null),eU(null)},variant:eV?"secondary":"outline",children:[eV?(0,l.jsx)(r.EyeOff,{}):(0,l.jsx)(a.Eye,{}),eV?n("exitBasicPreview"):n("previewBasicLayout")]}),(0,l.jsxs)(w.Button,{onClick:()=>G.current?.click(),variant:"outline",children:[(0,l.jsx)(g.Upload,{})," ",n("import")]}),(0,l.jsxs)(w.Button,{onClick:()=>void lw(),variant:"outline",children:[(0,l.jsx)(s.Download,{})," ",n("export")]}),U&&(0,l.jsxs)(w.Button,{onClick:()=>void ly(),variant:"outline",children:[(0,l.jsx)(i.Copy,{})," ",n("duplicate")]}),(0,l.jsxs)(w.Button,{disabled:eg,onClick:()=>void lj(),variant:"outline",children:[eg?(0,l.jsx)(D.Spinner,{}):(0,l.jsx)(h.Save,{})," ",n("saveDraft")]}),(0,l.jsxs)(w.Button,{disabled:eg,onClick:()=>void lb(),children:[(0,l.jsx)(x.Send,{})," ",n("publish")]})]})]}),ev&&(0,l.jsx)(b.Alert,{variant:"destructive",children:(0,l.jsx)(b.AlertDescription,{children:ev})}),ey&&(0,l.jsx)(b.Alert,{children:(0,l.jsx)(b.AlertDescription,{children:ey})}),(0,l.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[280px_minmax(0,1fr)]",children:[(0,l.jsx)(k.Card,{"aria-disabled":eV,className:`flex h-[min(78vh,860px)] min-h-[520px] flex-col gap-0 py-0 ${eV?"pointer-events-none opacity-60":""}`,size:"sm",children:(0,l.jsxs)(R.Tabs,{className:"flex min-h-0 flex-1 gap-0",onValueChange:e=>ep(e),value:eu,children:[(0,l.jsx)("div",{className:"border-b p-2",children:(0,l.jsxs)(R.TabsList,{className:"w-full",children:[(0,l.jsx)(R.TabsTrigger,{value:"palette",children:n("steps")}),(0,l.jsx)(R.TabsTrigger,{value:"outline",children:n("outline")})]})}),(0,l.jsxs)(k.CardContent,{className:"flex min-h-0 flex-1 flex-col p-2",children:[(0,l.jsxs)(R.TabsContent,{className:"flex min-h-0 flex-1 flex-col gap-2",value:"palette",children:[(0,l.jsxs)(E.InputGroup,{children:[(0,l.jsx)(E.InputGroupAddon,{children:(0,l.jsx)(p.Search,{})}),(0,l.jsx)(E.InputGroupInput,{"aria-label":n("searchSteps"),onChange:e=>ex(e.target.value),placeholder:n("searchSteps"),value:eh})]}),lE.length||lF.length?(0,l.jsx)(P.ScrollArea,{className:"-mr-2 min-h-0 flex-1",children:(0,l.jsxs)("div",{className:"space-y-3 pr-2 pb-1",children:[lE.map(([e,t])=>(0,l.jsxs)("section",{children:[(0,l.jsx)("div",{className:"px-1 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",children:e}),(0,l.jsx)(F.ItemGroup,{className:"gap-1",children:t.map(e=>(0,l.jsx)(la,{details:e.details,children:(0,l.jsxs)("button",{className:"cursor-grab text-left",draggable:!0,onClick:()=>e5(e),onDragStart:l=>{l.dataTransfer.setData("application/aide-workflow-step",e.kind),l.dataTransfer.effectAllowed="copy"},type:"button",children:[(0,l.jsx)(F.ItemMedia,{children:(0,l.jsx)(o,{className:"size-3.5 text-muted-foreground"})}),(0,l.jsxs)(F.ItemContent,{className:"min-w-0",children:[(0,l.jsx)(F.ItemTitle,{className:"text-xs",children:e.label}),(0,l.jsx)(F.ItemDescription,{className:"line-clamp-2 text-[10px] leading-snug",children:e.description})]}),(0,l.jsxs)(F.ItemActions,{className:"flex-col items-end gap-0.5",children:[(0,l.jsx)(y.Badge,{className:"text-[9px]",variant:"outline",children:e.execution}),(e.mutatesExternal||e.mutatesWorktree)&&(0,l.jsx)(y.Badge,{className:"text-[9px]",variant:"outline",children:n("mutates")})]})]})},e.kind))})]},`step:${e}`)),lF.map(([e,t])=>(0,l.jsxs)("section",{children:[(0,l.jsxs)("div",{className:"px-1 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",children:[n("triggers")," · ",e]}),(0,l.jsx)(F.ItemGroup,{className:"gap-1",children:t.map(e=>(0,l.jsx)(la,{details:e.details,children:(0,l.jsxs)("button",{className:"text-left",onClick:()=>lc(e),type:"button",children:[(0,l.jsx)(F.ItemMedia,{children:(0,l.jsx)(u.Plus,{className:"size-3.5 text-muted-foreground"})}),(0,l.jsxs)(F.ItemContent,{className:"min-w-0",children:[(0,l.jsx)(F.ItemTitle,{className:"text-xs",children:e.label}),(0,l.jsx)(F.ItemDescription,{className:"line-clamp-2 text-[10px] leading-snug",children:e.description})]})]})},e.kind))})]},`trigger:${e}`))]})}):(0,l.jsx)(N.Empty,{className:"py-10",children:(0,l.jsx)(N.EmptyHeader,{children:(0,l.jsx)(N.EmptyTitle,{children:n("noOptions")})})})]}),(0,l.jsx)(R.TabsContent,{className:"min-h-0",value:"outline",children:(0,l.jsx)(P.ScrollArea,{className:"-mr-2 h-full",children:(0,l.jsx)(F.ItemGroup,{className:"gap-1 pr-2 pb-1",children:[...K.triggers,...K.nodes].map(e=>(0,l.jsx)(F.Item,{asChild:!0,className:"px-1.5 py-1",size:"xs",variant:e.id===ea?"muted":"outline",children:(0,l.jsx)("button",{"aria-current":e.id===ea,onClick:()=>er(e.id),type:"button",children:(0,l.jsxs)(F.ItemContent,{children:[(0,l.jsx)(F.ItemTitle,{children:e.name??c.kind(e.kind)}),(0,l.jsx)(F.ItemDescription,{children:c.kind(e.kind)})]})})},e.id))})})})]})]})}),(0,l.jsxs)("div",{className:"min-w-0 space-y-3",children:[eV?(0,l.jsx)(e8.WorkflowGraph,{categories:eH,definition:K,diagnostics:ek,onNodeClick:e=>eU(e),selectedNodeId:eG}):(0,l.jsxs)("div",{className:"relative h-[min(78vh,860px)] min-h-[520px] overflow-hidden rounded-xl border bg-muted/20",onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDrop:e=>{e.preventDefault();let l=e.dataTransfer.getData("application/aide-workflow-step"),t=X.steps.find(e=>e.kind===l);t&&ei&&e5(t,ei.screenToFlowPosition({x:e.clientX,y:e.clientY}))},ref:M,children:[en&&(0,l.jsxs)(w.Button,{className:"absolute top-3 right-3 z-10 shadow-md",onClick:()=>lg([en]),size:"sm",variant:"destructive",children:[(0,l.jsx)(f.Trash2,{})," ",n("deleteConnection")]}),(0,l.jsx)(e8.WorkflowNodeActionsContext,{value:lx,children:(0,l.jsxs)(t.ReactFlow,{className:eM?e7.workflowFitLockPaneClass:void 0,colorMode:"system",deleteKeyCode:["Backspace","Delete"],edges:ee,fitView:!0,nodeTypes:e8.workflowNodeTypes,nodes:lT,onConnect:lm,onEdgeClick:(e,l)=>{er(null),eo(l.id)},onEdgesChange:lf,onInit:e=>es(e),onNodeClick:(e,l)=>{let t;eo(null),void 0!==(t=e.nativeEvent.pointerType)&&"mouse"!==t&&er(l.id)},onNodeDoubleClick:(e,l)=>{eo(null),er(l.id)},onNodeDragStop:(e,l)=>{_(e=>({...e,nodes:e.nodes.map(e=>e.id===l.id?{...e,position:l.position}:e),triggers:e.triggers.map(e=>e.id===l.id?{...e,position:l.position}:e)}))},onNodesChange:Z,onNodesDelete:e=>ld(e.map(({id:e})=>e)),onPaneClick:()=>eo(null),panOnDrag:!eM,preventScrolling:!eM,proOptions:{hideAttribution:!0},zoomOnDoubleClick:!1,zoomOnPinch:!eM,zoomOnScroll:!eM,children:[(0,l.jsx)(t.Background,{gap:20,size:1}),(0,l.jsxs)(t.Controls,{className:"overflow-hidden rounded-lg",showFitView:!eM,showInteractive:!1,showZoom:!eM,children:[(0,l.jsx)(e7.WorkflowFitLockButton,{locked:eM,onToggle:()=>e$(e=>!e)}),(0,l.jsx)(lr,{}),(0,l.jsx)(ln,{onToggle:()=>eB(e=>!e),shown:eq})]}),(0,l.jsx)(e7.WorkflowFitLock,{locked:eM,signature:lI}),!eM&&(0,l.jsx)(t.MiniMap,{className:"overflow-hidden rounded-xl border",maskColor:"transparent",nodeBorderRadius:e8.MINIMAP_NODE_RADIUS,pannable:!0,zoomable:!0})]})})]}),ek.length>0&&(0,l.jsxs)(k.Card,{children:[(0,l.jsx)(k.CardHeader,{children:(0,l.jsx)(k.CardTitle,{children:n("diagnostics")})}),(0,l.jsx)(k.CardContent,{children:(0,l.jsx)(F.ItemGroup,{className:"gap-2",children:ek.map((e,t)=>(0,l.jsx)(F.Item,{asChild:!0,size:"sm",variant:"outline",children:(0,l.jsxs)("button",{className:"text-left",onClick:()=>(eV?eU:er)(e.nodeId??e.triggerId),type:"button",children:[(0,l.jsx)(F.ItemContent,{children:(0,l.jsx)(F.ItemTitle,{children:e.message})}),(0,l.jsx)(F.ItemActions,{children:(0,l.jsx)(y.Badge,{variant:"ERROR"===e.severity?"destructive":"outline",children:c.diagnosticCode(e.code)})})]})},`${e.code}-${t}`))})})]})]})]}),(0,l.jsx)(S.Dialog,{onOpenChange:ed,open:ec,children:(0,l.jsxs)(S.DialogContent,{className:"sm:max-w-2xl",children:[(0,l.jsxs)(S.DialogHeader,{children:[(0,l.jsx)(S.DialogTitle,{children:n("workflowSettings")}),(0,l.jsx)(S.DialogDescription,{children:n("editorDescription")})]}),(0,l.jsxs)(I.FieldGroup,{className:"gap-5",children:[(0,l.jsxs)(I.FieldSet,{children:[(0,l.jsx)(I.FieldLegend,{variant:"label",children:n("detailsSection")}),(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-name",children:n("name")}),(0,l.jsx)(T.Input,{id:"workflow-name",onChange:e=>_(l=>({...l,name:e.target.value})),value:K.name})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-description",children:n("description")}),(0,l.jsx)(W.Textarea,{id:"workflow-description",onChange:e=>_(l=>({...l,description:e.target.value})),value:K.description})]})]})]}),(0,l.jsxs)(I.FieldSet,{children:[(0,l.jsx)(I.FieldLegend,{variant:"label",children:n("runningSection")}),(0,l.jsx)(I.FieldDescription,{children:n("runningSectionHelp")}),(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-overlap-policy",children:n("overlapPolicy")}),(0,l.jsxs)(O.Select,{onValueChange:eN,value:eS,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-overlap-policy",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"QUEUE",children:n("overlap.QUEUE")}),(0,l.jsx)(O.SelectItem,{value:"CONCURRENT",children:n("overlap.CONCURRENT")}),(0,l.jsx)(O.SelectItem,{value:"COALESCE_LATEST",children:n("overlap.COALESCE_LATEST")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`overlapHelp.${eS}`)})]}),"CONCURRENT"===eS&&(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-concurrency",children:n("maxConcurrentRuns")}),(0,l.jsx)(T.Input,{id:"workflow-concurrency",max:32,min:1,onChange:e=>eO(Number(e.target.value)),type:"number",value:eF}),(0,l.jsx)(I.FieldDescription,{children:n("maxConcurrentRunsHelp")})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-overlap-scope",children:n("overlapScope")}),(0,l.jsxs)(O.Select,{onValueChange:eE,value:eT,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-overlap-scope",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"WORKTREE",children:n("overlapScopes.WORKTREE")}),(0,l.jsx)(O.SelectItem,{value:"GLOBAL",children:n("overlapScopes.GLOBAL")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`overlapScopeHelp.${eT}`)})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-worktree-concurrency",children:n("worktreeConcurrency")}),(0,l.jsxs)(O.Select,{onValueChange:e=>{eD(e),eW("EXCLUSIVE"===e)},value:eL,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-worktree-concurrency",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"EXCLUSIVE",children:n("worktreeConcurrencyModes.EXCLUSIVE")}),(0,l.jsx)(O.SelectItem,{value:"NON_EXCLUSIVE",children:n("worktreeConcurrencyModes.NON_EXCLUSIVE")}),(0,l.jsx)(O.SelectItem,{value:"EXCLUDED",children:n("worktreeConcurrencyModes.EXCLUDED")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`worktreeConcurrencyHelp.${eL}`)})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,l.jsx)(C.Checkbox,{checked:"EXCLUSIVE"===eL||eR,disabled:"EXCLUSIVE"===eL,onCheckedChange:e=>eW(!0===e)}),n("blocksGitOperations")]}),(0,l.jsx)(I.FieldDescription,{children:n("EXCLUSIVE"===eL?"blocksGitOperationsExclusiveHelp":"blocksGitOperationsHelp")})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,l.jsx)(C.Checkbox,{checked:eA,onCheckedChange:e=>eP(!0===e)}),n("completionNotifications")]}),(0,l.jsx)(I.FieldDescription,{children:n("completionNotificationsHelp")})]})]})]}),(0,l.jsxs)(I.FieldSet,{children:[(0,l.jsx)(I.FieldLegend,{variant:"label",children:n("canvasSection")}),(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-display-layout",children:n("displayLayout")}),(0,l.jsxs)(O.Select,{onValueChange:e=>{e2({...K,editor:{...K.editor,displayLayout:e}}),"REGULAR"===e&&(ez(!1),eU(null))},value:lO,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-display-layout",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"REGULAR",children:n("displayLayouts.REGULAR")}),(0,l.jsx)(O.SelectItem,{value:"BASIC",children:n("displayLayouts.BASIC")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`displayLayoutHelp.${lO}`)})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-handle-layout",children:n("connectorLayout")}),(0,l.jsxs)(O.Select,{onValueChange:e=>e2({...K,editor:{...K.editor,handleLayout:e}}),value:K.editor.handleLayout??"SIDES",children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-handle-layout",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"SIDES",children:n("connectorLayouts.SIDES")}),(0,l.jsx)(O.SelectItem,{value:"TOP_BOTTOM",children:n("connectorLayouts.TOP_BOTTOM")})]})]})]})]})]}),(0,l.jsx)(w.Button,{className:"w-full",onClick:()=>void lv(),variant:"outline",children:n("validate")})]})]})}),(0,l.jsx)(L.Sheet,{onOpenChange:e=>{e||er(null)},open:!!eQ,children:(0,l.jsx)(L.SheetContent,{className:"overflow-y-auto sm:max-w-lg",children:eQ&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(L.SheetHeader,{children:[(0,l.jsx)(L.SheetTitle,{children:eQ.name??c.kind(eQ.kind)}),(0,l.jsx)(L.SheetDescription,{children:eY?.description??c.kind(eQ.kind)})]}),(0,l.jsxs)(I.FieldGroup,{className:"gap-4 px-4",children:[eY&&(0,l.jsx)("p",{className:"rounded-lg border bg-muted/30 p-3 text-xs leading-relaxed text-muted-foreground",children:eY.details}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"node-name",children:n("name")}),(0,l.jsx)(T.Input,{id:"node-name",onChange:e=>lC({name:e.target.value}),value:eQ.name??""})]}),(0,eI.hasConfigDescriptor)(eQ.kind,eX?"step":"trigger")?(0,l.jsx)(e6,{config:eQ.config,kind:eQ.kind,onChange:e=>lC({config:e}),scope:eX?"step":"trigger",sessionPaths:e0},eQ.id):(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldTitle,{children:n("configuration")}),(0,l.jsx)(e3,{config:eQ.config,defaultOpen:!0,onChange:e=>lC({config:e})})]},eQ.id),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldTitle,{children:eX?n("addsToSession"):n("seedsSession")}),e1.length>0?(0,l.jsx)(F.ItemGroup,{className:"gap-1 rounded-lg border bg-muted/30 p-2",children:e1.map(e=>(0,l.jsx)(F.Item,{className:"px-1 py-0",size:"xs",children:(0,l.jsxs)(F.ItemContent,{children:[(0,l.jsx)(F.ItemTitle,{children:(0,l.jsx)("code",{className:"text-[11px]",children:e.path})}),e.description&&(0,l.jsx)(F.ItemDescription,{className:"text-[10px]",children:e.description})]})},e.path))}):(0,l.jsx)(N.Empty,{className:"py-6",children:(0,l.jsx)(N.EmptyHeader,{children:(0,l.jsx)(N.EmptyTitle,{children:n("addsToSessionEmpty")})})})]}),eX&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"required-paths",children:n("requiredPaths")}),(0,l.jsx)(T.Input,{id:"required-paths",onChange:e=>lC({requiredPaths:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}),value:eX.requiredPaths.join(", ")})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"provided-paths",children:n("providedPaths")}),(0,l.jsx)(T.Input,{id:"provided-paths",onChange:e=>lC({providedPaths:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}),value:eX.providedPaths.join(", ")})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"retry-count",children:n("maxAttempts")}),(0,l.jsx)(T.Input,{id:"retry-count",max:20,min:1,onChange:e=>lC({retry:{...eX.retry,maxAttempts:Number(e.target.value)}}),type:"number",value:eX.retry.maxAttempts})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"failure-policy",children:n("failurePolicy")}),(0,l.jsxs)(O.Select,{onValueChange:e=>lC({failurePolicy:e}),value:eX.failurePolicy,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"failure-policy",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"FAIL",children:n("failure.FAIL")}),(0,l.jsx)(O.SelectItem,{value:"CONTINUE",children:n("failure.CONTINUE")})]})]})]})]}),X.steps.find(({kind:e})=>e===eX.kind)?.mutatesExternal&&(0,l.jsx)(b.Alert,{variant:"destructive",children:(0,l.jsx)(b.AlertDescription,{children:n("idempotencyWarning")})})]})]}),(0,l.jsxs)(L.SheetFooter,{children:[eX&&(0,l.jsxs)(w.Button,{onClick:lp,variant:"outline",children:[(0,l.jsx)(i.Copy,{})," ",n("duplicateNode")]}),(0,l.jsxs)(w.Button,{onClick:()=>ld([eQ.id]),variant:"destructive",children:[(0,l.jsx)(f.Trash2,{})," ",n("deleteNode")]})]})]})})}),(0,l.jsx)(ll.WorkflowReadonlyInspector,{catalog:X,definition:K,onOpenChange:e=>{e||eU(null)},selectedId:eV?eG:null})]}):(0,l.jsx)(b.Alert,{variant:"destructive",children:(0,l.jsx)(b.AlertDescription,{children:ev})})}e.s(["WorkflowEditor",0,function(e){return(0,l.jsx)(t.ReactFlowProvider,{children:(0,l.jsx)(lo,{...e})})}],106134)}]);
|
|
72
|
+
}`,{id:U.id});eC(e.validateWorkflowDraft.diagnostics),e_(K,e.validateWorkflowDraft.diagnostics),ew(e.validateWorkflowDraft.valid?n("validationPassed"):n("validationFailed"))}catch(e){eb(e instanceof Error?e.message:String(e))}},lb=async()=>{if(!U)return void eb(n("saveBeforePublish"));ej(!0);try{if(!await lj())return;await (0,B.controlPlaneRequest)("mutation PublishWorkflow($id: ID!) { publishWorkflow(id: $id) { id version contentHash } }",{id:U.id}),ew(n("published")),d.push(`/workflows/${U.id}`)}catch(e){eb(e instanceof Error?e.message:String(e))}finally{ej(!1)}},ly=async()=>{try{let e=await (0,B.controlPlaneRequest)("mutation DuplicateWorkflow($input: CreateWorkflowInput!) { createWorkflow(input: $input) { id } }",{input:{name:`${K.name} copy`,description:K.description,definition:{...K,name:`${K.name} copy`},overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:eP,blocksGitOperations:eR}});d.push(`/workflows/${e.createWorkflow.id}/edit`)}catch(e){eb(e instanceof Error?e.message:String(e))}},lw=async()=>{try{let e=U?(await (0,B.controlPlaneRequest)("query ExportWorkflow($id: ID!) { exportWorkflow(id: $id) }",{id:U.id})).exportWorkflow:{format:"aide.workflow.export",schemaVersion:1,workflow:{name:K.name,description:K.description,overlapPolicy:eS,overlapScope:eT,maxConcurrentRuns:eF,completionNotificationsEnabled:eA,worktreeConcurrency:eP,blocksGitOperations:eR,definition:K}};(0,q.downloadJson)(e,`${(0,q.exportFileStem)(K.name)}.workflow.json`)}catch(e){eb(e instanceof Error?e.message:String(e))}},lk=async e=>{try{let l=JSON.parse(await e.text()),t="aide.workflow.export"===l.format&&l.workflow&&"object"==typeof l.workflow?l.workflow.definition:l;if(!t||"object"!=typeof t)throw Error(n("invalidImport"));ez(!1),eU(null),_(t),e_(t),ew(n("importLoaded"))}catch(e){eb(e instanceof Error?e.message:String(e))}},lC=e=>{e2({...K,nodes:K.nodes.map(l=>l.id===ea?{...l,...e}:l),triggers:K.triggers.map(l=>l.id===ea?{...l,...e}:l)})},lS=(0,v.useMemo)(()=>X?.steps.filter(e=>`${e.label} ${e.kind} ${e.category} ${e.description}`.toLowerCase().includes(eh.toLowerCase()))??[],[X,eh]),lN=(0,v.useMemo)(()=>X?.triggers.filter(e=>`${e.label} ${e.kind} ${e.category} ${e.description}`.toLowerCase().includes(eh.toLowerCase()))??[],[X,eh]),lI=(0,v.useMemo)(()=>`${K.triggers.map(({id:e})=>e).join()}|${K.nodes.map(({id:e})=>e).join()}|${K.edges.map(({id:e})=>e).join()}|${K.editor.handleLayout??"SIDES"}|${eq}`,[K,eq]),lT=(0,v.useMemo)(()=>eq?Q:Q.map(e=>e.data.provides.length?{...e,data:{...e.data,provides:[]}}:e),[Q,eq]),lE=(0,v.useMemo)(()=>[...ls(lS)],[lS]),lF=(0,v.useMemo)(()=>[...ls(lN)],[lN]),lO=K.editor.displayLayout??"REGULAR";return em?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(A.Skeleton,{className:"h-8 w-52"}),(0,l.jsx)(A.Skeleton,{className:"h-4 w-96"})]}),(0,l.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[280px_minmax(0,1fr)]",children:[(0,l.jsx)(A.Skeleton,{className:"h-[min(78vh,860px)] min-h-[520px]"}),(0,l.jsx)(A.Skeleton,{className:"h-[min(78vh,860px)] min-h-[520px]"})]})]}):X?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,l.jsx)("div",{className:"flex min-w-0 items-start gap-2",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:n("editor")}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:n("editorDescription")})]})}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)("input",{accept:"application/json,.json",className:"hidden",onChange:e=>{let l=e.target.files?.[0];l&&lk(l),e.target.value=""},ref:G,type:"file"}),(0,l.jsxs)(w.Button,{onClick:()=>ed(!0),variant:"outline",children:[(0,l.jsx)(m.Settings,{})," ",n("settings")]}),"BASIC"===lO&&(0,l.jsxs)(w.Button,{"aria-pressed":eV,onClick:()=>{ez(e=>!e),er(null),eo(null),eU(null)},variant:eV?"secondary":"outline",children:[eV?(0,l.jsx)(r.EyeOff,{}):(0,l.jsx)(a.Eye,{}),eV?n("exitBasicPreview"):n("previewBasicLayout")]}),(0,l.jsxs)(w.Button,{onClick:()=>G.current?.click(),variant:"outline",children:[(0,l.jsx)(g.Upload,{})," ",n("import")]}),(0,l.jsxs)(w.Button,{onClick:()=>void lw(),variant:"outline",children:[(0,l.jsx)(s.Download,{})," ",n("export")]}),U&&(0,l.jsxs)(w.Button,{onClick:()=>void ly(),variant:"outline",children:[(0,l.jsx)(i.Copy,{})," ",n("duplicate")]}),(0,l.jsxs)(w.Button,{disabled:eg,onClick:()=>void lj(),variant:"outline",children:[eg?(0,l.jsx)(D.Spinner,{}):(0,l.jsx)(h.Save,{})," ",n("saveDraft")]}),(0,l.jsxs)(w.Button,{disabled:eg,onClick:()=>void lb(),children:[(0,l.jsx)(x.Send,{})," ",n("publish")]})]})]}),ev&&(0,l.jsx)(b.Alert,{variant:"destructive",children:(0,l.jsx)(b.AlertDescription,{children:ev})}),ey&&(0,l.jsx)(b.Alert,{children:(0,l.jsx)(b.AlertDescription,{children:ey})}),(0,l.jsxs)("div",{className:"grid gap-4 xl:grid-cols-[280px_minmax(0,1fr)]",children:[(0,l.jsx)(k.Card,{"aria-disabled":eV,className:`flex h-[min(78vh,860px)] min-h-[520px] flex-col gap-0 py-0 ${eV?"pointer-events-none opacity-60":""}`,size:"sm",children:(0,l.jsxs)(R.Tabs,{className:"flex min-h-0 flex-1 gap-0",onValueChange:e=>ep(e),value:eu,children:[(0,l.jsx)("div",{className:"border-b p-2",children:(0,l.jsxs)(R.TabsList,{className:"w-full",children:[(0,l.jsx)(R.TabsTrigger,{value:"palette",children:n("steps")}),(0,l.jsx)(R.TabsTrigger,{value:"outline",children:n("outline")})]})}),(0,l.jsxs)(k.CardContent,{className:"flex min-h-0 flex-1 flex-col p-2",children:[(0,l.jsxs)(R.TabsContent,{className:"flex min-h-0 flex-1 flex-col gap-2",value:"palette",children:[(0,l.jsxs)(E.InputGroup,{children:[(0,l.jsx)(E.InputGroupAddon,{children:(0,l.jsx)(p.Search,{})}),(0,l.jsx)(E.InputGroupInput,{"aria-label":n("searchSteps"),onChange:e=>ex(e.target.value),placeholder:n("searchSteps"),value:eh})]}),lE.length||lF.length?(0,l.jsx)(L.ScrollArea,{className:"-mr-2 min-h-0 flex-1",children:(0,l.jsxs)("div",{className:"space-y-3 pr-2 pb-1",children:[lE.map(([e,t])=>(0,l.jsxs)("section",{children:[(0,l.jsx)("div",{className:"px-1 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",children:e}),(0,l.jsx)(F.ItemGroup,{className:"gap-1",children:t.map(e=>(0,l.jsx)(la,{details:e.details,children:(0,l.jsxs)("button",{className:"cursor-grab text-left",draggable:!0,onClick:()=>e5(e),onDragStart:l=>{l.dataTransfer.setData("application/aide-workflow-step",e.kind),l.dataTransfer.effectAllowed="copy"},type:"button",children:[(0,l.jsx)(F.ItemMedia,{children:(0,l.jsx)(o,{className:"size-3.5 text-muted-foreground"})}),(0,l.jsxs)(F.ItemContent,{className:"min-w-0",children:[(0,l.jsx)(F.ItemTitle,{className:"text-xs",children:e.label}),(0,l.jsx)(F.ItemDescription,{className:"line-clamp-2 text-[10px] leading-snug",children:e.description})]}),(0,l.jsxs)(F.ItemActions,{className:"flex-col items-end gap-0.5",children:[(0,l.jsx)(y.Badge,{className:"text-[9px]",variant:"outline",children:e.execution}),(e.mutatesExternal||e.mutatesWorktree)&&(0,l.jsx)(y.Badge,{className:"text-[9px]",variant:"outline",children:n("mutates")})]})]})},e.kind))})]},`step:${e}`)),lF.map(([e,t])=>(0,l.jsxs)("section",{children:[(0,l.jsxs)("div",{className:"px-1 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",children:[n("triggers")," · ",e]}),(0,l.jsx)(F.ItemGroup,{className:"gap-1",children:t.map(e=>(0,l.jsx)(la,{details:e.details,children:(0,l.jsxs)("button",{className:"text-left",onClick:()=>lc(e),type:"button",children:[(0,l.jsx)(F.ItemMedia,{children:(0,l.jsx)(u.Plus,{className:"size-3.5 text-muted-foreground"})}),(0,l.jsxs)(F.ItemContent,{className:"min-w-0",children:[(0,l.jsx)(F.ItemTitle,{className:"text-xs",children:e.label}),(0,l.jsx)(F.ItemDescription,{className:"line-clamp-2 text-[10px] leading-snug",children:e.description})]})]})},e.kind))})]},`trigger:${e}`))]})}):(0,l.jsx)(N.Empty,{className:"py-10",children:(0,l.jsx)(N.EmptyHeader,{children:(0,l.jsx)(N.EmptyTitle,{children:n("noOptions")})})})]}),(0,l.jsx)(R.TabsContent,{className:"min-h-0",value:"outline",children:(0,l.jsx)(L.ScrollArea,{className:"-mr-2 h-full",children:(0,l.jsx)(F.ItemGroup,{className:"gap-1 pr-2 pb-1",children:[...K.triggers,...K.nodes].map(e=>(0,l.jsx)(F.Item,{asChild:!0,className:"px-1.5 py-1",size:"xs",variant:e.id===ea?"muted":"outline",children:(0,l.jsx)("button",{"aria-current":e.id===ea,onClick:()=>er(e.id),type:"button",children:(0,l.jsxs)(F.ItemContent,{children:[(0,l.jsx)(F.ItemTitle,{children:e.name??c.kind(e.kind)}),(0,l.jsx)(F.ItemDescription,{children:c.kind(e.kind)})]})})},e.id))})})})]})]})}),(0,l.jsxs)("div",{className:"min-w-0 space-y-3",children:[eV?(0,l.jsx)(e8.WorkflowGraph,{categories:eH,definition:K,diagnostics:ek,onNodeClick:e=>eU(e),selectedNodeId:eG}):(0,l.jsxs)("div",{className:"relative h-[min(78vh,860px)] min-h-[520px] overflow-hidden rounded-xl border bg-muted/20",onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"},onDrop:e=>{e.preventDefault();let l=e.dataTransfer.getData("application/aide-workflow-step"),t=X.steps.find(e=>e.kind===l);t&&ei&&e5(t,ei.screenToFlowPosition({x:e.clientX,y:e.clientY}))},ref:M,children:[en&&(0,l.jsxs)(w.Button,{className:"absolute top-3 right-3 z-10 shadow-md",onClick:()=>lg([en]),size:"sm",variant:"destructive",children:[(0,l.jsx)(f.Trash2,{})," ",n("deleteConnection")]}),(0,l.jsx)(e8.WorkflowNodeActionsContext,{value:lx,children:(0,l.jsxs)(t.ReactFlow,{className:eM?e7.workflowFitLockPaneClass:void 0,colorMode:"system",deleteKeyCode:["Backspace","Delete"],edges:ee,fitView:!0,nodeTypes:e8.workflowNodeTypes,nodes:lT,onConnect:lm,onEdgeClick:(e,l)=>{er(null),eo(l.id)},onEdgesChange:lf,onInit:e=>es(e),onNodeClick:(e,l)=>{let t;eo(null),void 0!==(t=e.nativeEvent.pointerType)&&"mouse"!==t&&er(l.id)},onNodeDoubleClick:(e,l)=>{eo(null),er(l.id)},onNodeDragStop:(e,l)=>{_(e=>({...e,nodes:e.nodes.map(e=>e.id===l.id?{...e,position:l.position}:e),triggers:e.triggers.map(e=>e.id===l.id?{...e,position:l.position}:e)}))},onNodesChange:Z,onNodesDelete:e=>ld(e.map(({id:e})=>e)),onPaneClick:()=>eo(null),panOnDrag:!eM,preventScrolling:!eM,proOptions:{hideAttribution:!0},zoomOnDoubleClick:!1,zoomOnPinch:!eM,zoomOnScroll:!eM,children:[(0,l.jsx)(t.Background,{gap:20,size:1}),(0,l.jsxs)(t.Controls,{className:"overflow-hidden rounded-lg",showFitView:!eM,showInteractive:!1,showZoom:!eM,children:[(0,l.jsx)(e7.WorkflowFitLockButton,{locked:eM,onToggle:()=>e$(e=>!e)}),(0,l.jsx)(lr,{}),(0,l.jsx)(ln,{onToggle:()=>eB(e=>!e),shown:eq})]}),(0,l.jsx)(e7.WorkflowFitLock,{locked:eM,signature:lI}),!eM&&(0,l.jsx)(t.MiniMap,{className:"overflow-hidden rounded-xl border",maskColor:"transparent",nodeBorderRadius:e8.MINIMAP_NODE_RADIUS,pannable:!0,zoomable:!0})]})})]}),ek.length>0&&(0,l.jsxs)(k.Card,{children:[(0,l.jsx)(k.CardHeader,{children:(0,l.jsx)(k.CardTitle,{children:n("diagnostics")})}),(0,l.jsx)(k.CardContent,{children:(0,l.jsx)(F.ItemGroup,{className:"gap-2",children:ek.map((e,t)=>(0,l.jsx)(F.Item,{asChild:!0,size:"sm",variant:"outline",children:(0,l.jsxs)("button",{className:"text-left",onClick:()=>(eV?eU:er)(e.nodeId??e.triggerId),type:"button",children:[(0,l.jsx)(F.ItemContent,{children:(0,l.jsx)(F.ItemTitle,{children:e.message})}),(0,l.jsx)(F.ItemActions,{children:(0,l.jsx)(y.Badge,{variant:"ERROR"===e.severity?"destructive":"outline",children:c.diagnosticCode(e.code)})})]})},`${e.code}-${t}`))})})]})]})]}),(0,l.jsx)(S.Dialog,{onOpenChange:ed,open:ec,children:(0,l.jsxs)(S.DialogContent,{className:"sm:max-w-2xl",children:[(0,l.jsxs)(S.DialogHeader,{children:[(0,l.jsx)(S.DialogTitle,{children:n("workflowSettings")}),(0,l.jsx)(S.DialogDescription,{children:n("editorDescription")})]}),(0,l.jsxs)(I.FieldGroup,{className:"gap-5",children:[(0,l.jsxs)(I.FieldSet,{children:[(0,l.jsx)(I.FieldLegend,{variant:"label",children:n("detailsSection")}),(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-name",children:n("name")}),(0,l.jsx)(T.Input,{id:"workflow-name",onChange:e=>_(l=>({...l,name:e.target.value})),value:K.name})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-description",children:n("description")}),(0,l.jsx)(W.Textarea,{id:"workflow-description",onChange:e=>_(l=>({...l,description:e.target.value})),value:K.description})]})]})]}),(0,l.jsxs)(I.FieldSet,{children:[(0,l.jsx)(I.FieldLegend,{variant:"label",children:n("runningSection")}),(0,l.jsx)(I.FieldDescription,{children:n("runningSectionHelp")}),(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-overlap-policy",children:n("overlapPolicy")}),(0,l.jsxs)(O.Select,{onValueChange:eN,value:eS,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-overlap-policy",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"QUEUE",children:n("overlap.QUEUE")}),(0,l.jsx)(O.SelectItem,{value:"CONCURRENT",children:n("overlap.CONCURRENT")}),(0,l.jsx)(O.SelectItem,{value:"COALESCE_LATEST",children:n("overlap.COALESCE_LATEST")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`overlapHelp.${eS}`)})]}),"CONCURRENT"===eS&&(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-concurrency",children:n("maxConcurrentRuns")}),(0,l.jsx)(T.Input,{id:"workflow-concurrency",max:32,min:1,onChange:e=>eO(Number(e.target.value)),type:"number",value:eF}),(0,l.jsx)(I.FieldDescription,{children:n("maxConcurrentRunsHelp")})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-overlap-scope",children:n("overlapScope")}),(0,l.jsxs)(O.Select,{onValueChange:eE,value:eT,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-overlap-scope",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"WORKTREE",children:n("overlapScopes.WORKTREE")}),(0,l.jsx)(O.SelectItem,{value:"GLOBAL",children:n("overlapScopes.GLOBAL")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`overlapScopeHelp.${eT}`)})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-worktree-concurrency",children:n("worktreeConcurrency")}),(0,l.jsxs)(O.Select,{onValueChange:e=>{eD(e),eW("EXCLUSIVE"===e)},value:eP,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-worktree-concurrency",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"EXCLUSIVE",children:n("worktreeConcurrencyModes.EXCLUSIVE")}),(0,l.jsx)(O.SelectItem,{value:"NON_EXCLUSIVE",children:n("worktreeConcurrencyModes.NON_EXCLUSIVE")}),(0,l.jsx)(O.SelectItem,{value:"EXCLUDED",children:n("worktreeConcurrencyModes.EXCLUDED")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`worktreeConcurrencyHelp.${eP}`)})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,l.jsx)(C.Checkbox,{checked:"EXCLUSIVE"===eP||eR,disabled:"EXCLUSIVE"===eP,onCheckedChange:e=>eW(!0===e)}),n("blocksGitOperations")]}),(0,l.jsx)(I.FieldDescription,{children:n("EXCLUSIVE"===eP?"blocksGitOperationsExclusiveHelp":"blocksGitOperationsHelp")})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,l.jsx)(C.Checkbox,{checked:eA,onCheckedChange:e=>eL(!0===e)}),n("completionNotifications")]}),(0,l.jsx)(I.FieldDescription,{children:n("completionNotificationsHelp")})]})]})]}),(0,l.jsxs)(I.FieldSet,{children:[(0,l.jsx)(I.FieldLegend,{variant:"label",children:n("canvasSection")}),(0,l.jsxs)(I.FieldGroup,{className:"gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-display-layout",children:n("displayLayout")}),(0,l.jsxs)(O.Select,{onValueChange:e=>{e2({...K,editor:{...K.editor,displayLayout:e}}),"REGULAR"===e&&(ez(!1),eU(null))},value:lO,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-display-layout",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"REGULAR",children:n("displayLayouts.REGULAR")}),(0,l.jsx)(O.SelectItem,{value:"BASIC",children:n("displayLayouts.BASIC")})]})]}),(0,l.jsx)(I.FieldDescription,{children:n(`displayLayoutHelp.${lO}`)})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"workflow-handle-layout",children:n("connectorLayout")}),(0,l.jsxs)(O.Select,{onValueChange:e=>e2({...K,editor:{...K.editor,handleLayout:e}}),value:K.editor.handleLayout??"SIDES",children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"workflow-handle-layout",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"SIDES",children:n("connectorLayouts.SIDES")}),(0,l.jsx)(O.SelectItem,{value:"TOP_BOTTOM",children:n("connectorLayouts.TOP_BOTTOM")})]})]})]})]})]}),(0,l.jsx)(w.Button,{className:"w-full",onClick:()=>void lv(),variant:"outline",children:n("validate")})]})]})}),(0,l.jsx)(P.Sheet,{onOpenChange:e=>{e||er(null)},open:!!eQ,children:(0,l.jsx)(P.SheetContent,{className:"overflow-y-auto sm:max-w-lg",children:eQ&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(P.SheetHeader,{children:[(0,l.jsx)(P.SheetTitle,{children:eQ.name??c.kind(eQ.kind)}),(0,l.jsx)(P.SheetDescription,{children:eY?.description??c.kind(eQ.kind)})]}),(0,l.jsxs)(I.FieldGroup,{className:"gap-4 px-4",children:[eY&&(0,l.jsx)("p",{className:"rounded-lg border bg-muted/30 p-3 text-xs leading-relaxed text-muted-foreground",children:eY.details}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"node-name",children:n("name")}),(0,l.jsx)(T.Input,{id:"node-name",onChange:e=>lC({name:e.target.value}),value:eQ.name??""})]}),(0,eI.hasConfigDescriptor)(eQ.kind,eX?"step":"trigger")?(0,l.jsx)(e6,{config:eQ.config,kind:eQ.kind,onChange:e=>lC({config:e}),scope:eX?"step":"trigger",sessionPaths:e0},eQ.id):(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldTitle,{children:n("configuration")}),(0,l.jsx)(e3,{config:eQ.config,defaultOpen:!0,onChange:e=>lC({config:e})})]},eQ.id),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldTitle,{children:eX?n("addsToSession"):n("seedsSession")}),e1.length>0?(0,l.jsx)(F.ItemGroup,{className:"gap-1 rounded-lg border bg-muted/30 p-2",children:e1.map(e=>(0,l.jsx)(F.Item,{className:"px-1 py-0",size:"xs",children:(0,l.jsxs)(F.ItemContent,{children:[(0,l.jsx)(F.ItemTitle,{children:(0,l.jsx)("code",{className:"text-[11px]",children:e.path})}),e.description&&(0,l.jsx)(F.ItemDescription,{className:"text-[10px]",children:e.description})]})},e.path))}):(0,l.jsx)(N.Empty,{className:"py-6",children:(0,l.jsx)(N.EmptyHeader,{children:(0,l.jsx)(N.EmptyTitle,{children:n("addsToSessionEmpty")})})})]}),eX&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"required-paths",children:n("requiredPaths")}),(0,l.jsx)(T.Input,{id:"required-paths",onChange:e=>lC({requiredPaths:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}),value:eX.requiredPaths.join(", ")})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"provided-paths",children:n("providedPaths")}),(0,l.jsx)(T.Input,{id:"provided-paths",onChange:e=>lC({providedPaths:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}),value:eX.providedPaths.join(", ")})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"retry-count",children:n("maxAttempts")}),(0,l.jsx)(T.Input,{id:"retry-count",max:20,min:1,onChange:e=>lC({retry:{...eX.retry,maxAttempts:Number(e.target.value)}}),type:"number",value:eX.retry.maxAttempts})]}),(0,l.jsxs)(I.Field,{children:[(0,l.jsx)(I.FieldLabel,{htmlFor:"failure-policy",children:n("failurePolicy")}),(0,l.jsxs)(O.Select,{onValueChange:e=>lC({failurePolicy:e}),value:eX.failurePolicy,children:[(0,l.jsx)(O.SelectTrigger,{className:"w-full",id:"failure-policy",children:(0,l.jsx)(O.SelectValue,{})}),(0,l.jsxs)(O.SelectContent,{children:[(0,l.jsx)(O.SelectItem,{value:"FAIL",children:n("failure.FAIL")}),(0,l.jsx)(O.SelectItem,{value:"CONTINUE",children:n("failure.CONTINUE")})]})]})]})]}),X.steps.find(({kind:e})=>e===eX.kind)?.mutatesExternal&&(0,l.jsx)(b.Alert,{variant:"destructive",children:(0,l.jsx)(b.AlertDescription,{children:n("idempotencyWarning")})})]})]}),(0,l.jsxs)(P.SheetFooter,{children:[eX&&(0,l.jsxs)(w.Button,{onClick:lp,variant:"outline",children:[(0,l.jsx)(i.Copy,{})," ",n("duplicateNode")]}),(0,l.jsxs)(w.Button,{onClick:()=>ld([eQ.id]),variant:"destructive",children:[(0,l.jsx)(f.Trash2,{})," ",n("deleteNode")]})]})]})})}),(0,l.jsx)(ll.WorkflowReadonlyInspector,{catalog:X,definition:K,onOpenChange:e=>{e||eU(null)},selectedId:eV?eG:null})]}):(0,l.jsx)(b.Alert,{variant:"destructive",children:(0,l.jsx)(b.AlertDescription,{children:ev})})}e.s(["WorkflowEditor",0,function(e){return(0,l.jsx)(t.ReactFlowProvider,{children:(0,l.jsx)(lo,{...e})})}],106134)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,563707,e=>{"use strict";let t=(0,e.i(456420).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],563707)},741120,e=>{"use strict";let t=(0,e.i(456420).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],741120)},856522,e=>{"use strict";let t=(0,e.i(456420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,t],856522)},983913,e=>{"use strict";var t=e.i(843476),a=e.i(563707),s=e.i(271645),i=e.i(519455),r=e.i(317056),l=e.i(906197),n=e.i(337822),c=e.i(975157);e.s(["SearchableSelect",0,function({value:e,onValueChange:o,options:d,placeholder:u,searchPlaceholder:m,emptyMessage:h,ariaLabel:x,disabled:p,className:b,showSelectedDetails:j=!1,allowCustomValue:g=!1}){let[f,v]=(0,s.useState)(!1),[T,C]=(0,s.useState)(""),w=(0,s.useCallback)(e=>{e&&e.addEventListener("wheel",e=>e.stopPropagation())},[]),y=d.find(t=>t.value===e),N=y?.label??(e||u),S=T.trim(),A=g&&S.length>0&&!d.some(e=>e.value.toLowerCase()===S.toLowerCase()||e.label.toLowerCase()===S.toLowerCase());return(0,t.jsxs)(n.Popover,{onOpenChange:e=>{v(e),e||C("")},open:f,children:[(0,t.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(i.Button,{"aria-expanded":f,"aria-label":x,className:(0,c.cn)("min-w-0 w-full justify-between font-normal",j&&y&&"h-auto min-h-8 py-2",b),disabled:p,role:"combobox",type:"button",variant:"outline",children:[j&&y?(0,t.jsxs)("span",{className:"min-w-0 text-left",children:[(0,t.jsx)("span",{className:"block truncate",children:y.label}),y.description&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:y.description}),y.secondaryDescription&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:y.secondaryDescription})]}):(0,t.jsx)("span",{className:"min-w-0 truncate",children:N}),(0,t.jsx)(a.ChevronsUpDown,{className:"shrink-0 opacity-50"})]})}),(0,t.jsx)(n.PopoverContent,{ref:w,align:"start",className:"z-70 max-h-[min(24rem,var(--radix-popover-content-available-height))] w-(--radix-popover-trigger-width) overflow-hidden p-0",children:(0,t.jsxs)(r.Command,{className:"min-h-0",label:m,children:[(0,t.jsx)(r.CommandInput,{"aria-label":m,autoFocus:!0,onValueChange:C,placeholder:m,value:T}),(0,t.jsxs)(r.CommandList,{className:"min-h-0 flex-1 max-h-64 overscroll-contain [scrollbar-width:thin] [&::-webkit-scrollbar]:block [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border",children:[(0,t.jsx)(r.CommandEmpty,{children:h}),(0,t.jsxs)(r.CommandGroup,{children:[A&&(0,t.jsx)(r.CommandItem,{"aria-label":S,onSelect:()=>{o(S),C(""),v(!1)},value:S,children:(0,t.jsx)(l.Item,{className:"min-w-0 flex-1 border-0 p-0",size:"xs",children:(0,t.jsx)(l.ItemContent,{className:"min-w-0",children:(0,t.jsx)(l.ItemTitle,{className:"block truncate",children:S})})})}),d.map(a=>(0,t.jsx)(r.CommandItem,{"aria-label":[a.label,a.description,a.secondaryDescription].filter(Boolean).join(", "),"aria-selected":a.value===e,className:"items-start py-2","data-checked":a.value===e,disabled:a.disabled,keywords:[a.label,a.description??"",a.secondaryDescription??"",a.keywords??""],onSelect:()=>{o(a.value),C(""),v(!1)},value:a.value,children:(0,t.jsx)(l.Item,{className:"min-w-0 flex-1 border-0 p-0",size:"xs",children:(0,t.jsxs)(l.ItemContent,{className:"min-w-0",children:[(0,t.jsx)(l.ItemTitle,{className:"block truncate",children:a.label}),a.description&&(0,t.jsx)(l.ItemDescription,{className:"block truncate",children:a.description}),a.secondaryDescription&&(0,t.jsx)(l.ItemDescription,{className:"block truncate",children:a.secondaryDescription})]})})},a.value))]})]})]})})]})}])},900278,e=>{"use strict";var t=e.i(843476),a=e.i(809584),s=e.i(482022),i=e.i(77071),r=e.i(741120),l=e.i(856522),n=e.i(573474),c=e.i(861745),o=e.i(948148),d=e.i(271645),u=e.i(816484),m=e.i(983913),h=e.i(340953),x=e.i(929592),p=e.i(487486),b=e.i(519455),j=e.i(515288),g=e.i(82612),f=e.i(436589),v=e.i(793479),T=e.i(110204),C=e.i(967489),w=e.i(987968),y=e.i(784774),N=e.i(520133),S=e.i(637611),A=e.i(360583);let L="window total live cache errors averageMs pointsUsed pointsAvoided",E=["ALL","GRAPHQL","REST"],H=["ALL","LIVE","CACHE"],R=["ALL","GITHUB_API","GITHUB_SETTINGS","COMMENTS_PAGE","CODEBASE_REPOSITORY","PULL_REQUESTS_PAGE","PULL_REQUEST_DETAILS","ACTIONS_PAGE","WORKTREES","WORKTREE_PIPELINES","WORKTREE_AUTOMATION","AUTO_RETRY","WORKFLOW_AUTOMATION","ACTIONS_NOTIFICATIONS","CACHE_MANAGEMENT"];function O(e){return"LIVE"===e?"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300":"ERROR"===e?"border-destructive/30 bg-destructive/10 text-destructive":"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"}function k({apiMetrics:e,snapshots:a}){let s=(0,o.useTranslations)("githubCache"),i=a.filter(e=>"graphql"===e.resource),r=a.filter(e=>"graphql"!==e.resource);return(0,t.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,t.jsx)(I,{title:s("graphqlRateTitle"),description:s("graphqlRateDescription"),metrics:e.find(e=>"GRAPHQL"===e.apiType)?.windows??[],snapshots:i}),(0,t.jsx)(I,{title:s("restRateTitle"),description:s("restRateDescription"),metrics:e.find(e=>"REST"===e.apiType)?.windows??[],snapshots:r})]})}function I({title:e,description:a,metrics:s,snapshots:i}){let r=(0,o.useTranslations)("githubCache");return(0,t.jsx)(M,{title:e,description:a,children:(0,t.jsxs)("div",{children:[0===i.length?(0,t.jsx)(q,{children:r("noRateData")}):(0,t.jsx)("div",{className:`grid gap-3 p-4 ${i.length>1?"sm:grid-cols-2":""}`,children:i.map(e=>{let a,s,i=(a=Date.parse(e.resetAt),!Number.isFinite(s=Date.parse(e.observedAt)-(a-36e5))||s<=0||s>=36e5?e.used:Math.max(e.used,Math.round(36e5*e.used/s)));return(0,t.jsx)(j.Card,{children:(0,t.jsxs)(j.CardContent,{children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"font-medium",children:[e.authentication," · ",e.resource]}),(0,t.jsxs)(p.Badge,{variant:"outline",children:[e.remaining," / ",e.limit]})]}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-2 gap-2 text-sm",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("limit")}),(0,t.jsx)("dd",{children:e.limit}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("remaining")}),(0,t.jsx)("dd",{children:e.remaining}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("used")}),(0,t.jsx)("dd",{children:e.used}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("estimated")}),(0,t.jsx)("dd",{className:i>e.limit?"font-medium text-destructive":void 0,children:i}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("reset")}),(0,t.jsx)("dd",{children:(0,t.jsx)(u.DateTime,{value:e.resetAt})}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("resource")}),(0,t.jsx)("dd",{children:e.resource}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("observed")}),(0,t.jsx)("dd",{children:(0,t.jsx)(u.DateTime,{value:e.observedAt})})]})]})},`${e.authentication}-${e.resource}`)})}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 border-t p-4",children:s.map(e=>(0,t.jsx)(D,{metric:e},e.window))})]})})}function D({metric:e}){let s=(0,o.useTranslations)("githubCache");return(0,t.jsx)(j.Card,{children:(0,t.jsxs)(j.CardContent,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-medium",children:e.window}),(0,t.jsx)(a.Database,{className:"size-4 text-muted-foreground"})]}),(0,t.jsx)("p",{className:"mt-3 text-3xl font-semibold",children:e.total}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s("average",{ms:e.averageMs})}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs",children:[(0,t.jsxs)("span",{children:[s("live")," ",e.live]}),(0,t.jsxs)("span",{children:[s("cache")," ",e.cache]}),(0,t.jsxs)("span",{children:[s("errors")," ",e.errors]})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:s("points",{used:e.pointsUsed,avoided:e.pointsAvoided})})]})})}function $({metric:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-medium",children:e.total}),(0,t.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground",children:["L ",e.live," · C ",e.cache," · E ",e.errors," · P"," ",e.pointsUsed,"/",e.pointsAvoided]})]})}function M({title:e,description:a,action:s,children:i}){return(0,t.jsxs)(j.Card,{className:"gap-0 py-0",children:[(0,t.jsxs)(j.CardHeader,{children:[(0,t.jsx)(j.CardTitle,{children:e}),(0,t.jsx)(j.CardDescription,{children:a}),s&&(0,t.jsx)(j.CardAction,{children:s})]}),i]})}function q({children:e}){return(0,t.jsx)(g.Empty,{className:"py-8",children:(0,t.jsx)(g.EmptyHeader,{children:(0,t.jsx)(g.EmptyDescription,{children:e})})})}function B({offset:e,setOffset:a,total:s}){let i=(0,o.useTranslations)("githubCache");return(0,t.jsxs)("div",{className:"flex items-center justify-between border-t p-3 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:i("showing",{start:0===s?0:e+1,end:Math.min(e+50,s),total:s})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(b.Button,{disabled:0===e,onClick:()=>a(Math.max(0,e-50)),size:"sm",variant:"outline",children:i("previous")}),(0,t.jsx)(b.Button,{disabled:e+50>=s,onClick:()=>a(e+50),size:"sm",variant:"outline",children:i("next")})]})]})}e.s(["GitHubCachePage",0,function(){let e=(0,o.useTranslations)("githubCache"),a=(0,o.useTranslations)("common"),j=(0,c.useLocale)(),[g,I]=(0,d.useState)(null),[D,P]=(0,d.useState)("5"),[G,_]=(0,d.useState)(""),[U,z]=(0,d.useState)("60"),[F,V]=(0,d.useState)({}),[K,W]=(0,d.useState)(0),[Q,J]=(0,d.useState)(0),[Y,X]=(0,d.useState)("ALL"),[Z,ee]=(0,d.useState)("ALL"),[et,ea]=(0,d.useState)("ALL"),[es,ei]=(0,d.useState)(!0),[er,el]=(0,d.useState)(null),[en,ec]=(0,d.useState)(null),eo=(0,d.useCallback)(async()=>{ei(!0);try{let e=await (0,S.controlPlaneRequest)(`query GitHubCachePage($limit: Int!, $callOffset: Int!, $entryOffset: Int!, $apiType: GitHubApiType, $requestSource: GitHubRequestSource, $callSource: GitHubCallSource) {
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,563707,e=>{"use strict";let t=(0,e.i(456420).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],563707)},741120,e=>{"use strict";let t=(0,e.i(456420).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],741120)},856522,e=>{"use strict";let t=(0,e.i(456420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,t],856522)},983913,e=>{"use strict";var t=e.i(843476),a=e.i(563707),s=e.i(271645),i=e.i(519455),r=e.i(317056),l=e.i(906197),n=e.i(337822),c=e.i(975157);e.s(["SearchableSelect",0,function({value:e,onValueChange:o,options:d,placeholder:u,searchPlaceholder:m,emptyMessage:h,ariaLabel:x,disabled:p,className:b,showSelectedDetails:j=!1,allowCustomValue:g=!1,clearLabel:f}){let[v,T]=(0,s.useState)(!1),[C,w]=(0,s.useState)(""),y=(0,s.useCallback)(e=>{e&&e.addEventListener("wheel",e=>e.stopPropagation())},[]),N=d.find(t=>t.value===e),S=N?.label??(e||u),A=C.trim(),L=g&&A.length>0&&!d.some(e=>e.value.toLowerCase()===A.toLowerCase()||e.label.toLowerCase()===A.toLowerCase());return(0,t.jsxs)(n.Popover,{onOpenChange:e=>{T(e),e||w("")},open:v,children:[(0,t.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(i.Button,{"aria-expanded":v,"aria-label":x,className:(0,c.cn)("min-w-0 w-full justify-between font-normal",j&&N&&"h-auto min-h-8 py-2",b),disabled:p,role:"combobox",type:"button",variant:"outline",children:[j&&N?(0,t.jsxs)("span",{className:"min-w-0 text-left",children:[(0,t.jsx)("span",{className:"block truncate",children:N.label}),N.description&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:N.description}),N.secondaryDescription&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:N.secondaryDescription})]}):(0,t.jsx)("span",{className:"min-w-0 truncate",children:S}),(0,t.jsx)(a.ChevronsUpDown,{className:"shrink-0 opacity-50"})]})}),(0,t.jsx)(n.PopoverContent,{ref:y,align:"start",className:"z-70 max-h-[min(24rem,var(--radix-popover-content-available-height))] w-(--radix-popover-trigger-width) overflow-hidden p-0",children:(0,t.jsxs)(r.Command,{className:"min-h-0",label:m,children:[(0,t.jsx)(r.CommandInput,{"aria-label":m,autoFocus:!0,onValueChange:w,placeholder:m,value:C}),(0,t.jsxs)(r.CommandList,{className:"min-h-0 flex-1 max-h-64 overscroll-contain [scrollbar-width:thin] [&::-webkit-scrollbar]:block [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border",children:[(0,t.jsx)(r.CommandEmpty,{children:h}),(0,t.jsxs)(r.CommandGroup,{children:[f&&e&&(0,t.jsx)(r.CommandItem,{"aria-label":f,onSelect:()=>{o(""),w(""),T(!1)},value:"__clear_selection__",children:f}),L&&(0,t.jsx)(r.CommandItem,{"aria-label":A,onSelect:()=>{o(A),w(""),T(!1)},value:A,children:(0,t.jsx)(l.Item,{className:"min-w-0 flex-1 border-0 p-0",size:"xs",children:(0,t.jsx)(l.ItemContent,{className:"min-w-0",children:(0,t.jsx)(l.ItemTitle,{className:"block truncate",children:A})})})}),d.map(a=>(0,t.jsx)(r.CommandItem,{"aria-label":[a.label,a.description,a.secondaryDescription].filter(Boolean).join(", "),"aria-selected":a.value===e,className:"items-start py-2","data-checked":a.value===e,disabled:a.disabled,keywords:[a.label,a.description??"",a.secondaryDescription??"",a.keywords??""],onSelect:()=>{o(a.value),w(""),T(!1)},value:a.value,children:(0,t.jsx)(l.Item,{className:"min-w-0 flex-1 border-0 p-0",size:"xs",children:(0,t.jsxs)(l.ItemContent,{className:"min-w-0",children:[(0,t.jsx)(l.ItemTitle,{className:"block truncate",children:a.label}),a.description&&(0,t.jsx)(l.ItemDescription,{className:"block truncate",children:a.description}),a.secondaryDescription&&(0,t.jsx)(l.ItemDescription,{className:"block truncate",children:a.secondaryDescription})]})})},a.value))]})]})]})})]})}])},900278,e=>{"use strict";var t=e.i(843476),a=e.i(809584),s=e.i(482022),i=e.i(77071),r=e.i(741120),l=e.i(856522),n=e.i(573474),c=e.i(861745),o=e.i(948148),d=e.i(271645),u=e.i(816484),m=e.i(983913),h=e.i(340953),x=e.i(929592),p=e.i(487486),b=e.i(519455),j=e.i(515288),g=e.i(82612),f=e.i(436589),v=e.i(793479),T=e.i(110204),C=e.i(967489),w=e.i(987968),y=e.i(784774),N=e.i(520133),S=e.i(637611),A=e.i(360583);let L="window total live cache errors averageMs pointsUsed pointsAvoided",E=["ALL","GRAPHQL","REST"],H=["ALL","LIVE","CACHE"],R=["ALL","GITHUB_API","GITHUB_SETTINGS","COMMENTS_PAGE","CODEBASE_REPOSITORY","PULL_REQUESTS_PAGE","PULL_REQUEST_DETAILS","ACTIONS_PAGE","WORKTREES","WORKTREE_PIPELINES","WORKTREE_AUTOMATION","AUTO_RETRY","WORKFLOW_AUTOMATION","ACTIONS_NOTIFICATIONS","CACHE_MANAGEMENT"];function O(e){return"LIVE"===e?"border-blue-500/30 bg-blue-500/10 text-blue-700 dark:text-blue-300":"ERROR"===e?"border-destructive/30 bg-destructive/10 text-destructive":"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"}function k({apiMetrics:e,snapshots:a}){let s=(0,o.useTranslations)("githubCache"),i=a.filter(e=>"graphql"===e.resource),r=a.filter(e=>"graphql"!==e.resource);return(0,t.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,t.jsx)(I,{title:s("graphqlRateTitle"),description:s("graphqlRateDescription"),metrics:e.find(e=>"GRAPHQL"===e.apiType)?.windows??[],snapshots:i}),(0,t.jsx)(I,{title:s("restRateTitle"),description:s("restRateDescription"),metrics:e.find(e=>"REST"===e.apiType)?.windows??[],snapshots:r})]})}function I({title:e,description:a,metrics:s,snapshots:i}){let r=(0,o.useTranslations)("githubCache");return(0,t.jsx)(M,{title:e,description:a,children:(0,t.jsxs)("div",{children:[0===i.length?(0,t.jsx)(q,{children:r("noRateData")}):(0,t.jsx)("div",{className:`grid gap-3 p-4 ${i.length>1?"sm:grid-cols-2":""}`,children:i.map(e=>{let a,s,i=(a=Date.parse(e.resetAt),!Number.isFinite(s=Date.parse(e.observedAt)-(a-36e5))||s<=0||s>=36e5?e.used:Math.max(e.used,Math.round(36e5*e.used/s)));return(0,t.jsx)(j.Card,{children:(0,t.jsxs)(j.CardContent,{children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"font-medium",children:[e.authentication," · ",e.resource]}),(0,t.jsxs)(p.Badge,{variant:"outline",children:[e.remaining," / ",e.limit]})]}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-2 gap-2 text-sm",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("limit")}),(0,t.jsx)("dd",{children:e.limit}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("remaining")}),(0,t.jsx)("dd",{children:e.remaining}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("used")}),(0,t.jsx)("dd",{children:e.used}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("estimated")}),(0,t.jsx)("dd",{className:i>e.limit?"font-medium text-destructive":void 0,children:i}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("reset")}),(0,t.jsx)("dd",{children:(0,t.jsx)(u.DateTime,{value:e.resetAt})}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("resource")}),(0,t.jsx)("dd",{children:e.resource}),(0,t.jsx)("dt",{className:"text-muted-foreground",children:r("observed")}),(0,t.jsx)("dd",{children:(0,t.jsx)(u.DateTime,{value:e.observedAt})})]})]})},`${e.authentication}-${e.resource}`)})}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 border-t p-4",children:s.map(e=>(0,t.jsx)(D,{metric:e},e.window))})]})})}function D({metric:e}){let s=(0,o.useTranslations)("githubCache");return(0,t.jsx)(j.Card,{children:(0,t.jsxs)(j.CardContent,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-medium",children:e.window}),(0,t.jsx)(a.Database,{className:"size-4 text-muted-foreground"})]}),(0,t.jsx)("p",{className:"mt-3 text-3xl font-semibold",children:e.total}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s("average",{ms:e.averageMs})}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs",children:[(0,t.jsxs)("span",{children:[s("live")," ",e.live]}),(0,t.jsxs)("span",{children:[s("cache")," ",e.cache]}),(0,t.jsxs)("span",{children:[s("errors")," ",e.errors]})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:s("points",{used:e.pointsUsed,avoided:e.pointsAvoided})})]})})}function $({metric:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-medium",children:e.total}),(0,t.jsxs)("span",{className:"ml-2 text-xs text-muted-foreground",children:["L ",e.live," · C ",e.cache," · E ",e.errors," · P"," ",e.pointsUsed,"/",e.pointsAvoided]})]})}function M({title:e,description:a,action:s,children:i}){return(0,t.jsxs)(j.Card,{className:"gap-0 py-0",children:[(0,t.jsxs)(j.CardHeader,{children:[(0,t.jsx)(j.CardTitle,{children:e}),(0,t.jsx)(j.CardDescription,{children:a}),s&&(0,t.jsx)(j.CardAction,{children:s})]}),i]})}function q({children:e}){return(0,t.jsx)(g.Empty,{className:"py-8",children:(0,t.jsx)(g.EmptyHeader,{children:(0,t.jsx)(g.EmptyDescription,{children:e})})})}function B({offset:e,setOffset:a,total:s}){let i=(0,o.useTranslations)("githubCache");return(0,t.jsxs)("div",{className:"flex items-center justify-between border-t p-3 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:i("showing",{start:0===s?0:e+1,end:Math.min(e+50,s),total:s})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(b.Button,{disabled:0===e,onClick:()=>a(Math.max(0,e-50)),size:"sm",variant:"outline",children:i("previous")}),(0,t.jsx)(b.Button,{disabled:e+50>=s,onClick:()=>a(e+50),size:"sm",variant:"outline",children:i("next")})]})]})}e.s(["GitHubCachePage",0,function(){let e=(0,o.useTranslations)("githubCache"),a=(0,o.useTranslations)("common"),j=(0,c.useLocale)(),[g,I]=(0,d.useState)(null),[D,P]=(0,d.useState)("5"),[G,_]=(0,d.useState)(""),[U,z]=(0,d.useState)("60"),[F,V]=(0,d.useState)({}),[K,W]=(0,d.useState)(0),[Q,J]=(0,d.useState)(0),[Y,X]=(0,d.useState)("ALL"),[Z,ee]=(0,d.useState)("ALL"),[et,ea]=(0,d.useState)("ALL"),[es,ei]=(0,d.useState)(!0),[er,el]=(0,d.useState)(null),[en,ec]=(0,d.useState)(null),eo=(0,d.useCallback)(async()=>{ei(!0);try{let e=await (0,S.controlPlaneRequest)(`query GitHubCachePage($limit: Int!, $callOffset: Int!, $entryOffset: Int!, $apiType: GitHubApiType, $requestSource: GitHubRequestSource, $callSource: GitHubCallSource) {
|
|
2
2
|
githubSettings { tokenConfigured defaultJiraKeyRegex actionsNotificationPollIntervalSeconds cacheTtlSeconds updatedAt }
|
|
3
3
|
githubCacheTtlOverrides { operation ttlSeconds builtIn createdAt updatedAt }
|
|
4
4
|
githubCacheableGraphqlOperations
|