@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
|
-
{"version":3,"sources":["../../../src/lib/errors.ts","../../../src/lib/tickets.ts","../../../src/app/api/teams/%5BteamId%5D/tickets/comment/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/lib/ticket-comments.ts"],"sourcesContent":["/**\n * Extracts a string message from an unknown error value.\n * Used consistently across API routes and client components.\n */\nexport function errorMessage(e: unknown): string {\n return e instanceof Error ? e.message : String(e);\n}\n","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","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { NextResponse } from \"next/server\";\n\nimport { errorMessage } from \"@/lib/errors\";\nimport { resolveTicket } from \"@/lib/tickets\";\nimport { formatTicketCommentMarkdown } from \"@/lib/ticket-comments\";\n\nasync function sleep(ms: number) {\n await new Promise((r) => setTimeout(r, ms));\n}\n\nasync function withLock(lockFile: string, fn: () => Promise<void>) {\n const started = Date.now();\n while (true) {\n try {\n const handle = await fs.open(lockFile, \"wx\");\n try {\n await fn();\n } finally {\n await handle.close();\n await fs.unlink(lockFile).catch(() => null);\n }\n return;\n } catch (e: unknown) {\n const code = typeof e === \"object\" && e && \"code\" in e ? (e as { code?: unknown }).code : undefined;\n if (code !== \"EEXIST\") throw e;\n if (Date.now() - started > 2000) throw new Error(\"Ticket is busy; please retry.\");\n await sleep(50);\n }\n }\n}\n\nfunction ensureCommentsSectionAtEnd(md: string) {\n const has = /\\n## Comments\\n/i.test(md) || /^## Comments\\n/im.test(md);\n if (has) return md;\n return md.replace(/\\s*$/, \"\\n\\n## Comments\\n\");\n}\n\nfunction insertComment(md: string, commentBlock: string) {\n const re = /^## Comments\\s*$/gim;\n const m = re.exec(md);\n if (!m) {\n return ensureCommentsSectionAtEnd(md) + commentBlock;\n }\n\n const headerEnd = m.index + m[0].length;\n const rest = md.slice(headerEnd);\n const nextHeadingIdx = rest.search(/^##\\s+/m);\n\n if (nextHeadingIdx === -1) {\n // Comments are last section.\n return md.replace(/\\s*$/, \"\") + commentBlock + \"\\n\";\n }\n\n // Insert before the next heading.\n const insertAt = headerEnd + nextHeadingIdx;\n return md.slice(0, insertAt).replace(/\\s*$/, \"\") + commentBlock + \"\\n\\n\" + md.slice(insertAt).replace(/^\\s+/, \"\");\n}\n\nexport async function POST(req: Request, ctx: { params: Promise<{ teamId: string }> }) {\n try {\n const { teamId } = await ctx.params;\n const body = (await req.json().catch(() => null)) as null | {\n ticket?: string;\n comment?: string;\n author?: string;\n };\n\n const ticketId = body?.ticket?.trim();\n const comment = body?.comment?.trim();\n const author = body?.author?.trim() || \"unknown\";\n\n if (!ticketId) return NextResponse.json({ error: \"Missing ticket.\" }, { status: 400 });\n if (!comment) return NextResponse.json({ error: \"Comment cannot be empty.\" }, { status: 400 });\n if (comment.length > 10_000) return NextResponse.json({ error: \"Comment is too long.\" }, { status: 400 });\n\n const ticket = await resolveTicket(teamId, ticketId);\n if (!ticket) return NextResponse.json({ error: \"Ticket not found.\" }, { status: 404 });\n\n const stamp = new Date().toISOString().replace(\"T\", \" \").replace(/\\.\\d{3}Z$/, \" UTC\");\n const commentBlock = formatTicketCommentMarkdown({ timestamp: stamp, author, body: comment });\n\n const lockFile = path.join(path.dirname(ticket.file), `.${path.basename(ticket.file)}.comment.lock`);\n\n await withLock(lockFile, async () => {\n const current = await fs.readFile(ticket.file, \"utf8\");\n const next = insertComment(ensureCommentsSectionAtEnd(current), commentBlock);\n const tmp = `${ticket.file}.tmp`;\n await fs.writeFile(tmp, next, \"utf8\");\n await fs.rename(tmp, ticket.file);\n });\n\n return NextResponse.json({ ok: true });\n } catch (e: unknown) {\n return NextResponse.json({ error: errorMessage(e) }, { status: 500 });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/teams/[teamId]/tickets/comment/route\",\n pathname: \"/api/teams/[teamId]/tickets/comment\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/teams/[teamId]/tickets/comment/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/teams/[teamId]/tickets/comment/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","export type TicketComment = {\n timestamp: string;\n authorName: string;\n authorRole?: string;\n authorRaw: string;\n body: string;\n};\n\nfunction findCommentsSection(md: string): { start: number; end: number } | null {\n const headerRe = /^## Comments\\s*$/gim;\n const m = headerRe.exec(md);\n if (!m) return null;\n\n const start = m.index + m[0].length;\n\n // Find next heading of same or higher level.\n const rest = md.slice(start);\n const nextHeading = rest.search(/^##\\s+/m);\n const end = nextHeading === -1 ? md.length : start + nextHeading;\n return { start, end };\n}\n\nconst ROLE_HINTS = new Set([\"lead\", \"dev\", \"qa\", \"tester\", \"agent\", \"system\"]);\n\nfunction parseAuthor(rawAuthor: string): { name: string; role?: string; raw: string } {\n const raw = rawAuthor?.trim() || \"\";\n const normalized = raw || \"unknown\";\n\n // Pattern: \"RJ (lead)\"\n const paren = normalized.match(/^(.*?)\\s*\\((.*?)\\)\\s*$/);\n if (paren) {\n const name = paren[1].trim() || \"unknown\";\n const role = paren[2].trim();\n return { name, role: role && role.toLowerCase() != name.toLowerCase() ? role : undefined, raw: normalized };\n }\n\n // Pattern: \"lead — RJ\" / \"RJ — lead\" / \"lead | RJ\" / \"RJ | lead\"\n for (const sep of [\" — \", \" - \", \" | \"] as const) {\n if (!normalized.includes(sep)) continue;\n const [a, b] = normalized.split(sep).map((s) => s.trim()).filter(Boolean);\n if (!a || !b) break;\n\n const aIsRole = ROLE_HINTS.has(a.toLowerCase());\n const bIsRole = ROLE_HINTS.has(b.toLowerCase());\n\n if (aIsRole && !bIsRole) return { name: b, role: a, raw: normalized };\n if (bIsRole && !aIsRole) return { name: a, role: b, raw: normalized };\n\n // Otherwise, treat the left as the primary author label and right as secondary detail.\n return { name: a, role: b, raw: normalized };\n }\n\n return { name: normalized, raw: normalized };\n}\n\nexport function parseTicketComments(md: string): TicketComment[] {\n const section = findCommentsSection(md);\n if (!section) return [];\n\n const body = md.slice(section.start, section.end).replace(/^\\s+/, \"\");\n const lines = body.split(\"\\n\");\n\n const out: TicketComment[] = [];\n let current: TicketComment | null = null;\n\n const header = /^- \\*\\*(.+?)\\*\\*\\s+—\\s+(.*)$/;\n\n for (const rawLine of lines) {\n const line = rawLine.replace(/\\r$/, \"\");\n const m = line.match(header);\n if (m) {\n if (current) out.push({ ...current, body: current.body.trimEnd() });\n const timestamp = m[1].trim();\n const rest = m[2].trim();\n // Support either \"author: first line\" or just \"author\".\n const colonIdx = rest.indexOf(\":\");\n const authorRaw = (colonIdx >= 0 ? rest.slice(0, colonIdx) : rest).trim() || \"unknown\";\n const firstBody = colonIdx >= 0 ? rest.slice(colonIdx + 1).trimStart() : \"\";\n const author = parseAuthor(authorRaw);\n current = {\n timestamp,\n authorName: author.name,\n authorRole: author.role,\n authorRaw: author.raw,\n body: firstBody ? firstBody + \"\\n\" : \"\",\n };\n continue;\n }\n\n if (!current) continue;\n\n // Allow list paragraph indentation, but keep it simple.\n current.body += line.replace(/^\\s{0,2}/, \"\") + \"\\n\";\n }\n\n if (current) out.push({ ...current, body: current.body.trimEnd() });\n return out;\n}\n\nexport function formatTicketCommentMarkdown(args: { timestamp: string; author: string; body: string }): string {\n const body = args.body.trim().replace(/\\r\\n/g, \"\\n\");\n const indented = body\n .split(\"\\n\")\n .map((l) => ` ${l}`)\n .join(\"\\n\");\n\n const author = args.author?.trim() || \"unknown\";\n return `\\n- **${args.timestamp}** — ${author}:\\n${indented}\\n`;\n}\n"],"names":[],"mappings":"4sCAIO,SAAS,EAAa,CAAU,EACrC,OAAO,aAAa,MAAQ,EAAE,OAAO,CAAG,OAAO,EACjD,qDCNA,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,CAEO,SAAS,EAAc,CAAc,EAT1C,GAAI,CAAC,4BAA4B,IAAI,CAAC,AAUrB,GATf,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,CAMO,SAAS,EAAoB,CAAe,SACjD,AAAI,EAAe,EAAc,GAC1B,CADK,OACG,GAAG,CAAC,qBAAqB,EAAI,EAAc,QAAQ,GAAG,CAAC,UAAU,EAAI,mBACtF,CAEO,SAAS,EAAS,CAAkB,CAAE,EAAsB,kBAAkB,EAQnF,IAAM,EAAO,EAAW,GAAe,EAAc,EAAc,GACnE,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EARwB,AAQlB,CAPrB,QAAS,eACT,cAAe,mBACf,QAAS,eACT,KAAM,WACR,CAG0B,CAAC,EAAM,CACnC,CAiFO,eAAe,EAAY,EAAsB,kBAAkB,MA3BlE,EA4BA,EAAS,EAAW,GA3B1B,AAAI,GADS,EAAA,OAAI,AA4BwB,CA5BvB,QAAQ,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AY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/errors.ts","../../../src/lib/tickets.ts","../../../src/app/api/teams/%5BteamId%5D/tickets/comment/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/lib/ticket-comments.ts"],"sourcesContent":["/**\n * Extracts a string message from an unknown error value.\n * Used consistently across API routes and client components.\n */\nexport function errorMessage(e: unknown): string {\n return e instanceof Error ? e.message : String(e);\n}\n","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 === \"workspace\") return \"main\";\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 const teamIds = entries\n .filter((e) => e.startsWith(\"workspace-\"))\n .map((e) => e.slice(\"workspace-\".length))\n .filter((id) => Boolean(id) && id !== \"workspace\");\n\n // Also include personal workspace scope.\n teamIds.push(\"main\");\n\n return Array.from(new Set(teamIds)).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","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { NextResponse } from \"next/server\";\n\nimport { errorMessage } from \"@/lib/errors\";\nimport { resolveTicket } from \"@/lib/tickets\";\nimport { formatTicketCommentMarkdown } from \"@/lib/ticket-comments\";\n\nasync function sleep(ms: number) {\n await new Promise((r) => setTimeout(r, ms));\n}\n\nasync function withLock(lockFile: string, fn: () => Promise<void>) {\n const started = Date.now();\n while (true) {\n try {\n const handle = await fs.open(lockFile, \"wx\");\n try {\n await fn();\n } finally {\n await handle.close();\n await fs.unlink(lockFile).catch(() => null);\n }\n return;\n } catch (e: unknown) {\n const code = typeof e === \"object\" && e && \"code\" in e ? (e as { code?: unknown }).code : undefined;\n if (code !== \"EEXIST\") throw e;\n if (Date.now() - started > 2000) throw new Error(\"Ticket is busy; please retry.\");\n await sleep(50);\n }\n }\n}\n\nfunction ensureCommentsSectionAtEnd(md: string) {\n const has = /\\n## Comments\\n/i.test(md) || /^## Comments\\n/im.test(md);\n if (has) return md;\n return md.replace(/\\s*$/, \"\\n\\n## Comments\\n\");\n}\n\nfunction insertComment(md: string, commentBlock: string) {\n const re = /^## Comments\\s*$/gim;\n const m = re.exec(md);\n if (!m) {\n return ensureCommentsSectionAtEnd(md) + commentBlock;\n }\n\n const headerEnd = m.index + m[0].length;\n const rest = md.slice(headerEnd);\n const nextHeadingIdx = rest.search(/^##\\s+/m);\n\n if (nextHeadingIdx === -1) {\n // Comments are last section.\n return md.replace(/\\s*$/, \"\") + commentBlock + \"\\n\";\n }\n\n // Insert before the next heading.\n const insertAt = headerEnd + nextHeadingIdx;\n return md.slice(0, insertAt).replace(/\\s*$/, \"\") + commentBlock + \"\\n\\n\" + md.slice(insertAt).replace(/^\\s+/, \"\");\n}\n\nexport async function POST(req: Request, ctx: { params: Promise<{ teamId: string }> }) {\n try {\n const { teamId } = await ctx.params;\n const body = (await req.json().catch(() => null)) as null | {\n ticket?: string;\n comment?: string;\n author?: string;\n };\n\n const ticketId = body?.ticket?.trim();\n const comment = body?.comment?.trim();\n const author = body?.author?.trim() || \"unknown\";\n\n if (!ticketId) return NextResponse.json({ error: \"Missing ticket.\" }, { status: 400 });\n if (!comment) return NextResponse.json({ error: \"Comment cannot be empty.\" }, { status: 400 });\n if (comment.length > 10_000) return NextResponse.json({ error: \"Comment is too long.\" }, { status: 400 });\n\n const ticket = await resolveTicket(teamId, ticketId);\n if (!ticket) return NextResponse.json({ error: \"Ticket not found.\" }, { status: 404 });\n\n const stamp = new Date().toISOString().replace(\"T\", \" \").replace(/\\.\\d{3}Z$/, \" UTC\");\n const commentBlock = formatTicketCommentMarkdown({ timestamp: stamp, author, body: comment });\n\n const lockFile = path.join(path.dirname(ticket.file), `.${path.basename(ticket.file)}.comment.lock`);\n\n await withLock(lockFile, async () => {\n const current = await fs.readFile(ticket.file, \"utf8\");\n const next = insertComment(ensureCommentsSectionAtEnd(current), commentBlock);\n const tmp = `${ticket.file}.tmp`;\n await fs.writeFile(tmp, next, \"utf8\");\n await fs.rename(tmp, ticket.file);\n });\n\n return NextResponse.json({ ok: true });\n } catch (e: unknown) {\n return NextResponse.json({ error: errorMessage(e) }, { status: 500 });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/teams/[teamId]/tickets/comment/route\",\n pathname: \"/api/teams/[teamId]/tickets/comment\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/teams/[teamId]/tickets/comment/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/teams/[teamId]/tickets/comment/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","export type TicketComment = {\n timestamp: string;\n authorName: string;\n authorRole?: string;\n authorRaw: string;\n body: string;\n};\n\nfunction findCommentsSection(md: string): { start: number; end: number } | null {\n const headerRe = /^## Comments\\s*$/gim;\n const m = headerRe.exec(md);\n if (!m) return null;\n\n const start = m.index + m[0].length;\n\n // Find next heading of same or higher level.\n const rest = md.slice(start);\n const nextHeading = rest.search(/^##\\s+/m);\n const end = nextHeading === -1 ? md.length : start + nextHeading;\n return { start, end };\n}\n\nconst ROLE_HINTS = new Set([\"lead\", \"dev\", \"qa\", \"tester\", \"agent\", \"system\"]);\n\nfunction parseAuthor(rawAuthor: string): { name: string; role?: string; raw: string } {\n const raw = rawAuthor?.trim() || \"\";\n const normalized = raw || \"unknown\";\n\n // Pattern: \"RJ (lead)\"\n const paren = normalized.match(/^(.*?)\\s*\\((.*?)\\)\\s*$/);\n if (paren) {\n const name = paren[1].trim() || \"unknown\";\n const role = paren[2].trim();\n return { name, role: role && role.toLowerCase() != name.toLowerCase() ? role : undefined, raw: normalized };\n }\n\n // Pattern: \"lead — RJ\" / \"RJ — lead\" / \"lead | RJ\" / \"RJ | lead\"\n for (const sep of [\" — \", \" - \", \" | \"] as const) {\n if (!normalized.includes(sep)) continue;\n const [a, b] = normalized.split(sep).map((s) => s.trim()).filter(Boolean);\n if (!a || !b) break;\n\n const aIsRole = ROLE_HINTS.has(a.toLowerCase());\n const bIsRole = ROLE_HINTS.has(b.toLowerCase());\n\n if (aIsRole && !bIsRole) return { name: b, role: a, raw: normalized };\n if (bIsRole && !aIsRole) return { name: a, role: b, raw: normalized };\n\n // Otherwise, treat the left as the primary author label and right as secondary detail.\n return { name: a, role: b, raw: normalized };\n }\n\n return { name: normalized, raw: normalized };\n}\n\nexport function parseTicketComments(md: string): TicketComment[] {\n const section = findCommentsSection(md);\n if (!section) return [];\n\n const body = md.slice(section.start, section.end).replace(/^\\s+/, \"\");\n const lines = body.split(\"\\n\");\n\n const out: TicketComment[] = [];\n let current: TicketComment | null = null;\n\n const header = /^- \\*\\*(.+?)\\*\\*\\s+—\\s+(.*)$/;\n\n for (const rawLine of lines) {\n const line = rawLine.replace(/\\r$/, \"\");\n const m = line.match(header);\n if (m) {\n if (current) out.push({ ...current, body: current.body.trimEnd() });\n const timestamp = m[1].trim();\n const rest = m[2].trim();\n // Support either \"author: first line\" or just \"author\".\n const colonIdx = rest.indexOf(\":\");\n const authorRaw = (colonIdx >= 0 ? rest.slice(0, colonIdx) : rest).trim() || \"unknown\";\n const firstBody = colonIdx >= 0 ? rest.slice(colonIdx + 1).trimStart() : \"\";\n const author = parseAuthor(authorRaw);\n current = {\n timestamp,\n authorName: author.name,\n authorRole: author.role,\n authorRaw: author.raw,\n body: firstBody ? firstBody + \"\\n\" : \"\",\n };\n continue;\n }\n\n if (!current) continue;\n\n // Allow list paragraph indentation, but keep it simple.\n current.body += line.replace(/^\\s{0,2}/, \"\") + \"\\n\";\n }\n\n if (current) out.push({ ...current, body: current.body.trimEnd() });\n return out;\n}\n\nexport function formatTicketCommentMarkdown(args: { timestamp: string; author: string; body: string }): string {\n const body = args.body.trim().replace(/\\r\\n/g, \"\\n\");\n const indented = body\n .split(\"\\n\")\n .map((l) => ` ${l}`)\n .join(\"\\n\");\n\n const author = args.author?.trim() || \"unknown\";\n return `\\n- **${args.timest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AA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
|
|
@@ -0,0 +1,3 @@
|
|
|
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"))},28215,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227);async function e(){let a=d.default.join(c.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await b.default.readFile(a,"utf8"))}async function f(){let a=await e(),b=a.agents?.defaults?.workspace;if(!b)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return b}async function g(a){let b=c.default.homedir();if(!b)throw Error("Could not resolve home directory");return d.default.join(b,".openclaw",`workspace-${a}`)}a.s(["getTeamWorkspaceDir",()=>g,"getWorkspaceDir",()=>f])},62188,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/HomeClient.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/HomeClient.tsx <module evaluation>","default")},49735,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/HomeClient.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/HomeClient.tsx","default")},73189,a=>{"use strict";a.i(62188);var b=a.i(49735);a.n(b)},60168,a=>{"use strict";var b=a.i(7997),c=a.i(18558),d=a.i(21133),e=a.i(83643),f=a.i(15629),g=a.i(73189);async function h(){let a=await (0,e.runOpenClaw)(["agents","list","--json"]);return a.ok?JSON.parse(a.stdout):[]}async function i(){let a=await (0,f.listRecipes)(),b={};for(let c of a){if("team"!==c.kind)continue;let a=String(c.name??"").trim();a&&(b[c.id]=a)}return{teamNames:b}}async function j(){(0,c.unstable_noStore)();let[a,{teamNames:e}]=await Promise.all([h(),i()]);return(0,b.jsx)(g.default,{agents:a,teamNames:e,appVersion:d.APP_VERSION})}a.s(["default",()=>j,"dynamic",0,"force-dynamic","revalidate",0,0])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__02e6ccaa._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/paths.ts","../../../../src/app/HomeClient.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/page.tsx"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\ntype OpenClawConfig = {\n agents?: { defaults?: { workspace?: string } };\n gateway?: { port?: number; auth?: { token?: string } };\n tools?: {\n agentToAgent?: {\n enabled?: boolean;\n allow?: string[];\n };\n };\n plugins?: {\n installs?: { recipes?: { installPath?: string; sourcePath?: string } };\n load?: { paths?: string[] };\n };\n // OpenClaw message routing bindings (used for HITL approvals, etc.)\n bindings?: unknown[];\n};\n\nexport async function readOpenClawConfig(): Promise<OpenClawConfig> {\n const p = path.join(os.homedir(), \".openclaw\", \"openclaw.json\");\n const text = await fs.readFile(p, \"utf8\");\n return JSON.parse(text) as OpenClawConfig;\n}\n\nexport async function getWorkspaceDir() {\n const cfg = await readOpenClawConfig();\n const ws = cfg.agents?.defaults?.workspace;\n if (!ws) throw new Error(\"agents.defaults.workspace is not set in ~/.openclaw/openclaw.json\");\n return ws;\n}\n\nexport async function getWorkspaceRecipesDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"recipes\");\n}\n\nexport async function getWorkspaceGoalsDir() {\n const ws = await getWorkspaceDir();\n\n // Back-compat: some installs keep goals at <workspace>/goals.\n // Prefer that when present, otherwise fall back to <workspace>/notes/goals.\n const direct = path.join(ws, \"goals\");\n try {\n const st = await fs.stat(direct);\n if (st.isDirectory()) return direct;\n } catch {\n // ignore\n }\n\n return path.join(ws, \"notes\", \"goals\");\n}\n\nexport async function getTeamWorkspaceDir(teamId: string) {\n const home = os.homedir();\n if (!home) throw new Error(\"Could not resolve home directory\");\n return path.join(home, \".openclaw\", `workspace-${teamId}`);\n}\n\n/** Team workspace dir derived from agents.defaults.workspace (sibling: .. / workspace-{teamId}) */\nexport function teamDirFromBaseWorkspace(baseWorkspace: string, teamId: string) {\n // Special-case: treat \"main\" as the personal workspace (agents.defaults.workspace).\n // This lets Kitchen expose a selectable \"main\" scope without creating a separate\n // ~/.openclaw/workspace-main folder.\n if (teamId === \"main\") return path.resolve(baseWorkspace);\n return path.resolve(baseWorkspace, \"..\", `workspace-${teamId}`);\n}\n\n/** Rejects path traversal and empty names; returns normalized name. */\nexport function assertSafeRelativeFileName(name: string): string {\n const n = name.replace(/\\\\/g, \"/\");\n if (!n || n.startsWith(\"/\") || n.includes(\"..\")) throw new Error(\"Invalid file name\");\n return n;\n}\n\nexport async function getBuiltinRecipesDir() {\n const cfg = await readOpenClawConfig();\n const p =\n cfg.plugins?.installs?.recipes?.installPath ||\n cfg.plugins?.installs?.recipes?.sourcePath ||\n cfg.plugins?.load?.paths?.[0];\n if (!p) throw new Error(\"Could not determine recipes plugin install path from ~/.openclaw/openclaw.json\");\n return path.join(p, \"recipes\", \"default\");\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/HomeClient.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/HomeClient.tsx\",\n \"default\",\n);\n","import { unstable_noStore as noStore } from \"next/cache\";\nimport { type AgentListItem } from \"@/lib/agents\";\nimport { APP_VERSION } from \"@/lib/app-info\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { listRecipes } from \"@/lib/recipes\";\nimport HomeClient from \"./HomeClient\";\n\nexport const dynamic = \"force-dynamic\";\nexport const revalidate = 0;\nasync function getAgents(): Promise<AgentListItem[]> {\n const res = await runOpenClaw([\"agents\", \"list\", \"--json\"]);\n if (!res.ok) return [];\n return JSON.parse(res.stdout) as AgentListItem[];\n}\n\nasync function getTeamsFromRecipes(): Promise<{ teamNames: Record<string, string> }> {\n const items = await listRecipes();\n const teamNames: Record<string, string> = {};\n for (const r of items) {\n if (r.kind !== \"team\") continue;\n const name = String(r.name ?? \"\").trim();\n if (!name) continue;\n teamNames[r.id] = name;\n }\n return { teamNames };\n}\n\nexport default async function Home() {\n // Home should always reflect the current OpenClaw state (teams/agents can change outside Next).\n noStore();\n\n const [agents, { teamNames }] = await Promise.all([getAgents(), getTeamsFromRecipes()]);\n return <HomeClient agents={agents} teamNames={teamNames} appVersion={APP_VERSION} />;\n}\n"],"names":[],"mappings":"szBAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAmBO,eAAe,IACpB,IAAM,EAAI,EAAA,OAAI,CAAC,IAAI,CAAC,EAAA,OAAE,CAAC,OAAO,GAAI,YAAa,iBAE/C,OAAO,KAAK,KAAK,CADJ,AACK,MADC,EAAA,O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Ee,eAAe,IAE5B,CAAA,EAAA,EAAA,gBAAA,AAAO,IAEP,GAAM,CAAC,EAAQ,CAAE,WAAS,CAAE,CAAC,CAAG,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAa,IAAsB,EACtF,MAAO,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAU,CAAA,CAAC,OAAQ,EAAQ,UAAW,EAAW,WAAY,EAAA,WAAW,EAClF,kCA1BuB,+BACG","ignoreList":[1]}
|
|
@@ -0,0 +1,3 @@
|
|
|
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"))},28215,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227);async function e(){let a=d.default.join(c.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await b.default.readFile(a,"utf8"))}async function f(){let a=await e(),b=a.agents?.defaults?.workspace;if(!b)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return b}async function g(a){let b=c.default.homedir();if(!b)throw Error("Could not resolve home directory");return d.default.join(b,".openclaw",`workspace-${a}`)}a.s(["getTeamWorkspaceDir",()=>g,"getWorkspaceDir",()=>f])},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)},94510,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/recipes/[id]/RecipeEditor/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/recipes/[id]/RecipeEditor/index.tsx <module evaluation>","default")},87732,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/recipes/[id]/RecipeEditor/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/recipes/[id]/RecipeEditor/index.tsx","default")},62485,a=>{"use strict";a.i(94510);var b=a.i(87732);a.n(b)},79604,a=>{"use strict";var b=a.i(7997),c=a.i(95936),d=a.i(18558),e=a.i(15629),f=a.i(62485);async function g(a){let b=await (0,e.listRecipes)();return b.find(b=>b.id===a)?.kind??null}async function h({params:a}){(0,d.unstable_noStore)();let{id:e}=await a;return await g(e),(0,b.jsxs)("main",{className:"min-h-screen p-8",children:[(0,b.jsx)("div",{className:"mx-auto mb-4 max-w-6xl",children:(0,b.jsx)(c.default,{href:"/recipes",className:"text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:text-[color:var(--ck-text-primary)]",children:"← Back to recipes"})}),(0,b.jsx)(f.default,{recipeId:e})]})}a.s(["default",()=>h,"dynamic",0,"force-dynamic","revalidate",0,0])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0df430db._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/paths.ts","../../../../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/app/recipes/%5Bid%5D/RecipeEditor/index.tsx/__nextjs-internal-proxy.mjs","../../../../src/app/recipes/%5Bid%5D/page.tsx"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\ntype OpenClawConfig = {\n agents?: { defaults?: { workspace?: string } };\n gateway?: { port?: number; auth?: { token?: string } };\n tools?: {\n agentToAgent?: {\n enabled?: boolean;\n allow?: string[];\n };\n };\n plugins?: {\n installs?: { recipes?: { installPath?: string; sourcePath?: string } };\n load?: { paths?: string[] };\n };\n // OpenClaw message routing bindings (used for HITL approvals, etc.)\n bindings?: unknown[];\n};\n\nexport async function readOpenClawConfig(): Promise<OpenClawConfig> {\n const p = path.join(os.homedir(), \".openclaw\", \"openclaw.json\");\n const text = await fs.readFile(p, \"utf8\");\n return JSON.parse(text) as OpenClawConfig;\n}\n\nexport async function getWorkspaceDir() {\n const cfg = await readOpenClawConfig();\n const ws = cfg.agents?.defaults?.workspace;\n if (!ws) throw new Error(\"agents.defaults.workspace is not set in ~/.openclaw/openclaw.json\");\n return ws;\n}\n\nexport async function getWorkspaceRecipesDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"recipes\");\n}\n\nexport async function getWorkspaceGoalsDir() {\n const ws = await getWorkspaceDir();\n\n // Back-compat: some installs keep goals at <workspace>/goals.\n // Prefer that when present, otherwise fall back to <workspace>/notes/goals.\n const direct = path.join(ws, \"goals\");\n try {\n const st = await fs.stat(direct);\n if (st.isDirectory()) return direct;\n } catch {\n // ignore\n }\n\n return path.join(ws, \"notes\", \"goals\");\n}\n\nexport async function getTeamWorkspaceDir(teamId: string) {\n const home = os.homedir();\n if (!home) throw new Error(\"Could not resolve home directory\");\n return path.join(home, \".openclaw\", `workspace-${teamId}`);\n}\n\n/** Team workspace dir derived from agents.defaults.workspace (sibling: .. / workspace-{teamId}) */\nexport function teamDirFromBaseWorkspace(baseWorkspace: string, teamId: string) {\n // Special-case: treat \"main\" as the personal workspace (agents.defaults.workspace).\n // This lets Kitchen expose a selectable \"main\" scope without creating a separate\n // ~/.openclaw/workspace-main folder.\n if (teamId === \"main\") return path.resolve(baseWorkspace);\n return path.resolve(baseWorkspace, \"..\", `workspace-${teamId}`);\n}\n\n/** Rejects path traversal and empty names; returns normalized name. */\nexport function assertSafeRelativeFileName(name: string): string {\n const n = name.replace(/\\\\/g, \"/\");\n if (!n || n.startsWith(\"/\") || n.includes(\"..\")) throw new Error(\"Invalid file name\");\n return n;\n}\n\nexport async function getBuiltinRecipesDir() {\n const cfg = await readOpenClawConfig();\n const p =\n cfg.plugins?.installs?.recipes?.installPath ||\n cfg.plugins?.installs?.recipes?.sourcePath ||\n cfg.plugins?.load?.paths?.[0];\n if (!p) throw new Error(\"Could not determine recipes plugin install path from ~/.openclaw/openclaw.json\");\n return path.join(p, \"recipes\", \"default\");\n}\n","// 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","// 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/recipes/[id]/RecipeEditor/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.\"); },\n \"[project]/src/app/recipes/[id]/RecipeEditor/index.tsx\",\n \"default\",\n);\n","import Link from \"next/link\";\nimport { unstable_noStore as noStore } from \"next/cache\";\n\nimport { listRecipes } from \"@/lib/recipes\";\nimport RecipeEditor from \"./RecipeEditor\";\n\nexport const dynamic = \"force-dynamic\";\nexport const revalidate = 0;\n\nasync function getKind(id: string): Promise<\"agent\" | \"team\" | null> {\n const recipes = await listRecipes();\n return recipes.find((r) => r.id === id)?.kind ?? null;\n}\n\nexport default async function RecipePage({ params }: { params: Promise<{ id: string }> }) {\n noStore();\n\n const { id } = await params;\n await getKind(id); // Resolved for future redirect logic; kept for cache consistency\n\n // NOTE: We do NOT redirect team recipes to /teams/<id>.\n // /recipes/<id> is the recipe editor/preview surface; /teams/<id> is the installed team editor.\n\n return (\n <main className=\"min-h-screen p-8\">\n <div className=\"mx-auto mb-4 max-w-6xl\">\n <Link\n href=\"/recipes\"\n className=\"text-sm font-medium text-[color:var(--ck-text-secondary)] transition-colors hover:text-[color:var(--ck-text-primary)]\"\n >\n ← Back to recipes\n </Link>\n </div>\n <RecipeEditor recipeId={id} />\n </main>\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":"szBAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAmBO,eAAe,IACpB,IAAM,EAAI,EAAA,OAAI,CAAC,IAAI,CAAC,EAAA,OAAE,CAAC,OAAO,GAAI,YAAa,iBAE/C,OAAO,KAAK,KAAK,CADJ,AACK,MADC,EAAA,OAAE,CAAC,QAAQ,CAAC,EAAG,QAEpC,CAEO,eAAe,IACpB,IAAM,EAAM,MAAM,IACZ,EAAK,EAAI,MA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MAAM,6SAA+S,EAC5U,4EACA,gEAHW,CAAA,EADf,AACe,EADf,CAAA,CAAA,OACe,uBAAA,AAAuB,EAClC,WAAa,MAAM,AAAI,MAAM,yRAA2R,EACxT,wDACA,8GCLJ,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAKA,eAAe,EAAQ,CAAU,EAC/B,IAAM,EAAU,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,IACjC,OAAO,EAAQ,IAAI,CAAC,AAAC,GAAM,EAAE,EAAE,GAAK,IAAK,MAAQ,IACnD,CAEe,eAAe,EAAW,QAAE,CAAM,CAAuC,EACtF,CAAA,EAAA,EAAA,gBAAA,AAAO,IAEP,GAAM,IAAE,CAAE,CAAE,CAAG,MAAM,EAMrB,OALA,MAAM,EAAQ,GAMZ,CAAA,CANiB,CAMjB,EAAA,IAAA,EAAC,OAAA,CAAK,UAAU,6BACd,CAAA,EAAA,EAAA,GAAA,CAPgF,CAO/E,MAAA,CAAI,UAAU,kCACb,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAI,CAAA,CACH,KAAK,WACL,UAAU,iIACX,wBAIH,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAY,CAAA,CAAC,SAAU,MAG9B,kCA9BuB,+BACG","ignoreList":[1,3,4]}
|
|
@@ -0,0 +1,3 @@
|
|
|
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"))},28215,a=>{"use strict";var b=a.i(12714),c=a.i(60526),d=a.i(50227);async function e(){let a=d.default.join(c.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await b.default.readFile(a,"utf8"))}async function f(){let a=await e(),b=a.agents?.defaults?.workspace;if(!b)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return b}async function g(a){let b=c.default.homedir();if(!b)throw Error("Could not resolve home directory");return d.default.join(b,".openclaw",`workspace-${a}`)}a.s(["getTeamWorkspaceDir",()=>g,"getWorkspaceDir",()=>f])},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)},30095,88241,a=>{"use strict";var b=a.i(12714),c=a.i(50227),d=a.i(28215);let e=c.default.join("shared-context","workflows");function f(a){let b=String(a??"").trim();if(!b)throw Error("workflow id is required");if(!/^[a-z0-9][a-z0-9-]{0,62}$/.test(b))throw Error("Invalid workflow id. Use lowercase letters, numbers, and dashes (max 63 chars), e.g. marketing-cadence-v1");return b}async function g(a){let b=await (0,d.getTeamWorkspaceDir)(a);return c.default.join(b,e)}async function h(a,d){let e=f(d),h=await g(a),i=c.default.join(h,`${e}.workflow.json`),j=JSON.parse(await b.default.readFile(i,"utf8"));return{ok:!0,path:i,workflow:j}}a.s(["assertSafeWorkflowId",()=>f,"readWorkflow",()=>h],88241);let i=c.default.join("shared-context","workflow-runs");async function j(a,b){f(b);let e=await (0,d.getTeamWorkspaceDir)(a);return c.default.join(e,i)}function k(a){return`${a}.run.json`}async function l(a,d,e){let g=f(d),h=function(a){let b=String(a??"").trim();if(!b)throw Error("run id is required");if(!/^[A-Za-z0-9][A-Za-z0-9-]{0,120}$/.test(b))throw Error("Invalid run id. Use letters, numbers, and dashes.");return b}(e),i=await j(a,g),l=c.default.join(i,h,"run.json");try{let d=await b.default.readFile(l,"utf8"),e=JSON.parse(d),f=n(a,g,e,h);if(Array.isArray(f.nodes)&&f.nodes.length){let a=c.default.join(i,h,"node-outputs"),d=[];try{d=await b.default.readdir(a)}catch{d=[]}let e=new Map;for(let b of d.slice().sort()){let d=b.match(/-([^/]+)\.json$/);if(!d)continue;let f=d[1];if(!f)continue;let g=e.get(f)??[];g.push(c.default.join(a,b)),e.set(f,g)}await Promise.all(f.nodes.map(async a=>{if(!a||"object"!=typeof a||void 0!==a.output)return;let c=e.get(a.nodeId);if(!c||!c.length)return;let d=c.shift();if(d)try{let c=await b.default.readFile(d,"utf8");a.output=JSON.parse(c)}catch{}}))}return{ok:!0,path:l,run:f}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}let m=c.default.join(i,k(h));try{let c=await b.default.readFile(m,"utf8"),d=JSON.parse(c);return{ok:!0,path:m,run:n(a,g,d,h)}}catch(d){if(d&&"object"==typeof d&&"ENOENT"===d.code){let d=c.default.join(i,g,k(h)),e=JSON.parse(await b.default.readFile(d,"utf8"));return{ok:!0,path:d,run:n(a,g,e,h)}}throw d}}async function m(a){let e=await (0,d.getTeamWorkspaceDir)(a),f=c.default.join(e,i),g=[];try{for(let d of(await b.default.readdir(f,{withFileTypes:!0})).filter(a=>a.isDirectory()).map(a=>a.name).sort()){let e=c.default.join(f,d,"run.json");try{let[c,f]=await Promise.all([b.default.readFile(e,"utf8"),b.default.stat(e)]),h=n(a,"(unknown)",JSON.parse(c),d);g.push({workflowId:h.workflowId,runId:h.id,status:h.status,startedAt:h.startedAt,endedAt:h.endedAt,updatedAt:f.mtime?new Date(f.mtime).toISOString():void 0,path:e})}catch{}}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}try{for(let d of(await b.default.readdir(f)).filter(a=>a.endsWith(".run.json")).sort()){let e=d.replace(/\.run\.json$/i,""),h=c.default.join(f,d);try{let[c,d]=await Promise.all([b.default.readFile(h,"utf8"),b.default.stat(h)]),f=n(a,"(unknown)",JSON.parse(c),e);g.push({workflowId:f.workflowId,runId:f.id,status:f.status,startedAt:f.startedAt,endedAt:f.endedAt,updatedAt:d.mtime?new Date(d.mtime).toISOString():void 0,path:h})}catch{g.push({workflowId:"(unknown)",runId:e,path:h})}}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}try{for(let a of(await b.default.readdir(f,{withFileTypes:!0})).filter(a=>a.isDirectory()).map(a=>a.name).sort()){let d=c.default.join(f,a),e=[];try{e=(await b.default.readdir(d)).filter(a=>a.endsWith(".run.json")).sort()}catch(a){if(a&&"object"==typeof a&&"ENOENT"===a.code)continue;throw a}for(let f of e){let e=f.replace(/\.run\.json$/i,""),h=c.default.join(d,f);try{let[c,d]=await Promise.all([b.default.readFile(h,"utf8"),b.default.stat(h)]),f=JSON.parse(c);g.push({workflowId:a,runId:e,status:f.status,startedAt:"string"==typeof f.startedAt?f.startedAt:void 0,endedAt:"string"==typeof f.endedAt?f.endedAt:void 0,updatedAt:d.mtime?new Date(d.mtime).toISOString():void 0,path:h})}catch{g.push({workflowId:a,runId:e,path:h})}}}}catch(a){if(!(a&&"object"==typeof a&&"ENOENT"===a.code))throw a}let h=new Map;for(let a of g){let b=`${a.workflowId}:${a.runId}`,d=h.get(b);if(!d){h.set(b,a);continue}let e=a=>{let b=0;return a.status&&(b+=2),a.startedAt&&(b+=1),a.endedAt&&(b+=1),a.updatedAt&&(b+=1),a.path.endsWith(`${c.default.sep}run.json`)&&(b+=2),b};e(a)>=e(d)&&h.set(b,a)}let j=Array.from(h.values());return j.sort((a,b)=>String(b.updatedAt??b.startedAt??"").localeCompare(String(a.updatedAt??a.startedAt??""))),{ok:!0,dir:f,runs:j}}function n(a,b,d,e){if(d&&"object"==typeof d&&"clawkitchen.workflow-run.v1"===d.schema)return d;if(d&&"object"==typeof d&&"runId"in d&&"workflow"in d){let f=d.workflow&&"object"==typeof d.workflow?d.workflow:{},g="string"==typeof f.file?f.file:"",h=g?c.default.basename(g).replace(/\.workflow\.json$/i,""):"",i="string"==typeof f.id&&f.id?f.id:h||b,j=String(d.status??""),k="awaiting_approval"===j?"waiting_for_approval":"completed"===j?"success":"rejected"===j||"error"===j?"error":"canceled"===j?"canceled":"running",l=Array.isArray(d.nodeResults)?d.nodeResults.map(a=>{if(!a||"object"!=typeof a)return null;let b="string"==typeof a.nodeId?a.nodeId:"";if(!b)return null;let c=String(a.status??"pending"),d="awaiting_approval"===c?"waiting":"completed"===c?"success":"error"===c?"error":c,e=["pending","running","waiting","success","error","skipped"].includes(d)?d:"pending",f="string"==typeof a.error?a.error:a.error&&"object"==typeof a.error&&"message"in a.error?{message:String(a.error.message??"")}:void 0,g="string"==typeof a.startedAt?a.startedAt:void 0,h="string"==typeof a.endedAt?a.endedAt:void 0;return{nodeId:b,status:e,...g?{startedAt:g}:{},...h?{endedAt:h}:{},...void 0!==a.output?{output:a.output}:{},...void 0!==f?{error:f}:{}}}).filter(a=>null!==a):void 0;return{schema:"clawkitchen.workflow-run.v1",id:"string"==typeof d.runId?d.runId:e,workflowId:i,teamId:a,startedAt:"string"==typeof d.createdAt?d.createdAt:new Date().toISOString(),endedAt:("success"===k||"error"===k||"canceled"===k)&&"string"==typeof d.updatedAt?d.updatedAt:void 0,status:k,summary:"Executed by workflow runner",nodes:l}}return{schema:"clawkitchen.workflow-run.v1",id:e,workflowId:b,teamId:a,startedAt:new Date().toISOString(),status:"error",summary:"Malformed run file"}}a.s(["listAllWorkflowRuns",()=>m,"readWorkflowRun",()=>l],30095)},51551,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]/runs/[workflowId]/[runId]/run-detail-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]/runs/[workflowId]/[runId]/run-detail-client.tsx <module evaluation>","default")},9936,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]/runs/[workflowId]/[runId]/run-detail-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]/runs/[workflowId]/[runId]/run-detail-client.tsx","default")},37381,a=>{"use strict";a.i(51551);var b=a.i(9936);a.n(b)},2018,a=>{"use strict";var b=a.i(7997),c=a.i(95936),d=a.i(18558),e=a.i(15629),f=a.i(30095),g=a.i(88241),h=a.i(37381);async function i({params:a}){(0,d.unstable_noStore)();let{teamId:i,workflowId:j,runId:k}=await a,l=await (0,e.getTeamDisplayName)(i),[{run:m},n]=await Promise.all([(0,f.readWorkflowRun)(i,j,k),(0,g.readWorkflow)(i,j).catch(()=>null)]),o=n?.workflow?.name;return(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,b.jsx)(c.default,{href:`/runs?team=${encodeURIComponent(i)}`,className:"hover:underline",children:"Runs"}),(0,b.jsx)("span",{className:"mx-2",children:"/"}),(0,b.jsx)("span",{className:"font-mono",children:j})]}),(0,b.jsxs)("h1",{className:"mt-1 text-2xl font-semibold tracking-tight",children:[o?`${o} \xb7 `:"",(0,b.jsx)("span",{className:"font-mono",children:k})]}),(0,b.jsxs)("div",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:[l||i," · ",(0,b.jsx)("span",{className:"font-mono",children:i})]})]}),(0,b.jsx)("div",{className:"flex items-center gap-3",children:(0,b.jsx)(c.default,{href:`/teams/${encodeURIComponent(i)}/workflows/${encodeURIComponent(j)}`,className:"text-sm font-medium text-[color:var(--ck-text-secondary)] hover:underline",children:"Workflow editor →"})})]}),(0,b.jsx)(h.default,{run:m})]})}a.s(["default",()=>i,"dynamic",0,"force-dynamic","revalidate",0,0])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__162d7d9d._.js.map
|