@jiggai/kitchen 0.3.10 → 0.3.12
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 +4 -4
- package/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/agents/[agentId]/page.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 +5 -5
- package/.next/server/app/channels.segments/_full.segment.rsc +5 -5
- package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
- package/.next/server/app/channels.segments/_index.segment.rsc +3 -3
- package/.next/server/app/channels.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
- package/.next/server/app/cron-jobs/page.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 +5 -5
- package/.next/server/app/goals/new.segments/_full.segment.rsc +5 -5
- package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/_index.segment.rsc +3 -3
- package/.next/server/app/goals/new.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
- package/.next/server/app/goals/page.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 +5 -5
- package/.next/server/app/goals.segments/_full.segment.rsc +5 -5
- package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals.segments/_index.segment.rsc +3 -3
- package/.next/server/app/goals.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
- package/.next/server/app/page.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 +4 -4
- 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 +3 -3
- 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 +4 -4
- 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 +5 -5
- package/.next/server/app/settings.segments/_full.segment.rsc +5 -5
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +3 -3
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/app/teams/[teamId]/page.js +4 -4
- 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 +3 -3
- 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 +4 -4
- 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 +1 -1
- 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/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.js +1 -1
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_1fe98a49.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]__76f9757d._.js.map → [root-of-the-server]__0df430db._.js.map} +1 -1
- 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]__4981f370._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__4981f370._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__4c66998a._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__4c66998a._.js.map +1 -0
- 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]__ad4e8478._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__ad4e8478._.js.map +1 -0
- 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/{node_modules_next_10fb6ad9._.js → _7f9e89d2._.js} +2 -2
- package/.next/server/chunks/ssr/_7f9e89d2._.js.map +1 -0
- 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_59477309._.js +1 -1
- package/.next/server/chunks/ssr/src_59477309._.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/chunks/ssr/src_app_teams_[teamId]_workflows_workflows-client_tsx_12742cc9._.js +3 -0
- package/.next/server/chunks/ssr/src_app_teams_[teamId]_workflows_workflows-client_tsx_12742cc9._.js.map +1 -0
- package/.next/server/chunks/ssr/src_lib_errors_ts_f440efeb._.js +3 -0
- package/.next/server/chunks/ssr/src_lib_errors_ts_f440efeb._.js.map +1 -0
- 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/3e0d3a43014c0ad2.css +3 -0
- package/.next/static/chunks/43d0024279c6160e.js +1 -0
- package/.next/static/chunks/{ecdc9465f0e4d954.js → 4d4876ec71727e38.js} +1 -1
- package/.next/static/chunks/4f5e02a609758a0b.js +1 -0
- package/.next/static/chunks/5e3b1d0f61a651bf.js +1 -0
- package/.next/static/chunks/be12a66bd736fad8.js +1 -0
- package/.next/static/chunks/f179280598d329b2.js +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/public/images/clawkitchen/home.png +0 -0
- package/public/images/clawkitchen/recipes.png +0 -0
- package/public/images/clawkitchen/runs.png +0 -0
- package/public/images/clawkitchen/team.png +0 -0
- package/public/images/clawkitchen/tickets.png +0 -0
- package/public/images/clawkitchen/workflows.png +0 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1d65fddf._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1d65fddf._.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]__450d6006._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__450d6006._.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]__76f9757d._.js +0 -3
- 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]__9ffebe91._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__9ffebe91._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__a26db919._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__a26db919._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__afaa71fe._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__afaa71fe._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__b577b475._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__b577b475._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__e94ab521._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__e94ab521._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__fb6781d4._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__fb6781d4._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_10fb6ad9._.js.map +0 -1
- package/.next/server/chunks/ssr/src_e54f24fb._.js +0 -3
- package/.next/server/chunks/ssr/src_e54f24fb._.js.map +0 -1
- package/.next/static/chunks/42b3230688d0834c.js +0 -1
- package/.next/static/chunks/7495459fdf300bf9.js +0 -1
- package/.next/static/chunks/821af975ccc1f8d5.js +0 -1
- package/.next/static/chunks/be874907adf946fd.js +0 -1
- package/.next/static/chunks/e397a21bf5f13650.js +0 -1
- package/.next/static/chunks/f5d0d403c0fecb7f.css +0 -3
- /package/.next/static/{0PWp2TzSmiSf_Pf9YHES- → hUvZJdetkFjI4DzH44gs9}/_buildManifest.js +0 -0
- /package/.next/static/{0PWp2TzSmiSf_Pf9YHES- → hUvZJdetkFjI4DzH44gs9}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{0PWp2TzSmiSf_Pf9YHES- → hUvZJdetkFjI4DzH44gs9}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/errors.ts","../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/paths.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/cron/worker/route.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","// NOTE: This file is compiled by Next.js.\n// Do not import `openclaw/plugin-sdk` here (it is provided by the gateway runtime, not as an npm dep).\n\ntype KitchenApi = {\n config: unknown;\n runtime: {\n system: { runCommandWithTimeout: (argv: string[], opts: { timeoutMs: number }) => Promise<{ stdout?: string; stderr?: string }> };\n };\n};\n\nexport function getKitchenApi(): KitchenApi {\n const api = (globalThis as unknown as { __clawkitchen_api?: KitchenApi }).__clawkitchen_api;\n if (!api) {\n throw new Error(\n \"ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)\",\n );\n }\n return api;\n}\n","import { getKitchenApi } from \"@/lib/kitchen-api\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\n\nexport type OpenClawExecResult = {\n ok: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n};\n\nfunction extractStdout(err: { stdout?: unknown }): string {\n if (typeof err.stdout === \"string\") return err.stdout;\n if (err.stdout && typeof err.stdout === \"object\" && \"toString\" in err.stdout) {\n return String((err.stdout as { toString: () => string }).toString());\n }\n return \"\";\n}\n\nfunction resolveExitCode(res: { exitCode?: unknown; code?: unknown; status?: unknown }): number {\n if (typeof res.exitCode === \"number\") return res.exitCode;\n if (typeof res.code === \"number\") return res.code;\n if (typeof res.status === \"number\") return res.status;\n return 0;\n}\n\nfunction extractStderr(err: { stderr?: unknown; message?: unknown }, fallback: unknown): string {\n if (typeof err.stderr === \"string\") return err.stderr;\n if (err.stderr && typeof err.stderr === \"object\" && \"toString\" in err.stderr) {\n return String((err.stderr as { toString: () => string }).toString());\n }\n if (typeof err.message === \"string\") return err.message;\n return String(fallback);\n}\n\nasync function runOpenClawLocal(args: string[]): Promise<OpenClawExecResult> {\n try {\n const res = await execFileAsync(\"openclaw\", args, {\n timeout: 120000,\n windowsHide: true,\n maxBuffer: 10 * 1024 * 1024,\n });\n\n return {\n ok: true,\n exitCode: 0,\n stdout: String(res.stdout ?? \"\"),\n stderr: String(res.stderr ?? \"\"),\n };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n\nexport async function runOpenClaw(args: string[]): Promise<OpenClawExecResult> {\n // In some Kitchen runtime contexts, `api.runtime.system.runCommandWithTimeout`\n // is executed with a restricted allowlist that does not include the `cron` tool,\n // causing `openclaw cron ...` to fail with \"Tool not available: cron\".\n //\n // Cron routes need to work in the gateway-run Kitchen environment, so for cron\n // specifically we prefer a local exec (host OpenClaw).\n if (args[0] === \"cron\") return runOpenClawLocal(args);\n\n const api = getKitchenApi();\n try {\n const res = (await api.runtime.system.runCommandWithTimeout([\"openclaw\", ...args], { timeoutMs: 120000 })) as {\n stdout?: unknown;\n stderr?: unknown;\n exitCode?: unknown;\n code?: unknown;\n status?: unknown;\n };\n\n const stdout = String(res.stdout ?? \"\");\n const stderr = String(res.stderr ?? \"\");\n const exitCode = resolveExitCode(res);\n\n if (exitCode !== 0) return { ok: false, exitCode, stdout, stderr };\n return { ok: true, exitCode: 0, stdout, stderr };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n","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 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 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","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/cron/worker/route\",\n pathname: \"/api/cron/worker\",\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/cron/worker/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/cron/worker/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","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { NextResponse } from \"next/server\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { getTeamWorkspaceDir } from \"@/lib/paths\";\nimport { errorMessage } from \"@/lib/errors\";\n\ntype MappingStateV1 = {\n version: 1;\n entries: Record<string, { installedCronId: string; orphaned?: boolean }>;\n};\n\nfunction workerKey(teamId: string, agentId: string) {\n return `workflow-worker:${teamId}:${agentId}`;\n}\n\nfunction cronName(teamId: string, agentId: string) {\n return `workflow-worker:${teamId}:${agentId}`;\n}\n\nfunction buildWorkerMessage(teamId: string, agentId: string) {\n return `Workflow worker tick: pull + execute pending workflow tasks for this agent.\\n\\nCommand:\\n openclaw recipes workflows worker-tick --team-id ${teamId} --agent-id ${agentId} --limit 5 --worker-id cron\\n`;\n}\n\nasync function getAgentWorkspace(agentId: string): Promise<string> {\n const cfgText = await runOpenClaw([\"config\", \"get\", \"agents.list\", \"--no-color\"]);\n if (!cfgText.ok) throw new Error(cfgText.stderr || cfgText.stdout || \"Failed to load agents.list\");\n const list = JSON.parse(String(cfgText.stdout ?? \"[]\")) as Array<{ id?: unknown; workspace?: unknown }>;\n const match = list.find((a) => String(a.id ?? \"\").trim() === agentId);\n const ws = String(match?.workspace ?? \"\").trim();\n if (!ws) throw new Error(`Workspace not found for agent: ${agentId}`);\n return ws;\n}\n\nasync function readMapping(mappingPath: string): Promise<MappingStateV1> {\n try {\n const raw = await fs.readFile(mappingPath, \"utf8\");\n const parsed = JSON.parse(raw) as MappingStateV1;\n if (!parsed || parsed.version !== 1 || !parsed.entries) return { version: 1, entries: {} };\n return parsed;\n } catch {\n return { version: 1, entries: {} };\n }\n}\n\nasync function writeMapping(mappingPath: string, mapping: MappingStateV1): Promise<void> {\n await fs.mkdir(path.dirname(mappingPath), { recursive: true });\n await fs.writeFile(mappingPath, JSON.stringify(mapping, null, 2) + \"\\n\", \"utf8\");\n}\n\nasync function listTeamWorkflowAgentIds(teamId: string): Promise<string[]> {\n const teamDir = await getTeamWorkspaceDir(teamId);\n const workflowsDir = path.join(teamDir, \"shared-context\", \"workflows\");\n let files: string[] = [];\n try {\n files = (await fs.readdir(workflowsDir)).filter((f) => f.endsWith(\".workflow.json\"));\n } catch {\n return [];\n }\n\n const agentIds: string[] = [];\n for (const f of files) {\n try {\n const raw = await fs.readFile(path.join(workflowsDir, f), \"utf8\");\n const wf = JSON.parse(raw) as { nodes?: Array<{ type?: unknown; config?: unknown }> };\n const nodes = Array.isArray(wf.nodes) ? wf.nodes : [];\n for (const n of nodes) {\n const t = String((n as { type?: unknown }).type ?? \"\");\n if (t === \"start\" || t === \"end\") continue;\n const cfg = (n as { config?: unknown }).config;\n const o = cfg && typeof cfg === \"object\" && !Array.isArray(cfg) ? (cfg as Record<string, unknown>) : {};\n const agentId = String(o.agentId ?? \"\").trim();\n if (agentId) agentIds.push(agentId);\n }\n } catch {\n // ignore invalid workflow files\n }\n }\n return Array.from(new Set(agentIds));\n}\n\nasync function installWorkerCron(teamId: string, agentId: string): Promise<{\n alreadyInstalled: boolean;\n installedCronId: string;\n mappingPath: string;\n key: string;\n}> {\n const agentWs = await getAgentWorkspace(agentId);\n const mappingPath = path.join(agentWs, \"notes\", \"cron-jobs.json\");\n const key = workerKey(teamId, agentId);\n\n const mapping = await readMapping(mappingPath);\n const existing = mapping.entries[key];\n if (existing && existing.installedCronId && !existing.orphaned) {\n await runOpenClaw([\"cron\", \"enable\", String(existing.installedCronId)]);\n return { alreadyInstalled: true, installedCronId: String(existing.installedCronId), mappingPath, key };\n }\n\n const name = cronName(teamId, agentId);\n const description = \"Workflow worker cron (Kitchen)\";\n const message = buildWorkerMessage(teamId, agentId);\n\n const add = await runOpenClaw([\n \"cron\",\n \"add\",\n \"--agent\",\n agentId,\n \"--cron\",\n \"* * * * *\",\n \"--name\",\n name,\n \"--description\",\n description,\n \"--message\",\n message,\n \"--json\",\n ]);\n if (!add.ok) throw new Error(add.stderr || add.stdout || \"Failed to add cron\");\n\n // openclaw cron add --json returns the job object itself (id at top-level).\n // Older versions may return { job: { id } }.\n const parsed = JSON.parse(String(add.stdout ?? \"{}\")) as { id?: unknown; job?: { id?: unknown } };\n const installedCronId = String(parsed?.id ?? parsed?.job?.id ?? \"\").trim();\n if (!installedCronId) throw new Error(\"Cron add succeeded but did not return id\");\n\n mapping.entries[key] = { installedCronId };\n await writeMapping(mappingPath, mapping);\n\n return { alreadyInstalled: false, installedCronId, mappingPath, key };\n}\n\nexport async function POST(req: Request) {\n try {\n const body = (await req.json()) as { action?: string; teamId?: string; agentId?: string };\n const action = String(body.action ?? \"\").trim();\n const teamId = String(body.teamId ?? \"\").trim();\n const agentId = String(body.agentId ?? \"\").trim();\n\n if (!teamId) return NextResponse.json({ ok: false, error: \"teamId is required\" }, { status: 400 });\n\n if (action === \"install\") {\n if (!agentId) return NextResponse.json({ ok: false, error: \"agentId is required\" }, { status: 400 });\n const res = await installWorkerCron(teamId, agentId);\n return NextResponse.json({ ok: true, action, teamId, agentId, ...res });\n }\n\n if (action === \"reconcile\") {\n const requiredAgentIds = await listTeamWorkflowAgentIds(teamId);\n\n const installed: Array<{ agentId: string; installedCronId: string; alreadyInstalled: boolean }> = [];\n for (const a of requiredAgentIds) {\n const res = await installWorkerCron(teamId, a);\n installed.push({ agentId: a, installedCronId: res.installedCronId, alreadyInstalled: res.alreadyInstalled });\n }\n\n // Disable orphaned entries for this team in any agent mapping.\n const disabled: Array<{ agentId: string; installedCronId: string; key: string }> = [];\n\n const cfgText = await runOpenClaw([\"config\", \"get\", \"agents.list\", \"--no-color\"]);\n if (cfgText.ok) {\n const list = JSON.parse(String(cfgText.stdout ?? \"[]\")) as Array<{ id?: unknown; workspace?: unknown }>;\n for (const ent of list) {\n const ws = String(ent.workspace ?? \"\").trim();\n if (!ws) continue;\n const mappingPath = path.join(ws, \"notes\", \"cron-jobs.json\");\n const mapping = await readMapping(mappingPath);\n let changed = false;\n for (const [k, v] of Object.entries(mapping.entries)) {\n if (!k.startsWith(`workflow-worker:${teamId}:`)) continue;\n const agentInKey = k.replace(`workflow-worker:${teamId}:`, \"\");\n if (requiredAgentIds.includes(agentInKey)) continue;\n if (v && !v.orphaned) {\n const id = String(v.installedCronId ?? \"\").trim();\n if (id) await runOpenClaw([\"cron\", \"disable\", id]);\n mapping.entries[k] = { ...v, orphaned: true };\n disabled.push({ agentId: agentInKey, installedCronId: id, key: k });\n changed = true;\n }\n }\n if (changed) await writeMapping(mappingPath, mapping);\n }\n }\n\n return NextResponse.json({ ok: true, action, teamId, requiredAgentIds, installed, disabled });\n }\n\n return NextResponse.json({ ok: false, error: \"action must be install|reconcile\" }, { status: 400 });\n } catch (e: unknown) {\n return NextResponse.json({ ok: false, error: errorMessage(e) }, { status: 500 });\n }\n}\n"],"names":[],"mappings":"uCAIO,SAAS,EAAa,CAAU,EACrC,OAAO,aAAa,MAAQ,EAAE,OAAO,CAAG,OAAO,EACjD,iNCIO,SAAS,IACd,IAAM,EAAO,WAA6D,iBAAiB,CAC3F,GAAI,CAAC,EACH,GADQ,GACF,AAAI,MACR,gIAGJ,OAAO,CACT,qDClBA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGA,IAAM,EAAgB,CAAA,EAFtB,AAEsB,EAFtB,CAAA,CAAA,OAEsB,SAAA,AAAS,EAAC,EAAA,QAAQ,EASxC,SAAS,EAAc,CAAyB,QAC9C,AAA0B,UAAtB,AAAgC,OAAzB,EAAI,MAAM,CAAsB,EAAI,MAAM,CACjD,EAAI,MAAM,EAA0B,UAAtB,OAAO,EAAI,MAAM,EAAiB,aAAc,EAAI,MAAM,CACnE,CADqE,MAC7D,EAAI,MAAM,CAAgC,QAAQ,IAE5D,EACT,CASA,SAAS,EAAc,CAA4C,CAAE,CAAiB,QACpF,AAA0B,UAAtB,AAAgC,OAAzB,EAAI,MAAM,CAAsB,EAAI,MAAM,CACjD,EAAI,MAAM,EAA0B,UAAtB,OAAO,EAAI,MAAM,EAAiB,aAAc,EAAI,MAAM,CACnE,CADqE,MAC7D,EAAI,MAAM,CAAgC,QAAQ,IAE/D,AAAuB,UAAU,OAA1B,EAAI,OAAO,CAAsB,EAAI,OAAO,CAChD,OAAO,EAChB,CAEA,eAAe,E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../../src/lib/errors.ts","../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/paths.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/cron/worker/route.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","// NOTE: This file is compiled by Next.js.\n// Do not import `openclaw/plugin-sdk` here (it is provided by the gateway runtime, not as an npm dep).\n\ntype KitchenApi = {\n config: unknown;\n runtime: {\n system: { runCommandWithTimeout: (argv: string[], opts: { timeoutMs: number }) => Promise<{ stdout?: string; stderr?: string }> };\n };\n};\n\nexport function getKitchenApi(): KitchenApi {\n const api = (globalThis as unknown as { __clawkitchen_api?: KitchenApi }).__clawkitchen_api;\n if (!api) {\n throw new Error(\n \"ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)\",\n );\n }\n return api;\n}\n","import { getKitchenApi } from \"@/lib/kitchen-api\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\n\nexport type OpenClawExecResult = {\n ok: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n};\n\nfunction extractStdout(err: { stdout?: unknown }): string {\n if (typeof err.stdout === \"string\") return err.stdout;\n if (err.stdout && typeof err.stdout === \"object\" && \"toString\" in err.stdout) {\n return String((err.stdout as { toString: () => string }).toString());\n }\n return \"\";\n}\n\nfunction resolveExitCode(res: { exitCode?: unknown; code?: unknown; status?: unknown }): number {\n if (typeof res.exitCode === \"number\") return res.exitCode;\n if (typeof res.code === \"number\") return res.code;\n if (typeof res.status === \"number\") return res.status;\n return 0;\n}\n\nfunction extractStderr(err: { stderr?: unknown; message?: unknown }, fallback: unknown): string {\n if (typeof err.stderr === \"string\") return err.stderr;\n if (err.stderr && typeof err.stderr === \"object\" && \"toString\" in err.stderr) {\n return String((err.stderr as { toString: () => string }).toString());\n }\n if (typeof err.message === \"string\") return err.message;\n return String(fallback);\n}\n\nasync function runOpenClawLocal(args: string[]): Promise<OpenClawExecResult> {\n try {\n const res = await execFileAsync(\"openclaw\", args, {\n timeout: 120000,\n windowsHide: true,\n maxBuffer: 10 * 1024 * 1024,\n });\n\n return {\n ok: true,\n exitCode: 0,\n stdout: String(res.stdout ?? \"\"),\n stderr: String(res.stderr ?? \"\"),\n };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n\nexport async function runOpenClaw(args: string[]): Promise<OpenClawExecResult> {\n // In some Kitchen runtime contexts, `api.runtime.system.runCommandWithTimeout`\n // is executed with a restricted allowlist that does not include the `cron` tool,\n // causing `openclaw cron ...` to fail with \"Tool not available: cron\".\n //\n // Cron routes need to work in the gateway-run Kitchen environment, so for cron\n // specifically we prefer a local exec (host OpenClaw).\n if (args[0] === \"cron\") return runOpenClawLocal(args);\n\n const api = getKitchenApi();\n try {\n const res = (await api.runtime.system.runCommandWithTimeout([\"openclaw\", ...args], { timeoutMs: 120000 })) as {\n stdout?: unknown;\n stderr?: unknown;\n exitCode?: unknown;\n code?: unknown;\n status?: unknown;\n };\n\n const stdout = String(res.stdout ?? \"\");\n const stderr = String(res.stderr ?? \"\");\n const exitCode = resolveExitCode(res);\n\n if (exitCode !== 0) return { ok: false, exitCode, stdout, stderr };\n return { ok: true, exitCode: 0, stdout, stderr };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n","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","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/cron/worker/route\",\n pathname: \"/api/cron/worker\",\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/cron/worker/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/cron/worker/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","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { NextResponse } from \"next/server\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { getTeamWorkspaceDir } from \"@/lib/paths\";\nimport { errorMessage } from \"@/lib/errors\";\n\ntype MappingStateV1 = {\n version: 1;\n entries: Record<string, { installedCronId: string; orphaned?: boolean }>;\n};\n\nfunction workerKey(teamId: string, agentId: string) {\n return `workflow-worker:${teamId}:${agentId}`;\n}\n\nfunction cronName(teamId: string, agentId: string) {\n return `workflow-worker:${teamId}:${agentId}`;\n}\n\nfunction buildWorkerMessage(teamId: string, agentId: string) {\n return `Workflow worker tick: pull + execute pending workflow tasks for this agent.\\n\\nCommand:\\n openclaw recipes workflows worker-tick --team-id ${teamId} --agent-id ${agentId} --limit 5 --worker-id cron\\n`;\n}\n\nasync function getAgentWorkspace(agentId: string): Promise<string> {\n const cfgText = await runOpenClaw([\"config\", \"get\", \"agents.list\", \"--no-color\"]);\n if (!cfgText.ok) throw new Error(cfgText.stderr || cfgText.stdout || \"Failed to load agents.list\");\n const list = JSON.parse(String(cfgText.stdout ?? \"[]\")) as Array<{ id?: unknown; workspace?: unknown }>;\n const match = list.find((a) => String(a.id ?? \"\").trim() === agentId);\n const ws = String(match?.workspace ?? \"\").trim();\n if (!ws) throw new Error(`Workspace not found for agent: ${agentId}`);\n return ws;\n}\n\nasync function readMapping(mappingPath: string): Promise<MappingStateV1> {\n try {\n const raw = await fs.readFile(mappingPath, \"utf8\");\n const parsed = JSON.parse(raw) as MappingStateV1;\n if (!parsed || parsed.version !== 1 || !parsed.entries) return { version: 1, entries: {} };\n return parsed;\n } catch {\n return { version: 1, entries: {} };\n }\n}\n\nasync function writeMapping(mappingPath: string, mapping: MappingStateV1): Promise<void> {\n await fs.mkdir(path.dirname(mappingPath), { recursive: true });\n await fs.writeFile(mappingPath, JSON.stringify(mapping, null, 2) + \"\\n\", \"utf8\");\n}\n\nasync function listTeamWorkflowAgentIds(teamId: string): Promise<string[]> {\n const teamDir = await getTeamWorkspaceDir(teamId);\n const workflowsDir = path.join(teamDir, \"shared-context\", \"workflows\");\n let files: string[] = [];\n try {\n files = (await fs.readdir(workflowsDir)).filter((f) => f.endsWith(\".workflow.json\"));\n } catch {\n return [];\n }\n\n const agentIds: string[] = [];\n for (const f of files) {\n try {\n const raw = await fs.readFile(path.join(workflowsDir, f), \"utf8\");\n const wf = JSON.parse(raw) as { nodes?: Array<{ type?: unknown; config?: unknown }> };\n const nodes = Array.isArray(wf.nodes) ? wf.nodes : [];\n for (const n of nodes) {\n const t = String((n as { type?: unknown }).type ?? \"\");\n if (t === \"start\" || t === \"end\") continue;\n const cfg = (n as { config?: unknown }).config;\n const o = cfg && typeof cfg === \"object\" && !Array.isArray(cfg) ? (cfg as Record<string, unknown>) : {};\n const agentId = String(o.agentId ?? \"\").trim();\n if (agentId) agentIds.push(agentId);\n }\n } catch {\n // ignore invalid workflow files\n }\n }\n return Array.from(new Set(agentIds));\n}\n\nasync function installWorkerCron(teamId: string, agentId: string): Promise<{\n alreadyInstalled: boolean;\n installedCronId: string;\n mappingPath: string;\n key: string;\n}> {\n const agentWs = await getAgentWorkspace(agentId);\n const mappingPath = path.join(agentWs, \"notes\", \"cron-jobs.json\");\n const key = workerKey(teamId, agentId);\n\n const mapping = await readMapping(mappingPath);\n const existing = mapping.entries[key];\n if (existing && existing.installedCronId && !existing.orphaned) {\n await runOpenClaw([\"cron\", \"enable\", String(existing.installedCronId)]);\n return { alreadyInstalled: true, installedCronId: String(existing.installedCronId), mappingPath, key };\n }\n\n const name = cronName(teamId, agentId);\n const description = \"Workflow worker cron (Kitchen)\";\n const message = buildWorkerMessage(teamId, agentId);\n\n const add = await runOpenClaw([\n \"cron\",\n \"add\",\n \"--agent\",\n agentId,\n \"--cron\",\n \"* * * * *\",\n \"--name\",\n name,\n \"--description\",\n description,\n \"--message\",\n message,\n \"--json\",\n ]);\n if (!add.ok) throw new Error(add.stderr || add.stdout || \"Failed to add cron\");\n\n // openclaw cron add --json returns the job object itself (id at top-level).\n // Older versions may return { job: { id } }.\n const parsed = JSON.parse(String(add.stdout ?? \"{}\")) as { id?: unknown; job?: { id?: unknown } };\n const installedCronId = String(parsed?.id ?? parsed?.job?.id ?? \"\").trim();\n if (!installedCronId) throw new Error(\"Cron add succeeded but did not return id\");\n\n mapping.entries[key] = { installedCronId };\n await writeMapping(mappingPath, mapping);\n\n return { alreadyInstalled: false, installedCronId, mappingPath, key };\n}\n\nexport async function POST(req: Request) {\n try {\n const body = (await req.json()) as { action?: string; teamId?: string; agentId?: string };\n const action = String(body.action ?? \"\").trim();\n const teamId = String(body.teamId ?? \"\").trim();\n const agentId = String(body.agentId ?? \"\").trim();\n\n if (!teamId) return NextResponse.json({ ok: false, error: \"teamId is required\" }, { status: 400 });\n\n if (action === \"install\") {\n if (!agentId) return NextResponse.json({ ok: false, error: \"agentId is required\" }, { status: 400 });\n const res = await installWorkerCron(teamId, agentId);\n return NextResponse.json({ ok: true, action, teamId, agentId, ...res });\n }\n\n if (action === \"reconcile\") {\n const requiredAgentIds = await listTeamWorkflowAgentIds(teamId);\n\n const installed: Array<{ agentId: string; installedCronId: string; alreadyInstalled: boolean }> = [];\n for (const a of requiredAgentIds) {\n const res = await installWorkerCron(teamId, a);\n installed.push({ agentId: a, installedCronId: res.installedCronId, alreadyInstalled: res.alreadyInstalled });\n }\n\n // Disable orphaned entries for this team in any agent mapping.\n const disabled: Array<{ agentId: string; installedCronId: string; key: string }> = [];\n\n const cfgText = await runOpenClaw([\"config\", \"get\", \"agents.list\", \"--no-color\"]);\n if (cfgText.ok) {\n const list = JSON.parse(String(cfgText.stdout ?? \"[]\")) as Array<{ id?: unknown; workspace?: unknown }>;\n for (const ent of list) {\n const ws = String(ent.workspace ?? \"\").trim();\n if (!ws) continue;\n const mappingPath = path.join(ws, \"notes\", \"cron-jobs.json\");\n const mapping = await readMapping(mappingPath);\n let changed = false;\n for (const [k, v] of Object.entries(mapping.entries)) {\n if (!k.startsWith(`workflow-worker:${teamId}:`)) continue;\n const agentInKey = k.replace(`workflow-worker:${teamId}:`, \"\");\n if (requiredAgentIds.includes(agentInKey)) continue;\n if (v && !v.orphaned) {\n const id = String(v.installedCronId ?? \"\").trim();\n if (id) await runOpenClaw([\"cron\", \"disable\", id]);\n mapping.entries[k] = { ...v, orphaned: true };\n disabled.push({ agentId: agentInKey, installedCronId: id, key: k });\n changed = true;\n }\n }\n if (changed) await writeMapping(mappingPath, mapping);\n }\n }\n\n return NextResponse.json({ ok: true, action, teamId, requiredAgentIds, installed, disabled });\n }\n\n return NextResponse.json({ ok: false, error: \"action must be install|reconcile\" }, { status: 400 });\n } catch (e: unknown) {\n return NextResponse.json({ ok: false, error: errorMessage(e) }, { status: 500 });\n }\n}\n"],"names":[],"mappings":"uCAIO,SAAS,EAAa,CAAU,EACrC,OAAO,aAAa,MAAQ,EAAE,OAAO,CAAG,OAAO,EACjD,iNCIO,SAAS,IACd,IAAM,EAAO,WAA6D,iBAAiB,CAC3F,GAAI,CAAC,EACH,GADQ,GACF,AAAI,MACR,gIAGJ,OAAO,CACT,qDClBA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGA,IAAM,EAAgB,CAAA,EAFtB,AAEsB,EAFtB,CAAA,CAAA,OAEsB,SAAA,AAAS,EAAC,EAAA,QAAQ,EASxC,SAAS,EAAc,CAAyB,QAC9C,AAA0B,UAAtB,AAAgC,OAAzB,EAAI,MAAM,CAAsB,EAAI,MAAM,CACj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C,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,EACA,sBACJ,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":[4]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[74533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},12057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},59494,e=>{"use strict";function t(){let e=globalThis.__clawkitchen_api;if(!e)throw Error("ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)");return e}e.s(["getKitchenApi",()=>t])},5003,e=>{"use strict";var t=e.i(59494),r=e.i(74533);let n=(0,e.i(12057).promisify)(r.execFile);function i(e){return"string"==typeof e.stdout?e.stdout:e.stdout&&"object"==typeof e.stdout&&"toString"in e.stdout?String(e.stdout.toString()):""}function a(e,t){return"string"==typeof e.stderr?e.stderr:e.stderr&&"object"==typeof e.stderr&&"toString"in e.stderr?String(e.stderr.toString()):"string"==typeof e.message?e.message:String(t)}async function s(e){try{let t=await n("openclaw",e,{timeout:12e4,windowsHide:!0,maxBuffer:0xa00000});return{ok:!0,exitCode:0,stdout:String(t.stdout??""),stderr:String(t.stderr??"")}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:i(t),stderr:a(t,t)}}}async function o(e){if("cron"===e[0])return s(e);let r=(0,t.getKitchenApi)();try{let t=await r.runtime.system.runCommandWithTimeout(["openclaw",...e],{timeoutMs:12e4}),n=String(t.stdout??""),i=String(t.stderr??""),a="number"==typeof t.exitCode?t.exitCode:"number"==typeof t.code?t.code:"number"==typeof t.status?t.status:0;if(0!==a)return{ok:!1,exitCode:a,stdout:n,stderr:i};return{ok:!0,exitCode:0,stdout:n,stderr:i}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:i(t),stderr:a(t,t)}}}e.s(["runOpenClaw",()=>o])},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},7367,e=>{"use strict";var t=e.i(12714),r=e.i(60526),n=e.i(50227);async function i(){let e=n.default.join(r.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await t.default.readFile(e,"utf8"))}async function a(){let e=await i(),t=e.agents?.defaults?.workspace;if(!t)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return t}async function s(){let e=await a();return n.default.join(e,"recipes")}async function o(){let e=await a();return n.default.join(e,"notes","goals")}async function u(e){let t=r.default.homedir();if(!t)throw Error("Could not resolve home directory");return n.default.join(t,".openclaw",`workspace-${e}`)}function l(e,t){return n.default.resolve(e,"..",`workspace-${t}`)}function d(e){let t=e.replace(/\\/g,"/");if(!t||t.startsWith("/")||t.includes(".."))throw Error("Invalid file name");return t}async function c(){let e=await i(),t=e.plugins?.installs?.recipes?.installPath||e.plugins?.installs?.recipes?.sourcePath||e.plugins?.load?.paths?.[0];if(!t)throw Error("Could not determine recipes plugin install path from ~/.openclaw/openclaw.json");return n.default.join(t,"recipes","default")}e.s(["assertSafeRelativeFileName",()=>d,"getBuiltinRecipesDir",()=>c,"getTeamWorkspaceDir",()=>u,"getWorkspaceDir",()=>a,"getWorkspaceGoalsDir",()=>o,"getWorkspaceRecipesDir",()=>s,"readOpenClawConfig",()=>i,"teamDirFromBaseWorkspace",()=>l])},5365,(e,t,r)=>{t.exports=e.x("process",()=>require("process"))},874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},72915,e=>{"use strict";var t=e.i(12714),r=e.i(50227),n=e.i(23008),i=e.i(5003),a=e.i(7367);function s(e){if(!e.startsWith("---\n"))throw Error("Recipe markdown must start with YAML frontmatter (---)");let t=e.indexOf("\n---\n",4);if(-1===t)throw Error("Recipe frontmatter not terminated (---)");let r=e.slice(4,t+1),i=n.default.parse(r);if(!i?.id)throw Error("Recipe frontmatter must include id");return i.id}async function o(){let e=await (0,i.runOpenClaw)(["recipes","list"]);if(!e.ok)return[];try{return JSON.parse(e.stdout)}catch{return[]}}async function u(e){return(await o()).find(t=>t.id===e)??null}async function l(e){let t="builtin"===e.source?await (0,a.getBuiltinRecipesDir)():await (0,a.getWorkspaceRecipesDir)();return r.default.join(t,`${e.id}.md`)}async function d(e,n){await t.default.mkdir(r.default.dirname(e),{recursive:!0}),await t.default.writeFile(e,n,"utf8")}e.s(["findRecipeById",()=>u,"parseFrontmatterId",()=>s,"resolveRecipePath",()=>l,"writeRecipeFile",()=>d])},64965,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),i=e.i(59756),a=e.i(61916),s=e.i(74677),o=e.i(69741),u=e.i(16795),l=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),f=e.i(70101),h=e.i(26937),w=e.i(10372),x=e.i(93695);e.i(52474);var m=e.i(220),g=e.i(66680),R=e.i(89171),y=e.i(5003),v=e.i(72915);async function E(e,{params:t}){var r;let{id:n}=await t,i=await (0,v.findRecipeById)(n);if(!i)return R.NextResponse.json({error:`Recipe not found: ${n}`},{status:404});let a=await (0,y.runOpenClaw)(["recipes","show",n]),s=await (0,v.resolveRecipePath)(i).catch(()=>null),o=(r=a.stdout,g.default.createHash("sha256").update(r,"utf8").digest("hex"));return R.NextResponse.json({recipe:{...i,content:a.stdout,filePath:s},recipeHash:o,stderr:a.stderr})}async function C(e,{params:t}){let r,{id:n}=await t,i=await e.json();if("string"!=typeof i.content)return R.NextResponse.json({error:"Missing content"},{status:400});try{r=(0,v.parseFrontmatterId)(i.content)}catch(e){return R.NextResponse.json({error:e.message},{status:400})}if(r!==n)return R.NextResponse.json({error:`Frontmatter id (${r}) must match URL id (${n})`},{status:400});let a=await (0,v.findRecipeById)(n);if(!a)return R.NextResponse.json({error:`Recipe not found: ${n}`},{status:404});if("builtin"===a.source)return R.NextResponse.json({error:`Recipe ${n} is builtin and cannot be modified`},{status:403});let s=await (0,v.resolveRecipePath)(a);return await (0,v.writeRecipeFile)(s,i.content),R.NextResponse.json({ok:!0,filePath:s})}e.s(["GET",()=>E,"PUT",()=>C],89749);var b=e.i(89749);let k=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/recipes/[id]/route",pathname:"/api/recipes/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/recipes/[id]/route.ts",nextConfigOutput:"standalone",userland:b}),{workAsyncStorage:j,workUnitAsyncStorage:N,serverHooks:A}=k;function S(){return(0,n.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:N})}async function P(e,t,n){k.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/recipes/[id]/route";g=g.replace(/\/index$/,"")||"/";let R=await k.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,params:v,nextConfig:E,parsedUrl:C,isDraftMode:b,prerenderManifest:j,routerServerContext:N,isOnDemandRevalidate:A,revalidateOnlyGenerated:S,resolvedPathname:P,clientReferenceManifest:T,serverActionsManifest:O}=R,q=(0,o.normalizeAppPath)(g),_=!!(j.dynamicRoutes[q]||j.routes[P]),I=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!b){let e=!!j.routes[P],t=j.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await I();throw new x.NoFallbackError}}let D=null;!_||k.isDev||b||(D="/index"===(D=P)?"/":D);let H=!0===k.isDev||!_,F=_&&!H;O&&T&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:T,serverActionsManifest:O});let U=e.method||"GET",$=(0,a.getTracer)(),M=$.getActiveScopeSpan(),B={params:v,prerenderManifest:j,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>k.onRequestError(e,t,n,i,N)},sharedContext:{buildId:y}},K=new u.NodeNextRequest(e),W=new u.NodeNextResponse(t),L=l.NextRequestAdapter.fromNodeNextRequest(K,(0,l.signalFromNodeResponse)(t));try{let s=async e=>k.handle(L,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${U} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${g}`)}),o=!!(0,i.getRequestMeta)(e,"minimalMode"),u=async i=>{var a,u;let l=async({previousCacheEntry:r})=>{try{if(!o&&A&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=B.renderOpts.fetchMetrics;let u=B.renderOpts.pendingWaitUntil;u&&n.waitUntil&&(n.waitUntil(u),u=void 0);let l=B.renderOpts.collectedTags;if(!_)return await (0,p.sendResponse)(K,W,a,B.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[w.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=w.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,n=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=w.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:A})},!1,N),t}},d=await k.handleResponse({req:e,nextConfig:E,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:j,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:S,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:o});if(!_)return null;if((null==d||null==(a=d.value)?void 0:a.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(u=d.value)?void 0:u.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",A?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let x=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return o&&_||x.delete(w.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||x.get("Cache-Control")||x.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(K,W,new Response(d.value.body,{headers:x,status:d.value.status||200})),null};M?await u(M):await $.withPropagatedContext(e.headers,()=>$.trace(d.BaseServerSpan.handleRequest,{spanName:`${U} ${g}`,kind:a.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},u))}catch(t){if(t instanceof x.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:A})},!1,N),_)throw t;return await (0,p.sendResponse)(K,W,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>S,"routeModule",()=>k,"serverHooks",()=>A,"workAsyncStorage",()=>j,"workUnitAsyncStorage",()=>N],64965)}];
|
|
1
|
+
module.exports=[74533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},12057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},59494,e=>{"use strict";function t(){let e=globalThis.__clawkitchen_api;if(!e)throw Error("ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)");return e}e.s(["getKitchenApi",()=>t])},5003,e=>{"use strict";var t=e.i(59494),r=e.i(74533);let n=(0,e.i(12057).promisify)(r.execFile);function a(e){return"string"==typeof e.stdout?e.stdout:e.stdout&&"object"==typeof e.stdout&&"toString"in e.stdout?String(e.stdout.toString()):""}function i(e,t){return"string"==typeof e.stderr?e.stderr:e.stderr&&"object"==typeof e.stderr&&"toString"in e.stderr?String(e.stderr.toString()):"string"==typeof e.message?e.message:String(t)}async function s(e){try{let t=await n("openclaw",e,{timeout:12e4,windowsHide:!0,maxBuffer:0xa00000});return{ok:!0,exitCode:0,stdout:String(t.stdout??""),stderr:String(t.stderr??"")}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:a(t),stderr:i(t,t)}}}async function o(e){if("cron"===e[0])return s(e);let r=(0,t.getKitchenApi)();try{let t=await r.runtime.system.runCommandWithTimeout(["openclaw",...e],{timeoutMs:12e4}),n=String(t.stdout??""),a=String(t.stderr??""),i="number"==typeof t.exitCode?t.exitCode:"number"==typeof t.code?t.code:"number"==typeof t.status?t.status:0;if(0!==i)return{ok:!1,exitCode:i,stdout:n,stderr:a};return{ok:!0,exitCode:0,stdout:n,stderr:a}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:a(t),stderr:i(t,t)}}}e.s(["runOpenClaw",()=>o])},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},7367,e=>{"use strict";var t=e.i(12714),r=e.i(60526),n=e.i(50227);async function a(){let e=n.default.join(r.default.homedir(),".openclaw","openclaw.json");return JSON.parse(await t.default.readFile(e,"utf8"))}async function i(){let e=await a(),t=e.agents?.defaults?.workspace;if(!t)throw Error("agents.defaults.workspace is not set in ~/.openclaw/openclaw.json");return t}async function s(){let e=await i();return n.default.join(e,"recipes")}async function o(){let e=await i(),r=n.default.join(e,"goals");try{if((await t.default.stat(r)).isDirectory())return r}catch{}return n.default.join(e,"notes","goals")}async function l(e){let t=r.default.homedir();if(!t)throw Error("Could not resolve home directory");return n.default.join(t,".openclaw",`workspace-${e}`)}function u(e,t){return"main"===t?n.default.resolve(e):n.default.resolve(e,"..",`workspace-${t}`)}function d(e){let t=e.replace(/\\/g,"/");if(!t||t.startsWith("/")||t.includes(".."))throw Error("Invalid file name");return t}async function c(){let e=await a(),t=e.plugins?.installs?.recipes?.installPath||e.plugins?.installs?.recipes?.sourcePath||e.plugins?.load?.paths?.[0];if(!t)throw Error("Could not determine recipes plugin install path from ~/.openclaw/openclaw.json");return n.default.join(t,"recipes","default")}e.s(["assertSafeRelativeFileName",()=>d,"getBuiltinRecipesDir",()=>c,"getTeamWorkspaceDir",()=>l,"getWorkspaceDir",()=>i,"getWorkspaceGoalsDir",()=>o,"getWorkspaceRecipesDir",()=>s,"readOpenClawConfig",()=>a,"teamDirFromBaseWorkspace",()=>u])},5365,(e,t,r)=>{t.exports=e.x("process",()=>require("process"))},874,(e,t,r)=>{t.exports=e.x("buffer",()=>require("buffer"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},72915,e=>{"use strict";var t=e.i(12714),r=e.i(50227),n=e.i(23008),a=e.i(5003),i=e.i(7367);function s(e){if(!e.startsWith("---\n"))throw Error("Recipe markdown must start with YAML frontmatter (---)");let t=e.indexOf("\n---\n",4);if(-1===t)throw Error("Recipe frontmatter not terminated (---)");let r=e.slice(4,t+1),a=n.default.parse(r);if(!a?.id)throw Error("Recipe frontmatter must include id");return a.id}async function o(){let e=await (0,a.runOpenClaw)(["recipes","list"]);if(!e.ok)return[];try{return JSON.parse(e.stdout)}catch{return[]}}async function l(e){return(await o()).find(t=>t.id===e)??null}async function u(e){let t="builtin"===e.source?await (0,i.getBuiltinRecipesDir)():await (0,i.getWorkspaceRecipesDir)();return r.default.join(t,`${e.id}.md`)}async function d(e,n){await t.default.mkdir(r.default.dirname(e),{recursive:!0}),await t.default.writeFile(e,n,"utf8")}e.s(["findRecipeById",()=>l,"parseFrontmatterId",()=>s,"resolveRecipePath",()=>u,"writeRecipeFile",()=>d])},64965,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),a=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),f=e.i(70101),h=e.i(26937),w=e.i(10372),x=e.i(93695);e.i(52474);var m=e.i(220),g=e.i(66680),R=e.i(89171),y=e.i(5003),v=e.i(72915);async function E(e,{params:t}){var r;let{id:n}=await t,a=await (0,v.findRecipeById)(n);if(!a)return R.NextResponse.json({error:`Recipe not found: ${n}`},{status:404});let i=await (0,y.runOpenClaw)(["recipes","show",n]),s=await (0,v.resolveRecipePath)(a).catch(()=>null),o=(r=i.stdout,g.default.createHash("sha256").update(r,"utf8").digest("hex"));return R.NextResponse.json({recipe:{...a,content:i.stdout,filePath:s},recipeHash:o,stderr:i.stderr})}async function C(e,{params:t}){let r,{id:n}=await t,a=await e.json();if("string"!=typeof a.content)return R.NextResponse.json({error:"Missing content"},{status:400});try{r=(0,v.parseFrontmatterId)(a.content)}catch(e){return R.NextResponse.json({error:e.message},{status:400})}if(r!==n)return R.NextResponse.json({error:`Frontmatter id (${r}) must match URL id (${n})`},{status:400});let i=await (0,v.findRecipeById)(n);if(!i)return R.NextResponse.json({error:`Recipe not found: ${n}`},{status:404});if("builtin"===i.source)return R.NextResponse.json({error:`Recipe ${n} is builtin and cannot be modified`},{status:403});let s=await (0,v.resolveRecipePath)(i);return await (0,v.writeRecipeFile)(s,a.content),R.NextResponse.json({ok:!0,filePath:s})}e.s(["GET",()=>E,"PUT",()=>C],89749);var b=e.i(89749);let k=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/recipes/[id]/route",pathname:"/api/recipes/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/recipes/[id]/route.ts",nextConfigOutput:"standalone",userland:b}),{workAsyncStorage:j,workUnitAsyncStorage:N,serverHooks:A}=k;function S(){return(0,n.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:N})}async function P(e,t,n){k.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/recipes/[id]/route";g=g.replace(/\/index$/,"")||"/";let R=await k.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,params:v,nextConfig:E,parsedUrl:C,isDraftMode:b,prerenderManifest:j,routerServerContext:N,isOnDemandRevalidate:A,revalidateOnlyGenerated:S,resolvedPathname:P,clientReferenceManifest:T,serverActionsManifest:O}=R,q=(0,o.normalizeAppPath)(g),_=!!(j.dynamicRoutes[q]||j.routes[P]),D=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,C,!1):t.end("This page could not be found"),null);if(_&&!b){let e=!!j.routes[P],t=j.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await D();throw new x.NoFallbackError}}let I=null;!_||k.isDev||b||(I="/index"===(I=P)?"/":I);let H=!0===k.isDev||!_,F=_&&!H;O&&T&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:T,serverActionsManifest:O});let U=e.method||"GET",$=(0,i.getTracer)(),M=$.getActiveScopeSpan(),B={params:v,prerenderManifest:j,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>k.onRequestError(e,t,n,a,N)},sharedContext:{buildId:y}},K=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),L=u.NextRequestAdapter.fromNodeNextRequest(K,(0,u.signalFromNodeResponse)(t));try{let s=async e=>k.handle(L,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${U} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${g}`)}),o=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var i,l;let u=async({previousCacheEntry:r})=>{try{if(!o&&A&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(a);e.fetchMetrics=B.renderOpts.fetchMetrics;let l=B.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let u=B.renderOpts.collectedTags;if(!_)return await (0,p.sendResponse)(K,W,i,B.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[w.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=w.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,n=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=w.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:A})},!1,N),t}},d=await k.handleResponse({req:e,nextConfig:E,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:j,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:S,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:o});if(!_)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",A?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let x=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return o&&_||x.delete(w.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||x.get("Cache-Control")||x.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,p.sendResponse)(K,W,new Response(d.value.body,{headers:x,status:d.value.status||200})),null};M?await l(M):await $.withPropagatedContext(e.headers,()=>$.trace(d.BaseServerSpan.handleRequest,{spanName:`${U} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},l))}catch(t){if(t instanceof x.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:A})},!1,N),_)throw t;return await (0,p.sendResponse)(K,W,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>S,"routeModule",()=>k,"serverHooks",()=>A,"workAsyncStorage",()=>j,"workUnitAsyncStorage",()=>N],64965)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__50fe6ff8._.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/paths.ts","../../../src/lib/recipes.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/recipes/%5Bid%5D/route.ts"],"sourcesContent":["// NOTE: This file is compiled by Next.js.\n// Do not import `openclaw/plugin-sdk` here (it is provided by the gateway runtime, not as an npm dep).\n\ntype KitchenApi = {\n config: unknown;\n runtime: {\n system: { runCommandWithTimeout: (argv: string[], opts: { timeoutMs: number }) => Promise<{ stdout?: string; stderr?: string }> };\n };\n};\n\nexport function getKitchenApi(): KitchenApi {\n const api = (globalThis as unknown as { __clawkitchen_api?: KitchenApi }).__clawkitchen_api;\n if (!api) {\n throw new Error(\n \"ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)\",\n );\n }\n return api;\n}\n","import { getKitchenApi } from \"@/lib/kitchen-api\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\n\nexport type OpenClawExecResult = {\n ok: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n};\n\nfunction extractStdout(err: { stdout?: unknown }): string {\n if (typeof err.stdout === \"string\") return err.stdout;\n if (err.stdout && typeof err.stdout === \"object\" && \"toString\" in err.stdout) {\n return String((err.stdout as { toString: () => string }).toString());\n }\n return \"\";\n}\n\nfunction resolveExitCode(res: { exitCode?: unknown; code?: unknown; status?: unknown }): number {\n if (typeof res.exitCode === \"number\") return res.exitCode;\n if (typeof res.code === \"number\") return res.code;\n if (typeof res.status === \"number\") return res.status;\n return 0;\n}\n\nfunction extractStderr(err: { stderr?: unknown; message?: unknown }, fallback: unknown): string {\n if (typeof err.stderr === \"string\") return err.stderr;\n if (err.stderr && typeof err.stderr === \"object\" && \"toString\" in err.stderr) {\n return String((err.stderr as { toString: () => string }).toString());\n }\n if (typeof err.message === \"string\") return err.message;\n return String(fallback);\n}\n\nasync function runOpenClawLocal(args: string[]): Promise<OpenClawExecResult> {\n try {\n const res = await execFileAsync(\"openclaw\", args, {\n timeout: 120000,\n windowsHide: true,\n maxBuffer: 10 * 1024 * 1024,\n });\n\n return {\n ok: true,\n exitCode: 0,\n stdout: String(res.stdout ?? \"\"),\n stderr: String(res.stderr ?? \"\"),\n };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n\nexport async function runOpenClaw(args: string[]): Promise<OpenClawExecResult> {\n // In some Kitchen runtime contexts, `api.runtime.system.runCommandWithTimeout`\n // is executed with a restricted allowlist that does not include the `cron` tool,\n // causing `openclaw cron ...` to fail with \"Tool not available: cron\".\n //\n // Cron routes need to work in the gateway-run Kitchen environment, so for cron\n // specifically we prefer a local exec (host OpenClaw).\n if (args[0] === \"cron\") return runOpenClawLocal(args);\n\n const api = getKitchenApi();\n try {\n const res = (await api.runtime.system.runCommandWithTimeout([\"openclaw\", ...args], { timeoutMs: 120000 })) as {\n stdout?: unknown;\n stderr?: unknown;\n exitCode?: unknown;\n code?: unknown;\n status?: unknown;\n };\n\n const stdout = String(res.stdout ?? \"\");\n const stderr = String(res.stderr ?? \"\");\n const exitCode = resolveExitCode(res);\n\n if (exitCode !== 0) return { ok: false, exitCode, stdout, stderr };\n return { ok: true, exitCode: 0, stdout, stderr };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n","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 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 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","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport YAML from \"yaml\";\nimport { runOpenClaw } from \"./openclaw\";\nimport { getBuiltinRecipesDir, getWorkspaceRecipesDir } from \"./paths\";\n\nexport type RecipeListItem = {\n id: string;\n name: string;\n kind: \"agent\" | \"team\";\n source: \"builtin\" | \"workspace\";\n};\n\nexport type RecipeDetail = RecipeListItem & {\n content: string;\n filePath: string | null;\n};\n\nexport function parseFrontmatterId(md: string): string {\n if (!md.startsWith(\"---\\n\")) throw new Error(\"Recipe markdown must start with YAML frontmatter (---)\");\n const end = md.indexOf(\"\\n---\\n\", 4);\n if (end === -1) throw new Error(\"Recipe frontmatter not terminated (---)\");\n const yamlText = md.slice(4, end + 1);\n const fm = YAML.parse(yamlText) as { id?: string };\n if (!fm?.id) throw new Error(\"Recipe frontmatter must include id\");\n return fm.id;\n}\n\n/** Ensures the frontmatter id field matches the given id. Preserves body. Returns md unchanged if no valid frontmatter. */\nexport function forceFrontmatterId(md: string, id: string): string {\n if (!md.startsWith(\"---\\n\")) return md;\n const end = md.indexOf(\"\\n---\\n\", 4);\n if (end === -1) return md;\n const fm = md.slice(4, end);\n const body = md.slice(end + 5);\n\n const lines = fm.split(\"\\n\");\n let found = false;\n const nextLines = lines.map((line) => {\n if (/^id\\s*:/i.test(line)) {\n found = true;\n return `id: ${id}`;\n }\n return line;\n });\n if (!found) nextLines.unshift(`id: ${id}`);\n\n return `---\\n${nextLines.join(\"\\n\")}\\n---\\n${body}`;\n}\n\n/** Returns display name for a team from recipe list, or null if not found. */\nexport async function getTeamDisplayName(teamId: string): Promise<string | null> {\n const recipes = await listRecipes();\n const match = recipes.find((r) => r.kind === \"team\" && r.id === teamId);\n return match?.name ?? null;\n}\n\n/** Fetches recipe list from openclaw. Returns empty array on failure. */\nexport async function listRecipes(): Promise<RecipeListItem[]> {\n const list = await runOpenClaw([\"recipes\", \"list\"]);\n if (!list.ok) return [];\n try {\n return JSON.parse(list.stdout) as RecipeListItem[];\n } catch {\n return [];\n }\n}\n\n/** Fetches recipe list and returns the item with the given id, or null. */\nexport async function findRecipeById(id: string): Promise<RecipeListItem | null> {\n const recipes = await listRecipes();\n return recipes.find((r) => r.id === id) ?? null;\n}\n\nexport async function resolveRecipePath(item: RecipeListItem): Promise<string> {\n const dir = item.source === \"builtin\" ? await getBuiltinRecipesDir() : await getWorkspaceRecipesDir();\n // Current convention: <id>.md in the directory.\n return path.join(dir, `${item.id}.md`);\n}\n\nexport async function readRecipe(item: RecipeListItem, contentFromCli: string): Promise<RecipeDetail> {\n // Prefer CLI-provided markdown, but also compute path for saving.\n let filePath: string | null = null;\n try {\n filePath = await resolveRecipePath(item);\n } catch {\n filePath = null;\n }\n return { ...item, content: contentFromCli, filePath };\n}\n\nexport async function writeRecipeFile(filePath: string, md: string) {\n await fs.mkdir(path.dirname(filePath), { recursive: true });\n await fs.writeFile(filePath, md, \"utf8\");\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/recipes/[id]/route\",\n pathname: \"/api/recipes/[id]\",\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/recipes/[id]/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/recipes/[id]/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","import crypto from \"node:crypto\";\nimport { NextResponse } from \"next/server\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { findRecipeById, parseFrontmatterId, resolveRecipePath, writeRecipeFile } from \"@/lib/recipes\";\n\nfunction sha256(text: string) {\n return crypto.createHash(\"sha256\").update(text, \"utf8\").digest(\"hex\");\n}\n\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n\n const item = await findRecipeById(id);\n if (!item) return NextResponse.json({ error: `Recipe not found: ${id}` }, { status: 404 });\n\n const shown = await runOpenClaw([\"recipes\", \"show\", id]);\n const filePath = await resolveRecipePath(item).catch(() => null);\n\n const recipeHash = sha256(shown.stdout);\n\n return NextResponse.json({ recipe: { ...item, content: shown.stdout, filePath }, recipeHash, stderr: shown.stderr });\n}\n\nexport async function PUT(\n req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n const body = (await req.json()) as { content?: string };\n if (typeof body.content !== \"string\") {\n return NextResponse.json({ error: \"Missing content\" }, { status: 400 });\n }\n\n // Validate frontmatter id matches route id.\n let parsedId: string;\n try {\n parsedId = parseFrontmatterId(body.content);\n } catch (e) {\n return NextResponse.json({ error: (e as Error).message }, { status: 400 });\n }\n if (parsedId !== id) {\n return NextResponse.json(\n { error: `Frontmatter id (${parsedId}) must match URL id (${id})` },\n { status: 400 }\n );\n }\n\n const item = await findRecipeById(id);\n if (!item) return NextResponse.json({ error: `Recipe not found: ${id}` }, { status: 404 });\n\n if (item.source === \"builtin\") {\n return NextResponse.json({ error: `Recipe ${id} is builtin and cannot be modified` }, { status: 403 });\n }\n\n const filePath = await resolveRecipePath(item);\n await writeRecipeFile(filePath, body.content);\n\n return NextResponse.json({ ok: true, filePath });\n}\n"],"names":[],"mappings":"mMAUO,SAAS,IACd,IAA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,AAAZ,EAAa,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,MAAM,EAAe,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,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":[4]}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/paths.ts","../../../src/lib/recipes.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/recipes/%5Bid%5D/route.ts"],"sourcesContent":["// NOTE: This file is compiled by Next.js.\n// Do not import `openclaw/plugin-sdk` here (it is provided by the gateway runtime, not as an npm dep).\n\ntype KitchenApi = {\n config: unknown;\n runtime: {\n system: { runCommandWithTimeout: (argv: string[], opts: { timeoutMs: number }) => Promise<{ stdout?: string; stderr?: string }> };\n };\n};\n\nexport function getKitchenApi(): KitchenApi {\n const api = (globalThis as unknown as { __clawkitchen_api?: KitchenApi }).__clawkitchen_api;\n if (!api) {\n throw new Error(\n \"ClawKitchen: OpenClaw plugin API not available. (This should only happen if Kitchen is started outside the gateway process.)\",\n );\n }\n return api;\n}\n","import { getKitchenApi } from \"@/lib/kitchen-api\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execFileAsync = promisify(execFile);\n\nexport type OpenClawExecResult = {\n ok: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n};\n\nfunction extractStdout(err: { stdout?: unknown }): string {\n if (typeof err.stdout === \"string\") return err.stdout;\n if (err.stdout && typeof err.stdout === \"object\" && \"toString\" in err.stdout) {\n return String((err.stdout as { toString: () => string }).toString());\n }\n return \"\";\n}\n\nfunction resolveExitCode(res: { exitCode?: unknown; code?: unknown; status?: unknown }): number {\n if (typeof res.exitCode === \"number\") return res.exitCode;\n if (typeof res.code === \"number\") return res.code;\n if (typeof res.status === \"number\") return res.status;\n return 0;\n}\n\nfunction extractStderr(err: { stderr?: unknown; message?: unknown }, fallback: unknown): string {\n if (typeof err.stderr === \"string\") return err.stderr;\n if (err.stderr && typeof err.stderr === \"object\" && \"toString\" in err.stderr) {\n return String((err.stderr as { toString: () => string }).toString());\n }\n if (typeof err.message === \"string\") return err.message;\n return String(fallback);\n}\n\nasync function runOpenClawLocal(args: string[]): Promise<OpenClawExecResult> {\n try {\n const res = await execFileAsync(\"openclaw\", args, {\n timeout: 120000,\n windowsHide: true,\n maxBuffer: 10 * 1024 * 1024,\n });\n\n return {\n ok: true,\n exitCode: 0,\n stdout: String(res.stdout ?? \"\"),\n stderr: String(res.stderr ?? \"\"),\n };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n\nexport async function runOpenClaw(args: string[]): Promise<OpenClawExecResult> {\n // In some Kitchen runtime contexts, `api.runtime.system.runCommandWithTimeout`\n // is executed with a restricted allowlist that does not include the `cron` tool,\n // causing `openclaw cron ...` to fail with \"Tool not available: cron\".\n //\n // Cron routes need to work in the gateway-run Kitchen environment, so for cron\n // specifically we prefer a local exec (host OpenClaw).\n if (args[0] === \"cron\") return runOpenClawLocal(args);\n\n const api = getKitchenApi();\n try {\n const res = (await api.runtime.system.runCommandWithTimeout([\"openclaw\", ...args], { timeoutMs: 120000 })) as {\n stdout?: unknown;\n stderr?: unknown;\n exitCode?: unknown;\n code?: unknown;\n status?: unknown;\n };\n\n const stdout = String(res.stdout ?? \"\");\n const stderr = String(res.stderr ?? \"\");\n const exitCode = resolveExitCode(res);\n\n if (exitCode !== 0) return { ok: false, exitCode, stdout, stderr };\n return { ok: true, exitCode: 0, stdout, stderr };\n } catch (e: unknown) {\n const err = e as { code?: unknown; stdout?: unknown; stderr?: unknown; message?: unknown };\n const exitCode = typeof err.code === \"number\" ? err.code : 1;\n const stdout = extractStdout(err);\n const stderr = extractStderr(err, e);\n return { ok: false, exitCode, stdout, stderr };\n }\n}\n","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","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport YAML from \"yaml\";\nimport { runOpenClaw } from \"./openclaw\";\nimport { getBuiltinRecipesDir, getWorkspaceRecipesDir } from \"./paths\";\n\nexport type RecipeListItem = {\n id: string;\n name: string;\n kind: \"agent\" | \"team\";\n source: \"builtin\" | \"workspace\";\n};\n\nexport type RecipeDetail = RecipeListItem & {\n content: string;\n filePath: string | null;\n};\n\nexport function parseFrontmatterId(md: string): string {\n if (!md.startsWith(\"---\\n\")) throw new Error(\"Recipe markdown must start with YAML frontmatter (---)\");\n const end = md.indexOf(\"\\n---\\n\", 4);\n if (end === -1) throw new Error(\"Recipe frontmatter not terminated (---)\");\n const yamlText = md.slice(4, end + 1);\n const fm = YAML.parse(yamlText) as { id?: string };\n if (!fm?.id) throw new Error(\"Recipe frontmatter must include id\");\n return fm.id;\n}\n\n/** Ensures the frontmatter id field matches the given id. Preserves body. Returns md unchanged if no valid frontmatter. */\nexport function forceFrontmatterId(md: string, id: string): string {\n if (!md.startsWith(\"---\\n\")) return md;\n const end = md.indexOf(\"\\n---\\n\", 4);\n if (end === -1) return md;\n const fm = md.slice(4, end);\n const body = md.slice(end + 5);\n\n const lines = fm.split(\"\\n\");\n let found = false;\n const nextLines = lines.map((line) => {\n if (/^id\\s*:/i.test(line)) {\n found = true;\n return `id: ${id}`;\n }\n return line;\n });\n if (!found) nextLines.unshift(`id: ${id}`);\n\n return `---\\n${nextLines.join(\"\\n\")}\\n---\\n${body}`;\n}\n\n/** Returns display name for a team from recipe list, or null if not found. */\nexport async function getTeamDisplayName(teamId: string): Promise<string | null> {\n const recipes = await listRecipes();\n const match = recipes.find((r) => r.kind === \"team\" && r.id === teamId);\n return match?.name ?? null;\n}\n\n/** Fetches recipe list from openclaw. Returns empty array on failure. */\nexport async function listRecipes(): Promise<RecipeListItem[]> {\n const list = await runOpenClaw([\"recipes\", \"list\"]);\n if (!list.ok) return [];\n try {\n return JSON.parse(list.stdout) as RecipeListItem[];\n } catch {\n return [];\n }\n}\n\n/** Fetches recipe list and returns the item with the given id, or null. */\nexport async function findRecipeById(id: string): Promise<RecipeListItem | null> {\n const recipes = await listRecipes();\n return recipes.find((r) => r.id === id) ?? null;\n}\n\nexport async function resolveRecipePath(item: RecipeListItem): Promise<string> {\n const dir = item.source === \"builtin\" ? await getBuiltinRecipesDir() : await getWorkspaceRecipesDir();\n // Current convention: <id>.md in the directory.\n return path.join(dir, `${item.id}.md`);\n}\n\nexport async function readRecipe(item: RecipeListItem, contentFromCli: string): Promise<RecipeDetail> {\n // Prefer CLI-provided markdown, but also compute path for saving.\n let filePath: string | null = null;\n try {\n filePath = await resolveRecipePath(item);\n } catch {\n filePath = null;\n }\n return { ...item, content: contentFromCli, filePath };\n}\n\nexport async function writeRecipeFile(filePath: string, md: string) {\n await fs.mkdir(path.dirname(filePath), { recursive: true });\n await fs.writeFile(filePath, md, \"utf8\");\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/recipes/[id]/route\",\n pathname: \"/api/recipes/[id]\",\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/recipes/[id]/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/recipes/[id]/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","import crypto from \"node:crypto\";\nimport { NextResponse } from \"next/server\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { findRecipeById, parseFrontmatterId, resolveRecipePath, writeRecipeFile } from \"@/lib/recipes\";\n\nfunction sha256(text: string) {\n return crypto.createHash(\"sha256\").update(text, \"utf8\").digest(\"hex\");\n}\n\nexport async function GET(\n _req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n\n const item = await findRecipeById(id);\n if (!item) return NextResponse.json({ error: `Recipe not found: ${id}` }, { status: 404 });\n\n const shown = await runOpenClaw([\"recipes\", \"show\", id]);\n const filePath = await resolveRecipePath(item).catch(() => null);\n\n const recipeHash = sha256(shown.stdout);\n\n return NextResponse.json({ recipe: { ...item, content: shown.stdout, filePath }, recipeHash, stderr: shown.stderr });\n}\n\nexport async function PUT(\n req: Request,\n { params }: { params: Promise<{ id: string }> }\n) {\n const { id } = await params;\n const body = (await req.json()) as { content?: string };\n if (typeof body.content !== \"string\") {\n return NextResponse.json({ error: \"Missing content\" }, { status: 400 });\n }\n\n // Validate frontmatter id matches route id.\n let parsedId: string;\n try {\n parsedId = parseFrontmatterId(body.content);\n } catch (e) {\n return NextResponse.json({ error: (e as Error).message }, { status: 400 });\n }\n if (parsedId !== id) {\n return NextResponse.json(\n { error: `Frontmatter id (${parsedId}) must match URL id (${id})` },\n { status: 400 }\n );\n }\n\n const item = await findRecipeById(id);\n if (!item) return NextResponse.json({ error: `Recipe not found: ${id}` }, { status: 404 });\n\n if (item.source === \"builtin\") {\n return NextResponse.json({ error: `Recipe ${id} is builtin and cannot be modified` }, { status: 403 });\n }\n\n const filePath = await resolveRecipePath(item);\n await writeRecipeFile(filePath, body.content);\n\n return NextResponse.json({ ok: true, filePath });\n}\n"],"names":[],"mappings":"mMAUO,SAAS,IACd,IAAM,EAAO,WAA6D,iBAAiB,CAC3F,GAAI,CAAC,EACH,GADQ,GACF,AAAI,MACR,gIAGJ,OAAO,CACT,qDClBA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGA,IAAM,EAAgB,CAAA,EAFtB,AAEsB,EAFtB,CAAA,CAAA,OAEsB,SAAA,AAAS,EAAC,EAAA,QAAQ,EASxC,SAAS,EAAc,CAAyB,QAC9C,AAAI,AAAsB,UAAU,OAAzB,EAAI,MAAM,CAAsB,EAAI,MAAM,CACjD,EAAI,MAAM,EAA0B,UAAtB,OAAO,EAAI,MAAM,EAAiB,aAAc,EAAI,MAAM,CACnE,CADqE,MAC7D,EAAI,MAAM,CAAgC,QAAQ,IAE5D,EACT,CASA,SAAS,EAAc,CAA4C,CAAE,CAAiB,QACpF,AAA0B,UAAtB,AAAgC,OAAzB,EAAI,MAAM,CAAsB,EAAI,MAAM,CACjD,EAAI,MAAM,EAA0B,UAAtB,OAAO,EAAI,MAAM,EAAiB,aAAc,EAAI,MAAM,CACnE,CADqE,MAC7D,EAAI,MAAM,CAAgC,QAAQ,IAExC,UAAvB,AAAiC,OAA1B,EAAI,OAAO,CAAsB,EAAI,OAAO,CAChD,OAAO,EAChB,CAEA,eAAe,EAAiB,CAAc,EAC5C,GAAI,CACF,IAAM,EAAM,MAAM,EAAc,WAAY,EAAM,CAChD,QAAS,KACT,aAAa,EACb,UAAW,KAAK,GAClB,GAEA,CAHyB,KAGlB,CACL,IAAI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