@jiggai/kitchen 0.3.13 → 0.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/server/app/_global-error.html +2 -2
  4. package/.next/server/app/_global-error.rsc +1 -1
  5. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found.html +1 -1
  11. package/.next/server/app/_not-found.rsc +2 -2
  12. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  13. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  18. package/.next/server/app/channels.html +2 -2
  19. package/.next/server/app/channels.rsc +2 -2
  20. package/.next/server/app/channels.segments/_full.segment.rsc +2 -2
  21. package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
  22. package/.next/server/app/channels.segments/_index.segment.rsc +1 -1
  23. package/.next/server/app/channels.segments/_tree.segment.rsc +1 -1
  24. package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +1 -1
  25. package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
  26. package/.next/server/app/goals/new.html +2 -2
  27. package/.next/server/app/goals/new.rsc +2 -2
  28. package/.next/server/app/goals/new.segments/_full.segment.rsc +2 -2
  29. package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
  30. package/.next/server/app/goals/new.segments/_index.segment.rsc +1 -1
  31. package/.next/server/app/goals/new.segments/_tree.segment.rsc +1 -1
  32. package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +1 -1
  33. package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
  34. package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
  35. package/.next/server/app/goals.html +1 -1
  36. package/.next/server/app/goals.rsc +2 -2
  37. package/.next/server/app/goals.segments/_full.segment.rsc +2 -2
  38. package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
  39. package/.next/server/app/goals.segments/_index.segment.rsc +1 -1
  40. package/.next/server/app/goals.segments/_tree.segment.rsc +1 -1
  41. package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +1 -1
  42. package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
  43. package/.next/server/app/settings.html +1 -1
  44. package/.next/server/app/settings.rsc +2 -2
  45. package/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  46. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  47. package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  48. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  49. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  50. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  51. package/.next/server/app/teams/[teamId]/page_client-reference-manifest.js +1 -1
  52. package/.next/server/app/teams/[teamId]/tickets/[ticket]/page_client-reference-manifest.js +1 -1
  53. package/.next/server/app/teams/[teamId]/tickets/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/tickets/[ticket]/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/tickets/page_client-reference-manifest.js +1 -1
  56. package/.next/server/chunks/[root-of-the-server]__01863a8b._.js +1 -1
  57. package/.next/server/chunks/[root-of-the-server]__01863a8b._.js.map +1 -1
  58. package/.next/server/chunks/[root-of-the-server]__04f289da._.js +1 -1
  59. package/.next/server/chunks/[root-of-the-server]__04f289da._.js.map +1 -1
  60. package/.next/server/chunks/[root-of-the-server]__05f5e243._.js +1 -1
  61. package/.next/server/chunks/[root-of-the-server]__05f5e243._.js.map +1 -1
  62. package/.next/server/chunks/[root-of-the-server]__08b4c8f2._.js +1 -1
  63. package/.next/server/chunks/[root-of-the-server]__08b4c8f2._.js.map +1 -1
  64. package/.next/server/chunks/[root-of-the-server]__0c4fc3d3._.js +1 -1
  65. package/.next/server/chunks/[root-of-the-server]__0c4fc3d3._.js.map +1 -1
  66. package/.next/server/chunks/[root-of-the-server]__1311d7a3._.js +1 -1
  67. package/.next/server/chunks/[root-of-the-server]__1311d7a3._.js.map +1 -1
  68. package/.next/server/chunks/[root-of-the-server]__18423bab._.js +1 -1
  69. package/.next/server/chunks/[root-of-the-server]__18423bab._.js.map +1 -1
  70. package/.next/server/chunks/[root-of-the-server]__1c6c2e43._.js +1 -1
  71. package/.next/server/chunks/[root-of-the-server]__1c6c2e43._.js.map +1 -1
  72. package/.next/server/chunks/[root-of-the-server]__30cd38e9._.js +1 -1
  73. package/.next/server/chunks/[root-of-the-server]__30cd38e9._.js.map +1 -1
  74. package/.next/server/chunks/[root-of-the-server]__3cfdf0b3._.js +2 -2
  75. package/.next/server/chunks/[root-of-the-server]__3cfdf0b3._.js.map +1 -1
  76. package/.next/server/chunks/[root-of-the-server]__3fdbc43e._.js +1 -1
  77. package/.next/server/chunks/[root-of-the-server]__3fdbc43e._.js.map +1 -1
  78. package/.next/server/chunks/[root-of-the-server]__4079fa2b._.js +1 -1
  79. package/.next/server/chunks/[root-of-the-server]__4079fa2b._.js.map +1 -1
  80. package/.next/server/chunks/[root-of-the-server]__453333f5._.js +1 -1
  81. package/.next/server/chunks/[root-of-the-server]__453333f5._.js.map +1 -1
  82. package/.next/server/chunks/[root-of-the-server]__47eb3111._.js +1 -1
  83. package/.next/server/chunks/[root-of-the-server]__47eb3111._.js.map +1 -1
  84. package/.next/server/chunks/[root-of-the-server]__502825d0._.js +2 -2
  85. package/.next/server/chunks/[root-of-the-server]__502825d0._.js.map +1 -1
  86. package/.next/server/chunks/[root-of-the-server]__50fe6ff8._.js +1 -1
  87. package/.next/server/chunks/[root-of-the-server]__50fe6ff8._.js.map +1 -1
  88. package/.next/server/chunks/[root-of-the-server]__51198e25._.js +1 -1
  89. package/.next/server/chunks/[root-of-the-server]__51198e25._.js.map +1 -1
  90. package/.next/server/chunks/[root-of-the-server]__542a081b._.js +1 -1
  91. package/.next/server/chunks/[root-of-the-server]__542a081b._.js.map +1 -1
  92. package/.next/server/chunks/[root-of-the-server]__5ceff0f3._.js +2 -2
  93. package/.next/server/chunks/[root-of-the-server]__5ceff0f3._.js.map +1 -1
  94. package/.next/server/chunks/[root-of-the-server]__5ea38a67._.js +1 -1
  95. package/.next/server/chunks/[root-of-the-server]__5ea38a67._.js.map +1 -1
  96. package/.next/server/chunks/[root-of-the-server]__63715de8._.js +1 -1
  97. package/.next/server/chunks/[root-of-the-server]__63715de8._.js.map +1 -1
  98. package/.next/server/chunks/[root-of-the-server]__69c45937._.js +1 -1
  99. package/.next/server/chunks/[root-of-the-server]__69c45937._.js.map +1 -1
  100. package/.next/server/chunks/[root-of-the-server]__6caa8f2d._.js +1 -1
  101. package/.next/server/chunks/[root-of-the-server]__6caa8f2d._.js.map +1 -1
  102. package/.next/server/chunks/[root-of-the-server]__6f4e90a0._.js +1 -1
  103. package/.next/server/chunks/[root-of-the-server]__6f4e90a0._.js.map +1 -1
  104. package/.next/server/chunks/[root-of-the-server]__7459129e._.js +1 -1
  105. package/.next/server/chunks/[root-of-the-server]__7459129e._.js.map +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__7bf889c1._.js +1 -1
  107. package/.next/server/chunks/[root-of-the-server]__7bf889c1._.js.map +1 -1
  108. package/.next/server/chunks/[root-of-the-server]__89605574._.js +1 -1
  109. package/.next/server/chunks/[root-of-the-server]__89605574._.js.map +1 -1
  110. package/.next/server/chunks/[root-of-the-server]__99b12bcb._.js +1 -1
  111. package/.next/server/chunks/[root-of-the-server]__99b12bcb._.js.map +1 -1
  112. package/.next/server/chunks/[root-of-the-server]__9d0ea07b._.js +1 -1
  113. package/.next/server/chunks/[root-of-the-server]__9d0ea07b._.js.map +1 -1
  114. package/.next/server/chunks/[root-of-the-server]__a49c534d._.js +1 -1
  115. package/.next/server/chunks/[root-of-the-server]__a49c534d._.js.map +1 -1
  116. package/.next/server/chunks/[root-of-the-server]__a74a32d5._.js +1 -1
  117. package/.next/server/chunks/[root-of-the-server]__a74a32d5._.js.map +1 -1
  118. package/.next/server/chunks/[root-of-the-server]__b002764e._.js +1 -1
  119. package/.next/server/chunks/[root-of-the-server]__b002764e._.js.map +1 -1
  120. package/.next/server/chunks/[root-of-the-server]__b64936a3._.js +1 -1
  121. package/.next/server/chunks/[root-of-the-server]__b64936a3._.js.map +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__bbdb6dcb._.js +2 -2
  123. package/.next/server/chunks/[root-of-the-server]__bbdb6dcb._.js.map +1 -1
  124. package/.next/server/chunks/[root-of-the-server]__bccfb2c0._.js +2 -2
  125. package/.next/server/chunks/[root-of-the-server]__bccfb2c0._.js.map +1 -1
  126. package/.next/server/chunks/[root-of-the-server]__c5e88cbb._.js +1 -1
  127. package/.next/server/chunks/[root-of-the-server]__c5e88cbb._.js.map +1 -1
  128. package/.next/server/chunks/[root-of-the-server]__d924e5ac._.js +1 -1
  129. package/.next/server/chunks/[root-of-the-server]__d924e5ac._.js.map +1 -1
  130. package/.next/server/chunks/[root-of-the-server]__e063a986._.js +1 -1
  131. package/.next/server/chunks/[root-of-the-server]__e063a986._.js.map +1 -1
  132. package/.next/server/chunks/[root-of-the-server]__e478ef0d._.js +1 -1
  133. package/.next/server/chunks/[root-of-the-server]__e478ef0d._.js.map +1 -1
  134. package/.next/server/chunks/[root-of-the-server]__f4cbadf7._.js +1 -1
  135. package/.next/server/chunks/[root-of-the-server]__f4cbadf7._.js.map +1 -1
  136. package/.next/server/chunks/[root-of-the-server]__ff69832c._.js +2 -2
  137. package/.next/server/chunks/[root-of-the-server]__ff69832c._.js.map +1 -1
  138. package/.next/server/chunks/ssr/[root-of-the-server]__17b046ea._.js +1 -1
  139. package/.next/server/chunks/ssr/[root-of-the-server]__17b046ea._.js.map +1 -1
  140. package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js +1 -1
  141. package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js.map +1 -1
  142. package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js +1 -1
  143. package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js.map +1 -1
  144. package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js +1 -1
  145. package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js.map +1 -1
  146. package/.next/server/chunks/ssr/[root-of-the-server]__c777e326._.js +1 -1
  147. package/.next/server/chunks/ssr/[root-of-the-server]__c777e326._.js.map +1 -1
  148. package/.next/server/chunks/ssr/_7f9e89d2._.js +1 -1
  149. package/.next/server/chunks/ssr/_7f9e89d2._.js.map +1 -1
  150. package/.next/server/chunks/ssr/src_59477309._.js +1 -1
  151. package/.next/server/chunks/ssr/src_59477309._.js.map +1 -1
  152. package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_index_tsx_e68e9cbc._.js +1 -1
  153. package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_index_tsx_e68e9cbc._.js.map +1 -1
  154. package/.next/server/chunks/ssr/src_app_tickets_TicketsBoardClient_tsx_5e156ef3._.js +1 -1
  155. package/.next/server/chunks/ssr/src_app_tickets_TicketsBoardClient_tsx_5e156ef3._.js.map +1 -1
  156. package/.next/server/pages/404.html +1 -1
  157. package/.next/server/pages/500.html +2 -2
  158. package/.next/static/chunks/4a6dcf80b293d7a4.js +1 -0
  159. package/.next/static/chunks/{5f77499ca309ab9d.js → a719c5f36ffeec2a.js} +1 -1
  160. package/.next/static/chunks/{febbbb81927c8042.js → e083bcf4a197beae.js} +1 -1
  161. package/openclaw.plugin.json +1 -1
  162. package/package.json +1 -1
  163. package/.next/static/chunks/be12a66bd736fad8.js +0 -1
  164. /package/.next/static/{uTm9pVsF7AuRLSQKZwTWp → Wr2xJ4v7YSX2YxupoHWtl}/_buildManifest.js +0 -0
  165. /package/.next/static/{uTm9pVsF7AuRLSQKZwTWp → Wr2xJ4v7YSX2YxupoHWtl}/_clientMiddlewareManifest.json +0 -0
  166. /package/.next/static/{uTm9pVsF7AuRLSQKZwTWp → Wr2xJ4v7YSX2YxupoHWtl}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[31105,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131);let e=[{key:"backlog",label:"Backlog"},{key:"in-progress",label:"In progress"},{key:"testing",label:"Testing"},{key:"done",label:"Done"}],f=[{key:"all",label:"All"},{key:"today",label:"Today"},{key:"yesterday",label:"Yesterday"},{key:"7d",label:"Last 7 days"},{key:"30d",label:"Last 30 days"},{key:"custom",label:"Custom range"}];function g(a){if(!a)return null;let b=a.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!b)return null;let c=new Date(Number(b[1]),Number(b[2])-1,Number(b[3]),0,0,0,0);return Number.isFinite(c.getTime())?c:null}function h({tickets:a,basePath:h,selectedTeamId:i}){let j=i?`ck-tickets-date-filter:${i}`:"ck-tickets-date-filter:all",[k,l]=(0,d.useState)(()=>"30d"),[m,n]=(0,d.useState)(""),[o,p]=(0,d.useState)(""),q=(0,d.useMemo)(()=>{var b;if("all"===k)return a;let c=new Date((b=new Date).getFullYear(),b.getMonth(),b.getDate(),0,0,0,0),d=new Date(c);d.setDate(d.getDate()-1);let e=null,f=null;if("today"===k)e=c,(f=new Date(c)).setDate(f.getDate()+1);else if("yesterday"===k)e=d,f=c;else if("7d"===k)(e=new Date(c)).setDate(e.getDate()-6);else if("30d"===k)(e=new Date(c)).setDate(e.getDate()-29);else if("custom"===k){e=g(m);let a=g(o);a&&(f=new Date(a)).setDate(f.getDate()+1)}return a.filter(a=>{let b=new Date(a.updatedAt);return!!Number.isFinite(b.getTime())&&(!e||!(b<e))&&(!f||!(b>=f))})},[a,k,m,o]),r=(0,d.useMemo)(()=>{let a={backlog:[],"in-progress":[],testing:[],done:[]};for(let b of q)a[b.stage].push(b);for(let b of Object.keys(a))a[b].sort((a,b)=>a.number-b.number);return a},[q]);return(0,d.useEffect)(()=>{},[k,j]),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Tickets"}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Viewing: ",(0,b.jsx)("span",{className:"font-medium text-[color:var(--ck-text-secondary)]",children:i??"all"})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,b.jsxs)("label",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:["Time",(0,b.jsx)("select",{className:"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs",value:k,onChange:a=>l(a.target.value),children:f.map(a=>(0,b.jsx)("option",{value:a.key,children:a.label},a.key))})]}),"custom"===k?(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("label",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:["From",(0,b.jsx)("input",{type:"date",value:m,onChange:a=>n(a.target.value),className:"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs"})]}),(0,b.jsxs)("label",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:["To",(0,b.jsx)("input",{type:"date",value:o,onChange:a=>p(a.target.value),className:"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs"})]})]}):null]})]}),(0,b.jsx)("div",{className:"grid gap-4 lg:grid-cols-4",children:e.map(({key:a,label:d})=>(0,b.jsxs)("section",{className:"ck-glass p-3",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold tracking-tight",children:d}),(0,b.jsx)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:r[a].length})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[0===r[a].length?(0,b.jsx)("div",{className:"rounded-[var(--ck-radius-sm)] border border-dashed border-[color:var(--ck-border-subtle)] p-3 text-xs text-[color:var(--ck-text-tertiary)]",children:"Empty"}):null,r[a].map(a=>{var d;let e;return(0,b.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass-strong)] p-3",children:[(0,b.jsxs)(c.default,{href:(e=`${h}/${encodeURIComponent(a.id)}`,i?`${e}?team=${encodeURIComponent(i)}`:e),prefetch:!1,className:"block text-sm font-medium text-[color:var(--ck-text-primary)] hover:underline",children:[String(a.number).padStart(4,"0")," — ",a.title]}),(0,b.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,b.jsx)("span",{className:"rounded bg-white/5 px-1.5 py-0.5",children:a.teamId}),(0,b.jsx)("span",{children:"·"}),(0,b.jsx)("span",{children:a.owner?`Owner: ${a.owner}`:"Owner: —"}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:["Age: ",(d=a.ageHours)<1?`${Math.max(1,Math.round(60*d))}m`:d<48?`${Math.round(d)}h`:`${Math.round(d/24)}d`]})]})]},`${a.teamId}:${a.id}`)})]})]},a))}),(0,b.jsx)("p",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Source of truth: ticket markdown files in the team workspace."})]})}a.s(["TicketsBoardClient",()=>h])}];
1
+ module.exports=[31105,a=>{"use strict";var b=a.i(87924),c=a.i(38246),d=a.i(72131);let e=[{key:"backlog",label:"Backlog"},{key:"in-progress",label:"In progress"},{key:"testing",label:"Testing"},{key:"done",label:"Done"}],f=[{key:"all",label:"All"},{key:"today",label:"Today"},{key:"yesterday",label:"Yesterday"},{key:"7d",label:"Last 7 days"},{key:"30d",label:"Last 30 days"},{key:"custom",label:"Custom range"}];function g(a){if(!a)return null;let b=a.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!b)return null;let c=new Date(Number(b[1]),Number(b[2])-1,Number(b[3]),0,0,0,0);return Number.isFinite(c.getTime())?c:null}function h({tickets:a,basePath:h,selectedTeamId:i}){let j=i?`ck-tickets-date-filter:${i}`:"ck-tickets-date-filter:all",[k,l]=(0,d.useState)(()=>"30d"),[m,n]=(0,d.useState)(""),[o,p]=(0,d.useState)(""),q=(0,d.useMemo)(()=>{var b;if("all"===k)return a;let c=new Date((b=new Date).getFullYear(),b.getMonth(),b.getDate(),0,0,0,0),d=new Date(c);d.setDate(d.getDate()-1);let e=null,f=null;if("today"===k)e=c,(f=new Date(c)).setDate(f.getDate()+1);else if("yesterday"===k)e=d,f=c;else if("7d"===k)(e=new Date(c)).setDate(e.getDate()-6);else if("30d"===k)(e=new Date(c)).setDate(e.getDate()-29);else if("custom"===k){e=g(m);let a=g(o);a&&(f=new Date(a)).setDate(f.getDate()+1)}return a.filter(a=>{let b=new Date(a.updatedAt);return!!Number.isFinite(b.getTime())&&(!e||!(b<e))&&(!f||!(b>=f))})},[a,k,m,o]),r=(0,d.useMemo)(()=>{let a={backlog:[],"in-progress":[],testing:[],done:[]};for(let b of q)a[b.stage].push(b);for(let b of Object.keys(a))a[b].sort((a,b)=>a.number-b.number);return a},[q]);return(0,d.useEffect)(()=>{},[k,j]),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Tickets"}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Viewing: ",(0,b.jsx)("span",{className:"font-medium text-[color:var(--ck-text-secondary)]",children:i??"all"})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,b.jsxs)("label",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:["Time",(0,b.jsx)("select",{className:"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs",value:k,onChange:a=>l(a.target.value),children:f.map(a=>(0,b.jsx)("option",{value:a.key,children:a.label},a.key))})]}),"custom"===k?(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("label",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:["From",(0,b.jsx)("input",{type:"date",value:m,onChange:a=>n(a.target.value),className:"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs"})]}),(0,b.jsxs)("label",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:["To",(0,b.jsx)("input",{type:"date",value:o,onChange:a=>p(a.target.value),className:"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs"})]})]}):null]})]}),(0,b.jsx)("div",{className:"grid gap-4 lg:grid-cols-4",children:e.map(({key:a,label:d})=>(0,b.jsxs)("section",{className:"ck-glass p-3",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold tracking-tight",children:d}),(0,b.jsx)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:r[a].length})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[0===r[a].length?(0,b.jsx)("div",{className:"rounded-[var(--ck-radius-sm)] border border-dashed border-[color:var(--ck-border-subtle)] p-3 text-xs text-[color:var(--ck-text-tertiary)]",children:"Empty"}):null,r[a].map(a=>{var d;let e,f;return(0,b.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass-strong)] p-3",children:[(0,b.jsxs)(c.default,{href:(e=`${h}/${encodeURIComponent(a.id)}`,(f=i||a.teamId)?`${e}?team=${encodeURIComponent(f)}`:e),prefetch:!1,className:"block text-sm font-medium text-[color:var(--ck-text-primary)] hover:underline",children:[String(a.number).padStart(4,"0")," — ",a.title]}),(0,b.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,b.jsx)("span",{className:"rounded bg-white/5 px-1.5 py-0.5",children:a.teamId}),(0,b.jsx)("span",{children:"·"}),(0,b.jsx)("span",{children:a.owner?`Owner: ${a.owner}`:"Owner: —"}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:["Age: ",(d=a.ageHours)<1?`${Math.max(1,Math.round(60*d))}m`:d<48?`${Math.round(d)}h`:`${Math.round(d/24)}d`]})]})]},`${a.teamId}:${a.id}`)})]})]},a))}),(0,b.jsx)("p",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Source of truth: ticket markdown files in the team workspace."})]})}a.s(["TicketsBoardClient",()=>h])}];
2
2
 
3
3
  //# sourceMappingURL=src_app_tickets_TicketsBoardClient_tsx_5e156ef3._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/app/tickets/TicketsBoardClient.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport type { TicketStage, TicketSummary } from \"@/lib/tickets\";\n\nconst STAGES: { key: TicketStage; label: string }[] = [\n { key: \"backlog\", label: \"Backlog\" },\n { key: \"in-progress\", label: \"In progress\" },\n { key: \"testing\", label: \"Testing\" },\n { key: \"done\", label: \"Done\" },\n];\n\ntype DateFilter = \"all\" | \"today\" | \"yesterday\" | \"7d\" | \"30d\" | \"custom\";\nconst DATE_FILTERS: { key: DateFilter; label: string }[] = [\n { key: \"all\", label: \"All\" },\n { key: \"today\", label: \"Today\" },\n { key: \"yesterday\", label: \"Yesterday\" },\n { key: \"7d\", label: \"Last 7 days\" },\n { key: \"30d\", label: \"Last 30 days\" },\n { key: \"custom\", label: \"Custom range\" },\n];\n\nfunction startOfLocalDay(d: Date) {\n return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0, 0, 0);\n}\n\nfunction parseDateInput(value: string): Date | null {\n if (!value) return null;\n const m = value.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/);\n if (!m) return null;\n const y = Number(m[1]);\n const mo = Number(m[2]) - 1;\n const day = Number(m[3]);\n const d = new Date(y, mo, day, 0, 0, 0, 0);\n return Number.isFinite(d.getTime()) ? d : null;\n}\n\nfunction formatAge(hours: number) {\n if (hours < 1) return `${Math.max(1, Math.round(hours * 60))}m`;\n if (hours < 48) return `${Math.round(hours)}h`;\n return `${Math.round(hours / 24)}d`;\n}\n\nexport function TicketsBoardClient({\n tickets,\n basePath,\n selectedTeamId,\n}: {\n tickets: TicketSummary[];\n basePath: string;\n selectedTeamId: string | null;\n}) {\n const storageKey = selectedTeamId ? `ck-tickets-date-filter:${selectedTeamId}` : \"ck-tickets-date-filter:all\";\n\n const [dateFilter, setDateFilter] = useState<DateFilter>(() => {\n if (typeof window === \"undefined\") return \"30d\";\n try {\n const raw = (localStorage.getItem(storageKey) || \"\").trim();\n if (raw === \"all\" || raw === \"today\" || raw === \"yesterday\" || raw === \"7d\" || raw === \"30d\" || raw === \"custom\") return raw;\n return \"30d\";\n } catch {\n return \"30d\";\n }\n });\n\n const [customFrom, setCustomFrom] = useState<string>(\"\");\n const [customTo, setCustomTo] = useState<string>(\"\");\n\n const filteredTickets = useMemo(() => {\n if (dateFilter === \"all\") return tickets;\n\n const now = new Date();\n const todayStart = startOfLocalDay(now);\n const yesterdayStart = new Date(todayStart);\n yesterdayStart.setDate(yesterdayStart.getDate() - 1);\n\n let from: Date | null = null;\n let toExclusive: Date | null = null;\n\n if (dateFilter === \"today\") {\n from = todayStart;\n toExclusive = new Date(todayStart);\n toExclusive.setDate(toExclusive.getDate() + 1);\n } else if (dateFilter === \"yesterday\") {\n from = yesterdayStart;\n toExclusive = todayStart;\n } else if (dateFilter === \"7d\") {\n from = new Date(todayStart);\n from.setDate(from.getDate() - 6); // include today\n } else if (dateFilter === \"30d\") {\n from = new Date(todayStart);\n from.setDate(from.getDate() - 29); // include today\n } else if (dateFilter === \"custom\") {\n from = parseDateInput(customFrom);\n const to = parseDateInput(customTo);\n if (to) {\n toExclusive = new Date(to);\n toExclusive.setDate(toExclusive.getDate() + 1);\n }\n }\n\n return tickets.filter((t) => {\n const updated = new Date(t.updatedAt);\n if (!Number.isFinite(updated.getTime())) return false;\n if (from && updated < from) return false;\n if (toExclusive && updated >= toExclusive) return false;\n return true;\n });\n }, [tickets, dateFilter, customFrom, customTo]);\n\n const byStage = useMemo(() => {\n const map: Record<TicketStage, TicketSummary[]> = {\n backlog: [],\n \"in-progress\": [],\n testing: [],\n done: [],\n };\n for (const t of filteredTickets) map[t.stage].push(t);\n for (const s of Object.keys(map) as TicketStage[]) {\n map[s].sort((a, b) => a.number - b.number);\n }\n return map;\n }, [filteredTickets]);\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n try {\n localStorage.setItem(storageKey, dateFilter);\n } catch {\n // ignore\n }\n }, [dateFilter, storageKey]);\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight\">Tickets</h1>\n <p className=\"mt-1 text-xs text-[color:var(--ck-text-tertiary)]\">\n Viewing: <span className=\"font-medium text-[color:var(--ck-text-secondary)]\">{selectedTeamId ?? \"all\"}</span>\n </p>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-3\">\n <label className=\"text-xs text-[color:var(--ck-text-secondary)]\">\n Time\n <select\n className=\"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs\"\n value={dateFilter}\n onChange={(e) => setDateFilter(e.target.value as DateFilter)}\n >\n {DATE_FILTERS.map((f) => (\n <option key={f.key} value={f.key}>\n {f.label}\n </option>\n ))}\n </select>\n </label>\n\n {dateFilter === \"custom\" ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <label className=\"text-xs text-[color:var(--ck-text-secondary)]\">\n From\n <input\n type=\"date\"\n value={customFrom}\n onChange={(e) => setCustomFrom(e.target.value)}\n className=\"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs\"\n />\n </label>\n <label className=\"text-xs text-[color:var(--ck-text-secondary)]\">\n To\n <input\n type=\"date\"\n value={customTo}\n onChange={(e) => setCustomTo(e.target.value)}\n className=\"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs\"\n />\n </label>\n </div>\n ) : null}\n </div>\n </div>\n\n <div className=\"grid gap-4 lg:grid-cols-4\">\n {STAGES.map(({ key, label }) => (\n <section key={key} className=\"ck-glass p-3\">\n <div className=\"mb-3 flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold tracking-tight\">{label}</h2>\n <span className=\"text-xs text-[color:var(--ck-text-tertiary)]\">{byStage[key].length}</span>\n </div>\n\n <div className=\"space-y-2\">\n {byStage[key].length === 0 ? (\n <div className=\"rounded-[var(--ck-radius-sm)] border border-dashed border-[color:var(--ck-border-subtle)] p-3 text-xs text-[color:var(--ck-text-tertiary)]\">\n Empty\n </div>\n ) : null}\n\n {byStage[key].map((t) => (\n <div\n key={`${t.teamId}:${t.id}`}\n className=\"rounded-[var(--ck-radius-sm)] border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass-strong)] p-3\"\n >\n <Link\n href={(() => {\n const base = `${basePath}/${encodeURIComponent(t.id)}`;\n if (!selectedTeamId) return base;\n return `${base}?team=${encodeURIComponent(selectedTeamId)}`;\n })()}\n prefetch={false}\n className=\"block text-sm font-medium text-[color:var(--ck-text-primary)] hover:underline\"\n >\n {String(t.number).padStart(4, \"0\")} — {t.title}\n </Link>\n <div className=\"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[color:var(--ck-text-secondary)]\">\n <span className=\"rounded bg-white/5 px-1.5 py-0.5\">{t.teamId}</span>\n <span>·</span>\n <span>{t.owner ? `Owner: ${t.owner}` : \"Owner: —\"}</span>\n <span>·</span>\n <span>Age: {formatAge(t.ageHours)}</span>\n </div>\n </div>\n ))}\n </div>\n </section>\n ))}\n </div>\n\n <p className=\"text-xs text-[color:var(--ck-text-tertiary)]\">Source of truth: ticket markdown files in the team workspace.</p>\n </div>\n );\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"sources":["../../../../src/app/tickets/TicketsBoardClient.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport type { TicketStage, TicketSummary } from \"@/lib/tickets\";\n\nconst STAGES: { key: TicketStage; label: string }[] = [\n { key: \"backlog\", label: \"Backlog\" },\n { key: \"in-progress\", label: \"In progress\" },\n { key: \"testing\", label: \"Testing\" },\n { key: \"done\", label: \"Done\" },\n];\n\ntype DateFilter = \"all\" | \"today\" | \"yesterday\" | \"7d\" | \"30d\" | \"custom\";\nconst DATE_FILTERS: { key: DateFilter; label: string }[] = [\n { key: \"all\", label: \"All\" },\n { key: \"today\", label: \"Today\" },\n { key: \"yesterday\", label: \"Yesterday\" },\n { key: \"7d\", label: \"Last 7 days\" },\n { key: \"30d\", label: \"Last 30 days\" },\n { key: \"custom\", label: \"Custom range\" },\n];\n\nfunction startOfLocalDay(d: Date) {\n return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0, 0, 0);\n}\n\nfunction parseDateInput(value: string): Date | null {\n if (!value) return null;\n const m = value.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/);\n if (!m) return null;\n const y = Number(m[1]);\n const mo = Number(m[2]) - 1;\n const day = Number(m[3]);\n const d = new Date(y, mo, day, 0, 0, 0, 0);\n return Number.isFinite(d.getTime()) ? d : null;\n}\n\nfunction formatAge(hours: number) {\n if (hours < 1) return `${Math.max(1, Math.round(hours * 60))}m`;\n if (hours < 48) return `${Math.round(hours)}h`;\n return `${Math.round(hours / 24)}d`;\n}\n\nexport function TicketsBoardClient({\n tickets,\n basePath,\n selectedTeamId,\n}: {\n tickets: TicketSummary[];\n basePath: string;\n selectedTeamId: string | null;\n}) {\n const storageKey = selectedTeamId ? `ck-tickets-date-filter:${selectedTeamId}` : \"ck-tickets-date-filter:all\";\n\n const [dateFilter, setDateFilter] = useState<DateFilter>(() => {\n if (typeof window === \"undefined\") return \"30d\";\n try {\n const raw = (localStorage.getItem(storageKey) || \"\").trim();\n if (raw === \"all\" || raw === \"today\" || raw === \"yesterday\" || raw === \"7d\" || raw === \"30d\" || raw === \"custom\") return raw;\n return \"30d\";\n } catch {\n return \"30d\";\n }\n });\n\n const [customFrom, setCustomFrom] = useState<string>(\"\");\n const [customTo, setCustomTo] = useState<string>(\"\");\n\n const filteredTickets = useMemo(() => {\n if (dateFilter === \"all\") return tickets;\n\n const now = new Date();\n const todayStart = startOfLocalDay(now);\n const yesterdayStart = new Date(todayStart);\n yesterdayStart.setDate(yesterdayStart.getDate() - 1);\n\n let from: Date | null = null;\n let toExclusive: Date | null = null;\n\n if (dateFilter === \"today\") {\n from = todayStart;\n toExclusive = new Date(todayStart);\n toExclusive.setDate(toExclusive.getDate() + 1);\n } else if (dateFilter === \"yesterday\") {\n from = yesterdayStart;\n toExclusive = todayStart;\n } else if (dateFilter === \"7d\") {\n from = new Date(todayStart);\n from.setDate(from.getDate() - 6); // include today\n } else if (dateFilter === \"30d\") {\n from = new Date(todayStart);\n from.setDate(from.getDate() - 29); // include today\n } else if (dateFilter === \"custom\") {\n from = parseDateInput(customFrom);\n const to = parseDateInput(customTo);\n if (to) {\n toExclusive = new Date(to);\n toExclusive.setDate(toExclusive.getDate() + 1);\n }\n }\n\n return tickets.filter((t) => {\n const updated = new Date(t.updatedAt);\n if (!Number.isFinite(updated.getTime())) return false;\n if (from && updated < from) return false;\n if (toExclusive && updated >= toExclusive) return false;\n return true;\n });\n }, [tickets, dateFilter, customFrom, customTo]);\n\n const byStage = useMemo(() => {\n const map: Record<TicketStage, TicketSummary[]> = {\n backlog: [],\n \"in-progress\": [],\n testing: [],\n done: [],\n };\n for (const t of filteredTickets) map[t.stage].push(t);\n for (const s of Object.keys(map) as TicketStage[]) {\n map[s].sort((a, b) => a.number - b.number);\n }\n return map;\n }, [filteredTickets]);\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n try {\n localStorage.setItem(storageKey, dateFilter);\n } catch {\n // ignore\n }\n }, [dateFilter, storageKey]);\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight\">Tickets</h1>\n <p className=\"mt-1 text-xs text-[color:var(--ck-text-tertiary)]\">\n Viewing: <span className=\"font-medium text-[color:var(--ck-text-secondary)]\">{selectedTeamId ?? \"all\"}</span>\n </p>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-3\">\n <label className=\"text-xs text-[color:var(--ck-text-secondary)]\">\n Time\n <select\n className=\"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs\"\n value={dateFilter}\n onChange={(e) => setDateFilter(e.target.value as DateFilter)}\n >\n {DATE_FILTERS.map((f) => (\n <option key={f.key} value={f.key}>\n {f.label}\n </option>\n ))}\n </select>\n </label>\n\n {dateFilter === \"custom\" ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <label className=\"text-xs text-[color:var(--ck-text-secondary)]\">\n From\n <input\n type=\"date\"\n value={customFrom}\n onChange={(e) => setCustomFrom(e.target.value)}\n className=\"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs\"\n />\n </label>\n <label className=\"text-xs text-[color:var(--ck-text-secondary)]\">\n To\n <input\n type=\"date\"\n value={customTo}\n onChange={(e) => setCustomTo(e.target.value)}\n className=\"ml-2 rounded border border-[color:var(--ck-border-subtle)] bg-transparent px-2 py-1 text-xs\"\n />\n </label>\n </div>\n ) : null}\n </div>\n </div>\n\n <div className=\"grid gap-4 lg:grid-cols-4\">\n {STAGES.map(({ key, label }) => (\n <section key={key} className=\"ck-glass p-3\">\n <div className=\"mb-3 flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold tracking-tight\">{label}</h2>\n <span className=\"text-xs text-[color:var(--ck-text-tertiary)]\">{byStage[key].length}</span>\n </div>\n\n <div className=\"space-y-2\">\n {byStage[key].length === 0 ? (\n <div className=\"rounded-[var(--ck-radius-sm)] border border-dashed border-[color:var(--ck-border-subtle)] p-3 text-xs text-[color:var(--ck-text-tertiary)]\">\n Empty\n </div>\n ) : null}\n\n {byStage[key].map((t) => (\n <div\n key={`${t.teamId}:${t.id}`}\n className=\"rounded-[var(--ck-radius-sm)] border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass-strong)] p-3\"\n >\n <Link\n href={(() => {\n const base = `${basePath}/${encodeURIComponent(t.id)}`;\n const team = selectedTeamId || t.teamId;\n return team ? `${base}?team=${encodeURIComponent(team)}` : base;\n })()}\n prefetch={false}\n className=\"block text-sm font-medium text-[color:var(--ck-text-primary)] hover:underline\"\n >\n {String(t.number).padStart(4, \"0\")} — {t.title}\n </Link>\n <div className=\"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-[color:var(--ck-text-secondary)]\">\n <span className=\"rounded bg-white/5 px-1.5 py-0.5\">{t.teamId}</span>\n <span>·</span>\n <span>{t.owner ? `Owner: ${t.owner}` : \"Owner: —\"}</span>\n <span>·</span>\n <span>Age: {formatAge(t.ageHours)}</span>\n </div>\n </div>\n ))}\n </div>\n </section>\n ))}\n </div>\n\n <p className=\"text-xs text-[color:var(--ck-text-tertiary)]\">Source of truth: ticket markdown files in the team workspace.</p>\n </div>\n );\n}\n"],"names":[],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGA,IAAM,EAAgD,CACpD,CAAE,IAAK,UAAW,MAAO,SAAU,EACnC,CAAE,IAAK,cAAe,MAAO,aAAc,EAC3C,CAAE,IAAK,UAAW,MAAO,SAAU,EACnC,CAAE,IAAK,OAAQ,MAAO,MAAO,EAC9B,CAGK,EAAqD,CACzD,CAAE,IAAK,MAAO,MAAO,KAAM,EAC3B,CAAE,IAAK,QAAS,MAAO,OAAQ,EAC/B,CAAE,IAAK,YAAa,MAAO,WAAY,EACvC,CAAE,IAAK,KAAM,MAAO,aAAc,EAClC,CAAE,IAAK,MAAO,MAAO,cAAe,EACpC,CAAE,IAAK,SAAU,MAAO,cAAe,EACxC,CAMD,SAAS,EAAe,CAAa,EACnC,GAAI,CAAC,EAAO,OAAO,KACnB,IAAM,EAAI,EAAM,KAAK,CAAC,6BACtB,GAAI,CAAC,EAAG,OAAO,KACf,IAGM,EAAI,AAHJ,IAGQ,KAHJ,AAGS,GAAG,IAAI,AAHT,CAAC,CAAC,EAAE,EACV,OAAO,CAAC,CAAC,EAAE,EAAI,EACd,OAAO,CAAC,CAAC,EAAE,EACQ,EAAG,EAAG,EAAG,GACxC,OAAO,OAAO,QAAQ,CAAC,EAAE,OAAO,IAAM,EAAI,IAC5C,CAQO,SAAS,EAAmB,SACjC,CAAO,UACP,CAAQ,gBACR,CAAc,CAKf,EACC,IAAM,EAAa,EAAiB,CAAC,uBAAuB,EAAE,EAAA,CAAgB,CAAG,6BAE3E,CAAC,EAAY,EAAc,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAa,IACb,OAUtC,CAAC,EAAY,EAAc,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAS,IAC/C,CAAC,EAAU,EAAY,CAAG,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAS,IAE3C,EAAkB,CAAA,EAAA,EAAA,OAAA,AAAO,EAAC,SA9CT,CAAO,CA+C5B,GAAmB,QAAf,EAAsB,OAAO,EAGjC,IAAM,EAjDD,IAAI,KAAK,EAiDK,CADP,IAAI,MAhDA,KAiDmB,MAjDR,GAAI,EAAE,QAAQ,GAAI,EAAE,OAAO,GAAI,EAAG,EAAG,EAAG,GAkD7D,EAAiB,IAAI,KAAK,GAChC,EAAe,OAAO,CAAC,EAAe,OAAO,GAAK,GAElD,IAAI,EAAoB,KACpB,EAA2B,KAE/B,GAAmB,SAAS,CAAxB,EACF,EAAO,EAEP,CADA,EAAc,IAAI,KAAK,EAAA,EACX,OAAO,CAAC,EAAY,OAAO,GAAK,QACvC,GAAmB,aAAa,CAA5B,EACT,EAAO,EACP,EAAc,OACT,GAAmB,MAAM,CAArB,EAET,CADA,EAAO,IAAI,KAAK,EAAA,EACX,OAAO,CAAC,EAAK,OAAO,GAAK,IAAI,IAC7B,GAAmB,OAAO,CAAtB,CADyC,CAGlD,CADA,EAAO,IAAI,KAAK,EAAA,EACX,OAAO,CAAC,EAAK,OAAO,GAAK,KAAK,IAC9B,GAAI,AAAe,SAD2B,IACjB,CAClC,EAAO,EAAe,GACtB,IAAM,EAAK,EAAe,GACtB,GAEF,CAFM,AACN,EAAc,IAAI,KAAK,EAAA,EACX,OAAO,CAAC,EAAY,OAAO,GAAK,EAEhD,CAEA,OAAO,EAAQ,MAAM,CAAE,AAAD,IACpB,IAAM,EAAU,IAAI,KAAK,EAAE,SAAS,SAChC,CAAC,OAAO,QAAQ,CAAC,EAAQ,OAAO,KAAK,AACrC,OAD4C,AACpC,EAAU,CAAA,CAAA,EAAM,GACxB,IAD+B,CAChB,GAAW,CAAA,CAAA,CAEhC,EACF,AAH+C,EAG5C,CAAC,EAAS,EAAY,AAH6B,EAGjB,EAAS,EAExC,EAAU,CAAA,EAAA,EAAA,OAAA,AAAO,EAAC,KACtB,IAAM,EAA4C,CAChD,QAAS,EAAE,CACX,cAAe,EAAE,CACjB,QAAS,EAAE,CACX,KAAM,EAAE,AACV,EACA,IAAK,IAAM,KAAK,EAAiB,CAAG,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,GACnD,IAAK,IAAM,KAAK,OAAO,IAAI,CAAC,GAC1B,CAAG,CAAC,AAD6C,EAC3C,CAAC,IAAI,CAAC,CAAC,EAAG,IAAM,EAAE,MAAM,CAAG,EAAE,MAAM,EAE3C,OAAO,CACT,EAAG,CAAC,EAAgB,EAWpB,MATA,CAAA,EAAA,EAAA,SAAS,AAAT,EAAU,KAOV,EAAG,CAAC,EAAY,EAAW,EAGzB,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,sBACb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,8DACb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,WACC,CAAA,EAAA,EAAA,GAAA,EAAC,KAAA,CAAG,UAAU,iDAAwC,YACtD,CAAA,EAAA,EAAA,IAAA,EAAC,IAAA,CAAE,UAAU,8DAAoD,YACtD,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,6DAAqD,GAAkB,cAIpG,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,8CACb,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAM,UAAU,0DAAgD,OAE/D,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CACC,UAAU,8FACV,MAAO,EACP,SAAU,AAAC,GAAM,EAAc,EAAE,MAAM,CAAC,KAAK,WAE5C,EAAa,GAAG,CAAC,AAAC,GACjB,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CAAmB,MAAO,EAAE,GAAG,UAC7B,EAAE,KAAK,EADG,EAAE,GAAG,QAOvB,AAAe,aACd,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,8CACb,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAM,UAAU,0DAAgD,OAE/D,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CACC,KAAK,OACL,MAAO,EACP,SAAU,AAAC,GAAM,EAAc,EAAE,MAAM,CAAC,KAAK,EAC7C,UAAU,mGAGd,CAAA,EAAA,EAAA,IAAA,EAAC,QAAA,CAAM,UAAU,0DAAgD,KAE/D,CAAA,EAAA,EAAA,GAAA,EAAC,QAAA,CACC,KAAK,OACL,MAAO,EACP,SAAU,AAAC,GAAM,EAAY,EAAE,MAAM,CAAC,KAAK,EAC3C,UAAU,sGAId,WAIR,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,qCACZ,EAAO,GAAG,CAAC,CAAC,KAAE,CAAG,OAAE,CAAK,CAAE,GACzB,CAAA,EAAA,EAAA,IAAA,EAAC,UAAA,CAAkB,UAAU,yBAC3B,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,mDACb,CAAA,EAAA,EAAA,GAAA,EAAC,KAAA,CAAG,UAAU,gDAAwC,IACtD,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,wDAAgD,CAAO,CAAC,EAAI,CAAC,MAAM,MAGrF,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,sBACY,IAAxB,CAAO,CAAC,EAAI,CAAC,MAAM,CAClB,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,sJAA6I,UAG1J,KAEH,CAAO,CAAC,EAAI,CAAC,GAAG,CAAC,AAAC,cAOL,EACA,QAPZ,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAEC,UAAU,iIAEV,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,OAAI,CAAA,CACH,IAAA,EAAM,CAAC,CACQ,CAAA,EAAG,EAAS,CAAC,EAAE,mBAAmB,EAAE,EAAE,EAAA,CAAG,CAE/C,GADM,GAAkB,EAAE,MAAM,EACzB,CAAA,EAAG,EAAK,MAAM,EAAE,mBAAmB,GAAA,CAAO,CAAG,GAE7D,UAAU,EACV,UAAU,0FAET,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAG,KAAK,MAAI,EAAE,KAAK,IAEhD,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,2GACb,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,4CAAoC,EAAE,MAAM,GAC5D,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,UAAK,MACN,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,UAAM,EAAE,KAAK,CAAG,CAAC,OAAO,EAAE,EAAE,KAAK,CAAA,CAAE,CAAG,aACvC,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,UAAK,MACN,CAAA,EAAA,EAAA,IAAA,EAAC,OAAA,WAAK,QAtLxB,AAAI,CADa,EAuLuB,EAAE,CAvLZ,OAuLoB,EAtLtC,EAAU,CAAP,AAAO,EAAG,KAAK,GAAG,CAAC,EAAG,KAAK,KAAK,CAAS,GAAR,IAAa,CAAC,CAAC,CAC3D,EAAQ,GAAW,CAAP,AAAO,EAAG,KAAK,KAAK,CAAC,GAAO,CAAC,CAAC,CACvC,CAAA,EAAG,KAAK,KAAK,CAAC,EAAQ,IAAI,CAAC,CAAC,SAiKd,CAAA,EAAG,EAAE,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAA,CAAE,SAfpB,MA2ClB,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CAAE,UAAU,wDAA+C,oEAGlE"}
@@ -1 +1 @@
1
- <!DOCTYPE html><!--uTm9pVsF7AuRLSQKZwTWp--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/3e0d3a43014c0ad2.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/93719e85369dd453.js"/><script src="/_next/static/chunks/68a088aa49e6124a.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/0edab8a24d59a626.js" async=""></script><script src="/_next/static/chunks/turbopack-0236a74c4f471967.js" async=""></script><script src="/_next/static/chunks/4d4876ec71727e38.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><script src="/_next/static/chunks/c84580993f22c17a.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>ClawKitchen (0.3.12-beta)</title><meta name="description" content="Local-first UI for authoring ClawRecipes recipes and scaffolding agents/teams."/><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><link rel="icon" href="/favicon.ico" sizes="any"/><link rel="icon" href="/favicon-16x16.png" sizes="16x16" type="image/png"/><link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-touch-icon.png"/><script>(function(){try{var t=localStorage.getItem('ck-theme');var theme=(t==='light')?'light':'dark';document.documentElement.dataset.theme=theme;}catch(e){document.documentElement.dataset.theme='dark';}})();</script><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased"><div hidden=""><!--$--><!--/$--></div><div class="flex h-dvh w-dvw overflow-hidden"><aside class="flex shrink-0 flex-col border-r border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass)] backdrop-blur-[var(--ck-glass-blur)] w-72"><div class="flex h-14 items-center justify-between gap-2 border-b border-[color:var(--ck-border-subtle)] px-3"><a class="text-sm font-semibold tracking-tight" title="Home" href="/">Claw Kitchen</a><button class="rounded-[var(--ck-radius-sm)] px-2 py-1 text-sm text-[color:var(--ck-text-secondary)] hover:bg-white/5 hover:text-[color:var(--ck-text-primary)]" title="Collapse">«</button></div><div class="border-b border-[color:var(--ck-border-subtle)] p-2"><div class="flex flex-col gap-1"><div class="px-2 pt-1 text-xs font-semibold uppercase tracking-wide text-[color:var(--ck-text-tertiary)]">Team</div><select class="w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]"><option value="" selected="">All teams</option></select></div></div><nav class="min-h-0 flex-1 overflow-auto p-2"><div class="mt-2 px-2 pb-2 pt-2"></div><a title="Agents" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l9-8 9 8"></path><path d="M5 10v10h14V10"></path></svg></span></span><span>Agents</span></a><a title="Recipes" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/recipes"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 4h12v16H6z"></path><path d="M9 8h6"></path><path d="M9 12h6"></path></svg></span></span><span>Recipes</span></a><a title="Tickets" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/tickets"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 7h16v4a2 2 0 0 1 0 4v4H4v-4a2 2 0 0 0 0-4z"></path></svg></span></span><span>Tickets</span></a><a title="Channels" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/channels"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 6h16"></path><path d="M4 12h16"></path><path d="M4 18h16"></path><path d="M7 9h0"></path></svg></span></span><span>Channels</span></a><a title="Goals" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/goals"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><path d="M12 7v5l3 3"></path></svg></span></span><span>Goals</span></a><a title="Cron jobs" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/cron-jobs"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><path d="M12 7v5"></path></svg></span></span><span>Cron jobs</span></a><a title="Runs" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/runs"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19h16"></path><path d="M6 16l4-4 3 3 5-7"></path><circle cx="10" cy="12" r="1"></circle><circle cx="13" cy="15" r="1"></circle><circle cx="18" cy="8" r="1"></circle></svg></span></span><span>Runs</span></a><a title="Settings" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/settings"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"></path><path d="M19.4 15a7.9 7.9 0 0 0 .1-1l2-1.5-2-3.5-2.4.5a7.8 7.8 0 0 0-1.7-1L13.5 3h-4L8.6 6.5a7.8 7.8 0 0 0-1.7 1L4.5 7l-2 3.5 2 1.5a7.9 7.9 0 0 0 .1 1l-2 1.5 2 3.5 2.4-.5a7.8 7.8 0 0 0 1.7 1L10.5 21h4l.9-3.5a7.8 7.8 0 0 0 1.7-1l2.4.5 2-3.5-2-1.5Z"></path></svg></span></span><span>Settings</span></a></nav><div class="flex items-center justify-between gap-2 border-t border-[color:var(--ck-border-subtle)] p-2"><a href="https://github.com/JIGGAI/ClawRecipes/tree/main/docs" target="_blank" rel="noreferrer" class="rounded-[var(--ck-radius-sm)] px-3 py-2 text-sm font-medium text-[color:var(--ck-text-secondary)] hover:bg-white/5 hover:text-[color:var(--ck-text-primary)]" title="Docs">Docs</a><button type="button" class="grid h-9 w-9 place-items-center rounded-full border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass)] text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[color:var(--ck-bg-glass-strong)]" aria-label="Switch to light mode" title="Switch to light mode"><span class="sr-only">Switch to light mode</span><svg class="h-4.5 w-4.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M21 14.2A7.8 7.8 0 0 1 9.8 3a7 7 0 1 0 11.2 11.2Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"></path></svg></button></div></aside><div class="min-w-0 flex-1"><main class="h-full overflow-auto p-4 md:p-6"><div class="mx-auto max-w-2xl px-6 py-12"><h1 class="text-xl font-semibold">Page not found</h1><p class="mt-2 text-sm text-[color:var(--ck-text-secondary)]">The page you requested does not exist.</p></div><!--$--><!--/$--></main></div></div><div aria-live="assertive" class="pointer-events-none fixed inset-0 z-[100] flex items-end px-4 py-6 sm:p-6"><div class="flex w-full flex-col items-start space-y-4"></div></div><script src="/_next/static/chunks/93719e85369dd453.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[49830,[\"/_next/static/chunks/4d4876ec71727e38.js\"],\"AppShell\"]\n3:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n5:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nc:I[63491,[\"/_next/static/chunks/c84580993f22c17a.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3e0d3a43014c0ad2.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"uTm9pVsF7AuRLSQKZwTWp\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3e0d3a43014c0ad2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/4d4876ec71727e38.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{var t=localStorage.getItem('ck-theme');var theme=(t==='light')?'light':'dark';document.documentElement.dataset.theme=theme;}catch(e){document.documentElement.dataset.theme='dark';}})();\"}}]}],[\"$\",\"body\",null,{\"suppressHydrationWarning\":true,\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"div\",null,{\"className\":\"mx-auto max-w-2xl px-6 py-12\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-xl font-semibold\",\"children\":\"Page not found\"}],[\"$\",\"p\",null,{\"className\":\"mt-2 text-sm text-[color:var(--ck-text-secondary)]\",\"children\":\"The page you requested does not exist.\"}]]}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"div\",null,{\"className\":\"mx-auto max-w-2xl px-6 py-12\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-xl font-semibold\",\"children\":\"Page not found\"}],[\"$\",\"p\",null,{\"className\":\"mt-2 text-sm text-[color:var(--ck-text-secondary)]\",\"children\":\"The page you requested does not exist.\"}]]}],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"ClawKitchen (0.3.12-beta)\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Local-first UI for authoring ClawRecipes recipes and scaffolding agents/teams.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"sizes\":\"any\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"/favicon-16x16.png\",\"sizes\":\"16x16\",\"type\":\"image/png\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon-32x32.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-touch-icon.png\"}],[\"$\",\"$Ld\",\"8\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--Wr2xJ4v7YSX2YxupoHWtl--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/3e0d3a43014c0ad2.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/93719e85369dd453.js"/><script src="/_next/static/chunks/68a088aa49e6124a.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/0edab8a24d59a626.js" async=""></script><script src="/_next/static/chunks/turbopack-0236a74c4f471967.js" async=""></script><script src="/_next/static/chunks/4d4876ec71727e38.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><script src="/_next/static/chunks/c84580993f22c17a.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>ClawKitchen (0.3.14-beta)</title><meta name="description" content="Local-first UI for authoring ClawRecipes recipes and scaffolding agents/teams."/><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><link rel="icon" href="/favicon.ico" sizes="any"/><link rel="icon" href="/favicon-16x16.png" sizes="16x16" type="image/png"/><link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-touch-icon.png"/><script>(function(){try{var t=localStorage.getItem('ck-theme');var theme=(t==='light')?'light':'dark';document.documentElement.dataset.theme=theme;}catch(e){document.documentElement.dataset.theme='dark';}})();</script><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased"><div hidden=""><!--$--><!--/$--></div><div class="flex h-dvh w-dvw overflow-hidden"><aside class="flex shrink-0 flex-col border-r border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass)] backdrop-blur-[var(--ck-glass-blur)] w-72"><div class="flex h-14 items-center justify-between gap-2 border-b border-[color:var(--ck-border-subtle)] px-3"><a class="text-sm font-semibold tracking-tight" title="Home" href="/">Claw Kitchen</a><button class="rounded-[var(--ck-radius-sm)] px-2 py-1 text-sm text-[color:var(--ck-text-secondary)] hover:bg-white/5 hover:text-[color:var(--ck-text-primary)]" title="Collapse">«</button></div><div class="border-b border-[color:var(--ck-border-subtle)] p-2"><div class="flex flex-col gap-1"><div class="px-2 pt-1 text-xs font-semibold uppercase tracking-wide text-[color:var(--ck-text-tertiary)]">Team</div><select class="w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]"><option value="" selected="">All teams</option></select></div></div><nav class="min-h-0 flex-1 overflow-auto p-2"><div class="mt-2 px-2 pb-2 pt-2"></div><a title="Agents" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 11l9-8 9 8"></path><path d="M5 10v10h14V10"></path></svg></span></span><span>Agents</span></a><a title="Recipes" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/recipes"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 4h12v16H6z"></path><path d="M9 8h6"></path><path d="M9 12h6"></path></svg></span></span><span>Recipes</span></a><a title="Tickets" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/tickets"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 7h16v4a2 2 0 0 1 0 4v4H4v-4a2 2 0 0 0 0-4z"></path></svg></span></span><span>Tickets</span></a><a title="Channels" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/channels"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 6h16"></path><path d="M4 12h16"></path><path d="M4 18h16"></path><path d="M7 9h0"></path></svg></span></span><span>Channels</span></a><a title="Goals" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/goals"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><path d="M12 7v5l3 3"></path></svg></span></span><span>Goals</span></a><a title="Cron jobs" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/cron-jobs"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"></circle><path d="M12 7v5"></path></svg></span></span><span>Cron jobs</span></a><a title="Runs" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/runs"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19h16"></path><path d="M6 16l4-4 3 3 5-7"></path><circle cx="10" cy="12" r="1"></circle><circle cx="13" cy="15" r="1"></circle><circle cx="18" cy="8" r="1"></circle></svg></span></span><span>Runs</span></a><a title="Settings" class="flex items-center rounded-[var(--ck-radius-sm)] text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:bg-white/5 hover:text-[color:var(--ck-text-primary)] gap-4 px-4 py-3" href="/settings"><span aria-hidden="true"><span class="grid size-7 place-items-center text-[color:var(--ck-text-secondary)]" aria-hidden="true"><svg viewBox="0 0 24 24" class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"></path><path d="M19.4 15a7.9 7.9 0 0 0 .1-1l2-1.5-2-3.5-2.4.5a7.8 7.8 0 0 0-1.7-1L13.5 3h-4L8.6 6.5a7.8 7.8 0 0 0-1.7 1L4.5 7l-2 3.5 2 1.5a7.9 7.9 0 0 0 .1 1l-2 1.5 2 3.5 2.4-.5a7.8 7.8 0 0 0 1.7 1L10.5 21h4l.9-3.5a7.8 7.8 0 0 0 1.7-1l2.4.5 2-3.5-2-1.5Z"></path></svg></span></span><span>Settings</span></a></nav><div class="flex items-center justify-between gap-2 border-t border-[color:var(--ck-border-subtle)] p-2"><a href="https://github.com/JIGGAI/ClawRecipes/tree/main/docs" target="_blank" rel="noreferrer" class="rounded-[var(--ck-radius-sm)] px-3 py-2 text-sm font-medium text-[color:var(--ck-text-secondary)] hover:bg-white/5 hover:text-[color:var(--ck-text-primary)]" title="Docs">Docs</a><button type="button" class="grid h-9 w-9 place-items-center rounded-full border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass)] text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[color:var(--ck-bg-glass-strong)]" aria-label="Switch to light mode" title="Switch to light mode"><span class="sr-only">Switch to light mode</span><svg class="h-4.5 w-4.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M21 14.2A7.8 7.8 0 0 1 9.8 3a7 7 0 1 0 11.2 11.2Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"></path></svg></button></div></aside><div class="min-w-0 flex-1"><main class="h-full overflow-auto p-4 md:p-6"><div class="mx-auto max-w-2xl px-6 py-12"><h1 class="text-xl font-semibold">Page not found</h1><p class="mt-2 text-sm text-[color:var(--ck-text-secondary)]">The page you requested does not exist.</p></div><!--$--><!--/$--></main></div></div><div aria-live="assertive" class="pointer-events-none fixed inset-0 z-[100] flex items-end px-4 py-6 sm:p-6"><div class="flex w-full flex-col items-start space-y-4"></div></div><script src="/_next/static/chunks/93719e85369dd453.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[49830,[\"/_next/static/chunks/4d4876ec71727e38.js\"],\"AppShell\"]\n3:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n5:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nc:I[63491,[\"/_next/static/chunks/c84580993f22c17a.js\"],\"default\"]\n:HL[\"/_next/static/chunks/3e0d3a43014c0ad2.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"Wr2xJ4v7YSX2YxupoHWtl\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/3e0d3a43014c0ad2.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/4d4876ec71727e38.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{var t=localStorage.getItem('ck-theme');var theme=(t==='light')?'light':'dark';document.documentElement.dataset.theme=theme;}catch(e){document.documentElement.dataset.theme='dark';}})();\"}}]}],[\"$\",\"body\",null,{\"suppressHydrationWarning\":true,\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"div\",null,{\"className\":\"mx-auto max-w-2xl px-6 py-12\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-xl font-semibold\",\"children\":\"Page not found\"}],[\"$\",\"p\",null,{\"className\":\"mt-2 text-sm text-[color:var(--ck-text-secondary)]\",\"children\":\"The page you requested does not exist.\"}]]}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"div\",null,{\"className\":\"mx-auto max-w-2xl px-6 py-12\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-xl font-semibold\",\"children\":\"Page not found\"}],[\"$\",\"p\",null,{\"className\":\"mt-2 text-sm text-[color:var(--ck-text-secondary)]\",\"children\":\"The page you requested does not exist.\"}]]}],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"ClawKitchen (0.3.14-beta)\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Local-first UI for authoring ClawRecipes recipes and scaffolding agents/teams.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"sizes\":\"any\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"/favicon-16x16.png\",\"sizes\":\"16x16\",\"type\":\"image/png\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon-32x32.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"7\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-touch-icon.png\"}],[\"$\",\"$Ld\",\"8\",{}]]\n"])</script></body></html>
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><!--uTm9pVsF7AuRLSQKZwTWp--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/93719e85369dd453.js"/><script src="/_next/static/chunks/68a088aa49e6124a.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/0edab8a24d59a626.js" async=""></script><script src="/_next/static/chunks/turbopack-0236a74c4f471967.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
- @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/93719e85369dd453.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"uTm9pVsF7AuRLSQKZwTWp\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"2\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--Wr2xJ4v7YSX2YxupoHWtl--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/93719e85369dd453.js"/><script src="/_next/static/chunks/68a088aa49e6124a.js" async=""></script><script src="/_next/static/chunks/f2f58a7e93290fbb.js" async=""></script><script src="/_next/static/chunks/0edab8a24d59a626.js" async=""></script><script src="/_next/static/chunks/turbopack-0236a74c4f471967.js" async=""></script><script src="/_next/static/chunks/ff1a16fafef87110.js" async=""></script><script src="/_next/static/chunks/d2be314c3ece3fbe.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/favicon.ico?favicon.0b3bf435.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
+ @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/93719e85369dd453.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"ViewportBoundary\"]\n9:I[97367,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"MetadataBoundary\"]\nb:I[68027,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"Wr2xJ4v7YSX2YxupoHWtl\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[27201,[\"/_next/static/chunks/ff1a16fafef87110.js\",\"/_next/static/chunks/d2be314c3ece3fbe.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0b3bf435.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"2\",{}]]\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82310,e=>{"use strict";function t(e){return e instanceof Error?e.message:String(e)}e.s(["errorMessage",()=>t])},36288,e=>{"use strict";var t=e.i(43476),r=e.i(22016),s=e.i(18566),a=e.i(71645),o=e.i(76972),n=e.i(82310),c=e.i(42771);let l=new Set(["lead","dev","qa","tester","agent","system"]);function i({teamId:e,ticket:r,currentOwner:o}){let n=(0,s.useRouter)(),[c,l]=(0,a.useState)([]),[i,d]=(0,a.useState)(o??""),[m,x]=(0,a.useState)(!1),[u,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{let t=!1;return(async()=>{try{let r=e?`/api/teams/${encodeURIComponent(e)}/tickets/assignees`:"/api/tickets/assignees",s=await fetch(r,{cache:"no-store"}),a=await s.json();if(t)return;l(Array.isArray(a.assignees)?a.assignees:[])}catch{if(t)return;l([])}})(),()=>{t=!0}},[]);let h=(0,a.useMemo)(()=>{let e=new Set(c);return o&&e.add(o),Array.from(e).sort()},[c,o]);async function p(){x(!0),b(null);try{let t=e?`/api/teams/${encodeURIComponent(e)}/tickets/assign`:"/api/tickets/assign",s=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:r,assignee:i,...e?{teamId:e}:{}})}),a=await s.json();if(!s.ok)return void b(a.error||"Assign failed");n.refresh()}catch{b("Assign failed")}finally{x(!1)}}return(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-tertiary)]",children:"Assignee"}),(0,t.jsxs)("select",{className:"rounded-md border border-white/10 bg-black/20 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",value:i,onChange:e=>d(e.target.value),children:[(0,t.jsx)("option",{value:"",disabled:!0,children:"Select…"}),h.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),(0,t.jsx)("button",{type:"button",onClick:p,disabled:m||!i||i===(o??""),className:"rounded-md bg-emerald-600 px-3 py-2 text-sm font-semibold text-white hover:bg-emerald-500 disabled:cursor-not-allowed disabled:opacity-50",children:m?"Assigning…":"Assign"}),o?(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:["Currently: ",o]}):null]}),u?(0,t.jsx)("div",{className:"mt-2 text-xs text-red-300",children:u}):null]})}function d(e,t){return t||0==e.trim().length}function m(e){let m=(0,s.useRouter)(),x=(0,o.useToast)(),[u,b]=(0,a.useTransition)(),[h,p]=(0,a.useState)(null),[k,v]=(0,a.useState)(null),f=(0,a.useMemo)(()=>(function(e){let t=function(e){let t=/^## Comments\s*$/gim.exec(e);if(!t)return null;let r=t.index+t[0].length,s=e.slice(r).search(/^##\s+/m),a=-1===s?e.length:r+s;return{start:r,end:a}}(e);if(!t)return[];let r=e.slice(t.start,t.end).replace(/^\s+/,"").split("\n"),s=[],a=null,o=/^- \*\*(.+?)\*\*\s+—\s+(.*)$/;for(let e of r){let t=e.replace(/\r$/,""),r=t.match(o);if(r){a&&s.push({...a,body:a.body.trimEnd()});let e=r[1].trim(),t=r[2].trim(),o=t.indexOf(":"),n=(o>=0?t.slice(0,o):t).trim()||"unknown",c=o>=0?t.slice(o+1).trimStart():"",i=function(e){let t=e?.trim()||"unknown",r=t.match(/^(.*?)\s*\((.*?)\)\s*$/);if(r){let e=r[1].trim()||"unknown",s=r[2].trim();return{name:e,role:s&&s.toLowerCase()!=e.toLowerCase()?s:void 0,raw:t}}for(let e of[" — "," - "," | "]){if(!t.includes(e))continue;let[r,s]=t.split(e).map(e=>e.trim()).filter(Boolean);if(!r||!s)break;let a=l.has(r.toLowerCase()),o=l.has(s.toLowerCase());if(a&&!o)return{name:s,role:r,raw:t};return{name:r,role:s,raw:t}}return{name:t,raw:t}}(n);a={timestamp:e,authorName:i.name,authorRole:i.role,authorRaw:i.raw,body:c?c+"\n":""};continue}a&&(a.body+=t.replace(/^\s{0,2}/,"")+"\n")}return a&&s.push({...a,body:a.body.trimEnd()}),s})(e.markdown),[e.markdown]),[g,y]=(0,a.useState)(""),[j,w]=(0,a.useState)("");async function N(){p(null),await (0,c.fetchJson)(`/api/teams/${encodeURIComponent(e.teamId)}/tickets/move-to-goals`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:e.ticketId})})}async function C(){p(null),await (0,c.fetchJson)(`/api/teams/${encodeURIComponent(e.teamId)}/tickets/delete`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:e.ticketId})})}async function S(t){p(null),await (0,c.fetchJson)(`/api/teams/${encodeURIComponent(e.teamId)}/tickets/move`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:e.ticketId,to:t})})}async function T(){p(null);let t=j.trim();if(!t)throw Error("Comment cannot be empty.");await (0,c.fetchJson)(`/api/teams/${encodeURIComponent(e.teamId)}/tickets/comment`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:e.ticketId,author:g.trim()||void 0,comment:t})}),w(""),x.push({kind:"success",message:"Comment added."}),m.refresh()}return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(r.default,{href:e.backHref??"/tickets",className:"text-sm font-medium hover:underline",children:"← Back"}),(0,t.jsx)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:e.file})]}),h?(0,t.jsx)("div",{className:"ck-glass border border-[color:var(--ck-border-strong)] p-3 text-sm text-[color:var(--ck-text-primary)]",children:h}):null,(0,t.jsxs)("div",{className:"ck-glass p-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-[color:var(--ck-text-primary)]",children:"Ticket"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("span",{children:"Status"}),(0,t.jsxs)("select",{className:"rounded border border-[color:var(--ck-border-subtle)] bg-black/20 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",disabled:u,value:e.stage,onChange:t=>{let r=t.target.value;if(r!==e.stage){if("done"===r&&!window.confirm("Mark this ticket done? This will move the file to work/done and add an audit comment."))return;b(()=>{S(r).then(()=>{x.push({kind:"success",message:`Status updated to ${r}.`}),m.refresh()}).catch(e=>p((0,n.errorMessage)(e)))})}},children:[(0,t.jsx)("option",{value:"backlog",children:"backlog"}),(0,t.jsx)("option",{value:"in-progress",children:"in-progress"}),(0,t.jsx)("option",{value:"testing",children:"testing"}),(0,t.jsx)("option",{value:"done",children:"done"})]})]}),(0,t.jsx)("button",{className:"rounded border border-[color:var(--ck-border-subtle)] px-3 py-1.5 text-xs font-medium text-[color:var(--ck-text-secondary)] hover:border-[color:var(--ck-border-strong)]",onClick:()=>v({kind:"goals"}),disabled:u,children:"Move to Goals"}),(0,t.jsx)("button",{className:"rounded border border-[color:var(--ck-accent-red)] bg-[color:var(--ck-accent-red-soft)] px-3 py-1.5 text-xs font-medium text-[color:var(--ck-accent-red)] hover:bg-[color:var(--ck-accent-red-soft-strong)]",onClick:()=>v({kind:"delete"}),disabled:u,children:"Delete Ticket"})]})]}),void 0!==e.currentOwner?(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(i,{teamId:e.teamId,ticket:e.ticketId,currentOwner:e.currentOwner??null})}):null,(0,t.jsxs)("div",{className:"mt-6 border-t border-[color:var(--ck-border-subtle)] pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-[color:var(--ck-text-primary)]",children:"Comments"}),(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:f.length})]}),f.length?(0,t.jsx)("div",{className:"mt-3 space-y-3",children:f.map((e,r)=>(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-[color:var(--ck-border-subtle)] bg-black/10 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-primary)]",children:e.authorName}),e.authorRole?(0,t.jsx)("div",{className:"rounded border border-[color:var(--ck-border-subtle)] bg-black/10 px-1.5 py-0.5 text-[10px] font-medium text-[color:var(--ck-text-tertiary)]",children:e.authorRole}):null]}),(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:e.timestamp})]}),(0,t.jsx)("div",{className:"mt-2 whitespace-pre-wrap break-words text-sm leading-6 text-[color:var(--ck-text-secondary)]",children:e.body})]},`${e.timestamp}-${r}`))}):(0,t.jsx)("div",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:"No comments yet."}),(0,t.jsxs)("div",{className:"mt-4 border-t border-[color:var(--ck-border-subtle)] pt-4",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-[color:var(--ck-text-primary)]",children:"Add comment"}),(0,t.jsxs)("div",{className:"mt-3 grid gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",htmlFor:"ck-comment-author",children:"Author (optional)"}),(0,t.jsx)("input",{id:"ck-comment-author",value:g,onChange:e=>y(e.target.value),placeholder:"unknown",className:"w-full rounded border border-[color:var(--ck-border-subtle)] bg-black/20 px-3 py-2 text-sm text-[color:var(--ck-text-primary)] outline-none focus:border-[color:var(--ck-border-strong)]",disabled:u})]}),(0,t.jsxs)("div",{className:"grid gap-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",htmlFor:"ck-comment-body",children:"Comment"}),(0,t.jsx)("textarea",{id:"ck-comment-body",value:j,onChange:e=>w(e.target.value),rows:4,className:"w-full rounded border border-[color:var(--ck-border-subtle)] bg-black/20 px-3 py-2 text-sm text-[color:var(--ck-text-primary)] outline-none focus:border-[color:var(--ck-border-strong)]",disabled:u})]}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)("button",{type:"button","aria-busy":u,className:"rounded-[var(--ck-radius-sm)] bg-[color:var(--ck-accent)] px-3 py-2 text-xs font-semibold text-black transition hover:brightness-110 active:brightness-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--ck-border-strong)] focus-visible:ring-offset-2 focus-visible:ring-offset-black/30 disabled:cursor-not-allowed disabled:border disabled:border-[color:var(--ck-border-subtle)] disabled:bg-[color:var(--ck-bg-glass)] disabled:text-[color:var(--ck-text-tertiary)]",onClick:()=>{b(()=>{T().catch(e=>p((0,n.errorMessage)(e)))})},disabled:d(j,u),children:u?"Posting…":"Post comment"})})]})]})]})]}),(0,t.jsx)("div",{className:"ck-glass p-6",children:(0,t.jsx)("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-[color:var(--ck-text-primary)]",children:e.markdown})}),k?(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",children:(0,t.jsxs)("div",{className:"ck-glass w-full max-w-lg rounded-[var(--ck-radius-md)] border border-[color:var(--ck-border-strong)] p-4",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-[color:var(--ck-text-primary)]",children:"goals"===k.kind?"Move to Goals":"Delete ticket"}),(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"goals"===k.kind?(0,t.jsxs)(t.Fragment,{children:["This will move the ticket out of the work lanes into ",(0,t.jsx)("code",{children:"work/goals/"})," so it won’t be picked up by automation."]}):(0,t.jsx)(t.Fragment,{children:"This will permanently remove the ticket markdown file. Assignment stubs (if any) will be archived."})}),(0,t.jsxs)("div",{className:"mt-4 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{className:"rounded border border-[color:var(--ck-border-subtle)] px-3 py-1.5 text-xs text-[color:var(--ck-text-secondary)]",onClick:()=>v(null),disabled:u,children:"Cancel"}),(0,t.jsx)("button",{className:"delete"===k.kind?"rounded bg-[color:var(--ck-accent-red)] px-3 py-1.5 text-xs font-medium text-white":"rounded bg-[color:var(--ck-accent)] px-3 py-1.5 text-xs font-medium text-black",onClick:()=>{let t=k.kind;v(null),b(()=>{("goals"===t?N():C()).then(()=>{x.push({kind:"success",message:"delete"===t?"Ticket deleted.":"Moved to Goals."}),"delete"===t?m.push(e.backHref??"/tickets"):m.refresh()}).catch(e=>p((0,n.errorMessage)(e)))})},disabled:u,children:"Confirm"})]})]})}):null]})}e.s(["TicketDetailClient",()=>m,"isPostCommentDisabled",()=>d],36288)}]);
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86103,e=>{"use strict";var t=e.i(43476),s=e.i(71645);e.i(22258);var a=e.i(94988),r=e.i(18566),i=e.i(54510),l=e.i(44355);function o({open:e,teamId:s,recipeId:a,onClose:r,onConfirm:i,busy:o}){return(0,t.jsxs)(l.ConfirmationModal,{open:e,onClose:r,title:"Publish changes",confirmLabel:"Publish changes",confirmBusyLabel:"Publishing…",busy:o,onConfirm:i,confirmButtonClassName:"rounded-[var(--ck-radius-sm)] bg-emerald-600 px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-emerald-500 disabled:opacity-50",children:[(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["This will re-scaffold team ",(0,t.jsx)("code",{className:"font-mono",children:s})," from recipe ",(0,t.jsx)("code",{className:"font-mono",children:a}),"."]}),(0,t.jsxs)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-amber-400/30 bg-amber-500/10 p-3 text-sm text-amber-100",children:[(0,t.jsx)("div",{className:"font-medium",children:"Complete overwrite"}),(0,t.jsxs)("div",{className:"mt-1",children:["All existing team workspace files managed by the recipe will be overwritten (for example: ",(0,t.jsx)("code",{className:"font-mono",children:"AGENTS.md"}),","," ",(0,t.jsx)("code",{className:"font-mono",children:"SOUL.md"}),", role templates, and other scaffolded files). Any manual edits in those files will be lost."]})]})]})}var c=e.i(76972),n=e.i(82310),d=e.i(42771);function m(e,t){try{return JSON.parse(e)}catch{return t}}async function x(e){let[t,s]=await Promise.all([(0,d.fetchJson)("/api/recipes",{cache:"no-store"}),fetch(`/api/teams/meta?teamId=${encodeURIComponent(e)}`,{cache:"no-store"})]);return{recipesData:t,metaRes:s}}async function h(e){let t=await (0,d.fetchAll)([`/api/teams/files?teamId=${encodeURIComponent(e)}`,`/api/cron/jobs?teamId=${encodeURIComponent(e)}`,"/api/agents",`/api/teams/skills?teamId=${encodeURIComponent(e)}`,"/api/skills/available"]),s=await Promise.all(t.map(e=>e.text()));return{responses:t,texts:s}}async function p(e,t){t.setTeamFilesLoading(!0),t.setCronLoading(!0),t.setTeamAgentsLoading(!0),t.setSkillsLoading(!0);try{let{responses:s,texts:a}=await h(e),[r,i,l,o,c]=s,[n,d,x,p,u]=a,v=m(n,{});r.ok&&v.ok&&Array.isArray(v.files)&&t.setTeamFiles(v.files.map(e=>({name:String(e.name??""),missing:!!e.missing,required:!!e.required,rationale:"string"==typeof e.rationale?e.rationale:void 0})));let g=m(d,{});i.ok&&g.ok&&Array.isArray(g.jobs)&&t.setCronJobs(g.jobs);let k=m(x,{});if(l.ok&&Array.isArray(k.agents)){let s=k.agents.filter(t=>String(t.id??"").startsWith(`${e}-`));t.setTeamAgents(s.map(e=>({id:String(e.id??""),identityName:"string"==typeof e.identityName?e.identityName:void 0})))}let f=m(p,{});o.ok&&f.ok&&Array.isArray(f.skills)&&t.setSkillsList(f.skills);let y=m(u,{});if(c.ok&&y.ok&&Array.isArray(y.skills)){let e=y.skills;t.setAvailableSkills(e),t.setSelectedSkill(t=>{let s=String(t??"").trim();return s&&e.includes(s)?s:e[0]??""})}}finally{t.setTeamFilesLoading(!1),t.setCronLoading(!1),t.setTeamAgentsLoading(!1),t.setSkillsLoading(!1)}}async function u(e,t){let s=await x(e);t.setRecipes(s.recipesData.recipes??[]);let a=null;try{let e=await s.metaRes.json(),r=e.meta;s.metaRes.ok&&e.ok&&r?.recipeId?(a={recipeId:String(r.recipeId),recipeName:"string"==typeof r.recipeName?r.recipeName:void 0},t.setTeamMetaRecipeHash("string"==typeof r.recipeHash?r.recipeHash:null)):t.setTeamMetaRecipeHash(null)}catch{t.setTeamMetaRecipeHash(null)}if(a)t.setLockedFromId(a.recipeId),t.setLockedFromName(a.recipeName??null),t.setProvenanceMissing(!1),t.setFromId(a.recipeId);else{t.setLockedFromId(null),t.setLockedFromName(null),t.setProvenanceMissing(!0);let a=s.recipesData.recipes??[],r=a.find(t=>"team"===t.kind&&t.id===e),i=a.find(e=>"team"===e.kind),l=r??i;l&&t.setFromId(l.id)}await p(e,{setTeamFiles:t.setTeamFiles,setCronJobs:t.setCronJobs,setTeamAgents:t.setTeamAgents,setSkillsList:t.setSkillsList,setAvailableSkills:t.setAvailableSkills,setSelectedSkill:t.setSelectedSkill,setTeamFilesLoading:t.setTeamFilesLoading,setCronLoading:t.setCronLoading,setTeamAgentsLoading:t.setTeamAgentsLoading,setSkillsLoading:t.setSkillsLoading})}async function v(e){try{let t=await (0,d.fetchJson)("/api/agents",{cache:"no-store"}),s=(Array.isArray(t.agents)?t.agents:[]).filter(t=>String(t.id??"").startsWith(`${e}-`)).map(e=>({id:String(e.id??""),identityName:"string"==typeof e.identityName?e.identityName:void 0}));return{ok:!0,agents:s}}catch{return{ok:!1,agents:[]}}}async function g(e,t,s){try{await (0,d.fetchJson)("/api/scaffold",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"team",recipeId:t.trim(),teamId:e,applyConfig:!0,overwrite:!1,allowExisting:!0,cronInstallChoice:"no"})})}catch(e){s((0,n.errorMessage)(e),"error")}}async function k(e,t,s,a){let r=Date.now();for(;Date.now()-r<a;){try{let a=await v(e);if(a.ok){s(a.agents);let e=!!t&&a.agents.some(e=>e.id===t);if(!t||e)return!0}}catch{}await new Promise(e=>setTimeout(e,500))}return!1}async function f(e){let{teamId:t,toId:s,newRole:a,derivedRole:r,newRoleName:i,content:l,setContent:o,setTeamAgents:c,flashMessage:m,ensureCustomRecipeExists:x}=e;try{await x({overwrite:!1})}catch(t){let e=(0,n.errorMessage)(t);if(!/Recipe id already exists:/i.test(e))throw t}let h=await (0,d.fetchJson)("/api/recipes/team-agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify("__custom__"===a?{recipeId:s.trim(),op:"add",role:r,name:i}:{recipeId:s.trim(),op:"addLike",baseRole:r,teamId:t,name:i})});if(!h.ok)throw Error("Failed updating agents list");o(String(h.content??l)),await g(t,s,m);let p="string"==typeof h.addedAgentId?h.addedAgentId:"";if(!await k(t,p,c,5e3)&&p){try{fetch("/api/gateway/restart",{method:"POST"})}catch{}await k(t,p,c,1e4)}m(`Updated agents list in ${s}`,"success")}function y(e){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Custom recipe target"}),e.loading?(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Loading team…"}):null]}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Team id"}),(0,t.jsx)("input",{value:e.toId,onChange:t=>e.setToId(t.target.value),disabled:!e.canEditTargetId,className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)] disabled:opacity-70"}),(0,t.jsx)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:"This is the custom recipe id that will be created when you save."}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Team name"}),(0,t.jsx)("input",{value:e.toName,onChange:t=>e.setToName(t.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:e.saving||!e.teamIdValid||!e.targetIdValid||e.targetIsBuiltin,onClick:()=>e.onSaveCustom(!0),className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:e.saving?"Saving":"Save"}),(0,t.jsx)("button",{type:"button",disabled:e.saving||!e.teamIdValid||!e.targetIdValid||e.targetIsBuiltin||!e.loadedRecipeHash||!e.teamMetaRecipeHash||e.loadedRecipeHash===e.teamMetaRecipeHash,onClick:e.onPublishOpen,className:"rounded-[var(--ck-radius-sm)] bg-emerald-600 px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:e.publishing?"Publishing":"Publish changes"}),(0,t.jsx)("button",{type:"button",disabled:e.saving,onClick:e.onDeleteOpen,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] disabled:opacity-50",children:"Delete Team"})]})]}),(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Notes"}),(0,t.jsxs)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Parent recipe (locked)"}),(0,t.jsx)("select",{disabled:!0,className:"mt-2 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)] disabled:opacity-70",value:e.fromId,onChange:t=>e.setFromId(t.target.value),children:e.teamRecipes.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.id," (",e.source,")"]},`${e.source}:${e.id}`))}),e.lockedFromId&&(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("code",{children:e.lockedFromId}),e.lockedFromName?` (${e.lockedFromName})`:""]}),!e.lockedFromId&&e.provenanceMissing&&(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Provenance not found for this team."})]}),(0,t.jsxs)("ul",{className:"mt-4 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("li",{children:"Save writes the custom recipe file identified by Team id."}),(0,t.jsx)("li",{children:"Publish changes re-scaffolds this team from your custom recipe."}),(0,t.jsx)("li",{children:"Delete Team runs openclaw recipes remove-team."})]})]})]}),(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Recipe markdown"}),e.recipeLoadError?(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:e.recipeLoadError}):null,(0,t.jsx)("textarea",{value:e.content,onChange:t=>{e.setContent(t.target.value),e.setLoadedRecipeHash(null)},className:"mt-2 h-[55vh] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]",spellCheck:!1})]})]})}function b(e){let{teamId:s,toId:a,recipeAgents:r,newRole:i,setNewRole:l,customRole:o,setCustomRole:c,newRoleName:n,setNewRoleName:d,derivedRole:m,saving:x,teamAgents:h,teamAgentsLoading:p,onAddAgent:u}=e;return(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Agents in this team"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Add/remove agents by updating the ",(0,t.jsx)("code",{children:"agents:"})," list in your custom team recipe (",(0,t.jsx)("code",{children:a}),")."]}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Role"}),(0,t.jsxs)("select",{value:i,onChange:e=>{let t=e.target.value;if(l(t),"__custom__"===t){c(""),d("");return}c("");let s=r.find(e=>e.role===t);d(s?.name||"")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"Select…"}),r.map(e=>(0,t.jsx)("option",{value:e.role,children:e.name||e.role},e.role)),(0,t.jsx)("option",{value:"__custom__",children:"Other…"})]}),"__custom__"===i?(0,t.jsx)("input",{value:o,onChange:e=>c(e.target.value),placeholder:"role (e.g. researcher)",className:"mt-2 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}):null,(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["This writes to the recipe's ",(0,t.jsx)("code",{children:"agents:"})," list."]})]}),(0,t.jsx)("div",{className:"sm:col-span-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Name (optional)"}),(0,t.jsx)("input",{value:n,onChange:e=>d(e.target.value),placeholder:"Onchain Researcher",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})})]}),(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:(0,t.jsx)("button",{disabled:x||!m,onClick:u,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:"Add agent"})}),(0,t.jsxs)("div",{className:"mt-6",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Detected installed team agents (read-only)"}),(0,t.jsxs)("ul",{className:"mt-2 space-y-2",children:[h.length?h.map(e=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-[color:var(--ck-text-primary)]",children:e.identityName||e.id}),(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:e.id})]}),(0,t.jsx)("a",{className:"text-sm font-medium text-[var(--ck-accent-red)] hover:text-[color:var(--ck-accent-red-hover)]",href:"/agents/"+encodeURIComponent(e.id)+"?returnTo="+encodeURIComponent("/teams/"+s+"?tab=agents"),children:"Edit"})]},e.id)):null,0===h.length&&!p&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No team agents detected."}),0===h.length&&p&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"})]})]})]})}function j(e){return(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Skills"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"Skills installed in this team workspace. For agent-specific skills, open the agent from the Agents tab."}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Installed"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:e.skillsList.length?e.skillsList.map(e=>(0,t.jsx)("li",{children:e},e)):(0,t.jsx)("li",{children:"None installed."})})]}),(0,t.jsxs)("div",{className:"mt-5 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15 p-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Add a skill"}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,t.jsx)("select",{value:e.selectedSkill,onChange:t=>e.setSelectedSkill(t.target.value),disabled:e.installingSkill||e.skillsLoading||!e.availableSkills.length,className:"w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",children:e.availableSkills.length?e.availableSkills.map(e=>(0,t.jsx)("option",{value:e,children:e},e)):(0,t.jsx)("option",{value:"",children:"No skills found"})}),(0,t.jsx)("button",{type:"button",disabled:e.installingSkill||e.skillsLoading||!e.selectedSkill,onClick:e.onInstallSkill,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:e.installingSkill?"Adding":"Add"})]}),e.teamSkillError&&(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:e.teamSkillError}),e.teamSkillMsg&&(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-emerald-400/30 bg-emerald-500/10 p-3 text-sm text-emerald-100",children:e.teamSkillMsg}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["Uses openclaw recipes install-skill with team-id ",e.teamId,"."]})]})]})}function N(e){let{cronJobs:s,cronLoading:a,saving:r,onCronAction:i}=e;return(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Cron jobs (filtered by team name)"}),(0,t.jsxs)("ul",{className:"mt-3 space-y-3",children:[s.length?s.map(e=>{let s=String(e.id??e.jobId??"").trim(),a=s||String(e.name??"job"),l=String(e.name??e.id??e.jobId??"(unnamed)"),o=e.enabled??e.state?.enabled;return(0,t.jsxs)("li",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"font-medium text-[color:var(--ck-text-primary)]",children:l}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Enabled: ",String(o??"?")]}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,t.jsx)("button",{disabled:r||!s,onClick:()=>i(s,l,"run"),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Run"}),(0,t.jsx)("button",{disabled:r||!s,onClick:()=>i(s,l,"enable"),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Enable"}),(0,t.jsx)("button",{disabled:r||!s,onClick:()=>i(s,l,"disable"),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Disable"}),s?null:(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"(missing id)"})]})]},a)}):null,0===s.length&&a&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading"}),0===s.length&&!a&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No cron jobs detected for this team."})]})]})}var w=e.i(72532);function S(e){let{teamFiles:s,teamFilesLoading:a,showOptionalFiles:r,setShowOptionalFiles:i,fileName:l,fileContent:o,setFileContent:c,teamFileError:n,saving:d,onLoadTeamFile:m,onSaveTeamFile:x}=e;return(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsx)(w.FileListWithOptionalToggle,{title:"Team files",files:s,loading:a,showOptionalFiles:r,onShowOptionalChange:i,selectedFileName:l,onSelectFile:m}),(0,t.jsxs)("div",{className:"ck-glass-strong p-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:["Edit: ",l]}),(0,t.jsx)("button",{disabled:d,onClick:x,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:d?"Saving…":"Save file"})]}),n?(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:n}):null,(0,t.jsx)("textarea",{value:o,onChange:e=>c(e.target.value),className:"mt-3 h-[55vh] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]",spellCheck:!1})]})]})}function I(e){return`${e._file??""}:${e._line??0}`}function C({teamId:e}){let[a,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(""),[o,c]=(0,s.useState)([]),[d,m]=(0,s.useState)([]),[x,h]=(0,s.useState)([]),[p,u]=(0,s.useState)("learning"),[v,g]=(0,s.useState)(""),[k,f]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[j,N]=(0,s.useState)(null);async function w(){r(!0),l("");try{let t=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();if(!t.ok||!s.ok)throw Error(s.error||"Failed to load memory");c(Array.isArray(s.files)?s.files:[]),m(Array.isArray(s.pinnedItems)?s.pinnedItems:[]),h(Array.isArray(s.items)?s.items:[])}catch(e){l((0,n.errorMessage)(e)),c([]),m([]),h([])}finally{r(!1)}}(0,s.useEffect)(()=>{w()},[e]);let S=(0,s.useMemo)(()=>[{label:"decision",value:"decision"},{label:"learning",value:"learning"},{label:"bug",value:"bug"},{label:"customer",value:"customer"},{label:"release",value:"release"}],[]),C=(0,s.useMemo)(()=>new Set(d.map(e=>e._key)),[d]);async function A(t){let s=I(t);if(t._file&&t._line){N(s),l("");try{let s={op:"pin",ts:new Date().toISOString(),actor:`${e}-lead`,key:{file:"team.jsonl",line:t._line},item:{ts:t.ts,author:t.author,type:t.type,content:t.content,source:t.source}},a=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)}),r=await a.json();if(!a.ok||!r.ok)throw Error(r.error||"Failed to pin");await w()}catch(e){l((0,n.errorMessage)(e))}finally{N(null)}}}async function T(t){let s=I(t);if(t._file&&t._line){N(s),l("");try{let s={op:"unpin",ts:new Date().toISOString(),actor:`${e}-lead`,key:{file:"team.jsonl",line:t._line}},a=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)}),r=await a.json();if(!a.ok||!r.ok)throw Error(r.error||"Failed to unpin");await w()}catch(e){l((0,n.errorMessage)(e))}finally{N(null)}}}return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Team memory (file-first)"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Stored in ",(0,t.jsx)("span",{className:"font-mono",children:"shared-context/memory/*.jsonl"}),". Items must be attributable."]}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-secondary)]",children:["Canonical memory model doc:"," ",(0,t.jsx)("a",{className:"underline decoration-white/20 underline-offset-4 hover:decoration-white/40",href:"https://github.com/JIGGAI/ClawRecipes/blob/main/docs/MEMORY_MODEL.md",target:"_blank",rel:"noreferrer",children:"ClawRecipes/docs/MEMORY_MODEL.md"})]})]}),(0,t.jsx)("button",{type:"button",onClick:w,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Refresh"})]}),i?(0,t.jsx)("div",{className:"mt-3 rounded border border-red-400/30 bg-red-500/10 p-2 text-sm text-red-100",children:i}):null,(0,t.jsxs)("div",{className:"mt-3 text-xs text-[color:var(--ck-text-secondary)]",children:["Files: ",o.length?o.join(", "):"(none)"]})]}),(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Add memory item"}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"type"}),(0,t.jsx)("select",{value:p,onChange:e=>u(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",children:S.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"source (ticket/pr/path)"}),(0,t.jsx)("input",{value:k,onChange:e=>f(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",placeholder:"e.g. ticket 0088, PR https://..., shared-context/DECISIONS.md"})]}),(0,t.jsxs)("label",{className:"block md:col-span-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"content"}),(0,t.jsx)("textarea",{value:v,onChange:e=>g(e.target.value),className:"mt-1 h-[110px] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 text-sm text-[color:var(--ck-text-primary)]",placeholder:"Write a small, specific memory item…"})]}),(0,t.jsx)("div",{className:"md:col-span-2",children:(0,t.jsx)("button",{type:"button",disabled:y||!v.trim(),onClick:async()=>{b(!0),l("");try{let t={op:"append",ts:new Date().toISOString(),author:`${e}-lead`,type:p,content:v.trim(),source:k.trim()?{text:k.trim()}:void 0,file:"team.jsonl"},s=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),a=await s.json();if(!s.ok||!a.ok)throw Error(a.error||"Failed to append memory");g(""),f(""),await w()}catch(e){l((0,n.errorMessage)(e))}finally{b(!1)}},className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:y?"Saving…":"Append to team.jsonl"})})]})]}),(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Pinned memory"}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[d.length," pinned"]})]}),a?(0,t.jsx)("div",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,(0,t.jsx)("div",{className:"mt-3 space-y-3",children:d.length?d.map(e=>(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.ts}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"rounded bg-white/5 px-2 py-0.5 font-mono",children:e.type}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"font-mono",children:e.author}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsxs)("span",{className:"font-mono",children:["pinned ",e.pinnedAt]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>void T(e),disabled:j===e._key,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:j===e._key?"Unpinning…":"Unpin"})]}),(0,t.jsx)("div",{className:"mt-2 whitespace-pre-wrap text-sm text-[color:var(--ck-text-primary)]",children:e.content}),e.source?(0,t.jsx)("pre",{className:"mt-2 overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(e.source,null,2)}):null]},e._key)):(0,t.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No pinned items yet."})})]}),(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Recent memory"}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:["Showing ",x.length," (max 200)"]})]}),a?(0,t.jsx)("div",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,(0,t.jsx)("div",{className:"mt-3 space-y-3",children:x.length?x.map(e=>{let s=I(e),a=C.has(s);return(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.ts}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"rounded bg-white/5 px-2 py-0.5 font-mono",children:e.type}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"font-mono",children:e.author})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e._file?(0,t.jsxs)("span",{className:"text-[10px] text-[color:var(--ck-text-tertiary)] font-mono",children:[e._file,":",e._line]}):null,(0,t.jsx)("button",{type:"button",onClick:()=>void A(e),disabled:a||j===s||!e._file||!e._line,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:a?"Pinned":j===s?"Pinning…":"Pin"})]})]}),(0,t.jsx)("div",{className:"mt-2 whitespace-pre-wrap text-sm text-[color:var(--ck-text-primary)]",children:e.content}),e.source?(0,t.jsx)("pre",{className:"mt-2 overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(e.source,null,2)}):null]},`${e._file??"?"}:${e._line??0}`)}):(0,t.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No memory items yet."})})]})]})}var A=e.i(74080);function T({open:e,onClose:a,teamId:r,onInstalled:i}){let l=(0,s.useMemo)(()=>`${r}-swarm-orchestrator`,[r]),[o,c]=(0,s.useState)(l),[n,m]=(0,s.useState)(""),[x,h]=(0,s.useState)("/home/control/swarm-worktrees"),[p,u]=(0,s.useState)("origin/main"),[v,g]=(0,s.useState)(!0),[k,f]=(0,s.useState)(!0),[y,b]=(0,s.useState)(!1),[j,N]=(0,s.useState)(null),[w,S]=(0,s.useState)(null),I=(0,s.useMemo)(()=>({effectiveAgentId:String(o??"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/--+/g,"-")}),[o]);return e?(0,A.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[210]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:()=>{y||a()}}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"w-full max-w-xl rounded-2xl border border-white/10 bg-[color:var(--ck-bg-glass-strong)] p-5 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-[color:var(--ck-text-primary)]",children:"Add Orchestrator"}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:["This will scaffold a new ",(0,t.jsx)("span",{className:"font-mono text-xs",children:"swarm-orchestrator"})," agent workspace for this team and prefill its config."]}),(0,t.jsx)("label",{className:"mt-4 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Orchestrator agent id"}),(0,t.jsx)("input",{value:o,onChange:e=>c(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Default: ",(0,t.jsx)("span",{className:"font-mono",children:l})," (normalized: ",(0,t.jsx)("span",{className:"font-mono",children:I.effectiveAgentId}),")"]}),(0,t.jsx)("label",{className:"mt-4 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Repo directory (SWARM_REPO_DIR)"}),(0,t.jsx)("input",{value:n,onChange:e=>m(e.target.value),placeholder:"/home/control/clawkitchen",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Worktree root (SWARM_WORKTREE_ROOT)"}),(0,t.jsx)("input",{value:x,onChange:e=>h(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsx)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:"Recommend a dedicated folder outside the repo."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Base ref (SWARM_BASE_REF)"}),(0,t.jsx)("input",{value:p,onChange:e=>u(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsxs)("label",{className:"mt-5 flex items-start gap-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:v,onChange:e=>g(e.target.checked),className:"mt-1"}),(0,t.jsxs)("span",{children:["Add this agent to OpenClaw config (recommended).",(0,t.jsx)("br",{}),(0,t.jsxs)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:["This will modify ",(0,t.jsx)("span",{className:"font-mono",children:"~/.openclaw/openclaw.json"})," to add ",(0,t.jsx)("span",{className:"font-mono",children:I.effectiveAgentId}),"."]})]})]}),(0,t.jsxs)("label",{className:"mt-3 flex items-start gap-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:k,onChange:e=>f(e.target.checked),className:"mt-1"}),(0,t.jsxs)("span",{children:["Make scripts executable (developer convenience).",(0,t.jsx)("br",{}),(0,t.jsxs)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:["Runs ",(0,t.jsx)("span",{className:"font-mono",children:"chmod +x .clawdbot/*.sh"})," in the orchestrator workspace."]})]})]}),j?(0,t.jsx)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:j}):null,w?(0,t.jsxs)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-emerald-400/30 bg-emerald-500/10 p-3 text-sm text-emerald-100",children:["Installed ",(0,t.jsx)("span",{className:"font-mono",children:w.orchestratorAgentId})," → ",(0,t.jsx)("span",{className:"font-mono",children:w.workspace})]}):null,(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:a,disabled:y,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:y||!I.effectiveAgentId||!n.trim(),onClick:async()=>{b(!0),N(null),S(null);try{let e=await (0,d.fetchJson)("/api/teams/orchestrator/install",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:r,orchestratorAgentId:I.effectiveAgentId,repoDir:n.trim(),worktreeRoot:x.trim(),baseRef:p.trim(),applyConfig:v,makeExecutable:k})});if(!e.ok)throw Error(e.error);S({orchestratorAgentId:e.orchestratorAgentId,workspace:e.workspace}),i()}catch(e){N(e instanceof Error?e.message:String(e))}finally{b(!1)}},className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-[var(--ck-accent-red-hover)] disabled:opacity-50",children:y?"Installing…":"Install"})]})]})})})]}),document.body):null}function R({teamId:e}){let[a,r]=(0,s.useState)(!0),[i,l]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),[n,m]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{r(!0);try{let t=await (0,d.fetchJson)(`/api/teams/orchestrator?teamId=${encodeURIComponent(e)}`,{cache:"no-store"});l(t),c(new Date().toISOString())}catch(e){l({ok:!1,error:e instanceof Error?e.message:String(e)}),c(new Date().toISOString())}finally{r(!1)}},[e]);return((0,s.useEffect)(()=>{x()},[x]),a)?(0,t.jsx)("div",{className:"mt-6 ck-glass-strong p-4",children:"Loading orchestrator state…"}):i?i.ok?i.present?(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Orchestrator"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Agent: ",(0,t.jsx)("span",{className:"font-mono",children:i.agent.id}),i.agent.identityName?` (${i.agent.identityName})`:""]}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Workspace: ",(0,t.jsx)("span",{className:"font-mono",children:i.agent.workspace})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:o?(0,t.jsxs)("span",{children:["Last updated: ",(0,t.jsx)("span",{className:"font-mono",children:o})]}):null}),(0,t.jsx)("button",{type:"button",onClick:()=>void x(),disabled:a,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15 disabled:opacity-50",children:a?"Refreshing…":"Refresh"})]})]}),(0,t.jsxs)("div",{className:"mt-5 grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("section",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"tmux sessions"}),i.tmuxSessions.length?(0,t.jsx)("ul",{className:"mt-2 space-y-2",children:i.tmuxSessions.map(e=>(0,t.jsxs)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.name}),(0,t.jsxs)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["attached=",String(e.attached),"number"==typeof e.windows?` windows=${e.windows}`:""]})]},e.name))}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No sessions detected (or tmux not running)."})]}),(0,t.jsxs)("section",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"git worktrees"}),i.worktrees.length?(0,t.jsx)("ul",{className:"mt-2 space-y-2",children:i.worktrees.map(e=>(0,t.jsxs)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"font-mono text-xs",children:e.path}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[e.branch?e.branch:"(no branch)",e.sha?` @ ${e.sha.slice(0,7)}`:""]})]},e.path))}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No worktrees detected."})]})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Active tasks"}),i.activeTasksSummary?(0,t.jsxs)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"font-mono text-xs",children:i.activeTasksSummary.path}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["number"==typeof i.activeTasksSummary.taskCount?`tasks=${i.activeTasksSummary.taskCount}`:"tasks=?",i.activeTasksSummary.rawType?` type=${i.activeTasksSummary.rawType}`:""]})]}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No active-tasks.json found."})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"CLI quick actions"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"The orchestrator is designed to be driven from the CLI (and usually tmux). Common commands:"}),(0,t.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:"tmux ls"}),(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(list sessions)"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:"tmux attach -t <session>"}),(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(jump into a running swarm)"})]}),(0,t.jsxs)("li",{children:[(0,t.jsxs)("span",{className:"font-mono text-xs",children:["git -C ",i.agent.workspace," worktree list"]}),(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(inspect worktrees)"})]})]}),(0,t.jsx)("p",{className:"mt-3 text-xs text-[color:var(--ck-text-tertiary)]",children:"Note: ClawKitchen is read-only here; it surfaces status and pointers, but does not run or attach to tmux."})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Human approval gate (recommended)"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["For workflows that publish, deploy, or send outbound messages, keep a ",(0,t.jsx)("strong",{children:"human approval step"}),"."]}),(0,t.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("li",{children:"Generate a proposed change/post as a draft."}),(0,t.jsx)("li",{children:"Send the draft to a bound messaging channel (e.g. Telegram) for approval."}),(0,t.jsx)("li",{children:"Only execute the final action after explicit approve/deny."})]})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Where to change settings"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"These are the common knobs for a swarm/orchestrator scaffold (read-only references):"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:i.settingsPaths.map(e=>(0,t.jsx)("li",{className:"font-mono text-xs",children:e},e))})]})]}):(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Orchestrator"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No swarm/orchestrator detected for this team."})]}),(0,t.jsx)("button",{type:"button",onClick:()=>m(!0),className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-[var(--ck-accent-red-hover)]",children:"Add Orchestrator"})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-tertiary)]",children:"Detection"}),(0,t.jsx)("div",{className:"mt-1 font-mono text-xs",children:i.reason||"(no reason provided)"})]}),(0,t.jsxs)("p",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:["Default convention is ",(0,t.jsx)("code",{children:"<teamId>-swarm-orchestrator"}),". Once installed, this tab will show: tmux sessions, git worktrees/branches, and active task state."]}),(0,t.jsx)(T,{open:n,onClose:()=>m(!1),teamId:e,onInstalled:()=>{m(!1),x()}})]}):(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Orchestrator"}),(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:i.error})]}):(0,t.jsx)("div",{className:"mt-6 ck-glass-strong p-4",children:"No orchestrator state available."})}var O=e.i(92140);let L=[{id:"recipe",label:"Recipe"},{id:"agents",label:"Agents"},{id:"skills",label:"Skills"},{id:"cron",label:"Cron"},{id:"files",label:"Files"},{id:"orchestrator",label:"Orchestrator"}],$=[{id:"memory",label:"Memory"},{id:"workflows",label:"Workflows"}];function M({teamId:e,initialTab:l}){let m=(0,r.useRouter)(),[x,h]=(0,s.useState)([]),[p,v]=(0,s.useState)(""),[g,k]=(0,s.useState)(null),[w,I]=(0,s.useState)(null),[A,T]=(0,s.useState)(!1),[M,_]=(0,s.useState)(e),[F,E]=(0,s.useState)(e),[P,J]=(0,s.useState)(""),[U,D]=(0,s.useState)(null),[H,W]=(0,s.useState)(()=>["recipe","agents","skills","cron","files","memory","orchestrator","workflows"].includes(l)?l:"recipe"),B=(0,s.useMemo)(()=>[...L,...$],[]),[z,V]=(0,s.useState)(!0),[q,G]=(0,s.useState)(!1),[K,Y]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(!1),[Z,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(""),ea=(0,c.useToast)(),[er,ei]=(0,s.useState)(!1),[el,eo]=(0,s.useState)(!1),[ec,en]=(0,s.useState)(null);function ed(e,t="info"){let s=String(e??"").trim();s&&ea.push({kind:t,message:s})}let[em,ex]=(0,s.useState)([]),[eh,ep]=(0,s.useState)(!1),[eu,ev]=(0,s.useState)(""),[eg,ek]=(0,s.useState)(!1),[ef,ey]=(0,s.useState)("SOUL.md"),[eb,ej]=(0,s.useState)(""),[eN,ew]=(0,s.useState)([]),[eS,eI]=(0,s.useState)(!1),[eC,eA]=(0,s.useState)([]),[eT,eR]=(0,s.useState)(!1),eO=(0,s.useMemo)(()=>{let e=String(P??"");if(!e.startsWith("---\n"))return[];let t=e.indexOf("\n---\n",4);if(-1===t)return[];let s=e.slice(4,t+1);try{let e=(0,a.parse)(s)??{};return(Array.isArray(e.agents)?e.agents:[]).map(e=>e).map(e=>({role:String(e.role??"").trim(),name:"string"==typeof e.name?e.name:void 0})).filter(e=>!!e.role)}catch{return[]}},[P]),[eL,e$]=(0,s.useState)(""),[eM,e_]=(0,s.useState)(""),[eF,eE]=(0,s.useState)(""),eP=(0,s.useMemo)(()=>("__custom__"===eL?eM:eL).trim()||"",[eL,eM]),[eJ,eU]=(0,s.useState)([]),[eD,eH]=(0,s.useState)([]),[eW,eB]=(0,s.useState)(!1),[ez,eV]=(0,s.useState)(""),[eq,eG]=(0,s.useState)(!1),[eK,eY]=(0,s.useState)(""),[eQ,eX]=(0,s.useState)(""),eZ=(0,s.useMemo)(()=>x.filter(e=>"team"===e.kind),[x]),e0=(0,s.useMemo)(()=>x.find(e=>e.id===M&&"workspace"===e.source)??x.find(e=>e.id===M)??null,[x,M]),e1=!!e.trim(),e2=!!M.trim(),e3=x.some(e=>e.id===M&&"workspace"===e.source),e5=!!(e0?.source==="builtin"&&!e3);async function e4(){let e=M.trim();if(e){ee(!0),es("");try{let t=await (0,d.fetchJson)(`/api/recipes/${encodeURIComponent(e)}`,{cache:"no-store"}),s=t.recipe;J(s.content),D("string"==typeof t.recipeHash?t.recipeHash:null)}catch(e){es((0,n.errorMessage)(e))}finally{ee(!1)}}}async function e6(e){let t=p.trim(),s=String(e.toId??M).trim(),a=String(e.toName??F).trim(),r=!!e.overwrite,i=!!e.scaffold;if(!t)throw Error("Source recipe id is required");if(!s)throw Error("Custom recipe id is required");return await (0,d.fetchJson)("/api/recipes/clone",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({fromId:t,toId:s,toName:a||void 0,overwrite:r,scaffold:i})})}async function e7(e,t){G(!0),ed("");try{let s=await e6({overwrite:e,...t});if(s.scaffold&&!s.scaffold.ok&&ed(`Scaffold failed (recipe was still cloned): ${s.scaffold.error||"Unknown error"}`,"error"),P.trim()&&P.trim()!==s.content.trim()){let e=function(e,t){if(!e.startsWith("---\n"))return e;let s=e.indexOf("\n---\n",4);if(-1===s)return e;let a=e.slice(4,s),r=e.slice(s+5),{next:i,sawTeamBlock:l,patched:o}=function(e,t){let s=[],a=!1,r=!1,i=!1;for(let l of e){if(/^team\s*:\s*$/i.test(l)){a=!0,r=!0,s.push(l);continue}if(a&&/^\S/.test(l)&&(a=!1),a&&/^\s+teamId\s*:/i.test(l)){s.push(` teamId: ${t}`),i=!0;continue}s.push(l)}return{next:s,sawTeamBlock:r,patched:i}}(a.split("\n"),t);if(l&&!o){let e=[];for(let s of i)e.push(s),/^team\s*:\s*$/i.test(s)&&e.push(` teamId: ${t}`);return`---
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86103,e=>{"use strict";var t=e.i(43476),s=e.i(71645);e.i(22258);var a=e.i(94988),r=e.i(18566),i=e.i(54510),l=e.i(44355);function o({open:e,teamId:s,recipeId:a,onClose:r,onConfirm:i,busy:o}){return(0,t.jsxs)(l.ConfirmationModal,{open:e,onClose:r,title:"Publish changes",confirmLabel:"Publish changes",confirmBusyLabel:"Publishing…",busy:o,onConfirm:i,confirmButtonClassName:"rounded-[var(--ck-radius-sm)] bg-emerald-600 px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-emerald-500 disabled:opacity-50",children:[(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["This will re-scaffold team ",(0,t.jsx)("code",{className:"font-mono",children:s})," from recipe ",(0,t.jsx)("code",{className:"font-mono",children:a}),"."]}),(0,t.jsxs)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-amber-400/30 bg-amber-500/10 p-3 text-sm text-amber-100",children:[(0,t.jsx)("div",{className:"font-medium",children:"Complete overwrite"}),(0,t.jsxs)("div",{className:"mt-1",children:["All existing team workspace files managed by the recipe will be overwritten (for example: ",(0,t.jsx)("code",{className:"font-mono",children:"AGENTS.md"}),","," ",(0,t.jsx)("code",{className:"font-mono",children:"SOUL.md"}),", role templates, and other scaffolded files). Any manual edits in those files will be lost."]})]})]})}var c=e.i(76972),n=e.i(82310),d=e.i(42771);function m(e,t){try{return JSON.parse(e)}catch{return t}}async function x(e){let[t,s]=await Promise.all([(0,d.fetchJson)("/api/recipes",{cache:"no-store"}),fetch(`/api/teams/meta?teamId=${encodeURIComponent(e)}`,{cache:"no-store"})]);return{recipesData:t,metaRes:s}}async function h(e){let t=await (0,d.fetchAll)([`/api/teams/files?teamId=${encodeURIComponent(e)}`,`/api/cron/jobs?teamId=${encodeURIComponent(e)}`,"/api/agents",`/api/teams/skills?teamId=${encodeURIComponent(e)}`,"/api/skills/available"]),s=await Promise.all(t.map(e=>e.text()));return{responses:t,texts:s}}async function p(e,t){t.setTeamFilesLoading(!0),t.setCronLoading(!0),t.setTeamAgentsLoading(!0),t.setSkillsLoading(!0);try{let{responses:s,texts:a}=await h(e),[r,i,l,o,c]=s,[n,d,x,p,u]=a,v=m(n,{});r.ok&&v.ok&&Array.isArray(v.files)&&t.setTeamFiles(v.files.map(e=>({name:String(e.name??""),missing:!!e.missing,required:!!e.required,rationale:"string"==typeof e.rationale?e.rationale:void 0})));let g=m(d,{});i.ok&&g.ok&&Array.isArray(g.jobs)&&t.setCronJobs(g.jobs);let k=m(x,{});if(l.ok&&Array.isArray(k.agents)){let s=k.agents.filter(t=>String(t.id??"").startsWith(`${e}-`));t.setTeamAgents(s.map(e=>({id:String(e.id??""),identityName:"string"==typeof e.identityName?e.identityName:void 0})))}let f=m(p,{});o.ok&&f.ok&&Array.isArray(f.skills)&&t.setSkillsList(f.skills);let y=m(u,{});if(c.ok&&y.ok&&Array.isArray(y.skills)){let e=y.skills;t.setAvailableSkills(e),t.setSelectedSkill(t=>{let s=String(t??"").trim();return s&&e.includes(s)?s:e[0]??""})}}finally{t.setTeamFilesLoading(!1),t.setCronLoading(!1),t.setTeamAgentsLoading(!1),t.setSkillsLoading(!1)}}async function u(e,t){let s=await x(e);t.setRecipes(s.recipesData.recipes??[]);let a=null;try{let e=await s.metaRes.json(),r=e.meta;s.metaRes.ok&&e.ok&&r?.recipeId?(a={recipeId:String(r.recipeId),recipeName:"string"==typeof r.recipeName?r.recipeName:void 0},t.setTeamMetaRecipeHash("string"==typeof r.recipeHash?r.recipeHash:null)):t.setTeamMetaRecipeHash(null)}catch{t.setTeamMetaRecipeHash(null)}if(a)t.setLockedFromId(a.recipeId),t.setLockedFromName(a.recipeName??null),t.setProvenanceMissing(!1),t.setFromId(a.recipeId);else{t.setLockedFromId(null),t.setLockedFromName(null),t.setProvenanceMissing(!0);let a=s.recipesData.recipes??[],r=a.find(t=>"team"===t.kind&&t.id===e),i=a.find(e=>"team"===e.kind),l=r??i;l&&t.setFromId(l.id)}await p(e,{setTeamFiles:t.setTeamFiles,setCronJobs:t.setCronJobs,setTeamAgents:t.setTeamAgents,setSkillsList:t.setSkillsList,setAvailableSkills:t.setAvailableSkills,setSelectedSkill:t.setSelectedSkill,setTeamFilesLoading:t.setTeamFilesLoading,setCronLoading:t.setCronLoading,setTeamAgentsLoading:t.setTeamAgentsLoading,setSkillsLoading:t.setSkillsLoading})}async function v(e){try{let t=await (0,d.fetchJson)("/api/agents",{cache:"no-store"}),s=(Array.isArray(t.agents)?t.agents:[]).filter(t=>String(t.id??"").startsWith(`${e}-`)).map(e=>({id:String(e.id??""),identityName:"string"==typeof e.identityName?e.identityName:void 0}));return{ok:!0,agents:s}}catch{return{ok:!1,agents:[]}}}async function g(e,t,s){try{await (0,d.fetchJson)("/api/scaffold",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"team",recipeId:t.trim(),teamId:e,applyConfig:!0,overwrite:!1,allowExisting:!0,cronInstallChoice:"no"})})}catch(e){s((0,n.errorMessage)(e),"error")}}async function k(e,t,s,a){let r=Date.now();for(;Date.now()-r<a;){try{let a=await v(e);if(a.ok){s(a.agents);let e=!!t&&a.agents.some(e=>e.id===t);if(!t||e)return!0}}catch{}await new Promise(e=>setTimeout(e,500))}return!1}async function f(e){let{teamId:t,toId:s,newRole:a,derivedRole:r,newRoleName:i,content:l,setContent:o,setTeamAgents:c,flashMessage:m,ensureCustomRecipeExists:x}=e;try{await x({overwrite:!1})}catch(t){let e=(0,n.errorMessage)(t);if(!/Recipe id already exists:/i.test(e))throw t}let h=await (0,d.fetchJson)("/api/recipes/team-agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify("__custom__"===a?{recipeId:s.trim(),op:"add",role:r,name:i}:{recipeId:s.trim(),op:"addLike",baseRole:r,teamId:t,name:i})});if(!h.ok)throw Error("Failed updating agents list");o(String(h.content??l)),await g(t,s,m);let p="string"==typeof h.addedAgentId?h.addedAgentId:"";if(!await k(t,p,c,5e3)&&p){try{fetch("/api/gateway/restart",{method:"POST"})}catch{}await k(t,p,c,1e4)}m(`Updated agents list in ${s}`,"success")}function y(e){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Custom recipe target"}),e.loading?(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Loading team…"}):null]}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Team id"}),(0,t.jsx)("input",{value:e.toId,onChange:t=>e.setToId(t.target.value),disabled:!e.canEditTargetId,className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)] disabled:opacity-70"}),(0,t.jsx)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:"This is the custom recipe id that will be created when you save."}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Team name"}),(0,t.jsx)("input",{value:e.toName,onChange:t=>e.setToName(t.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:e.saving||!e.teamIdValid||!e.targetIdValid||e.targetIsBuiltin,onClick:()=>e.onSaveCustom(!0),className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:e.saving?"Saving":"Save"}),(0,t.jsx)("button",{type:"button",disabled:e.saving||!e.teamIdValid||!e.targetIdValid||e.targetIsBuiltin||!e.loadedRecipeHash||!e.teamMetaRecipeHash||e.loadedRecipeHash===e.teamMetaRecipeHash,onClick:e.onPublishOpen,className:"rounded-[var(--ck-radius-sm)] bg-emerald-600 px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:e.publishing?"Publishing":"Publish changes"}),(0,t.jsx)("button",{type:"button",disabled:e.saving,onClick:e.onDeleteOpen,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] disabled:opacity-50",children:"Delete Team"})]})]}),(0,t.jsxs)("div",{className:"ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Notes"}),(0,t.jsxs)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Parent recipe (locked)"}),(0,t.jsx)("select",{disabled:!0,className:"mt-2 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)] disabled:opacity-70",value:e.fromId,onChange:t=>e.setFromId(t.target.value),children:e.teamRecipes.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.id," (",e.source,")"]},`${e.source}:${e.id}`))}),e.lockedFromId&&(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("code",{children:e.lockedFromId}),e.lockedFromName?` (${e.lockedFromName})`:""]}),!e.lockedFromId&&e.provenanceMissing&&(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Provenance not found for this team."})]}),(0,t.jsxs)("ul",{className:"mt-4 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("li",{children:"Save writes the custom recipe file identified by Team id."}),(0,t.jsx)("li",{children:"Publish changes re-scaffolds this team from your custom recipe."}),(0,t.jsx)("li",{children:"Delete Team runs openclaw recipes remove-team."})]})]})]}),(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Recipe markdown"}),e.recipeLoadError?(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:e.recipeLoadError}):null,(0,t.jsx)("textarea",{value:e.content,onChange:t=>{e.setContent(t.target.value),e.setLoadedRecipeHash(null)},className:"mt-2 h-[55vh] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]",spellCheck:!1})]})]})}function b(e){let{teamId:s,toId:a,recipeAgents:r,newRole:i,setNewRole:l,customRole:o,setCustomRole:c,newRoleName:n,setNewRoleName:d,derivedRole:m,saving:x,teamAgents:h,teamAgentsLoading:p,onAddAgent:u}=e;return(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Agents in this team"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Add/remove agents by updating the ",(0,t.jsx)("code",{children:"agents:"})," list in your custom team recipe (",(0,t.jsx)("code",{children:a}),")."]}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Role"}),(0,t.jsxs)("select",{value:i,onChange:e=>{let t=e.target.value;if(l(t),"__custom__"===t){c(""),d("");return}c("");let s=r.find(e=>e.role===t);d(s?.name||"")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"Select…"}),r.map(e=>(0,t.jsx)("option",{value:e.role,children:e.name||e.role},e.role)),(0,t.jsx)("option",{value:"__custom__",children:"Other…"})]}),"__custom__"===i?(0,t.jsx)("input",{value:o,onChange:e=>c(e.target.value),placeholder:"role (e.g. researcher)",className:"mt-2 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}):null,(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["This writes to the recipe's ",(0,t.jsx)("code",{children:"agents:"})," list."]})]}),(0,t.jsx)("div",{className:"sm:col-span-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Name (optional)"}),(0,t.jsx)("input",{value:n,onChange:e=>d(e.target.value),placeholder:"Onchain Researcher",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})})]}),(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:(0,t.jsx)("button",{disabled:x||!m,onClick:u,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:"Add agent"})}),(0,t.jsxs)("div",{className:"mt-6",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Detected installed team agents (read-only)"}),(0,t.jsxs)("ul",{className:"mt-2 space-y-2",children:[h.length?h.map(e=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-[color:var(--ck-text-primary)]",children:e.identityName||e.id}),(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:e.id})]}),(0,t.jsx)("a",{className:"text-sm font-medium text-[var(--ck-accent-red)] hover:text-[color:var(--ck-accent-red-hover)]",href:"/agents/"+encodeURIComponent(e.id)+"?returnTo="+encodeURIComponent("/teams/"+s+"?tab=agents"),children:"Edit"})]},e.id)):null,0===h.length&&!p&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No team agents detected."}),0===h.length&&p&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"})]})]})]})}function j(e){return(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Skills"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"Skills installed in this team workspace. For agent-specific skills, open the agent from the Agents tab."}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Installed"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:e.skillsList.length?e.skillsList.map(e=>(0,t.jsx)("li",{children:e},e)):(0,t.jsx)("li",{children:"None installed."})})]}),(0,t.jsxs)("div",{className:"mt-5 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15 p-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Add a skill"}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,t.jsx)("select",{value:e.selectedSkill,onChange:t=>e.setSelectedSkill(t.target.value),disabled:e.installingSkill||e.skillsLoading||!e.availableSkills.length,className:"w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",children:e.availableSkills.length?e.availableSkills.map(e=>(0,t.jsx)("option",{value:e,children:e},e)):(0,t.jsx)("option",{value:"",children:"No skills found"})}),(0,t.jsx)("button",{type:"button",disabled:e.installingSkill||e.skillsLoading||!e.selectedSkill,onClick:e.onInstallSkill,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:e.installingSkill?"Adding":"Add"})]}),e.teamSkillError&&(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:e.teamSkillError}),e.teamSkillMsg&&(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-emerald-400/30 bg-emerald-500/10 p-3 text-sm text-emerald-100",children:e.teamSkillMsg}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["Uses openclaw recipes install-skill with team-id ",e.teamId,"."]})]})]})}function N(e){let{cronJobs:s,cronLoading:a,saving:r,onCronAction:i}=e;return(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Cron jobs (filtered by team name)"}),(0,t.jsxs)("ul",{className:"mt-3 space-y-3",children:[s.length?s.map(e=>{let s=String(e.id??e.jobId??"").trim(),a=s||String(e.name??"job"),l=String(e.name??e.id??e.jobId??"(unnamed)"),o=e.enabled??e.state?.enabled;return(0,t.jsxs)("li",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"font-medium text-[color:var(--ck-text-primary)]",children:l}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Enabled: ",String(o??"?")]}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,t.jsx)("button",{disabled:r||!s,onClick:()=>i(s,l,"run"),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Run"}),(0,t.jsx)("button",{disabled:r||!s,onClick:()=>i(s,l,"enable"),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Enable"}),(0,t.jsx)("button",{disabled:r||!s,onClick:()=>i(s,l,"disable"),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2.5 py-1.5 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Disable"}),s?null:(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"(missing id)"})]})]},a)}):null,0===s.length&&a&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading"}),0===s.length&&!a&&(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No cron jobs detected for this team."})]})]})}var w=e.i(72532);function S(e){let{teamFiles:s,teamFilesLoading:a,showOptionalFiles:r,setShowOptionalFiles:i,fileName:l,fileContent:o,setFileContent:c,teamFileError:n,saving:d,onLoadTeamFile:m,onSaveTeamFile:x}=e;return(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsx)(w.FileListWithOptionalToggle,{title:"Team files",files:s,loading:a,showOptionalFiles:r,onShowOptionalChange:i,selectedFileName:l,onSelectFile:m}),(0,t.jsxs)("div",{className:"ck-glass-strong p-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:["Edit: ",l]}),(0,t.jsx)("button",{disabled:d,onClick:x,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:d?"Saving…":"Save file"})]}),n?(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:n}):null,(0,t.jsx)("textarea",{value:o,onChange:e=>c(e.target.value),className:"mt-3 h-[55vh] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]",spellCheck:!1})]})]})}function I(e){return`${e._file??""}:${e._line??0}`}function C({teamId:e}){let[a,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(""),[o,c]=(0,s.useState)([]),[d,m]=(0,s.useState)([]),[x,h]=(0,s.useState)([]),[p,u]=(0,s.useState)("learning"),[v,g]=(0,s.useState)(""),[k,f]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[j,N]=(0,s.useState)(null);async function w(){r(!0),l("");try{let t=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await t.json();if(!t.ok||!s.ok)throw Error(s.error||"Failed to load memory");c(Array.isArray(s.files)?s.files:[]),m(Array.isArray(s.pinnedItems)?s.pinnedItems:[]),h(Array.isArray(s.items)?s.items:[])}catch(e){l((0,n.errorMessage)(e)),c([]),m([]),h([])}finally{r(!1)}}(0,s.useEffect)(()=>{w()},[e]);let S=(0,s.useMemo)(()=>[{label:"decision",value:"decision"},{label:"learning",value:"learning"},{label:"bug",value:"bug"},{label:"customer",value:"customer"},{label:"release",value:"release"}],[]),C=(0,s.useMemo)(()=>new Set(d.map(e=>e._key)),[d]);async function A(t){let s=I(t);if(t._file&&t._line){N(s),l("");try{let s={op:"pin",ts:new Date().toISOString(),actor:`${e}-lead`,key:{file:"team.jsonl",line:t._line},item:{ts:t.ts,author:t.author,type:t.type,content:t.content,source:t.source}},a=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)}),r=await a.json();if(!a.ok||!r.ok)throw Error(r.error||"Failed to pin");await w()}catch(e){l((0,n.errorMessage)(e))}finally{N(null)}}}async function T(t){let s=I(t);if(t._file&&t._line){N(s),l("");try{let s={op:"unpin",ts:new Date().toISOString(),actor:`${e}-lead`,key:{file:"team.jsonl",line:t._line}},a=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(s)}),r=await a.json();if(!a.ok||!r.ok)throw Error(r.error||"Failed to unpin");await w()}catch(e){l((0,n.errorMessage)(e))}finally{N(null)}}}return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Team memory (file-first)"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Stored in ",(0,t.jsx)("span",{className:"font-mono",children:"shared-context/memory/*.jsonl"}),". Items must be attributable."]}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-secondary)]",children:["Canonical memory model doc:"," ",(0,t.jsx)("a",{className:"underline decoration-white/20 underline-offset-4 hover:decoration-white/40",href:"https://github.com/JIGGAI/ClawRecipes/blob/main/docs/MEMORY_MODEL.md",target:"_blank",rel:"noreferrer",children:"ClawRecipes/docs/MEMORY_MODEL.md"})]})]}),(0,t.jsx)("button",{type:"button",onClick:w,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Refresh"})]}),i?(0,t.jsx)("div",{className:"mt-3 rounded border border-red-400/30 bg-red-500/10 p-2 text-sm text-red-100",children:i}):null,(0,t.jsxs)("div",{className:"mt-3 text-xs text-[color:var(--ck-text-secondary)]",children:["Files: ",o.length?o.join(", "):"(none)"]})]}),(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Add memory item"}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"type"}),(0,t.jsx)("select",{value:p,onChange:e=>u(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",children:S.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"source (ticket/pr/path)"}),(0,t.jsx)("input",{value:k,onChange:e=>f(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",placeholder:"e.g. ticket 0088, PR https://..., shared-context/DECISIONS.md"})]}),(0,t.jsxs)("label",{className:"block md:col-span-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"content"}),(0,t.jsx)("textarea",{value:v,onChange:e=>g(e.target.value),className:"mt-1 h-[110px] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 text-sm text-[color:var(--ck-text-primary)]",placeholder:"Write a small, specific memory item…"})]}),(0,t.jsx)("div",{className:"md:col-span-2",children:(0,t.jsx)("button",{type:"button",disabled:y||!v.trim(),onClick:async()=>{b(!0),l("");try{let t={op:"append",ts:new Date().toISOString(),author:`${e}-lead`,type:p,content:v.trim(),source:k.trim()?{text:k.trim()}:void 0,file:"team.jsonl"},s=await fetch(`/api/teams/memory?teamId=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),a=await s.json();if(!s.ok||!a.ok)throw Error(a.error||"Failed to append memory");g(""),f(""),await w()}catch(e){l((0,n.errorMessage)(e))}finally{b(!1)}},className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:y?"Saving…":"Append to team.jsonl"})})]})]}),(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Pinned memory"}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[d.length," pinned"]})]}),a?(0,t.jsx)("div",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,(0,t.jsx)("div",{className:"mt-3 space-y-3",children:d.length?d.map(e=>(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.ts}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"rounded bg-white/5 px-2 py-0.5 font-mono",children:e.type}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"font-mono",children:e.author}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsxs)("span",{className:"font-mono",children:["pinned ",e.pinnedAt]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>void T(e),disabled:j===e._key,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:j===e._key?"Unpinning…":"Unpin"})]}),(0,t.jsx)("div",{className:"mt-2 whitespace-pre-wrap text-sm text-[color:var(--ck-text-primary)]",children:e.content}),e.source?(0,t.jsx)("pre",{className:"mt-2 overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(e.source,null,2)}):null]},e._key)):(0,t.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No pinned items yet."})})]}),(0,t.jsxs)("div",{className:"ck-glass p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Recent memory"}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:["Showing ",x.length," (max 200)"]})]}),a?(0,t.jsx)("div",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,(0,t.jsx)("div",{className:"mt-3 space-y-3",children:x.length?x.map(e=>{let s=I(e),a=C.has(s);return(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.ts}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"rounded bg-white/5 px-2 py-0.5 font-mono",children:e.type}),(0,t.jsx)("span",{className:"mx-2",children:"•"}),(0,t.jsx)("span",{className:"font-mono",children:e.author})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e._file?(0,t.jsxs)("span",{className:"text-[10px] text-[color:var(--ck-text-tertiary)] font-mono",children:[e._file,":",e._line]}):null,(0,t.jsx)("button",{type:"button",onClick:()=>void A(e),disabled:a||j===s||!e._file||!e._line,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:a?"Pinned":j===s?"Pinning…":"Pin"})]})]}),(0,t.jsx)("div",{className:"mt-2 whitespace-pre-wrap text-sm text-[color:var(--ck-text-primary)]",children:e.content}),e.source?(0,t.jsx)("pre",{className:"mt-2 overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(e.source,null,2)}):null]},`${e._file??"?"}:${e._line??0}`)}):(0,t.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No memory items yet."})})]})]})}var A=e.i(74080);function T({open:e,onClose:a,teamId:r,onInstalled:i}){let l=(0,s.useMemo)(()=>`${r}-swarm-orchestrator`,[r]),[o,c]=(0,s.useState)(l),[n,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(`~/swarm-worktrees/${r}`),[p,u]=(0,s.useState)("origin/main"),[v,g]=(0,s.useState)(!0),[k,f]=(0,s.useState)(!0),[y,b]=(0,s.useState)(!1),[j,N]=(0,s.useState)(null),[w,S]=(0,s.useState)(null),I=(0,s.useMemo)(()=>({effectiveAgentId:String(o??"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/--+/g,"-")}),[o]);return e?(0,A.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[210]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:()=>{y||a()}}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"w-full max-w-xl rounded-2xl border border-white/10 bg-[color:var(--ck-bg-glass-strong)] p-5 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsx)("div",{className:"text-lg font-semibold text-[color:var(--ck-text-primary)]",children:"Add Orchestrator"}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:["This will scaffold a new ",(0,t.jsx)("span",{className:"font-mono text-xs",children:"swarm-orchestrator"})," agent workspace for this team and prefill its config."]}),(0,t.jsx)("label",{className:"mt-4 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Orchestrator agent id"}),(0,t.jsx)("input",{value:o,onChange:e=>c(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Default: ",(0,t.jsx)("span",{className:"font-mono",children:l})," (normalized: ",(0,t.jsx)("span",{className:"font-mono",children:I.effectiveAgentId}),")"]}),(0,t.jsx)("label",{className:"mt-4 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Repo directory (SWARM_REPO_DIR)"}),(0,t.jsx)("input",{value:n,onChange:e=>m(e.target.value),placeholder:"~/my-project",className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Worktree root (SWARM_WORKTREE_ROOT)"}),(0,t.jsx)("input",{value:x,onChange:e=>h(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsx)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:"Recommend a dedicated folder outside the repo."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Base ref (SWARM_BASE_REF)"}),(0,t.jsx)("input",{value:p,onChange:e=>u(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsxs)("label",{className:"mt-5 flex items-start gap-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:v,onChange:e=>g(e.target.checked),className:"mt-1"}),(0,t.jsxs)("span",{children:["Add this agent to OpenClaw config (recommended).",(0,t.jsx)("br",{}),(0,t.jsxs)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:["This will modify ",(0,t.jsx)("span",{className:"font-mono",children:"~/.openclaw/openclaw.json"})," to add ",(0,t.jsx)("span",{className:"font-mono",children:I.effectiveAgentId}),"."]})]})]}),(0,t.jsxs)("label",{className:"mt-3 flex items-start gap-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:k,onChange:e=>f(e.target.checked),className:"mt-1"}),(0,t.jsxs)("span",{children:["Make scripts executable (developer convenience).",(0,t.jsx)("br",{}),(0,t.jsxs)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:["Runs ",(0,t.jsx)("span",{className:"font-mono",children:"chmod +x .clawdbot/*.sh"})," in the orchestrator workspace."]})]})]}),j?(0,t.jsx)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:j}):null,w?(0,t.jsxs)("div",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-emerald-400/30 bg-emerald-500/10 p-3 text-sm text-emerald-100",children:["Installed ",(0,t.jsx)("span",{className:"font-mono",children:w.orchestratorAgentId})," → ",(0,t.jsx)("span",{className:"font-mono",children:w.workspace})]}):null,(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:a,disabled:y,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:y||!I.effectiveAgentId||!n.trim(),onClick:async()=>{b(!0),N(null),S(null);try{let e=await (0,d.fetchJson)("/api/teams/orchestrator/install",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:r,orchestratorAgentId:I.effectiveAgentId,repoDir:n.trim(),worktreeRoot:x.trim(),baseRef:p.trim(),applyConfig:v,makeExecutable:k})});if(!e.ok)throw Error(e.error);S({orchestratorAgentId:e.orchestratorAgentId,workspace:e.workspace}),i()}catch(e){N(e instanceof Error?e.message:String(e))}finally{b(!1)}},className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-[var(--ck-accent-red-hover)] disabled:opacity-50",children:y?"Installing…":"Install"})]})]})})})]}),document.body):null}function R({teamId:e}){let[a,r]=(0,s.useState)(!0),[i,l]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),[n,m]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{r(!0);try{let t=await (0,d.fetchJson)(`/api/teams/orchestrator?teamId=${encodeURIComponent(e)}`,{cache:"no-store"});l(t),c(new Date().toISOString())}catch(e){l({ok:!1,error:e instanceof Error?e.message:String(e)}),c(new Date().toISOString())}finally{r(!1)}},[e]);return((0,s.useEffect)(()=>{x()},[x]),a)?(0,t.jsx)("div",{className:"mt-6 ck-glass-strong p-4",children:"Loading orchestrator state…"}):i?i.ok?i.present?(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Orchestrator"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Agent: ",(0,t.jsx)("span",{className:"font-mono",children:i.agent.id}),i.agent.identityName?` (${i.agent.identityName})`:""]}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Workspace: ",(0,t.jsx)("span",{className:"font-mono",children:i.agent.workspace})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:o?(0,t.jsxs)("span",{children:["Last updated: ",(0,t.jsx)("span",{className:"font-mono",children:o})]}):null}),(0,t.jsx)("button",{type:"button",onClick:()=>void x(),disabled:a,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15 disabled:opacity-50",children:a?"Refreshing…":"Refresh"})]})]}),(0,t.jsxs)("div",{className:"mt-5 grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("section",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"tmux sessions"}),i.tmuxSessions.length?(0,t.jsx)("ul",{className:"mt-2 space-y-2",children:i.tmuxSessions.map(e=>(0,t.jsxs)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.name}),(0,t.jsxs)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["attached=",String(e.attached),"number"==typeof e.windows?` windows=${e.windows}`:""]})]},e.name))}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No sessions detected (or tmux not running)."})]}),(0,t.jsxs)("section",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"git worktrees"}),i.worktrees.length?(0,t.jsx)("ul",{className:"mt-2 space-y-2",children:i.worktrees.map(e=>(0,t.jsxs)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"font-mono text-xs",children:e.path}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[e.branch?e.branch:"(no branch)",e.sha?` @ ${e.sha.slice(0,7)}`:""]})]},e.path))}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No worktrees detected."})]})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Active tasks"}),i.activeTasksSummary?(0,t.jsxs)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"font-mono text-xs",children:i.activeTasksSummary.path}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["number"==typeof i.activeTasksSummary.taskCount?`tasks=${i.activeTasksSummary.taskCount}`:"tasks=?",i.activeTasksSummary.rawType?` type=${i.activeTasksSummary.rawType}`:""]})]}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No active-tasks.json found."})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"CLI quick actions"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"The orchestrator is designed to be driven from the CLI (and usually tmux). Common commands:"}),(0,t.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:"tmux ls"}),(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(list sessions)"})]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:"tmux attach -t <session>"}),(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(jump into a running swarm)"})]}),(0,t.jsxs)("li",{children:[(0,t.jsxs)("span",{className:"font-mono text-xs",children:["git -C ",i.agent.workspace," worktree list"]}),(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(inspect worktrees)"})]})]}),(0,t.jsx)("p",{className:"mt-3 text-xs text-[color:var(--ck-text-tertiary)]",children:"Note: ClawKitchen is read-only here; it surfaces status and pointers, but does not run or attach to tmux."})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Human approval gate (recommended)"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["For workflows that publish, deploy, or send outbound messages, keep a ",(0,t.jsx)("strong",{children:"human approval step"}),"."]}),(0,t.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("li",{children:"Generate a proposed change/post as a draft."}),(0,t.jsx)("li",{children:"Send the draft to a bound messaging channel (e.g. Telegram) for approval."}),(0,t.jsx)("li",{children:"Only execute the final action after explicit approve/deny."})]})]}),(0,t.jsxs)("section",{className:"mt-4 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Where to change settings"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"These are the common knobs for a swarm/orchestrator scaffold (read-only references):"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:i.settingsPaths.map(e=>(0,t.jsx)("li",{className:"font-mono text-xs",children:e},e))})]})]}):(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Orchestrator"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No swarm/orchestrator detected for this team."})]}),(0,t.jsx)("button",{type:"button",onClick:()=>m(!0),className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-[var(--ck-accent-red-hover)]",children:"Add Orchestrator"})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-tertiary)]",children:"Detection"}),(0,t.jsx)("div",{className:"mt-1 font-mono text-xs",children:i.reason||"(no reason provided)"})]}),(0,t.jsxs)("p",{className:"mt-3 text-sm text-[color:var(--ck-text-secondary)]",children:["Default convention is ",(0,t.jsx)("code",{children:"<teamId>-swarm-orchestrator"}),". Once installed, this tab will show: tmux sessions, git worktrees/branches, and active task state."]}),(0,t.jsx)(T,{open:n,onClose:()=>m(!1),teamId:e,onInstalled:()=>{m(!1),x()}})]}):(0,t.jsxs)("div",{className:"mt-6 ck-glass-strong p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Orchestrator"}),(0,t.jsx)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:i.error})]}):(0,t.jsx)("div",{className:"mt-6 ck-glass-strong p-4",children:"No orchestrator state available."})}var O=e.i(92140);let L=[{id:"recipe",label:"Recipe"},{id:"agents",label:"Agents"},{id:"skills",label:"Skills"},{id:"cron",label:"Cron"},{id:"files",label:"Files"},{id:"orchestrator",label:"Orchestrator"}],$=[{id:"memory",label:"Memory"},{id:"workflows",label:"Workflows"}];function M({teamId:e,initialTab:l}){let m=(0,r.useRouter)(),[x,h]=(0,s.useState)([]),[p,v]=(0,s.useState)(""),[g,k]=(0,s.useState)(null),[w,I]=(0,s.useState)(null),[A,T]=(0,s.useState)(!1),[M,_]=(0,s.useState)(e),[F,E]=(0,s.useState)(e),[P,J]=(0,s.useState)(""),[U,D]=(0,s.useState)(null),[H,W]=(0,s.useState)(()=>["recipe","agents","skills","cron","files","memory","orchestrator","workflows"].includes(l)?l:"recipe"),B=(0,s.useMemo)(()=>[...L,...$],[]),[z,V]=(0,s.useState)(!0),[q,G]=(0,s.useState)(!1),[K,Y]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(!1),[Z,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(""),ea=(0,c.useToast)(),[er,ei]=(0,s.useState)(!1),[el,eo]=(0,s.useState)(!1),[ec,en]=(0,s.useState)(null);function ed(e,t="info"){let s=String(e??"").trim();s&&ea.push({kind:t,message:s})}let[em,ex]=(0,s.useState)([]),[eh,ep]=(0,s.useState)(!1),[eu,ev]=(0,s.useState)(""),[eg,ek]=(0,s.useState)(!1),[ef,ey]=(0,s.useState)("SOUL.md"),[eb,ej]=(0,s.useState)(""),[eN,ew]=(0,s.useState)([]),[eS,eI]=(0,s.useState)(!1),[eC,eA]=(0,s.useState)([]),[eT,eR]=(0,s.useState)(!1),eO=(0,s.useMemo)(()=>{let e=String(P??"");if(!e.startsWith("---\n"))return[];let t=e.indexOf("\n---\n",4);if(-1===t)return[];let s=e.slice(4,t+1);try{let e=(0,a.parse)(s)??{};return(Array.isArray(e.agents)?e.agents:[]).map(e=>e).map(e=>({role:String(e.role??"").trim(),name:"string"==typeof e.name?e.name:void 0})).filter(e=>!!e.role)}catch{return[]}},[P]),[eL,e$]=(0,s.useState)(""),[eM,e_]=(0,s.useState)(""),[eF,eE]=(0,s.useState)(""),eP=(0,s.useMemo)(()=>("__custom__"===eL?eM:eL).trim()||"",[eL,eM]),[eJ,eU]=(0,s.useState)([]),[eD,eH]=(0,s.useState)([]),[eW,eB]=(0,s.useState)(!1),[ez,eV]=(0,s.useState)(""),[eq,eG]=(0,s.useState)(!1),[eK,eY]=(0,s.useState)(""),[eQ,eX]=(0,s.useState)(""),eZ=(0,s.useMemo)(()=>x.filter(e=>"team"===e.kind),[x]),e0=(0,s.useMemo)(()=>x.find(e=>e.id===M&&"workspace"===e.source)??x.find(e=>e.id===M)??null,[x,M]),e1=!!e.trim(),e2=!!M.trim(),e3=x.some(e=>e.id===M&&"workspace"===e.source),e5=!!(e0?.source==="builtin"&&!e3);async function e4(){let e=M.trim();if(e){ee(!0),es("");try{let t=await (0,d.fetchJson)(`/api/recipes/${encodeURIComponent(e)}`,{cache:"no-store"}),s=t.recipe;J(s.content),D("string"==typeof t.recipeHash?t.recipeHash:null)}catch(e){es((0,n.errorMessage)(e))}finally{ee(!1)}}}async function e6(e){let t=p.trim(),s=String(e.toId??M).trim(),a=String(e.toName??F).trim(),r=!!e.overwrite,i=!!e.scaffold;if(!t)throw Error("Source recipe id is required");if(!s)throw Error("Custom recipe id is required");return await (0,d.fetchJson)("/api/recipes/clone",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({fromId:t,toId:s,toName:a||void 0,overwrite:r,scaffold:i})})}async function e7(e,t){G(!0),ed("");try{let s=await e6({overwrite:e,...t});if(s.scaffold&&!s.scaffold.ok&&ed(`Scaffold failed (recipe was still cloned): ${s.scaffold.error||"Unknown error"}`,"error"),P.trim()&&P.trim()!==s.content.trim()){let e=function(e,t){if(!e.startsWith("---\n"))return e;let s=e.indexOf("\n---\n",4);if(-1===s)return e;let a=e.slice(4,s),r=e.slice(s+5),{next:i,sawTeamBlock:l,patched:o}=function(e,t){let s=[],a=!1,r=!1,i=!1;for(let l of e){if(/^team\s*:\s*$/i.test(l)){a=!0,r=!0,s.push(l);continue}if(a&&/^\S/.test(l)&&(a=!1),a&&/^\s+teamId\s*:/i.test(l)){s.push(` teamId: ${t}`),i=!0;continue}s.push(l)}return{next:s,sawTeamBlock:r,patched:i}}(a.split("\n"),t);if(l&&!o){let e=[];for(let s of i)e.push(s),/^team\s*:\s*$/i.test(s)&&e.push(` teamId: ${t}`);return`---
2
2
  ${e.join("\n")}
3
3
  ---
4
4
  ${r}`}return`---