@jiggai/kitchen 0.3.11 → 0.3.13
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/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- 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.js +1 -1
- 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 +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- 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 +1 -1
- package/.next/server/app/agents/[agentId]/page.js +1 -1
- 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.nft.json +1 -1
- package/.next/server/app/api/agents/file/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/skills/install/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/update/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/jobs/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/recipe-installed/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/worker/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/ids/check/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/custom-team/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/local-agent-catalog/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/settings/cron-installation/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/[teamId]/tickets/assign/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/[teamId]/tickets/assignees/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/[teamId]/tickets/comment/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/[teamId]/tickets/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/[teamId]/tickets/move/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/[teamId]/tickets/move-to-goals/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/file/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/files/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/meta/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/orchestrator/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/teams/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/workflow-runs/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/workflow-templates/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/workflows/route.js.nft.json +1 -1
- package/.next/server/app/api/tickets/assign/route.js.nft.json +1 -1
- package/.next/server/app/api/tickets/assignees/route.js.nft.json +1 -1
- package/.next/server/app/api/tickets/move/route.js.nft.json +1 -1
- package/.next/server/app/channels/page.js +1 -1
- 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 +4 -4
- package/.next/server/app/channels.segments/_full.segment.rsc +4 -4
- package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
- package/.next/server/app/channels.segments/_index.segment.rsc +2 -2
- package/.next/server/app/channels.segments/_tree.segment.rsc +1 -1
- 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.js +1 -1
- 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/goals/[id]/page.js +1 -1
- 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.js +1 -1
- 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 +4 -4
- package/.next/server/app/goals/new.segments/_full.segment.rsc +4 -4
- package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/_index.segment.rsc +2 -2
- package/.next/server/app/goals/new.segments/_tree.segment.rsc +1 -1
- 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.js +1 -1
- 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 +4 -4
- package/.next/server/app/goals.segments/_full.segment.rsc +4 -4
- package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals.segments/_index.segment.rsc +2 -2
- package/.next/server/app/goals.segments/_tree.segment.rsc +1 -1
- 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.js +3 -3
- 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.js +3 -3
- 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.js +1 -1
- 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/runs/page.js +2 -2
- package/.next/server/app/runs/page.js.nft.json +1 -1
- package/.next/server/app/runs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +1 -1
- 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 +4 -4
- package/.next/server/app/settings.segments/_full.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- 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.js +3 -3
- 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/teams/[teamId]/runs/[workflowId]/[runId]/page.js +2 -2
- package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/runs/page.js +1 -1
- package/.next/server/app/teams/[teamId]/runs/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/runs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/tickets/[ticket]/page.js +1 -1
- package/.next/server/app/teams/[teamId]/tickets/[ticket]/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/tickets/[ticket]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/tickets/page.js +2 -2
- package/.next/server/app/teams/[teamId]/tickets/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/tickets/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page.js +1 -1
- package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/workflows/page.js +3 -3
- package/.next/server/app/teams/[teamId]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tickets/[ticket]/page.js +1 -1
- 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.js +2 -2
- 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/chunks/[root-of-the-server]__01863a8b._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__01863a8b._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__04f289da._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__04f289da._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__05f5e243._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__05f5e243._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__0c4fc3d3._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0c4fc3d3._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__1311d7a3._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1311d7a3._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__1c6c2e43._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1c6c2e43._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__3cfdf0b3._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__3cfdf0b3._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__3fdbc43e._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__3fdbc43e._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__453333f5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__453333f5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__47eb3111._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__47eb3111._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__502825d0._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__502825d0._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__50fe6ff8._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__50fe6ff8._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__51198e25._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__51198e25._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__542a081b._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__542a081b._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__5ceff0f3._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__5ceff0f3._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__5ea38a67._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__5ea38a67._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__698cf062._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__698cf062._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__69be1758._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__69be1758._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__69c45937._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__69c45937._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__6f4e90a0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__6f4e90a0._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__7459129e._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__7459129e._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__7a331e51._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__7a331e51._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__7bf889c1._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__7bf889c1._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__864a08dd._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__864a08dd._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__89605574._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__89605574._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__8e27e9f7._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__8e27e9f7._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__95ddb81a._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__95ddb81a._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__99b12bcb._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__99b12bcb._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__9d0ea07b._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__9d0ea07b._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__a49c534d._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__a49c534d._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__a74a32d5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__a74a32d5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__b002764e._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__b002764e._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__b64936a3._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__b64936a3._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__bbdb6dcb._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__bbdb6dcb._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__bccfb2c0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__bccfb2c0._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__d924e5ac._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__d924e5ac._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__e063a986._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__e063a986._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__e40409a2._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__e40409a2._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__e478ef0d._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__e478ef0d._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__fef7183d._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__fef7183d._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__ff69832c._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__ff69832c._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__02e6ccaa._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__02e6ccaa._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0df430db._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0df430db._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__162d7d9d._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__162d7d9d._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__17b046ea._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__17b046ea._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__255506f2._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__255506f2._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__471bc2e7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__471bc2e7._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__49281b4c._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__8756d76d._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__8756d76d._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__8a588fad._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__8a588fad._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__9a7d79aa._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__c777e326._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__c777e326._.js.map +1 -0
- package/.next/server/chunks/ssr/_018dfe6b._.js +1 -1
- package/.next/server/chunks/ssr/_018dfe6b._.js.map +1 -1
- package/.next/server/chunks/ssr/b1a17_app_teams_[teamId]_workflows_[workflowId]_workflows-editor-client_tsx_5e714aa2._.js +1 -1
- package/.next/server/chunks/ssr/b1a17_app_teams_[teamId]_workflows_[workflowId]_workflows-editor-client_tsx_5e714aa2._.js.map +1 -1
- 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/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/{ecdc9465f0e4d954.js → 4d4876ec71727e38.js} +1 -1
- package/.next/static/chunks/{4f5e02a609758a0b.js → d7f5083b972391f7.js} +1 -1
- package/.next/static/chunks/f179280598d329b2.js +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__24c20736._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__24c20736._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__28f5d174._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__28f5d174._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__30619465._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__30619465._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__6bd48d33._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__6bd48d33._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__78972f52._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__78972f52._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__7fcc6175._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__7fcc6175._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__8e001110._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__8e001110._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__bd20cf10._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__bd20cf10._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__cefae8c8._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__cefae8c8._.js.map +0 -1
- package/.next/static/chunks/821af975ccc1f8d5.js +0 -1
- /package/.next/static/{pW5SAQ1dzPcsq_66yy5po → uTm9pVsF7AuRLSQKZwTWp}/_buildManifest.js +0 -0
- /package/.next/static/{pW5SAQ1dzPcsq_66yy5po → uTm9pVsF7AuRLSQKZwTWp}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{pW5SAQ1dzPcsq_66yy5po → uTm9pVsF7AuRLSQKZwTWp}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87090,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(22016),o=e.i(44355);function s(e){let t=new Set;for(let r of e)t.add(r);return t.size}function n(e,t){return`ck-wf-draft:${e}:${t}`}function i({teamId:e,workflowId:i,draft:l,llmTaskEnabled:d}){let c,x,m,p,u,h,g,v,b,[k,f]=(0,r.useState)("canvas"),[y,w]=(0,r.useState)(!1),[j,N]=(0,r.useState)({kind:"loading"}),[S,C]=(0,r.useState)(""),I=(0,r.useRef)(null),[A,T]=(0,r.useState)(!1),[$,M]=(0,r.useState)(1),L=(0,r.useRef)(null),[O,E]=(0,r.useState)(""),[B,R]=(0,r.useState)(null),[_,z]=(0,r.useState)({kind:"select"}),[U,W]=(0,r.useState)(""),[P,D]=(0,r.useState)([]),[J,F]=(0,r.useState)(""),[q,K]=(0,r.useState)([]),[Z,Y]=(0,r.useState)(""),V=(0,r.useMemo)(()=>/Tool not available:\s*gateway/i.test(String(Z||"")),[Z]),[H,X]=(0,r.useState)([]),[Q,G]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(""),[er,ea]=(0,r.useState)(""),[eo,es]=(0,r.useState)(!1),[en,ei]=(0,r.useState)(""),[el,ed]=(0,r.useState)({}),[ec,ex]=(0,r.useState)(!1),[em,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(""),[eg,ev]=(0,r.useState)(""),[eb,ek]=(0,r.useState)(""),[ef,ey]=(0,r.useState)("llm"),[ew,ej]=(0,r.useState)(""),[eN,eS]=(0,r.useState)(""),[eC,eI]=(0,r.useState)("");function eA(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function eT(e){if(!eA(e))return null;let t=eA(e.match)?e.match:null;if(!t)return null;let r=String(t.channel??"").trim();if(!r)return null;let a=String(e.agentId??"").trim(),o=String(t.accountId??"").trim(),s=eA(t.peer)?t.peer:null,n=s?String(s.kind??"").trim():"",i=s?String(s.id??"").trim():"",l=i||o;if(!l)return null;let d=a||(o?`${r}:account:${o}`:`${r}:${n}:${i}`),c=[r];return a&&c.push(a),o&&c.push(`account:${o}`),n&&i&&c.push(`${n}:${i}`),{id:d,label:c.join(" · "),channel:r,target:l}}(0,r.useEffect)(()=>{(async()=>{try{if(l){let t=sessionStorage.getItem(n(e,i));if(t)return void N({kind:"ready",jsonText:t});let r=JSON.stringify({schema:"clawkitchen.workflow.v1",id:i,name:"New workflow",timezone:"UTC",nodes:[{id:"start",type:"start",name:"start",x:80,y:80,config:{}},{id:"end",type:"end",name:"end",x:520,y:80,config:{}}],edges:[{id:"e1",from:"start",to:"end"}]},null,2)+"\n";N({kind:"ready",jsonText:r});try{sessionStorage.setItem(n(e,i),r)}catch{}return}let t=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(i)}`,{cache:"no-store"}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to load workflow");N({kind:"ready",jsonText:JSON.stringify(r.workflow,null,2)+"\n"})}catch(e){N({kind:"error",error:e instanceof Error?e.message:String(e)})}})()},[e,i,l]),(0,r.useEffect)(()=>{(async()=>{F("");try{let t=await fetch("/api/agents",{cache:"no-store"}),r=await t.json();if(!t.ok)throw Error(r.error||r.message||"Failed to load agents");let a=(Array.isArray(r.agents)?r.agents:[]).map(e=>({id:String(e.id??"").trim(),identityName:"string"==typeof e.identityName?e.identityName:void 0})).filter(t=>t.id&&t.id.startsWith(`${e}-`));D(a)}catch(e){F(e instanceof Error?e.message:String(e)),D([])}})()},[e]),(0,r.useEffect)(()=>{(async()=>{Y("");try{let e=await fetch("/api/channels/bindings",{cache:"no-store"}),t=await e.json();if(!e.ok||!1===t.ok)throw Error(t.error||"Failed to load bindings");let r=(Array.isArray(t.bindings)?t.bindings:[]).map(eT).filter(Boolean);K(r)}catch(e){Y(e instanceof Error?e.message:String(e)),K([])}})()},[]);let e$=(0,r.useCallback)(async()=>{ei(""),es(!0);try{let e=await fetch("/api/cron/jobs",{cache:"no-store"}),t=await e.json();if(!e.ok||!1===t.ok)throw Error(t.error||"Failed to load cron jobs");let r=Array.isArray(t.jobs)?t.jobs:[],a={};for(let e of r){if(!e||!e.enabled)continue;let t=String(e.agentId??"").trim();if(t){a[t]=!0;continue}if(e.scope&&"agent"===String(e.scope.kind)){let t=String(e.scope.id??"").trim();t&&(a[t]=!0)}}return ed(a),a}catch(e){return ei(e instanceof Error?e.message:String(e)),ed({}),{}}finally{es(!1)}},[]);(0,r.useEffect)(()=>{e$()},[e$]);let eM=(0,r.useMemo)(()=>{if("ready"!==j.kind)return{wf:null,err:""};try{return{wf:JSON.parse(j.jsonText),err:""}}catch(e){return{wf:null,err:e instanceof Error?e.message:String(e)}}},[j]),eL=(0,r.useMemo)(()=>eM.wf?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:[],o=Array.isArray(e.edges)?e.edges:[],n=Array.isArray(e.triggers)?e.triggers:[],i=a.map(e=>String(e?.id??"").trim()).filter(Boolean);i.length!==a.length&&t.push("all nodes must have a non-empty id"),s(i)!==i.length&&t.push("node ids must be unique");let l=o.map(e=>String(e?.id??"").trim()).filter(Boolean);l.length!==o.length&&t.push("all edges must have a non-empty id"),s(l)!==l.length&&t.push("edge ids must be unique");let d=new Set(i);for(let e of o){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}d.has(r)||t.push(`edge ${String(e.id)} references missing from node: ${r}`),d.has(a)||t.push(`edge ${String(e.id)} references missing to node: ${a}`)}let c=a.filter(e=>"start"===e.type),x=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)"),x.length||r.push("no end node found"),n))if("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`);let a=e.tz?String(e.tz).trim():"";a&&"UTC"!==a&&!a.includes("/")&&r.push(`cron trigger ${String(e.id)} tz doesn't look like an IANA timezone: ${String(e.tz)}`)}let m=e.meta&&"object"==typeof e.meta&&!Array.isArray(e.meta)?e.meta:{},p=String(m.approvalTarget??"").trim();for(let e of a){if("human_approval"!==e.type)continue;let t=e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},a=String(t.target??t.chatId??"").trim(),o=String(t.provider??t.channel??"").trim();a||p||r.push(`human_approval node ${String(e.id)} has no target (set node.config.target or workflow.meta.approvalTarget)`),!a||o||String(m.approvalProvider??"").trim()||r.push(`human_approval node ${String(e.id)} has a target but no provider (set node.config.provider or workflow.meta.approvalProvider)`)}return{errors:t,warnings:r}}(eM.wf):{errors:[],warnings:[]},[eM.wf]),eO=(0,r.useMemo)(()=>{let e=eM.wf;if(!e)return{missingAgentOnNodeIds:[],requiredAgentIds:[],agentIdsMissingCron:[],ok:!0};let t=(e.nodes??[]).filter(e=>"start"!==e.type&&"end"!==e.type&&"human_approval"!==e.type),r=t.filter(e=>!String((e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{}).agentId??"").trim()).map(e=>e.id),a=Array.from(new Set(t.map(e=>String((e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{}).agentId??"").trim()).filter(Boolean))),o=a.filter(e=>!el[e]),s=0===r.length&&0===o.length;return{missingAgentOnNodeIds:r,requiredAgentIds:a,agentIdsMissingCron:o,ok:s}},[eM.wf,el]);function eE(t){let r=JSON.stringify(t,null,2)+"\n";if(N({kind:"ready",jsonText:r}),l)try{sessionStorage.setItem(n(e,i),r)}catch{}}async function eB(){if("ready"===j.kind&&eM.wf&&!eM.err&&!eL.errors.length){w(!0),C("");try{let t=await fetch("/api/teams/workflows",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflow:eM.wf})}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to save workflow");try{sessionStorage.removeItem(n(e,i))}catch{}}catch(e){C(e instanceof Error?e.message:String(e))}finally{w(!1)}}}if("loading"===j.kind)return(0,t.jsx)("div",{className:"ck-glass w-full p-6",children:"Loading…"});if("error"===j.kind)return(0,t.jsx)("div",{className:"ck-glass w-full p-6",children:j.error});let eR=!1===d?(0,t.jsxs)("div",{className:"mx-3 mb-3 rounded-[var(--ck-radius-sm)] border border-amber-500/30 bg-amber-500/10 p-3 text-sm",children:[(0,t.jsx)("div",{className:"font-medium text-amber-200",children:"LLM support is not enabled"}),(0,t.jsxs)("div",{className:"mt-1 text-[color:var(--ck-text-secondary)]",children:["Workflow LLM nodes require the optional built-in ",(0,t.jsx)("code",{className:"px-1",children:"llm-task"})," plugin."]}),(0,t.jsxs)("div",{className:"mt-2 text-[color:var(--ck-text-secondary)]",children:["Enable it with: ",(0,t.jsx)("code",{className:"px-1",children:"openclaw plugins enable llm-task"})," then run"," ",(0,t.jsx)("code",{className:"px-1",children:"openclaw gateway restart"}),"."]})]}):null;return(0,t.jsxs)("div",{className:"flex h-full min-h-0 w-full flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("a",{href:`/teams/${encodeURIComponent(e)}?tab=workflows`,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:"Back"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"truncate text-base font-medium text-[color:var(--ck-text-primary)]",children:[i,".workflow.json"]}),(0,t.jsxs)("div",{className:"mt-0.5 text-sm text-[color:var(--ck-text-tertiary)]",children:["Team: ",e]})]})]}),(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:()=>f("canvas"),className:"canvas"===k?"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:()=>f("json"),className:"json"===k?"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:I,type:"file",accept:"application/json,.json",className:"hidden",onChange:async t=>{let r=t.target.files?.[0];if(t.target.value="",r){C("");try{let t=await r.text(),a=JSON.parse(t);if(N({kind:"ready",jsonText:JSON.stringify(a,null,2)+"\n"}),l)try{sessionStorage.setItem(n(e,i),JSON.stringify(a,null,2)+"\n")}catch{}}catch(e){C(e instanceof Error?e.message:String(e))}}}}),(0,t.jsx)("button",{type:"button",disabled:y,onClick:()=>I.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:!eM.wf||!!eM.err||eL.errors.length>0,onClick:function(){if(!eM.wf||eM.err||eL.errors.length)return;let e=`${eM.wf.id||i}.workflow.json`,t=new Blob([JSON.stringify(eM.wf,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)},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",{type:"button",disabled:y||!eM.wf||!!eM.err||eL.errors.length>0,onClick:eB,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:y?"Saving…":"Save"})]})]}),eR,eM.err?(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: ",eM.err]}):null,!eM.err&&eL.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:eL.errors.map(e=>(0,t.jsx)("li",{children:e},e))})]}):null,eM.err||eL.errors.length||!eL.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:eL.warnings.map(e=>(0,t.jsx)("li",{children:e},e))})]}),S?(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:S}):null,(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 gap-0",children:["json"===k?(0,t.jsx)("textarea",{value:j.jsonText,onChange:t=>{let r=t.target.value;if(N({kind:"ready",jsonText:r}),l)try{sessionStorage.setItem(n(e,i),r)}catch{}},className:"h-full min-h-0 w-full flex-1 resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]"}):(0,t.jsx)("div",{ref:L,className:"relative h-full min-h-0 w-full flex-1 overflow-auto bg-black/20",onWheel:e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let t=e.deltaY>0?-1:1;M(e=>Math.max(.5,Math.min(2.5,Math.round((e+.1*t)*10)/10)))},onClick:e=>{if("add-node"!==_.kind)return;let t=eM.wf;if(!t)return;let r=L.current;if(!r)return;let a=e.target;if(a&&a.closest("[data-wf-node='1']"))return;let o=r.getBoundingClientRect(),s=(e.clientX-o.left+r.scrollLeft)/$,n=(e.clientY-o.top+r.scrollTop)/$,i=_.nodeType.replace(/[^a-z0-9_\-]/gi,"_"),l=new Set(t.nodes.map(e=>e.id)),d=1,c=`${i}_${d}`;for(;l.has(c);)d++,c=`${i}_${d}`;let x=Math.max(0,s-90),m=Math.max(0,n-24),p={id:c,type:_.nodeType,name:c,x,y:m,config:{}};eE({...t,nodes:[...t.nodes,p]}),E(c),z({kind:"select"})},children:(0,t.jsxs)("div",{className:"relative",style:{width:2200*$,height:1200*$},children:[(0,t.jsxs)("div",{className:A?"absolute left-3 top-3 z-20 w-[44px] overflow-hidden rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/40 p-2 backdrop-blur":"absolute left-3 top-3 z-20 w-[260px] rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/40 p-2 backdrop-blur",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:A?"hidden":"text-[10px] font-medium uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"Tools"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:A?"hidden":"flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>M(e=>Math.max(.5,Math.round((e-.1)*10)/10)),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Zoom out (Ctrl/Cmd+wheel)",children:"-"}),(0,t.jsxs)("div",{className:"min-w-[42px] text-center text-[10px] text-[color:var(--ck-text-tertiary)]",children:[Math.round(100*$),"%"]}),(0,t.jsx)("button",{type:"button",onClick:()=>M(e=>Math.min(2.5,Math.round((e+.1)*10)/10)),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Zoom in (Ctrl/Cmd+wheel)",children:"+"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>T(e=>!e),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:A?"Expand":"Collapse",children:A?">":"<"})]})]}),A?(0,t.jsx)("div",{className:"mt-2 flex flex-col items-center gap-2",children:[{key:"select",label:"Select",active:"select"===_.kind,onClick:()=>{z({kind:"select"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M5 4l7 16 2-7 7-2L5 4Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})})},{key:"connect",label:"Connect",active:"connect"===_.kind,onClick:()=>{z(e=>"connect"===e.kind?{kind:"select"}:{kind:"connect"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M10 13a5 5 0 0 1 0-7l1.2-1.2a5 5 0 0 1 7 7L17 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M14 11a5 5 0 0 1 0 7L12.8 19.2a5 5 0 1 1-7-7L7 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})},{key:"llm",label:"LLM",active:"add-node"===_.kind&&"llm"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"llm"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M12 2l1.5 6.5L20 10l-6.5 1.5L12 18l-1.5-6.5L4 10l6.5-1.5L12 2Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})})},{key:"tool",label:"Tool",active:"add-node"===_.kind&&"tool"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"tool"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M14.5 7.5l2 2-8.5 8.5H6v-2l8.5-8.5Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M12 6a4 4 0 0 0-5 5l3-3 2 2 3-3A4 4 0 0 0 12 6Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})},{key:"condition",label:"If",active:"add-node"===_.kind&&"condition"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"condition"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7 4v7a3 3 0 0 0 3 3h7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M17 10l3 3-3 3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})},{key:"delay",label:"Delay",active:"add-node"===_.kind&&"delay"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"delay"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 7v5l3 2",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 1 1-9-9",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})},{key:"approval",label:"Approval",active:"add-node"===_.kind&&"human_approval"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"human_approval"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})},{key:"end",label:"End",active:"add-node"===_.kind&&"end"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"end"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M7 7h10v10H7V7Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})})}].map(e=>(0,t.jsx)("button",{type:"button",onClick:e.onClick,className:e.active?"flex h-8 w-8 items-center justify-center rounded-[var(--ck-radius-sm)] bg-white/10 text-[color:var(--ck-text-primary)]":"flex h-8 w-8 items-center justify-center rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:e.label,"aria-label":e.label,children:e.icon},e.key))}):(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{z({kind:"select"}),W("")},className:"select"===_.kind?"rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]":"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",children:"Select"}),(0,t.jsx)("button",{type:"button",onClick:()=>{z({kind:"connect"}),W("")},className:"connect"===_.kind?"rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]":"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Click a node, then click another node to create an edge",children:"Connect"}),[{t:"llm",label:"LLM"},{t:"tool",label:"Tool"},{t:"condition",label:"If"},{t:"delay",label:"Delay"},{t:"human_approval",label:"Approve"},{t:"end",label:"End"}].map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{z({kind:"add-node",nodeType:e.t}),W("")},className:"add-node"===_.kind&&_.nodeType===e.t?"rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]":"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Select tool, then click on the canvas to place",children:["+ ",e.label]},e.t))]}),!A&&"connect"===_.kind&&U?(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-secondary)]",children:["Connecting from: ",(0,t.jsx)("span",{className:"font-mono",children:U})]}):null,A||"add-node"!==_.kind?null:(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-secondary)]",children:["Click on the canvas to place a ",(0,t.jsx)("span",{className:"font-mono",children:_.nodeType})," node."]}),(0,t.jsxs)("div",{className:"mt-3 border-t border-white/10 pt-3",children:[(0,t.jsxs)("div",{className:A?"hidden":"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"Agents"}),(0,t.jsx)("div",{className:"text-[10px] text-[color:var(--ck-text-tertiary)]",children:"drag → node"})]}),A?(0,t.jsx)("button",{type:"button",onClick:()=>T(!1),className:"mt-2 flex h-8 w-8 items-center justify-center rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Expand to see agents","aria-label":"Expand to see agents",children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M16 11a4 4 0 1 0-8 0",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M4 20a8 8 0 0 1 16 0",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}):(0,t.jsxs)(t.Fragment,{children:[J?(0,t.jsx)("div",{className:"mt-1 text-[11px] text-red-200",children:J}):null,(0,t.jsx)("div",{className:"mt-2 max-h-[140px] space-y-1 overflow-auto",children:P.length?P.map(r=>(0,t.jsx)("div",{draggable:!0,onDragStart:e=>{e.dataTransfer.setData("text/plain",r.id),e.dataTransfer.effectAllowed="copy"},className:"cursor-grab rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:r.id,children:r.identityName?r.identityName:r.id.replace(`${e}-`,"")},r.id)):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"No team agents found."})})]})]})]}),(0,t.jsxs)("div",{className:"relative h-[1200px] w-[2200px]",style:{transform:`scale(${$})`,transformOrigin:"0 0"},children:[(0,t.jsx)("svg",{className:"pointer-events-none absolute inset-0 -z-10",width:2200,height:1200,style:{overflow:"visible"},children:(eM.wf?.edges??[]).map(e=>{let r=eM.wf;if(!r)return null;let a=r.nodes.find(t=>t.id===e.from),o=r.nodes.find(t=>t.id===e.to);if(!a||!o)return null;let s=("number"==typeof a.x?a.x:80)+90,n=("number"==typeof a.y?a.y:80)+24,i=("number"==typeof o.x?o.x:80)+90,l=("number"==typeof o.y?o.y:80)+24;return(0,t.jsx)("line",{x1:s,y1:n,x2:i,y2:l,stroke:"rgba(255,255,255,0.35)",strokeWidth:3},e.id)})}),(eM.wf?.nodes??[]).map((r,a)=>{let o="number"==typeof r.x?r.x:80+220*a,s="number"==typeof r.y?r.y:80,n=O===r.id;return(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-wf-node":"1",draggable:"select"===_.kind||"connect"===_.kind,onDragStart:e=>{"select"===_.kind&&e.dataTransfer.setData("text/plain","")},onDragOver:e=>{e.dataTransfer.types.includes("text/plain")&&e.preventDefault()},onDrop:e=>{let t=eM.wf;if(!t)return;e.preventDefault(),e.stopPropagation();let a=String(e.dataTransfer.getData("text/plain")||"").trim();if(!a)return;let o=t.nodes.map(e=>{if(e.id!==r.id)return e;let t=e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{};return{...e,config:{...t,agentId:a}}});eE({...t,nodes:o}),E(r.id)},onClick:e=>{e.stopPropagation();let t=eM.wf;if("connect"===_.kind){if(!t)return;if(!U){W(r.id),E(r.id);return}let e=r.id;if(W(""),!U||!e||U===e||(t.edges??[]).some(t=>t.from===U&&t.to===e))return;let a=`e${Date.now()}`;eE({...t,edges:[...t.edges??[],{id:a,from:U,to:e}]}),z({kind:"select"});return}E(r.id)},onPointerDown:e=>{if("add-node"===_.kind||0!==e.button)return;let t=L.current;if(!t)return;let a=t.getBoundingClientRect();E(r.id);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}e.preventDefault();let n=(e.clientX-a.left+t.scrollLeft)/$,i=(e.clientY-a.top+t.scrollTop)/$;R({nodeId:r.id,dx:n-o,dy:i-s})},onPointerUp:e=>{try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}R(null)},onPointerMove:e=>{if(!B||B.nodeId!==r.id)return;let t=eM.wf;if(!t)return;let a=L.current;if(!a)return;let o=a.getBoundingClientRect(),s=(e.clientX-o.left+a.scrollLeft)/$,n=(e.clientY-o.top+a.scrollTop)/$,i=s-B.dx,l=n-B.dy,d=t.nodes.map(e=>e.id===r.id?{...e,x:i,y:l}:e);N({kind:"ready",jsonText:JSON.stringify({...t,nodes:d},null,2)+"\n"})},className:n?"absolute z-10 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 z-10 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:o,top:s,width:180},children:[(0,t.jsx)("div",{className:"font-medium text-[color:var(--ck-text-primary)]",children:r.name||r.id}),(0,t.jsx)("div",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:r.type}),(()=>{let a=r.config&&"object"==typeof r.config&&!Array.isArray(r.config)?r.config:null,o=a?String(a.agentId??"").trim():"";if(!o)return null;let s=o.replace(`${e}-`,"");return(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-secondary)]",children:["Agent: ",s]})})()]},r.id)}),(()=>{let e=eM.wf;if(!e||!O)return null;let r=e.nodes.find(e=>e.id===O);if(!r)return null;let a="number"==typeof r.x?r.x:80,o="number"==typeof r.y?r.y:80,s=r.config&&"object"==typeof r.config&&!Array.isArray(r.config)?r.config:{},n=String(s.agentId??"").trim();return(0,t.jsxs)("div",{className:"absolute z-10 w-[320px] rounded-[var(--ck-radius-sm)] border border-white/15 bg-black/60 p-3 shadow-[var(--ck-shadow-1)] backdrop-blur",style:{left:a+200,top:o},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-primary)]",children:r.name||r.id}),(0,t.jsx)("button",{type:"button",onClick:()=>E(""),className:"text-[10px] text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]",children:"Close"})]}),(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:"name"}),(0,t.jsx)("input",{value:String(r.name??""),onChange:t=>{let a=t.target.value;eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,name:a}:e)})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 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:r.type,onChange:t=>{let a=t.target.value;eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,type:a}:e)})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 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)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"agentId"}),(0,t.jsx)("input",{value:n,onChange:t=>{let a=String(t.target.value||"").trim(),o={...s,...a?{agentId:a}:{}};a||delete o.agentId,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"(drag an agent onto the node or type)"})]}),"human_approval"===r.type?(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"approval config"}),(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:String(s.provider??""),onChange:t=>{let a=String(t.target.value||"").trim(),o={...s,...a?{provider:a}:{}};a||delete o.provider,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},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:String(s.target??""),onChange:t=>{let a=String(t.target.value||"").trim(),o={...s,...a?{target:a}:{}};a||delete o.target,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},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:"Overrides workflow-level default when set."})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"messageTemplate (optional)"}),(0,t.jsx)("textarea",{value:String(s.messageTemplate??""),onChange:t=>{let a=String(t.target.value||""),o={...s,...a.trim()?{messageTemplate:a}:{}};a.trim()||delete o.messageTemplate,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},className:"mt-1 h-[70px] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 font-mono text-[10px] text-[color:var(--ck-text-primary)]",placeholder:"Approval needed for {{workflowName}} (run {{runId}})",spellCheck:!1}),(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:["Vars: ","{{workflowName}}",", ","{{workflowId}}",", ","{{runId}}",", ","{{nodeId}}"]})]})]})]}):null,(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"config (json)"}),(0,t.jsx)("textarea",{value:JSON.stringify(s,null,2),onChange:t=>{try{let a=JSON.parse(t.target.value);if(!a||"object"!=typeof a||Array.isArray(a))return;eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:a}:e)})}catch{}},className:"mt-1 h-[140px] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 p-2 font-mono text-[10px] text-[color:var(--ck-text-primary)]",spellCheck:!1}),(0,t.jsx)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:"(Edits apply when JSON is valid.)"})]})]})]})})()]})]})}),(0,t.jsx)("div",{className:"w-[380px] shrink-0 overflow-auto p-3 text-sm",children:(0,t.jsx)("div",{className:"space-y-3",children:eM.wf?(x=String((c=eM.wf).timezone??"").trim()||"UTC",m=c.triggers??[],u=String((p=c.meta&&"object"==typeof c.meta&&!Array.isArray(c.meta)?c.meta:{}).approvalBindingId??"").trim(),h=String(p.approvalProvider??"telegram").trim()||"telegram",g=String(p.approvalTarget??"").trim(),v=[{label:"(no preset)",expr:""},{label:"Weekdays 09:00 local",expr:"0 9 * * 1-5"},{label:"Mon/Wed/Fri 09:00 local",expr:"0 9 * * 1,3,5"},{label:"Daily 08:00 local",expr:"0 8 * * *"},{label:"Daily 12:00 local",expr:"0 12 * * *"},{label:"Mon 09:30 local",expr:"30 9 * * 1"}],(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Workflow"}),(0,t.jsx)("div",{className:"px-3 pb-3",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[11px] font-medium text-[color:var(--ck-text-tertiary)]",children:"Timezone"}),(0,t.jsx)("input",{value:x,onChange:e=>{let t=String(e.target.value||"").trim()||"UTC";eE({...c,timezone:t})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-sm text-[color:var(--ck-text-primary)]",placeholder:"America/New_York"})]})})]}),(0,t.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Approval Channel"}),(0,t.jsxs)("div",{className:"px-3 pb-3 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:"binding (recommended)"}),(0,t.jsxs)("select",{value:u,onChange:e=>{let t=String(e.target.value||"").trim(),r=q.find(e=>e.id===t);r?eE({...c,meta:{...p,approvalBindingId:r.id,approvalProvider:r.channel,approvalTarget:r.target},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:r.id,provider:r.channel,target:r.target}}:e)}):eE({...c,meta:{...p,approvalBindingId:""},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:""}}:e)})},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:"(manual)"}),q.map(e=>(0,t.jsx)("option",{value:e.id,children:e.label},e.id))]}),V?(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-yellow-200",children:["Kitchen looks out of date. Run ",(0,t.jsx)("code",{className:"font-mono",children:"openclaw plugins update"})," then",(0,t.jsx)("code",{className:"ml-1 font-mono",children:"openclaw gateway restart"}),"."]}):null,Z?(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-red-200",children:["Failed to load bindings: ",Z]}):null,(0,t.jsx)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:"Uses your existing OpenClaw bindings (recommended). Manual provider/target is an advanced override."})]}),(0,t.jsxs)("details",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-secondary)]",children:"Advanced: manual override"}),(0,t.jsxs)("div",{className:"px-2 pb-2 pt-1 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";eE({...c,meta:{...p,approvalBindingId:"",approvalProvider:t},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:"",provider:t}}:e)})},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:g,onChange:e=>{let t=String(e.target.value||"").trim();eE({...c,meta:{...p,approvalBindingId:"",approvalTarget:t},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:"",target:t}}:e)})},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.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Triggers"}),(0,t.jsxs)("div",{className:"px-3 pb-3",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()}`;eE({...c,triggers:[...m,{kind:"cron",id:e,name:"New trigger",enabled:!0,expr:"0 9 * * 1-5",tz:x}]})},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:m.length?m.map((e,r)=>{let a=e.kind,o=String(e.id??""),s=String(e.name??""),n=!!e.enabled,i=String(e.expr??""),l=String(e.tz??x),d=i.trim().split(/\s+/).filter(Boolean),p=!i.trim()||5===d.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:s||o||`trigger-${r+1}`}),(0,t.jsx)("button",{type:"button",onClick:()=>eE({...c,triggers:m.filter((e,t)=>t!==r)}),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:n,onChange:e=>{let t=e.target.checked;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,enabled:t}:e)})}}),"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:s,onChange:e=>{let t=e.target.value;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,name:t}:e)})},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:i,onChange:e=>{let t=e.target.value;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,expr:t}:e)})},className:p?"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"}),p?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 ",d.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===i)?i:"",onChange:e=>{let t=e.target.value;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,expr:t}:e)})},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:l,onChange:e=>{let t=String(e.target.value||"").trim()||x;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,tz:t}:e)})},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:x})]})]})]},`${o}-${r}`)}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"No triggers yet."})})]})]}),(0,t.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Runs"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Runs (history)"}),(0,t.jsx)(a.default,{href:`/teams/${encodeURIComponent(e)}/runs`,className:"text-[10px] font-medium text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-secondary)] hover:underline",children:"View all →"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:y,onClick:async()=>{let t=String(c.id??"").trim();if(t){et(""),G(!0);try{let r=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,mode:"enqueue"})}),a=await r.json();if(!r.ok||!a.ok)throw Error(a.error||"Failed to enqueue run");let o=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"}),s=await o.json();if(!o.ok||!s.ok)throw Error(s.error||"Failed to refresh runs");let n=(Array.isArray(s.files)?s.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);X(n)}catch(e){et(e instanceof Error?e.message:String(e))}finally{G(!1)}}},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:"+ Queue run"}),(0,t.jsx)("button",{type:"button",disabled:y||eo||!eO.ok,onClick:async()=>{let t=String(c.id??"").trim();if(t){if(eO.missingAgentOnNodeIds.length)return void et("All nodes must be assigned to an agent.");if(eO.agentIdsMissingCron.length){ep(!0),eh("");try{let t=await fetch("/api/cron/worker",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"reconcile",teamId:e})}),r=await t.json();if(!t.ok||!1===r.ok)throw Error(r.error||"Failed to reconcile worker crons");let a=await e$(),o=eO.requiredAgentIds.filter(e=>!a[e]);if(o.length)return void et(`Cron not set up for: ${o.join(", ")}`)}catch(e){et(e instanceof Error?e.message:String(e));return}finally{ep(!1)}}et(""),G(!0);try{let r=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,mode:"run_now"})}),a=await r.json();if(!r.ok||!a.ok)throw Error(a.error||"Failed to create run");let o=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"}),s=await o.json();if(!o.ok||!s.ok)throw Error(s.error||"Failed to refresh runs");let n=(Array.isArray(s.files)?s.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);X(n)}catch(e){et(e instanceof Error?e.message:String(e))}finally{G(!1)}}},className:"rounded-[var(--ck-radius-sm)] border border-emerald-400/30 bg-emerald-500/10 px-2 py-1 text-[10px] font-medium text-emerald-50 hover:bg-emerald-500/15 disabled:opacity-50",title:"Enqueue a run for the workflow runner (Kitchen does not execute nodes)",children:"+ Run now"}),en?(0,t.jsx)("div",{className:"ml-2 text-[10px] text-amber-100/90",title:en,children:"Cron check unavailable"}):null]})]}),eO.missingAgentOnNodeIds.length?(0,t.jsxs)("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:["All nodes must be assigned to an agent. Missing agentId on: ",eO.missingAgentOnNodeIds.join(", ")]}):eO.agentIdsMissingCron.length?(0,t.jsxs)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-amber-400/30 bg-amber-500/10 p-2 text-xs text-amber-50",children:[(0,t.jsxs)("div",{children:["Cron not set up for: ",eO.agentIdsMissingCron.join(", ")]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{eh(""),ex(!0)},className:"rounded-[var(--ck-radius-sm)] border border-amber-300/30 bg-amber-500/10 px-2 py-1 text-[10px] font-medium text-amber-50 hover:bg-amber-500/15",children:"Install worker cron(s)"}),(0,t.jsx)("button",{type:"button",onClick:()=>void 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:"Re-check"})]})]}):null,(0,t.jsx)(o.ConfirmationModal,{open:ec,title:"Install worker cron jobs?",busy:em,error:eu||void 0,confirmLabel:"Install",onClose:()=>{em||ex(!1)},onConfirm:async()=>{ep(!0),eh("");try{let t=await fetch("/api/cron/worker",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"reconcile",teamId:e})}),r=await t.json();if(!t.ok||!1===r.ok)throw Error(r.error||"Failed to install worker crons");await e$(),ex(!1)}catch(e){eh(e instanceof Error?e.message:String(e))}finally{ep(!1)}},children:(0,t.jsxs)("div",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:["Kitchen will install (or enable) worker cron jobs for the following agents so this workflow can drain:",(0,t.jsx)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 font-mono text-[11px] text-[color:var(--ck-text-primary)]",children:eO.agentIdsMissingCron.join(", ")}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["Cron cadence: 1 minute. The worker runs: ",(0,t.jsx)("span",{className:"font-mono",children:"openclaw recipes workflows worker-tick"}),"."]})]})}),ee?(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:ee}):null,(0,t.jsx)("div",{className:"mt-2 space-y-1",children:Q?(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"Loading runs…"}):H.length?H.slice(0,8).map(r=>{let o=String(c.id??"").trim(),s=String(r).replace(/\.run\.json$/i,""),n=er===s,i=o?`/teams/${encodeURIComponent(e)}/runs/${encodeURIComponent(o)}/${encodeURIComponent(s)}`:"#";return(0,t.jsx)(a.default,{href:i,onClick:()=>ea(s),className:n?"block w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-left text-[11px] font-mono text-[color:var(--ck-text-primary)]":"block w-full rounded-[var(--ck-radius-sm)] px-2 py-1 text-left text-[11px] font-mono text-[color:var(--ck-text-secondary)] hover:bg-white/5",title:"Open run detail",children:s},r)}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"No runs yet."})}),(0,t.jsxs)("details",{open:!0,className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Nodes"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(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:eg,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)]",placeholder:"e.g. draft_assets"})]}),(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:eb,onChange:e=>ek(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:ef,onChange:e=>ey(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(eg||"").trim().replace(/[^a-z0-9_\-]/gi,"_");if(!e||c.nodes.some(t=>t.id===e))return;let t=c.nodes.reduce((e,t)=>"number"==typeof t.x?Math.max(e,t.x):e,80),r={id:e,type:ef,name:String(eb||"").trim()||e,x:t+220,y:80};eE({...c,nodes:[...c.nodes,r]}),E(e),ev(""),ek("")},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:c.nodes.map(e=>{let r=O===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>E(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)("details",{open:!0,className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Edges"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(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:ew,onChange:e=>ej(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)"}),c.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:eN,onChange:e=>eS(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)"}),c.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:eC,onChange:e=>eI(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(ew||"").trim(),t=String(eN||"").trim();if(!e||!t||e===t)return;let r={id:`e${Date.now()}`,from:e,to:t,...String(eC||"").trim()?{label:String(eC).trim()}:{}};eE({...c,edges:[...c.edges??[],r]}),eI("")},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:(c.edges??[]).length?(c.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:()=>eE({...c,edges:(c.edges??[]).filter(t=>t.id!==e.id)}),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)("details",{open:!0,className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Node inspector"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-2",children:O?(0,t.jsx)("button",{type:"button",onClick:()=>{let e=c.nodes.filter(e=>e.id!==O),t=(c.edges??[]).filter(e=>e.from!==O&&e.to!==O);eE({...c,nodes:e,edges:t}),E("")},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}),O?(b=c.nodes.find(e=>e.id===O))?(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:b.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(b.name??""),onChange:e=>{let t=e.target.value;eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,name:t}:e)})},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:b.type,onChange:e=>{let t=e.target.value;eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,type:t}:e)})},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 b.x?b.x:0,onChange:e=>{let t=Number(e.target.value);eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,x:t}:e)})},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 b.y?b.y:0,onChange:e=>{let t=Number(e.target.value);eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,y:t}:e)})},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(b.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."})]})]})]})]})]})):null})})]})]})}e.s(["default",()=>i],87090)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87090,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(22016),o=e.i(44355);function s(e){let t=new Set;for(let r of e)t.add(r);return t.size}function n(e,t){return`ck-wf-draft:${e}:${t}`}function i({teamId:e,workflowId:i,draft:l,llmTaskEnabled:d}){let c,x,m,p,u,h,g,v,b,[k,f]=(0,r.useState)("canvas"),[y,w]=(0,r.useState)(!1),[j,N]=(0,r.useState)({kind:"loading"}),[S,C]=(0,r.useState)(""),I=(0,r.useRef)(null),[A,T]=(0,r.useState)(!1),[$,M]=(0,r.useState)(1),L=(0,r.useRef)(null),[O,E]=(0,r.useState)(""),[B,R]=(0,r.useState)(null),[_,z]=(0,r.useState)({kind:"select"}),[U,W]=(0,r.useState)(""),[P,D]=(0,r.useState)([]),[J,F]=(0,r.useState)(""),[q,K]=(0,r.useState)([]),[Z,Y]=(0,r.useState)(""),V=(0,r.useMemo)(()=>/Tool not available:\s*gateway/i.test(String(Z||"")),[Z]),[H,X]=(0,r.useState)([]),[Q,G]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(""),[er,ea]=(0,r.useState)(""),[eo,es]=(0,r.useState)(!1),[en,ei]=(0,r.useState)(""),[el,ed]=(0,r.useState)({}),[ec,ex]=(0,r.useState)(!1),[em,ep]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(""),[eg,ev]=(0,r.useState)(""),[eb,ek]=(0,r.useState)(""),[ef,ey]=(0,r.useState)("llm"),[ew,ej]=(0,r.useState)(""),[eN,eS]=(0,r.useState)(""),[eC,eI]=(0,r.useState)("");function eA(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function eT(e){if(!eA(e))return null;let t=eA(e.match)?e.match:null;if(!t)return null;let r=String(t.channel??"").trim();if(!r)return null;let a=String(e.agentId??"").trim(),o=String(t.accountId??"").trim(),s=eA(t.peer)?t.peer:null,n=s?String(s.kind??"").trim():"",i=s?String(s.id??"").trim():"",l=i||o;if(!l)return null;let d=a||(o?`${r}:account:${o}`:`${r}:${n}:${i}`),c=[r];return a&&c.push(a),o&&c.push(`account:${o}`),n&&i&&c.push(`${n}:${i}`),{id:d,label:c.join(" · "),channel:r,target:l}}(0,r.useEffect)(()=>{(async()=>{try{if(l){let t=sessionStorage.getItem(n(e,i));if(t)return void N({kind:"ready",jsonText:t});let r=JSON.stringify({schema:"clawkitchen.workflow.v1",id:i,name:"New workflow",timezone:"UTC",nodes:[{id:"start",type:"start",name:"start",x:80,y:80,config:{}},{id:"end",type:"end",name:"end",x:520,y:80,config:{}}],edges:[{id:"e1",from:"start",to:"end"}]},null,2)+"\n";N({kind:"ready",jsonText:r});try{sessionStorage.setItem(n(e,i),r)}catch{}return}let t=await fetch(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(i)}`,{cache:"no-store"}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to load workflow");N({kind:"ready",jsonText:JSON.stringify(r.workflow,null,2)+"\n"})}catch(e){N({kind:"error",error:e instanceof Error?e.message:String(e)})}})()},[e,i,l]),(0,r.useEffect)(()=>{(async()=>{F("");try{let t=await fetch("/api/agents",{cache:"no-store"}),r=await t.json();if(!t.ok)throw Error(r.error||r.message||"Failed to load agents");let a=(Array.isArray(r.agents)?r.agents:[]).map(e=>({id:String(e.id??"").trim(),identityName:"string"==typeof e.identityName?e.identityName:void 0})).filter(t=>t.id&&t.id.startsWith(`${e}-`));D(a)}catch(e){F(e instanceof Error?e.message:String(e)),D([])}})()},[e]),(0,r.useEffect)(()=>{(async()=>{Y("");try{let e=await fetch("/api/channels/bindings",{cache:"no-store"}),t=await e.json();if(!e.ok||!1===t.ok)throw Error(t.error||"Failed to load bindings");let r=(Array.isArray(t.bindings)?t.bindings:[]).map(eT).filter(Boolean);K(r)}catch(e){Y(e instanceof Error?e.message:String(e)),K([])}})()},[]);let e$=(0,r.useCallback)(async()=>{ei(""),es(!0);try{let e=await fetch("/api/cron/jobs",{cache:"no-store"}),t=await e.json();if(!e.ok||!1===t.ok)throw Error(t.error||"Failed to load cron jobs");let r=Array.isArray(t.jobs)?t.jobs:[],a={};for(let e of r){if(!e||!e.enabled)continue;let t=String(e.agentId??"").trim();if(t){a[t]=!0;continue}if(e.scope&&"agent"===String(e.scope.kind)){let t=String(e.scope.id??"").trim();t&&(a[t]=!0)}}return ed(a),a}catch(e){return ei(e instanceof Error?e.message:String(e)),ed({}),{}}finally{es(!1)}},[]);(0,r.useEffect)(()=>{e$()},[e$]);let eM=(0,r.useMemo)(()=>{if("ready"!==j.kind)return{wf:null,err:""};try{return{wf:JSON.parse(j.jsonText),err:""}}catch(e){return{wf:null,err:e instanceof Error?e.message:String(e)}}},[j]),eL=(0,r.useMemo)(()=>eM.wf?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:[],o=Array.isArray(e.edges)?e.edges:[],n=Array.isArray(e.triggers)?e.triggers:[],i=a.map(e=>String(e?.id??"").trim()).filter(Boolean);i.length!==a.length&&t.push("all nodes must have a non-empty id"),s(i)!==i.length&&t.push("node ids must be unique");let l=o.map(e=>String(e?.id??"").trim()).filter(Boolean);l.length!==o.length&&t.push("all edges must have a non-empty id"),s(l)!==l.length&&t.push("edge ids must be unique");let d=new Set(i);for(let e of o){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}d.has(r)||t.push(`edge ${String(e.id)} references missing from node: ${r}`),d.has(a)||t.push(`edge ${String(e.id)} references missing to node: ${a}`)}let c=a.filter(e=>"start"===e.type),x=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)"),x.length||r.push("no end node found"),n))if("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`);let a=e.tz?String(e.tz).trim():"";a&&"UTC"!==a&&!a.includes("/")&&r.push(`cron trigger ${String(e.id)} tz doesn't look like an IANA timezone: ${String(e.tz)}`)}let m=e.meta&&"object"==typeof e.meta&&!Array.isArray(e.meta)?e.meta:{},p=String(m.approvalTarget??"").trim();for(let e of a){if("human_approval"!==e.type)continue;let t=e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},a=String(t.target??t.chatId??"").trim(),o=String(t.provider??t.channel??"").trim();a||p||r.push(`human_approval node ${String(e.id)} has no target (set node.config.target or workflow.meta.approvalTarget)`),!a||o||String(m.approvalProvider??"").trim()||r.push(`human_approval node ${String(e.id)} has a target but no provider (set node.config.provider or workflow.meta.approvalProvider)`)}return{errors:t,warnings:r}}(eM.wf):{errors:[],warnings:[]},[eM.wf]),eO=(0,r.useMemo)(()=>{let e=eM.wf;if(!e)return{missingAgentOnNodeIds:[],requiredAgentIds:[],agentIdsMissingCron:[],ok:!0};let t=(e.nodes??[]).filter(e=>"start"!==e.type&&"end"!==e.type&&"human_approval"!==e.type),r=t.filter(e=>!String((e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{}).agentId??"").trim()).map(e=>e.id),a=Array.from(new Set(t.map(e=>String((e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{}).agentId??"").trim()).filter(Boolean))),o=a.filter(e=>!el[e]),s=0===r.length&&0===o.length;return{missingAgentOnNodeIds:r,requiredAgentIds:a,agentIdsMissingCron:o,ok:s}},[eM.wf,el]);function eE(t){let r=JSON.stringify(t,null,2)+"\n";if(N({kind:"ready",jsonText:r}),l)try{sessionStorage.setItem(n(e,i),r)}catch{}}async function eB(){if("ready"===j.kind&&eM.wf&&!eM.err&&!eL.errors.length){w(!0),C("");try{let t=await fetch("/api/teams/workflows",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflow:eM.wf})}),r=await t.json();if(!t.ok||!r.ok)throw Error(r.error||"Failed to save workflow");try{sessionStorage.removeItem(n(e,i))}catch{}}catch(e){C(e instanceof Error?e.message:String(e))}finally{w(!1)}}}if("loading"===j.kind)return(0,t.jsx)("div",{className:"ck-glass w-full p-6",children:"Loading…"});if("error"===j.kind)return(0,t.jsx)("div",{className:"ck-glass w-full p-6",children:j.error});let eR=!1===d?(0,t.jsxs)("div",{className:"mx-3 mb-3 rounded-[var(--ck-radius-sm)] border border-amber-500/30 bg-amber-500/10 p-3 text-sm",children:[(0,t.jsx)("div",{className:"font-medium text-amber-200",children:"LLM support is not enabled"}),(0,t.jsxs)("div",{className:"mt-1 text-[color:var(--ck-text-secondary)]",children:["Workflow LLM nodes require the optional built-in ",(0,t.jsx)("code",{className:"px-1",children:"llm-task"})," plugin."]}),(0,t.jsxs)("div",{className:"mt-2 text-[color:var(--ck-text-secondary)]",children:["Enable it with: ",(0,t.jsx)("code",{className:"px-1",children:"openclaw plugins enable llm-task"})," then run"," ",(0,t.jsx)("code",{className:"px-1",children:"openclaw gateway restart"}),"."]})]}):null;return(0,t.jsxs)("div",{className:"flex h-full min-h-0 w-full flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("a",{href:`/teams/${encodeURIComponent(e)}?tab=workflows`,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:"Back"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"truncate text-base font-medium text-[color:var(--ck-text-primary)]",children:[i,".workflow.json"]}),(0,t.jsxs)("div",{className:"mt-0.5 text-sm text-[color:var(--ck-text-tertiary)]",children:["Team: ",e]})]})]}),(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:()=>f("canvas"),className:"canvas"===k?"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:()=>f("json"),className:"json"===k?"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:I,type:"file",accept:"application/json,.json",className:"hidden",onChange:async t=>{let r=t.target.files?.[0];if(t.target.value="",r){C("");try{let t=await r.text(),a=JSON.parse(t);if(N({kind:"ready",jsonText:JSON.stringify(a,null,2)+"\n"}),l)try{sessionStorage.setItem(n(e,i),JSON.stringify(a,null,2)+"\n")}catch{}}catch(e){C(e instanceof Error?e.message:String(e))}}}}),(0,t.jsx)("button",{type:"button",disabled:y,onClick:()=>I.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:!eM.wf||!!eM.err||eL.errors.length>0,onClick:function(){if(!eM.wf||eM.err||eL.errors.length)return;let e=`${eM.wf.id||i}.workflow.json`,t=new Blob([JSON.stringify(eM.wf,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)},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",{type:"button",disabled:y||!eM.wf||!!eM.err||eL.errors.length>0,onClick:eB,className:"rounded-[var(--ck-radius-sm)] bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:y?"Saving…":"Save"})]})]}),eR,eM.err?(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: ",eM.err]}):null,!eM.err&&eL.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:eL.errors.map(e=>(0,t.jsx)("li",{children:e},e))})]}):null,eM.err||eL.errors.length||!eL.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:eL.warnings.map(e=>(0,t.jsx)("li",{children:e},e))})]}),S?(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:S}):null,(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 gap-0",children:["json"===k?(0,t.jsx)("textarea",{value:j.jsonText,onChange:t=>{let r=t.target.value;if(N({kind:"ready",jsonText:r}),l)try{sessionStorage.setItem(n(e,i),r)}catch{}},className:"h-full min-h-0 w-full flex-1 resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]"}):(0,t.jsx)("div",{ref:L,className:"relative h-full min-h-0 w-full flex-1 overflow-auto bg-black/20",onWheel:e=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let t=e.deltaY>0?-1:1;M(e=>Math.max(.5,Math.min(2.5,Math.round((e+.1*t)*10)/10)))},onClick:e=>{if("add-node"!==_.kind)return;let t=eM.wf;if(!t)return;let r=L.current;if(!r)return;let a=e.target;if(a&&a.closest("[data-wf-node='1']"))return;let o=r.getBoundingClientRect(),s=(e.clientX-o.left+r.scrollLeft)/$,n=(e.clientY-o.top+r.scrollTop)/$,i=_.nodeType.replace(/[^a-z0-9_\-]/gi,"_"),l=new Set(t.nodes.map(e=>e.id)),d=1,c=`${i}_${d}`;for(;l.has(c);)d++,c=`${i}_${d}`;let x=Math.max(0,s-90),m=Math.max(0,n-24),p={id:c,type:_.nodeType,name:c,x,y:m,config:{}};eE({...t,nodes:[...t.nodes,p]}),E(c),z({kind:"select"})},children:(0,t.jsxs)("div",{className:"relative",style:{width:2200*$,height:1200*$},children:[(0,t.jsxs)("div",{className:A?"absolute left-3 top-3 z-20 w-[44px] overflow-hidden rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/40 p-2 backdrop-blur":"absolute left-3 top-3 z-20 w-[260px] rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/40 p-2 backdrop-blur",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:A?"hidden":"text-[10px] font-medium uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"Tools"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:A?"hidden":"flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>M(e=>Math.max(.5,Math.round((e-.1)*10)/10)),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Zoom out (Ctrl/Cmd+wheel)",children:"-"}),(0,t.jsxs)("div",{className:"min-w-[42px] text-center text-[10px] text-[color:var(--ck-text-tertiary)]",children:[Math.round(100*$),"%"]}),(0,t.jsx)("button",{type:"button",onClick:()=>M(e=>Math.min(2.5,Math.round((e+.1)*10)/10)),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Zoom in (Ctrl/Cmd+wheel)",children:"+"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>T(e=>!e),className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-[10px] text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:A?"Expand":"Collapse",children:A?">":"<"})]})]}),A?(0,t.jsx)("div",{className:"mt-2 flex flex-col items-center gap-2",children:[{key:"select",label:"Select",active:"select"===_.kind,onClick:()=>{z({kind:"select"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M5 4l7 16 2-7 7-2L5 4Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})})},{key:"connect",label:"Connect",active:"connect"===_.kind,onClick:()=>{z(e=>"connect"===e.kind?{kind:"select"}:{kind:"connect"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M10 13a5 5 0 0 1 0-7l1.2-1.2a5 5 0 0 1 7 7L17 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M14 11a5 5 0 0 1 0 7L12.8 19.2a5 5 0 1 1-7-7L7 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})},{key:"llm",label:"LLM",active:"add-node"===_.kind&&"llm"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"llm"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M12 2l1.5 6.5L20 10l-6.5 1.5L12 18l-1.5-6.5L4 10l6.5-1.5L12 2Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})})},{key:"tool",label:"Tool",active:"add-node"===_.kind&&"tool"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"tool"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M14.5 7.5l2 2-8.5 8.5H6v-2l8.5-8.5Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M12 6a4 4 0 0 0-5 5l3-3 2 2 3-3A4 4 0 0 0 12 6Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})},{key:"condition",label:"If",active:"add-node"===_.kind&&"condition"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"condition"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7 4v7a3 3 0 0 0 3 3h7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M17 10l3 3-3 3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})},{key:"delay",label:"Delay",active:"add-node"===_.kind&&"delay"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"delay"}),W("")},icon:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 7v5l3 2",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 1 1-9-9",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})},{key:"approval",label:"Approval",active:"add-node"===_.kind&&"human_approval"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"human_approval"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})},{key:"end",label:"End",active:"add-node"===_.kind&&"end"===_.nodeType,onClick:()=>{z({kind:"add-node",nodeType:"end"}),W("")},icon:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M7 7h10v10H7V7Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})})}].map(e=>(0,t.jsx)("button",{type:"button",onClick:e.onClick,className:e.active?"flex h-8 w-8 items-center justify-center rounded-[var(--ck-radius-sm)] bg-white/10 text-[color:var(--ck-text-primary)]":"flex h-8 w-8 items-center justify-center rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:e.label,"aria-label":e.label,children:e.icon},e.key))}):(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{z({kind:"select"}),W("")},className:"select"===_.kind?"rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]":"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",children:"Select"}),(0,t.jsx)("button",{type:"button",onClick:()=>{z({kind:"connect"}),W("")},className:"connect"===_.kind?"rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]":"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Click a node, then click another node to create an edge",children:"Connect"}),[{t:"llm",label:"LLM"},{t:"tool",label:"Tool"},{t:"condition",label:"If"},{t:"delay",label:"Delay"},{t:"human_approval",label:"Approve"},{t:"end",label:"End"}].map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{z({kind:"add-node",nodeType:e.t}),W("")},className:"add-node"===_.kind&&_.nodeType===e.t?"rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]":"rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Select tool, then click on the canvas to place",children:["+ ",e.label]},e.t))]}),!A&&"connect"===_.kind&&U?(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-secondary)]",children:["Connecting from: ",(0,t.jsx)("span",{className:"font-mono",children:U})]}):null,A||"add-node"!==_.kind?null:(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-secondary)]",children:["Click on the canvas to place a ",(0,t.jsx)("span",{className:"font-mono",children:_.nodeType})," node."]}),(0,t.jsxs)("div",{className:"mt-3 border-t border-white/10 pt-3",children:[(0,t.jsxs)("div",{className:A?"hidden":"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"Agents"}),(0,t.jsx)("div",{className:"text-[10px] text-[color:var(--ck-text-tertiary)]",children:"drag → node"})]}),A?(0,t.jsx)("button",{type:"button",onClick:()=>T(!1),className:"mt-2 flex h-8 w-8 items-center justify-center rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:"Expand to see agents","aria-label":"Expand to see agents",children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M16 11a4 4 0 1 0-8 0",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M4 20a8 8 0 0 1 16 0",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}):(0,t.jsxs)(t.Fragment,{children:[J?(0,t.jsx)("div",{className:"mt-1 text-[11px] text-red-200",children:J}):null,(0,t.jsx)("div",{className:"mt-2 max-h-[140px] space-y-1 overflow-auto",children:P.length?P.map(r=>(0,t.jsx)("div",{draggable:!0,onDragStart:e=>{e.dataTransfer.setData("text/plain",r.id),e.dataTransfer.effectAllowed="copy"},className:"cursor-grab rounded-[var(--ck-radius-sm)] border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-secondary)] hover:bg-white/10",title:r.id,children:r.identityName?r.identityName:r.id.replace(`${e}-`,"")},r.id)):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"No team agents found."})})]})]})]}),(0,t.jsxs)("div",{className:"relative h-[1200px] w-[2200px]",style:{transform:`scale(${$})`,transformOrigin:"0 0"},children:[(0,t.jsx)("svg",{className:"pointer-events-none absolute inset-0 -z-10",width:2200,height:1200,style:{overflow:"visible"},children:(eM.wf?.edges??[]).map(e=>{let r=eM.wf;if(!r)return null;let a=r.nodes.find(t=>t.id===e.from),o=r.nodes.find(t=>t.id===e.to);if(!a||!o)return null;let s=("number"==typeof a.x?a.x:80)+90,n=("number"==typeof a.y?a.y:80)+24,i=("number"==typeof o.x?o.x:80)+90,l=("number"==typeof o.y?o.y:80)+24;return(0,t.jsx)("line",{x1:s,y1:n,x2:i,y2:l,stroke:"rgba(255,255,255,0.35)",strokeWidth:3},e.id)})}),(eM.wf?.nodes??[]).map((r,a)=>{let o="number"==typeof r.x?r.x:80+220*a,s="number"==typeof r.y?r.y:80,n=O===r.id;return(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-wf-node":"1",draggable:"select"===_.kind||"connect"===_.kind,onDragStart:e=>{"select"===_.kind&&e.dataTransfer.setData("text/plain","")},onDragOver:e=>{e.dataTransfer.types.includes("text/plain")&&e.preventDefault()},onDrop:e=>{let t=eM.wf;if(!t)return;e.preventDefault(),e.stopPropagation();let a=String(e.dataTransfer.getData("text/plain")||"").trim();if(!a)return;let o=t.nodes.map(e=>{if(e.id!==r.id)return e;let t=e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{};return{...e,config:{...t,agentId:a}}});eE({...t,nodes:o}),E(r.id)},onClick:e=>{e.stopPropagation();let t=eM.wf;if("connect"===_.kind){if(!t)return;if(!U){W(r.id),E(r.id);return}let e=r.id;if(W(""),!U||!e||U===e||(t.edges??[]).some(t=>t.from===U&&t.to===e))return;let a=`e${Date.now()}`;eE({...t,edges:[...t.edges??[],{id:a,from:U,to:e}]}),z({kind:"select"});return}E(r.id)},onPointerDown:e=>{if("add-node"===_.kind||0!==e.button)return;let t=L.current;if(!t)return;let a=t.getBoundingClientRect();E(r.id);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}e.preventDefault();let n=(e.clientX-a.left+t.scrollLeft)/$,i=(e.clientY-a.top+t.scrollTop)/$;R({nodeId:r.id,dx:n-o,dy:i-s})},onPointerUp:e=>{try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}R(null)},onPointerMove:e=>{if(!B||B.nodeId!==r.id)return;let t=eM.wf;if(!t)return;let a=L.current;if(!a)return;let o=a.getBoundingClientRect(),s=(e.clientX-o.left+a.scrollLeft)/$,n=(e.clientY-o.top+a.scrollTop)/$,i=s-B.dx,l=n-B.dy,d=t.nodes.map(e=>e.id===r.id?{...e,x:i,y:l}:e);N({kind:"ready",jsonText:JSON.stringify({...t,nodes:d},null,2)+"\n"})},className:n?"absolute z-10 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 z-10 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:o,top:s,width:180},children:[(0,t.jsx)("div",{className:"font-medium text-[color:var(--ck-text-primary)]",children:r.name||r.id}),(0,t.jsx)("div",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:r.type}),(()=>{let a=r.config&&"object"==typeof r.config&&!Array.isArray(r.config)?r.config:null,o=a?String(a.agentId??"").trim():"";if(!o)return null;let s=o.replace(`${e}-`,"");return(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-secondary)]",children:["Agent: ",s]})})()]},r.id)}),(()=>{let e=eM.wf;if(!e||!O)return null;let r=e.nodes.find(e=>e.id===O);if(!r)return null;let a="number"==typeof r.x?r.x:80,o="number"==typeof r.y?r.y:80,s=r.config&&"object"==typeof r.config&&!Array.isArray(r.config)?r.config:{},n=String(s.agentId??"").trim();return(0,t.jsxs)("div",{className:"absolute z-10 w-[320px] rounded-[var(--ck-radius-sm)] border border-white/15 bg-black/60 p-3 shadow-[var(--ck-shadow-1)] backdrop-blur",style:{left:a+200,top:o},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-primary)]",children:r.name||r.id}),(0,t.jsx)("button",{type:"button",onClick:()=>E(""),className:"text-[10px] text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]",children:"Close"})]}),(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:"name"}),(0,t.jsx)("input",{value:String(r.name??""),onChange:t=>{let a=t.target.value;eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,name:a}:e)})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 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:r.type,onChange:t=>{let a=t.target.value;eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,type:a}:e)})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 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)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"agentId"}),(0,t.jsx)("input",{value:n,onChange:t=>{let a=String(t.target.value||"").trim(),o={...s,...a?{agentId:a}:{}};a||delete o.agentId,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"(drag an agent onto the node or type)"})]}),"human_approval"===r.type?(0,t.jsxs)("div",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/20 p-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"approval config"}),(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:String(s.provider??""),onChange:t=>{let a=String(t.target.value||"").trim(),o={...s,...a?{provider:a}:{}};a||delete o.provider,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},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:String(s.target??""),onChange:t=>{let a=String(t.target.value||"").trim(),o={...s,...a?{target:a}:{}};a||delete o.target,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},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:"Overrides workflow-level default when set."})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"messageTemplate (optional)"}),(0,t.jsx)("textarea",{value:String(s.messageTemplate??""),onChange:t=>{let a=String(t.target.value||""),o={...s,...a.trim()?{messageTemplate:a}:{}};a.trim()||delete o.messageTemplate,eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:o}:e)})},className:"mt-1 h-[70px] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 font-mono text-[10px] text-[color:var(--ck-text-primary)]",placeholder:"Approval needed for {{workflowName}} (run {{runId}})",spellCheck:!1}),(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:["Vars: ","{{workflowName}}",", ","{{workflowId}}",", ","{{runId}}",", ","{{nodeId}}"]})]})]})]}):null,(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"config (json)"}),(0,t.jsx)("textarea",{value:JSON.stringify(s,null,2),onChange:t=>{try{let a=JSON.parse(t.target.value);if(!a||"object"!=typeof a||Array.isArray(a))return;eE({...e,nodes:e.nodes.map(e=>e.id===r.id?{...e,config:a}:e)})}catch{}},className:"mt-1 h-[140px] w-full resize-none rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/30 p-2 font-mono text-[10px] text-[color:var(--ck-text-primary)]",spellCheck:!1}),(0,t.jsx)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:"(Edits apply when JSON is valid.)"})]})]})]})})()]})]})}),(0,t.jsx)("div",{className:"w-[380px] shrink-0 overflow-auto p-3 text-sm",children:(0,t.jsx)("div",{className:"space-y-3",children:eM.wf?(x=String((c=eM.wf).timezone??"").trim()||"UTC",m=c.triggers??[],u=String((p=c.meta&&"object"==typeof c.meta&&!Array.isArray(c.meta)?c.meta:{}).approvalBindingId??"").trim(),h=String(p.approvalProvider??"telegram").trim()||"telegram",g=String(p.approvalTarget??"").trim(),v=[{label:"(no preset)",expr:""},{label:"Weekdays 09:00 local",expr:"0 9 * * 1-5"},{label:"Mon/Wed/Fri 09:00 local",expr:"0 9 * * 1,3,5"},{label:"Daily 08:00 local",expr:"0 8 * * *"},{label:"Daily 12:00 local",expr:"0 12 * * *"},{label:"Mon 09:30 local",expr:"30 9 * * 1"}],(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Workflow"}),(0,t.jsx)("div",{className:"px-3 pb-3",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[11px] font-medium text-[color:var(--ck-text-tertiary)]",children:"Timezone"}),(0,t.jsx)("input",{value:x,onChange:e=>{let t=String(e.target.value||"").trim()||"UTC";eE({...c,timezone:t})},className:"mt-1 w-full rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 px-2 py-1 text-sm text-[color:var(--ck-text-primary)]",placeholder:"America/New_York"})]})})]}),(0,t.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Approval Channel"}),(0,t.jsxs)("div",{className:"px-3 pb-3 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:"binding (recommended)"}),(0,t.jsxs)("select",{value:u,onChange:e=>{let t=String(e.target.value||"").trim(),r=q.find(e=>e.id===t);r?eE({...c,meta:{...p,approvalBindingId:r.id,approvalProvider:r.channel,approvalTarget:r.target},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:r.id,provider:r.channel,target:r.target}}:e)}):eE({...c,meta:{...p,approvalBindingId:""},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:""}}:e)})},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:"(manual)"}),q.map(e=>(0,t.jsx)("option",{value:e.id,children:e.label},e.id))]}),V?(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-yellow-200",children:["Kitchen looks out of date. Run ",(0,t.jsx)("code",{className:"font-mono",children:"openclaw plugins update"})," then",(0,t.jsx)("code",{className:"ml-1 font-mono",children:"openclaw gateway restart"}),"."]}):null,Z?(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-red-200",children:["Failed to load bindings: ",Z]}):null,(0,t.jsx)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:"Uses your existing OpenClaw bindings (recommended). Manual provider/target is an advanced override."})]}),(0,t.jsxs)("details",{className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-secondary)]",children:"Advanced: manual override"}),(0,t.jsxs)("div",{className:"px-2 pb-2 pt-1 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";eE({...c,meta:{...p,approvalBindingId:"",approvalProvider:t},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:"",provider:t}}:e)})},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:g,onChange:e=>{let t=String(e.target.value||"").trim();eE({...c,meta:{...p,approvalBindingId:"",approvalTarget:t},nodes:c.nodes.map(e=>"human_approval"===e.type?{...e,config:{...e.config&&"object"==typeof e.config&&!Array.isArray(e.config)?e.config:{},approvalBindingId:"",target:t}}:e)})},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.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Triggers"}),(0,t.jsxs)("div",{className:"px-3 pb-3",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()}`;eE({...c,triggers:[...m,{kind:"cron",id:e,name:"New trigger",enabled:!0,expr:"0 9 * * 1-5",tz:x}]})},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:m.length?m.map((e,r)=>{let a=e.kind,o=String(e.id??""),s=String(e.name??""),n=!!e.enabled,i=String(e.expr??""),l=String(e.tz??x),d=i.trim().split(/\s+/).filter(Boolean),p=!i.trim()||5===d.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:s||o||`trigger-${r+1}`}),(0,t.jsx)("button",{type:"button",onClick:()=>eE({...c,triggers:m.filter((e,t)=>t!==r)}),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:n,onChange:e=>{let t=e.target.checked;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,enabled:t}:e)})}}),"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:s,onChange:e=>{let t=e.target.value;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,name:t}:e)})},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:i,onChange:e=>{let t=e.target.value;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,expr:t}:e)})},className:p?"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"}),p?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 ",d.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===i)?i:"",onChange:e=>{let t=e.target.value;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,expr:t}:e)})},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:l,onChange:e=>{let t=String(e.target.value||"").trim()||x;eE({...c,triggers:m.map((e,a)=>a===r&&"cron"===e.kind?{...e,tz:t}:e)})},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:x})]})]})]},`${o}-${r}`)}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"No triggers yet."})})]})]}),(0,t.jsxs)("details",{open:!0,className:"rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/15",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Runs"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Runs (history)"}),(0,t.jsx)(a.default,{href:`/teams/${encodeURIComponent(e)}/runs`,className:"text-[10px] font-medium text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-secondary)] hover:underline",children:"View all →"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:y,onClick:async()=>{let t=String(c.id??"").trim();if(t){et(""),G(!0);try{let r=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,mode:"enqueue"})}),a=await r.json();if(!r.ok||!a.ok)throw Error(a.error||"Failed to enqueue run");let o=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"}),s=await o.json();if(!o.ok||!s.ok)throw Error(s.error||"Failed to refresh runs");let n=(Array.isArray(s.files)?s.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);X(n)}catch(e){et(e instanceof Error?e.message:String(e))}finally{G(!1)}}},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:"+ Queue run"}),(0,t.jsx)("button",{type:"button",disabled:y||eo||!eO.ok,onClick:async()=>{let t=String(c.id??"").trim();if(t){if(eO.missingAgentOnNodeIds.length)return void et("All nodes must be assigned to an agent.");if(eO.agentIdsMissingCron.length){ep(!0),eh("");try{let t=await fetch("/api/cron/worker",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"reconcile",teamId:e})}),r=await t.json();if(!t.ok||!1===r.ok)throw Error(r.error||"Failed to reconcile worker crons");let a=await e$(),o=eO.requiredAgentIds.filter(e=>!a[e]);if(o.length)return void et(`Cron not set up for: ${o.join(", ")}`)}catch(e){et(e instanceof Error?e.message:String(e));return}finally{ep(!1)}}et(""),G(!0);try{let r=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,mode:"run_now"})}),a=await r.json();if(!r.ok||!a.ok)throw Error(a.error||"Failed to create run");let o=await fetch(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"}),s=await o.json();if(!o.ok||!s.ok)throw Error(s.error||"Failed to refresh runs");let n=(Array.isArray(s.files)?s.files:[]).map(e=>String(e??"").trim()).filter(e=>!!e);X(n)}catch(e){et(e instanceof Error?e.message:String(e))}finally{G(!1)}}},className:"rounded-[var(--ck-radius-sm)] border border-emerald-400/30 bg-emerald-500/10 px-2 py-1 text-[10px] font-medium text-emerald-50 hover:bg-emerald-500/15 disabled:opacity-50",title:"Enqueue a run for the workflow runner (Kitchen does not execute nodes)",children:"+ Run now"}),en?(0,t.jsx)("div",{className:"ml-2 text-[10px] text-amber-100/90",title:en,children:"Cron check unavailable"}):null]})]}),eO.missingAgentOnNodeIds.length?(0,t.jsxs)("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:["All nodes must be assigned to an agent. Missing agentId on: ",eO.missingAgentOnNodeIds.join(", ")]}):eO.agentIdsMissingCron.length?(0,t.jsxs)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-amber-400/30 bg-amber-500/10 p-2 text-xs text-amber-50",children:[(0,t.jsxs)("div",{children:["Cron not set up for: ",eO.agentIdsMissingCron.join(", ")]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{eh(""),ex(!0)},className:"rounded-[var(--ck-radius-sm)] border border-amber-300/30 bg-amber-500/10 px-2 py-1 text-[10px] font-medium text-amber-50 hover:bg-amber-500/15",children:"Install worker cron(s)"}),(0,t.jsx)("button",{type:"button",onClick:()=>void 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:"Re-check"})]})]}):null,(0,t.jsx)(o.ConfirmationModal,{open:ec,title:"Install worker cron jobs?",busy:em,error:eu||void 0,confirmLabel:"Install",onClose:()=>{em||ex(!1)},onConfirm:async()=>{ep(!0),eh("");try{let t=await fetch("/api/cron/worker",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"reconcile",teamId:e})}),r=await t.json();if(!t.ok||!1===r.ok)throw Error(r.error||"Failed to install worker crons");await e$(),ex(!1)}catch(e){eh(e instanceof Error?e.message:String(e))}finally{ep(!1)}},children:(0,t.jsxs)("div",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:["Kitchen will install (or enable) worker cron jobs for the following agents so this workflow can drain:",(0,t.jsx)("div",{className:"mt-2 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/25 p-2 font-mono text-[11px] text-[color:var(--ck-text-primary)]",children:eO.agentIdsMissingCron.join(", ")}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["Cron cadence: every 5 minutes. The worker runs: ",(0,t.jsx)("span",{className:"font-mono",children:"openclaw recipes workflows worker-tick"}),"."]})]})}),ee?(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:ee}):null,(0,t.jsx)("div",{className:"mt-2 space-y-1",children:Q?(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"Loading runs…"}):H.length?H.slice(0,8).map(r=>{let o=String(c.id??"").trim(),s=String(r).replace(/\.run\.json$/i,""),n=er===s,i=o?`/teams/${encodeURIComponent(e)}/runs/${encodeURIComponent(o)}/${encodeURIComponent(s)}`:"#";return(0,t.jsx)(a.default,{href:i,onClick:()=>ea(s),className:n?"block w-full rounded-[var(--ck-radius-sm)] bg-white/10 px-2 py-1 text-left text-[11px] font-mono text-[color:var(--ck-text-primary)]":"block w-full rounded-[var(--ck-radius-sm)] px-2 py-1 text-left text-[11px] font-mono text-[color:var(--ck-text-secondary)] hover:bg-white/5",title:"Open run detail",children:s},r)}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"No runs yet."})}),(0,t.jsxs)("details",{open:!0,className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Nodes"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(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:eg,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)]",placeholder:"e.g. draft_assets"})]}),(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:eb,onChange:e=>ek(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:ef,onChange:e=>ey(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(eg||"").trim().replace(/[^a-z0-9_\-]/gi,"_");if(!e||c.nodes.some(t=>t.id===e))return;let t=c.nodes.reduce((e,t)=>"number"==typeof t.x?Math.max(e,t.x):e,80),r={id:e,type:ef,name:String(eb||"").trim()||e,x:t+220,y:80};eE({...c,nodes:[...c.nodes,r]}),E(e),ev(""),ek("")},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:c.nodes.map(e=>{let r=O===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>E(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)("details",{open:!0,className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Edges"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(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:ew,onChange:e=>ej(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)"}),c.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:eN,onChange:e=>eS(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)"}),c.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:eC,onChange:e=>eI(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(ew||"").trim(),t=String(eN||"").trim();if(!e||!t||e===t)return;let r={id:`e${Date.now()}`,from:e,to:t,...String(eC||"").trim()?{label:String(eC).trim()}:{}};eE({...c,edges:[...c.edges??[],r]}),eI("")},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:(c.edges??[]).length?(c.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:()=>eE({...c,edges:(c.edges??[]).filter(t=>t.id!==e.id)}),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)("details",{open:!0,className:"mt-3 rounded-[var(--ck-radius-sm)] border border-white/10 bg-black/10",children:[(0,t.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Node inspector"}),(0,t.jsxs)("div",{className:"px-3 pb-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-2",children:O?(0,t.jsx)("button",{type:"button",onClick:()=>{let e=c.nodes.filter(e=>e.id!==O),t=(c.edges??[]).filter(e=>e.from!==O&&e.to!==O);eE({...c,nodes:e,edges:t}),E("")},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}),O?(b=c.nodes.find(e=>e.id===O))?(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:b.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(b.name??""),onChange:e=>{let t=e.target.value;eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,name:t}:e)})},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:b.type,onChange:e=>{let t=e.target.value;eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,type:t}:e)})},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 b.x?b.x:0,onChange:e=>{let t=Number(e.target.value);eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,x:t}:e)})},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 b.y?b.y:0,onChange:e=>{let t=Number(e.target.value);eE({...c,nodes:c.nodes.map(e=>e.id===b.id?{...e,y:t}:e)})},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(b.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."})]})]})]})]})]})):null})})]})]})}e.s(["default",()=>i],87090)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54523,e=>{"use strict";var t=e.i(43476),s=e.i(22016),r=e.i(71645),a=e.i(65046);function l({agents:e,teamNames:l,appVersion:c}){let o=(0,a.useSelectedTeamId)()||"all",i=(0,r.useMemo)(()=>{let t=new Map;for(let s of e){let e=function(e){if(!e)return null;let t=e.split("/").filter(Boolean).find(e=>e.startsWith("workspace-"))??"";return t&&t.slice(10)||null}(s.workspace)??"personal";if("all"!==o&&e!==o)continue;let r=t.get(e)??[];r.push(s),t.set(e,r)}return Array.from(t.keys()).sort((e,t)=>"personal"===e?1:"personal"===t?-1:e.localeCompare(t)).map(e=>{let s,r,a="personal"===e?"Personal / Unassigned":(s=e.endsWith("-team")?e.slice(0,-5):e,l[e]||l[s]||((r=s.replace(/[-_]+/g," ").replace(/\s+/g," ").trim())?r.split(" ").map(e=>/^(ai|api|cli|ui|ux|sre|qa|devops)$/i.test(e)?e.toUpperCase():e.slice(0,1).toUpperCase()+e.slice(1)).join(" "):s));return{key:e,title:a,subtitle:"personal"===e?null:`workspace-${e}`,agents:(t.get(e)??[]).slice().sort((e,t)=>e.id.localeCompare(t.id)),isTeam:"personal"!==e}})},[e,o,l]);return(0,t.jsxs)("div",{className:"ck-glass w-full p-6 sm:p-8",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h1",{className:"text-3xl font-semibold tracking-tight",children:["ClawKitchen"," ",(0,t.jsxs)("span",{className:"text-sm align-middle text-[color:var(--ck-text-secondary)]",children:["(",c,"-beta)"]})]}),(0,t.jsx)("p",{className:"mt-2 max-w-prose text-[color:var(--ck-text-secondary)]",children:"Installed agents on this machine, grouped by team workspace when available."})]}),(0,t.jsxs)("div",{className:"flex flex-col items-start gap-2 sm:items-end",children:[(0,t.jsx)(s.default,{href:"/recipes?createCustomTeam=1",className:"rounded-[var(--ck-radius-sm)] border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass)] px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[color:var(--ck-bg-glass-strong)]",children:"Create team"}),(0,t.jsx)(s.default,{href:"/recipes",className:"text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:text-[color:var(--ck-text-primary)]",children:"Recipes"}),(0,t.jsx)(s.default,{href:"/tickets",className:"text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:text-[color:var(--ck-text-primary)]",children:"Tickets"}),(0,t.jsx)(s.default,{href:"/channels",className:"text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:text-[color:var(--ck-text-primary)]",children:"Channels / Bindings"}),(0,t.jsx)(s.default,{href:"/settings",className:"text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:text-[color:var(--ck-text-primary)]",children:"Settings"})]})]}),(0,t.jsx)("div",{className:"mt-8 space-y-8",children:i.map(e=>(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"truncate text-lg font-semibold tracking-tight text-[color:var(--ck-text-primary)]",children:e.title}),e.subtitle?(0,t.jsx)("div",{className:"mt-0.5 truncate text-xs text-[color:var(--ck-text-secondary)]",children:e.subtitle}):null]}),e.isTeam?(0,t.jsx)(s.default,{href:`/teams/${encodeURIComponent(e.key)}`,className:"rounded-[var(--ck-radius-sm)] border border-[color:var(--ck-border-subtle)] bg-[color:var(--ck-bg-glass)] px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[color:var(--ck-bg-glass-strong)]",children:"Edit"}):null]}),(0,t.jsx)("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.agents.map(e=>(0,t.jsxs)(s.default,{href:`/agents/${encodeURIComponent(e.id)}`,className:"ck-glass block px-4 py-3 transition-colors hover:bg-[color:var(--ck-bg-glass-strong)]",children:[(0,t.jsx)("div",{className:"truncate font-medium text-[color:var(--ck-text-primary)]",children:e.identityName||e.id}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-secondary)]",children:[e.id,e.isDefault?" • default":""]}),e.model?(0,t.jsx)("div",{className:"mt-1 truncate text-xs text-[color:var(--ck-text-tertiary)]",children:e.model}):null]},e.id))})]},e.key))}),(0,t.jsxs)("p",{className:"mt-10 text-xs text-[color:var(--ck-text-tertiary)]",children:["Note: Team detection currently uses the convention ",(0,t.jsx)("code",{children:"~/.openclaw/workspace-<teamId>"}),"."]})]})}e.s(["default",()=>l])}]);
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},12057,(a,b,c)=>{b.exports=a.x("node:util",()=>require("node:util"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},5365,(a,b,c)=>{b.exports=a.x("process",()=>require("process"))},874,(a,b,c)=>{b.exports=a.x("buffer",()=>require("buffer"))},790,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js <module evaluation>"))},84707,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js"))},97647,a=>{"use strict";a.i(790);var b=a.i(84707);a.n(b)},95936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return i},useLinkStatus:function(){return h.useLinkStatus}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(64240),g=a.r(7997),h=f._(a.r(97647));function i(a){let b=a.legacyBehavior,c="string"==typeof a.children||"number"==typeof a.children||"string"==typeof a.children?.type,d=a.children?.type?.$$typeof===Symbol.for("react.client.reference");return!b||c||d||(a.children?.type?.$$typeof===Symbol.for("react.lazy")?console.error("Using a Lazy Component as a direct child of `<Link legacyBehavior>` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's `<a>` tag."):console.error("Using a Server Component as a direct child of `<Link legacyBehavior>` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's `<a>` tag.")),(0,g.jsx)(h.default,{...a})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},81511,a=>{"use strict";var b=a.i(83643);async function c(){let a=await (0,b.runOpenClaw)(["plugins","list","--json","--verbose"]);if(!a.ok)return{ok:!1,error:a.stderr.trim()||`openclaw plugins list failed (exit=${a.exitCode})`};try{var c,d;return{ok:!0,ids:(c=a.stdout,(Array.isArray(d=JSON.parse(c))?d:d&&"object"==typeof d&&Array.isArray(d.plugins)?d.plugins:[]).filter(a=>!!a&&"object"==typeof a&&!0===a.enabled).map(a=>String(a.id??"")).filter(Boolean))}}catch{return{ok:!1,error:"Failed to parse openclaw plugins list output"}}}async function d(a){let b=await c();return!!b.ok&&b.ids.includes(a)}a.s(["isPluginEnabled",()=>d])},88845,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/workflows/workflows-client.tsx <module evaluation> from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/teams/[teamId]/workflows/workflows-client.tsx <module evaluation>","default")},9247,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/workflows/workflows-client.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/teams/[teamId]/workflows/workflows-client.tsx","default")},53739,a=>{"use strict";a.i(88845);var b=a.i(9247);a.n(b)},51316,a=>{"use strict";var b=a.i(7997),c=a.i(95936),d=a.i(18558),e=a.i(15629),f=a.i(81511),g=a.i(53739);async function h({params:a}){(0,d.unstable_noStore)();let{teamId:h}=await a,i=await (0,e.getTeamDisplayName)(h);return(0,b.jsxs)("div",{className:"space-y-4 p-6",children:[(0,b.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:(0,b.jsxs)("div",{children:[(0,b.jsxs)(c.default,{href:`/teams/${encodeURIComponent(h)}`,className:"text-sm font-medium text-[color:var(--ck-text-secondary)] hover:underline",children:["← ",i||h]}),(0,b.jsx)("h1",{className:"mt-2 text-2xl font-semibold tracking-tight",children:"Workflows"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:"Create and edit workflow definitions for this team."})]})}),(0,b.jsx)(g.default,{teamId:h,llmTaskEnabled:await (0,f.isPluginEnabled)("llm-task")})]})}a.s(["default",()=>h,"dynamic",0,"force-dynamic","revalidate",0,0])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__24c20736._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/next/dist/client/app-dir/link.js/__nextjs-internal-proxy.cjs","../../../../node_modules/next/src/client/app-dir/link.tsx","../../../../node_modules/next/src/client/app-dir/link.react-server.tsx","../../../../src/lib/plugins.ts","../../../../src/app/teams/%5BteamId%5D/workflows/workflows-client.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/teams/%5BteamId%5D/workflows/page.tsx"],"sourcesContent":["// This file is generated by next-core EcmascriptClientReferenceModule.\nconst { createClientModuleProxy } = require(\"react-server-dom-turbopack/server\");\n\n__turbopack_context__.n(createClientModuleProxy(\"[project]/node_modules/next/dist/client/app-dir/link.js\"));\n","'use client'\n\nimport React, { createContext, useContext, useOptimistic, useRef } from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport type { PENDING_LINK_STATUS } from '../components/links'\nimport {\n IDLE_LINK_STATUS,\n mountLinkInstance,\n onNavigationIntent,\n unmountLinkForCurrentNavigation,\n unmountPrefetchableInstance,\n type LinkInstance,\n} from '../components/links'\nimport { isLocalURL } from '../../shared/lib/router/utils/is-local-url'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n} from '../components/segment-cache/types'\nimport { errorOnce } from '../../shared/lib/utils/error-once'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype OnNavigateEventHandler = (event: { preventDefault: () => void }) => void\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref legacyBehavior>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `\"auto\"`, `null`, `undefined` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | 'auto' | null\n\n /**\n * (unstable) Switch to a full prefetch on hover. Effectively the same as\n * updating the prefetch prop to `true` in a mouse event.\n */\n unstable_dynamicOnHover?: boolean\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior.\n *\n * @deprecated This will be removed in a future version\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is navigated.\n */\n onNavigate?: OnNavigateEventHandler\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when type generation runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n href: string,\n as: string,\n linkInstanceRef: React.RefObject<LinkInstance | null>,\n replace?: boolean,\n scroll?: boolean,\n onNavigate?: OnNavigateEventHandler\n): void {\n if (typeof window !== 'undefined') {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n if (\n (isAnchorNodeName && isModifiedEvent(e)) ||\n e.currentTarget.hasAttribute('download')\n ) {\n // ignore click for browser’s default behavior\n return\n }\n\n if (!isLocalURL(href)) {\n if (replace) {\n // browser default behavior does not replace the history state\n // so we need to do it manually\n e.preventDefault()\n location.replace(href)\n }\n\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n if (onNavigate) {\n let isDefaultPrevented = false\n\n onNavigate({\n preventDefault: () => {\n isDefaultPrevented = true\n },\n })\n\n if (isDefaultPrevented) {\n return\n }\n }\n\n const { dispatchNavigateAction } =\n require('../components/app-router-instance') as typeof import('../components/app-router-instance')\n\n React.startTransition(() => {\n dispatchNavigateAction(\n as || href,\n replace ? 'replace' : 'push',\n scroll ?? true,\n linkInstanceRef.current\n )\n })\n }\n}\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nexport default function LinkComponent(\n props: LinkProps & {\n children: React.ReactNode\n ref: React.Ref<HTMLAnchorElement>\n }\n) {\n const [linkStatus, setOptimisticLinkStatus] = useOptimistic(IDLE_LINK_STATUS)\n\n let children: React.ReactNode\n\n const linkInstanceRef = useRef<LinkInstance | null>(null)\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n onNavigate,\n ref: forwardedRef,\n unstable_dynamicOnHover,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n\n const fetchStrategy =\n prefetchProp !== false\n ? getFetchStrategyFromPrefetchProp(prefetchProp)\n : // TODO: it makes no sense to assign a fetchStrategy when prefetching is disabled.\n FetchStrategy.PPR\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n unstable_dynamicOnHover: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n onNavigate: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart' ||\n key === 'onNavigate'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'legacyBehavior' ||\n key === 'unstable_dynamicOnHover'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else if (key === 'prefetch') {\n if (\n props[key] != null &&\n valType !== 'boolean' &&\n props[key] !== 'auto'\n ) {\n throw createPropError({\n key,\n expected: '`boolean | \"auto\"`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n const _: never = key\n }\n })\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof hrefProp === 'string') {\n href = hrefProp\n } else if (\n typeof hrefProp === 'object' &&\n typeof hrefProp.pathname === 'string'\n ) {\n href = hrefProp.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n const { href, as } = React.useMemo(() => {\n const resolvedHref = formatStringOrUrl(hrefProp)\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref,\n }\n }, [hrefProp, asProp])\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if ((children as any)?.$$typeof === Symbol.for('react.lazy')) {\n throw new Error(\n `\\`<Link legacyBehavior>\\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (router !== null) {\n linkInstanceRef.current = mountLinkInstance(\n element,\n href,\n router,\n fetchStrategy,\n prefetchEnabled,\n setOptimisticLinkStatus\n )\n }\n\n return () => {\n if (linkInstanceRef.current) {\n unmountLinkForCurrentNavigation(linkInstanceRef.current)\n linkInstanceRef.current = null\n }\n unmountPrefetchableInstance(element)\n }\n },\n [prefetchEnabled, href, router, fetchStrategy, setOptimisticLinkStatus]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n if (e.defaultPrevented) {\n return\n }\n linkClicked(e, href, as, linkInstanceRef, replace, scroll, onNavigate)\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n if (!prefetchEnabled) {\n return\n }\n\n const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement,\n upgradeToDynamicPrefetch\n )\n },\n }\n\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(as)) {\n childProps.href = as\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(as)\n }\n\n let link: React.ReactNode\n\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n errorOnce(\n '`legacyBehavior` is deprecated and will be removed in a future ' +\n 'release. A codemod is available to upgrade your components:\\n\\n' +\n 'npx @next/codemod@latest new-link .\\n\\n' +\n 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components'\n )\n }\n link = React.cloneElement(child, childProps)\n } else {\n link = (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n\n return (\n <LinkStatusContext.Provider value={linkStatus}>\n {link}\n </LinkStatusContext.Provider>\n )\n}\n\nconst LinkStatusContext = createContext<\n typeof PENDING_LINK_STATUS | typeof IDLE_LINK_STATUS\n>(IDLE_LINK_STATUS)\n\nexport const useLinkStatus = () => {\n return useContext(LinkStatusContext)\n}\n\nfunction getFetchStrategyFromPrefetchProp(\n prefetchProp: Exclude<LinkProps['prefetch'], undefined | false>\n): PrefetchTaskFetchStrategy {\n if (process.env.__NEXT_CACHE_COMPONENTS) {\n if (prefetchProp === true) {\n return FetchStrategy.Full\n }\n\n // `null` or `\"auto\"`: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport.\n // This will also include invalid prop values that don't match the types specified here.\n // (although those should've been filtered out by prop validation in dev)\n prefetchProp satisfies null | 'auto'\n return FetchStrategy.PPR\n } else {\n return prefetchProp === null || prefetchProp === 'auto'\n ? // We default to PPR, and we'll discover whether or not the route supports it with the initial prefetch.\n FetchStrategy.PPR\n : // In the old implementation without runtime prefetches, `prefetch={true}` forces all dynamic data to be prefetched.\n // To preserve backwards-compatibility, anything other than `false`, `null`, or `\"auto\"` results in a full prefetch.\n // (although invalid values should've been filtered out by prop validation in dev)\n FetchStrategy.Full\n }\n}\n","import type { ComponentProps } from 'react'\nimport ClientLinkComponent, { type LinkProps, useLinkStatus } from './link'\n\nexport default function LinkComponent(\n props: ComponentProps<typeof ClientLinkComponent>\n) {\n const isLegacyBehavior = props.legacyBehavior\n const childIsHostComponent =\n typeof props.children === 'string' ||\n typeof props.children === 'number' ||\n typeof (props.children as any)?.type === 'string'\n const childIsClientComponent =\n (props.children as any)?.type?.$$typeof ===\n Symbol.for('react.client.reference')\n\n if (isLegacyBehavior && !childIsHostComponent && !childIsClientComponent) {\n if ((props.children as any)?.type?.$$typeof === Symbol.for('react.lazy')) {\n console.error(\n `Using a Lazy Component as a direct child of \\`<Link legacyBehavior>\\` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n } else {\n console.error(\n `Using a Server Component as a direct child of \\`<Link legacyBehavior>\\` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's \\`<a>\\` tag.`\n )\n }\n }\n\n return <ClientLinkComponent {...props} />\n}\n\nexport { type LinkProps, useLinkStatus }\n","import { runOpenClaw } from \"@/lib/openclaw\";\n\nexport type PluginListEntry = {\n id?: unknown;\n enabled?: unknown;\n};\n\nfunction extractPluginEntries(raw: unknown): PluginListEntry[] {\n if (Array.isArray(raw)) return raw as PluginListEntry[];\n if (raw && typeof raw === \"object\" && Array.isArray((raw as { plugins?: unknown }).plugins)) {\n return (raw as { plugins: PluginListEntry[] }).plugins;\n }\n return [];\n}\n\nexport function parseEnabledPluginIds(stdout: string): string[] {\n const parsed = JSON.parse(stdout) as unknown;\n const items = extractPluginEntries(parsed);\n return items\n .filter((p) => Boolean(p) && typeof p === \"object\" && (p as { enabled?: unknown }).enabled === true)\n .map((p) => String(p.id ?? \"\"))\n .filter(Boolean);\n}\n\nexport async function getEnabledPluginIds(): Promise<{ ok: true; ids: string[] } | { ok: false; error: string }> {\n const res = await runOpenClaw([\"plugins\", \"list\", \"--json\", \"--verbose\"]);\n if (!res.ok) {\n const err = res.stderr.trim() || `openclaw plugins list failed (exit=${res.exitCode})`;\n return { ok: false, error: err };\n }\n\n try {\n return { ok: true, ids: parseEnabledPluginIds(res.stdout) };\n } catch {\n return { ok: false, error: \"Failed to parse openclaw plugins list output\" };\n }\n}\n\nexport async function isPluginEnabled(pluginId: string): Promise<boolean> {\n const res = await getEnabledPluginIds();\n if (!res.ok) return false;\n return res.ids.includes(pluginId);\n}\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport default registerClientReference(\n function() { throw new Error(\"Attempted to call the default export of [project]/src/app/teams/[teamId]/workflows/workflows-client.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\"); },\n \"[project]/src/app/teams/[teamId]/workflows/workflows-client.tsx\",\n \"default\",\n);\n","import Link from \"next/link\";\nimport { unstable_noStore as noStore } from \"next/cache\";\n\nimport { getTeamDisplayName } from \"@/lib/recipes\";\nimport { isPluginEnabled } from \"@/lib/plugins\";\nimport WorkflowsClient from \"./workflows-client\";\n\nexport const dynamic = \"force-dynamic\";\nexport const revalidate = 0;\n\nexport default async function WorkflowsPage({\n params,\n}: {\n params: Promise<{ teamId: string }>;\n}) {\n noStore();\n\n const { teamId } = await params;\n const name = await getTeamDisplayName(teamId);\n\n return (\n <div className=\"space-y-4 p-6\">\n <div className=\"flex flex-wrap items-start justify-between gap-4\">\n <div>\n <Link\n href={`/teams/${encodeURIComponent(teamId)}`}\n className=\"text-sm font-medium text-[color:var(--ck-text-secondary)] hover:underline\"\n >\n ← {name || teamId}\n </Link>\n <h1 className=\"mt-2 text-2xl font-semibold tracking-tight\">Workflows</h1>\n <p className=\"mt-1 text-sm text-[color:var(--ck-text-secondary)]\">\n Create and edit workflow definitions for this team.\n </p>\n </div>\n </div>\n\n <WorkflowsClient teamId={teamId} llmTaskEnabled={await isPluginEnabled(\"llm-task\")} />\n </div>\n );\n}\n"],"names":["LinkComponent","useLinkStatus","isModifiedEvent","event","eventTarget","currentTarget","target","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","href","as","linkInstanceRef","replace","scroll","onNavigate","window","nodeName","isAnchorNodeName","toUpperCase","hasAttribute","isLocalURL","preventDefault","location","isDefaultPrevented","dispatchNavigateAction","require","React","startTransition","current","formatStringOrUrl","urlObjOrString","formatUrl","props","linkStatus","setOptimisticLinkStatus","useOptimistic","IDLE_LINK_STATUS","children","useRef","hrefProp","asProp","childrenProp","prefetch","prefetchProp","passHref","shallow","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","ref","forwardedRef","unstable_dynamicOnHover","restProps","a","router","useContext","AppRouterContext","prefetchEnabled","fetchStrategy","getFetchStrategyFromPrefetchProp","FetchStrategy","PPR","process","env","NODE_ENV","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","locale","warnOnce","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","useMemo","resolvedHref","child","$$typeof","Symbol","for","console","warn","Children","only","err","type","childRef","observeLinkVisibilityOnMount","useCallback","element","mountLinkInstance","unmountLinkForCurrentNavigation","unmountPrefetchableInstance","mergedRef","useMergedRef","childProps","defaultPrevented","upgradeToDynamicPrefetch","onNavigationIntent","__NEXT_LINK_NO_TOUCH_START","undefined","isAbsoluteUrl","addBasePath","link","errorOnce","cloneElement","LinkStatusContext","Provider","value","createContext","__NEXT_CACHE_COMPONENTS","Full","isLegacyBehavior","childIsHostComponent","childIsClientComponent","error","ClientLinkComponent"],"mappings":"6yBACA,GAAM,yBAAE,CAAuB,CAAE,CAAA,EAAA,CAAA,CAAA,OAEjC,EAAsB,CAAC,CAAC,EAAwB,iGAFhD,GAAM,yBAAE,CAAuB,CAAE,CAAA,EAAA,CAAA,CAAA,OAEjC,EAAsB,CAAC,CAAC,EAAwB,2MEAhD,OAyBC,CAAA,kBAzBuBA,GA2BCC,aAAa,CAAA,kBAAbA,EAAAA,aAAa,2GA7B6B,CAAA,CAAA,IAAA,IAEpD,SAASD,EACtBuC,CAAiD,EAEjD,IAAMkG,EAAmBlG,EAAMmB,cAAc,CACvCgF,EACsB,UAA1B,OAAOnG,EAAMK,QAAQ,EACK,UAA1B,OAAOL,EAAMK,QAAQ,EACoB,UAAzC,OAAQL,EAAMK,QAAQ,EAAUkE,KAC5B6B,EACHpG,EAAMK,QAAQ,EAAUkE,MAAMR,WAC/BC,OAAOC,GAAG,CAAC,0BAcb,OAZIiC,AAYJ,GAZyBC,GAAyBC,IAC3CpG,CAWP,CAXaK,QADW,AACH,EAAUkE,KADkB,CACZR,EADqC,SACxBC,OAAOC,GAAG,CAAC,cACzDC,CADwE,OAChEmC,KAAK,CACX,CAAC,8NAGHnC,CAHkO,CAAC,MAG3NmC,KAAK,CACX,CAAC,2MAA2M,AAK3M,CAL4M,AAK5M,EAAA,EAAA,GAAA,EAACC,EAAAA,OAAmB,CAAA,CAAE,GAAGtG,CAAK,EACvC,gPC5BA,IAAA,EAAA,EAAA,CAAA,CAAA,OAwBO,eAAe,IACpB,IAAM,EAAM,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,EAAC,CAAC,UAAW,OAAQ,SAAU,YAAY,EACxE,GAAI,CAAC,EAAI,EAAE,CAET,CAFW,KAEJ,CAAE,IAAI,EAAO,MADR,CACe,CADX,MAAM,CAAC,IAAI,IAAM,CAAC,mCAAmC,EAAE,EAAI,QAAQ,CAAC,CAAC,CAAC,AACvD,EAGjC,GAAI,SACF,MAAO,CAAE,IAAI,EAAM,GAAA,EAjBe,AAiBV,EAAsB,EAAI,EAjBF,IAiBQ,CAdnD,CAVP,AAAI,MAAM,OAAO,CADW,AACV,EAQH,CATyB,GAChB,CAQJ,KAAK,CAAC,IARK,EAC3B,GAAsB,UAAf,OAAO,GAAoB,MAAM,OAAO,CAAE,EAA8B,OAAO,EAChF,CADmF,CAC5C,OAAO,CAEjD,EAJwB,AAItB,EAON,MAAM,CAAC,AAAC,IAAM,CAAQ,GAAmB,UAAb,OAAO,IAA2D,IAAxC,EAA4B,OAAO,EACzF,GAAG,CAAC,AAAC,GAAM,OAAO,EAAE,EAAE,EAAI,KAC1B,MAAM,CAAC,SAWkD,CAC5D,CAAE,KAAM,CACN,MAAO,CAAE,IAAI,EAAO,MAAO,8CAA+C,CAC5E,CACF,CAEO,eAAe,EAAgB,CAAgB,EACpD,IAAM,EAAM,MAAM,UAClB,CAAI,CAAC,EAAI,EAAE,EAAE,AACN,EAAI,GAAG,CAAC,CADK,OACG,CAAC,EAC1B,qFCxCe,CAAA,EADf,AACe,EADf,CAAA,CAAA,OACe,uBAAA,AAAuB,EAClC,WAAa,MAAM,AAAI,MAAM,uTAAyT,EACtV,sFACA,+DAHW,CAAA,EAAA,AADf,EAAA,CAAA,CAAA,OACe,uBAAA,AAAuB,EAClC,WAAa,MAAM,AAAI,MAAM,mSAAqS,EAClU,kEACA,6GCLJ,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAKe,eAAe,EAAc,QAC1C,CAAM,CAGP,EACC,CAAA,EAAA,EAAA,gBAAO,AAAP,IAEA,GAAM,QAAE,CAAM,CAAE,CAAG,MAAM,EACnB,EAAO,MAAM,CAAA,EAAA,EAAA,kBAAA,AAAkB,EAAC,GAEtC,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,0BACb,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,4DACb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,WACC,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,OAAI,CAAA,CACH,KAAM,CAAC,OAAO,EAAE,mBAAmB,GAAA,CAAS,CAC5C,UAAU,sFACX,KACI,GAAQ,KAEb,CAAA,EAAA,EAAA,GAAA,EAAC,KAAA,CAAG,UAAU,sDAA6C,cAC3D,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CAAE,UAAU,8DAAqD,6DAMtE,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAe,CAAA,CAAC,OAAQ,EAAQ,eAAgB,MAAM,CAAA,EAAA,EAAA,eAAA,AAAe,EAAC,gBAG7E,kCAjCuB,+BACG","ignoreList":[0,2,4]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},37941,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227);function e(a){return a.includes("/")||a.includes("\\")}function f(a,b="development-team"){let g=e(b)?b:function(a){if(!/^[a-z0-9][a-z0-9-]{1,63}$/.test(a))throw Error(`Invalid teamId "${a}"`);return d.default.join(c.default.homedir(),".openclaw",`workspace-${a}`)}(b);return d.default.join(g,{backlog:"work/backlog","in-progress":"work/in-progress",testing:"work/testing",done:"work/done"}[a])}async function g(a="development-team"){let c,h=e(a)?(c=d.default.basename(a)).startsWith("workspace-")?c.slice(10):c:a,i=[];for(let c of["backlog","in-progress","testing","done"]){let e=[];try{e=await b.default.readdir(f(c,a))}catch{e=[]}for(let g of e){if(!g.endsWith(".md"))continue;let e=function(a){let b=a.match(/^(\d{4})-/);return b?Number(b[1]):null}(g);if(null==e)continue;let j=d.default.join(f(c,a),g),[k,l]=await Promise.all([b.default.readFile(j,"utf8"),b.default.stat(j)]),m=function(a){let b=a.split("\n")[0]??"",c=b.startsWith("# ")?b.slice(2).trim():"",d=c.indexOf(" ");if(d>0){let a=c.slice(d+1).trim();if(a)return a}let e=c.replace(/^\d{4}-/,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim(),f=new Set(["api","cli","ui","ux","gpu","cpu","npm","pr","ci","cd","json","yaml","md"]),g=e?e.split(" ").filter(Boolean).map(a=>{let b=a.toLowerCase();return f.has(b)?a.toUpperCase():b.startsWith("v")&&/^\d/.test(b.slice(1))||/^[\d.]+$/.test(a)?a:a.slice(0,1).toUpperCase()+a.slice(1)}).join(" "):"";return g||c||"(untitled)"}(k),n=function(a,b){let c=RegExp(`^${b}:\\s*(.*)$`,"mi"),d=a.match(c);return d?.[1]?.trim()||null}(k,"Owner"),o=l.mtime.toISOString(),p=(Date.now()-l.mtimeMs)/36e5;i.push({teamId:h,number:e,id:g.replace(/\.md$/,""),title:m,owner:n,stage:c,file:j,updatedAt:o,ageHours:p})}}return i.sort((a,b)=>a.number-b.number),i}async function h(a,b="development-team"){let c=await g(b),d=a.trim(),e=d.match(/^\d+$/)?c.find(a=>a.number===Number(d)):null;return c.find(a=>a.id===d)??e??null}async function i(a,c){let d=await h(c,a);return d?{teamId:d.teamId,id:d.id,file:d.file,markdown:await b.default.readFile(d.file,"utf8"),owner:d.owner,stage:d.stage}:null}a.s(["getTicketMarkdown",()=>i,"listTickets",()=>g])},55468,a=>{"use strict";a.s(["TicketsBoardClient",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call TicketsBoardClient() from the server but TicketsBoardClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/tickets/TicketsBoardClient.tsx <module evaluation>","TicketsBoardClient")},46566,a=>{"use strict";a.s(["TicketsBoardClient",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call TicketsBoardClient() from the server but TicketsBoardClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/tickets/TicketsBoardClient.tsx","TicketsBoardClient")},26306,a=>{"use strict";a.i(55468);var b=a.i(46566);a.n(b)},119,a=>{"use strict";var b=a.i(7997),c=a.i(26306),d=a.i(37941);async function e({params:a}){let{teamId:e}=await a,f=await (0,d.listTickets)(e);return(0,b.jsx)(c.TicketsBoardClient,{tickets:f,basePath:`/teams/${encodeURIComponent(e)}/tickets`,selectedTeamId:e})}a.s(["default",()=>e,"dynamic",0,"force-dynamic"])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__28f5d174._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/tickets.ts","../../../../src/app/tickets/TicketsBoardClient.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/teams/%5BteamId%5D/tickets/page.tsx"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nexport type TicketStage = \"backlog\" | \"in-progress\" | \"testing\" | \"done\";\n\nexport interface TicketSummary {\n teamId: string;\n number: number;\n id: string;\n title: string;\n owner: string | null;\n stage: TicketStage;\n file: string;\n updatedAt: string; // ISO\n ageHours: number;\n}\n\nfunction assertSafeTeamId(teamId: string) {\n // Conservative: matches OpenClaw team ids like \"development-team\".\n if (!/^[a-z0-9][a-z0-9-]{1,63}$/.test(teamId)) {\n throw new Error(`Invalid teamId \"${teamId}\"`);\n }\n}\n\nfunction isPathLike(s: string) {\n return s.includes(\"/\") || s.includes(\"\\\\\");\n}\n\nexport function teamWorkspace(teamId: string) {\n assertSafeTeamId(teamId);\n return path.join(os.homedir(), \".openclaw\", `workspace-${teamId}`);\n}\n\n/**\n * Back-compat helper for older non-team-scoped code paths.\n * Prefer passing explicit teamId into APIs instead.\n */\nexport function getTeamWorkspaceDir(teamId?: string): string {\n if (teamId) return teamWorkspace(teamId);\n return process.env.CK_TEAM_WORKSPACE_DIR ?? teamWorkspace(process.env.CK_TEAM_ID ?? \"development-team\");\n}\n\nexport function stageDir(stage: TicketStage, teamIdOrDir: string = \"development-team\") {\n const map: Record<TicketStage, string> = {\n backlog: \"work/backlog\",\n \"in-progress\": \"work/in-progress\",\n testing: \"work/testing\",\n done: \"work/done\",\n };\n\n const base = isPathLike(teamIdOrDir) ? teamIdOrDir : teamWorkspace(teamIdOrDir);\n return path.join(base, map[stage]);\n}\n\nexport function parseTitle(md: string) {\n // Ticket markdown files typically start with: # 0033-some-slug\n const firstLine = md.split(\"\\n\")[0] ?? \"\";\n const header = firstLine.startsWith(\"# \") ? firstLine.slice(2).trim() : \"\";\n\n // If header is like: \"<id> <title...>\" keep the explicit title portion.\n const firstSpace = header.indexOf(\" \");\n if (firstSpace > 0) {\n const afterSpace = header.slice(firstSpace + 1).trim();\n if (afterSpace) return afterSpace;\n }\n\n // Otherwise derive from the slug: strip leading number + hyphen, then de-kebab.\n const derivedRaw = header\n .replace(/^\\d{4}-/, \"\")\n .replace(/[-_]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n\n const ACRONYMS = new Set([\"api\", \"cli\", \"ui\", \"ux\", \"gpu\", \"cpu\", \"npm\", \"pr\", \"ci\", \"cd\", \"json\", \"yaml\", \"md\"]);\n const titleCase = (s: string) =>\n s\n .split(\" \")\n .filter(Boolean)\n .map((w) => {\n const lower = w.toLowerCase();\n if (ACRONYMS.has(lower)) return w.toUpperCase();\n if (lower.startsWith(\"v\") && /^\\d/.test(lower.slice(1))) return w; // version-like\n if (/^[\\d.]+$/.test(w)) return w; // numbers/semver\n return w.slice(0, 1).toUpperCase() + w.slice(1);\n })\n .join(\" \");\n\n const derived = derivedRaw ? titleCase(derivedRaw) : \"\";\n\n if (derived) return derived;\n return header || \"(untitled)\";\n}\n\nfunction parseField(md: string, field: string): string | null {\n const re = new RegExp(`^${field}:\\\\s*(.*)$`, \"mi\");\n const m = md.match(re);\n return m?.[1]?.trim() || null;\n}\n\nexport function parseNumberFromFilename(filename: string): number | null {\n const m = filename.match(/^(\\d{4})-/);\n if (!m) return null;\n return Number(m[1]);\n}\n\nfunction teamIdFromTeamDir(teamDir: string): string {\n const base = path.basename(teamDir);\n if (base.startsWith(\"workspace-\")) return base.slice(\"workspace-\".length);\n return base;\n}\n\nexport async function discoverTeamIds(): Promise<string[]> {\n // Convention: ~/.openclaw/workspace-<teamId>\n const root = path.join(os.homedir(), \".openclaw\");\n let entries: string[] = [];\n try {\n entries = await fs.readdir(root);\n } catch {\n return [];\n }\n\n return entries\n .filter((e) => e.startsWith(\"workspace-\"))\n .map((e) => e.slice(\"workspace-\".length))\n .filter((id) => Boolean(id) && id !== \"workspace\")\n .sort();\n}\n\n/**\n * List tickets for a specific team (recommended).\n * - listTickets(\"development-team\")\n * - listTickets(teamWorkspaceDir)\n */\nexport async function listTickets(teamIdOrDir: string = \"development-team\"): Promise<TicketSummary[]> {\n const teamId = isPathLike(teamIdOrDir) ? teamIdFromTeamDir(teamIdOrDir) : teamIdOrDir;\n const stages: TicketStage[] = [\"backlog\", \"in-progress\", \"testing\", \"done\"];\n const all: TicketSummary[] = [];\n\n for (const stage of stages) {\n let files: string[] = [];\n try {\n files = await fs.readdir(stageDir(stage, teamIdOrDir));\n } catch {\n files = [];\n }\n\n for (const f of files) {\n if (!f.endsWith(\".md\")) continue;\n const number = parseNumberFromFilename(f);\n if (number == null) continue;\n\n const file = path.join(stageDir(stage, teamIdOrDir), f);\n const [md, stat] = await Promise.all([fs.readFile(file, \"utf8\"), fs.stat(file)]);\n\n const title = parseTitle(md);\n const owner = parseField(md, \"Owner\");\n const updatedAt = stat.mtime.toISOString();\n const ageHours = (Date.now() - stat.mtimeMs) / (1000 * 60 * 60);\n\n all.push({\n teamId,\n number,\n id: f.replace(/\\.md$/, \"\"),\n title,\n owner,\n stage,\n file,\n updatedAt,\n ageHours,\n });\n }\n }\n\n all.sort((a, b) => a.number - b.number);\n return all;\n}\n\n/**\n * List tickets across all discovered teams (used for /tickets?team=all).\n */\nexport async function listAllTeamsTickets(): Promise<TicketSummary[]> {\n const teamIds = await discoverTeamIds();\n const all: TicketSummary[] = [];\n\n for (const teamId of teamIds) {\n all.push(...(await listTickets(teamId)));\n }\n\n all.sort((a, b) => (a.teamId === b.teamId ? a.number - b.number : a.teamId.localeCompare(b.teamId)));\n return all;\n}\n\n/**\n * Back-compat helper used by some API routes.\n */\nexport async function getTicketByIdOrNumber(ticketIdOrNumber: string, teamIdOrDir: string = \"development-team\") {\n const tickets = await listTickets(teamIdOrDir);\n const normalized = ticketIdOrNumber.trim();\n\n const byNumber = normalized.match(/^\\d+$/) ? tickets.find((t) => t.number === Number(normalized)) : null;\n const byId = tickets.find((t) => t.id === normalized);\n return byId ?? byNumber ?? null;\n}\n\nexport async function resolveTicket(teamId: string, ticketIdOrNumber: string): Promise<TicketSummary | null> {\n return getTicketByIdOrNumber(ticketIdOrNumber, teamId);\n}\n\n/**\n * getTicketMarkdown(teamId, ticketIdOrNumber)\n */\nexport async function getTicketMarkdown(\n teamId: string,\n ticketIdOrNumber: string,\n): Promise<{ teamId: string; id: string; file: string; markdown: string; owner: string | null; stage: TicketStage } | null> {\n const hit = await getTicketByIdOrNumber(ticketIdOrNumber, teamId);\n if (!hit) return null;\n\n return {\n teamId: hit.teamId,\n id: hit.id,\n file: hit.file,\n markdown: await fs.readFile(hit.file, \"utf8\"),\n owner: hit.owner,\n stage: hit.stage,\n };\n}\n","// This file is generated by next-core EcmascriptClientReferenceModule.\nimport { registerClientReference } from \"react-server-dom-turbopack/server\";\nexport const TicketsBoardClient = registerClientReference(\n function() { throw new Error(\"Attempted to call TicketsBoardClient() from the server but TicketsBoardClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\"); },\n \"[project]/src/app/tickets/TicketsBoardClient.tsx\",\n \"TicketsBoardClient\",\n);\n","import { TicketsBoardClient } from \"@/app/tickets/TicketsBoardClient\";\nimport { listTickets } from \"@/lib/tickets\";\n\nexport const dynamic = \"force-dynamic\";\n\nexport default async function TeamTicketsPage({\n params,\n}: {\n params: Promise<{ teamId: string }>;\n}) {\n const { teamId } = await params;\n const tickets = await listTickets(teamId);\n\n return (\n <TicketsBoardClient\n tickets={tickets}\n basePath={`/teams/${encodeURIComponent(teamId)}/tickets`}\n selectedTeamId={teamId}\n />\n );\n}\n"],"names":[],"mappings":"6hBAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAuBA,SAAS,EAAW,CAAS,EAC3B,OAAO,EAAE,QAAQ,CAAC,MAAQ,EAAE,QAAQ,CAAC,KACvC,CAgBO,SAAS,EAAS,CAAkB,CAAE,EAAsB,kBAAkB,EAQnF,IAAM,EAAO,EAAW,GAAe,EAAc,AAtBhD,SAAuB,AAAd,CAA4B,EAT1C,GAAI,CAAC,4BAA4B,IAAI,CAUpB,AAVqB,GACpC,MAD6C,AACvC,AAAI,MAAM,CAAC,gBAAgB,EAAE,EAAO,CAAC,CAAC,EAU9C,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAA,OAAE,CAAC,OAAO,GAAI,YAAa,CAAC,UAAU,EAAE,EAAA,CAAQ,CACnE,EAmBqE,GACnE,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAM,AARkB,CACvC,QAAS,eACT,cAAe,mBACf,QAAS,eACT,KAAM,WACR,CAG0B,CAAC,EAAM,CACnC,CAiFO,eAAe,EAAY,EAAsB,kBAAkB,QAClE,EAAS,EAAW,GA3B1B,AAAI,CADE,EAAO,EAAA,OAAI,AA4BwB,CA5BvB,QAAQ,CAAC,AA4BgC,IA3BlD,UAAU,CAAC,cAAsB,CAAP,CAAY,KAAK,CAAC,IAC9C,EA0BmE,EAEpE,EAAuB,EAAE,CAE/B,AA/BkE,IA+B7D,EA/BmE,EA+B7D,IAHmB,CAAC,IAGX,MAHsB,cAAe,UAAW,OAAO,CAG/C,CAC1B,IAAI,EAAkB,EAAE,CACxB,GAAI,CACF,EAAQ,MAAM,EAAA,OAAE,CAAC,OAAO,CAAC,EAAS,EAAO,GAC3C,CAAE,KAAM,CACN,EAAQ,EAAE,AACZ,CAEA,IAAK,IAAM,KAAK,EAAO,CACrB,GAAI,CAAC,EAAE,QAAQ,CAAC,OAAQ,SACxB,IAAM,EAjDL,AAiDc,SAjDL,AAAwB,CAAgB,EACtD,IAAM,EAAI,EAAS,KAAK,CAAC,oBACpB,AAAL,EACO,CADC,CAAJ,KACU,CAAC,CAAC,EAAE,EADH,IAEjB,EA6C6C,GACvC,GAAI,AAAU,QAAM,SAEpB,IAAM,EAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAS,EAAO,GAAc,GAC/C,CAAC,EAAI,EAAK,CAAG,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAA,OAAE,CAAC,QAAQ,CAAC,EAAM,QAAS,EAAA,OAAE,CAAC,IAAI,CAAC,GAAM,EAEzE,EApGL,AAoGa,SApGJ,AAAW,CAAU,EAEnC,IAAM,EAAY,EAAG,KAAK,CAAC,KAAK,CAAC,EAAE,EAAI,GACjC,EAAS,EAAU,UAAU,CAAC,MAAQ,EAAU,KAAK,CAAC,GAAG,IAAI,GAAK,GAGlE,EAAa,EAAO,OAAO,CAAC,KAClC,GAAI,EAAa,EAAG,CAClB,IAAM,EAAa,EAAO,KAAK,CAAC,EAAa,GAAG,IAAI,GACpD,GAAI,EAAY,OAAO,CACzB,CAGA,IAAM,EAAa,EAChB,OAAO,CAAC,UAAW,IACnB,OAAO,CAAC,SAAU,KAClB,OAAO,CAAC,OAAQ,KAChB,IAAI,GAED,EAAW,IAAI,IAAI,CAAC,MAAO,MAAO,KAAM,KAAM,MAAO,MAAO,MAAO,KAAM,KAAM,KAAM,OAAQ,OAAQ,KAAK,EAc1G,EAAU,EAAuB,AAZrC,EACG,KAAK,CAAC,GAWkB,EAVxB,MAAM,CAAC,SACP,GAAG,CAAC,AAAC,IACJ,IAAM,EAAQ,EAAE,WAAW,UAC3B,AAAI,EAAS,GAAG,CAAC,GAAe,EAAE,GAAT,QAAoB,GACzC,EAAM,UAAU,CAAC,MAAQ,MAAM,IAAI,CAAC,EAAM,KAAK,CAAC,KAAK,AACrD,WAAW,IAAI,CAAC,GAD4C,CACxC,CACjB,CAF4D,CAE1D,IADsB,CACjB,CAAC,CADmB,CAChB,GAAG,GAF6D,QAElD,EADmB,CACd,EAAE,KAAK,CAAC,EAC/C,GACC,IAAI,CAAC,KAE2C,UAErD,AAAI,GACG,GAAU,GADJ,OAAO,EAEtB,EA+D+B,GACnB,EAAQ,AA9DpB,SAAS,AAAW,CAAU,CAAE,CAAa,EAC3C,IAAM,EAAK,AAAI,OAAO,CAAC,CAAC,EAAE,EAAM,UAAU,CAAC,CAAE,MACvC,EAAI,EAAG,KAAK,CAAC,GACnB,OAAO,GAAG,CAAC,EAAE,EAAE,QAAU,IAC3B,EA0D+B,EAAI,SACvB,EAAY,EAAK,KAAK,CAAC,WAAW,GAClC,EAAW,CAAC,KAAK,GAAG,GAAK,EAAK,OAAA,AAAO,EAAK,EAAD,GAE/C,EAFuD,AAEnD,IAAI,CAFoD,AAEnD,EAFqD,MAG5D,SACA,EACA,GAAI,EAAE,OAAO,CAAC,QAAS,UACvB,QACA,QACA,OACA,YACA,WACA,CACF,EACF,CACF,CAGA,OADA,EAAI,IAAI,CAAC,CAAC,EAAG,IAAM,EAAE,MAAM,CAAG,EAAE,MAAM,EAC/B,CACT,CAoBO,eAAe,EAAsB,CAAwB,CAAE,EAAsB,kBAAkB,EAC5G,IAAM,EAAU,MAAM,EAAY,GAC5B,EAAa,EAAiB,IAAI,GAElC,EAAW,EAAW,KAAK,CAAC,SAAW,EAAQ,IAAI,CAAC,AAAC,GAAM,EAAE,MAAM,GAAK,OAAO,IAAe,KAEpG,OADa,AACN,EADc,IAAI,CAAC,AAAC,GAAM,EAAE,EAAE,GAAK,IAC3B,GAAY,IAC7B,CASO,eAAe,EACpB,CAAc,CACd,CAAwB,EAExB,IAAM,EAAM,MAAM,EAAsB,EAAkB,UAC1D,AAAK,EAEE,CACL,CAHE,CAAM,KAGA,EAAI,MAAM,CAClB,GAAI,EAAI,EAAE,CACV,KAAM,EAAI,IAAI,CACd,SAAU,MAAM,EAAA,OAAE,CAAC,QAAQ,CAAC,EAAI,IAAI,CAAE,QACtC,MAAO,EAAI,KAAK,CAChB,MAAO,EAAI,KAAK,AAClB,EATiB,IAUnB,gHCjOO,IAAM,EAAqB,CAAA,EAAA,AADlC,EAAA,CAAA,CAAA,OACkC,uBAAA,AAAuB,EACrD,WAAa,MAAM,AAAI,MAAM,kPAAoP,EACjR,uEACA,gFAHG,IAAM,EAAqB,CAAA,EADlC,AACkC,EADlC,CAAA,CAAA,OACkC,uBAAA,AAAuB,EACrD,WAAa,MAAM,AAAI,MAAM,kPAAoP,EACjR,mDACA,uHCLJ,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAIe,eAAe,EAAgB,QAC5C,CAAM,CAGP,EACC,GAAM,QAAE,CAAM,CAAE,CAAG,MAAM,EACnB,EAAU,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,EAAC,GAElC,MACE,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,kBAAkB,CAAA,CACjB,QAAS,EACT,SAAU,CAAC,OAAO,EAAE,mBAAmB,GAAQ,QAAQ,CAAC,CACxD,eAAgB,GAGtB,kCAjBuB","ignoreList":[1]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(a,b,c)=>{b.exports=a.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(a,b,c)=>{b.exports=a.x("node:path",()=>require("node:path"))},60526,(a,b,c)=>{b.exports=a.x("node:os",()=>require("node:os"))},74533,(a,b,c)=>{b.exports=a.x("node:child_process",()=>require("node:child_process"))},12057,(a,b,c)=>{b.exports=a.x("node:util",()=>require("node:util"))},69264,a=>{a.n(a.i(54832))},50645,a=>{a.n(a.i(27572))},17537,a=>{a.n(a.i(3363))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},5365,(a,b,c)=>{b.exports=a.x("process",()=>require("process"))},874,(a,b,c)=>{b.exports=a.x("buffer",()=>require("buffer"))},790,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js <module evaluation>"))},84707,(a,b,c)=>{let{createClientModuleProxy:d}=a.r(11857);a.n(d("[project]/node_modules/next/dist/client/app-dir/link.js"))},97647,a=>{"use strict";a.i(790);var b=a.i(84707);a.n(b)},95936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return i},useLinkStatus:function(){return h.useLinkStatus}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(64240),g=a.r(7997),h=f._(a.r(97647));function i(a){let b=a.legacyBehavior,c="string"==typeof a.children||"number"==typeof a.children||"string"==typeof a.children?.type,d=a.children?.type?.$$typeof===Symbol.for("react.client.reference");return!b||c||d||(a.children?.type?.$$typeof===Symbol.for("react.lazy")?console.error("Using a Lazy Component as a direct child of `<Link legacyBehavior>` from a Server Component is not supported. If you need legacyBehavior, wrap your Lazy Component in a Client Component that renders the Link's `<a>` tag."):console.error("Using a Server Component as a direct child of `<Link legacyBehavior>` is not supported. If you need legacyBehavior, wrap your Server Component in a Client Component that renders the Link's `<a>` tag.")),(0,g.jsx)(h.default,{...a})}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},23279,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/team-editor/index.tsx <module evaluation> from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/teams/[teamId]/team-editor/index.tsx <module evaluation>","default")},30067,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/src/app/teams/[teamId]/team-editor/index.tsx from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/teams/[teamId]/team-editor/index.tsx","default")},81254,a=>{"use strict";a.i(23279);var b=a.i(30067);a.n(b)},33201,a=>{"use strict";var b=a.i(7997),c=a.i(95936),d=a.i(18558),e=a.i(15629),f=a.i(81254);async function g({params:a,searchParams:g}){(0,d.unstable_noStore)();let{teamId:h}=await a,i=(await g??{}).tab,j=Array.isArray(i)?i[0]:i,k=await (0,e.getTeamDisplayName)(h);return(0,b.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-xl font-semibold tracking-tight text-[color:var(--ck-text-primary)]",children:k||h}),(0,b.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:h})]}),(0,b.jsx)("div",{className:"flex items-center gap-3",children:(0,b.jsx)(c.default,{href:`/goals?team=${encodeURIComponent(h)}`,className:"text-sm font-medium text-[color:var(--ck-text-secondary)] hover:underline",children:"View goals →"})})]}),(0,b.jsx)(f.default,{teamId:h,initialTab:"string"==typeof j?j:void 0})]})}a.s(["default",()=>g,"dynamic",0,"force-dynamic","revalidate",0,0])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__30619465._.js.map
|