@jiggai/kitchen 0.1.8 → 0.1.10-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -0
- package/.next/build-manifest.json +6 -6
- package/.next/prerender-manifest.json +3 -27
- package/.next/required-server-files.js +4 -4
- package/.next/required-server-files.json +4 -4
- package/.next/routes-manifest.json +30 -0
- package/.next/server/app/_global-error/page/build-manifest.json +4 -4
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +4 -4
- package/.next/server/app/_not-found/page.js +10 -9
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +4 -4
- package/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/agents/[agentId]/page/build-manifest.json +4 -4
- package/.next/server/app/agents/[agentId]/page.js +7 -7
- package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/add/route.js +1 -1
- package/.next/server/app/api/agents/add/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/files/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/identity/route.js +1 -1
- package/.next/server/app/api/agents/identity/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/route.js +1 -1
- package/.next/server/app/api/agents/route.js.nft.json +1 -1
- package/.next/server/app/api/gateway/restart/route.js +1 -1
- package/.next/server/app/api/gateway/restart/route.js.nft.json +1 -1
- package/.next/server/app/api/goals/[id]/promote/route.js.nft.json +1 -1
- package/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/goals/route.js.nft.json +1 -1
- package/.next/server/app/api/recipes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/recipes/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/recipes/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/recipes/route.js +1 -1
- package/.next/server/app/api/recipes/route.js.nft.json +1 -1
- package/.next/server/app/api/recipes/team-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/scaffold/route.js.nft.json +1 -1
- package/.next/server/app/api/swarms/start/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/swarms/start/route/build-manifest.json +11 -0
- package/.next/server/app/api/swarms/start/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/swarms/start/route.js +6 -0
- package/.next/server/app/api/swarms/start/route.js.map +5 -0
- package/.next/server/app/api/swarms/start/route.js.nft.json +1 -0
- package/.next/server/app/api/swarms/start/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/swarms/status/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/swarms/status/route/build-manifest.json +11 -0
- package/.next/server/app/api/swarms/status/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/swarms/status/route.js +6 -0
- package/.next/server/app/api/swarms/status/route.js.map +5 -0
- package/.next/server/app/api/swarms/status/route.js.nft.json +1 -0
- package/.next/server/app/api/swarms/status/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/teams/orchestrator/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/teams/orchestrator/route/build-manifest.json +11 -0
- package/.next/server/app/api/teams/orchestrator/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/teams/orchestrator/route.js +6 -0
- package/.next/server/app/api/teams/orchestrator/route.js.map +5 -0
- package/.next/server/app/api/teams/orchestrator/route.js.nft.json +1 -0
- package/.next/server/app/api/teams/orchestrator/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/teams/remove-team/route.js +1 -1
- package/.next/server/app/api/teams/remove-team/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/skills/install/route.js +1 -1
- package/.next/server/app/api/teams/skills/install/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/workflow-runs/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/teams/workflow-runs/route/build-manifest.json +11 -0
- package/.next/server/app/api/teams/workflow-runs/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/teams/workflow-runs/route.js +7 -0
- package/.next/server/app/api/teams/workflow-runs/route.js.map +5 -0
- package/.next/server/app/api/teams/workflow-runs/route.js.nft.json +1 -0
- package/.next/server/app/api/teams/workflow-runs/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/teams/workflows/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/teams/workflows/route/build-manifest.json +11 -0
- package/.next/server/app/api/teams/workflows/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/teams/workflows/route.js +6 -0
- package/.next/server/app/api/teams/workflows/route.js.map +5 -0
- package/.next/server/app/api/teams/workflows/route.js.nft.json +1 -0
- package/.next/server/app/api/teams/workflows/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/tickets/move/route.js +1 -1
- package/.next/server/app/api/tickets/move/route.js.nft.json +1 -1
- package/.next/server/app/channels/page/build-manifest.json +4 -4
- package/.next/server/app/channels/page.js +7 -7
- package/.next/server/app/channels/page.js.nft.json +1 -1
- package/.next/server/app/channels/page_client-reference-manifest.js +1 -1
- package/.next/server/app/channels.html +2 -2
- package/.next/server/app/channels.rsc +5 -5
- package/.next/server/app/channels.segments/_full.segment.rsc +5 -5
- package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
- package/.next/server/app/channels.segments/_index.segment.rsc +3 -3
- package/.next/server/app/channels.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
- package/.next/server/app/cron-jobs/page/build-manifest.json +4 -4
- package/.next/server/app/cron-jobs/page.js +7 -7
- package/.next/server/app/cron-jobs/page.js.nft.json +1 -1
- package/.next/server/app/cron-jobs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/cron-jobs.html +1 -1
- package/.next/server/app/cron-jobs.rsc +6 -6
- package/.next/server/app/cron-jobs.segments/_full.segment.rsc +6 -6
- package/.next/server/app/cron-jobs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/cron-jobs.segments/_index.segment.rsc +3 -3
- package/.next/server/app/cron-jobs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/cron-jobs.segments/cron-jobs/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/cron-jobs.segments/cron-jobs.segment.rsc +1 -1
- package/.next/server/app/goals/[id]/page/build-manifest.json +4 -4
- package/.next/server/app/goals/[id]/page.js +7 -7
- package/.next/server/app/goals/[id]/page.js.nft.json +1 -1
- package/.next/server/app/goals/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/goals/new/page/build-manifest.json +4 -4
- package/.next/server/app/goals/new/page.js +7 -7
- package/.next/server/app/goals/new/page.js.nft.json +1 -1
- package/.next/server/app/goals/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/goals/new.html +2 -2
- package/.next/server/app/goals/new.rsc +5 -5
- package/.next/server/app/goals/new.segments/_full.segment.rsc +5 -5
- package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/_index.segment.rsc +3 -3
- package/.next/server/app/goals/new.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
- package/.next/server/app/goals/page/build-manifest.json +4 -4
- package/.next/server/app/goals/page.js +7 -7
- package/.next/server/app/goals/page.js.nft.json +1 -1
- package/.next/server/app/goals/page_client-reference-manifest.js +1 -1
- package/.next/server/app/goals.html +1 -1
- package/.next/server/app/goals.rsc +5 -5
- package/.next/server/app/goals.segments/_full.segment.rsc +5 -5
- package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals.segments/_index.segment.rsc +3 -3
- package/.next/server/app/goals.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
- package/.next/server/app/page/build-manifest.json +4 -4
- package/.next/server/app/page.js +7 -7
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/recipes/[id]/page/build-manifest.json +4 -4
- package/.next/server/app/recipes/[id]/page.js +8 -8
- package/.next/server/app/recipes/[id]/page.js.nft.json +1 -1
- package/.next/server/app/recipes/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/recipes/page/build-manifest.json +4 -4
- package/.next/server/app/recipes/page.js +8 -8
- package/.next/server/app/recipes/page.js.nft.json +1 -1
- package/.next/server/app/recipes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page/build-manifest.json +4 -4
- package/.next/server/app/settings/page.js +7 -7
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +5 -5
- package/.next/server/app/settings.segments/_full.segment.rsc +5 -5
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +3 -3
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/app/teams/[teamId]/page/build-manifest.json +4 -4
- package/.next/server/app/teams/[teamId]/page.js +8 -8
- package/.next/server/app/teams/[teamId]/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tickets/[ticket]/page/build-manifest.json +4 -4
- package/.next/server/app/tickets/[ticket]/page.js +7 -7
- package/.next/server/app/tickets/[ticket]/page.js.nft.json +1 -1
- package/.next/server/app/tickets/[ticket]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tickets/page/build-manifest.json +4 -4
- package/.next/server/app/tickets/page.js +7 -7
- package/.next/server/app/tickets/page.js.nft.json +1 -1
- package/.next/server/app/tickets/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +5 -0
- package/.next/server/chunks/[root-of-the-server]__065a27a4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__065a27a4._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__94d68aa3._.js → [root-of-the-server]__1989d64f._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__94d68aa3._.js.map → [root-of-the-server]__1989d64f._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__c4ffbb03._.js → [root-of-the-server]__21b72903._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__c4ffbb03._.js.map → [root-of-the-server]__21b72903._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0c01c5c7._.js → [root-of-the-server]__262d8a6e._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0c01c5c7._.js.map → [root-of-the-server]__262d8a6e._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__b11231a9._.js → [root-of-the-server]__2f2c799d._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__b11231a9._.js.map → [root-of-the-server]__2f2c799d._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__6f85770b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__6f85770b._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__7cf49621._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__7cf49621._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__a27f8405._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__a27f8405._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__a5226713._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__a5226713._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__c7f92fce._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__c7f92fce._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__d737ca42._.js → [root-of-the-server]__e8bfeaba._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__d737ca42._.js.map → [root-of-the-server]__e8bfeaba._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__4eda99a9._.js → [root-of-the-server]__ebaa0038._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__4eda99a9._.js.map → [root-of-the-server]__ebaa0038._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__b59b3cdd._.js → [root-of-the-server]__f5546a39._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__b59b3cdd._.js.map → [root-of-the-server]__f5546a39._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__e6184ba3._.js → [root-of-the-server]__fdda9176._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__e6184ba3._.js.map → [root-of-the-server]__fdda9176._.js.map} +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_swarms_start_route_actions_b79e9029.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_swarms_start_route_actions_b79e9029.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_swarms_status_route_actions_54826df0.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_swarms_status_route_actions_54826df0.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_teams_orchestrator_route_actions_1949c463.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_teams_orchestrator_route_actions_1949c463.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_teams_workflow-runs_route_actions_8327ac7d.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_teams_workflow-runs_route_actions_8327ac7d.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_teams_workflows_route_actions_43dd6e07.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_teams_workflows_route_actions_43dd6e07.js.map +1 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.js +14 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0d4cb2ba._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0fd02d84._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__4393e897._.js.map → [root-of-the-server]__0fd02d84._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__285ae6b7._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__46e08d44._.js.map → [root-of-the-server]__285ae6b7._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2bef6884._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__15600e29._.js.map → [root-of-the-server]__2bef6884._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__3efd25c4._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__2a6f1e3e._.js.map → [root-of-the-server]__3efd25c4._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__491e06fa._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__491e06fa._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__550d78f8._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__bc3b27b0._.js.map → [root-of-the-server]__550d78f8._.js.map} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__e2e52c6e._.js → [root-of-the-server]__78cdd31e._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__8ecc89e4._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__507d2fc9._.js.map → [root-of-the-server]__8ecc89e4._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__92524828._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__247198dc._.js.map → [root-of-the-server]__92524828._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__9e1ab064._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__9e1ab064._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__a36a058d._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__8d24c9c3._.js.map → [root-of-the-server]__a36a058d._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__a8eca9e1._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__82ce3aee._.js.map → [root-of-the-server]__a8eca9e1._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__aa8e2649._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__f75a61bf._.js.map → [root-of-the-server]__aa8e2649._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__b2617fbf._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__fd669584._.js.map → [root-of-the-server]__b2617fbf._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__b5f65083._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__b5f65083._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__e5d416d5._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__3ad3e5b1._.js.map → [root-of-the-server]__e5d416d5._.js.map} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__b9356576._.js → [root-of-the-server]__f62d412e._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__b9356576._.js.map → [root-of-the-server]__f62d412e._.js.map} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__fbe5ff69._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__3575e6da._.js.map → [root-of-the-server]__fbe5ff69._.js.map} +1 -1
- package/.next/server/chunks/ssr/{_8c45edba._.js → _0bdae23a._.js} +3 -3
- package/.next/server/chunks/ssr/{node_modules_next_dist_esm_build_templates_app-page_68c68167.js.map → _0bdae23a._.js.map} +1 -1
- package/.next/server/chunks/ssr/{_0808c2b9._.js → _347e2d56._.js} +3 -3
- package/.next/server/chunks/ssr/_347e2d56._.js.map +1 -0
- package/.next/server/chunks/ssr/{_68793c1f._.js → _49fb12c2._.js} +3 -3
- package/.next/server/chunks/ssr/_49fb12c2._.js.map +1 -0
- package/.next/server/chunks/ssr/{_3c8b2df6._.js → _536983a4._.js} +3 -3
- package/.next/server/chunks/ssr/_536983a4._.js.map +1 -0
- package/.next/server/chunks/ssr/{_cd23c5af._.js → _5b282394._.js} +3 -3
- package/.next/server/chunks/ssr/_5b282394._.js.map +1 -0
- package/.next/server/chunks/ssr/{_6e70b5a4._.js → _5cc24343._.js} +3 -3
- package/.next/server/chunks/ssr/_5cc24343._.js.map +1 -0
- package/.next/server/chunks/ssr/{_92140ca3._.js → _7eac37fb._.js} +3 -3
- package/.next/server/chunks/ssr/_7eac37fb._.js.map +1 -0
- package/.next/server/chunks/ssr/{_8c8207c1._.js → _8062e992._.js} +3 -3
- package/.next/server/chunks/ssr/_8062e992._.js.map +1 -0
- package/.next/server/chunks/ssr/{_25e6aab8._.js → _99994c05._.js} +3 -3
- package/.next/server/chunks/ssr/_99994c05._.js.map +1 -0
- package/.next/server/chunks/ssr/{_b5e9afcc._.js → _aafc99aa._.js} +3 -3
- package/.next/server/chunks/ssr/_aafc99aa._.js.map +1 -0
- package/.next/server/chunks/ssr/{_39e6e769._.js → _b7f3caf7._.js} +3 -3
- package/.next/server/chunks/ssr/_b7f3caf7._.js.map +1 -0
- package/.next/server/chunks/ssr/_c2041f88._.js +4 -0
- package/.next/server/chunks/ssr/_c2041f88._.js.map +1 -0
- package/.next/server/chunks/ssr/{_3158c108._.js → _f4d8af3b._.js} +3 -3
- package/.next/server/chunks/ssr/_f4d8af3b._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_12287b3d._.js → node_modules_next_dist_8a37abed._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_next_dist_12287b3d._.js.map → node_modules_next_dist_8a37abed._.js.map} +1 -1
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_9774470f._.js → node_modules_next_dist_client_components_2fffaa3a._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_9774470f._.js.map → node_modules_next_dist_client_components_2fffaa3a._.js.map} +1 -1
- package/.next/server/chunks/ssr/{node_modules_next_dist_esm_build_templates_app-page_68c68167.js → node_modules_next_dist_esm_build_templates_app-page_b5ef32b4.js} +3 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_b5ef32b4.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_HomeClient_tsx_f9f7568d._.js +1 -1
- package/.next/server/chunks/ssr/src_app_HomeClient_tsx_f9f7568d._.js.map +1 -1
- package/.next/server/chunks/ssr/src_app_global-error_tsx_aa661ba4._.js +3 -0
- package/.next/server/chunks/ssr/src_app_global-error_tsx_aa661ba4._.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_not-found_tsx_3f23d179._.js +3 -0
- package/.next/server/chunks/ssr/src_app_not-found_tsx_3f23d179._.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_tsx_2900b91d._.js +2 -2
- package/.next/server/chunks/ssr/src_app_teams_[teamId]_team-editor_tsx_2900b91d._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +4 -4
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{40f7fde35327d214.js → 423ca3a7f09c1470.js} +1 -1
- package/.next/static/chunks/{82abf2d65f5428ae.js → 68a088aa49e6124a.js} +3 -3
- package/.next/static/chunks/96b0d0ef92ef0eca.css +3 -0
- package/.next/static/chunks/a92e9d0c91b71b55.js +1 -0
- package/.next/static/chunks/bd3fcd39d918f9b4.js +10 -0
- package/.next/static/chunks/c84580993f22c17a.js +1 -0
- package/.next/static/chunks/f3e3461eda4a8d62.js +1 -0
- package/.next/static/chunks/{turbopack-ae1340e658f67df8.js → turbopack-6c658f991a22d28a.js} +1 -1
- package/package.json +2 -2
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/chef.jpg +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/src/app/HomeClient.tsx +1 -1
- package/src/app/api/cron/jobs/route.ts +12 -4
- package/src/app/api/swarms/start/route.ts +118 -0
- package/src/app/api/swarms/status/route.ts +50 -0
- package/src/app/api/teams/orchestrator/route.ts +218 -0
- package/src/app/api/teams/workflow-runs/route.ts +431 -0
- package/src/app/api/teams/workflows/route.ts +88 -0
- package/src/app/cron-jobs/page.tsx +1 -1
- package/src/app/global-error.tsx +50 -0
- package/src/app/not-found.tsx +8 -0
- package/src/app/recipes/page.tsx +1 -1
- package/src/app/settings/page.tsx +1 -1
- package/src/app/teams/[teamId]/OrchestratorPanel.tsx +228 -0
- package/src/app/teams/[teamId]/page.tsx +25 -29
- package/src/app/teams/[teamId]/team-editor.tsx +1656 -8
- package/src/app/tickets/[ticket]/page.tsx +3 -0
- package/src/app/tickets/page.tsx +3 -0
- package/src/components/AppShell.tsx +245 -31
- package/src/lib/workflows/README.md +11 -0
- package/src/lib/workflows/runs-storage.ts +71 -0
- package/src/lib/workflows/runs-types.ts +32 -0
- package/src/lib/workflows/storage.ts +82 -0
- package/src/lib/workflows/types.ts +50 -0
- package/src/lib/workflows/validate.ts +70 -0
- package/.next/server/app/tickets.html +0 -1
- package/.next/server/app/tickets.meta +0 -15
- package/.next/server/app/tickets.rsc +0 -19
- package/.next/server/app/tickets.segments/_full.segment.rsc +0 -19
- package/.next/server/app/tickets.segments/_head.segment.rsc +0 -6
- package/.next/server/app/tickets.segments/_index.segment.rsc +0 -6
- package/.next/server/app/tickets.segments/_tree.segment.rsc +0 -4
- package/.next/server/app/tickets.segments/tickets/__PAGE__.segment.rsc +0 -8
- package/.next/server/app/tickets.segments/tickets.segment.rsc +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__15600e29._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__247198dc._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__2a6f1e3e._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__346f79e5._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__346f79e5._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__3575e6da._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__3ad3e5b1._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__3bc7ad0a._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__4393e897._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__46e08d44._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__507d2fc9._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__82ce3aee._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__8d24c9c3._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__a457c799._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__a457c799._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__bc3b27b0._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__f75a61bf._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__fd669584._.js +0 -3
- package/.next/server/chunks/ssr/_0808c2b9._.js.map +0 -1
- package/.next/server/chunks/ssr/_25e6aab8._.js.map +0 -1
- package/.next/server/chunks/ssr/_3158c108._.js.map +0 -1
- package/.next/server/chunks/ssr/_39e6e769._.js.map +0 -1
- package/.next/server/chunks/ssr/_3c8b2df6._.js.map +0 -1
- package/.next/server/chunks/ssr/_68793c1f._.js.map +0 -1
- package/.next/server/chunks/ssr/_6e70b5a4._.js.map +0 -1
- package/.next/server/chunks/ssr/_8c45edba._.js.map +0 -1
- package/.next/server/chunks/ssr/_8c8207c1._.js.map +0 -1
- package/.next/server/chunks/ssr/_92140ca3._.js.map +0 -1
- package/.next/server/chunks/ssr/_b5e9afcc._.js.map +0 -1
- package/.next/server/chunks/ssr/_cd23c5af._.js.map +0 -1
- package/.next/server/chunks/ssr/_d27483a1._.js +0 -4
- package/.next/server/chunks/ssr/_d27483a1._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_45780354.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_45780354.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js.map +0 -1
- package/.next/static/chunks/8484c54dc9a377e8.js +0 -10
- package/.next/static/chunks/8662fcc3cdff66f3.js +0 -1
- package/.next/static/chunks/a4e69b85b74277a7.css +0 -3
- package/.next/static/chunks/a9ed074e89b16a5e.js +0 -1
- /package/.next/server/chunks/ssr/{[root-of-the-server]__3bc7ad0a._.js.map → [root-of-the-server]__0d4cb2ba._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{[root-of-the-server]__e2e52c6e._.js.map → [root-of-the-server]__78cdd31e._.js.map} +0 -0
- /package/.next/static/{2hgbnJUmLMe9COlc5rJd3 → LkBl31uBDAuYl-0TzH69D}/_buildManifest.js +0 -0
- /package/.next/static/{2hgbnJUmLMe9COlc5rJd3 → LkBl31uBDAuYl-0TzH69D}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{2hgbnJUmLMe9COlc5rJd3 → LkBl31uBDAuYl-0TzH69D}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53525,e=>{"use strict";var t=e.i(43476),r=e.i(71645);e.i(22258);var a=e.i(94988),s=e.i(18566),i=e.i(74080);function o({open:e,teamId:r,onClose:a,onConfirm:s,busy:o}){return e?(0,i.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[200]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick: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-lg 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:"Delete Team"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Delete team ",(0,t.jsx)("code",{className:"font-mono",children:r}),"? This will remove the team workspace, agents, and stamped cron jobs."]}),(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick: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)] hover:bg-white/10",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:o,onClick:s,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:o?"Deleting…":"Delete"})]})]})})})]}),document.body):null}function l({open:e,teamId:r,recipeId:a,onClose:s,onConfirm:o,busy:l}){return e?(0,i.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[200]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:s}),(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-lg 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:"Publish changes"}),(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:r})," 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."]})]}),(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:s,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:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:l,onClick:o,className:"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:l?"Publishing…":"Publish changes"})]})]})})})]}),document.body):null}var n=e.i(76972);function c({teamId:e}){let[a,s]=(0,r.useState)(!0),[i,o]=(0,r.useState)(null),[l,n]=(0,r.useState)(null),c=(0,r.useCallback)(async()=>{s(!0);try{let t=await fetch(`/api/teams/orchestrator?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),r=await t.json();o(r),n(new Date().toISOString())}catch(e){o({ok:!1,error:e instanceof Error?e.message:String(e)}),n(new Date().toISOString())}finally{s(!1)}},[e]);return((0,r.useEffect)(()=>{c()},[c]),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:l?(0,t.jsxs)("span",{children:["Last updated: ",(0,t.jsx)("span",{className:"font-mono",children:l})]}):null}),(0,t.jsx)("button",{type:"button",onClick:()=>void c(),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.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.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:["Once an orchestrator agent is installed (e.g. ",(0,t.jsx)("code",{children:"<teamId>-swarm-orchestrator"}),"), this tab will show: tmux sessions, git worktrees/branches, and active task state."]})]}):(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."})}function d(e){let t=new Set;for(let r of e)t.add(r);return t.size}function m({teamId:e,initialTab:i}){let m,x,p,h,u,v,g,f,k,b,y,w,j,N,S,C=(0,s.useRouter)(),[I,$]=(0,r.useState)([]),[E,O]=(0,r.useState)(""),[A,R]=(0,r.useState)(null),[T,U]=(0,r.useState)(null),[_,J]=(0,r.useState)(!1),[P,D]=(0,r.useState)(e),[F,z]=(0,r.useState)(e),[q,L]=(0,r.useState)(""),[W,M]=(0,r.useState)(null),[B,H]=(0,r.useState)("recipe");(0,r.useEffect)(()=>{i&&["recipe","agents","skills","cron","workflows","files","orchestrator"].includes(i)&&H(i)},[i]);let[Y,G]=(0,r.useState)(!0),[K,X]=(0,r.useState)(!1),[Q,V]=(0,r.useState)(!1),[Z,ee]=(0,r.useState)(!1),[et,er]=(0,r.useState)(!1),[ea,es]=(0,r.useState)(""),ei=(0,n.useToast)(),[eo,el]=(0,r.useState)(!1),[en,ec]=(0,r.useState)(!1),[ed,em]=(0,r.useState)(null);function ex(e,t="info"){let r=String(e??"").trim();r&&ei.push({kind:t,message:r})}let[ep,eh]=(0,r.useState)([]),[eu,ev]=(0,r.useState)(!1),[eg,ef]=(0,r.useState)(""),[ek,eb]=(0,r.useState)(!1),[ey,ew]=(0,r.useState)("SOUL.md"),[ej,eN]=(0,r.useState)(""),[eS,eC]=(0,r.useState)([]),[eI,e$]=(0,r.useState)(!1),[eE,eO]=(0,r.useState)([]),[eA,eR]=(0,r.useState)(!1),[eT,eU]=(0,r.useState)(""),[e_,eJ]=(0,r.useState)(""),[eP,eD]=(0,r.useState)(""),[eF,ez]=(0,r.useState)(!1),[eq,eL]=(0,r.useState)("canvas"),[eW,eM]=(0,r.useState)(""),[eB,eH]=(0,r.useState)(null),[eY,eG]=(0,r.useState)(""),[eK,eX]=(0,r.useState)(""),[eQ,eV]=(0,r.useState)("llm"),[eZ,e0]=(0,r.useState)(""),[e1,e2]=(0,r.useState)(""),[e5,e3]=(0,r.useState)(""),[e4,e6]=(0,r.useState)(!1),[e8,e9]=(0,r.useState)(!1),[e7,te]=(0,r.useState)("new-workflow"),[tt,tr]=(0,r.useState)("New workflow"),[ta,ts]=(0,r.useState)([]),[ti,to]=(0,r.useState)(!1),[tl,tn]=(0,r.useState)(""),[tc,td]=(0,r.useState)(""),[tm,tx]=(0,r.useState)(null),[tp,th]=(0,r.useState)([]),[tu,tv]=(0,r.useState)(!1),tg=(0,r.useRef)(null),tf=(0,r.useRef)(null),tk=(0,r.useMemo)(()=>{let e=String(eP||"").trim();if(!e)return null;try{return JSON.parse(e)}catch{return null}},[eP]),tb=(0,r.useMemo)(()=>{let e=String(eP||"").trim();if(!e)return"";try{return JSON.parse(e),""}catch(e){return e instanceof Error?e.message:"Invalid JSON"}},[eP]),ty=(0,r.useMemo)(()=>{if(!tk)return{errors:[],warnings:[]};try{return function(e){let t=[],r=[];"clawkitchen.workflow.v1"!==e.schema&&t.push(`schema must be clawkitchen.workflow.v1 (got ${String(e.schema)})`),String(e.id||"").trim()||t.push("id is required"),String(e.name||"").trim()||t.push("name is required");let a=Array.isArray(e.nodes)?e.nodes:[],s=Array.isArray(e.edges)?e.edges:[],i=Array.isArray(e.triggers)?e.triggers:[],o=a.map(e=>String(e?.id??"").trim()).filter(Boolean);o.length!==a.length&&t.push("all nodes must have a non-empty id"),d(o)!==o.length&&t.push("node ids must be unique");let l=s.map(e=>String(e?.id??"").trim()).filter(Boolean);l.length!==s.length&&t.push("all edges must have a non-empty id"),d(l)!==l.length&&t.push("edge ids must be unique");let n=new Set(o);for(let e of s){let r=String(e?.from??"").trim(),a=String(e?.to??"").trim();if(!r||!a){t.push(`edge ${String(e?.id??"(missing id)")} must have from/to`);continue}n.has(r)||t.push(`edge ${String(e.id)} references missing from node: ${r}`),n.has(a)||t.push(`edge ${String(e.id)} references missing to node: ${a}`)}let c=a.filter(e=>"start"===e.type),m=a.filter(e=>"end"===e.type);for(let e of(c.length||r.push("no start node found"),c.length>1&&r.push("multiple start nodes found (MVP supports this, but execution semantics may be ambiguous)"),m.length||r.push("no end node found"),i))"cron"===e.kind&&((String(e.id||"").trim()||t.push("cron trigger missing id"),String(e.expr||"").trim())?5!==String(e.expr||"").trim().split(/\s+/).filter(Boolean).length&&r.push(`cron trigger ${String(e.id)} expr is not 5-field: ${String(e.expr)}`):t.push(`cron trigger ${String(e.id||"(missing id)")} missing expr`),e.tz&&!String(e.tz).includes("/")&&r.push(`cron trigger ${String(e.id)} tz doesn't look like an IANA timezone: ${String(e.tz)}`));return{errors:t,warnings:r}}(tk)}catch(e){return{errors:[e instanceof Error?e.message:String(e)],warnings:[]}}},[tk]);(0,r.useEffect)(()=>{let t=String(tk?.id??"").trim();if(!t){ts([]),td(""),tx(null),tn("");return}let r=!1;return(async()=>{to(!0),tn("");try{let a=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed to list runs");let i=(Array.isArray(s.files)?s.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);if(r)return;ts(i),tc&&!i.some(e=>e===`${tc}.run.json`)&&(td(""),tx(null))}catch(e){if(r)return;tn(e instanceof Error?e.message:String(e))}finally{r||to(!1)}})(),()=>{r=!0}},[e,tk?.id,tc]),(0,r.useEffect)(()=>{if(eB)return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)};function e(e){if(!eB||!tk)return;let t=tk.nodes.find(e=>e.id===eB.nodeId);if(!t)return;let r=Math.max(0,Math.round(e.clientX-eB.containerLeft-eB.dx)),a=Math.max(0,Math.round(e.clientY-eB.containerTop-eB.dy));eD(JSON.stringify({...tk,nodes:tk.nodes.map(e=>e.id===t.id?{...e,x:r,y:a}:e)},null,2)+"\n")}function t(){eH(null)}},[eB,tk]);let tw=(0,r.useMemo)(()=>{let e=String(q??"");if(!e.startsWith("---\n"))return[];let t=e.indexOf("\n---\n",4);if(-1===t)return[];let r=e.slice(4,t+1);try{let e=(0,a.parse)(r)??{};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[]}},[q]),[tj,tN]=(0,r.useState)(""),[tS,tC]=(0,r.useState)(""),[tI,t$]=(0,r.useState)(""),tE=(0,r.useMemo)(()=>{let e=("__custom__"===tj?tS:tj).trim();return e||""},[tj,tS]),[tO,tA]=(0,r.useState)([]),[tR,tT]=(0,r.useState)([]),[tU,t_]=(0,r.useState)(!1),[tJ,tP]=(0,r.useState)(""),[tD,tF]=(0,r.useState)(!1),[tz,tq]=(0,r.useState)(""),[tL,tW]=(0,r.useState)(""),tM=(0,r.useMemo)(()=>I.filter(e=>"team"===e.kind),[I]),tB=(0,r.useMemo)(()=>I.find(e=>e.id===P&&"workspace"===e.source)??I.find(e=>e.id===P)??null,[I,P]),tH=!!e.trim(),tY=!!P.trim(),tG=I.some(e=>e.id===P&&"workspace"===e.source),tK=!!(tB?.source==="builtin"&&!tG);async function tX(){let e=P.trim();if(e){er(!0),es("");try{let t=await fetch(`/api/recipes/${encodeURIComponent(e)}`,{cache:"no-store"}),r=await t.json();if(!t.ok)throw Error(r.error||`Recipe not found: ${e}. Save first to create it.`);let a=r.recipe;L(a.content),M("string"==typeof r.recipeHash?r.recipeHash:null)}catch(e){es(e instanceof Error?e.message:String(e))}finally{er(!1)}}}async function tQ(e){let t=E.trim(),r=String(e.toId??P).trim(),a=String(e.toName??F).trim(),s=!!e.overwrite,i=!!e.scaffold;if(!t)throw Error("Source recipe id is required");if(!r)throw Error("Custom recipe id is required");let o=await fetch("/api/recipes/clone",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({fromId:t,toId:r,toName:a||void 0,overwrite:s,scaffold:i})}),l=await o.json();if(!o.ok)throw Error(l.error||"Save failed");return l}async function tV(e,t){X(!0),ex("");try{let r=await tQ({overwrite:e,...t});if(r.scaffold&&!r.scaffold.ok&&ex(`Scaffold failed (recipe was still cloned): ${r.scaffold.error||"Unknown error"}`,"error"),q.trim()&&q.trim()!==r.content.trim()){let e=function(e,t){if(!e.startsWith("---\n"))return e;let r=e.indexOf("\n---\n",4);if(-1===r)return e;let a=e.slice(4,r),s=e.slice(r+5),i=a.split("\n"),o=[],l=!1,n=!1,c=!1;for(let e=0;e<i.length;e++){let r=i[e];if(/^team\s*:\s*$/i.test(r)){l=!0,n=!0,o.push(r);continue}if(l&&/^\S/.test(r)&&(l=!1),l&&/^\s+teamId\s*:/i.test(r)){o.push(` teamId: ${t}`),c=!0;continue}o.push(r)}if(n&&!c){let e=[];for(let r=0;r<o.length;r++)e.push(o[r]),/^team\s*:\s*$/i.test(o[r])&&(e.push(` teamId: ${t}`),c=!0);return`---
|
|
2
|
+
${e.join("\n")}
|
|
3
|
+
---
|
|
4
|
+
${s}`}return`---
|
|
5
|
+
${o.join("\n")}
|
|
6
|
+
---
|
|
7
|
+
${s}`}(function(e,t){if(!e.startsWith("---\n"))return e;let r=e.indexOf("\n---\n",4);if(-1===r)return e;let a=e.slice(4,r),s=e.slice(r+5),i=a.split("\n"),o=!1,l=i.map(e=>/^id\s*:/i.test(e)?(o=!0,`id: ${t}`):e);return o||l.unshift(`id: ${t}`),`---
|
|
8
|
+
${l.join("\n")}
|
|
9
|
+
---
|
|
10
|
+
${s}`}(q,P.trim()),P.trim()),t=await fetch(`/api/recipes/${encodeURIComponent(P.trim())}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:e})}),r=await t.json();if(!t.ok)throw Error(r.error||"Save failed");L(e)}else L(r.content);try{let e=await fetch(`/api/recipes/${encodeURIComponent(P.trim())}`,{cache:"no-store"}),t=await e.json();e.ok&&"string"==typeof t.recipeHash&&M(t.recipeHash)}catch{M(null)}ex(`Saved team recipe: ${r.filePath}`,"success")}catch(e){ex(e instanceof Error?e.message:String(e),"error")}finally{X(!1)}}async function tZ(t){X(!0),ef("");try{let r=await fetch(`/api/teams/file?teamId=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{cache:"no-store"}),a=await r.json();if(!r.ok||!a.ok)throw Error(a.error||"Failed to load file");ew(t),eN(String(a.content??""))}catch(e){ef(e instanceof Error?e.message:String(e))}finally{X(!1)}}async function t0(){X(!0),ef("");try{let t=await fetch("/api/teams/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,name:ey,content:ej})}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to save file")}catch(e){ef(e instanceof Error?e.message:String(e))}finally{X(!1)}}return((0,r.useEffect)(()=>{D(e),z(e),L(""),M(null),em(null),ec(!1),el(!1)},[e]),(0,r.useEffect)(()=>{(async()=>{G(!0);try{let[t,r]=await Promise.all([fetch("/api/recipes",{cache:"no-store"}),fetch(`/api/teams/meta?teamId=${encodeURIComponent(e)}`,{cache:"no-store"})]),a=(await t.json()).recipes??[];$(a);let s=null;try{let e=await r.json();if(r.ok&&e.ok&&e.meta&&e.meta.recipeId){let t=e.meta;s={recipeId:String(t.recipeId),recipeName:"string"==typeof t.recipeName?t.recipeName:void 0};let r="string"==typeof t.recipeHash?t.recipeHash:null;em(r)}else em(null)}catch{}if(s)R(s.recipeId),U(s.recipeName??null),J(!1),O(s.recipeId);else{R(null),U(null),J(!0);let t=a.find(t=>"team"===t.kind&&t.id===e),r=a.find(e=>"team"===e.kind),s=t??r;s&&O(s.id)}G(!1),(async()=>{ev(!0),e$(!0),eR(!0),tv(!0),t_(!0);try{let[t,r,a,s,i,o]=await Promise.all([fetch(`/api/teams/files?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),fetch(`/api/cron/jobs?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),fetch("/api/agents",{cache:"no-store"}),fetch(`/api/teams/skills?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),fetch("/api/skills/available",{cache:"no-store"}),fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}`,{cache:"no-store"})]);try{let e=await t.json();if(t.ok&&e.ok){let t=Array.isArray(e.files)?e.files:[];eh(t.map(e=>({name:String(e.name??""),missing:!!e.missing,required:!!e.required,rationale:"string"==typeof e.rationale?e.rationale:void 0})))}}catch{}try{let e=await r.json();if(r.ok&&e.ok){let t=Array.isArray(e.jobs)?e.jobs:[];eC(t)}}catch{}try{let e=await o.json();if(o.ok&&e.ok){let t=(Array.isArray(e.files)?e.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);eO(t),eJ(e=>{let r=String(e??"").trim();return r&&t.includes(r)?r:t[0]??""})}}catch{}try{let t=await a.json();if(a.ok){let r=(Array.isArray(t.agents)?t.agents:[]).filter(t=>String(t.id??"").startsWith(`${e}-`));th(r.map(e=>({id:String(e.id??""),identityName:"string"==typeof e.identityName?e.identityName:void 0})))}}catch{}try{let e=await s.json();s.ok&&e.ok&&tA(Array.isArray(e.skills)?e.skills:[])}catch{}try{let e=await i.json();if(i.ok&&e.ok){let t=Array.isArray(e.skills)?e.skills:[];tT(t),tP(e=>{let r=String(e??"").trim();return r&&t.includes(r)?r:t[0]??""})}}catch{}}finally{ev(!1),e$(!1),eR(!1),tv(!1),t_(!1)}})()}catch(e){ex(e instanceof Error?e.message:String(e),"error")}finally{G(!1)}})()},[e]),(0,r.useEffect)(()=>{!P.trim()||q.trim()||et||tX()},[P]),Y)?(0,t.jsx)("div",{className:"ck-glass w-full p-6",children:"Loading…"}):(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:[{id:"recipe",label:"Recipe"},{id:"agents",label:"Agents"},{id:"skills",label:"Skills"},{id:"cron",label:"Cron"},{id:"workflows",label:"Workflows"},{id:"files",label:"Files"},{id:"orchestrator",label:"Orchestrator"}].map(r=>(0,t.jsx)("button",{onClick:()=>{H(r.id);try{C.replace(`/teams/${encodeURIComponent(e)}?tab=${encodeURIComponent(r.id)}`,{scroll:!1})}catch{}},className:B===r.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:r.label},r.id))}),"recipe"===B?(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.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Custom recipe target"}),(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:P,onChange:e=>D(e.target.value),disabled:!1,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.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["This is the ",(0,t.jsx)("b",{children:"custom recipe id"})," that will be created/overwritten 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:F,onChange:e=>z(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-4 grid grid-cols-1 gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:K||!tH||!tY||tK,onClick:()=>tV(!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)] transition-colors hover:bg-[var(--ck-accent-red-hover)] active:bg-[var(--ck-accent-red-active)] disabled:opacity-50",children:K?"Saving…":"Save"}),(0,t.jsx)("button",{type:"button",disabled:K||!tH||!tY||tK||!W||!ed||W===ed,onClick:()=>ec(!0),className:"rounded-[var(--ck-radius-sm)] bg-emerald-600 px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] transition-colors hover:bg-emerald-500 active:bg-emerald-700 disabled:opacity-50",children:Q?"Publishing…":"Publish changes"}),(0,t.jsx)("button",{type:"button",disabled:K,onClick:()=>el(!0),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:"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,onChange:e=>O(e.target.value),children:tM.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.id," (",e.source,")"]},`${e.source}:${e.id}`))}),A?(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("code",{children:A}),T?` (${T})`:""]}):_?(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Provenance not found for this team. The parent recipe above is a best-guess."}):null]}),(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.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Save"})," writes/overwrites the custom recipe file identified by “Team id”."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Publish changes"})," re-scaffolds this team from your current custom recipe and applies config (complete overwrite)."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Delete Team"})," runs the safe uninstall command (",(0,t.jsx)("code",{children:"openclaw recipes remove-team"}),")."]})]})]})]}):null,"agents"===B?(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:P}),")."]}),(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:tj,onChange:e=>{let t=e.target.value;if(tN(t),"__custom__"===t){tC(""),t$("");return}tC("");let r=tw.find(e=>e.role===t);t$(r?.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…"}),tw.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__"===tj?(0,t.jsx)("input",{value:tS,onChange:e=>tC(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:tI,onChange:e=>t$(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:K||!tE,onClick:async()=>{X(!0);try{try{await tQ({overwrite:!1})}catch(t){let e=t instanceof Error?t.message:String(t);if(!/Recipe id already exists:/i.test(e))throw t}let a=await fetch("/api/recipes/team-agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify("__custom__"===tj?{recipeId:P.trim(),op:"add",role:tE,name:tI}:{recipeId:P.trim(),op:"addLike",baseRole:tE,teamId:e,name:tI})}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed updating agents list");L(String(s.content??q));try{let t=await fetch("/api/scaffold",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"team",recipeId:P.trim(),teamId:e,applyConfig:!0,overwrite:!1,allowExisting:!0,cronInstallChoice:"no"})}),r=await t.json();if(!t.ok)throw Error(r.error||"Failed to apply config / scaffold team")}catch(e){ex(e instanceof Error?e.message:String(e),"error")}let i="string"==typeof s.addedAgentId?s.addedAgentId:"";async function t(){let t=await fetch("/api/agents",{cache:"no-store"}),r=await t.json();if(!t.ok)return{ok:!1,hasExpected:!1,agents:[]};let a=(Array.isArray(r.agents)?r.agents:[]).filter(t=>String(t.id??"").startsWith(`${e}-`)).map(e=>({id:String(e.id??""),identityName:"string"==typeof e.identityName?e.identityName:void 0})),s=!!i&&a.some(e=>e.id===i);return{ok:!0,hasExpected:s,agents:a}}async function r(e){let r=Date.now();for(;Date.now()-r<e;){try{let e=await t();if(e.ok&&(th(e.agents),!i||e.hasExpected))return!0}catch{}await new Promise(e=>setTimeout(e,500))}return!1}if(!await r(5e3)&&i){try{fetch("/api/gateway/restart",{method:"POST"})}catch{}await r(1e4)}ex(`Updated agents list in ${P}`,"success")}catch(e){ex(e instanceof Error?e.message:String(e),"error")}finally{X(!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:"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.jsx)("ul",{className:"mt-2 space-y-2",children:tp.length?tp.map(r=>(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:r.identityName||r.id}),(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:r.id})]}),(0,t.jsx)("a",{className:"text-sm font-medium text-[color:var(--ck-accent-red)] hover:text-[color:var(--ck-accent-red-hover)]",href:`/agents/${encodeURIComponent(r.id)}?returnTo=${encodeURIComponent(`/teams/${e}?tab=agents`)}`,children:"Edit"})]},r.id)):tu?(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No team agents detected."})})]})]}):null,"skills"===B?(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.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Skills installed in this ",(0,t.jsx)("strong",{children:"team"})," workspace (",(0,t.jsx)("code",{children:"skills/"}),"). These are available to all agents in the team. 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:tO.length?tO.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:tJ,onChange:e=>tP(e.target.value),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)]",disabled:tD||tU||!tR.length,children:tR.length?tR.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:tD||tU||!tJ,onClick:async()=>{tF(!0),tq(""),tW("");try{let t=await fetch("/api/teams/skills/install",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,skill:tJ})}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to install skill");tq(`Installed skill: ${tJ}`);let a=await fetch(`/api/teams/skills?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await a.json();a.ok&&s.ok&&tA(Array.isArray(s.skills)?s.skills:[])}catch(e){tW(e instanceof Error?e.message:String(e))}finally{tF(!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:tD?"Adding…":"Add"})]}),tL?(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:tL}):null,tz?(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:tz}):null,(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["This uses ",(0,t.jsxs)("code",{children:["openclaw recipes install-skill <skill> --team-id ",e," --yes"]}),"."]})]})]}):null,"cron"===B?(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.jsx)("ul",{className:"mt-3 space-y-3",children:eS.length?eS.map(e=>{let r=String(e.id??e.jobId??"").trim(),a=r||String(e.name??"job"),s=String(e.name??e.id??e.jobId??"(unnamed)"),i=e.enabled??e.state?.enabled;async function o(e){X(!0);try{let t=await fetch("/api/cron/job",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:r,action:e})}),a=await t.json();if(!t.ok||!a.ok)throw Error(a.error||"Cron action failed");ex(`Cron ${e}: ${s}`,"success")}catch(e){ex(e instanceof Error?e.message:String(e),"error")}finally{X(!1)}}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:s}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Enabled: ",String(i??"?")]}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,t.jsx)("button",{disabled:K||!r,onClick:()=>o("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:K||!r,onClick:()=>o("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:K||!r,onClick:()=>o("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"}),r?null:(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"(missing id)"})]})]},a)}):eI?(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No cron jobs detected for this team."})})]}):null,"workflows"===B?(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsxs)("div",{className:e4?"ck-glass-strong p-4":"ck-glass-strong p-4 lg:col-span-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Workflows (file-first)"}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["Stored in ",(0,t.jsx)("code",{children:"shared-context/workflows/<id>.workflow.json"})," inside the team workspace."]}),eT?(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:eT}):null,(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,t.jsx)("button",{disabled:eF,onClick:()=>{te("new-workflow"),tr("New workflow"),e9(!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:"Add workflow"}),0===eE.length?(0,t.jsx)("button",{disabled:eF,onClick:async()=>{ez(!0),eU("");try{let t={schema:"clawkitchen.workflow.v1",id:"marketing-cadence",name:"Marketing Cadence (v1)",version:1,timezone:"America/New_York",triggers:[{kind:"cron",id:"content-cadence",name:"Content cadence",enabled:!0,expr:"0 9 * * 1,3,5",tz:"America/New_York"},{kind:"cron",id:"seasonal-scan",name:"Seasonal scan",enabled:!0,expr:"0 8 * * *",tz:"America/New_York"},{kind:"cron",id:"weekly-recap",name:"Weekly recap",enabled:!1,expr:"30 9 * * 1",tz:"America/New_York"}],nodes:[{id:"start",type:"start",name:"Start",x:80,y:80},{id:"research",type:"llm",name:"Research",x:320,y:80},{id:"draft_assets",type:"llm",name:"Draft assets",x:560,y:80},{id:"qc_brand",type:"llm",name:"QC brand",x:800,y:80},{id:"approval",type:"human_approval",name:"Approval",x:1040,y:80},{id:"post_x",type:"tool",name:"Post: X",x:1040,y:240},{id:"post_instagram",type:"tool",name:"Post: Instagram",x:1040,y:360},{id:"post_tiktok",type:"tool",name:"Post: TikTok",x:1040,y:480},{id:"post_youtube",type:"tool",name:"Post: YouTube",x:1040,y:600},{id:"writeback",type:"tool",name:"Writeback",x:800,y:600},{id:"end",type:"end",name:"End",x:560,y:600}],edges:[{id:"e1",from:"start",to:"research"},{id:"e2",from:"research",to:"draft_assets"},{id:"e3",from:"draft_assets",to:"qc_brand"},{id:"e4",from:"qc_brand",to:"approval"},{id:"e5",from:"approval",to:"post_x",label:"approve"},{id:"e6",from:"post_x",to:"post_instagram"},{id:"e7",from:"post_instagram",to:"post_tiktok"},{id:"e8",from:"post_tiktok",to:"post_youtube"},{id:"e9",from:"post_youtube",to:"writeback"},{id:"e10",from:"writeback",to:"end"}],meta:{templateId:"marketing-cadence-v1",approvalGateRequired:!0}},r=await fetch("/api/teams/workflows",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflow:t})}),a=await r.json();if(!r.ok||!a.ok)throw Error(a.error||"Failed to write workflow");let s=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),i=await s.json();if(s.ok&&i.ok){let e=(Array.isArray(i.files)?i.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);eO(e),eJ("marketing-cadence.workflow.json"),eD(JSON.stringify(t,null,2)+"\n"),e6(!0)}ex("Created workflow template: marketing-cadence","success")}catch(e){eU(e instanceof Error?e.message:String(e))}finally{ez(!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:eF?"Working…":"Create Marketing Cadence template"}):null,(0,t.jsx)("button",{disabled:eF,onClick:async()=>{ez(!0),eU("");try{let t=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to list workflows");let a=(Array.isArray(r.files)?r.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);eO(a),ex("Refreshed workflow list","success")}catch(e){eU(e instanceof Error?e.message:String(e))}finally{ez(!1)}},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)] hover:bg-white/10 disabled:opacity-50",children:"Refresh"})]}),e8?(0,t.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/70 p-4",children:(0,t.jsxs)("div",{className:"ck-glass-strong w-full max-w-lg rounded-[var(--ck-radius-lg)] border border-white/10 p-4 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Create workflow"}),(0,t.jsx)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:"Creates a new file under shared-context/workflows/ for this team."}),(0,t.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-3",children:[(0,t.jsxs)("label",{className:"grid gap-1",children:[(0,t.jsx)("span",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"Workflow id"}),(0,t.jsx)("input",{value:e7,onChange:e=>te(e.target.value),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",placeholder:"e.g. marketing-cadence"}),(0,t.jsx)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"lowercase letters, numbers, dashes"})]}),(0,t.jsxs)("label",{className:"grid gap-1",children:[(0,t.jsx)("span",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"Name"}),(0,t.jsx)("input",{value:tt,onChange:e=>tr(e.target.value),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",placeholder:"New workflow"})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>e9(!1),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:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e=String(e7||"").trim();if(!e)return void ex("Workflow id is required","error");let t={schema:"clawkitchen.workflow.v1",id:e,name:String(tt||e),version:1,timezone:"America/New_York",triggers:[],nodes:[{id:"start",type:"start",name:"Start",x:120,y:120},{id:"end",type:"end",name:"End",x:420,y:120}],edges:[{id:"e1",from:"start",to:"end"}],meta:{}};eJ(`${e}.workflow.json`),eD(JSON.stringify(t,null,2)+"\n"),e9(!1),e6(!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)]",children:"Create"})]})]})}):null,(0,t.jsx)("div",{className:"mt-4 text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Files"}),(0,t.jsxs)("ul",{className:"mt-2 space-y-1",children:[eA?(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,eE.length?eE.map(r=>{let a=e_===r;return(0,t.jsxs)("li",{className:"flex items-center justify-between gap-3 rounded-[var(--ck-radius-sm)] px-2 py-1 hover:bg-white/5",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>eJ(r),className:"flex min-w-0 items-center gap-2 text-left",children:[(0,t.jsx)("span",{className:a?"text-green-400":"text-white/25",children:a?"✓":"•"}),(0,t.jsx)("span",{className:a?"truncate text-base font-medium text-[color:var(--ck-text-primary)]":"truncate text-base text-[color:var(--ck-text-secondary)]",children:r})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:eF,onClick:async()=>{eJ(r),ez(!0),eU("");try{let t=String(r).replace(/\.workflow\.json$/i,""),a=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`,{cache:"no-store"}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed to load workflow");eD(JSON.stringify(s.workflow,null,2)+"\n"),e6(!0)}catch(e){eU(e instanceof Error?e.message:String(e))}finally{ez(!1)}},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)] hover:bg-white/10 disabled:opacity-50",children:"Edit"}),(0,t.jsx)("button",{type:"button",disabled:eF,onClick:async()=>{if(confirm(`Delete workflow ${r}?`)){ez(!0),eU("");try{let t=String(r).replace(/\.workflow\.json$/i,""),a=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`,{method:"DELETE"}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed to delete workflow");let i=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),o=await i.json();if(i.ok&&o.ok){let e=(Array.isArray(o.files)?o.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);eO(e)}e_===r&&(eJ(""),eD("")),ex(`Deleted workflow: ${r}`,"success")}catch(e){eU(e instanceof Error?e.message:String(e))}finally{ez(!1)}}},className:"rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 px-3 py-2 text-sm font-medium text-red-100 shadow-[var(--ck-shadow-1)] hover:bg-red-500/20 disabled:opacity-50",children:"Delete"})]})]},r)}):eA?null:(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"No workflows yet."})]})]}),e4?(0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-black/70",children:(0,t.jsxs)("div",{className:"ck-glass-strong h-full w-full overflow-hidden border border-white/10 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 bg-black/20 p-3",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:["Workflow editor",e_?` — ${e_}`:""]}),(0,t.jsx)("button",{type:"button",onClick:()=>e6(!1),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Close"})]}),(0,t.jsx)("div",{className:"h-[calc(100%-3rem)] overflow-auto p-4",children:(0,t.jsxs)("div",{className:"ck-glass-strong p-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Workflow editor"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex overflow-hidden rounded-[var(--ck-radius-sm)] border border-white/10",children:[(0,t.jsx)("button",{type:"button",onClick:()=>eL("canvas"),className:"canvas"===eq?"bg-white/10 px-3 py-2 text-xs font-medium text-[color:var(--ck-text-primary)]":"bg-transparent px-3 py-2 text-xs font-medium text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:"Canvas"}),(0,t.jsx)("button",{type:"button",onClick:()=>eL("json"),className:"json"===eq?"bg-white/10 px-3 py-2 text-xs font-medium text-[color:var(--ck-text-primary)]":"bg-transparent px-3 py-2 text-xs font-medium text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:"JSON"})]}),(0,t.jsx)("input",{ref:tf,type:"file",accept:"application/json,.json",className:"hidden",onChange:async e=>{let t=e.target.files?.[0];if(e.target.value="",t){eU("");try{let e=await t.text(),r=JSON.parse(e);eD(JSON.stringify(r,null,2)+"\n"),eJ(""),ex(`Imported workflow JSON: ${r.id||t.name}`,"success")}catch(e){eU(e instanceof Error?e.message:String(e))}}}}),(0,t.jsx)("button",{type:"button",disabled:eF,onClick:()=>tf.current?.click(),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)] hover:bg-white/10 disabled:opacity-50",children:"Import"}),(0,t.jsx)("button",{type:"button",disabled:eF||!tk||!!tb||ty.errors.length>0,onClick:()=>{eU("");try{if(!tk)throw Error("No workflow loaded");if(tb)throw Error(`Invalid JSON: ${tb}`);if(ty.errors.length)throw Error("Fix workflow validation errors before exporting");let e=`${tk.id||"workflow"}.workflow.json`,t=new Blob([JSON.stringify(tk,null,2)+"\n"],{type:"application/json"}),r=URL.createObjectURL(t),a=document.createElement("a");a.href=r,a.download=e,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(r),ex(`Exported: ${e}`,"success")}catch(e){eU(e instanceof Error?e.message:String(e))}},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)] hover:bg-white/10 disabled:opacity-50",children:"Export"}),(0,t.jsx)("button",{disabled:eF||!tk||!!tb||ty.errors.length>0,onClick:async()=>{ez(!0),eU("");try{if(!tk)throw Error("No workflow loaded");if(tb)throw Error(`Invalid JSON: ${tb}`);if(ty.errors.length)throw Error("Fix workflow validation errors before saving");let t=await fetch("/api/teams/workflows",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflow:tk})}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to save workflow");ex(`Saved workflow: ${tk.id}`,"success");let a=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),s=await a.json();if(a.ok&&s.ok){let e=(Array.isArray(s.files)?s.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);eO(e),eJ(`${tk.id}.workflow.json`)}}catch(e){eU(e instanceof Error?e.message:String(e))}finally{ez(!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:eF?"Saving…":"Save"})]})]}),tb?(0,t.jsxs)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-yellow-400/30 bg-yellow-500/10 p-3 text-sm text-yellow-100",children:["JSON parse error: ",tb]}):null,!tb&&ty.errors.length?(0,t.jsxs)("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:[(0,t.jsx)("div",{className:"font-medium",children:"Workflow validation errors"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5",children:ty.errors.map(e=>(0,t.jsx)("li",{children:e},e))})]}):null,tb||ty.errors.length||!ty.warnings.length?null:(0,t.jsxs)("div",{className:"mt-3 rounded-[var(--ck-radius-sm)] border border-yellow-400/30 bg-yellow-500/10 p-3 text-sm text-yellow-100",children:[(0,t.jsx)("div",{className:"font-medium",children:"Workflow validation warnings"}),(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5",children:ty.warnings.map(e=>(0,t.jsx)("li",{children:e},e))})]}),"canvas"===eq?(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-3 lg:grid-cols-4",children:[(0,t.jsxs)("div",{className:"lg:col-span-3",children:[(0,t.jsx)("div",{ref:tg,className:"relative h-[calc(100vh-20rem)] min-h-[55vh] w-full overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20",children:(0,t.jsxs)("div",{className:"relative h-[900px] w-[1400px]",children:[(0,t.jsx)("svg",{className:"absolute inset-0",width:1400,height:900,children:(tk?.edges??[]).map(e=>{if(!tk)return null;let r=tk.nodes.find(t=>t.id===e.from),a=tk.nodes.find(t=>t.id===e.to);if(!r||!a)return null;let s=("number"==typeof r.x?r.x:80)+90,i=("number"==typeof r.y?r.y:80)+24,o=("number"==typeof a.x?a.x:80)+90,l=("number"==typeof a.y?a.y:80)+24;return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:s,y1:i,x2:o,y2:l,stroke:"rgba(255,255,255,0.18)",strokeWidth:2}),e.label?(0,t.jsx)("text",{x:(s+o)/2,y:(i+l)/2-6,fill:"rgba(255,255,255,0.55)",fontSize:10,textAnchor:"middle",children:e.label}):null]},e.id)})}),(tk?.nodes??[]).map((e,r)=>{let a="number"==typeof e.x?e.x:80+220*r,s="number"==typeof e.y?e.y:80,i=eW===e.id;return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>eM(e.id),onPointerDown:t=>{if(0!==t.button)return;let r=tg.current;if(!r)return;let i=r.getBoundingClientRect(),o=t.clientX-i.left-a,l=t.clientY-i.top-s;eM(e.id),eH({nodeId:e.id,dx:o,dy:l,containerLeft:i.left,containerTop:i.top})},className:i?"absolute cursor-grab rounded-[var(--ck-radius-sm)] border border-white/25 bg-white/10 px-3 py-2 text-xs text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)]":"absolute cursor-grab rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-3 py-2 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",style:{left:a,top:s,width:180},children:[(0,t.jsx)("div",{className:"font-medium text-[color:var(--ck-text-primary)]",children:e.name||e.id}),(0,t.jsx)("div",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:e.type})]},e.id)})]})}),(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Tip: click a node to inspect it; drag to reposition. Positions are stored in the workflow JSON (file-first)."})]}),(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 lg:col-span-1",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Workflow"}),tk?(m=String(tk.timezone??"").trim()||"UTC",x=tk.triggers??[],h=String((p=tk.meta&&"object"==typeof tk.meta&&!Array.isArray(tk.meta)?tk.meta:{}).approvalProvider??"telegram").trim()||"telegram",u=String(p.approvalTarget??"").trim(),v=[{label:"(no preset)",expr:""},{label:"Mon/Wed/Fri 09:00 local",expr:"0 9 * * 1,3,5"},{label:"Daily 08:00 local",expr:"0 8 * * *"},{label:"Mon 09:30 local",expr:"30 9 * * 1"}],(0,t.jsxs)("div",{className:"mt-2 space-y-4",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:"timezone"}),(0,t.jsx)("input",{value:m,onChange:e=>{let t=String(e.target.value||"").trim()||"UTC";eD(JSON.stringify({...tk,timezone:t},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"America/New_York"})]}),(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"approval channel (mvp)"}),(0,t.jsxs)("div",{className:"mt-2 space-y-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:"provider"}),(0,t.jsx)("input",{value:h,onChange:e=>{let t=String(e.target.value||"").trim()||"telegram",r={...p,approvalProvider:t};eD(JSON.stringify({...tk,meta:r},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"telegram"})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"target"}),(0,t.jsx)("input",{value:u,onChange:e=>{let t=String(e.target.value||"").trim(),r={...p,approvalTarget:t};eD(JSON.stringify({...tk,meta:r},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"(e.g. Telegram chat id)"}),(0,t.jsx)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:"If set, sample runs that reach a human-approval node will send an approval packet via the gateway message tool."})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"triggers"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e=`t${Date.now()}`;eD(JSON.stringify({...tk,triggers:[...x,{kind:"cron",id:e,name:"New trigger",enabled:!0,expr:"0 9 * * 1-5",tz:m}]},null,2)+"\n")},className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"+ Add"})]}),(0,t.jsx)("div",{className:"mt-2 space-y-2",children:x.length?x.map((e,r)=>{let a=e.kind,s=String(e.id??""),i=String(e.name??""),o=!!e.enabled,l=String(e.expr??""),n=String(e.tz??m),c=l.trim().split(/\s+/).filter(Boolean),d=!l.trim()||5===c.length;return(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-primary)]",children:i||s||`trigger-${r+1}`}),(0,t.jsx)("button",{type:"button",onClick:()=>{eD(JSON.stringify({...tk,triggers:x.filter((e,t)=>t!==r)},null,2)+"\n")},className:"text-[10px] text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]",children:"Remove"})]}),"cron"===a?null:(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:["Unsupported trigger kind: ",String(a)]}),(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-1 gap-2",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:o,onChange:e=>{let t=e.target.checked;eD(JSON.stringify({...tk,triggers:x.map((e,a)=>a===r&&"cron"===e.kind?{...e,enabled:t}:e)},null,2)+"\n")}}),"Enabled"]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"name"}),(0,t.jsx)("input",{value:i,onChange:e=>{let t=e.target.value;eD(JSON.stringify({...tk,triggers:x.map((e,a)=>a===r&&"cron"===e.kind?{...e,name:t}:e)},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"Content cadence"})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"schedule (cron)"}),(0,t.jsx)("input",{value:l,onChange:e=>{let t=e.target.value;eD(JSON.stringify({...tk,triggers:x.map((e,a)=>a===r&&"cron"===e.kind?{...e,expr:t}:e)},null,2)+"\n")},className:d?"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 font-mono text-[11px] text-[color:var(--ck-text-primary)]":"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-red-400/50 bg-black/25 px-2 py-1 font-mono text-[11px] text-[color:var(--ck-text-primary)]",placeholder:"0 9 * * 1,3,5"}),d?null:(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-red-200",children:["Cron should be 5 fields (min hour dom month dow). You entered ",c.length,"."]}),(0,t.jsxs)("div",{className:"mt-1 grid grid-cols-1 gap-1",children:[(0,t.jsx)("select",{value:v.some(e=>e.expr===l)?l:"",onChange:e=>{let t=e.target.value;t&&eD(JSON.stringify({...tk,triggers:x.map((e,a)=>a===r&&"cron"===e.kind?{...e,expr:t}:e)},null,2)+"\n")},className:"w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-[11px] text-[color:var(--ck-text-secondary)]",children:v.map(e=>(0,t.jsx)("option",{value:e.expr,children:e.label},e.label))}),(0,t.jsx)("div",{className:"text-[10px] text-[color:var(--ck-text-tertiary)]",children:"Presets set the cron; edit freely for advanced schedules."})]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"timezone override"}),(0,t.jsx)("input",{value:n,onChange:e=>{let t=String(e.target.value||"").trim()||m;eD(JSON.stringify({...tk,triggers:x.map((e,a)=>a===r&&"cron"===e.kind?{...e,tz:t}:e)},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:m})]})]})]},`${s}-${r}`)}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"No triggers yet."})})]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Runs (history)"}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("button",{type:"button",disabled:eF,onClick:async()=>{let t=String(tk.id??"").trim();if(t){tn("");try{let r=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,mode:"sample"})}),a=await r.json();if(!r.ok||!a.ok)throw Error(a.error||"Failed to create sample run");let s=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"}),i=await s.json();if(!s.ok||!i.ok)throw Error(i.error||"Failed to refresh runs");let o=(Array.isArray(i.files)?i.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);ts(o),ex("Created sample run","success")}catch(e){tn(e instanceof Error?e.message:String(e))}}},className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"+ Sample run"})})]}),tl?(0,t.jsx)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 p-2 text-xs text-red-100",children:tl}):null,(0,t.jsx)("div",{className:"mt-2 space-y-1",children:ti?(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"Loading runs…"}):ta.length?ta.slice(0,8).map(r=>{let a=String(r).replace(/\.run\.json$/i,""),s=tc===a;return(0,t.jsx)("button",{type:"button",onClick:async()=>{let t=String(tk.id??"").trim();if(t){td(a),tx(null),tn("");try{let r=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}&runId=${encodeURIComponent(a)}`,{cache:"no-store"}),s=await r.json();if(!r.ok||!s.ok)throw Error(s.error||"Failed to load run");tx(s.run)}catch(e){tn(e instanceof Error?e.message:String(e))}}},className:s?"w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-primary)]":"w-full rounded-[var(--ck-radius-sm)] px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:a},r)}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"No runs yet."})}),tm?(k=Array.isArray(f=(g=tm&&"object"==typeof tm?tm:{}).nodes)?f:[],(0,t.jsxs)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-[11px] font-medium text-[color:var(--ck-text-primary)]",children:"Run detail"}),(0,t.jsxs)("div",{className:"text-[10px] text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:String(g?.status??"")}),g?.startedAt?(0,t.jsxs)("span",{children:[" · ",String(g.startedAt)]}):null]})]}),g?.summary?(0,t.jsx)("div",{className:"mt-1 text-[11px] text-[color:var(--ck-text-secondary)]",children:String(g.summary)}):null,(b=String(g?.status??""),j=String((w=(y=g.approval)&&"object"==typeof y?y:{}).state??""),N=String(w.nodeId??""),"waiting_for_approval"===b&&"pending"===j&&N?(0,t.jsxs)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-amber-300/30 bg-amber-500/10 p-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-amber-100",children:"approval required"}),(0,t.jsxs)("div",{className:"mt-1 text-[11px] text-amber-50",children:["Waiting on ",(0,t.jsx)("span",{className:"font-mono",children:N})]}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:async()=>{let t=String(tk.id??"").trim(),r=String(g.id??"").trim();if(t&&r){tn("");try{let a=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,runId:r,action:"approve"})}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed to approve");let i=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}&runId=${encodeURIComponent(r)}`,{cache:"no-store"}),o=await i.json();if(!i.ok||!o.ok)throw Error(o.error||"Failed to reload run");tx(o.run),ex("Approved","success")}catch(e){tn(e instanceof Error?e.message:String(e))}}},className:"rounded-[var(--ck-radius-sm)] border border-emerald-300/30 bg-emerald-500/10 px-2 py-1 text-[10px] font-medium text-emerald-50 hover:bg-emerald-500/20",children:"Approve & continue"}),(0,t.jsx)("button",{type:"button",onClick:async()=>{let t=String(tk.id??"").trim(),r=String(g.id??"").trim();if(t&&r){tn("");try{let a=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,runId:r,action:"request_changes"})}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed to request changes");let i=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}&runId=${encodeURIComponent(r)}`,{cache:"no-store"}),o=await i.json();if(!i.ok||!o.ok)throw Error(o.error||"Failed to reload run");tx(o.run),ex("Requested changes","success")}catch(e){tn(e instanceof Error?e.message:String(e))}}},className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Request changes"}),(0,t.jsx)("button",{type:"button",onClick:async()=>{let t=String(tk.id??"").trim(),r=String(g.id??"").trim();if(t&&r){tn("");try{let a=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,runId:r,action:"cancel"})}),s=await a.json();if(!a.ok||!s.ok)throw Error(s.error||"Failed to cancel");let i=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}&runId=${encodeURIComponent(r)}`,{cache:"no-store"}),o=await i.json();if(!i.ok||!o.ok)throw Error(o.error||"Failed to reload run");tx(o.run),ex("Canceled","success")}catch(e){tn(e instanceof Error?e.message:String(e))}}},className:"rounded-[var(--ck-radius-sm)] border border-red-400/30 bg-red-500/10 px-2 py-1 text-[10px] font-medium text-red-50 hover:bg-red-500/20",children:"Cancel"})]}),(0,t.jsx)("div",{className:"mt-2 text-[10px] text-amber-100/80",children:"Note: this is currently an in-app approval stub; channel delivery/resume wiring still TBD."})]}):null),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"per-node results"}),k.length?(0,t.jsx)("div",{className:"mt-1 space-y-1",children:k.slice(0,50).map((e,r)=>{let a=e&&"object"==typeof e?e:{},s=String(a.status??""),i="success"===s?"text-emerald-200":"error"===s?"text-red-200":"running"===s||"waiting"===s?"text-amber-200":"text-[color:var(--ck-text-secondary)]",o=String(a.nodeId??""),l=a.error,n=a.output;return(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 p-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-[11px] text-[color:var(--ck-text-primary)]",children:(0,t.jsx)("span",{className:"font-mono",children:o})}),(0,t.jsx)("div",{className:`text-[10px] font-medium ${i}`,children:s})]}),l?(0,t.jsx)("div",{className:"mt-1 text-[10px] text-red-100",children:"string"==typeof l?l:"object"==typeof l&&l&&"message"in l?String(l.message??""):String(l)}):null,void 0!==n?(0,t.jsx)("pre",{className:"mt-1 max-h-[120px] overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(n,null,2)}):null]},`${o||"node"}-${r}`)})}):(0,t.jsx)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:"No node results recorded on this run yet."})]}),(0,t.jsxs)("details",{className:"mt-2",children:[(0,t.jsx)("summary",{className:"cursor-pointer select-none text-[10px] text-[color:var(--ck-text-tertiary)]",children:"raw JSON"}),(0,t.jsx)("pre",{className:"mt-2 max-h-[220px] overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(tm,null,2)})]})]})):null]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Nodes"}),(0,t.jsx)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-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:"id"}),(0,t.jsx)("input",{value:eY,onChange:e=>eG(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"e.g. draft_assets"}),(0,t.jsx)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:"Tip: ids are file-first + portable; use lowercase letters, numbers, and underscores."})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"name (optional)"}),(0,t.jsx)("input",{value:eK,onChange:e=>eX(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"Human-friendly label"})]}),(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.jsxs)("select",{value:eQ,onChange:e=>eV(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"start",children:"start"}),(0,t.jsx)("option",{value:"end",children:"end"}),(0,t.jsx)("option",{value:"llm",children:"llm"}),(0,t.jsx)("option",{value:"tool",children:"tool"}),(0,t.jsx)("option",{value:"condition",children:"condition"}),(0,t.jsx)("option",{value:"delay",children:"delay"}),(0,t.jsx)("option",{value:"human_approval",children:"human_approval"})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e=String(eY||"").trim().replace(/[^a-z0-9_\-]/gi,"_");if(!e)return void ex("Node id is required","error");if(tk.nodes.some(t=>t.id===e))return void ex(`Node id already exists: ${e}`,"error");let t=tk.nodes.reduce((e,t)=>"number"==typeof t.x?Math.max(e,t.x):e,80),r={id:e,type:eQ,name:String(eK||"").trim()||e,x:t+220,y:80};eD(JSON.stringify({...tk,nodes:[...tk.nodes,r]},null,2)+"\n"),eM(e),eG(""),eX("")},className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"+ Add node"})]})}),(0,t.jsx)("div",{className:"mt-2 space-y-1",children:tk.nodes.map(e=>{let r=eW===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>eM(e.id),className:r?"w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-primary)]":"w-full rounded-[var(--ck-radius-sm)] px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:[(0,t.jsx)("span",{className:"font-mono",children:e.id}),(0,t.jsx)("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:e.type})]},e.id)})})]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Edges"}),(0,t.jsx)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-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:"from"}),(0,t.jsxs)("select",{value:eZ,onChange:e=>e0(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"(select)"}),tk.nodes.map(e=>(0,t.jsx)("option",{value:e.id,children:e.id},e.id))]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"to"}),(0,t.jsxs)("select",{value:e1,onChange:e=>e2(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"(select)"}),tk.nodes.map(e=>(0,t.jsx)("option",{value:e.id,children:e.id},e.id))]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"label (optional)"}),(0,t.jsx)("input",{value:e5,onChange:e=>e3(e.target.value),className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"e.g. approve"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e=String(eZ||"").trim(),t=String(e1||"").trim();if(!e||!t)return void ex("Edge requires from + to","error");if(e===t)return void ex("Edge from/to must be different","error");let r={id:`e${Date.now()}`,from:e,to:t,...String(e5||"").trim()?{label:String(e5).trim()}:{}};eD(JSON.stringify({...tk,edges:[...tk.edges??[],r]},null,2)+"\n"),e3("")},className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"+ Add edge"})]})}),(0,t.jsx)("div",{className:"mt-2 space-y-2",children:(tk.edges??[]).length?(tk.edges??[]).map(e=>(0,t.jsx)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-[11px] text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.from})," → ",(0,t.jsx)("span",{className:"font-mono",children:e.to}),e.label?(0,t.jsxs)("span",{className:"ml-2 text-[10px] text-[color:var(--ck-text-tertiary)]",children:["(",e.label,")"]}):null]}),(0,t.jsx)("button",{type:"button",onClick:()=>{eD(JSON.stringify({...tk,edges:(tk.edges??[]).filter(t=>t.id!==e.id)},null,2)+"\n")},className:"text-[10px] text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]",children:"Remove"})]})},e.id)):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"No edges yet."})})]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Node inspector"}),eW?(0,t.jsx)("button",{type:"button",onClick:()=>{let e=tk.nodes.filter(e=>e.id!==eW),t=(tk.edges??[]).filter(e=>e.from!==eW&&e.to!==eW);eD(JSON.stringify({...tk,nodes:e,edges:t},null,2)+"\n"),eM("")},className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] font-medium text-red-100 hover:bg-white/10",children:"Delete node"}):null]}),eW?(S=tk.nodes.find(e=>e.id===eW))?(0,t.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"id"}),(0,t.jsx)("div",{className:"mt-1 rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",children:S.id})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"name"}),(0,t.jsx)("input",{value:String(S.name??""),onChange:e=>{let t=e.target.value;eD(JSON.stringify({...tk,nodes:tk.nodes.map(e=>e.id===S.id?{...e,name:t}:e)},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"Optional"})]}),(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.jsxs)("select",{value:S.type,onChange:e=>{let t=e.target.value;eD(JSON.stringify({...tk,nodes:tk.nodes.map(e=>e.id===S.id?{...e,type:t}:e)},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"start",children:"start"}),(0,t.jsx)("option",{value:"end",children:"end"}),(0,t.jsx)("option",{value:"llm",children:"llm"}),(0,t.jsx)("option",{value:"tool",children:"tool"}),(0,t.jsx)("option",{value:"condition",children:"condition"}),(0,t.jsx)("option",{value:"delay",children:"delay"}),(0,t.jsx)("option",{value:"human_approval",children:"human_approval"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-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:"x"}),(0,t.jsx)("input",{type:"number",value:"number"==typeof S.x?S.x:0,onChange:e=>{let t=Number(e.target.value);eD(JSON.stringify({...tk,nodes:tk.nodes.map(e=>e.id===S.id?{...e,x:t}:e)},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]"})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"y"}),(0,t.jsx)("input",{type:"number",value:"number"==typeof S.y?S.y:0,onChange:e=>{let t=Number(e.target.value);eD(JSON.stringify({...tk,nodes:tk.nodes.map(e=>e.id===S.id?{...e,y:t}:e)},null,2)+"\n")},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"config"}),(0,t.jsx)("pre",{className:"mt-1 max-h-[200px] overflow-auto rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(S.config??{},null,2)})]})]}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"No node selected."}):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"Select a node."})]})]})):(0,t.jsx)("div",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"Load or create a workflow to edit triggers."})]})]}):(0,t.jsx)("textarea",{value:eP,onChange:e=>eD(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,placeholder:"Select a workflow from the left (or create the template)."})]})})]})}):null]}):null,"files"===B?(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-3",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:"Team files"}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:ek,onChange:e=>eb(e.target.checked)}),"Show optional"]})]}),(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Default view hides optional missing files to reduce noise."}),(0,t.jsxs)("ul",{className:"mt-3 space-y-1",children:[eu?(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,ep.filter(e=>!!ek||e.required||!e.missing).map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{onClick:()=>tZ(e.name),className:ey===e.name?"w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-3 py-2 text-left text-sm text-[color:var(--ck-text-primary)]":"w-full rounded-[var(--ck-radius-sm)] px-3 py-2 text-left text-sm text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:[(0,t.jsx)("span",{className:e.required?"text-[color:var(--ck-text-primary)]":"text-[color:var(--ck-text-secondary)]",children:e.name}),(0,t.jsx)("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:e.required?"required":"optional"}),e.missing?(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"missing"}):null]})},e.name))]})]}),(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: ",ey]}),(0,t.jsx)("button",{disabled:K,onClick:t0,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:K?"Saving…":"Save file"})]}),eg?(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:eg}):null,(0,t.jsx)("textarea",{value:ej,onChange:e=>eN(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})]})]}):null,"orchestrator"===B?(0,t.jsx)(c,{teamId:e}):null,"recipe"===B?(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"}),ea?(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:ea}):null,(0,t.jsx)("textarea",{value:q,onChange:e=>{L(e.target.value),M(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})]}):null,(0,t.jsx)(l,{open:en,teamId:e,recipeId:P,busy:Q,onClose:()=>ec(!1),onConfirm:async()=>{V(!0);try{let t=await fetch("/api/scaffold",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"team",recipeId:P.trim(),teamId:e,overwrite:!0,applyConfig:!0})}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Publish failed");try{let t=await fetch(`/api/teams/meta?teamId=${encodeURIComponent(e)}`,{cache:"no-store"}),r=await t.json();t.ok&&r.ok&&r.meta&&"string"==typeof r.meta.recipeHash&&em(r.meta.recipeHash)}catch{}ec(!1),ex("Published changes to active team","success")}catch(e){ex(e instanceof Error?e.message:String(e),"error")}finally{V(!1)}}}),(0,t.jsx)(o,{open:eo,teamId:e,busy:Z,onClose:()=>el(!1),onConfirm:async()=>{ee(!0);try{let t=await fetch("/api/teams/remove-team",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e})}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Delete failed");ex("Deleted team successfully","success"),el(!1),setTimeout(()=>C.push("/"),250)}catch(e){ex(e instanceof Error?e.message:String(e),"error")}finally{ee(!1)}}})]})}e.s(["default",()=>m],53525)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63491,e=>{"use strict";var t=e.i(43476),r=e.i(71645);function c({error:e,reset:c}){return(0,r.useEffect)(()=>{console.error("Global error:",e)},[e]),(0,t.jsx)("html",{lang:"en",children:(0,t.jsx)("body",{className:"min-h-screen bg-[color:var(--ck-bg)] text-[color:var(--ck-text-primary)]",children:(0,t.jsxs)("div",{className:"mx-auto max-w-2xl px-6 py-16",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"An unexpected error occurred."}),(0,t.jsx)("pre",{className:"mt-6 overflow-auto rounded-md border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass)] p-4 text-xs text-[color:var(--ck-text-secondary)]",children:String(e?.stack||e)}),e?.digest?(0,t.jsxs)("p",{className:"mt-3 text-xs text-[color:var(--ck-text-secondary)]",children:["Digest: ",e.digest]}):null,(0,t.jsx)("div",{className:"mt-6 flex gap-3",children:(0,t.jsx)("button",{type:"button",onClick:()=>c(),className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-4 py-2 text-sm font-medium text-white",children:"Try again"})})]})})})}e.s(["default",()=>c])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,35451,(e,t,r)=>{var n={229:function(e){var t,r,n,o=e.exports={};function u(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:u}catch(e){t=u}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}function l(e){if(t===setTimeout)return setTimeout(e,0);if((t===u||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var a=[],c=!1,s=-1;function f(){c&&n&&(c=!1,n.length?a=n.concat(a):s=-1,a.length&&d())}function d(){if(!c){var e=l(f);c=!0;for(var t=a.length;t;){for(n=a,a=[];++s<t;)n&&n[s].run();s=-1,t=a.length}n=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function _(){}o.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];a.push(new p(e,t)),1!==a.length||c||l(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=_,o.addListener=_,o.once=_,o.off=_,o.removeListener=_,o.removeAllListeners=_,o.emit=_,o.prependListener=_,o.prependOnceListener=_,o.listeners=function(e){return[]},o.binding=function(e){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw Error("process.chdir is not supported")},o.umask=function(){return 0}}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},i=!0;try{n[e](r,r.exports,u),i=!1}finally{i&&delete o[e]}return r.exports}u.ab="/ROOT/node_modules/next/dist/compiled/process/",t.exports=u(229)},47167,(e,t,r)=>{"use strict";var n,o;t.exports=(null==(n=e.g.process)?void 0:n.env)&&"object"==typeof(null==(o=e.g.process)?void 0:o.env)?e.g.process:e.r(35451)},45689,(e,t,r)=>{"use strict";var n=Symbol.for("react.transitional.element");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var u in r={},t)"key"!==u&&(r[u]=t[u]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}r.Fragment=Symbol.for("react.fragment"),r.jsx=o,r.jsxs=o},43476,(e,t,r)=>{"use strict";t.exports=e.r(45689)},50740,(e,t,r)=>{"use strict";var n=e.i(47167),o=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),s=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),E=Symbol.for("react.view_transition"),h=Symbol.iterator,b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,m={};function R(e,t,r){this.props=e,this.context=t,this.refs=m,this.updater=r||b}function g(){}function O(e,t,r){this.props=e,this.context=t,this.refs=m,this.updater=r||b}R.prototype.isReactComponent={},R.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},R.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=R.prototype;var j=O.prototype=new g;j.constructor=O,v(j,R.prototype),j.isPureReactComponent=!0;var T=Array.isArray;function S(){}var x={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function A(e,t,r){var n=r.ref;return{$$typeof:o,type:e,key:t,ref:void 0!==n?n:null,props:r}}function w(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var M=/\/+/g;function N(e,t){var r,n;return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36)}function C(e,t,r){if(null==e)return e;var n=[],i=0;return!function e(t,r,n,i,l){var a,c,s,f=typeof t;("undefined"===f||"boolean"===f)&&(t=null);var d=!1;if(null===t)d=!0;else switch(f){case"bigint":case"string":case"number":d=!0;break;case"object":switch(t.$$typeof){case o:case u:d=!0;break;case _:return e((d=t._init)(t._payload),r,n,i,l)}}if(d)return l=l(t),d=""===i?"."+N(t,0):i,T(l)?(n="",null!=d&&(n=d.replace(M,"$&/")+"/"),e(l,r,n,"",function(e){return e})):null!=l&&(w(l)&&(a=l,c=n+(null==l.key||t&&t.key===l.key?"":(""+l.key).replace(M,"$&/")+"/")+d,l=A(a.type,c,a.props)),r.push(l)),1;d=0;var p=""===i?".":i+":";if(T(t))for(var y=0;y<t.length;y++)f=p+N(i=t[y],y),d+=e(i,r,n,f,l);else if("function"==typeof(y=null===(s=t)||"object"!=typeof s?null:"function"==typeof(s=h&&s[h]||s["@@iterator"])?s:null))for(t=y.call(t),y=0;!(i=t.next()).done;)f=p+N(i=i.value,y++),d+=e(i,r,n,f,l);else if("object"===f){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(S,S):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),r,n,i,l);throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(r=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return d}(e,n,"","",function(e){return t.call(r,e,i++)}),n}function H(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)},function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof n.default&&"function"==typeof n.default.emit)return void n.default.emit("uncaughtException",e);console.error(e)};function U(e){var t=x.T,r={};r.types=null!==t?t.types:null,x.T=r;try{var n=e(),o=x.S;null!==o&&o(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(S,D)}catch(e){D(e)}finally{null!==t&&null!==r.types&&(t.types=r.types),x.T=t}}function I(e){var t=x.T;if(null!==t){var r=t.types;null===r?t.types=[e]:-1===r.indexOf(e)&&r.push(e)}else U(I.bind(null,e))}r.Activity=y,r.Children={map:C,forEach:function(e,t,r){C(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return C(e,function(){t++}),t},toArray:function(e){return C(e,function(e){return e})||[]},only:function(e){if(!w(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},r.Component=R,r.Fragment=i,r.Profiler=a,r.PureComponent=O,r.StrictMode=l,r.Suspense=d,r.ViewTransition=E,r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,r.__COMPILER_RUNTIME={__proto__:null,c:function(e){return x.H.useMemoCache(e)}},r.addTransitionType=I,r.cache=function(e){return function(){return e.apply(null,arguments)}},r.cacheSignal=function(){return null},r.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=v({},e.props),o=e.key;if(null!=t)for(u in void 0!==t.key&&(o=""+t.key),t)P.call(t,u)&&"key"!==u&&"__self"!==u&&"__source"!==u&&("ref"!==u||void 0!==t.ref)&&(n[u]=t[u]);var u=arguments.length-2;if(1===u)n.children=r;else if(1<u){for(var i=Array(u),l=0;l<u;l++)i[l]=arguments[l+2];n.children=i}return A(e.type,o,n)},r.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:c,_context:e},e},r.createElement=function(e,t,r){var n,o={},u=null;if(null!=t)for(n in void 0!==t.key&&(u=""+t.key),t)P.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(o[n]=t[n]);var i=arguments.length-2;if(1===i)o.children=r;else if(1<i){for(var l=Array(i),a=0;a<i;a++)l[a]=arguments[a+2];o.children=l}if(e&&e.defaultProps)for(n in i=e.defaultProps)void 0===o[n]&&(o[n]=i[n]);return A(e,u,o)},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:f,render:e}},r.isValidElement=w,r.lazy=function(e){return{$$typeof:_,_payload:{_status:-1,_result:e},_init:H}},r.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},r.startTransition=U,r.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},r.use=function(e){return x.H.use(e)},r.useActionState=function(e,t,r){return x.H.useActionState(e,t,r)},r.useCallback=function(e,t){return x.H.useCallback(e,t)},r.useContext=function(e){return x.H.useContext(e)},r.useDebugValue=function(){},r.useDeferredValue=function(e,t){return x.H.useDeferredValue(e,t)},r.useEffect=function(e,t){return x.H.useEffect(e,t)},r.useEffectEvent=function(e){return x.H.useEffectEvent(e)},r.useId=function(){return x.H.useId()},r.useImperativeHandle=function(e,t,r){return x.H.useImperativeHandle(e,t,r)},r.useInsertionEffect=function(e,t){return x.H.useInsertionEffect(e,t)},r.useLayoutEffect=function(e,t){return x.H.useLayoutEffect(e,t)},r.useMemo=function(e,t){return x.H.useMemo(e,t)},r.useOptimistic=function(e,t){return x.H.useOptimistic(e,t)},r.useReducer=function(e,t,r){return x.H.useReducer(e,t,r)},r.useRef=function(e){return x.H.useRef(e)},r.useState=function(e){return x.H.useState(e)},r.useSyncExternalStore=function(e,t,r){return x.H.useSyncExternalStore(e,t,r)},r.useTransition=function(){return x.H.useTransition()},r.version="19.3.0-canary-f93b9fd4-20251217"},71645,(e,t,r)=>{"use strict";t.exports=e.r(50740)},55682,(e,t,r)=>{"use strict";r._=function(e){return e&&e.__esModule?e:{default:e}}},76963,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RedirectStatusCode",{enumerable:!0,get:function(){return o}});var n,o=((n={})[n.SeeOther=303]="SeeOther",n[n.TemporaryRedirect=307]="TemporaryRedirect",n[n.PermanentRedirect=308]="PermanentRedirect",n);("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)},68391,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,o={REDIRECT_ERROR_CODE:function(){return l},RedirectType:function(){return a},isRedirectError:function(){return c}};for(var u in o)Object.defineProperty(r,u,{enumerable:!0,get:o[u]});let i=e.r(76963),l="NEXT_REDIRECT";var a=((n={}).push="push",n.replace="replace",n);function c(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let t=e.digest.split(";"),[r,n]=t,o=t.slice(2,-2).join(";"),u=Number(t.at(-2));return r===l&&("replace"===n||"push"===n)&&"string"==typeof o&&!isNaN(u)&&u in i.RedirectStatusCode}("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)},90317,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={bindSnapshot:function(){return c},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let u=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class i{disable(){throw u}getStore(){}run(){throw u}exit(){throw u}enterWith(){throw u}static bind(e){return e}}let l="u">typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return l?new l:new i}function c(e){return l?l.bind(e):i.bind(e)}function s(){return l?l.snapshot():function(e,...t){return e(...t)}}},21768,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ACTION_HEADER:function(){return i},FLIGHT_HEADERS:function(){return _},NEXT_ACTION_NOT_FOUND_HEADER:function(){return R},NEXT_ACTION_REVALIDATED_HEADER:function(){return j},NEXT_DID_POSTPONE_HEADER:function(){return h},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return f},NEXT_HMR_REFRESH_HEADER:function(){return s},NEXT_HTML_REQUEST_ID_HEADER:function(){return O},NEXT_IS_PRERENDER_HEADER:function(){return m},NEXT_REQUEST_ID_HEADER:function(){return g},NEXT_REWRITTEN_PATH_HEADER:function(){return b},NEXT_REWRITTEN_QUERY_HEADER:function(){return v},NEXT_ROUTER_PREFETCH_HEADER:function(){return a},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return c},NEXT_ROUTER_STALE_TIME_HEADER:function(){return E},NEXT_ROUTER_STATE_TREE_HEADER:function(){return l},NEXT_RSC_UNION_QUERY:function(){return y},NEXT_URL:function(){return d},RSC_CONTENT_TYPE_HEADER:function(){return p},RSC_HEADER:function(){return u}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let u="rsc",i="next-action",l="next-router-state-tree",a="next-router-prefetch",c="next-router-segment-prefetch",s="next-hmr-refresh",f="__next_hmr_refresh_hash__",d="next-url",p="text/x-component",_=[u,l,a,s,c],y="_rsc",E="x-nextjs-stale-time",h="x-nextjs-postponed",b="x-nextjs-rewritten-path",v="x-nextjs-rewritten-query",m="x-nextjs-prerender",R="x-nextjs-action-not-found",g="x-nextjs-request-id",O="x-nextjs-html-request-id",j="x-action-revalidated";("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)},90809,(e,t,r)=>{"use strict";function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}r._=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=u?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}},13258,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DEFAULT_SEGMENT_KEY:function(){return f},NOT_FOUND_SEGMENT_KEY:function(){return d},PAGE_SEGMENT_KEY:function(){return s},addSearchParamsIfPageSegment:function(){return a},computeSelectedLayoutSegment:function(){return c},getSegmentValue:function(){return u},getSelectedLayoutSegmentPath:function(){return function e(t,r,n=!0,o=[]){let i;if(n)i=t[1][r];else{let e=t[1];i=e.children??Object.values(e)[0]}if(!i)return o;let l=u(i[0]);return!l||l.startsWith(s)?o:(o.push(l),e(i,r,!1,o))}},isGroupSegment:function(){return i},isParallelRouteSegment:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function u(e){return Array.isArray(e)?e[1]:e}function i(e){return"("===e[0]&&e.endsWith(")")}function l(e){return e.startsWith("@")&&"@children"!==e}function a(e,t){if(e.includes(s)){let e=JSON.stringify(t);return"{}"!==e?s+"?"+e:s}return e}function c(e,t){if(!e||0===e.length)return null;let r="children"===t?e[0]:e[e.length-1];return r===f?null:r}let s="__PAGE__",f="__DEFAULT__",d="/_not-found"},92838,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={UnrecognizedActionError:function(){return u},unstable_isUnrecognizedActionError:function(){return i}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});class u extends Error{constructor(...e){super(...e),this.name="UnrecognizedActionError"}}function i(e){return!!(e&&"object"==typeof e&&e instanceof u)}("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)},34457,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"actionAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,e.r(90317).createAsyncLocalStorage)()},62266,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"actionAsyncStorage",{enumerable:!0,get:function(){return n.actionAsyncStorageInstance}});let n=e.r(34457)},24063,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={getRedirectError:function(){return a},getRedirectStatusCodeFromError:function(){return p},getRedirectTypeFromError:function(){return d},getURLFromRedirectError:function(){return f},permanentRedirect:function(){return s},redirect:function(){return c}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let u=e.r(76963),i=e.r(68391),l="u"<typeof window?e.r(62266).actionAsyncStorage:void 0;function a(e,t,r=u.RedirectStatusCode.TemporaryRedirect){let n=Object.defineProperty(Error(i.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n.digest=`${i.REDIRECT_ERROR_CODE};${t};${e};${r};`,n}function c(e,t){throw a(e,t??=l?.getStore()?.isAction?i.RedirectType.push:i.RedirectType.replace,u.RedirectStatusCode.TemporaryRedirect)}function s(e,t=i.RedirectType.replace){throw a(e,t,u.RedirectStatusCode.PermanentRedirect)}function f(e){return(0,i.isRedirectError)(e)?e.digest.split(";").slice(2,-2).join(";"):null}function d(e){if(!(0,i.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return e.digest.split(";",2)[1]}function p(e){if(!(0,i.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(e.digest.split(";").at(-2))}("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)},8372,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={AppRouterContext:function(){return i},GlobalLayoutRouterContext:function(){return a},LayoutRouterContext:function(){return l},MissingSlotContext:function(){return s},TemplateContext:function(){return c}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let u=e.r(55682)._(e.r(71645)),i=u.default.createContext(null),l=u.default.createContext(null),a=u.default.createContext(null),c=u.default.createContext(null),s=u.default.createContext(new Set)},90373,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useUntrackedPathname",{enumerable:!0,get:function(){return u}});let n=e.r(71645),o=e.r(61994);function u(){return!function(){if("u"<typeof window){let{workUnitAsyncStorage:t}=e.r(62141),r=t.getStore();if(!r)return!1;switch(r.type){case"prerender":case"prerender-client":case"prerender-ppr":let n=r.fallbackRouteParams;return!!n&&n.size>0}}return!1}()?(0,n.useContext)(o.PathnameContext):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)},78377,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={handleHardNavError:function(){return i},useNavFailureHandler:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});e.r(71645);let u=e.r(51191);function i(e){return!!(e&&"u">typeof window)&&!!window.next.__pendingUrl&&(0,u.createHrefFromUrl)(new URL(window.location.href))!==(0,u.createHrefFromUrl)(window.next.__pendingUrl)&&(console.error("Error occurred during navigation, falling back to hard navigation",e),window.location.href=window.next.__pendingUrl.toString(),!0)}function l(){}("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)},12354,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"HandleISRError",{enumerable:!0,get:function(){return o}});let n="u"<typeof window?e.r(63599).workAsyncStorage:void 0;function o({error:e}){if(n){let t=n.getStore();if(t?.isStaticGeneration)throw e&&console.error(e),e}return 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)},72383,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ErrorBoundary:function(){return _},ErrorBoundaryHandler:function(){return p}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let u=e.r(55682),i=e.r(43476),l=u._(e.r(71645)),a=e.r(90373),c=e.r(65713);e.r(78377);let s=e.r(12354),f=e.r(82604),d="u">typeof window&&(0,f.isBot)(window.navigator.userAgent);class p extends l.default.Component{constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}static getDerivedStateFromError(e){if((0,c.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){let{error:r}=t;return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error&&!d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.HandleISRError,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,i.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}}function _({errorComponent:e,errorStyles:t,errorScripts:r,children:n}){let o=(0,a.useUntrackedPathname)();return e?(0,i.jsx)(p,{pathname:o,errorComponent:e,errorStyles:t,errorScripts:r,children:n}):(0,i.jsx)(i.Fragment,{children:n})}("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)},58442,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={RedirectBoundary:function(){return p},RedirectErrorBoundary:function(){return d}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let u=e.r(90809),i=e.r(43476),l=u._(e.r(71645)),a=e.r(76562),c=e.r(24063),s=e.r(68391);function f({redirect:e,reset:t,redirectType:r}){let n=(0,a.useRouter)();return(0,l.useEffect)(()=>{l.default.startTransition(()=>{r===s.RedirectType.push?n.push(e,{}):n.replace(e,{}),t()})},[e,r,t,n]),null}class d extends l.default.Component{constructor(e){super(e),this.state={redirect:null,redirectType:null}}static getDerivedStateFromError(e){if((0,s.isRedirectError)(e)){let t=(0,c.getURLFromRedirectError)(e),r=(0,c.getRedirectTypeFromError)(e);return"handled"in e?{redirect:null,redirectType:null}:{redirect:t,redirectType:r}}throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,i.jsx)(f,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}}function p({children:e}){let t=(0,a.useRouter)();return(0,i.jsx)(d,{router:t,children:e})}("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)},1244,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"unresolvedThenable",{enumerable:!0,get:function(){return n}});let n={then:()=>{}};("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)},97367,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={MetadataBoundary:function(){return l},OutletBoundary:function(){return c},RootLayoutBoundary:function(){return s},ViewportBoundary:function(){return a}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let u=e.r(54839),i={[u.METADATA_BOUNDARY_NAME]:function({children:e}){return e},[u.VIEWPORT_BOUNDARY_NAME]:function({children:e}){return e},[u.OUTLET_BOUNDARY_NAME]:function({children:e}){return e},[u.ROOT_LAYOUT_BOUNDARY_NAME]:function({children:e}){return e}},l=i[u.METADATA_BOUNDARY_NAME.slice(0)],a=i[u.VIEWPORT_BOUNDARY_NAME.slice(0)],c=i[u.OUTLET_BOUNDARY_NAME.slice(0)],s=i[u.ROOT_LAYOUT_BOUNDARY_NAME.slice(0)]},68027,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let n=e.r(43476),o=e.r(12354),u={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"},i={fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"},l=function({error:e}){let t=e?.digest;return(0,n.jsxs)("html",{id:"__next_error__",children:[(0,n.jsx)("head",{}),(0,n.jsxs)("body",{children:[(0,n.jsx)(o.HandleISRError,{error:e}),(0,n.jsx)("div",{style:u,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("h2",{style:i,children:["Application error: a ",t?"server":"client","-side exception has occurred while loading ",window.location.hostname," (see the"," ",t?"server logs":"browser console"," for more information)."]}),t?(0,n.jsx)("p",{style:i,children:`Digest: ${t}`}):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)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/f3e3461eda4a8d62.js","static/chunks/68a088aa49e6124a.js","static/chunks/f2f58a7e93290fbb.js","static/chunks/10cbf02e6fc36465.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=(self.TURBOPACK_CHUNK_SUFFIX??document?.currentScript?.getAttribute?.("src")?.replace(/^(.*(?=\?)|^.*$)/,""))||"",n=new WeakMap;function o(e,t){this.m=e,this.e=t}let l=o.prototype,i=Object.prototype.hasOwnProperty,s="u">typeof Symbol&&Symbol.toStringTag;function u(e,t,r){i.call(e,t)||Object.defineProperty(e,t,r)}function a(e,t){let r=e[t];return r||(r=c(t),e[t]=r),r}function c(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function f(e,t){u(e,"__esModule",{value:!0}),s&&u(e,s,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)u(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?u(e,n,{get:o,set:t[r++],enumerable:!0}):u(e,n,{get:o,enumerable:!0})}Object.seal(e)}l.s=function(e,t){let r,n;null!=t?n=(r=a(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,f(n,e)},l.j=function(e,t){var r,o;let l,s,u;null!=t?s=(l=a(this.c,t)).exports:(l=this.m,s=this.e);let c=(r=l,o=s,(u=n.get(r))||(n.set(r,u=[]),r.exports=r.namespaceObject=new Proxy(o,{get(e,t){if(i.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of u){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of u)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),u);"object"==typeof e&&null!==e&&c.push(e)},l.v=function(e,t){(null!=t?a(this.c,t):this.m).exports=e},l.n=function(e,t){let r;(r=null!=t?a(this.c,t):this.m).exports=r.namespaceObject=e};let p=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,h=[null,p({}),p([]),p(p)];function d(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!h.includes(t);t=p(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),f(t,n),t}function m(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=d(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function b(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function y(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}l.i=m,l.A=function(e){return this.r(e)(m.bind(this))},l.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},l.r=function(e){return B(e,this.m).exports},l.f=function(e){function t(t){if(t=b(t),i.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=b(t),i.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let O=Symbol("turbopack queues"),g=Symbol("turbopack exports"),w=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}l.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:l,reject:i,promise:s}=y(),u=Object.assign(s,{[g]:r.exports,[O]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[g]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(O in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[g]:{},[O]:e=>e(t)};return e.then(e=>{r[g]=e,C(t)},e=>{r[w]=e,C(t)}),r}}return{[g]:e,[O]:()=>{}}}),r=()=>t.map(e=>{if(e[w])throw e[w];return e[g]}),{promise:l,resolve:i}=y(),s=Object.assign(()=>i(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[O](u)),s.queueCount?l:r()},function(e){e?i(u[w]=e):l(u[g]),C(n)}),n&&-1===n.status&&(n.status=0)};let U=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}U.prototype=URL.prototype,l.U=U,l.z=function(e){throw Error("dynamic usage of require is not supported")},l.g=globalThis;let j=o.prototype;var k,_=((k=_||{})[k.Runtime=0]="Runtime",k[k.Parent=1]="Parent",k[k.Update=2]="Update",k);let v=new Map;l.M=v;let $=new Map,P=new Map;async function S(e,t,r){let n;if("string"==typeof r)return E(e,t,K(r));let o=r.included||[],l=o.map(e=>!!v.has(e)||$.get(e));if(l.length>0&&l.every(e=>e))return void await Promise.all(l);let i=r.moduleChunks||[],s=i.map(e=>P.get(e)).filter(e=>e);if(s.length>0){if(s.length===i.length)return void await Promise.all(s);let r=new Set;for(let e of i)P.has(e)||r.add(e);for(let n of r){let r=E(e,t,K(n));P.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=E(e,t,K(r.path)),i))P.has(o)||P.set(o,n)}for(let e of o)$.has(e)||$.set(e,n);await n}j.l=function(e){return S(1,this.m.id,e)};let T=Promise.resolve(void 0),A=new WeakMap;function E(t,r,n){let o=e.loadChunkCached(t,n),l=A.get(o);if(void 0===l){let e=A.set.bind(A,o,T);l=o.then(e).catch(e=>{let o;switch(t){case 0:o=`as a runtime dependency of chunk ${r}`;break;case 1:o=`from module ${r}`;break;case 2:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),A.set(o,l)}return l}function K(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}j.L=function(e){return E(1,this.m.id,e)},j.R=function(e){let t=this.r(e);return t?.default??t},j.P=function(e){return`/ROOT/${e??""}`},j.b=function(e){let t=new Blob([`self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};
|
|
2
2
|
self.TURBOPACK_CHUNK_SUFFIX = ${JSON.stringify(r)};
|
|
3
3
|
self.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(e.reverse().map(K),null,2)};
|
|
4
4
|
importScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`],{type:"text/javascript"});return URL.createObjectURL(t)};let x=/\.js(?:\?[^#]*)?(?:#.*)?$/,N=/\.css(?:\?[^#]*)?(?:#.*)?$/;function M(e){return N.test(e)}l.w=function(t,r,n){return e.loadWebAssembly(1,this.m.id,t,r,n)},l.u=function(t,r){return e.loadWebAssemblyModule(1,this.m.id,t,r)};let L={};l.c=L;let B=(e,t)=>{let r=L[e];if(r){if(r.error)throw r.error;return r}return q(e,_.Parent,t.id)};function q(e,t,r){let n=v.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let l=c(e),i=l.exports;L[e]=l;let s=new o(l,i);try{n(s,l,i)}catch(e){throw l.error=e,e}return l.namespaceObject&&l.exports!==l.namespaceObject&&d(l.exports,l.namespaceObject),l}function I(r){let n,o=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(("u">typeof TURBOPACK_NEXT_CHUNK_URLS?TURBOPACK_NEXT_CHUNK_URLS.pop():e.getAttribute("src")).replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(r[0]);return 2===r.length?n=r[1]:(n=void 0,!function(e,t,r,n){let o=1;for(;o<e.length;){let t=e[o],n=o+1;for(;n<e.length&&"function"!=typeof e[n];)n++;if(n===e.length)throw Error("malformed chunk format, expected a factory function");if(!r.has(t)){let l=e[n];for(Object.defineProperty(l,"name",{value:"module evaluation"});o<n;o++)t=e[o],r.set(t,l)}o=n+1}}(r,0,v)),e.registerChunk(o,n)}let W=new Map;function H(e){let t=W.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},W.set(e,t)}return t}e={async registerChunk(e,t){if(H(K(e)).resolve(),null!=t){for(let e of t.otherChunks)H(K("string"==typeof e?e:e.path));if(await Promise.all(t.otherChunks.map(t=>S(0,e,t))),t.runtimeModuleIds.length>0)for(let r of t.runtimeModuleIds)!function(e,t){let r=L[t];if(r){if(r.error)throw r.error;return}q(t,_.Runtime,e)}(e,r)}},loadChunkCached:(e,t)=>(function(e,t){let r=H(t);if(r.loadingStarted)return r.promise;if(e===_.Runtime)return r.loadingStarted=!0,M(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(M(t));else if(x.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(TURBOPACK_WORKER_LOCATION+t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(M(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(x.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let l=fetch(K(r)),{instance:i}=await WebAssembly.instantiateStreaming(l,o);return i.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(K(r));return await WebAssembly.compileStreaming(o)}};let F=globalThis.TURBOPACK;globalThis.TURBOPACK={push:I},F.forEach(I)})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jiggai/kitchen",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"openclaw": {
|
|
6
6
|
"extensions": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "next dev",
|
|
12
|
-
"build": "next build",
|
|
12
|
+
"build": "NODE_ENV=production next build",
|
|
13
13
|
"postbuild": "node scripts/copy-standalone-static.mjs",
|
|
14
14
|
"start": "next start",
|
|
15
15
|
"lint": "eslint",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/public/chef.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/app/HomeClient.tsx
CHANGED
|
@@ -98,7 +98,7 @@ export default function HomeClient({
|
|
|
98
98
|
}, [agents, teamFilter, teamNames]);
|
|
99
99
|
|
|
100
100
|
return (
|
|
101
|
-
<div className="ck-glass
|
|
101
|
+
<div className="ck-glass w-full p-6 sm:p-8">
|
|
102
102
|
<div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
|
|
103
103
|
<div>
|
|
104
104
|
<h1 className="text-3xl font-semibold tracking-tight">
|
|
@@ -24,12 +24,20 @@ export async function GET(req: Request) {
|
|
|
24
24
|
args: { action: "list", includeDisabled: true },
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
// Tool responses may come back as either:
|
|
28
|
+
// - {type:"text", text:"{...}"} (stringified JSON)
|
|
29
|
+
// - {type:"json", json:{...}} (already-parsed)
|
|
27
30
|
const text = result?.content?.find((c) => c.type === "text")?.text;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
const jsonPayload = (result?.content as Array<{ type: string; text?: string; json?: unknown }> | undefined)?.find(
|
|
32
|
+
(c) => c.type === "json" && c.json,
|
|
33
|
+
)?.json;
|
|
34
|
+
|
|
35
|
+
const parsed = ((): { jobs?: unknown[] } => {
|
|
36
|
+
if (jsonPayload && typeof jsonPayload === "object") return jsonPayload as { jobs?: unknown[] };
|
|
37
|
+
if (text && text.trim()) return JSON.parse(text) as { jobs?: unknown[] };
|
|
38
|
+
return { jobs: [] };
|
|
39
|
+
})();
|
|
31
40
|
|
|
32
|
-
const parsed = JSON.parse(text) as { jobs?: unknown[] };
|
|
33
41
|
const jobs = Array.isArray(parsed.jobs) ? parsed.jobs : [];
|
|
34
42
|
|
|
35
43
|
// Enrich: map installed cron IDs → scope (team/agent) using provenance files.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
import { NextResponse } from "next/server";
|
|
6
|
+
|
|
7
|
+
import { getKitchenApi } from "@/lib/kitchen-api";
|
|
8
|
+
|
|
9
|
+
function normalizeId(kind: string, id: string) {
|
|
10
|
+
const s = String(id ?? "").trim();
|
|
11
|
+
if (!s) throw new Error(`${kind} is required`);
|
|
12
|
+
if (!/^[a-z0-9][a-z0-9-]{0,62}$/i.test(s)) {
|
|
13
|
+
throw new Error(`${kind} must match /^[a-z0-9][a-z0-9-]{0,62}$/i`);
|
|
14
|
+
}
|
|
15
|
+
return s;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function resolveOrchestratorWorkspace(orchestratorAgentId: string) {
|
|
19
|
+
const cfgPath = path.join(os.homedir(), ".openclaw", "openclaw.json");
|
|
20
|
+
const raw = await fs.readFile(cfgPath, "utf8");
|
|
21
|
+
const cfg = JSON.parse(raw) as { agents?: { defaults?: { workspace?: string } } };
|
|
22
|
+
|
|
23
|
+
const baseWorkspace = String(cfg?.agents?.defaults?.workspace ?? "").trim();
|
|
24
|
+
if (!baseWorkspace) throw new Error("agents.defaults.workspace not set");
|
|
25
|
+
|
|
26
|
+
// convention: ~/.openclaw/workspace-<id>
|
|
27
|
+
return path.resolve(baseWorkspace, "..", `workspace-${orchestratorAgentId}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export async function POST(req: Request) {
|
|
31
|
+
try {
|
|
32
|
+
const body = (await req.json()) as {
|
|
33
|
+
orchestratorAgentId?: string;
|
|
34
|
+
agentId?: string; // compat
|
|
35
|
+
taskId?: string;
|
|
36
|
+
spec?: string;
|
|
37
|
+
specFile?: string;
|
|
38
|
+
baseRef?: string;
|
|
39
|
+
branch?: string;
|
|
40
|
+
tmuxSession?: string;
|
|
41
|
+
agent?: "codex" | "claude";
|
|
42
|
+
model?: string;
|
|
43
|
+
reasoning?: "low" | "medium" | "high";
|
|
44
|
+
timeoutMs?: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const orchestratorAgentId = normalizeId("orchestratorAgentId", String(body.orchestratorAgentId ?? body.agentId ?? ""));
|
|
48
|
+
const taskId = normalizeId("taskId", String(body.taskId ?? ""));
|
|
49
|
+
|
|
50
|
+
const spec = typeof body.spec === "string" ? body.spec : "";
|
|
51
|
+
const specFile = typeof body.specFile === "string" ? body.specFile : "";
|
|
52
|
+
if (!!spec === !!specFile) {
|
|
53
|
+
throw new Error("Provide exactly one of spec or specFile");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const orchestratorWs = await resolveOrchestratorWorkspace(orchestratorAgentId);
|
|
57
|
+
const cliPath = path.join(orchestratorWs, ".clawdbot", "task.sh");
|
|
58
|
+
|
|
59
|
+
// Prefer spec-file to avoid shell quoting surprises.
|
|
60
|
+
let effectiveSpecFile = specFile;
|
|
61
|
+
let tmpToCleanup: string | null = null;
|
|
62
|
+
|
|
63
|
+
if (spec) {
|
|
64
|
+
const tmp = path.join(os.tmpdir(), `clawkitchen-swarm-${taskId}-${Date.now()}.md`);
|
|
65
|
+
await fs.writeFile(tmp, spec, "utf8");
|
|
66
|
+
effectiveSpecFile = tmp;
|
|
67
|
+
tmpToCleanup = tmp;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Basic existence checks for actionable errors.
|
|
71
|
+
await fs.access(cliPath);
|
|
72
|
+
|
|
73
|
+
const timeoutMs = Number.isFinite(body.timeoutMs) ? Number(body.timeoutMs) : 120000;
|
|
74
|
+
|
|
75
|
+
const args: string[] = [
|
|
76
|
+
"bash",
|
|
77
|
+
cliPath,
|
|
78
|
+
"start",
|
|
79
|
+
"--task-id",
|
|
80
|
+
taskId,
|
|
81
|
+
"--spec-file",
|
|
82
|
+
effectiveSpecFile,
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
if (typeof body.baseRef === "string" && body.baseRef.trim()) {
|
|
86
|
+
args.push("--base-ref", body.baseRef.trim());
|
|
87
|
+
}
|
|
88
|
+
if (typeof body.branch === "string" && body.branch.trim()) {
|
|
89
|
+
args.push("--branch", body.branch.trim());
|
|
90
|
+
}
|
|
91
|
+
if (typeof body.tmuxSession === "string" && body.tmuxSession.trim()) {
|
|
92
|
+
args.push("--tmux-session", body.tmuxSession.trim());
|
|
93
|
+
}
|
|
94
|
+
if (typeof body.agent === "string" && body.agent.trim()) {
|
|
95
|
+
args.push("--agent", body.agent.trim());
|
|
96
|
+
}
|
|
97
|
+
if (typeof body.model === "string" && body.model.trim()) {
|
|
98
|
+
args.push("--model", body.model.trim());
|
|
99
|
+
}
|
|
100
|
+
if (typeof body.reasoning === "string" && body.reasoning.trim()) {
|
|
101
|
+
args.push("--reasoning", body.reasoning.trim());
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const api = getKitchenApi();
|
|
105
|
+
const res = await api.runtime.system.runCommandWithTimeout(args, { timeoutMs });
|
|
106
|
+
|
|
107
|
+
// best-effort tmp cleanup
|
|
108
|
+
if (tmpToCleanup) {
|
|
109
|
+
void fs.unlink(tmpToCleanup).catch(() => {});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return NextResponse.json({ ok: true, orchestratorWorkspace: orchestratorWs, stdout: res.stdout, stderr: res.stderr });
|
|
113
|
+
} catch (err) {
|
|
114
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
115
|
+
const status = /required|match \//i.test(msg) ? 400 : 500;
|
|
116
|
+
return NextResponse.json({ ok: false, error: msg }, { status });
|
|
117
|
+
}
|
|
118
|
+
}
|