@usine/server 0.4.1-next.325.g79174da.1.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/auth/api.d.ts +108 -0
- package/dist/auth/api.d.ts.map +1 -0
- package/dist/auth/api.js +109 -0
- package/dist/auth/api.js.map +1 -0
- package/dist/auth/http.d.ts.map +1 -1
- package/dist/auth/http.js +26 -33
- package/dist/auth/http.js.map +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +2 -1
- package/dist/http.js.map +1 -1
- package/dist/openapi.d.ts +6 -0
- package/dist/openapi.d.ts.map +1 -0
- package/dist/openapi.js +68 -0
- package/dist/openapi.js.map +1 -0
- package/dist/web/assets/_agent-DduvwaVK.js +1 -0
- package/dist/web/assets/_label-CeJTfdyr.js +1 -0
- package/dist/web/assets/{_loop-CI8wT73I.js → _loop-xu3sbDMH.js} +1 -1
- package/dist/web/assets/{_name-BIiHdJIM.js → _name-DHJA0DfK.js} +1 -1
- package/dist/web/assets/{_number-DOftkarN.js → _number-CxL2Fcpl.js} +1 -1
- package/dist/web/assets/_number-DAq4EEnO.js +1 -0
- package/dist/web/assets/{_number-zDnuidOW.js → _number-DlcNbQyC.js} +1 -1
- package/dist/web/assets/_project-DAq4EEnO.js +1 -0
- package/dist/web/assets/{_project-DwYWqZaq.js → _project-DwpEglrZ.js} +1 -1
- package/dist/web/assets/{_project-CVPqKw8_.js → _project-GK2-urBn.js} +1 -1
- package/dist/web/assets/_run-DAq4EEnO.js +1 -0
- package/dist/web/assets/{_run-B4-87ibA.js → _run-jX-octY4.js} +1 -1
- package/dist/web/assets/{_worker-BBfkUdTZ.js → _worker-C_Nw6Vto.js} +1 -1
- package/dist/web/assets/{action-CAwzK5mk.js → action-CniC234z.js} +1 -1
- package/dist/web/assets/{actions-BXWVnBF3.js → actions-BJ8FViiC.js} +1 -1
- package/dist/web/assets/{agents-BStm1azV.js → agents-BD_MpjbH.js} +1 -1
- package/dist/web/assets/agents-Csj7pU8B.js +1 -0
- package/dist/web/assets/api-D3RWLycx.js +335 -0
- package/dist/web/assets/{code-block-CgYM2MuQ.js → code-block-d5zwBZo-.js} +1 -1
- package/dist/web/assets/{drawer-BB7jwe-O.js → drawer-D6KxeZBZ.js} +1 -1
- package/dist/web/assets/{edit-and-retry-B0OIPvbt.js → edit-and-retry-BKxt-FIG.js} +1 -1
- package/dist/web/assets/{file-error-DeQv_cj8.js → file-error-LMdCcTon.js} +1 -1
- package/dist/web/assets/{history-Dg2dL6yf.js → history-34nvr9sY.js} +1 -1
- package/dist/web/assets/{index-BGr-Cg-z.js → index-B_6qmKij.js} +3 -3
- package/dist/web/assets/{label-badge-C3PtxhEk.js → label-badge-cRUT7_pk.js} +1 -1
- package/dist/web/assets/{labels-DFfLQe0K.js → labels-BGCA9v1C.js} +1 -1
- package/dist/web/assets/{list-CHD0VbJL.js → list-qM2KUYvo.js} +1 -1
- package/dist/web/assets/loops-BXqvj3ko.js +1 -0
- package/dist/web/assets/{members-Cl_WCHwt.js → members-B14AFaH7.js} +1 -1
- package/dist/web/assets/{model-D9QKZ_Hk.js → model-C6gErpq3.js} +1 -1
- package/dist/web/assets/{moves-BQl144Rz.js → moves-BYTLKqNE.js} +1 -1
- package/dist/web/assets/{not-found-C8JhxsFV.js → not-found-CCicx33l.js} +1 -1
- package/dist/web/assets/{outcome-Bmu_N2Ni.js → outcome-D5IWnu4P.js} +1 -1
- package/dist/web/assets/{overview-CUn9OtUH.js → overview-DLYaCoiG.js} +1 -1
- package/dist/web/assets/{page-CmRQu9F2.js → page-BEpkTOW0.js} +1 -1
- package/dist/web/assets/{projects-D7j8WXJK.js → projects-B6PO2z2B.js} +1 -1
- package/dist/web/assets/{queries-Cvt0xQVN.js → queries-Bhp4FeLT.js} +1 -1
- package/dist/web/assets/{queries-CKjxlPEk.js → queries-CU77zJnf.js} +1 -1
- package/dist/web/assets/{queries-D5TGw8Nr.js → queries-C_qC_nGu.js} +1 -1
- package/dist/web/assets/{queries-Cdfj6CtB.js → queries-ESTqS3FK.js} +1 -1
- package/dist/web/assets/{repositories-B_mXysRY.js → repositories-Db6PsyxS.js} +1 -1
- package/dist/web/assets/{repository-link-B7-4fVcX.js → repository-link-OOfhq6c8.js} +1 -1
- package/dist/web/assets/route-D8Nd9ZwI.js +1 -0
- package/dist/web/assets/route-DjjbuG-J.js +1 -0
- package/dist/web/assets/{route-status-tny9_oCm.js → route-status-Cxocu6W_.js} +1 -1
- package/dist/web/assets/routes-DAq4EEnO.js +1 -0
- package/dist/web/assets/{routes-DRogv1gQ.js → routes-Dq3R4rSX.js} +1 -1
- package/dist/web/assets/{run-again-DVg9Ncn3.js → run-again-DHlW6Dcb.js} +1 -1
- package/dist/web/assets/{section-CjCP4gvu.js → section-C75aUrac.js} +1 -1
- package/dist/web/assets/{section-Du_ZZiFG.js → section-Db-f1liW.js} +1 -1
- package/dist/web/assets/{section-BjpSGYua.js → section-Wflvjspx.js} +1 -1
- package/dist/web/assets/{settings-DlN91oPk.js → settings-CpA5zhaC.js} +1 -1
- package/dist/web/assets/{sign-in-i_b9opnw.js → sign-in-D5kDf9C5.js} +1 -1
- package/dist/web/assets/{strings-DhGEKt5X.js → strings-DmAVtEUC.js} +1 -1
- package/dist/web/assets/tasks-DAq4EEnO.js +1 -0
- package/dist/web/assets/{tasks-DG6D0ByG.js → tasks-Dmzf4nUy.js} +1 -1
- package/dist/web/assets/{tokens-Dfsm5C2T.js → tokens-BHREcyDp.js} +1 -1
- package/dist/web/assets/{usage-cNWB4RMb.js → usage-ZTnmWdRP.js} +1 -1
- package/dist/web/assets/{use-project-links-C3F9c85T.js → use-project-links-CdgpfpoU.js} +1 -1
- package/dist/web/assets/{useTriggerFocusGuards-BEdypEdV.js → useTriggerFocusGuards-u-Jz4hr2.js} +1 -1
- package/dist/web/assets/{workers-DkgWKjiI.js → workers-D8lcf3zo.js} +1 -1
- package/dist/web/index.html +12 -12
- package/package.json +11 -10
- package/dist/web/assets/_agent-DIZrJ2oZ.js +0 -1
- package/dist/web/assets/_label-DMFWLPtF.js +0 -1
- package/dist/web/assets/_number-Bn_57si9.js +0 -1
- package/dist/web/assets/_project-Bn_57si9.js +0 -1
- package/dist/web/assets/_run-Bn_57si9.js +0 -1
- package/dist/web/assets/agents-BZV7-W7e.js +0 -1
- package/dist/web/assets/api-CoJQoiOc.js +0 -335
- package/dist/web/assets/loops-CRPsfOzn.js +0 -1
- package/dist/web/assets/route-Di3rgfZ0.js +0 -1
- package/dist/web/assets/route-DjL-s2L0.js +0 -1
- package/dist/web/assets/routes-Bn_57si9.js +0 -1
- package/dist/web/assets/tasks-Bn_57si9.js +0 -1
package/dist/openapi.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { OperatorApi } from "@usine/orchestrator/operator/http";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
4
|
+
import { AuthApi, AuthenticationError, publicAuthPaths } from "./auth/api.js";
|
|
5
|
+
export const DocumentationApi = HttpApiGroup.make("documentation").add(HttpApiEndpoint.get("openapi", "/api/openapi.json", {
|
|
6
|
+
success: Schema.Record(Schema.String, Schema.Unknown).annotate({
|
|
7
|
+
title: "OpenAPI document",
|
|
8
|
+
description: "OpenAPI 3.1 description of the instance HTTP API.",
|
|
9
|
+
}),
|
|
10
|
+
})
|
|
11
|
+
.annotate(OpenApi.Summary, "Read the API schema")
|
|
12
|
+
.annotate(OpenApi.Description, "Public OpenAPI 3.1 document generated from the registered API contracts."));
|
|
13
|
+
export const publicOperatorPaths = new Set([
|
|
14
|
+
OperatorApi.groups.operator.endpoints.serverVersion.path,
|
|
15
|
+
DocumentationApi.endpoints.openapi.path,
|
|
16
|
+
]);
|
|
17
|
+
export const operatorOpenApi = () => {
|
|
18
|
+
const document = OpenApi.fromApi(OperatorApi.add(AuthApi, DocumentationApi));
|
|
19
|
+
const authenticationError = Schema.toJsonSchemaDocument(AuthenticationError).schema;
|
|
20
|
+
document.components.securitySchemes = {
|
|
21
|
+
bearer: {
|
|
22
|
+
type: "http",
|
|
23
|
+
scheme: "bearer",
|
|
24
|
+
description: "Instance-issued token or local admin token.",
|
|
25
|
+
},
|
|
26
|
+
session: {
|
|
27
|
+
type: "apiKey",
|
|
28
|
+
in: "cookie",
|
|
29
|
+
name: "usine_session",
|
|
30
|
+
description: "Browser session. Writes also require X-Usine-CSRF.",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
for (const [path, methods] of Object.entries(document.paths)) {
|
|
34
|
+
for (const [method, operation] of Object.entries(methods)) {
|
|
35
|
+
if (!("responses" in operation))
|
|
36
|
+
continue;
|
|
37
|
+
if (publicAuthPaths.has(path) || (method === "get" && publicOperatorPaths.has(path)))
|
|
38
|
+
continue;
|
|
39
|
+
operation.security = [{ bearer: [] }, { session: [] }];
|
|
40
|
+
operation.responses["401"] = {
|
|
41
|
+
description: "A valid instance token or browser session is required.",
|
|
42
|
+
content: {
|
|
43
|
+
"application/json": {
|
|
44
|
+
schema: authenticationError,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
if (method !== "get") {
|
|
49
|
+
const forbidden = operation.responses["403"];
|
|
50
|
+
const existingSchema = forbidden?.content?.["application/json"]?.schema;
|
|
51
|
+
operation.responses["403"] = {
|
|
52
|
+
...forbidden,
|
|
53
|
+
description: `${forbidden?.description ?? "Forbidden."} Browser session writes require a valid X-Usine-CSRF header.`,
|
|
54
|
+
content: {
|
|
55
|
+
...forbidden?.content,
|
|
56
|
+
"application/json": {
|
|
57
|
+
schema: existingSchema
|
|
58
|
+
? { anyOf: [existingSchema, authenticationError] }
|
|
59
|
+
: authenticationError,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return document;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=openapi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.js","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CACpE,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,EAAE;IAClD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QAC7D,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,mDAAmD;KACjE,CAAC;CACH,CAAC;KACC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,qBAAqB,CAAC;KAChD,QAAQ,CACP,OAAO,CAAC,WAAW,EACnB,0EAA0E,CAC3E,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS;IACjD,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI;IACxD,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC7E,MAAM,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC;IACpF,QAAQ,CAAC,UAAU,CAAC,eAAe,GAAG;QACpC,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,6CAA6C;SAC3D;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,oDAAoD;SAClE;KACF,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7D,KAAK,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1D,IAAI,CAAC,CAAC,WAAW,IAAI,SAAS,CAAC;gBAAE,SAAS;YAC1C,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAClF,SAAS;YACX,SAAS,CAAC,QAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;YACvD,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG;gBAC3B,WAAW,EAAE,wDAAwD;gBACrE,OAAO,EAAE;oBACP,kBAAkB,EAAE;wBAClB,MAAM,EAAE,mBAAmB;qBAC5B;iBACF;aACF,CAAC;YACF,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBACrB,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;gBAC7C,MAAM,cAAc,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;gBACxE,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG;oBAC3B,GAAG,SAAS;oBACZ,WAAW,EAAE,GAAG,SAAS,EAAE,WAAW,IAAI,YAAY,8DAA8D;oBACpH,OAAO,EAAE;wBACP,GAAG,SAAS,EAAE,OAAO;wBACrB,kBAAkB,EAAE;4BAClB,MAAM,EAAE,cAAc;gCACpB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAAE;gCAClD,CAAC,CAAC,mBAAmB;yBACxB;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./useSuspenseQuery-ajaZl96Y.js";import{n}from"./queries-C_qC_nGu.js";import{d as r}from"./index-B_6qmKij.js";import{t as i}from"./agents-BD_MpjbH.js";var a=e(),o=()=>{let{agent:e}=r.useParams(),{data:o}=t(n());return(0,a.jsx)(i,{name:e,configuration:o})};export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{Z as t,t as n}from"./section-Db-f1liW.js";import{u as r}from"./index-B_6qmKij.js";var i=e(),a=()=>{let{label:e}=r.useParams();return(0,i.jsx)(n,{title:e,entity:t(`label`,e),children:null})};export{a as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{D as t,E as n,Z as r,a as i,c as a,i as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./section-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{D as t,E as n,Z as r,a as i,c as a,i as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./section-Db-f1liW.js";import{t as g}from"./useSuspenseQuery-ajaZl96Y.js";import{t as _}from"./link-3oQYoIpm.js";import{n as v,r as y}from"./list-qM2KUYvo.js";import{r as b}from"./strings-BIVdGoBr.js";import{t as x}from"./error-alert-Bq-SD6of.js";import{n as S}from"./queries-C_qC_nGu.js";import{at as C,l as w,v as T}from"./index-B_6qmKij.js";import{t as E}from"./file-error-LMdCcTon.js";import{t as D}from"./repository-link-OOfhq6c8.js";var O=e(),k=({loop:e,configuration:t})=>{let r=t.projects.find(t=>e.name.startsWith(`${t.id}/`)),a=t.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(i,{children:[r!==void 0&&(0,O.jsx)(o,{label:`Project`,children:(0,O.jsx)(_,{to:`/configuration/projects/$project`,params:{project:r.id},className:`text-primary hover:underline`,children:r.name})}),(0,O.jsxs)(o,{label:`Agent`,children:[(0,O.jsx)(_,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),a!==void 0&&(0,O.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:b(a)})]}),(0,O.jsx)(o,{label:`Repositories`,children:e.repositories.length===0?(0,O.jsx)(m,{children:`No registered repository matches the selector`}):(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsx)(D,{repository:e})},e))})}),(0,O.jsx)(o,{label:`Approval`,children:h[e.approval]}),(0,O.jsxs)(o,{label:`Max cycles`,children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,O.jsx)(m,{children:`runs per item before a reset`})]}),(0,O.jsx)(o,{label:`Permissions`,children:n[e.permissions]}),(0,O.jsx)(o,{label:`Priority`,children:e.priority===null?(0,O.jsx)(m,{children:`0; ties use lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(m,{children:`higher values go first; ties use lane order`})]})}),(0,O.jsx)(o,{label:`Step`,children:(0,O.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},A=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],j=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],M=({loop:e,configuration:n,pause:r})=>{let i=s(e.prompt).length;return(0,O.jsxs)(O.Fragment,{children:[r?.isError===!0&&(0,O.jsx)(x,{message:r.error.message}),(0,O.jsxs)(c,{facts:(0,O.jsx)(k,{loop:e,configuration:n}),children:[(0,O.jsxs)(d,{title:`Trigger`,children:[(0,O.jsx)(l,{entries:A(e)}),e.undeclaredLabels.length>0&&(0,O.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,O.jsx)(C,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,O.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels under`,` `,(0,O.jsx)(`code`,{children:`labels`}),` in `,(0,O.jsx)(`code`,{children:`usine.yaml`}),`.`]})]})]}),(0,O.jsx)(d,{title:`Selector`,children:e.selector===null?(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,O.jsx)(l,{entries:j(e.selector)})}),(0,O.jsx)(d,{title:`Prompt`,aside:i===0?`Same text for every run`:`${t(i,`outlined expression`)} filled in from each item`,children:(0,O.jsx)(u,{template:e.prompt})})]})]})},N=({name:e,configuration:t,pause:n})=>{let i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,O.jsx)(p,{entity:r(`loop`,e),title:i.name,marks:(0,O.jsx)(y,{paused:i.paused}),file:i.file,actions:n!==null&&(0,O.jsx)(v,{loop:i,pause:n,variant:`outline`}),children:(0,O.jsx)(M,{loop:i,configuration:t,pause:n})});let o=t.quarantinedLoops.find(t=>t.name===e);return o===void 0?(0,O.jsx)(p,{entity:r(`loop`,e),title:e,children:(0,O.jsxs)(f,{title:`Loop not found`,children:[`The configuration has no file `,(0,O.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,O.jsx)(_,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,O.jsx)(p,{entity:r(`loop`,e),title:o.name,marks:(0,O.jsx)(a,{}),file:o.file,children:(0,O.jsx)(E,{error:o.error,consequence:`No runs until the file loads.`})})},P=()=>{let{loop:e}=w.useParams(),{data:t}=g(S());return(0,O.jsx)(N,{name:e,configuration:t,pause:T()})};export{P as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,Z as n,a as r,i,n as a,r as o,s,t as c,u as l}from"./section-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,Z as n,a as r,i,n as a,r as o,s,t as c,u as l}from"./section-Db-f1liW.js";import{t as u}from"./useSuspenseQuery-ajaZl96Y.js";import{t as d}from"./link-3oQYoIpm.js";import{n as f}from"./queries-C_qC_nGu.js";import{Y as p,a as m}from"./index-B_6qmKij.js";import{t as h}from"./label-badge-cRUT7_pk.js";var g=e(),_=({label:e})=>e.failure===null?e.onGitHub===!1?(0,g.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,g.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),v=({repository:e,project:n})=>(0,g.jsxs)(r,{children:[(0,g.jsx)(i,{label:t.project,children:n===void 0?(0,g.jsx)(l,{children:t.unassignedProject}):(0,g.jsx)(d,{to:`/configuration/projects/$project`,params:{project:n.id},className:`text-primary hover:underline`,children:n.name})}),n!==void 0&&(0,g.jsx)(i,{label:`Board`,children:(0,g.jsx)(d,{to:`/projects/$project`,params:{project:n.id},className:`text-primary hover:underline`,children:t.board})}),(0,g.jsx)(i,{label:`Tags`,children:e.tags.length===0?(0,g.jsx)(l,{children:`None`}):e.tags.join(`, `)}),(0,g.jsx)(i,{label:`Loops`,children:e.loops.length===0?(0,g.jsx)(l,{children:`Not selected by any loop`}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,g.jsx)(`li`,{children:(0,g.jsx)(d,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),y=({owner:e,name:t,configuration:r})=>{let i=`${e}/${t}`,u=r.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return u===void 0?(0,g.jsx)(c,{entity:n(`repository`,i),title:i,children:(0,g.jsxs)(s,{title:`Repository not registered`,children:[i,` is not under `,(0,g.jsx)(`code`,{children:`repos`}),` in `,(0,g.jsx)(`code`,{children:`usine.yaml`}),`.`,` `,(0,g.jsx)(d,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,g.jsx)(c,{entity:n(`repository`,u.name),title:u.name,leading:(0,g.jsx)(p,{repository:u.name,size:`title`}),children:(0,g.jsx)(a,{facts:(0,g.jsx)(v,{repository:u,project:r.projects.find(e=>e.includes(u.name))}),children:(0,g.jsx)(o,{title:`Labels usine creates`,aside:`From labels in usine.yaml`,children:u.declaredLabels.length===0?(0,g.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No labels under `,(0,g.jsx)(`code`,{children:`labels`}),` in `,(0,g.jsx)(`code`,{children:`usine.yaml`}),`.`]}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.declaredLabels.map(e=>(0,g.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,g.jsx)(h,{name:e.name,label:e}),(0,g.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,g.jsx)(l,{children:`On GitHub`}):(0,g.jsx)(_,{label:e})})]},e.name))})})})})},b=()=>{let{owner:e,name:t}=m.useParams(),{data:n}=u(f());return(0,g.jsx)(y,{owner:e,name:t,configuration:n})};export{b as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-C3F9c85T.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,c as o,h as s,i as c,l,n as u,o as d,s as f,v as p}from"./actions-BXWVnBF3.js";import{n as m,t as h}from"./useNavigate-I5E4IRt2.js";import{t as g}from"./link-3oQYoIpm.js";import{r as _,t as v}from"./mark-lp0qzo_h.js";import{c as y,l as b,n as x,s as S,t as ee}from"./moves-BQl144Rz.js";import{r as te}from"./native-select-BCc0nbNt.js";import{r as C,t as w}from"./button-CzVqBv_O.js";import{l as ne,s as T}from"./useTriggerFocusGuards-BEdypEdV.js";import{i as E}from"./context-8jHKzDOY.js";import{Dn as re,En as ie,Ln as ae,Pn as D,a as oe,wn as se}from"./api-CoJQoiOc.js";import{o as O,s as ce,v as k}from"./strings-BIVdGoBr.js";import{D as le,E as A,F as ue,I as de,M as j,N as M,P as fe,i as N,n as pe,r as me}from"./overview-CUn9OtUH.js";import{a as he,n as ge,r as _e}from"./page-CmRQu9F2.js";import{t as P}from"./error-alert-Bq-SD6of.js";import{A as F,D as I,F as ve,M as ye,N as be,O as xe,P as Se,R as Ce,j as we,k as Te,lt as Ee,n as De,t as Oe}from"./index-BGr-Cg-z.js";import{t as ke}from"./pull-request-marks-_FfWkWIz.js";import{n as L,t as Ae}from"./status-badge-B2-vzEoZ.js";import{n as je,t as Me}from"./edit-and-retry-B0OIPvbt.js";import{a as Ne,i as R,n as z,o as B,r as V,t as H}from"./table-CKp2wE4u.js";import{t as U}from"./fill-cell-BtM3J7oO.js";import{t as Pe}from"./label-badge-C3PtxhEk.js";import{a as Fe,n as Ie,t as Le}from"./model-D9QKZ_Hk.js";import{n as Re,t as ze}from"./run-again-DVg9Ncn3.js";import{a as Be,i as W,n as G,r as K,t as q}from"./section-CjCP4gvu.js";import{t as Ve}from"./not-found-C8JhxsFV.js";var J=n(),He=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${k(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${k(e.postedAt)}`},Ue=({task:e})=>{let t=r(),n=new Map(e.runs.map(e=>[e.id,e])),i=new Map(e.items.map(e=>[e.itemKey,e]));return(0,J.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,J.jsx)(q,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,J.jsx)(z,{className:`border-t`,children:e.comments.map(e=>{let r=n.get(e.runId),a=r===void 0?void 0:i.get(r.itemKey),o=He(e);return(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${W}`,children:[Ie(e.kind),a!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(v,{item:a,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(g,{...t.run(r.repository,r.id),className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:r.loop})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:o!==null&&(0,J.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(o.at)})})]},e.url)})})})})]})},We=({task:e,project:t,disabled:n})=>{let r=ee(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,c=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),u=c===void 0?void 0:r.moves.find(({itemKey:e})=>e===c.card.itemKey),p=c===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==c.lane.id),m=t.board.lanes.find(({id:e})=>e===u?.toLane)?.name??c?.lane.name??e.lane.name,h=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),g=c===void 0?a.labels:x(c.card,c.lane).filter(e=>u===void 0||!h.has(e)),v=new Map(t.labels.map(e=>[e.name,e])),b=!n&&!r.isPending&&u===void 0&&p.length>0;E(c!==void 0&&b?p.map(e=>({label:y(e.name),run:()=>r.moveItem(c.card,e)})):[]);let{origin:C,pullRequests:T}=ne(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(_e,{actionsBeside:`sm`,heading:(0,J.jsx)(Ce,{variant:`page`,item:ae(C),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ke,{pullRequests:T}),(0,J.jsx)(ge,{icon:Ee,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:m})}),u!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:S(u.phase)}),g.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:g.map(e=>(0,J.jsx)(Pe,{name:e,label:v.get(e)},e))}),e.needsYou&&(0,J.jsx)(Ae,{})]}),...c!==void 0&&b?{actions:(0,J.jsxs)(d,{children:[(0,J.jsxs)(s,{render:(0,J.jsx)(w,{variant:`outline`}),"aria-label":`Move ${_(a)} to another lane`,children:[`Move to`,(0,J.jsx)(te,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(f,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(o,{children:p.map(e=>(0,J.jsx)(l,{onClick:()=>r.moveItem(c.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,J.jsx)(P,{className:`max-w-3xl`,message:r.error.message})]})},Ge=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,J.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,J.jsx)(q,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,J.jsx)(z,{className:`border-t`,children:t.map(e=>(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(V,{className:`w-0 py-3`,children:(0,J.jsx)(v,{item:e,linked:!1})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${W}`,children:[e.title,(0,J.jsx)(b,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,J.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},Y=e(t(),1),X=({run:e})=>{let t=he(3e4);return D(Le(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:ce(e)})})},Ke=({run:e})=>D(Fe(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:A(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:le(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:A(e)})]})}),Z=({run:e})=>(0,J.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${k(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:O(e.openedAt)}),Q=({pullRequest:e})=>D(e,{onNone:()=>null,onSome:e=>(0,J.jsx)(v,{item:e,className:`relative z-10`})}),qe=(e,t)=>`${e} ${t}${e===1?``:`s`}`,Je=({run:e,pullRequest:t})=>(0,J.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,J.jsx)(`span`,{children:e.agent}),(0,J.jsx)(`span`,{children:qe(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),$=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ye=({run:e,onEdit:t,openRun:n,status:r})=>{let i=c(),m=a(),[h,g]=(0,Y.useState)(!1),_=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),v=()=>m.mutate(u(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:ue}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),y=e.attempts.at(-1),b=$(e),x=y?.outcome?._tag===`Failed`&&y.outcome.failure._tag===`QuestionFailure`,S=[];return e.canApprove&&b!==`approve`&&S.push({label:M.approve,select:()=>_({action:`approve`})}),e.canRetry&&b!==`retry`&&S.push({label:M.retry,description:j(e.agentBrain),select:()=>_({action:`retry`})}),e.canRetry&&S.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(S.push({label:M.runAgain,select:v}),S.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&y!==void 0&&S.push({label:x?`Mark answered`:`Mark resolved`,select:()=>_({action:`resolveFailure`,attemptId:y.id})}),e.canCancel&&S.push({label:M.cancel,destructive:!0,select:()=>g(!0)}),E(i.isPending||m.isPending||h?[]:[...b===null?[]:[{label:M[b],select:()=>_({action:b})}],...S].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i.isPending&&i.variables!==void 0?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:fe[i.variables.request.action]}):m.isPending?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:de}):(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[b!==null&&(0,J.jsx)(w,{variant:`outline`,size:`sm`,title:b===`retry`?j(e.agentBrain):void 0,onClick:()=>_({action:b}),children:M[b]}),S.length>0&&(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{render:(0,J.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${O(e.openedAt)}`,children:(0,J.jsx)(p,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(f,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(o,{children:S.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(l,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(xe,{open:h,onOpenChange:g,children:(0,J.jsxs)(we,{children:[(0,J.jsxs)(Se,{children:[(0,J.jsxs)(ve,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(ye,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(be,{children:[(0,J.jsx)(F,{children:M.keepRunning}),(0,J.jsx)(Te,{variant:`destructive`,onClick:()=>{g(!1),_({action:`cancel`})},children:M.confirmCancel})]})]})})]})},Xe=8,Ze=({run:e,item:t,pullRequest:n,openRun:i})=>{let a=r(),[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:C(K,`[&>td]:align-top`),children:[(0,J.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,J.jsx)(L,{state:e.state,className:`ml-0.75`}),e.state]})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,J.jsx)(L,{state:e.state,className:`ml-0.75 self-center sm:hidden`}),(0,J.jsx)(g,{"data-row-link":!0,...a.run(e.repository,e.id),className:C(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(v,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Ke,{run:e}),e.runAgain!==null&&(0,J.jsx)(ze,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Re,{approval:e.approval,className:`text-xs`}),(0,J.jsx)(Je,{run:e,pullRequest:n}),c!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:c})]})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,J.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,J.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,J.jsx)(X,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Z,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Q,{pullRequest:n})}),(0,J.jsx)(V,{className:`py-2.5`,children:(0,J.jsx)(Ye,{run:e,onEdit:s,openRun:i,status:l})})]}),o!==null&&je(e,o)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:Xe,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(Me,{run:e,intent:o,close:()=>s(null),openRun:i,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${o}`)})})]})},Qe=({task:e,openRun:t})=>{let n=new Map(e.items.map(e=>[e.itemKey,e])),r=e.items.length>1;return(0,J.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,J.jsx)(q,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsxs)(H,{children:[(0,J.jsx)(Ne,{children:(0,J.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,J.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,J.jsx)(R,{children:`Run`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,J.jsx)(R,{children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,J.jsx)(z,{children:e.runs.map(i=>{let a=ie(re(i.pullRequestUrl),t=>T(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ze,{run:i,item:o===null||se(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},$e=({children:e})=>(0,J.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,J.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),et=({repository:e,number:t})=>{let{data:n}=i(pe()),r=me(n.projects,e),a=m(),o=I(),s=i(De(e,t));if(s.error instanceof oe&&s.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Ve,{repository:e,number:String(t)});let c=s.isError&&(0,J.jsx)(P,{className:`max-w-3xl`,title:`Could not refresh the task`,message:s.error.message}),l=s.data;return l.number!==t&&r!==void 0?(0,J.jsx)(h,{to:`/projects/$project/tasks/$number`,params:{project:N(r),number:String(l.number)},search:t=>({...t,repository:e}),replace:!0}):(0,J.jsxs)($e,{children:[r!==void 0&&r.repositories.length>1&&(0,J.jsx)(Be,{repositories:r.repositories,value:e,onChange:e=>void a({to:`/projects/$project/tasks`,params:{project:N(r)},search:{repository:e}})}),c,r!==void 0&&(0,J.jsx)(We,{task:l,project:r,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Qe,{task:l,openRun:o}),(0,J.jsx)(Ge,{task:l}),(0,J.jsx)(Ue,{task:l})]})},tt=()=>{let{repository:e,number:t}=Oe.useLoaderData();return(0,J.jsx)(et,{repository:e,number:t},`${e}#${t}`)};export{tt as component};
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-CdgpfpoU.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,c as o,h as s,i as c,l,n as u,o as d,s as f,v as p}from"./actions-BJ8FViiC.js";import{n as m,t as h}from"./useNavigate-I5E4IRt2.js";import{t as g}from"./link-3oQYoIpm.js";import{r as _,t as v}from"./mark-lp0qzo_h.js";import{c as y,l as b,n as x,s as S,t as ee}from"./moves-BYTLKqNE.js";import{r as te}from"./native-select-BCc0nbNt.js";import{r as C,t as w}from"./button-CzVqBv_O.js";import{l as ne,s as T}from"./useTriggerFocusGuards-u-Jz4hr2.js";import{i as E}from"./context-8jHKzDOY.js";import{Dn as re,En as ie,Ln as ae,Pn as D,a as oe,wn as se}from"./api-D3RWLycx.js";import{o as O,s as ce,v as k}from"./strings-BIVdGoBr.js";import{D as le,E as A,F as ue,I as de,M as j,N as M,P as fe,i as N,n as pe,r as me}from"./overview-DLYaCoiG.js";import{a as he,n as ge,r as _e}from"./page-BEpkTOW0.js";import{t as P}from"./error-alert-Bq-SD6of.js";import{A as F,D as I,F as ve,M as ye,N as be,O as xe,P as Se,R as Ce,j as we,k as Te,lt as Ee,n as De,t as Oe}from"./index-B_6qmKij.js";import{t as ke}from"./pull-request-marks-_FfWkWIz.js";import{n as L,t as Ae}from"./status-badge-B2-vzEoZ.js";import{n as je,t as Me}from"./edit-and-retry-BKxt-FIG.js";import{a as Ne,i as R,n as z,o as B,r as V,t as H}from"./table-CKp2wE4u.js";import{t as U}from"./fill-cell-BtM3J7oO.js";import{t as Pe}from"./label-badge-cRUT7_pk.js";import{a as Fe,n as Ie,t as Le}from"./model-C6gErpq3.js";import{n as Re,t as ze}from"./run-again-DHlW6Dcb.js";import{a as Be,i as W,n as G,r as K,t as q}from"./section-C75aUrac.js";import{t as Ve}from"./not-found-CCicx33l.js";var J=n(),He=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${k(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${k(e.postedAt)}`},Ue=({task:e})=>{let t=r(),n=new Map(e.runs.map(e=>[e.id,e])),i=new Map(e.items.map(e=>[e.itemKey,e]));return(0,J.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,J.jsx)(q,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,J.jsx)(z,{className:`border-t`,children:e.comments.map(e=>{let r=n.get(e.runId),a=r===void 0?void 0:i.get(r.itemKey),o=He(e);return(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${W}`,children:[Ie(e.kind),a!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(v,{item:a,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(g,{...t.run(r.repository,r.id),className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:r.loop})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:o!==null&&(0,J.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(o.at)})})]},e.url)})})})})]})},We=({task:e,project:t,disabled:n})=>{let r=ee(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,c=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),u=c===void 0?void 0:r.moves.find(({itemKey:e})=>e===c.card.itemKey),p=c===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==c.lane.id),m=t.board.lanes.find(({id:e})=>e===u?.toLane)?.name??c?.lane.name??e.lane.name,h=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),g=c===void 0?a.labels:x(c.card,c.lane).filter(e=>u===void 0||!h.has(e)),v=new Map(t.labels.map(e=>[e.name,e])),b=!n&&!r.isPending&&u===void 0&&p.length>0;E(c!==void 0&&b?p.map(e=>({label:y(e.name),run:()=>r.moveItem(c.card,e)})):[]);let{origin:C,pullRequests:T}=ne(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(_e,{actionsBeside:`sm`,heading:(0,J.jsx)(Ce,{variant:`page`,item:ae(C),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ke,{pullRequests:T}),(0,J.jsx)(ge,{icon:Ee,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:m})}),u!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:S(u.phase)}),g.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:g.map(e=>(0,J.jsx)(Pe,{name:e,label:v.get(e)},e))}),e.needsYou&&(0,J.jsx)(Ae,{})]}),...c!==void 0&&b?{actions:(0,J.jsxs)(d,{children:[(0,J.jsxs)(s,{render:(0,J.jsx)(w,{variant:`outline`}),"aria-label":`Move ${_(a)} to another lane`,children:[`Move to`,(0,J.jsx)(te,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(f,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(o,{children:p.map(e=>(0,J.jsx)(l,{onClick:()=>r.moveItem(c.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,J.jsx)(P,{className:`max-w-3xl`,message:r.error.message})]})},Ge=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,J.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,J.jsx)(q,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,J.jsx)(z,{className:`border-t`,children:t.map(e=>(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(V,{className:`w-0 py-3`,children:(0,J.jsx)(v,{item:e,linked:!1})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${W}`,children:[e.title,(0,J.jsx)(b,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,J.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},Y=e(t(),1),X=({run:e})=>{let t=he(3e4);return D(Le(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:ce(e)})})},Ke=({run:e})=>D(Fe(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:A(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:le(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:A(e)})]})}),Z=({run:e})=>(0,J.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${k(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:O(e.openedAt)}),Q=({pullRequest:e})=>D(e,{onNone:()=>null,onSome:e=>(0,J.jsx)(v,{item:e,className:`relative z-10`})}),qe=(e,t)=>`${e} ${t}${e===1?``:`s`}`,Je=({run:e,pullRequest:t})=>(0,J.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,J.jsx)(`span`,{children:e.agent}),(0,J.jsx)(`span`,{children:qe(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),$=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ye=({run:e,onEdit:t,openRun:n,status:r})=>{let i=c(),m=a(),[h,g]=(0,Y.useState)(!1),_=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),v=()=>m.mutate(u(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:ue}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),y=e.attempts.at(-1),b=$(e),x=y?.outcome?._tag===`Failed`&&y.outcome.failure._tag===`QuestionFailure`,S=[];return e.canApprove&&b!==`approve`&&S.push({label:M.approve,select:()=>_({action:`approve`})}),e.canRetry&&b!==`retry`&&S.push({label:M.retry,description:j(e.agentBrain),select:()=>_({action:`retry`})}),e.canRetry&&S.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(S.push({label:M.runAgain,select:v}),S.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&y!==void 0&&S.push({label:x?`Mark answered`:`Mark resolved`,select:()=>_({action:`resolveFailure`,attemptId:y.id})}),e.canCancel&&S.push({label:M.cancel,destructive:!0,select:()=>g(!0)}),E(i.isPending||m.isPending||h?[]:[...b===null?[]:[{label:M[b],select:()=>_({action:b})}],...S].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i.isPending&&i.variables!==void 0?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:fe[i.variables.request.action]}):m.isPending?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:de}):(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[b!==null&&(0,J.jsx)(w,{variant:`outline`,size:`sm`,title:b===`retry`?j(e.agentBrain):void 0,onClick:()=>_({action:b}),children:M[b]}),S.length>0&&(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{render:(0,J.jsx)(w,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${O(e.openedAt)}`,children:(0,J.jsx)(p,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(f,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(o,{children:S.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(l,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(xe,{open:h,onOpenChange:g,children:(0,J.jsxs)(we,{children:[(0,J.jsxs)(Se,{children:[(0,J.jsxs)(ve,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(ye,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(be,{children:[(0,J.jsx)(F,{children:M.keepRunning}),(0,J.jsx)(Te,{variant:`destructive`,onClick:()=>{g(!1),_({action:`cancel`})},children:M.confirmCancel})]})]})})]})},Xe=8,Ze=({run:e,item:t,pullRequest:n,openRun:i})=>{let a=r(),[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:C(K,`[&>td]:align-top`),children:[(0,J.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,J.jsx)(L,{state:e.state,className:`ml-0.75`}),e.state]})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,J.jsx)(L,{state:e.state,className:`ml-0.75 self-center sm:hidden`}),(0,J.jsx)(g,{"data-row-link":!0,...a.run(e.repository,e.id),className:C(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(v,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Ke,{run:e}),e.runAgain!==null&&(0,J.jsx)(ze,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Re,{approval:e.approval,className:`text-xs`}),(0,J.jsx)(Je,{run:e,pullRequest:n}),c!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:c})]})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,J.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,J.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,J.jsx)(X,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Z,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Q,{pullRequest:n})}),(0,J.jsx)(V,{className:`py-2.5`,children:(0,J.jsx)(Ye,{run:e,onEdit:s,openRun:i,status:l})})]}),o!==null&&je(e,o)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:Xe,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(Me,{run:e,intent:o,close:()=>s(null),openRun:i,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${o}`)})})]})},Qe=({task:e,openRun:t})=>{let n=new Map(e.items.map(e=>[e.itemKey,e])),r=e.items.length>1;return(0,J.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,J.jsx)(q,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsxs)(H,{children:[(0,J.jsx)(Ne,{children:(0,J.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,J.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,J.jsx)(R,{children:`Run`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,J.jsx)(R,{children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,J.jsx)(z,{children:e.runs.map(i=>{let a=ie(re(i.pullRequestUrl),t=>T(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ze,{run:i,item:o===null||se(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},$e=({children:e})=>(0,J.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,J.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),et=({repository:e,number:t})=>{let{data:n}=i(pe()),r=me(n.projects,e),a=m(),o=I(),s=i(De(e,t));if(s.error instanceof oe&&s.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Ve,{repository:e,number:String(t)});let c=s.isError&&(0,J.jsx)(P,{className:`max-w-3xl`,title:`Could not refresh the task`,message:s.error.message}),l=s.data;return l.number!==t&&r!==void 0?(0,J.jsx)(h,{to:`/projects/$project/tasks/$number`,params:{project:N(r),number:String(l.number)},search:t=>({...t,repository:e}),replace:!0}):(0,J.jsxs)($e,{children:[r!==void 0&&r.repositories.length>1&&(0,J.jsx)(Be,{repositories:r.repositories,value:e,onChange:e=>void a({to:`/projects/$project/tasks`,params:{project:N(r)},search:{repository:e}})}),c,r!==void 0&&(0,J.jsx)(We,{task:l,project:r,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Qe,{task:l,openRun:o}),(0,J.jsx)(Ge,{task:l}),(0,J.jsx)(Ue,{task:l})]})},tt=()=>{let{repository:e,number:t}=Oe.useLoaderData();return(0,J.jsx)(et,{repository:e,number:t},`${e}#${t}`)};export{tt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-Cxocu6W_.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./index-B_6qmKij.js";import{n,t as r}from"./not-found-CCicx33l.js";var i=e(),a=()=>{let{repository:e}=t.useSearch(),{number:a}=t.useParams();return e===void 0?(0,i.jsx)(`p`,{children:n}):(0,i.jsx)(r,{repository:e,number:a})};export{a as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-Cxocu6W_.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,Z as n,r,s as i,t as a}from"./section-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,Z as n,r,s as i,t as a}from"./section-Db-f1liW.js";import{t as o}from"./useSuspenseQuery-ajaZl96Y.js";import{t as s}from"./link-3oQYoIpm.js";import{n as c}from"./queries-C_qC_nGu.js";import{c as l}from"./index-B_6qmKij.js";import{t as u}from"./repository-link-OOfhq6c8.js";var d=e(),f=({id:e,configuration:o})=>{let c=o.projects.find(t=>t.id===e);return(0,d.jsx)(a,{title:c?.name??e,entity:n(`project`,e),children:c===void 0?(0,d.jsx)(i,{title:t.missing,children:null}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(s,{to:`/projects/$project`,params:{project:e},className:`text-primary hover:underline`,children:t.board}),(0,d.jsx)(r,{title:t.repositories,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:c.repositories.map(e=>(0,d.jsx)(`li`,{children:(0,d.jsx)(u,{repository:e})},e))})}),(0,d.jsx)(r,{title:t.lanes,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:c.lanes.map(e=>(0,d.jsxs)(`li`,{className:`flex flex-wrap gap-2`,children:[(0,d.jsx)(`span`,{children:e.name}),(0,d.jsx)(`span`,{className:`text-muted-foreground`,children:e.sources.map(e=>`label`in e?e.label:e.state).join(`, `)})]},e.name))})})]})})},p=()=>{let{project:e}=l.useParams(),{data:t}=o(c());return(0,d.jsx)(f,{id:e,configuration:t})};export{p as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-C3F9c85T.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,b as o,c as s,d as c,f as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,s as _,u as v,v as y}from"./actions-BXWVnBF3.js";import{t as b}from"./link-3oQYoIpm.js";import{r as x,t as S}from"./mark-lp0qzo_h.js";import{a as C,i as w,l as ee,n as T,o as E,r as D,s as te,t as ne}from"./moves-BQl144Rz.js";import{W as O,r as k,t as A}from"./button-CzVqBv_O.js";import{i as re}from"./context-8jHKzDOY.js";import{X as ie}from"./api-CoJQoiOc.js";import{c as ae,v as j}from"./strings-BIVdGoBr.js";import{I as oe,M,N,O as se,P as ce,a as P,i as F,k as I,n as le}from"./overview-CUn9OtUH.js";import{a as L,i as ue}from"./page-CmRQu9F2.js";import{t as R}from"./error-alert-Bq-SD6of.js";import{t as de}from"./queries-Cdfj6CtB.js";import{A as fe,D as pe,F as me,M as he,N as ge,O as _e,P as ve,Y as z,j as ye,k as be,o as xe,w as B}from"./index-BGr-Cg-z.js";import{n as V,r as Se,t as Ce}from"./status-badge-B2-vzEoZ.js";import{a as we,i as H,n as Te,o as U,r as W,t as Ee}from"./table-CKp2wE4u.js";import{a as De,c as Oe,d as G,f as ke,g as Ae,h as je,i as Me,l as Ne,m as K,o as Pe,p as Fe,r as Ie,s as Le,t as Re}from"./sortable.esm-D-1SvrpE.js";import{t as q}from"./label-badge-C3PtxhEk.js";import{t as ze}from"./action-CAwzK5mk.js";import{f as Be,o as Ve,u as J}from"./model-D9QKZ_Hk.js";import{n as He,t as Ue}from"./strings-DhGEKt5X.js";import{t as We}from"./project-not-found-BfK7XtjD.js";var Y=e(t(),1),Ge=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),Ke=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),X=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:Ge}));X.displayName=`ArrowUpRightIcon`;var Z=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:Ke}));Z.displayName=`ArrowsInLineHorizontalIcon`;var qe=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:I(t),Je={above:!1,below:!1},Ye=()=>{let[e,t]=(0,Y.useState)(Je),n=(0,Y.useRef)(null);return[(0,Y.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},Q=n();function $({className:e,size:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:k(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Xe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-header`,className:k(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Ze({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-title`,className:k(`text-lg font-semibold`,e),...t})}function Qe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-description`,className:k(`text-sm text-muted-foreground`,e),...t})}function $e({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-(--card-spacing)`,e),...t})}var et=3,tt=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(et);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,et).map(e=>(0,Q.jsx)(q,{name:e,label:t.get(e)},e)),n.length>0&&(0,Q.jsxs)(B,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},nt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,rt=({item:e,project:t})=>{let n=r();return(0,Q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,Q.jsx)(b,{...t===void 0?{...n.task(e.repository,J(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:J(e)},search:{repository:e.repository}},draggable:!1,className:nt,children:(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},it=({failure:e,children:t})=>(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),at=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,Q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:M(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:N.retry}):null,ot=({run:e})=>{let t=L(3e4),n=w(e);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,Q.jsx)(V,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,Q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,Q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,Q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:qe(e.state,n),children:ae(n,t)}),(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]}),e.machineWait!==null&&(0,Q.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:se(e.machineWait)})]})},st=({stalled:e,named:t,children:n})=>{let r=L(3e4),i=He(e,r);return(0,Q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,Q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},ct=e=>[`run-again`,`board-card`,e],lt=(e,t)=>{let n=ct(e),r=a({mutationKey:n,onClaimed:t}),i=o({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(m(e))}},ut=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:c,progress:l})=>{let u=C(n),d=D(n),f=s?.error?.message??null,p=c?.error?.message??null,m=a!==null&&u!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===u.run.id,h=a===null||s===null?null:(0,Q.jsx)(ze,{stalled:a,readOnly:o,appearance:`card`}),g=n.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&a===null;return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,Q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,Q.jsx)(S,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(z,{repository:n.repository}),(0,Q.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,Q.jsx)(rt,{item:n,project:e}),(0,Q.jsx)(tt,{labels:T(n,r),catalog:i}),d!==null&&(0,Q.jsx)(ot,{run:d}),l!==null&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,Q.jsx)(it,{failure:u,children:m&&a?.reason._tag===`SuppressedForOperator`?h:(0,Q.jsx)(at,{failure:u,action:s})}),a!==null&&!m&&(0,Q.jsx)(st,{stalled:a,named:(d===null||Ve(a)?.id!==d.id)&&!Ue(a),children:h}),c?.data?._tag===`CycleBlocked`&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),n.conflicting&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,Q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},dt=({runs:e,openRun:t})=>(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Run history`}),(0,Q.jsx)(g,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,Q.jsxs)(f,{onClick:()=>t(e.id),children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,Q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(V,{state:e.state}),e.state]}),(0,Q.jsx)(`time`,{dateTime:e.openedAt,title:I(e.openedAt),className:`font-mono tabular-nums`,children:ae(e.openedAt)})]})]},e.id))})]}),ft=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[d,m]=(0,Y.useState)(!1),b=x(e),C=e.runs.filter(({id:e})=>e!==t?.id),w=e.run?.canRunAgain===!0?e.run:null,T=[{key:`links`,content:e.items.map(e=>(0,Q.jsxs)(v,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,Q.jsx)(S,{item:e,linked:!1}),` on GitHub`,(0,Q.jsx)(ee,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||C.length>0)&&T.push({key:`runs`,content:(0,Q.jsxs)(Q.Fragment,{children:[t!==null&&(0,Q.jsx)(f,{onClick:()=>r(t.id),children:`Open run`}),C.length>0&&(0,Q.jsx)(dt,{runs:C,openRun:r})]})});let E=i.isPending||a.isPending,D=w!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!E&&D&&T.push({key:`actions`,content:(0,Q.jsxs)(Q.Fragment,{children:[t?.canApprove&&(0,Q.jsx)(f,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:N.approve}),t?.canRetry&&(0,Q.jsx)(f,{title:M(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:N.retry}),w!==null&&(0,Q.jsxs)(f,{onClick:()=>a.send(w),children:[N.runAgain,(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:w.loop})]}),t?.canCancel&&(0,Q.jsx)(f,{variant:`destructive`,onClick:()=>m(!0),children:N.cancel})]})}),!n.disabled&&n.targets.length>0&&T.push({key:`move`,content:(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Move to`}),(0,Q.jsx)(g,{className:`min-w-40`,children:n.targets.map(t=>(0,Q.jsx)(f,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(h,{children:[(0,Q.jsx)(u,{render:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:k(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${b}`,children:(0,Q.jsx)(y,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(_,{align:`end`,className:`w-auto min-w-48`,children:T.map(({key:e,content:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&(0,Q.jsx)(c,{}),(0,Q.jsx)(s,{children:t})]},e))})]}),t!==null&&(0,Q.jsx)(_e,{open:d,onOpenChange:m,children:(0,Q.jsxs)(ye,{children:[(0,Q.jsxs)(ve,{children:[(0,Q.jsxs)(me,{children:[`Cancel `,t.loop,`?`]}),(0,Q.jsxs)(he,{children:[`The run on `,b,` stops, including any attempt in progress.`]})]}),(0,Q.jsxs)(ge,{children:[(0,Q.jsx)(fe,{children:N.keepRunning}),(0,Q.jsx)(be,{variant:`destructive`,onClick:()=>{m(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:N.confirmCancel})]})]})})]})},pt=e=>k(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),mt=(e,t,n)=>e.isPending&&e.variables!==void 0?ce[e.variables.request.action]:t.isPending?oe:n===void 0?null:te(n),ht=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:l,openRun:u})=>{let f=d(),p=lt(n.itemKey,u),{attributes:m,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=Me({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,Q.jsxs)(`div`,{ref:g,style:{transform:Ae.Translate.toString(v),transition:y},className:k(`group/task relative`,b&&`opacity-40`),children:[(0,Q.jsx)($,{ref:_,size:`sm`,className:k(pt(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&m,...a&&h,children:(0,Q.jsx)(ut,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:l,action:f,again:p,progress:mt(f,p,o)})}),(0,Q.jsx)(ft,{item:n,run:D(n),moves:s,openRun:u,action:f,again:p,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},gt=new Set([`Waiting`,`Queued`,`Running`]),_t=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(({runs:e})=>e.filter(({state:e,loop:t})=>gt.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),vt=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),yt=({flow:e})=>{let t=e.loops.length>0;return(0,Q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:k(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${vt(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,Q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&`, `,e,t&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:k(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},bt=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&ie(e.state)),xt=({sources:e,catalog:t})=>(0,Q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,Q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,Q.jsx)(q,{name:e.label,label:t.get(e.label)}):(0,Q.jsx)(B,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),St=({lane:e,open:t})=>(0,Q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,Q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,Q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),Ct=({project:e,showRepository:t,lane:n,lanes:r,flow:i,catalog:a,targeted:o,pending:s,readOnly:c,moves:l,stallOf:u,openRun:d,onMove:f})=>{let p=bt(n),[m,h]=(0,Y.useState)(p),g=n._tag===`WritableBoardLane`,{setNodeRef:_}=Fe({id:n.id,disabled:!g||s}),v=r.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),y=n.items.length,[b,x]=Ye();return re(p?[{label:E(n.name,m),run:()=>h(!m)}]:[]),p&&m?(0,Q.jsx)(St,{lane:n,open:()=>h(!1)}):(0,Q.jsxs)(`section`,{ref:_,"aria-label":`${n.name} lane`,className:k(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,o&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,Q.jsxs)(`header`,{className:k(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!o&&`bg-background`),children:[(0,Q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:y})]}),i!==void 0&&(0,Q.jsx)(yt,{flow:i}),p&&(0,Q.jsx)(A,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${n.name}`,title:`Fold ${n.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>h(!0),children:(0,Q.jsx)(Z,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,Q.jsx)(xt,{sources:n.sources,catalog:a})})]}),(0,Q.jsx)(`div`,{ref:b,"aria-label":`${n.name} cards`,tabIndex:x.above||x.below?0:void 0,className:k(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,x.above&&`mask-t-from-[calc(100%-2.5rem)]`,x.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,Q.jsxs)(Re,{items:n.items.map(({itemKey:e})=>e),strategy:De,children:[y===0&&(0,Q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),n.items.map(r=>{let i=l.find(({itemKey:e})=>e===r.itemKey)?.phase,o=s||i!==void 0;return(0,Q.jsx)(ht,{item:r,project:e,showRepository:t,lane:n,catalog:a,draggable:!o&&v.length>0,phase:i,moves:{targets:v,disabled:o,onMove:f},stall:u(r),readOnly:c,openRun:d},r.itemKey)})]})})]})},wt=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,Q.jsx)($,{size:`sm`,className:k(pt(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,Q.jsx)(ut,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),Tt=({runs:e,openRun:t})=>(0,Q.jsxs)($,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,Q.jsxs)(Xe,{children:[(0,Q.jsx)(Ze,{children:`Runs without a card`}),(0,Q.jsxs)(Qe,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,Q.jsx)($e,{children:(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(we,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(H,{children:`Loop`}),(0,Q.jsx)(H,{children:`Agent`}),(0,Q.jsx)(H,{children:`Item`}),(0,Q.jsx)(H,{children:`State`}),(0,Q.jsx)(H,{className:`w-0`})]})}),(0,Q.jsx)(Te,{children:e.map(e=>(0,Q.jsxs)(U,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,Q.jsx)(W,{className:`font-medium`,children:e.loop}),(0,Q.jsx)(W,{children:e.agent}),(0,Q.jsx)(W,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,Q.jsx)(W,{children:(0,Q.jsx)(Se,{state:e.state})}),(0,Q.jsx)(W,{className:`text-right`,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(X,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Et=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Dt=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ot=e=>{let t=G(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=G({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return ke(e)},kt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Ie(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},At=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey);return e.id===t.toLane?{...e,items:[i,...n]}:{...e,items:n}})},jt=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},Mt=({project:e,loops:t,stalled:n,disabled:r,openRun:i})=>{let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),{moves:l,moveItem:u,isPending:d,error:f}=ne(e),p=jt(e),m=l.reduce(At,Et(e.board.lanes)),h=je(K(Ne,{activationConstraint:{distance:6}}),K(Oe,{coordinateGetter:kt(m)})),g=_t(m,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),_=m.reduce((e,t)=>e+t.items.length,0),v=e=>Be(n,e),y=new Map(e.labels.map(e=>[e.name,e])),b=r||d,x=()=>{o(null),c(null)};return(0,Q.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,Q.jsx)(ue,{title:P(e),leading:(0,Q.jsx)(z,{repository:e.repository,size:`title`}),counts:`${m.length} lane${m.length===1?``:`s`}, ${_} item${_===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,Q.jsx)(Ce,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,Q.jsx)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:`Proposed lanes are read-only. Add lanes with labels in Configuration > Projects to enable moves.`}),e.board.failures.length>0&&(0,Q.jsx)(R,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-CdgpfpoU.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,b as o,c as s,d as c,f as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,s as _,u as v,v as y}from"./actions-BJ8FViiC.js";import{t as b}from"./link-3oQYoIpm.js";import{r as x,t as S}from"./mark-lp0qzo_h.js";import{a as C,i as w,l as ee,n as T,o as E,r as D,s as te,t as ne}from"./moves-BYTLKqNE.js";import{W as O,r as k,t as A}from"./button-CzVqBv_O.js";import{i as re}from"./context-8jHKzDOY.js";import{X as ie}from"./api-D3RWLycx.js";import{c as ae,v as j}from"./strings-BIVdGoBr.js";import{I as oe,M,N,O as se,P as ce,a as P,i as F,k as I,n as le}from"./overview-DLYaCoiG.js";import{a as L,i as ue}from"./page-BEpkTOW0.js";import{t as R}from"./error-alert-Bq-SD6of.js";import{t as de}from"./queries-ESTqS3FK.js";import{A as fe,D as pe,F as me,M as he,N as ge,O as _e,P as ve,Y as z,j as ye,k as be,o as xe,w as B}from"./index-B_6qmKij.js";import{n as V,r as Se,t as Ce}from"./status-badge-B2-vzEoZ.js";import{a as we,i as H,n as Te,o as U,r as W,t as Ee}from"./table-CKp2wE4u.js";import{a as De,c as Oe,d as G,f as ke,g as Ae,h as je,i as Me,l as Ne,m as K,o as Pe,p as Fe,r as Ie,s as Le,t as Re}from"./sortable.esm-D-1SvrpE.js";import{t as q}from"./label-badge-cRUT7_pk.js";import{t as ze}from"./action-CniC234z.js";import{f as Be,o as Ve,u as J}from"./model-C6gErpq3.js";import{n as He,t as Ue}from"./strings-DmAVtEUC.js";import{t as We}from"./project-not-found-BfK7XtjD.js";var Y=e(t(),1),Ge=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),Ke=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),Y.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),X=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:Ge}));X.displayName=`ArrowUpRightIcon`;var Z=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:Ke}));Z.displayName=`ArrowsInLineHorizontalIcon`;var qe=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:I(t),Je={above:!1,below:!1},Ye=()=>{let[e,t]=(0,Y.useState)(Je),n=(0,Y.useRef)(null);return[(0,Y.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},Q=n();function $({className:e,size:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:k(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Xe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-header`,className:k(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Ze({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-title`,className:k(`text-lg font-semibold`,e),...t})}function Qe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-description`,className:k(`text-sm text-muted-foreground`,e),...t})}function $e({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-(--card-spacing)`,e),...t})}var et=3,tt=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(et);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,et).map(e=>(0,Q.jsx)(q,{name:e,label:t.get(e)},e)),n.length>0&&(0,Q.jsxs)(B,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},nt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,rt=({item:e,project:t})=>{let n=r();return(0,Q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,Q.jsx)(b,{...t===void 0?{...n.task(e.repository,J(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:J(e)},search:{repository:e.repository}},draggable:!1,className:nt,children:(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},it=({failure:e,children:t})=>(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),at=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,Q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:M(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:N.retry}):null,ot=({run:e})=>{let t=L(3e4),n=w(e);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,Q.jsx)(V,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,Q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,Q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,Q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:qe(e.state,n),children:ae(n,t)}),(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]}),e.machineWait!==null&&(0,Q.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:se(e.machineWait)})]})},st=({stalled:e,named:t,children:n})=>{let r=L(3e4),i=He(e,r);return(0,Q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,Q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},ct=e=>[`run-again`,`board-card`,e],lt=(e,t)=>{let n=ct(e),r=a({mutationKey:n,onClaimed:t}),i=o({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(m(e))}},ut=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:c,progress:l})=>{let u=C(n),d=D(n),f=s?.error?.message??null,p=c?.error?.message??null,m=a!==null&&u!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===u.run.id,h=a===null||s===null?null:(0,Q.jsx)(ze,{stalled:a,readOnly:o,appearance:`card`}),g=n.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&a===null;return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,Q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,Q.jsx)(S,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(z,{repository:n.repository}),(0,Q.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,Q.jsx)(rt,{item:n,project:e}),(0,Q.jsx)(tt,{labels:T(n,r),catalog:i}),d!==null&&(0,Q.jsx)(ot,{run:d}),l!==null&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,Q.jsx)(it,{failure:u,children:m&&a?.reason._tag===`SuppressedForOperator`?h:(0,Q.jsx)(at,{failure:u,action:s})}),a!==null&&!m&&(0,Q.jsx)(st,{stalled:a,named:(d===null||Ve(a)?.id!==d.id)&&!Ue(a),children:h}),c?.data?._tag===`CycleBlocked`&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),n.conflicting&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,Q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},dt=({runs:e,openRun:t})=>(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Run history`}),(0,Q.jsx)(g,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,Q.jsxs)(f,{onClick:()=>t(e.id),children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,Q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(V,{state:e.state}),e.state]}),(0,Q.jsx)(`time`,{dateTime:e.openedAt,title:I(e.openedAt),className:`font-mono tabular-nums`,children:ae(e.openedAt)})]})]},e.id))})]}),ft=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[d,m]=(0,Y.useState)(!1),b=x(e),C=e.runs.filter(({id:e})=>e!==t?.id),w=e.run?.canRunAgain===!0?e.run:null,T=[{key:`links`,content:e.items.map(e=>(0,Q.jsxs)(v,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,Q.jsx)(S,{item:e,linked:!1}),` on GitHub`,(0,Q.jsx)(ee,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||C.length>0)&&T.push({key:`runs`,content:(0,Q.jsxs)(Q.Fragment,{children:[t!==null&&(0,Q.jsx)(f,{onClick:()=>r(t.id),children:`Open run`}),C.length>0&&(0,Q.jsx)(dt,{runs:C,openRun:r})]})});let E=i.isPending||a.isPending,D=w!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!E&&D&&T.push({key:`actions`,content:(0,Q.jsxs)(Q.Fragment,{children:[t?.canApprove&&(0,Q.jsx)(f,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:N.approve}),t?.canRetry&&(0,Q.jsx)(f,{title:M(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:N.retry}),w!==null&&(0,Q.jsxs)(f,{onClick:()=>a.send(w),children:[N.runAgain,(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:w.loop})]}),t?.canCancel&&(0,Q.jsx)(f,{variant:`destructive`,onClick:()=>m(!0),children:N.cancel})]})}),!n.disabled&&n.targets.length>0&&T.push({key:`move`,content:(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Move to`}),(0,Q.jsx)(g,{className:`min-w-40`,children:n.targets.map(t=>(0,Q.jsx)(f,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(h,{children:[(0,Q.jsx)(u,{render:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:k(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${b}`,children:(0,Q.jsx)(y,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(_,{align:`end`,className:`w-auto min-w-48`,children:T.map(({key:e,content:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&(0,Q.jsx)(c,{}),(0,Q.jsx)(s,{children:t})]},e))})]}),t!==null&&(0,Q.jsx)(_e,{open:d,onOpenChange:m,children:(0,Q.jsxs)(ye,{children:[(0,Q.jsxs)(ve,{children:[(0,Q.jsxs)(me,{children:[`Cancel `,t.loop,`?`]}),(0,Q.jsxs)(he,{children:[`The run on `,b,` stops, including any attempt in progress.`]})]}),(0,Q.jsxs)(ge,{children:[(0,Q.jsx)(fe,{children:N.keepRunning}),(0,Q.jsx)(be,{variant:`destructive`,onClick:()=>{m(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:N.confirmCancel})]})]})})]})},pt=e=>k(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),mt=(e,t,n)=>e.isPending&&e.variables!==void 0?ce[e.variables.request.action]:t.isPending?oe:n===void 0?null:te(n),ht=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:l,openRun:u})=>{let f=d(),p=lt(n.itemKey,u),{attributes:m,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=Me({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,Q.jsxs)(`div`,{ref:g,style:{transform:Ae.Translate.toString(v),transition:y},className:k(`group/task relative`,b&&`opacity-40`),children:[(0,Q.jsx)($,{ref:_,size:`sm`,className:k(pt(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&m,...a&&h,children:(0,Q.jsx)(ut,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:l,action:f,again:p,progress:mt(f,p,o)})}),(0,Q.jsx)(ft,{item:n,run:D(n),moves:s,openRun:u,action:f,again:p,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},gt=new Set([`Waiting`,`Queued`,`Running`]),_t=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(({runs:e})=>e.filter(({state:e,loop:t})=>gt.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),vt=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),yt=({flow:e})=>{let t=e.loops.length>0;return(0,Q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:k(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${vt(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,Q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&`, `,e,t&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:k(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},bt=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&ie(e.state)),xt=({sources:e,catalog:t})=>(0,Q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,Q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,Q.jsx)(q,{name:e.label,label:t.get(e.label)}):(0,Q.jsx)(B,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),St=({lane:e,open:t})=>(0,Q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,Q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,Q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),Ct=({project:e,showRepository:t,lane:n,lanes:r,flow:i,catalog:a,targeted:o,pending:s,readOnly:c,moves:l,stallOf:u,openRun:d,onMove:f})=>{let p=bt(n),[m,h]=(0,Y.useState)(p),g=n._tag===`WritableBoardLane`,{setNodeRef:_}=Fe({id:n.id,disabled:!g||s}),v=r.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),y=n.items.length,[b,x]=Ye();return re(p?[{label:E(n.name,m),run:()=>h(!m)}]:[]),p&&m?(0,Q.jsx)(St,{lane:n,open:()=>h(!1)}):(0,Q.jsxs)(`section`,{ref:_,"aria-label":`${n.name} lane`,className:k(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,o&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,Q.jsxs)(`header`,{className:k(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!o&&`bg-background`),children:[(0,Q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:y})]}),i!==void 0&&(0,Q.jsx)(yt,{flow:i}),p&&(0,Q.jsx)(A,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${n.name}`,title:`Fold ${n.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>h(!0),children:(0,Q.jsx)(Z,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,Q.jsx)(xt,{sources:n.sources,catalog:a})})]}),(0,Q.jsx)(`div`,{ref:b,"aria-label":`${n.name} cards`,tabIndex:x.above||x.below?0:void 0,className:k(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,x.above&&`mask-t-from-[calc(100%-2.5rem)]`,x.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,Q.jsxs)(Re,{items:n.items.map(({itemKey:e})=>e),strategy:De,children:[y===0&&(0,Q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),n.items.map(r=>{let i=l.find(({itemKey:e})=>e===r.itemKey)?.phase,o=s||i!==void 0;return(0,Q.jsx)(ht,{item:r,project:e,showRepository:t,lane:n,catalog:a,draggable:!o&&v.length>0,phase:i,moves:{targets:v,disabled:o,onMove:f},stall:u(r),readOnly:c,openRun:d},r.itemKey)})]})})]})},wt=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,Q.jsx)($,{size:`sm`,className:k(pt(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,Q.jsx)(ut,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),Tt=({runs:e,openRun:t})=>(0,Q.jsxs)($,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,Q.jsxs)(Xe,{children:[(0,Q.jsx)(Ze,{children:`Runs without a card`}),(0,Q.jsxs)(Qe,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,Q.jsx)($e,{children:(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(we,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(H,{children:`Loop`}),(0,Q.jsx)(H,{children:`Agent`}),(0,Q.jsx)(H,{children:`Item`}),(0,Q.jsx)(H,{children:`State`}),(0,Q.jsx)(H,{className:`w-0`})]})}),(0,Q.jsx)(Te,{children:e.map(e=>(0,Q.jsxs)(U,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,Q.jsx)(W,{className:`font-medium`,children:e.loop}),(0,Q.jsx)(W,{children:e.agent}),(0,Q.jsx)(W,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,Q.jsx)(W,{children:(0,Q.jsx)(Se,{state:e.state})}),(0,Q.jsx)(W,{className:`text-right`,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(X,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Et=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Dt=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ot=e=>{let t=G(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=G({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return ke(e)},kt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Ie(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},At=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey);return e.id===t.toLane?{...e,items:[i,...n]}:{...e,items:n}})},jt=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},Mt=({project:e,loops:t,stalled:n,disabled:r,openRun:i})=>{let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),{moves:l,moveItem:u,isPending:d,error:f}=ne(e),p=jt(e),m=l.reduce(At,Et(e.board.lanes)),h=je(K(Ne,{activationConstraint:{distance:6}}),K(Oe,{coordinateGetter:kt(m)})),g=_t(m,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),_=m.reduce((e,t)=>e+t.items.length,0),v=e=>Be(n,e),y=new Map(e.labels.map(e=>[e.name,e])),b=r||d,x=()=>{o(null),c(null)};return(0,Q.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,Q.jsx)(ue,{title:P(e),leading:(0,Q.jsx)(z,{repository:e.repository,size:`title`}),counts:`${m.length} lane${m.length===1?``:`s`}, ${_} item${_===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,Q.jsx)(Ce,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,Q.jsx)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:`Proposed lanes are read-only. Add lanes with labels in Configuration > Projects to enable moves.`}),e.board.failures.length>0&&(0,Q.jsx)(R,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
|
|
2
2
|
`)}),f!==null&&(0,Q.jsx)(R,{className:`mx-4 max-w-3xl md:mx-5`,message:f.message}),(0,Q.jsxs)(Pe,{sensors:h,collisionDetection:Ot,onDragStart:({active:e})=>{let t=m.find(({items:t})=>t.some(({itemKey:t})=>t===e.id)),n=t?.items.find(({itemKey:t})=>t===e.id);o(t===void 0||n===void 0?null:{item:n,lane:t})},onDragOver:({over:e})=>c(e===null?null:Dt(e.id,m)?.id??null),onDragEnd:({over:e})=>{if(x(),e===null||a===null)return;let t=Dt(e.id,m);t!==void 0&&u(a.item,t)},onDragCancel:x,children:[(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${P(e)} project board`,children:(0,Q.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,Q.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:m.map(t=>(0,Q.jsx)(Ct,{project:F(e),showRepository:e.repositories.length>1,lane:t,lanes:m,flow:g.get(t.id),catalog:y,targeted:a!==null&&s===t.id&&t.id!==a.lane.id&&t._tag===`WritableBoardLane`,pending:b,readOnly:r,moves:l,stallOf:v,openRun:i,onMove:u},t.id))}),p.length>0&&(0,Q.jsx)(Tt,{runs:p,openRun:i})]})}),(0,Q.jsx)(Le,{children:a!==null&&(0,Q.jsx)(wt,{item:a.item,project:F(e),showRepository:e.repositories.length>1,lane:a.lane,catalog:y,stall:v(a.item)})})]})]})},Nt=()=>{let{project:e}=xe.useParams(),{data:t}=i(le()),n=i(de()),r=pe(),a=t.projects.find(t=>F(t)===e);return a===void 0?(0,Q.jsx)(We,{}):(0,Q.jsx)(Mt,{project:a,loops:t.loops,stalled:n.data.notMoving,disabled:t._tag===`NeedsSetup`,openRun:r})};export{Nt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-Cxocu6W_.js";var t=e;export{t as errorComponent};
|