@jiggai/kitchen 0.3.9 → 0.3.10

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 (101) 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/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +3 -3
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  14. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  16. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/channels/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/channels.html +2 -2
  22. package/.next/server/app/channels.rsc +4 -4
  23. package/.next/server/app/channels.segments/_full.segment.rsc +4 -4
  24. package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/channels.segments/_index.segment.rsc +3 -3
  26. package/.next/server/app/channels.segments/_tree.segment.rsc +2 -2
  27. package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +2 -2
  28. package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
  29. package/.next/server/app/cron-jobs/page_client-reference-manifest.js +1 -1
  30. package/.next/server/app/goals/[id]/page_client-reference-manifest.js +1 -1
  31. package/.next/server/app/goals/new/page_client-reference-manifest.js +1 -1
  32. package/.next/server/app/goals/new.html +2 -2
  33. package/.next/server/app/goals/new.rsc +4 -4
  34. package/.next/server/app/goals/new.segments/_full.segment.rsc +4 -4
  35. package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
  36. package/.next/server/app/goals/new.segments/_index.segment.rsc +3 -3
  37. package/.next/server/app/goals/new.segments/_tree.segment.rsc +2 -2
  38. package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +2 -2
  39. package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
  40. package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
  41. package/.next/server/app/goals/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/goals.html +1 -1
  43. package/.next/server/app/goals.rsc +4 -4
  44. package/.next/server/app/goals.segments/_full.segment.rsc +4 -4
  45. package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
  46. package/.next/server/app/goals.segments/_index.segment.rsc +3 -3
  47. package/.next/server/app/goals.segments/_tree.segment.rsc +2 -2
  48. package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +2 -2
  49. package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
  50. package/.next/server/app/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/recipes/[id]/page_client-reference-manifest.js +1 -1
  52. package/.next/server/app/recipes/page_client-reference-manifest.js +1 -1
  53. package/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/settings.html +1 -1
  56. package/.next/server/app/settings.rsc +4 -4
  57. package/.next/server/app/settings.segments/_full.segment.rsc +4 -4
  58. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  59. package/.next/server/app/settings.segments/_index.segment.rsc +3 -3
  60. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  61. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  62. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  63. package/.next/server/app/teams/[teamId]/page_client-reference-manifest.js +1 -1
  64. package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page_client-reference-manifest.js +1 -1
  65. package/.next/server/app/teams/[teamId]/runs/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/teams/[teamId]/tickets/[ticket]/page_client-reference-manifest.js +1 -1
  67. package/.next/server/app/teams/[teamId]/tickets/page_client-reference-manifest.js +1 -1
  68. package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page_client-reference-manifest.js +1 -1
  69. package/.next/server/app/teams/[teamId]/workflows/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/tickets/[ticket]/page_client-reference-manifest.js +1 -1
  71. package/.next/server/app/tickets/page_client-reference-manifest.js +1 -1
  72. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.js +1 -1
  73. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.js.map +1 -1
  74. package/.next/server/chunks/ssr/[root-of-the-server]__450d6006._.js +1 -1
  75. package/.next/server/chunks/ssr/[root-of-the-server]__450d6006._.js.map +1 -1
  76. package/.next/server/chunks/ssr/[root-of-the-server]__471bc2e7._.js +1 -1
  77. package/.next/server/chunks/ssr/[root-of-the-server]__471bc2e7._.js.map +1 -1
  78. package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js +1 -1
  79. package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js.map +1 -1
  80. package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js +1 -1
  81. package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js.map +1 -1
  82. package/.next/server/chunks/ssr/[root-of-the-server]__b577b475._.js +1 -1
  83. package/.next/server/chunks/ssr/[root-of-the-server]__b577b475._.js.map +1 -1
  84. package/.next/server/chunks/ssr/src_59477309._.js +1 -1
  85. package/.next/server/chunks/ssr/src_59477309._.js.map +1 -1
  86. package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_index_tsx_e68e9cbc._.js +1 -1
  87. package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_index_tsx_e68e9cbc._.js.map +1 -1
  88. package/.next/server/pages/404.html +1 -1
  89. package/.next/server/pages/500.html +2 -2
  90. package/.next/static/chunks/5f77499ca309ab9d.js +10 -0
  91. package/.next/static/chunks/7495459fdf300bf9.js +1 -0
  92. package/.next/static/chunks/{b28737d6a10af30d.js → ecdc9465f0e4d954.js} +1 -1
  93. package/.next/static/chunks/{cfe32a0bce2eab2b.css → f5d0d403c0fecb7f.css} +1 -1
  94. package/README.md +6 -5
  95. package/openclaw.plugin.json +1 -1
  96. package/package.json +1 -1
  97. package/.next/static/chunks/635adeaf329f2446.js +0 -1
  98. package/.next/static/chunks/6427cd3eaffdd572.js +0 -10
  99. /package/.next/static/{AKnetF2w3rOYqZBVpzsLP → 0PWp2TzSmiSf_Pf9YHES-}/_buildManifest.js +0 -0
  100. /package/.next/static/{AKnetF2w3rOYqZBVpzsLP → 0PWp2TzSmiSf_Pf9YHES-}/_clientMiddlewareManifest.json +0 -0
  101. /package/.next/static/{AKnetF2w3rOYqZBVpzsLP → 0PWp2TzSmiSf_Pf9YHES-}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><!--AKnetF2w3rOYqZBVpzsLP--><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/cfe32a0bce2eab2b.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/b28737d6a10af30d.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>Claw Kitchen</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/b28737d6a10af30d.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/cfe32a0bce2eab2b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"AKnetF2w3rOYqZBVpzsLP\",\"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/cfe32a0bce2eab2b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/b28737d6a10af30d.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\":\"Claw Kitchen\"}],[\"$\",\"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><!--0PWp2TzSmiSf_Pf9YHES_--><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/f5d0d403c0fecb7f.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/ecdc9465f0e4d954.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>Claw Kitchen</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/ecdc9465f0e4d954.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/f5d0d403c0fecb7f.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"0PWp2TzSmiSf_Pf9YHES-\",\"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/f5d0d403c0fecb7f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/ecdc9465f0e4d954.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\":\"Claw Kitchen\"}],[\"$\",\"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><!--AKnetF2w3rOYqZBVpzsLP--><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\":\"AKnetF2w3rOYqZBVpzsLP\",\"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><!--0PWp2TzSmiSf_Pf9YHES_--><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\":\"0PWp2TzSmiSf_Pf9YHES-\",\"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,10 @@
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`---
2
+ ${e.join("\n")}
3
+ ---
4
+ ${r}`}return`---
5
+ ${i.join("\n")}
6
+ ---
7
+ ${r}`}(function(e,t){var s;let a,r;if(!e.startsWith("---\n"))return e;let i=e.indexOf("\n---\n",4);if(-1===i)return e;let l=e.slice(4,i),o=e.slice(i+5),c=(s=l.split("\n"),a=!1,r=s.map(e=>/^id\s*:/i.test(e)?(a=!0,`id: ${t}`):e),a||r.unshift(`id: ${t}`),r);return`---
8
+ ${c.join("\n")}
9
+ ---
10
+ ${o}`}(P,M.trim()),M.trim());await (0,d.fetchJson)(`/api/recipes/${encodeURIComponent(M.trim())}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:e})}),J(e)}else J(s.content);try{let e=await (0,d.fetchJson)(`/api/recipes/${encodeURIComponent(M.trim())}`,{cache:"no-store"});"string"==typeof e.recipeHash&&D(e.recipeHash)}catch{D(null)}ed(`Saved team recipe: ${s.filePath}`,"success")}catch(e){ed((0,n.errorMessage)(e),"error")}finally{G(!1)}}async function e8(t){G(!0),ev("");try{let s=await (0,d.fetchJson)(`/api/teams/file?teamId=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{cache:"no-store"});if(!s.ok)throw Error("Failed to load file");ey(t),ej(String(s.content??""))}catch(e){ev((0,n.errorMessage)(e))}finally{G(!1)}}async function e9(){G(!0),ev("");try{if(!(await (0,d.fetchJson)("/api/teams/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,name:ef,content:eb})})).ok)throw Error("Failed to save file")}catch(e){ev((0,n.errorMessage)(e))}finally{G(!1)}}async function te(){G(!0);try{await f({teamId:e,toId:M,newRole:eL,derivedRole:eP,newRoleName:eF,content:P,setContent:J,setTeamAgents:eA,flashMessage:ed,ensureCustomRecipeExists:e6})}catch(e){ed((0,n.errorMessage)(e),"error")}finally{G(!1)}}async function tt(e,t,s){G(!0);try{await (0,d.fetchJson)("/api/cron/job",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,action:s})}),ed(`Cron ${s}: ${t}`,"success")}catch(e){ed((0,n.errorMessage)(e),"error")}finally{G(!1)}}async function ts(){eG(!0),eY(""),eX("");try{await (0,d.fetchJson)("/api/teams/skills/install",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,skill:ez})}),eY(`Installed skill: ${ez}`);try{let t=await (0,d.fetchJson)(`/api/teams/skills?teamId=${encodeURIComponent(e)}`,{cache:"no-store"});t.ok&&Array.isArray(t.skills)&&eU(t.skills)}catch{}}catch(e){eX((0,n.errorMessage)(e))}finally{eG(!1)}}return(0,s.useEffect)(()=>{_(e),E(e),J(""),D(null),en(null),eo(!1),ei(!1),l&&["recipe","agents","skills","cron","files","memory","orchestrator","workflows"].includes(l)&&W(l)},[e,l]),(0,s.useEffect)(()=>{let t=!1;return V(!0),u(e,{setRecipes:h,setLockedFromId:k,setLockedFromName:I,setProvenanceMissing:T,setFromId:v,setTeamMetaRecipeHash:en,setTeamFiles:ex,setCronJobs:ew,setTeamAgents:eA,setSkillsList:eU,setAvailableSkills:eH,setSelectedSkill:eV,setTeamFilesLoading:ep,setCronLoading:eI,setTeamAgentsLoading:eR,setSkillsLoading:eB}).then(()=>{t||V(!1)}).catch(e=>{ed((0,n.errorMessage)(e),"error"),t||V(!1)}),()=>{t=!0}},[e]),(0,s.useEffect)(()=>{!M.trim()||P.trim()||Z||e4()},[M]),(0,t.jsxs)("div",{className:"ck-glass w-full p-6 sm:p-8",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Team editor"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Bootstrap a ",(0,t.jsx)("strong",{children:"custom team recipe"})," for this installed team, without modifying builtin recipes."]}),(0,t.jsx)("div",{className:"mt-6 flex flex-wrap gap-2",children:B.map(e=>(0,t.jsx)("button",{onClick:()=>W(e.id),className:H===e.id?"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)]":"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)] hover:bg-white/10",children:e.label},e.id))}),"recipe"===H&&(0,t.jsx)(y,{loading:z,fromId:p,setFromId:v,toId:M,setToId:_,toName:F,setToName:E,canEditTargetId:!0,teamRecipes:eZ,lockedFromId:g,lockedFromName:w,provenanceMissing:A,saving:q,teamIdValid:e1,targetIdValid:e2,targetIsBuiltin:e5,loadedRecipeHash:U,teamMetaRecipeHash:ec,publishing:K,content:P,setContent:J,setLoadedRecipeHash:D,recipeLoadError:et,onSaveCustom:e7,onPublishOpen:()=>eo(!0),onDeleteOpen:()=>ei(!0)}),"agents"===H&&(0,t.jsx)(b,{teamId:e,toId:M,recipeAgents:eO,newRole:eL,setNewRole:e$,customRole:eM,setCustomRole:e_,newRoleName:eF,setNewRoleName:eE,derivedRole:eP,saving:q,teamAgents:eC,teamAgentsLoading:eT,onAddAgent:te}),"skills"===H&&(0,t.jsx)(j,{teamId:e,skillsList:eJ,availableSkills:eD,skillsLoading:eW,selectedSkill:ez,setSelectedSkill:eV,installingSkill:eq,teamSkillMsg:eK,teamSkillError:eQ,onInstallSkill:ts}),"cron"===H&&(0,t.jsx)(N,{cronJobs:eN,cronLoading:eS,saving:q,onCronAction:tt}),"orchestrator"===H&&(0,t.jsx)(R,{teamId:e}),"memory"===H&&(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(C,{teamId:e})}),"workflows"===H&&(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(O.default,{teamId:e})}),"files"===H&&(0,t.jsx)(S,{teamFiles:em,teamFilesLoading:eh,showOptionalFiles:eg,setShowOptionalFiles:ek,fileName:ef,fileContent:eb,setFileContent:ej,teamFileError:eu,saving:q,onLoadTeamFile:e8,onSaveTeamFile:e9}),(0,t.jsx)(o,{open:el,teamId:e,recipeId:M,busy:K,onClose:()=>eo(!1),onConfirm:async()=>{Y(!0);try{await (0,d.fetchJson)("/api/scaffold",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"team",recipeId:M.trim(),teamId:e,overwrite:!0,applyConfig:!0})});try{let t=await (0,d.fetchJson)(`/api/teams/meta?teamId=${encodeURIComponent(e)}`,{cache:"no-store"});t.ok&&t.meta&&"string"==typeof t.meta.recipeHash&&en(t.meta.recipeHash)}catch{}eo(!1),ed("Published changes to active team","success")}catch(e){ed((0,n.errorMessage)(e),"error")}finally{Y(!1)}}}),(0,t.jsx)(i.DeleteTeamModal,{open:er,teamId:e,busy:Q,onClose:()=>ei(!1),onConfirm:async()=>{X(!0);try{await (0,d.fetchJson)("/api/teams/remove-team",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e})}),ed("Deleted team successfully","success"),ei(!1),setTimeout(()=>m.push("/"),250)}catch(e){ed((0,n.errorMessage)(e),"error")}finally{X(!1)}}})]})}e.s(["default",()=>M],86103)}]);
@@ -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),s=e.i(22016),r=e.i(18566),a=e.i(71645),o=e.i(76972),c=e.i(82310),n=e.i(42771);function l({teamId:e,ticket:s,currentOwner:o}){let c=(0,r.useRouter)(),[n,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 s=e?`/api/teams/${encodeURIComponent(e)}/tickets/assignees`:"/api/tickets/assignees",r=await fetch(s,{cache:"no-store"}),a=await r.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(n);return o&&e.add(o),Array.from(e).sort()},[n,o]);async function k(){x(!0),b(null);try{let t=e?`/api/teams/${encodeURIComponent(e)}/tickets/assign`:"/api/tickets/assign",r=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:s,assignee:i})}),a=await r.json();if(!r.ok)return void b(a.error||"Assign failed");c.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:k,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 i(e,t){return t||0==e.trim().length}function d(e){let d=(0,r.useRouter)(),m=(0,o.useToast)(),[x,u]=(0,a.useTransition)(),[b,h]=(0,a.useState)(null),[k,p]=(0,a.useState)(null),v=(0,a.useMemo)(()=>(function(e){let t=function(e){let t=/^## Comments\s*$/gim.exec(e);if(!t)return null;let s=t.index+t[0].length,r=e.slice(s).search(/^##\s+/m),a=-1===r?e.length:s+r;return{start:s,end:a}}(e);if(!t)return[];let s=e.slice(t.start,t.end).replace(/^\s+/,"").split("\n"),r=[],a=null,o=/^- \*\*(.+?)\*\*\s+—\s+(.*)$/;for(let e of s){let t=e.replace(/\r$/,""),s=t.match(o);if(s){a&&r.push({...a,body:a.body.trimEnd()});let e=s[1].trim(),t=s[2].trim(),o=t.indexOf(":"),c=(o>=0?t.slice(0,o):t).trim()||"unknown",n=o>=0?t.slice(o+1).trimStart():"";a={timestamp:e,author:c,body:n?n+"\n":""};continue}a&&(a.body+=t.replace(/^\s{0,2}/,"")+"\n")}return a&&r.push({...a,body:a.body.trimEnd()}),r})(e.markdown),[e.markdown]),[f,g]=(0,a.useState)(""),[y,j]=(0,a.useState)("");async function N(){h(null),await (0,n.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 w(){h(null),await (0,n.fetchJson)(`/api/teams/${encodeURIComponent(e.teamId)}/tickets/delete`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:e.ticketId})})}async function C(){h(null);let t=y.trim();if(!t)throw Error("Comment cannot be empty.");await (0,n.fetchJson)(`/api/teams/${encodeURIComponent(e.teamId)}/tickets/comment`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:e.ticketId,author:f.trim()||void 0,comment:t})}),j(""),m.push({kind:"success",message:"Comment added."}),d.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)(s.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})]}),b?(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:b}):null,void 0!==e.currentOwner?(0,t.jsx)(l,{teamId:e.teamId,ticket:e.ticketId,currentOwner:e.currentOwner??null}):null,(0,t.jsx)("div",{className:"ck-glass p-4",children:(0,t.jsxs)("div",{className:"flex flex-wrap 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 font-medium text-[color:var(--ck-text-secondary)] hover:border-[color:var(--ck-border-strong)]",onClick:()=>p({kind:"goals"}),disabled:x,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:()=>p({kind:"delete"}),disabled:x,children:"Delete Ticket"})]})}),(0,t.jsxs)("div",{className:"ck-glass p-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:v.length})]}),v.length?(0,t.jsx)("div",{className:"mt-3 space-y-3",children:v.map((e,s)=>(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.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-primary)]",children:e.author}),(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}-${s}`))}):(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:f,onChange:e=>g(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:x})]}),(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:y,onChange:e=>j(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:x})]}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)("button",{type:"button","aria-busy":x,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:()=>{u(()=>{C().catch(e=>h((0,c.errorMessage)(e)))})},disabled:i(y,x),children:x?"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:()=>p(null),disabled:x,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;p(null),u(()=>{("goals"===t?N():w()).then(()=>{m.push({kind:"success",message:"delete"===t?"Ticket deleted.":"Moved to Goals."}),"delete"===t?d.push(e.backHref??"/tickets"):d.refresh()}).catch(e=>h((0,c.errorMessage)(e)))})},disabled:x,children:"Confirm"})]})]})}):null]})}e.s(["TicketDetailClient",()=>d,"isPostCommentDisabled",()=>i],36288)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42771,e=>{"use strict";async function t(e){return Promise.all(e.map(e=>fetch(e,{cache:"no-store"})))}async function r(e,t){let r=await fetch(e,t),o=await r.json();if(!r.ok)throw Error(o.error??"Request failed");return o}async function o(e,t){let r=await fetch(e,t),o=await r.json();return r.ok?{ok:!0,data:o}:{ok:!1,status:r.status,error:o.error??"Request failed"}}e.s(["fetchAll",()=>t,"fetchJson",()=>r,"fetchJsonWithStatus",()=>o])},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={assign:function(){return c},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return l}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});function a(e){let t={};for(let[r,o]of e.entries()){let e=t[r];void 0===e?t[r]=o:Array.isArray(e)?e.push(o):t[r]=[e,o]}return t}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(r,s(e));else t.set(r,s(o));return t}function c(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,o]of r.entries())e.append(t,o)}return e}},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={formatUrl:function(){return l},formatWithValidation:function(){return i},urlObjectKeys:function(){return c}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});let a=e.r(90809)._(e.r(98183)),s=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,o=e.protocol||"",n=e.pathname||"",l=e.hash||"",c=e.query||"",i=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?i=t+e.host:r&&(i=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(i+=":"+e.port)),c&&"object"==typeof c&&(c=String(a.urlQueryToSearchParams(c)));let u=e.search||c&&`?${c}`||"";return o&&!o.endsWith(":")&&(o+=":"),e.slashes||(!o||s.test(o))&&!1!==i?(i="//"+(i||""),n&&"/"!==n[0]&&(n="/"+n)):i||(i=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),n=n.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${o}${i}${n}${u}${l}`}let c=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function i(e){return l(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return n}});let o=e.r(71645);function n(e,t){let r=(0,o.useRef)(null),n=(0,o.useRef)(null);return(0,o.useCallback)(o=>{if(null===o){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=a(e,o)),t&&(n.current=a(t,o))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return b},NormalizeError:function(){return g},PageNotFoundError:function(){return k},SP:function(){return m},ST:function(){return x},WEB_VITALS:function(){return a},execOnce:function(){return s},getDisplayName:function(){return d},getLocationOrigin:function(){return i},getURL:function(){return u},isAbsoluteUrl:function(){return c},isResSent:function(){return h},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return y}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,r=!1;return(...o)=>(r||(r=!0,t=e(...o)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,c=e=>l.test(e);function i(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=i();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let o=await e.getInitialProps(t);if(r&&h(r))return o;if(!o)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${o}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return o}let m="u">typeof performance,x=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class g extends Error{}class k extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function y(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let o=e.r(18967),n=e.r(52817);function a(e){if(!(0,o.isAbsoluteUrl)(e))return!0;try{let t=(0,o.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,n.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={default:function(){return v},useLinkStatus:function(){return k}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});let a=e.r(90809),s=e.r(43476),l=a._(e.r(71645)),c=e.r(95057),i=e.r(8372),u=e.r(18581),d=e.r(18967),h=e.r(5550);e.r(33525);let f=e.r(91949),p=e.r(73668),m=e.r(9396);function x(e){return"string"==typeof e?e:(0,c.formatUrl)(e)}function v(t){var r;let o,n,a,[c,v]=(0,l.useOptimistic)(f.IDLE_LINK_STATUS),k=(0,l.useRef)(null),{href:b,as:j,children:y,prefetch:w=null,passHref:N,replace:C,shallow:S,scroll:P,onClick:E,onMouseEnter:M,onTouchStart:L,legacyBehavior:R=!1,onNavigate:T,ref:_,unstable_dynamicOnHover:O,...I}=t;o=y,R&&("string"==typeof o||"number"==typeof o)&&(o=(0,s.jsx)("a",{children:o}));let A=l.default.useContext(i.AppRouterContext),W=!1!==w,$=!1!==w?null===(r=w)||"auto"===r?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,{href:B,as:U}=l.default.useMemo(()=>{let e=x(b);return{href:e,as:j?x(j):e}},[b,j]);if(R){if(o?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});n=l.default.Children.only(o)}let z=R?n&&"object"==typeof n&&n.ref:_,D=l.default.useCallback(e=>(null!==A&&(k.current=(0,f.mountLinkInstance)(e,B,A,$,W,v)),()=>{k.current&&((0,f.unmountLinkForCurrentNavigation)(k.current),k.current=null),(0,f.unmountPrefetchableInstance)(e)}),[W,B,A,$,v]),F={ref:(0,u.useMergedRef)(D,z),onClick(t){R||"function"!=typeof E||E(t),R&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),!A||t.defaultPrevented||function(t,r,o,n,a,s,c){if("u">typeof window){let i,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((i=t.currentTarget.getAttribute("target"))&&"_self"!==i||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),c){let e=!1;if(c({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);l.default.startTransition(()=>{d(o||r,a?"replace":"push",s??!0,n.current)})}}(t,B,U,k,C,P,T)},onMouseEnter(e){R||"function"!=typeof M||M(e),R&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),A&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){R||"function"!=typeof L||L(e),R&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),A&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,d.isAbsoluteUrl)(U)?F.href=U:R&&!N&&("a"!==n.type||"href"in n.props)||(F.href=(0,h.addBasePath)(U)),a=R?l.default.cloneElement(n,F):(0,s.jsx)("a",{...I,...F,children:o}),(0,s.jsx)(g.Provider,{value:c,children:a})}e.r(84508);let g=(0,l.createContext)(f.IDLE_LINK_STATUS),k=()=>(0,l.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18566,(e,t,r)=>{t.exports=e.r(76562)},76972,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let o=(0,r.createContext)(null);function n({kind:e}){return"success"===e?(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5 text-emerald-400",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.707a1 1 0 00-1.414-1.414L9 10.172 7.707 8.879a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):"error"===e?(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5 text-red-400",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5a1 1 0 112 0 1 1 0 01-2 0zm0-8a1 1 0 012 0v6a1 1 0 11-2 0V5z",clipRule:"evenodd"})}):(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5 text-slate-300",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M18 10A8 8 0 11 2 10a8 8 0 0116 0zM9 9a1 1 0 112 0v5a1 1 0 11-2 0V9zm0-3a1 1 0 112 0 1 1 0 01-2 0z",clipRule:"evenodd"})})}function a({children:e}){let[a,s]=(0,r.useState)([]),l=(0,r.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e))},[]),c=(0,r.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,state:"leave"}:t)),window.setTimeout(()=>l(e),250)},[l]),i=(0,r.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,state:"show"}:t))},[]),u=(0,r.useCallback)(e=>{let t,r=`${Date.now()}-${(t=new Uint8Array(8),crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join(""))}`,o={id:r,timeoutMs:5e3,state:"enter",...e};s(e=>[o,...e].slice(0,4)),window.setTimeout(()=>i(r),10);let n=o.timeoutMs;n&&n>0&&window.setTimeout(()=>c(r),n)},[c,i]),d=(0,r.useMemo)(()=>({push:u}),[u]);return(0,t.jsxs)(o.Provider,{value:d,children:[e,(0,t.jsx)("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 z-[100] flex items-end px-4 py-6 sm:p-6",children:(0,t.jsx)("div",{className:"flex w-full flex-col items-start space-y-4",children:a.map(e=>{var r;return(0,t.jsx)("div",{className:"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg border bg-[color:var(--ck-toast-bg)] shadow-[var(--ck-shadow-2)] transition-all duration-200 ease-out border-[color:var(--ck-toast-border)] "+("enter"===(r=e.state)||"leave"===r?"translate-x-[-16px] opacity-0":"translate-x-0 opacity-100"),children:(0,t.jsx)("div",{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(n,{kind:e.kind})}),(0,t.jsxs)("div",{className:"ml-3 w-0 flex-1",children:[e.title?(0,t.jsx)("p",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:e.title}):null,(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm text-[color:var(--ck-text-primary)]",children:e.message})]}),(0,t.jsx)("div",{className:"ml-4 flex shrink-0",children:(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.id),className:"inline-flex rounded-md bg-transparent text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]","aria-label":"Dismiss",title:"Dismiss",children:[(0,t.jsx)("span",{className:"sr-only",children:"Close"}),(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5",children:(0,t.jsx)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 10-1.06-1.06L10 8.94 6.28 5.22z"})})]})})]})})},e.id)})})})]})}function s(){let e=(0,r.useContext)(o);if(!e)throw Error("useToast must be used within ToastProvider");return e}e.s(["ToastProvider",()=>a,"useToast",()=>s])},65046,e=>{"use strict";var t=e.i(71645);let r="ck-selected-team-changed";function o(){try{return(localStorage.getItem("ck-selected-team")||"").trim()}catch{return""}}function n(e){let t=()=>e();return window.addEventListener("storage",t),window.addEventListener(r,t),()=>{window.removeEventListener("storage",t),window.removeEventListener(r,t)}}function a(){return(0,t.useSyncExternalStore)(n,o,()=>"")}function s(){try{window.dispatchEvent(new Event(r))}catch{}}e.s(["dispatchSelectedTeamChanged",()=>s,"useSelectedTeamId",()=>a])},49830,e=>{"use strict";var t=e.i(43476),r=e.i(22016),o=e.i(18566),n=e.i(71645),a=e.i(65046),s=n;class l extends s.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught:",e,t)}render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"ck-glass mx-auto max-w-2xl p-6 sm:p-8",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight text-[color:var(--ck-text-primary)]",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"An unexpected error occurred. You can try refreshing the page or go back home."}),(0,t.jsx)("pre",{className:"mt-4 overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3 font-mono text-xs text-[color:var(--ck-text-secondary)]",children:this.state.error.message}),(0,t.jsxs)("div",{className:"mt-6 flex flex-wrap gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>window.location.reload(),className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-4 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-[var(--ck-accent-red)]/90",children:"Refresh page"}),(0,t.jsx)(r.default,{href:"/",className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-4 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] hover:bg-white/10",children:"Go home"})]})]}):this.props.children}}var c=e.i(42771);function i({className:e,children:r}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:r})}function u({className:e}){return(0,t.jsxs)(i,{className:e,children:[(0,t.jsx)("path",{d:"M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z",stroke:"currentColor",strokeWidth:"1.8"}),(0,t.jsx)("path",{d:"M12 2v2.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M12 19.5V22",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M2 12h2.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M19.5 12H22",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M4.2 4.2 6 6",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M18 18l1.8 1.8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M18 6l1.8-1.8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M4.2 19.8 6 18",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}function d({className:e}){return(0,t.jsx)(i,{className:e,children:(0,t.jsx)("path",{d:"M21 14.2A7.8 7.8 0 0 1 9.8 3a7 7 0 1 0 11.2 11.2Z",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round"})})}let h="ck-theme";function f(){return"light"===window.localStorage.getItem(h)?"light":"dark"}function p(){let[e,r]=(0,n.useState)(f);(0,n.useEffect)(()=>{document.documentElement.dataset.theme=e,window.localStorage.setItem(h,e)},[e]);let o="dark"===e?"Switch to light mode":"Switch to dark mode";return(0,t.jsxs)("button",{type:"button",onClick:function(){r(e=>"dark"===e?"light":"dark")},className:"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":o,title:o,children:[(0,t.jsx)("span",{className:"sr-only",suppressHydrationWarning:!0,children:o}),"dark"===e?(0,t.jsx)(d,{className:"h-4.5 w-4.5"}):(0,t.jsx)(u,{className:"h-4.5 w-4.5"})]})}var m=e.i(76972);function x({children:e}){return(0,t.jsx)("span",{className:"grid size-7 place-items-center text-[color:var(--ck-text-secondary)]","aria-hidden":!0,children:e})}function v({href:e,label:o,icon:n,active:a,collapsed:s}){return(0,t.jsxs)(r.default,{href:e,title:o,className:(a?"flex items-center rounded-[var(--ck-radius-sm)] bg-white/10 text-sm font-medium text-[color:var(--ck-text-primary)]":"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)]")+(s?" justify-center px-0 py-3":" gap-4 px-4 py-3"),children:[n,s?null:(0,t.jsx)("span",{children:o})]})}function g({children:e}){let s=(0,o.usePathname)()||"/",i=(0,o.useRouter)(),u=(0,n.useMemo)(()=>{let e=s.match(/^\/teams\/([^/]+)(?:\/|$)/);return e?decodeURIComponent(e[1]):null},[s]),d=(0,n.useMemo)(()=>s.startsWith("/teams/"),[s]),[h,f]=(0,n.useState)(()=>{try{return(localStorage.getItem("ck-selected-team")||"").trim()}catch{return""}}),g=(u||h).trim();function k(e){return g&&("/tickets"===e||"/goals"===e||"/cron-jobs"===e||"/runs"===e)?function(e,t){let[r,o]=e.split("?"),n=new URLSearchParams(o??"");return n.set("team",t),`${r}?${n.toString()}`}(e,g):e}function b(e){if(!s.startsWith("/teams/")&&("/tickets"===s||"/goals"===s||"/cron-jobs"===s||"/runs"===s))try{let t=new URL(window.location.href);if(!e){if(!t.searchParams.has("team"))return;t.searchParams.delete("team");let e=t.searchParams.toString();i.replace(t.pathname+(e?`?${e}`:""));return}if((t.searchParams.get("team")??"").trim()===e)return;t.searchParams.set("team",e),i.replace(t.pathname+"?"+t.searchParams.toString())}catch{}}(0,n.useEffect)(()=>{b(g)},[s,g]),(0,n.useEffect)(()=>{try{g?localStorage.setItem("ck-selected-team",g):localStorage.removeItem("ck-selected-team")}catch{}},[g]);let[j,y]=(0,n.useState)(!1);(0,n.useEffect)(()=>{try{let e=localStorage.getItem("ck-leftnav-collapsed");y("1"===e)}catch{}},[]);let[w,N]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{try{let e=await (0,c.fetchJson)("/api/agents",{cache:"no-store"}),t=Array.isArray(e.agents)?e.agents:[],r=new Set;for(let e of t){let t=String(e.workspace??"").split("/").filter(Boolean).find(e=>e.startsWith("workspace-"))??"";if(!t)continue;let o=t.slice(10);o&&"workspace"!==o&&r.add(o)}N(Array.from(r).sort())}catch{N([])}})()},[]);let C=[{href:"/",label:"Agents",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M3 11l9-8 9 8"}),(0,t.jsx)("path",{d:"M5 10v10h14V10"})]})})},{href:"/recipes",label:"Recipes",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M6 4h12v16H6z"}),(0,t.jsx)("path",{d:"M9 8h6"}),(0,t.jsx)("path",{d:"M9 12h6"})]})})},{href:k("/tickets"),label:"Tickets",icon:(0,t.jsx)(x,{children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{d:"M4 7h16v4a2 2 0 0 1 0 4v4H4v-4a2 2 0 0 0 0-4z"})})})},{href:"/channels",label:"Channels",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M4 6h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 18h16"}),(0,t.jsx)("path",{d:"M7 9h0"})]})})},{href:k("/goals"),label:"Goals",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7v5l3 3"})]})})},{href:k("/cron-jobs"),label:"Cron jobs",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7v5"})]})})},{href:k("/runs"),label:"Runs",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M4 19h16"}),(0,t.jsx)("path",{d:"M6 16l4-4 3 3 5-7"}),(0,t.jsx)("circle",{cx:"10",cy:"12",r:"1"}),(0,t.jsx)("circle",{cx:"13",cy:"15",r:"1"}),(0,t.jsx)("circle",{cx:"18",cy:"8",r:"1"})]})})},{href:"/settings",label:"Settings",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"}),(0,t.jsx)("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"})]})})}],S=j?"w-16":"w-72";return(0,t.jsx)(m.ToastProvider,{children:(0,t.jsxs)("div",{className:"flex h-dvh w-dvw overflow-hidden",children:[(0,t.jsxs)("aside",{className:`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)] ${S}`,children:[(0,t.jsxs)("div",{className:"flex h-14 items-center justify-between gap-2 border-b border-[color:var(--ck-border-subtle)] px-3",children:[(0,t.jsx)(r.default,{href:"/",className:"text-sm font-semibold tracking-tight",title:"Home",children:j?"CK":"Claw Kitchen"}),(0,t.jsx)("button",{onClick:function(){y(e=>{let t=!e;try{localStorage.setItem("ck-leftnav-collapsed",t?"1":"0")}catch{}return t})},className:"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:j?"Expand":"Collapse",children:j?"»":"«"})]}),(0,t.jsx)("div",{className:"border-b border-[color:var(--ck-border-subtle)] p-2",children:j?(0,t.jsx)("button",{className:"w-full rounded-[var(--ck-radius-sm)] bg-white/5 px-2 py-2 text-xs font-medium text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:g?`Team: ${g}`:"Select team",onClick:()=>{let e=w[0]||"";if(e){f(e);try{localStorage.setItem("ck-selected-team",e)}catch{}b(e)}},children:"👥"}):(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"px-2 pt-1 text-xs font-semibold uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"Team"}),(0,t.jsxs)("select",{value:g??"",disabled:d,onChange:e=>{let t=(e.target.value||"").trim();f(t);try{t?localStorage.setItem("ck-selected-team",t):localStorage.removeItem("ck-selected-team")}catch{}(0,a.dispatchSelectedTeamChanged)(),b(t)},className:"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)]"+(d?" cursor-not-allowed opacity-60":""),children:[(0,t.jsx)("option",{value:"",children:"All teams"}),w.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),g?(0,t.jsx)(r.default,{href:`/teams/${encodeURIComponent(g)}`,className:"px-2 pb-1 text-xs font-medium text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-secondary)]",children:"Edit team"}):null]})}),(0,t.jsxs)("nav",{className:"min-h-0 flex-1 overflow-auto p-2",children:[(0,t.jsx)("div",{className:"mt-2 px-2 pb-2 pt-2"}),C.map(e=>{let r;return(0,t.jsx)(v,{href:e.href,label:e.label,icon:(0,t.jsx)("span",{"aria-hidden":!0,children:e.icon}),collapsed:j,active:s===(r=e.href.split("?")[0])||s.startsWith(r+"/")},e.href)})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-[color:var(--ck-border-subtle)] p-2",children:[(0,t.jsx)("a",{href:"https://github.com/JIGGAI/ClawRecipes/tree/main/docs",target:"_blank",rel:"noreferrer",className:j?"mx-auto rounded-[var(--ck-radius-sm)] px-2 py-2 text-sm text-[color:var(--ck-text-secondary)] hover:bg-white/5 hover:text-[color:var(--ck-text-primary)]":"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",children:j?"📖":"Docs"}),j?null:(0,t.jsx)(p,{})]})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)("main",{className:"h-full overflow-auto p-4 md:p-6",children:(0,t.jsx)(l,{children:e})})})]})})}e.s(["AppShell",()=>g],49830)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42771,e=>{"use strict";async function t(e){return Promise.all(e.map(e=>fetch(e,{cache:"no-store"})))}async function r(e,t){let r=await fetch(e,t),o=await r.json();if(!r.ok)throw Error(o.error??"Request failed");return o}async function o(e,t){let r=await fetch(e,t),o=await r.json();return r.ok?{ok:!0,data:o}:{ok:!1,status:r.status,error:o.error??"Request failed"}}e.s(["fetchAll",()=>t,"fetchJson",()=>r,"fetchJsonWithStatus",()=>o])},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={assign:function(){return c},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return l}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});function a(e){let t={};for(let[r,o]of e.entries()){let e=t[r];void 0===e?t[r]=o:Array.isArray(e)?e.push(o):t[r]=[e,o]}return t}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(r,s(e));else t.set(r,s(o));return t}function c(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,o]of r.entries())e.append(t,o)}return e}},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={formatUrl:function(){return l},formatWithValidation:function(){return i},urlObjectKeys:function(){return c}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});let a=e.r(90809)._(e.r(98183)),s=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,o=e.protocol||"",n=e.pathname||"",l=e.hash||"",c=e.query||"",i=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?i=t+e.host:r&&(i=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(i+=":"+e.port)),c&&"object"==typeof c&&(c=String(a.urlQueryToSearchParams(c)));let u=e.search||c&&`?${c}`||"";return o&&!o.endsWith(":")&&(o+=":"),e.slashes||(!o||s.test(o))&&!1!==i?(i="//"+(i||""),n&&"/"!==n[0]&&(n="/"+n)):i||(i=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),n=n.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${o}${i}${n}${u}${l}`}let c=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function i(e){return l(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return n}});let o=e.r(71645);function n(e,t){let r=(0,o.useRef)(null),n=(0,o.useRef)(null);return(0,o.useCallback)(o=>{if(null===o){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=a(e,o)),t&&(n.current=a(t,o))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return b},NormalizeError:function(){return g},PageNotFoundError:function(){return k},SP:function(){return m},ST:function(){return x},WEB_VITALS:function(){return a},execOnce:function(){return s},getDisplayName:function(){return d},getLocationOrigin:function(){return i},getURL:function(){return u},isAbsoluteUrl:function(){return c},isResSent:function(){return h},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return y}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,r=!1;return(...o)=>(r||(r=!0,t=e(...o)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,c=e=>l.test(e);function i(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=i();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let o=await e.getInitialProps(t);if(r&&h(r))return o;if(!o)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${o}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return o}let m="u">typeof performance,x=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class g extends Error{}class k extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function y(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let o=e.r(18967),n=e.r(52817);function a(e){if(!(0,o.isAbsoluteUrl)(e))return!0;try{let t=(0,o.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,n.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return o}});let o=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={default:function(){return v},useLinkStatus:function(){return k}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});let a=e.r(90809),s=e.r(43476),l=a._(e.r(71645)),c=e.r(95057),i=e.r(8372),u=e.r(18581),d=e.r(18967),h=e.r(5550);e.r(33525);let f=e.r(91949),p=e.r(73668),m=e.r(9396);function x(e){return"string"==typeof e?e:(0,c.formatUrl)(e)}function v(t){var r;let o,n,a,[c,v]=(0,l.useOptimistic)(f.IDLE_LINK_STATUS),k=(0,l.useRef)(null),{href:b,as:j,children:y,prefetch:w=null,passHref:N,replace:C,shallow:S,scroll:E,onClick:P,onMouseEnter:M,onTouchStart:L,legacyBehavior:R=!1,onNavigate:T,ref:_,unstable_dynamicOnHover:O,...I}=t;o=y,R&&("string"==typeof o||"number"==typeof o)&&(o=(0,s.jsx)("a",{children:o}));let A=l.default.useContext(i.AppRouterContext),W=!1!==w,$=!1!==w?null===(r=w)||"auto"===r?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,{href:B,as:U}=l.default.useMemo(()=>{let e=x(b);return{href:e,as:j?x(j):e}},[b,j]);if(R){if(o?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});n=l.default.Children.only(o)}let z=R?n&&"object"==typeof n&&n.ref:_,D=l.default.useCallback(e=>(null!==A&&(k.current=(0,f.mountLinkInstance)(e,B,A,$,W,v)),()=>{k.current&&((0,f.unmountLinkForCurrentNavigation)(k.current),k.current=null),(0,f.unmountPrefetchableInstance)(e)}),[W,B,A,$,v]),F={ref:(0,u.useMergedRef)(D,z),onClick(t){R||"function"!=typeof P||P(t),R&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),!A||t.defaultPrevented||function(t,r,o,n,a,s,c){if("u">typeof window){let i,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((i=t.currentTarget.getAttribute("target"))&&"_self"!==i||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),c){let e=!1;if(c({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);l.default.startTransition(()=>{d(o||r,a?"replace":"push",s??!0,n.current)})}}(t,B,U,k,C,E,T)},onMouseEnter(e){R||"function"!=typeof M||M(e),R&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),A&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===O)},onTouchStart:function(e){R||"function"!=typeof L||L(e),R&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),A&&W&&(0,f.onNavigationIntent)(e.currentTarget,!0===O)}};return(0,d.isAbsoluteUrl)(U)?F.href=U:R&&!N&&("a"!==n.type||"href"in n.props)||(F.href=(0,h.addBasePath)(U)),a=R?l.default.cloneElement(n,F):(0,s.jsx)("a",{...I,...F,children:o}),(0,s.jsx)(g.Provider,{value:c,children:a})}e.r(84508);let g=(0,l.createContext)(f.IDLE_LINK_STATUS),k=()=>(0,l.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18566,(e,t,r)=>{t.exports=e.r(76562)},76972,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let o=(0,r.createContext)(null);function n({kind:e}){return"success"===e?(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5 text-emerald-400",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.707a1 1 0 00-1.414-1.414L9 10.172 7.707 8.879a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):"error"===e?(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5 text-red-400",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-1-5a1 1 0 112 0 1 1 0 01-2 0zm0-8a1 1 0 012 0v6a1 1 0 11-2 0V5z",clipRule:"evenodd"})}):(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5 text-slate-300",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M18 10A8 8 0 11 2 10a8 8 0 0116 0zM9 9a1 1 0 112 0v5a1 1 0 11-2 0V9zm0-3a1 1 0 112 0 1 1 0 01-2 0z",clipRule:"evenodd"})})}function a({children:e}){let[a,s]=(0,r.useState)([]),l=(0,r.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e))},[]),c=(0,r.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,state:"leave"}:t)),window.setTimeout(()=>l(e),250)},[l]),i=(0,r.useCallback)(e=>{s(t=>t.map(t=>t.id===e?{...t,state:"show"}:t))},[]),u=(0,r.useCallback)(e=>{let t,r=`${Date.now()}-${(t=new Uint8Array(8),crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join(""))}`,o={id:r,timeoutMs:5e3,state:"enter",...e};s(e=>[o,...e].slice(0,4)),window.setTimeout(()=>i(r),10);let n=o.timeoutMs;n&&n>0&&window.setTimeout(()=>c(r),n)},[c,i]),d=(0,r.useMemo)(()=>({push:u}),[u]);return(0,t.jsxs)(o.Provider,{value:d,children:[e,(0,t.jsx)("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 z-[100] flex items-end px-4 py-6 sm:p-6",children:(0,t.jsx)("div",{className:"flex w-full flex-col items-start space-y-4",children:a.map(e=>{var r;return(0,t.jsx)("div",{className:"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg border bg-[color:var(--ck-toast-bg)] shadow-[var(--ck-shadow-2)] transition-all duration-200 ease-out border-[color:var(--ck-toast-border)] "+("enter"===(r=e.state)||"leave"===r?"translate-x-[-16px] opacity-0":"translate-x-0 opacity-100"),children:(0,t.jsx)("div",{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(n,{kind:e.kind})}),(0,t.jsxs)("div",{className:"ml-3 w-0 flex-1",children:[e.title?(0,t.jsx)("p",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:e.title}):null,(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm text-[color:var(--ck-text-primary)]",children:e.message})]}),(0,t.jsx)("div",{className:"ml-4 flex shrink-0",children:(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.id),className:"inline-flex rounded-md bg-transparent text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]","aria-label":"Dismiss",title:"Dismiss",children:[(0,t.jsx)("span",{className:"sr-only",children:"Close"}),(0,t.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5",children:(0,t.jsx)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 10-1.06-1.06L10 8.94 6.28 5.22z"})})]})})]})})},e.id)})})})]})}function s(){let e=(0,r.useContext)(o);if(!e)throw Error("useToast must be used within ToastProvider");return e}e.s(["ToastProvider",()=>a,"useToast",()=>s])},65046,e=>{"use strict";var t=e.i(71645);let r="ck-selected-team-changed";function o(){try{return(localStorage.getItem("ck-selected-team")||"").trim()}catch{return""}}function n(e){let t=()=>e();return window.addEventListener("storage",t),window.addEventListener(r,t),()=>{window.removeEventListener("storage",t),window.removeEventListener(r,t)}}function a(){return(0,t.useSyncExternalStore)(n,o,()=>"")}function s(){try{window.dispatchEvent(new Event(r))}catch{}}e.s(["dispatchSelectedTeamChanged",()=>s,"useSelectedTeamId",()=>a])},49830,e=>{"use strict";var t=e.i(43476),r=e.i(22016),o=e.i(18566),n=e.i(71645),a=e.i(65046),s=n;class l extends s.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught:",e,t)}render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"ck-glass mx-auto max-w-2xl p-6 sm:p-8",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight text-[color:var(--ck-text-primary)]",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"An unexpected error occurred. You can try refreshing the page or go back home."}),(0,t.jsx)("pre",{className:"mt-4 overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-3 font-mono text-xs text-[color:var(--ck-text-secondary)]",children:this.state.error.message}),(0,t.jsxs)("div",{className:"mt-6 flex flex-wrap gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>window.location.reload(),className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-4 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] hover:bg-[var(--ck-accent-red)]/90",children:"Refresh page"}),(0,t.jsx)(r.default,{href:"/",className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-4 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] hover:bg-white/10",children:"Go home"})]})]}):this.props.children}}var c=e.i(42771);function i({className:e,children:r}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:r})}function u({className:e}){return(0,t.jsxs)(i,{className:e,children:[(0,t.jsx)("path",{d:"M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z",stroke:"currentColor",strokeWidth:"1.8"}),(0,t.jsx)("path",{d:"M12 2v2.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M12 19.5V22",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M2 12h2.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M19.5 12H22",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M4.2 4.2 6 6",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M18 18l1.8 1.8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M18 6l1.8-1.8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M4.2 19.8 6 18",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}function d({className:e}){return(0,t.jsx)(i,{className:e,children:(0,t.jsx)("path",{d:"M21 14.2A7.8 7.8 0 0 1 9.8 3a7 7 0 1 0 11.2 11.2Z",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round"})})}let h="ck-theme";function f(){return"light"===window.localStorage.getItem(h)?"light":"dark"}function p(){let[e,r]=(0,n.useState)(f);(0,n.useEffect)(()=>{document.documentElement.dataset.theme=e,window.localStorage.setItem(h,e)},[e]);let o="dark"===e?"Switch to light mode":"Switch to dark mode";return(0,t.jsxs)("button",{type:"button",onClick:function(){r(e=>"dark"===e?"light":"dark")},className:"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":o,title:o,children:[(0,t.jsx)("span",{className:"sr-only",suppressHydrationWarning:!0,children:o}),"dark"===e?(0,t.jsx)(d,{className:"h-4.5 w-4.5"}):(0,t.jsx)(u,{className:"h-4.5 w-4.5"})]})}var m=e.i(76972);function x({children:e}){return(0,t.jsx)("span",{className:"grid size-7 place-items-center text-[color:var(--ck-text-secondary)]","aria-hidden":!0,children:e})}function v({href:e,label:o,icon:n,active:a,collapsed:s}){return(0,t.jsxs)(r.default,{href:e,title:o,className:(a?"flex items-center rounded-[var(--ck-radius-sm)] bg-white/10 text-sm font-medium text-[color:var(--ck-text-primary)]":"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)]")+(s?" justify-center px-0 py-3":" gap-4 px-4 py-3"),children:[n,s?null:(0,t.jsx)("span",{children:o})]})}function g({children:e}){let s=(0,o.usePathname)()||"/",i=(0,o.useRouter)(),u=(0,n.useMemo)(()=>{let e=s.match(/^\/teams\/([^/]+)(?:\/|$)/);return e?decodeURIComponent(e[1]):null},[s]),d=(0,n.useMemo)(()=>s.startsWith("/teams/"),[s]),[h,f]=(0,n.useState)(""),g=(u||h).trim();function k(e){return g&&("/tickets"===e||"/goals"===e||"/cron-jobs"===e||"/runs"===e)?function(e,t){let[r,o]=e.split("?"),n=new URLSearchParams(o??"");return n.set("team",t),`${r}?${n.toString()}`}(e,g):e}function b(e){if(!s.startsWith("/teams/")&&("/tickets"===s||"/goals"===s||"/cron-jobs"===s||"/runs"===s))try{let t=new URL(window.location.href);if(!e){if(!t.searchParams.has("team"))return;t.searchParams.delete("team");let e=t.searchParams.toString();i.replace(t.pathname+(e?`?${e}`:""));return}if((t.searchParams.get("team")??"").trim()===e)return;t.searchParams.set("team",e),i.replace(t.pathname+"?"+t.searchParams.toString())}catch{}}(0,n.useEffect)(()=>{try{f((localStorage.getItem("ck-selected-team")||"").trim())}catch{}},[]),(0,n.useEffect)(()=>{b(g)},[s,g]),(0,n.useEffect)(()=>{try{g?localStorage.setItem("ck-selected-team",g):localStorage.removeItem("ck-selected-team")}catch{}},[g]);let[j,y]=(0,n.useState)(!1);(0,n.useEffect)(()=>{try{let e=localStorage.getItem("ck-leftnav-collapsed");y("1"===e)}catch{}},[]);let[w,N]=(0,n.useState)([]);(0,n.useEffect)(()=>{(async()=>{try{let e=await (0,c.fetchJson)("/api/agents",{cache:"no-store"}),t=Array.isArray(e.agents)?e.agents:[],r=new Set;for(let e of t){let t=String(e.workspace??"").split("/").filter(Boolean).find(e=>e.startsWith("workspace-"))??"";if(!t)continue;let o=t.slice(10);o&&"workspace"!==o&&r.add(o)}N(Array.from(r).sort())}catch{N([])}})()},[]);let C=[{href:"/",label:"Agents",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M3 11l9-8 9 8"}),(0,t.jsx)("path",{d:"M5 10v10h14V10"})]})})},{href:"/recipes",label:"Recipes",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M6 4h12v16H6z"}),(0,t.jsx)("path",{d:"M9 8h6"}),(0,t.jsx)("path",{d:"M9 12h6"})]})})},{href:k("/tickets"),label:"Tickets",icon:(0,t.jsx)(x,{children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{d:"M4 7h16v4a2 2 0 0 1 0 4v4H4v-4a2 2 0 0 0 0-4z"})})})},{href:"/channels",label:"Channels",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M4 6h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 18h16"}),(0,t.jsx)("path",{d:"M7 9h0"})]})})},{href:k("/goals"),label:"Goals",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7v5l3 3"})]})})},{href:k("/cron-jobs"),label:"Cron jobs",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7v5"})]})})},{href:k("/runs"),label:"Runs",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M4 19h16"}),(0,t.jsx)("path",{d:"M6 16l4-4 3 3 5-7"}),(0,t.jsx)("circle",{cx:"10",cy:"12",r:"1"}),(0,t.jsx)("circle",{cx:"13",cy:"15",r:"1"}),(0,t.jsx)("circle",{cx:"18",cy:"8",r:"1"})]})})},{href:"/settings",label:"Settings",icon:(0,t.jsx)(x,{children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"}),(0,t.jsx)("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"})]})})}],S=j?"w-16":"w-72";return(0,t.jsx)(m.ToastProvider,{children:(0,t.jsxs)("div",{className:"flex h-dvh w-dvw overflow-hidden",children:[(0,t.jsxs)("aside",{className:`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)] ${S}`,children:[(0,t.jsxs)("div",{className:"flex h-14 items-center justify-between gap-2 border-b border-[color:var(--ck-border-subtle)] px-3",children:[(0,t.jsx)(r.default,{href:"/",className:"text-sm font-semibold tracking-tight",title:"Home",children:j?"CK":"Claw Kitchen"}),(0,t.jsx)("button",{onClick:function(){y(e=>{let t=!e;try{localStorage.setItem("ck-leftnav-collapsed",t?"1":"0")}catch{}return t})},className:"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:j?"Expand":"Collapse",children:j?"»":"«"})]}),(0,t.jsx)("div",{className:"border-b border-[color:var(--ck-border-subtle)] p-2",children:j?(0,t.jsx)("button",{className:"w-full rounded-[var(--ck-radius-sm)] bg-white/5 px-2 py-2 text-xs font-medium text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:g?`Team: ${g}`:"Select team",onClick:()=>{let e=w[0]||"";if(e){f(e);try{localStorage.setItem("ck-selected-team",e)}catch{}b(e)}},children:"👥"}):(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"px-2 pt-1 text-xs font-semibold uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"Team"}),(0,t.jsxs)("select",{value:g??"",disabled:d,onChange:e=>{let t=(e.target.value||"").trim();f(t);try{t?localStorage.setItem("ck-selected-team",t):localStorage.removeItem("ck-selected-team")}catch{}(0,a.dispatchSelectedTeamChanged)(),b(t)},className:"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)]"+(d?" cursor-not-allowed opacity-60":""),children:[(0,t.jsx)("option",{value:"",children:"All teams"}),w.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),g?(0,t.jsx)(r.default,{href:`/teams/${encodeURIComponent(g)}`,className:"px-2 pb-1 text-xs font-medium text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-secondary)]",children:"Edit team"}):null]})}),(0,t.jsxs)("nav",{className:"min-h-0 flex-1 overflow-auto p-2",children:[(0,t.jsx)("div",{className:"mt-2 px-2 pb-2 pt-2"}),C.map(e=>{let r;return(0,t.jsx)(v,{href:e.href,label:e.label,icon:(0,t.jsx)("span",{"aria-hidden":!0,children:e.icon}),collapsed:j,active:s===(r=e.href.split("?")[0])||s.startsWith(r+"/")},e.href)})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-[color:var(--ck-border-subtle)] p-2",children:[(0,t.jsx)("a",{href:"https://github.com/JIGGAI/ClawRecipes/tree/main/docs",target:"_blank",rel:"noreferrer",className:j?"mx-auto rounded-[var(--ck-radius-sm)] px-2 py-2 text-sm text-[color:var(--ck-text-secondary)] hover:bg-white/5 hover:text-[color:var(--ck-text-primary)]":"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",children:j?"📖":"Docs"}),j?null:(0,t.jsx)(p,{})]})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)("main",{className:"h-full overflow-auto p-4 md:p-6",children:(0,t.jsx)(l,{children:e})})})]})})}e.s(["AppShell",()=>g],49830)}]);