@jiggai/kitchen 0.5.10 → 0.5.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_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cron/add/route.js +1 -1
- package/.next/server/app/api/cron/add/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/bulk/route.js +1 -1
- package/.next/server/app/api/cron/bulk/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/delete/route.js +1 -1
- package/.next/server/app/api/cron/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/edit/route.js +1 -1
- package/.next/server/app/api/cron/edit/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/job/route.js +1 -1
- package/.next/server/app/api/cron/job/route.js.nft.json +1 -1
- package/.next/server/app/api/cron/jobs/route.js +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 +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 +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/plugins/[pluginId]/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/plugins/[pluginId]/tabs/[tabId]/route.js.nft.json +1 -1
- package/.next/server/app/api/plugins/route.js.nft.json +1 -1
- package/.next/server/app/api/plugins/test/route.js.nft.json +1 -1
- package/.next/server/app/api/recipes/[id]/route.js +1 -1
- package/.next/server/app/api/recipes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/recipes/delete/route.js +1 -1
- package/.next/server/app/api/recipes/delete/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/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/orchestrator/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/plugins/route.js.nft.json +1 -1
- package/.next/server/app/api/teams/remove-team/route.js +1 -1
- package/.next/server/app/api/teams/remove-team/route.js.nft.json +1 -1
- package/.next/server/app/api/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_client-reference-manifest.js +1 -1
- package/.next/server/app/channels.html +2 -2
- package/.next/server/app/channels.rsc +3 -3
- package/.next/server/app/channels.segments/_full.segment.rsc +3 -3
- package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
- package/.next/server/app/channels.segments/_index.segment.rsc +2 -2
- package/.next/server/app/channels.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
- package/.next/server/app/cron-jobs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/goals/[id]/page_client-reference-manifest.js +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 +3 -3
- package/.next/server/app/goals/new.segments/_full.segment.rsc +3 -3
- package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals/new.segments/_index.segment.rsc +2 -2
- package/.next/server/app/goals/new.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +1 -1
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/goals.html +1 -1
- package/.next/server/app/goals.rsc +3 -3
- package/.next/server/app/goals.segments/_full.segment.rsc +3 -3
- package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
- package/.next/server/app/goals.segments/_index.segment.rsc +2 -2
- package/.next/server/app/goals.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +1 -1
- 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 +1 -1
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/runs/page_client-reference-manifest.js +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 +3 -3
- package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/app/teams/[teamId]/deliverables/page.js +2 -2
- package/.next/server/app/teams/[teamId]/deliverables/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/deliverables/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page.js +2 -2
- package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/runs/[workflowId]/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/runs/page_client-reference-manifest.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.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/tickets/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page.js +1 -1
- package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/workflows/[workflowId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/teams/[teamId]/workflows/page.js +3 -3
- package/.next/server/app/teams/[teamId]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/teams/[teamId]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tickets/[ticket]/page.js.nft.json +1 -1
- package/.next/server/app/tickets/[ticket]/page_client-reference-manifest.js +1 -1
- 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]__1331482c._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1331482c._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__24d25a8c._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__24d25a8c._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__3d9c4025._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__3d9c4025._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__83753ef0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__83753ef0._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__8799df50._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__8799df50._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__a90f7cdc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__a90f7cdc._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__afde9f7c._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__afde9f7c._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__e3431817._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__e3431817._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__e6ecca08._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__e6ecca08._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__d0634ad4._.js → [root-of-the-server]__fc511c8f._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__fc511c8f._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__fcde644b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__fcde644b._.js.map +1 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_cb6ddb24.js +2 -2
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_cb6ddb24.js.map +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__becf14db._.js → [root-of-the-server]__0a8db855._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0a8db855._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__4d24c088._.js → [root-of-the-server]__18154c9e._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__18154c9e._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__52cb8e0e._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__52cb8e0e._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__7af8e528._.js +9 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__7af8e528._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__7c14561e._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__7c14561e._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__c97fe9e9._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__c97fe9e9._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__e9faef37._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__e9faef37._.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/_15bc566e._.js +9 -0
- package/.next/server/chunks/ssr/_15bc566e._.js.map +1 -0
- package/.next/server/chunks/ssr/{_835573ec._.js → _3d6d3f59._.js} +8 -2
- package/.next/server/chunks/ssr/_3d6d3f59._.js.map +1 -0
- package/.next/server/chunks/ssr/b1a17_app_teams_[teamId]_workflows_[workflowId]_workflows-editor-client_tsx_5e714aa2._.js +1 -7
- package/.next/server/chunks/ssr/b1a17_app_teams_[teamId]_workflows_[workflowId]_workflows-editor-client_tsx_5e714aa2._.js.map +1 -1
- package/.next/server/chunks/ssr/src_app_teams_[teamId]_runs_[workflowId]_[runId]_run-detail-client_tsx_56f0cbd7._.js +1 -1
- package/.next/server/chunks/ssr/src_app_teams_[teamId]_runs_[workflowId]_[runId]_run-detail-client_tsx_56f0cbd7._.js.map +1 -1
- package/.next/server/chunks/ssr/src_app_teams_[teamId]_workflows_workflows-client_tsx_12742cc9._.js +1 -1
- package/.next/server/chunks/ssr/src_app_teams_[teamId]_workflows_workflows-client_tsx_12742cc9._.js.map +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/2a86fa0c3d9177c5.js +7 -0
- package/.next/static/chunks/4a57b795d958b061.js +1 -0
- package/.next/static/chunks/67a9a9a3c6dd4aa4.js +7 -0
- package/.next/static/chunks/a683f58aaf4f41e9.css +3 -0
- package/.next/static/chunks/{212477db59154fa7.js → b641409c1c9d8c3e.js} +3 -3
- package/.next/static/chunks/{fac5526bd312cf6e.js → b8722104d0ceb74d.js} +9 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/[root-of-the-server]__2705b289._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__2705b289._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__28a2e162._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__28a2e162._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__30cd38e9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__30cd38e9._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__55defc7c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__55defc7c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__69c065ce._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__69c065ce._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__6b759340._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__6b759340._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__70a062f7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__70a062f7._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__783b6b5b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__783b6b5b._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__9f73c31b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__9f73c31b._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__d0634ad4._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__f3e3dd8e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__f3e3dd8e._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__3f55f975._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__3f55f975._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__4d24c088._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__6390ce9c._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__6390ce9c._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__a2e3966f._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__a2e3966f._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__becf14db._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__cb91405c._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__cb91405c._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__f59c3144._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__f59c3144._.js.map +0 -1
- package/.next/server/chunks/ssr/_835573ec._.js.map +0 -1
- package/.next/static/chunks/24ac17715eb2614d.js +0 -1
- package/.next/static/chunks/8b99ae14a606b607.css +0 -3
- package/.next/static/chunks/d593ea5e91e81b45.js +0 -1
- package/.next/static/chunks/ff661b5e599f8d74.js +0 -7
- /package/.next/static/{3JkH3_7LqC0wr-k7JoZl9 → p8YaBY0FwA86zQelkOQ-m}/_buildManifest.js +0 -0
- /package/.next/static/{3JkH3_7LqC0wr-k7JoZl9 → p8YaBY0FwA86zQelkOQ-m}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{3JkH3_7LqC0wr-k7JoZl9 → p8YaBY0FwA86zQelkOQ-m}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82310,e=>{"use strict";function t(e){return e instanceof Error?e.message:String(e)}e.s(["errorMessage",()=>t])},44355,e=>{"use strict";var t=e.i(18050),r=e.i(74080);function a({open:e,onClose:a,title:s,children:i,error:o,confirmLabel:l,confirmBusyLabel:n,onConfirm:d,confirmDisabled:c,busy:m,confirmButtonClassName:u}){if(!e)return null;let x=m??!1,h=x&&n?n:l,p="confirmation-modal-title";return(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[200]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:a,"aria-hidden":"true"}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",role:"dialog","aria-modal":"true","aria-labelledby":p,children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"w-full max-w-lg rounded-2xl border border-white/10 bg-[color:var(--ck-bg-soft)] p-5 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsx)("h2",{id:p,className:"text-lg font-semibold text-[color:var(--ck-text-primary)]",children:s}),i,o?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:o}):null,(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:(c??!1)||x,onClick:d,className:u??"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[var(--ck-accent-red-hover)] disabled:opacity-50",children:h})]})]})})})]}),document.body)}e.s(["ConfirmationModal",()=>a])},54510,e=>{"use strict";var t=e.i(18050),r=e.i(44355);function a({open:e,onClose:a,title:s,entityLabel:i,bodyText:o,onConfirm:l,busy:n,error:d}){return(0,t.jsx)(r.ConfirmationModal,{open:e,onClose:a,title:s,confirmLabel:"Delete",confirmBusyLabel:"Deleting…",onConfirm:l,busy:n,error:d??void 0,children:(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:[s," ",(0,t.jsx)("code",{className:"font-mono",children:i}),"? ",o]})})}function s(e){return function(r){let s=r[e.entityLabelKey];return(0,t.jsx)(a,{open:r.open,onClose:r.onClose,title:e.title,entityLabel:s,bodyText:e.bodyText,onConfirm:r.onConfirm,busy:r.busy,error:r.error})}}let i=s({title:"Delete agent",bodyText:"This will remove its workspace/state.",entityLabelKey:"agentId"}),o=s({title:"Delete Team",bodyText:"This will remove the team workspace, agents, and stamped cron jobs.",entityLabelKey:"teamId"}),l=s({title:"Delete recipe",bodyText:"This removes the markdown file from your workspace.",entityLabelKey:"recipeId"}),n=s({title:"Delete cron job",bodyText:"This removes it from the Gateway scheduler. You can recreate it later.",entityLabelKey:"jobLabel"});e.s(["DeleteAgentModal",0,i,"DeleteCronJobModal",0,n,"DeleteRecipeModal",0,l,"DeleteTeamModal",0,o],54510)},55613,e=>{"use strict";var t=e.i(18050),r=e.i(74080);function a({open:e,onClose:a,title:s,children:i,size:o="md",hideTitle:l=!1}){if(!e)return null;let n="modal-title";return(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[200]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:a,"aria-hidden":"true"}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",role:"dialog","aria-modal":"true","aria-labelledby":n,children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,t.jsxs)("div",{className:`w-full ${{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-6xl"}[o]} rounded-2xl border border-white/10 bg-[color:var(--ck-bg-soft)] p-6 shadow-[var(--ck-shadow-2)]`,children:[l?(0,t.jsx)("h2",{id:n,className:"sr-only",children:s}):(0,t.jsx)("h2",{id:n,className:"text-lg font-semibold text-[color:var(--ck-text-primary)] mb-4",children:s}),i]})})})]}),document.body)}e.s(["Modal",()=>a])},88810,72532,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(18566),s=e.i(82310),i=e.i(42771),o=e.i(54510);function l({title:e,files:r,loading:a,showOptionalFiles:s,onShowOptionalChange:i,selectedFileName:o,onSelectFile:l,renderItemExtra:n}){let d=s?r:r.filter(e=>e.required||!e.missing);return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:e}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:s,onChange:e=>i(e.target.checked)}),"Show optional"]})]}),(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Default view hides optional missing files to reduce noise."}),(0,t.jsxs)("ul",{className:"mt-3 space-y-1",children:[a?(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,d.map(e=>{var r;let a;return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(e.name),className:(r=e.name,a="w-full rounded-lg px-3 py-2 text-left text-sm",o===r?`${a} bg-white/10 text-[color:var(--ck-text-primary)]`:`${a} text-[color:var(--ck-text-secondary)] hover:bg-white/5`),children:[(0,t.jsx)("span",{className:e.required?"text-[color:var(--ck-text-primary)]":"text-[color:var(--ck-text-secondary)]",children:e.name}),(0,t.jsx)("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:e.required?"required":"optional"}),e.missing?(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"missing"}):null]}),n?.(e)]})},e.name)})]})]})}function n({name:e,emoji:r,theme:a,avatar:s,saving:i,returnTo:o,onNameChange:l,onEmojiChange:n,onThemeChange:d,onAvatarChange:c,onSave:m,router:u}){return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Identity"}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Name"}),(0,t.jsx)("input",{value:e,onChange:e=>l(e.target.value),className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Emoji"}),(0,t.jsx)("input",{value:r,onChange:e=>n(e.target.value),placeholder:"🦞",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Theme"}),(0,t.jsx)("input",{value:a,onChange:e=>d(e.target.value),placeholder:"warm, sharp, calm",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Avatar"}),(0,t.jsx)("input",{value:s,onChange:e=>c(e.target.value),placeholder:"avatars/openclaw.png",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row",children:[(0,t.jsx)("button",{disabled:i,onClick:m,className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[var(--ck-accent-red-hover)] active:bg-[var(--ck-accent-red-active)] disabled:opacity-50",children:i?"Saving…":"Save"}),o?(0,t.jsx)("button",{disabled:i,onClick:async()=>{await m(),u.push(o)},className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15 disabled:opacity-50",children:"Save & return"}):null]})]})}function d({model:e,saving:r,onModelChange:a,onSave:s}){return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Config"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"Thin slice: edit the configured model id for this agent (writes to OpenClaw config)."}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Model"}),(0,t.jsx)("input",{value:e,onChange:e=>a(e.target.value),placeholder:"openai/gpt-5.2",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)("button",{disabled:r,onClick:s,className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:r?"Saving…":"Save config"})})]})}function c({agentId:e,skillsList:r,availableSkills:a,skillsLoading:s,selectedSkill:i,installingSkill:o,skillError:l,skillMsg:n,onSelectedSkillChange:d,onInstallSkill:c}){return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Skills"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Skills installed in this ",(0,t.jsx)("strong",{children:"agent"})," workspace (",(0,t.jsx)("code",{children:"skills/"}),"). If you want a skill available to all agents, add it at the team level."]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Installed"}),(0,t.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[s&&(0,t.jsx)("li",{children:"Loading…"}),!s&&r.length>0&&r.map(e=>(0,t.jsx)("li",{children:e},e)),!s&&!r.length&&(0,t.jsx)("li",{children:"None installed."})]})]}),(0,t.jsxs)("div",{className:"mt-5 rounded-lg border border-white/10 bg-white/5 p-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Add a skill"}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,t.jsx)("select",{value:i,onChange:e=>d(e.target.value),className:"w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",disabled:o||!a.length,children:a.length?a.map(e=>(0,t.jsx)("option",{value:e,children:e},e)):(0,t.jsx)("option",{value:"",children:"No skills found"})}),(0,t.jsx)("button",{type:"button",disabled:o||!i,onClick:()=>void c(),className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:o?"Adding…":"Add"})]}),l&&(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:l}),!l&&n&&(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-emerald-400/30 bg-emerald-500/10 p-3 text-sm text-emerald-100",children:n}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["This uses ",(0,t.jsxs)("code",{children:["openclaw recipes install-skill <skill> --agent-id ",e," --yes"]}),"."]})]})]})}function m({agentFiles:e,agentFilesLoading:r,showOptionalFiles:a,fileName:s,fileContent:i,loadingFile:o,saving:n,fileError:d,onShowOptionalChange:c,onLoadFile:m,onFileContentChange:u,onSaveFile:x,onCreateMissingFile:h}){return(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsx)(l,{title:"Agent files",files:e,loading:r,showOptionalFiles:a,onShowOptionalChange:c,selectedFileName:s,onSelectFile:m,renderItemExtra:e=>e.missing?(0,t.jsx)("button",{type:"button",disabled:n,onClick:()=>void h(e.name),className:"shrink-0 rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Create"}):null}),(0,t.jsxs)("div",{className:"ck-card p-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:["Edit: ",s]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[o?(0,t.jsx)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Loading…"}):null,(0,t.jsx)("button",{disabled:n,onClick:x,className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:n?"Saving…":"Save file"})]})]}),d?(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:d}):null,(0,t.jsx)("textarea",{value:i,onChange:e=>u(e.target.value),className:"mt-3 h-[55vh] w-full resize-none rounded-lg border border-white/10 bg-white/5 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]",spellCheck:!1})]})]})}async function u(e,t){t.setAgentFilesLoading(!0),t.setSkillsLoading(!0);try{let[r,a,s]=await (0,i.fetchAll)([`/api/agents/files?agentId=${encodeURIComponent(e)}`,`/api/agents/skills?agentId=${encodeURIComponent(e)}`,"/api/skills/available"]),o=[];try{let e=await r.json();if(r.ok&&e.ok){let r=Array.isArray(e.files)?e.files:[];t.setAgentFiles(r.map(e=>({name:String(e.name??""),missing:!!e.missing,required:!!e.required,rationale:"string"==typeof e.rationale?e.rationale:void 0})))}}catch{}try{let e=await a.json();a.ok&&e.ok&&(o=Array.isArray(e.skills)?e.skills:[],t.setSkillsList(o))}catch{}try{let e=await s.json();if(s.ok&&e.ok){let r=Array.isArray(e.skills)?e.skills:[];t.setAvailableSkills(r);let a=r.find(e=>!o.includes(e));t.setSelectedSkill(a??r[0]??"")}}catch{}}finally{t.setAgentFilesLoading(!1),t.setSkillsLoading(!1)}}function x({agentId:e,returnTo:l,onClose:x}){let h=(0,a.useRouter)(),[p,f]=(0,r.useState)(null),[g,v]=(0,r.useState)(!0),[b,w]=(0,r.useState)(!1),[y,j]=(0,r.useState)(!1),[k,N]=(0,r.useState)(""),[S,C]=(0,r.useState)(""),[I,E]=(0,r.useState)(""),[P,A]=(0,r.useState)(""),[_,R]=(0,r.useState)(!1),[O,M]=(0,r.useState)(!1),[$,T]=(0,r.useState)(null),[L,U]=(0,r.useState)("identity"),[D,F]=(0,r.useState)(""),[z,B]=(0,r.useState)(""),[q,J]=(0,r.useState)(""),[W,G]=(0,r.useState)(""),[K,H]=(0,r.useState)(""),[V,X]=(0,r.useState)([]),[Y,Q]=(0,r.useState)([]),[Z,ee]=(0,r.useState)(!1),[et,er]=(0,r.useState)(""),[ea,es]=(0,r.useState)(!1),[ei,eo]=(0,r.useState)([]),[el,en]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(!1),[em,eu]=(0,r.useState)("SOUL.md"),[ex,eh]=(0,r.useState)(""),ep=e.includes("-")?e.split("-").slice(0,-1).join("-"):"";async function ef(e){w(!0),N("");try{let t=await e();N(t)}catch(e){N((0,s.errorMessage)(e))}finally{w(!1)}}async function eg(){await ef(async()=>(await (0,i.fetchJson)("/api/agents/identity",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,name:D,emoji:z,theme:q,avatar:W})}),"Saved identity via openclaw agents set-identity"))}async function ev(){await ef(async()=>(await (0,i.fetchJson)("/api/agents/update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,patch:{model:K}})}),"Saved agent config (model) and restarted gateway"))}async function eb(t){eu(t),eh(""),j(!0),C("");try{let r=await (0,i.fetchJson)(`/api/agents/file?agentId=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{cache:"no-store"});if(!r.ok)throw Error("Failed to load file");eh(String(r.content??""))}catch(e){C((0,s.errorMessage)(e))}finally{j(!1)}}async function ew(){w(!0),C("");try{if(!(await (0,i.fetchJson)("/api/agents/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,name:em,content:ex})})).ok)throw Error("Failed to save file");try{let t=await (0,i.fetchJson)(`/api/agents/files?agentId=${encodeURIComponent(e)}`,{cache:"no-store"});t.ok&&Array.isArray(t.files)&&eo(t.files)}catch{}}catch(e){C((0,s.errorMessage)(e))}finally{w(!1)}}async function ey(e){eu(e),C(""),eh(function(e){switch(e){case"SOUL.md":return"# SOUL.md\n\n";case"AGENTS.md":return"# AGENTS.md\n\n";case"TOOLS.md":return"# TOOLS.md\n\n";case"STATUS.md":return"# STATUS.md\n\n- (empty)\n";case"NOTES.md":return"# NOTES.md\n\n- (empty)\n";case"IDENTITY.md":return"# IDENTITY.md\n\n- **Name:**\n- **Creature:**\n- **Vibe:**\n- **Emoji:**\n- **Avatar:**\n";case"USER.md":return"# USER.md\n\n";case"HEARTBEAT.md":return"# HEARTBEAT.md\n\n# Keep this file empty (or with only comments) to skip heartbeat API calls.\n";default:return""}}(e)),await ew()}async function ej(){M(!0),T(null),N("");try{await (0,i.fetchJson)(`/api/agents/${encodeURIComponent(e)}`,{method:"DELETE"}),window.location.href="/"}catch(e){T((0,s.errorMessage)(e)),M(!1)}}return(0,r.useEffect)(()=>{(async()=>{v(!0),N("");try{let t=await (0,i.fetchJson)("/api/agents",{cache:"no-store"}),r=(Array.isArray(t.agents)?t.agents:[]).find(t=>t.id===e)??null;f(r),F(r?.identityName??""),H(r?.model??""),v(!1),u(e,{setAgentFiles:eo,setSkillsList:X,setAvailableSkills:Q,setSelectedSkill:er,setAgentFilesLoading:en,setSkillsLoading:ee})}catch(e){N((0,s.errorMessage)(e))}finally{v(!1)}})()},[e]),(0,r.useEffect)(()=>{if("files"!==L||!ei.length)return;let e=ei.some(e=>e.name===em),t=ei[0]?.name,r=e?em:t;r&&(r!==em&&(eu(r),eh("")),ex||eb(r))},[L,e,ei.length]),g?(0,t.jsx)("div",{className:"w-full",children:"Loading…"}):p?(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[x?(0,t.jsx)("button",{type:"button",onClick:x,className:"text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]",title:"Close",children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,t.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}):null,(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:p.identityName||p.id}),(0,t.jsxs)("p",{className:"mt-1 text-sm font-mono text-[color:var(--ck-text-tertiary)]",children:[p.id,p.isDefault?" · default":"",p.model?` \xb7 ${p.model}`:""]})]})]}),(0,t.jsx)("button",{type:"button",disabled:b,onClick:()=>{T(null),R(!0)},className:"rounded-lg border border-[color:rgba(255,59,48,0.45)] bg-[color:rgba(255,59,48,0.08)] px-3 py-2 text-sm font-medium text-[color:var(--ck-accent-red)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[color:rgba(255,59,48,0.12)] disabled:opacity-50",children:"Delete agent"})]}),p.workspace?(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Workspace: ",p.workspace]}):null,ep?(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Team: ",ep]}):null,k?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-white/10 bg-white/5 p-3 text-sm text-[color:var(--ck-text-primary)]",children:k}):null,(0,t.jsx)("div",{className:"mt-6 flex flex-wrap gap-2",children:[{id:"identity",label:"Identity"},{id:"config",label:"Config"},{id:"skills",label:"Skills"},{id:"files",label:"Files"}].map(e=>(0,t.jsx)("button",{onClick:()=>U(e.id),className:L===e.id?"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)]":"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] hover:bg-white/10",children:e.label},e.id))}),(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4",children:["identity"===L&&(0,t.jsx)(n,{name:D,emoji:z,theme:q,avatar:W,saving:b,returnTo:l,onNameChange:F,onEmojiChange:B,onThemeChange:J,onAvatarChange:G,onSave:eg,router:h}),"config"===L&&(0,t.jsx)(d,{model:K,saving:b,onModelChange:H,onSave:ev}),"skills"===L&&(0,t.jsx)(c,{agentId:e,skillsList:V,availableSkills:Y,skillsLoading:Z,selectedSkill:et,installingSkill:ea,skillError:P,skillMsg:I,onSelectedSkillChange:er,onInstallSkill:async()=>{es(!0),E(""),A("");try{await (0,i.fetchJson)("/api/agents/skills/install",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,skill:et})}),E(`Installed skill: ${et}`);try{let t=await (0,i.fetchJson)(`/api/agents/skills?agentId=${encodeURIComponent(e)}`,{cache:"no-store"});t.ok&&Array.isArray(t.skills)&&X(t.skills)}catch{}}catch(e){A((0,s.errorMessage)(e))}finally{es(!1)}}}),"files"===L&&(0,t.jsx)(m,{agentFiles:ei,agentFilesLoading:el,showOptionalFiles:ed,fileName:em,fileContent:ex,loadingFile:y,saving:b,fileError:S,onShowOptionalChange:ec,onLoadFile:eb,onFileContentChange:eh,onSaveFile:ew,onCreateMissingFile:ey})]}),(0,t.jsx)(o.DeleteAgentModal,{open:_,agentId:e,busy:O,error:$,onClose:()=>R(!1),onConfirm:()=>void ej()})]}):(0,t.jsxs)("div",{className:"w-full",children:["Agent not found: ",e]})}e.s(["FileListWithOptionalToggle",()=>l],72532),e.s(["default",()=>x],88810)},92140,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(22016),s=e.i(18566),i=e.i(42771),o=e.i(82310),l=e.i(44355);function n(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function d({teamId:e,llmTaskEnabled:d}){let c=(0,s.useRouter)(),[m,u]=(0,r.useState)([]),[x,h]=(0,r.useState)(!0),[p,f]=(0,r.useState)(!1),[g,v]=(0,r.useState)(""),[b,w]=(0,r.useState)(""),[y,j]=(0,r.useState)({}),[k,N]=(0,r.useState)({}),[S,C]=(0,r.useState)(""),[I,E]=(0,r.useState)(""),[P,A]=(0,r.useState)(null),[_,R]=(0,r.useState)(""),[O,M]=(0,r.useState)(""),[$,T]=(0,r.useState)(!1),[L,U]=(0,r.useState)(""),[D,F]=(0,r.useState)(""),[z,B]=(0,r.useState)([]),[q,J]=(0,r.useState)(""),W=(0,r.useCallback)(async t=>{U(t),J("");try{let r=await (0,i.fetchJson)(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`,{cache:"no-store"});if(!r.ok||!r.workflow)throw Error(r.error||"Failed to load workflow");let a=r.workflow,s=n(a.meta)?a.meta:{};if(!0!==s.skipCronCheck){let e=Array.isArray(a.nodes)?a.nodes:[],r=Array.from(new Set(e.filter(e=>e.type&&!["start","end","human_approval"].includes(String(e.type))).map(e=>{let t=n(e.config)?e.config:{};return String(t.agentId??"").trim()}).filter(Boolean))),s=await (0,i.fetchJson)("/api/cron/jobs",{cache:"no-store"});if(!s.ok)throw Error(s.error||"Failed to load cron jobs");let o=Array.isArray(s.jobs)?s.jobs:[],l={};for(let e of o){if(!e||!e.enabled)continue;let t=String(e.name??""),r=String(e.payload?.message??"");if(!(t.startsWith("workflow-worker:")||r.includes("worker-tick")))continue;let a=t.match(/^workflow-worker:[^:]+:(.+)$/);if(a?.[1]){l[a[1]]=!0;continue}let s=r.match(/--agent-id\s+(\S+)/);s?.[1]&&(l[s[1]]=!0)}let d=r.filter(e=>!l[e]);if(d.length){B(d),F(t);return}}let o=await (0,i.fetchJson)("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,mode:"run_now"})});if(!o.ok)throw Error(o.error||"Failed to create run");let l=String(o.runId??"").trim();l?c.push(`/teams/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/${encodeURIComponent(l)}`):w(t)}catch(e){B([]),F(""),J((0,o.errorMessage)(e))}finally{U("")}},[e,c]),G=(0,r.useCallback)(async t=>{let r=!!t?.quiet;v(""),r||h(!0);try{let t=await (0,i.fetchJson)(`/api/teams/workflows?teamId=${encodeURIComponent(e)}`,{cache:"no-store"});if(!t.ok)throw Error("Failed to load workflows");let r=(Array.isArray(t.files)?t.files:[]).map(e=>e.endsWith(".workflow.json")?e.slice(0,-14):null).filter(e=>!!e);u(r.map(e=>({id:e,name:e})))}catch(e){v((0,o.errorMessage)(e))}finally{r||h(!1)}},[e]);async function K(){f(!0);try{await G({quiet:!0})}finally{f(!1)}}async function H(t){if(confirm(`Delete workflow “${t}”? This removes the .workflow.json file from the team workspace.`)){v("");try{let r=await (0,i.fetchJson)(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`,{method:"DELETE"});if(!r.ok)throw Error(r.error||"Failed to delete workflow");await G({quiet:!0}),b===t&&(w(""),C(""),A(null))}catch(e){v((0,o.errorMessage)(e))}}}async function V(t){N(e=>({...e,[t]:!0})),R("");try{let r=await (0,i.fetchJson)(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"});if(!r.ok)throw Error(r.error||"Failed to load runs");let a=Array.isArray(r.runIds)?r.runIds.map(e=>String(e||"").trim()).filter(Boolean):Array.isArray(r.files)?r.files.map(e=>"string"==typeof e&&e.endsWith(".run.json")?e.slice(0,-9):null).filter(e=>!!e):[];j(e=>({...e,[t]:a}))}catch(e){R((0,o.errorMessage)(e)),j(e=>({...e,[t]:[]}))}finally{N(e=>({...e,[t]:!1}))}}async function X(t,r){E(t),C(r),A(null),R(""),M("");try{let a=await (0,i.fetchJson)(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}&runId=${encodeURIComponent(r)}`,{cache:"no-store"});if(!a.ok)throw Error(a.error||"Failed to load run");let s=n(a.run)?a.run:null;if(!s)throw Error("Invalid run format");A({id:String(s.id??r),status:"string"==typeof s.status?s.status:void 0,startedAt:"string"==typeof s.startedAt?s.startedAt:void 0,finishedAt:"string"==typeof s.finishedAt?String(s.finishedAt):void 0,meta:s.meta,memoryUsed:s.memoryUsed,approval:s.approval,raw:s})}catch(e){R((0,o.errorMessage)(e)),A(null)}}async function Y(t){if(confirm(`Add workflow from template “${t}”?`)){v("");try{let r=await (0,i.fetchJson)("/api/teams/workflow-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,templateId:t})});if(!r.ok)throw Error(r.error||"Failed to apply template");let a=String(r.workflowId??"").trim();if(!a)throw Error("Template applied but workflowId missing");await G({quiet:!0}),c.push(`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(a)}`)}catch(e){v((0,o.errorMessage)(e))}}}(0,r.useEffect)(()=>{G()},[G]);let Q=(0,r.useMemo)(()=>{if(!P)return[];let e=P.memoryUsed??(n(P.meta)?P.meta.memoryUsed:void 0);return Array.isArray(e)?e.map(e=>n(e)?e:null).filter(Boolean).map(e=>({ts:String(e.ts??"").trim(),author:String(e.author??"").trim(),type:String(e.type??"").trim(),content:String(e.content??"").trim(),source:e.source})).filter(e=>e.ts&&e.author&&e.type&&e.content):[]},[P]);if(x)return(0,t.jsx)("div",{className:"ck-card p-4",children:"Loading workflows…"});let Z=!1===d?(0,t.jsxs)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 p-4 text-sm",children:[(0,t.jsx)("div",{className:"font-medium text-amber-200",children:"LLM support is not enabled"}),(0,t.jsxs)("div",{className:"mt-1 text-[color:var(--ck-text-secondary)]",children:["Workflow LLM nodes require the optional built-in ",(0,t.jsx)("code",{className:"px-1",children:"llm-task"})," plugin."]}),(0,t.jsxs)("div",{className:"mt-2 text-[color:var(--ck-text-secondary)]",children:["Enable it with: ",(0,t.jsx)("code",{className:"px-1",children:"openclaw plugins enable llm-task"})," then run"," ",(0,t.jsx)("code",{className:"px-1",children:"openclaw gateway restart"}),"."]}),(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"If you’re doing a non-interactive install, keep this command in your setup docs as a fallback."})]}):null;return(0,t.jsxs)("div",{className:"ck-card p-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Workflows (file-first)"}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:["Stored in ",(0,t.jsx)("code",{children:"shared-context/workflows/<id>.workflow.json"})," inside the team workspace."]}),Z,(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-start gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{let t=`new-${Date.now()}`;c.push(`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(t)}?draft=1`)},className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)]",children:"Add workflow"}),(0,t.jsx)("button",{type:"button",onClick:()=>void Y("marketing-cadence-v1"),className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Add example template"}),(0,t.jsx)("button",{type:"button",onClick:K,disabled:p,className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-60",children:p?"Refreshing…":"Refresh"})]})]}),g?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-red-400/30 bg-red-500/10 p-4 text-sm text-red-100",children:g}):null,q?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-red-400/30 bg-red-500/10 p-4 text-sm text-red-100",children:q}):null,(0,t.jsx)(l.ConfirmationModal,{open:!!D,title:"Worker crons not set up",confirmLabel:"Edit workflow",onClose:()=>{F(""),B([])},onConfirm:()=>{F(""),B([]),D&&c.push(`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(D)}`)},children:(0,t.jsxs)("div",{className:"space-y-2 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("p",{children:"This workflow can’t run because worker cron jobs aren’t installed for the required agents. Open the workflow editor to install them, or choose to skip the cron check (once or permanently) from the same screen."}),z.length?(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2 font-mono text-[11px] text-[color:var(--ck-text-primary)]",children:["Missing for: ",z.join(", ")]}):null]})}),0===m.length?(0,t.jsx)("p",{className:"mt-4 text-sm text-[color:var(--ck-text-secondary)]",children:"No workflows yet."}):(0,t.jsx)("ul",{className:"mt-4 divide-y divide-white/10 overflow-hidden rounded-lg border border-white/10",children:m.map(r=>{let s=b===r.id,i=y[r.id]??[],l=!!k[r.id];return(0,t.jsxs)("li",{className:"bg-white/5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[(0,t.jsxs)("button",{type:"button",onClick:async()=>{let e=s?"":r.id;w(e),C(""),A(null),R(""),e&&await V(e)},className:"min-w-0 flex-1 text-left",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-[color:var(--ck-text-primary)]",children:r.name||r.id}),(0,t.jsx)("div",{className:"truncate text-xs text-[color:var(--ck-text-tertiary)]",children:r.id}),(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:["Click to ",s?"collapse":"expand"," run details"]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:L===r.id,onClick:()=>void W(r.id),className:"rounded-lg border border-emerald-400/30 bg-emerald-500/10 px-3 py-1.5 text-sm font-medium text-emerald-50 transition-colors hover:bg-emerald-500/15 disabled:opacity-60",title:"Enqueue a run for this workflow",children:L===r.id?"Starting…":"Run"}),(0,t.jsx)(a.default,{href:`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(r.id)}`,className:"rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Edit"}),(0,t.jsx)("button",{type:"button",onClick:()=>void H(r.id),className:"rounded-lg border border-[color:rgba(255,59,48,0.45)] bg-[color:rgba(255,59,48,0.08)] px-3 py-1.5 text-sm font-medium text-[color:var(--ck-accent-red)] transition-colors hover:bg-[color:rgba(255,59,48,0.12)]",children:"Delete"})]})]}),s?(0,t.jsxs)("div",{className:"border-t border-white/10 bg-white/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Runs"}),(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>void V(r.id),className:"rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-60",children:l?"Loading…":"Refresh runs"})]}),_?(0,t.jsx)("div",{className:"mt-2 rounded-lg border border-red-400/30 bg-red-500/10 p-2 text-xs text-red-100",children:_}):null,(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,t.jsx)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2",children:i.length?(0,t.jsx)("div",{className:"space-y-1",children:i.slice(0,8).map(e=>{let a=S===e;return(0,t.jsx)("button",{type:"button",onClick:()=>void X(r.id,e),className:a?"w-full rounded-lg bg-white/10 px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-primary)]":"w-full rounded-lg px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:(0,t.jsx)("span",{className:"font-mono",children:e})},e)})}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"No runs yet."})}),(0,t.jsx)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-3",children:P?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Run detail"}),(0,t.jsxs)("div",{className:"mt-1 text-[11px] text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:P.id}),P.status?(0,t.jsxs)("span",{children:[" • ",P.status]}):null]})]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Approval"}),(()=>{let r=P.approval;if(!n(r))return(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(No approval info recorded.)"});let a=String(r.state??"").trim(),s="string"==typeof r.requestedAt?r.requestedAt:"",i="string"==typeof r.decidedAt?r.decidedAt:"",l="string"==typeof r.decidedBy?r.decidedBy:"",d="string"==typeof r.note?r.note:"",c=n(r.outbound)?r.outbound:null,m="pending"===a||"waiting_for_approval"===P.status;return(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2 text-[11px] text-[color:var(--ck-text-secondary)]",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"state"}),": ",(0,t.jsx)("span",{className:"font-mono text-[color:var(--ck-text-primary)]",children:a||"(unknown)"})]}),s?(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"requestedAt"}),": ",(0,t.jsx)("span",{className:"font-mono",children:s})]}):null,i?(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"decidedAt"}),": ",(0,t.jsx)("span",{className:"font-mono",children:i})]}):null,l?(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"decidedBy"}),": ",(0,t.jsx)("span",{className:"font-mono",children:l})]}):null,d?(0,t.jsx)("div",{className:"mt-1 whitespace-pre-wrap text-xs text-[color:var(--ck-text-primary)]",children:d}):null,c?(0,t.jsxs)("div",{className:"mt-2 rounded-lg border border-white/10 bg-black/30 p-2 text-[10px]",children:[(0,t.jsx)("div",{className:"text-[color:var(--ck-text-tertiary)]",children:"Outbound"}),(0,t.jsx)("pre",{className:"mt-1 overflow-auto whitespace-pre-wrap",children:JSON.stringify(c,null,2)})]}):null]}),m?(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"approval note (optional)"}),(0,t.jsx)("textarea",{value:O,onChange:e=>M(e.target.value),rows:3,className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"e.g. Ship it / please tweak hook"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:[{action:"approve",label:"Approve"},{action:"request_changes",label:"Request changes"},{action:"cancel",label:"Cancel"}].map(r=>(0,t.jsx)("button",{type:"button",disabled:$,onClick:async()=>{if(I&&S&&confirm(`${r.label} run ${S}?`)){T(!0),R("");try{let t=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:I,runId:S,action:r.action,note:O||void 0,decidedBy:"ClawKitchen UI"})}),a=await t.json();if(!t.ok||!a.ok)throw Error(a.error||"Failed to apply approval action");await X(I,S)}catch(e){R((0,o.errorMessage)(e))}finally{T(!1)}}},className:"rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-60",children:r.label},r.action))})]}):null]})})()]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Memory used in this run"}),Q.length?(0,t.jsx)("div",{className:"mt-2 space-y-2",children:Q.slice(0,20).map((e,r)=>(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2",children:[(0,t.jsxs)("div",{className:"text-[10px] text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.ts})," • ",(0,t.jsx)("span",{className:"font-mono",children:e.type})," • ",(0,t.jsx)("span",{className:"font-mono",children:e.author})]}),(0,t.jsx)("div",{className:"mt-1 whitespace-pre-wrap text-xs text-[color:var(--ck-text-primary)]",children:e.content}),void 0!==e.source?(0,t.jsx)("pre",{className:"mt-2 overflow-auto rounded-lg border border-white/10 bg-black/30 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(e.source,null,2)}):null]},`${e.ts}-${r}`))}):(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["(None recorded yet.)",(0,t.jsxs)("div",{className:"mt-1",children:["Next step: have the workflow runner write an explicit ",(0,t.jsx)("span",{className:"font-mono",children:"memoryUsed[]"})," list into the run file."]})]})]})]}):S?(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"Loading run…"}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Select a run to see details."})})]})]}):null]},r.id)})})]})}e.s(["default",()=>d])},88143,(e,t,r)=>{"use strict";function a({widthInt:e,heightInt:t,blurWidth:r,blurHeight:a,blurDataURL:s,objectFit:i}){let o=r?40*r:e,l=a?40*a:t,n=o&&l?`viewBox='0 0 ${o} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${n}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${n?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${s}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return a}})},87690,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return o}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let i=["default","imgix","cloudinary","akamai","custom"],o={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},8927,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return d}}),e.r(33525);let a=e.r(43369),s=e.r(88143),i=e.r(87690),o=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function n(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function d({src:e,sizes:t,unoptimized:r=!1,priority:d=!1,preload:c=!1,loading:m,className:u,quality:x,width:h,height:p,fill:f=!1,style:g,overrideSrc:v,onLoad:b,onLoadingComplete:w,placeholder:y="empty",blurDataURL:j,fetchPriority:k,decoding:N="async",layout:S,objectFit:C,objectPosition:I,lazyBoundary:E,lazyRoot:P,...A},_){var R;let O,M,$,{imgConf:T,showAltText:L,blurComplete:U,defaultLoader:D}=_,F=T||i.imageConfigDefault;if("allSizes"in F)O=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),r=F.qualities?.sort((e,t)=>e-t);O={...F,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===D)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let z=A.loader||D;delete A.loader,delete A.srcSet;let B="__next_img_default"in z;if(B){if("custom"===O.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
|
|
2
|
-
|
|
3
|
-
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let o=(0,a.findClosestQuality)(i,e),l=(0,s.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${o}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}i.__next_img_default=!0;let o=i},5500,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return w}});let a=e.r(55682),s=e.r(90809),i=e.r(18050),o=s._(e.r(71645)),l=a._(e.r(74080)),n=a._(e.r(25633)),d=e.r(8927),c=e.r(87690),m=e.r(18556);e.r(33525);let u=e.r(65856),x=a._(e.r(1948)),h=e.r(18581),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function f(e,t,r,a,s,i,o){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&s(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let a=!1,s=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>a,isPropagationStopped:()=>s,persist:()=>{},preventDefault:()=>{a=!0,t.preventDefault()},stopPropagation:()=>{s=!0,t.stopPropagation()}})}a?.current&&a.current(e)}}))}function g(e){return o.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let v=(0,o.forwardRef)(({src:e,srcSet:t,sizes:r,height:a,width:s,decoding:l,className:n,style:d,fetchPriority:c,placeholder:m,loading:u,unoptimized:x,fill:p,onLoadRef:v,onLoadingCompleteRef:b,setBlurComplete:w,setShowAltText:y,sizesInput:j,onLoad:k,onError:N,...S},C)=>{let I=(0,o.useCallback)(e=>{e&&(N&&(e.src=e.src),e.complete&&f(e,m,v,b,w,x,j))},[e,m,v,b,w,N,x,j]),E=(0,h.useMergedRef)(C,I);return(0,i.jsx)("img",{...S,...g(c),loading:u,width:s,height:a,decoding:l,"data-nimg":p?"fill":"1",className:n,style:d,sizes:r,srcSet:t,src:e,ref:E,onLoad:e=>{f(e.currentTarget,m,v,b,w,x,j)},onError:e=>{y(!0),"empty"!==m&&w(!0),N&&N(e)}})});function b({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...g(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,i.jsx)(n.default,{children:(0,i.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let w=(0,o.forwardRef)((e,t)=>{let r=(0,o.useContext)(u.RouterContext),a=(0,o.useContext)(m.ImageConfigContext),s=(0,o.useMemo)(()=>{let e=p||a||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),s=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:s,localPatterns:"u"<typeof window?a?.localPatterns:e.localPatterns}},[a]),{onLoad:l,onLoadingComplete:n}=e,h=(0,o.useRef)(l);(0,o.useEffect)(()=>{h.current=l},[l]);let f=(0,o.useRef)(n);(0,o.useEffect)(()=>{f.current=n},[n]);let[g,w]=(0,o.useState)(!1),[y,j]=(0,o.useState)(!1),{props:k,meta:N}=(0,d.getImgProps)(e,{defaultLoader:x.default,imgConf:s,blurComplete:g,showAltText:y});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v,{...k,unoptimized:N.unoptimized,placeholder:N.placeholder,fill:N.fill,onLoadRef:h,onLoadingCompleteRef:f,setBlurComplete:w,setShowAltText:j,sizesInput:e.sizes,ref:t}),N.preload?(0,i.jsx)(b,{isAppRouter:!r,imgAttributes:k}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},94909,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return c},getImageProps:function(){return d}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let i=e.r(55682),o=e.r(8927),l=e.r(5500),n=i._(e.r(1948));function d(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:n.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let c=l.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},37121,34011,e=>{"use strict";let t=new Set(["png","jpg","jpeg","gif","webp","svg"]),r=new Set(["mp4","webm","mov","avi","mkv","ogv"]),a=new Set(["mp3","wav","ogg","m4a","aac","flac","webm"]);function s(e){return e.toLowerCase().split(".").pop()??""}function i(e){return t.has(s(e))}function o(e){return r.has(s(e))}function l(e){return a.has(s(e))}let n={mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",ogv:"video/ogg",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",m4a:"audio/mp4",aac:"audio/aac",flac:"audio/flac"};function d(e){return n[s(e)]??""}e.s(["isAudioFile",()=>l,"isImageFile",()=>i,"isVideoFile",()=>o,"mimeForFile",()=>d],37121);var c=e.i(18050),m=e.i(57688);function u(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(1))+" "+["B","KB","MB","GB"][t]}function x(e){return({png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",webp:"🖼️",svg:"🖼️",mp4:"🎬",webm:"🎬",mov:"🎬",avi:"🎬",mkv:"🎬",ogv:"🎬",mp3:"🎵",wav:"🎵",ogg:"🎵",m4a:"🎵",aac:"🎵",flac:"🎵",json:"📋",md:"📝",txt:"📄",html:"🌐",pdf:"📕"})[e.toLowerCase().split(".").pop()??""]??"📎"}function h({deliverable:e,fileUrl:t,maxMediaHeight:r="400px",onDownload:a}){return e?(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"mb-3 pb-3 border-b border-white/10",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)("span",{className:"text-lg",children:x(e.fileName)}),(0,c.jsx)("span",{className:"font-medium text-[color:var(--ck-text-primary)] text-sm break-all",children:e.fileName})]}),(0,c.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] space-y-1",children:[(0,c.jsxs)("div",{children:["Size: ",u(e.size)]}),(0,c.jsxs)("div",{children:["Modified: ",function(e){try{return new Date(e).toLocaleString()}catch{return e}}(e.mtime)]}),(0,c.jsxs)("div",{children:["Path: ",e.relativePath]})]})]}),i(e.fileName)?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Image Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-2 overflow-hidden",children:(0,c.jsx)(m.default,{src:t,alt:e.fileName,width:800,height:600,className:"w-full h-auto rounded-lg object-contain",style:{maxHeight:r},unoptimized:!0})}),(0,c.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,c.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Open full size ↗"}),(0,c.jsx)("button",{onClick:a,className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download"})]})]}):o(e.fileName)?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Video Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-2 overflow-hidden",children:(0,c.jsxs)("video",{src:t,controls:!0,className:"w-full rounded-lg",style:{maxHeight:r},preload:"metadata",children:[(0,c.jsx)("source",{src:t,type:d(e.fileName)}),"Your browser does not support video playback."]})}),(0,c.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,c.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Open full size ↗"}),(0,c.jsx)("button",{onClick:a,className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download"})]})]}):l(e.fileName)?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Audio Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-2",children:(0,c.jsxs)("audio",{src:t,controls:!0,className:"w-full",preload:"metadata",children:[(0,c.jsx)("source",{src:t,type:d(e.fileName)}),"Your browser does not support audio playback."]})}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("button",{onClick:a,className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download"})})]}):e.isText&&e.contentPreview?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Content Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-3 overflow-auto",style:{maxHeight:r},children:(0,c.jsx)("pre",{className:"text-xs text-[color:var(--ck-text-primary)] whitespace-pre-wrap break-words",children:e.contentPreview})})]}):(0,c.jsxs)("div",{className:"text-center py-6",children:[(0,c.jsx)("div",{className:"text-3xl mb-2",children:x(e.fileName)}),(0,c.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-secondary)] mb-2",children:[u(e.size)," · ",e.fileName.split(".").pop()?.toUpperCase()," file"]}),(0,c.jsx)("button",{onClick:a,className:"text-xs px-3 py-1.5 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download file"})]})]}):(0,c.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)] italic",children:"Select a deliverable to preview"})}e.s(["DeliverablePreviewPanel",()=>h],34011)},529,e=>{"use strict";var t=e.i(18050),r=e.i(57688),a=e.i(22016),s=e.i(71645),i=e.i(18566),o=e.i(37121),l=e.i(34011);function n(e,t){return`/api/teams/workflow-deliverables/file?teamId=${encodeURIComponent(e)}&runId=${encodeURIComponent(t.runId)}&path=${encodeURIComponent(t.relativePath)}`}function d(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(1))+" "+["B","KB","MB","GB"][t]}function c(e){try{return new Date(e).toLocaleString()}catch{return e}}function m(e){switch(e.toLowerCase().split(".").pop()){case"md":return"📝";case"json":return"🔧";case"txt":default:return"📄";case"html":case"htm":return"🌐";case"css":return"🎨";case"js":case"ts":case"tsx":case"jsx":return"⚙️";case"png":case"jpg":case"jpeg":case"gif":case"webp":return"🖼️";case"pdf":return"📋";case"zip":case"tar":case"gz":return"📦"}}function u({teamId:e,deliverables:u,workflows:x}){let h=(0,i.useRouter)(),[p,f]=(0,s.useState)(""),[g,v]=(0,s.useState)(""),[b,w]=(0,s.useState)(""),[y,j]=(0,s.useState)(null),k=(0,s.useMemo)(()=>{let e=b.trim().toLowerCase();return u.filter(t=>{if(p&&t.workflowId!==p||g&&t.runId!==g)return!1;if(!e)return!0;let r=x[t.workflowId]?.name??"";return t.fileName.toLowerCase().includes(e)||t.workflowId.toLowerCase().includes(e)||t.runId.toLowerCase().includes(e)||r.toLowerCase().includes(e)||t.contentPreview&&t.contentPreview.toLowerCase().includes(e)})},[u,b,p,g,x]),N=(0,s.useMemo)(()=>Array.from(new Set(u.map(e=>e.workflowId).filter(Boolean))).sort(),[u]),S=(0,s.useMemo)(()=>Array.from(new Set((p?u.filter(e=>e.workflowId===p):u).map(e=>e.runId).filter(Boolean))).sort(),[u,p]),C=async t=>{try{if(t.isText&&t.contentPreview)await navigator.clipboard.writeText(t.contentPreview),alert("Content copied to clipboard!");else{let r=n(e,t),a=document.createElement("a");a.href=r,a.download=t.fileName,document.body.appendChild(a),a.click(),a.remove()}}catch{alert("Failed to download file")}};return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("div",{className:"rounded-3xl border border-white/10 bg-black/10 p-4",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"workflow"}),(0,t.jsxs)("select",{value:p,onChange:e=>{f(e.target.value||""),v("")},className:"mt-1 w-64 max-w-full rounded-lg border border-white/10 bg-white/5 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"All workflows"}),N.map(e=>(0,t.jsx)("option",{value:e,children:x[e]?.name?`${x[e]?.name} (${e})`:e},e))]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"run"}),(0,t.jsxs)("select",{value:g,onChange:e=>v(e.target.value||""),className:"mt-1 w-56 max-w-full rounded-lg border border-white/10 bg-white/5 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"All runs"}),S.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"search"}),(0,t.jsx)("input",{value:b,onChange:e=>w(e.target.value),placeholder:"filename / content",className:"mt-1 w-72 max-w-full rounded-lg border border-white/10 bg-white/5 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("button",{type:"button",onClick:()=>h.refresh(),className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Refresh"})})]})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsxs)("div",{className:"lg:col-span-2 rounded-3xl border border-white/10 bg-black/10 p-4",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-[color:var(--ck-text-primary)] mb-4",children:"Workflow Deliverables"}),k.length>0?(0,t.jsx)("div",{className:"space-y-2",children:k.map((s,i)=>{let l=y?.absolutePath===s.absolutePath,u=x[s.workflowId]?.name||s.workflowId;return(0,t.jsx)("div",{className:`cursor-pointer rounded-lg border p-3 transition-colors ${l?"border-white/20 bg-white/10":"border-white/5 bg-black/5 hover:bg-white/5"}`,onClick:()=>j(s),children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,o.isImageFile)(s.fileName)&&(0,t.jsx)("div",{className:"flex-shrink-0 w-12 h-12 rounded overflow-hidden bg-white/5 border border-white/10",children:(0,t.jsx)(r.default,{src:n(e,s),alt:s.fileName,width:48,height:48,className:"w-full h-full object-cover",unoptimized:!0})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-lg",children:m(s.fileName)}),(0,t.jsx)("span",{className:"font-medium text-[color:var(--ck-text-primary)] truncate",children:s.fileName}),s.isText&&(0,t.jsx)("span",{className:"text-xs bg-green-500/20 text-green-400 px-1.5 py-0.5 rounded",children:"TEXT"})]}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:u})," · ",(0,t.jsx)("span",{className:"font-mono",children:s.runId})]}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:[s.relativePath!==s.fileName&&(0,t.jsxs)("span",{children:[s.relativePath," · "]}),d(s.size)," · ",c(s.mtime)]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),C(s)},className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:s.isText?"Copy":"Download"}),(0,t.jsx)(a.default,{href:`/teams/${e}/runs/${s.workflowId}/${s.runId}`,onClick:e=>e.stopPropagation(),className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"View Run →"})]})]})},`${s.runId}-${s.relativePath}`)})}):(0,t.jsxs)("div",{className:"text-center py-8 text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"text-4xl mb-2",children:"📋"}),(0,t.jsx)("div",{className:"text-lg mb-1",children:"No deliverables found"}),(0,t.jsx)("div",{className:"text-sm",children:"Workflow runs will create deliverables that appear here when they complete."})]}),k.length>0&&(0,t.jsxs)("div",{className:"mt-4 text-xs text-[color:var(--ck-text-tertiary)]",children:["Showing ",k.length," of ",u.length," deliverables."]})]}),(0,t.jsxs)("div",{className:"lg:col-span-1 rounded-3xl border border-white/10 bg-black/10 p-4",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-[color:var(--ck-text-primary)] mb-3",children:"Preview"}),y?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-3 pb-3 border-b border-white/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-lg",children:m(y.fileName)}),(0,t.jsx)("span",{className:"font-medium text-[color:var(--ck-text-primary)] text-sm break-all",children:y.fileName})]}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] space-y-1",children:[(0,t.jsxs)("div",{children:["Size: ",d(y.size)]}),(0,t.jsxs)("div",{children:["Modified: ",c(y.mtime)]}),(0,t.jsxs)("div",{children:["Path: ",y.relativePath]})]})]}),(0,t.jsx)(l.DeliverablePreviewPanel,{deliverable:y,fileUrl:n(e,y),maxMediaHeight:"500px",onDownload:()=>C(y)})]}):(0,t.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)] italic",children:"Select a deliverable to preview"})]})]})]})}e.s(["default",()=>u])},32246,e=>{e.v(e=>Promise.resolve().then(()=>e(74080)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82310,e=>{"use strict";function t(e){return e instanceof Error?e.message:String(e)}e.s(["errorMessage",()=>t])},44355,e=>{"use strict";var t=e.i(18050),r=e.i(74080);function a({open:e,onClose:a,title:s,children:i,error:o,confirmLabel:l,confirmBusyLabel:n,onConfirm:d,confirmDisabled:c,busy:m,confirmButtonClassName:u}){if(!e)return null;let x=m??!1,h=x&&n?n:l,p="confirmation-modal-title";return(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[200]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:a,"aria-hidden":"true"}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",role:"dialog","aria-modal":"true","aria-labelledby":p,children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,t.jsxs)("div",{className:"w-full max-w-lg rounded-2xl border border-white/10 bg-[color:var(--ck-bg-soft)] p-5 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsx)("h2",{id:p,className:"text-lg font-semibold text-[color:var(--ck-text-primary)]",children:s}),i,o?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:o}):null,(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:(c??!1)||x,onClick:d,className:u??"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[var(--ck-accent-red-hover)] disabled:opacity-50",children:h})]})]})})})]}),document.body)}e.s(["ConfirmationModal",()=>a])},54510,e=>{"use strict";var t=e.i(18050),r=e.i(44355);function a({open:e,onClose:a,title:s,entityLabel:i,bodyText:o,onConfirm:l,busy:n,error:d}){return(0,t.jsx)(r.ConfirmationModal,{open:e,onClose:a,title:s,confirmLabel:"Delete",confirmBusyLabel:"Deleting…",onConfirm:l,busy:n,error:d??void 0,children:(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:[s," ",(0,t.jsx)("code",{className:"font-mono",children:i}),"? ",o]})})}function s(e){return function(r){let s=r[e.entityLabelKey];return(0,t.jsx)(a,{open:r.open,onClose:r.onClose,title:e.title,entityLabel:s,bodyText:e.bodyText,onConfirm:r.onConfirm,busy:r.busy,error:r.error})}}let i=s({title:"Delete agent",bodyText:"This will remove its workspace/state.",entityLabelKey:"agentId"}),o=s({title:"Delete Team",bodyText:"This will remove the team workspace, agents, and stamped cron jobs.",entityLabelKey:"teamId"}),l=s({title:"Delete recipe",bodyText:"This removes the markdown file from your workspace.",entityLabelKey:"recipeId"}),n=s({title:"Delete cron job",bodyText:"This removes it from the Gateway scheduler. You can recreate it later.",entityLabelKey:"jobLabel"});e.s(["DeleteAgentModal",0,i,"DeleteCronJobModal",0,n,"DeleteRecipeModal",0,l,"DeleteTeamModal",0,o],54510)},55613,e=>{"use strict";var t=e.i(18050),r=e.i(74080);function a({open:e,onClose:a,title:s,children:i,size:o="md",hideTitle:l=!1}){if(!e)return null;let n="modal-title";return(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[200]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60",onClick:a,"aria-hidden":"true"}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",role:"dialog","aria-modal":"true","aria-labelledby":n,children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4",children:(0,t.jsxs)("div",{className:`w-full ${{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-6xl"}[o]} rounded-2xl border border-white/10 bg-[color:var(--ck-bg-soft)] p-6 shadow-[var(--ck-shadow-2)]`,children:[l?(0,t.jsx)("h2",{id:n,className:"sr-only",children:s}):(0,t.jsx)("h2",{id:n,className:"text-lg font-semibold text-[color:var(--ck-text-primary)] mb-4",children:s}),i]})})})]}),document.body)}e.s(["Modal",()=>a])},88810,72532,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(18566),s=e.i(82310),i=e.i(42771),o=e.i(54510);function l({title:e,files:r,loading:a,showOptionalFiles:s,onShowOptionalChange:i,selectedFileName:o,onSelectFile:l,renderItemExtra:n}){let d=s?r:r.filter(e=>e.required||!e.missing);return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:e}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("input",{type:"checkbox",checked:s,onChange:e=>i(e.target.checked)}),"Show optional"]})]}),(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"Default view hides optional missing files to reduce noise."}),(0,t.jsxs)("ul",{className:"mt-3 space-y-1",children:[a?(0,t.jsx)("li",{className:"text-sm text-[color:var(--ck-text-secondary)]",children:"Loading…"}):null,d.map(e=>{var r;let a;return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(e.name),className:(r=e.name,a="w-full rounded-lg px-3 py-2 text-left text-sm",o===r?`${a} bg-white/10 text-[color:var(--ck-text-primary)]`:`${a} text-[color:var(--ck-text-secondary)] hover:bg-white/5`),children:[(0,t.jsx)("span",{className:e.required?"text-[color:var(--ck-text-primary)]":"text-[color:var(--ck-text-secondary)]",children:e.name}),(0,t.jsx)("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:e.required?"required":"optional"}),e.missing?(0,t.jsx)("span",{className:"ml-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"missing"}):null]}),n?.(e)]})},e.name)})]})]})}function n({name:e,emoji:r,theme:a,avatar:s,saving:i,returnTo:o,onNameChange:l,onEmojiChange:n,onThemeChange:d,onAvatarChange:c,onSave:m,router:u}){return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Identity"}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Name"}),(0,t.jsx)("input",{value:e,onChange:e=>l(e.target.value),className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Emoji"}),(0,t.jsx)("input",{value:r,onChange:e=>n(e.target.value),placeholder:"🦞",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Theme"}),(0,t.jsx)("input",{value:a,onChange:e=>d(e.target.value),placeholder:"warm, sharp, calm",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Avatar"}),(0,t.jsx)("input",{value:s,onChange:e=>c(e.target.value),placeholder:"avatars/openclaw.png",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row",children:[(0,t.jsx)("button",{disabled:i,onClick:m,className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[var(--ck-accent-red-hover)] active:bg-[var(--ck-accent-red-active)] disabled:opacity-50",children:i?"Saving…":"Save"}),o?(0,t.jsx)("button",{disabled:i,onClick:async()=>{await m(),u.push(o)},className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-white/10 active:bg-white/15 disabled:opacity-50",children:"Save & return"}):null]})]})}function d({model:e,saving:r,onModelChange:a,onSave:s}){return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Config"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:"Thin slice: edit the configured model id for this agent (writes to OpenClaw config)."}),(0,t.jsx)("label",{className:"mt-3 block text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Model"}),(0,t.jsx)("input",{value:e,onChange:e=>a(e.target.value),placeholder:"openai/gpt-5.2",className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]"}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)("button",{disabled:r,onClick:s,className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:r?"Saving…":"Save config"})})]})}function c({agentId:e,skillsList:r,availableSkills:a,skillsLoading:s,selectedSkill:i,installingSkill:o,skillError:l,skillMsg:n,onSelectedSkillChange:d,onInstallSkill:c}){return(0,t.jsxs)("div",{className:"ck-card p-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:"Skills"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-[color:var(--ck-text-secondary)]",children:["Skills installed in this ",(0,t.jsx)("strong",{children:"agent"})," workspace (",(0,t.jsx)("code",{children:"skills/"}),"). If you want a skill available to all agents, add it at the team level."]}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Installed"}),(0,t.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-[color:var(--ck-text-secondary)]",children:[s&&(0,t.jsx)("li",{children:"Loading…"}),!s&&r.length>0&&r.map(e=>(0,t.jsx)("li",{children:e},e)),!s&&!r.length&&(0,t.jsx)("li",{children:"None installed."})]})]}),(0,t.jsxs)("div",{className:"mt-5 rounded-lg border border-white/10 bg-white/5 p-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Add a skill"}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,t.jsx)("select",{value:i,onChange:e=>d(e.target.value),className:"w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-[color:var(--ck-text-primary)]",disabled:o||!a.length,children:a.length?a.map(e=>(0,t.jsx)("option",{value:e,children:e},e)):(0,t.jsx)("option",{value:"",children:"No skills found"})}),(0,t.jsx)("button",{type:"button",disabled:o||!i,onClick:()=>void c(),className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:o?"Adding…":"Add"})]}),l&&(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:l}),!l&&n&&(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-emerald-400/30 bg-emerald-500/10 p-3 text-sm text-emerald-100",children:n}),(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["This uses ",(0,t.jsxs)("code",{children:["openclaw recipes install-skill <skill> --agent-id ",e," --yes"]}),"."]})]})]})}function m({agentFiles:e,agentFilesLoading:r,showOptionalFiles:a,fileName:s,fileContent:i,loadingFile:o,saving:n,fileError:d,onShowOptionalChange:c,onLoadFile:m,onFileContentChange:u,onSaveFile:x,onCreateMissingFile:h}){return(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsx)(l,{title:"Agent files",files:e,loading:r,showOptionalFiles:a,onShowOptionalChange:c,selectedFileName:s,onSelectFile:m,renderItemExtra:e=>e.missing?(0,t.jsx)("button",{type:"button",disabled:n,onClick:()=>void h(e.name),className:"shrink-0 rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-xs font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-50",children:"Create"}):null}),(0,t.jsxs)("div",{className:"ck-card p-4 lg:col-span-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"text-sm font-medium text-[color:var(--ck-text-primary)]",children:["Edit: ",s]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[o?(0,t.jsx)("span",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Loading…"}):null,(0,t.jsx)("button",{disabled:n,onClick:x,className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)] disabled:opacity-50",children:n?"Saving…":"Save file"})]})]}),d?(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-red-400/30 bg-red-500/10 p-3 text-sm text-red-100",children:d}):null,(0,t.jsx)("textarea",{value:i,onChange:e=>u(e.target.value),className:"mt-3 h-[55vh] w-full resize-none rounded-lg border border-white/10 bg-white/5 p-3 font-mono text-xs text-[color:var(--ck-text-primary)]",spellCheck:!1})]})]})}async function u(e,t){t.setAgentFilesLoading(!0),t.setSkillsLoading(!0);try{let[r,a,s]=await (0,i.fetchAll)([`/api/agents/files?agentId=${encodeURIComponent(e)}`,`/api/agents/skills?agentId=${encodeURIComponent(e)}`,"/api/skills/available"]),o=[];try{let e=await r.json();if(r.ok&&e.ok){let r=Array.isArray(e.files)?e.files:[];t.setAgentFiles(r.map(e=>({name:String(e.name??""),missing:!!e.missing,required:!!e.required,rationale:"string"==typeof e.rationale?e.rationale:void 0})))}}catch{}try{let e=await a.json();a.ok&&e.ok&&(o=Array.isArray(e.skills)?e.skills:[],t.setSkillsList(o))}catch{}try{let e=await s.json();if(s.ok&&e.ok){let r=Array.isArray(e.skills)?e.skills:[];t.setAvailableSkills(r);let a=r.find(e=>!o.includes(e));t.setSelectedSkill(a??r[0]??"")}}catch{}}finally{t.setAgentFilesLoading(!1),t.setSkillsLoading(!1)}}function x({agentId:e,returnTo:l,onClose:x}){let h=(0,a.useRouter)(),[p,f]=(0,r.useState)(null),[g,v]=(0,r.useState)(!0),[b,w]=(0,r.useState)(!1),[y,j]=(0,r.useState)(!1),[k,N]=(0,r.useState)(""),[S,C]=(0,r.useState)(""),[I,P]=(0,r.useState)(""),[E,_]=(0,r.useState)(""),[A,R]=(0,r.useState)(!1),[O,M]=(0,r.useState)(!1),[$,T]=(0,r.useState)(null),[L,U]=(0,r.useState)("identity"),[D,F]=(0,r.useState)(""),[z,B]=(0,r.useState)(""),[q,J]=(0,r.useState)(""),[W,G]=(0,r.useState)(""),[K,H]=(0,r.useState)(""),[X,V]=(0,r.useState)([]),[Y,Q]=(0,r.useState)([]),[Z,ee]=(0,r.useState)(!1),[et,er]=(0,r.useState)(""),[ea,es]=(0,r.useState)(!1),[ei,eo]=(0,r.useState)([]),[el,en]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(!1),[em,eu]=(0,r.useState)("SOUL.md"),[ex,eh]=(0,r.useState)(""),ep=e.includes("-")?e.split("-").slice(0,-1).join("-"):"";async function ef(e){w(!0),N("");try{let t=await e();N(t)}catch(e){N((0,s.errorMessage)(e))}finally{w(!1)}}async function eg(){await ef(async()=>(await (0,i.fetchJson)("/api/agents/identity",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,name:D,emoji:z,theme:q,avatar:W})}),"Saved identity via openclaw agents set-identity"))}async function ev(){await ef(async()=>(await (0,i.fetchJson)("/api/agents/update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,patch:{model:K}})}),"Saved agent config (model) and restarted gateway"))}async function eb(t){eu(t),eh(""),j(!0),C("");try{let r=await (0,i.fetchJson)(`/api/agents/file?agentId=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{cache:"no-store"});if(!r.ok)throw Error("Failed to load file");eh(String(r.content??""))}catch(e){C((0,s.errorMessage)(e))}finally{j(!1)}}async function ew(){w(!0),C("");try{if(!(await (0,i.fetchJson)("/api/agents/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,name:em,content:ex})})).ok)throw Error("Failed to save file");try{let t=await (0,i.fetchJson)(`/api/agents/files?agentId=${encodeURIComponent(e)}`,{cache:"no-store"});t.ok&&Array.isArray(t.files)&&eo(t.files)}catch{}}catch(e){C((0,s.errorMessage)(e))}finally{w(!1)}}async function ey(e){eu(e),C(""),eh(function(e){switch(e){case"SOUL.md":return"# SOUL.md\n\n";case"AGENTS.md":return"# AGENTS.md\n\n";case"TOOLS.md":return"# TOOLS.md\n\n";case"STATUS.md":return"# STATUS.md\n\n- (empty)\n";case"NOTES.md":return"# NOTES.md\n\n- (empty)\n";case"IDENTITY.md":return"# IDENTITY.md\n\n- **Name:**\n- **Creature:**\n- **Vibe:**\n- **Emoji:**\n- **Avatar:**\n";case"USER.md":return"# USER.md\n\n";case"HEARTBEAT.md":return"# HEARTBEAT.md\n\n# Keep this file empty (or with only comments) to skip heartbeat API calls.\n";default:return""}}(e)),await ew()}async function ej(){M(!0),T(null),N("");try{await (0,i.fetchJson)(`/api/agents/${encodeURIComponent(e)}`,{method:"DELETE"}),window.location.href="/"}catch(e){T((0,s.errorMessage)(e)),M(!1)}}return(0,r.useEffect)(()=>{(async()=>{v(!0),N("");try{let t=await (0,i.fetchJson)("/api/agents",{cache:"no-store"}),r=(Array.isArray(t.agents)?t.agents:[]).find(t=>t.id===e)??null;f(r),F(r?.identityName??""),H(r?.model??""),v(!1),u(e,{setAgentFiles:eo,setSkillsList:V,setAvailableSkills:Q,setSelectedSkill:er,setAgentFilesLoading:en,setSkillsLoading:ee})}catch(e){N((0,s.errorMessage)(e))}finally{v(!1)}})()},[e]),(0,r.useEffect)(()=>{if("files"!==L||!ei.length)return;let e=ei.some(e=>e.name===em),t=ei[0]?.name,r=e?em:t;r&&(r!==em&&(eu(r),eh("")),ex||eb(r))},[L,e,ei.length]),g?(0,t.jsx)("div",{className:"w-full",children:"Loading…"}):p?(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[x?(0,t.jsx)("button",{type:"button",onClick:x,className:"text-[color:var(--ck-text-tertiary)] hover:text-[color:var(--ck-text-primary)]",title:"Close",children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,t.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}):null,(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:p.identityName||p.id}),(0,t.jsxs)("p",{className:"mt-1 text-sm font-mono text-[color:var(--ck-text-tertiary)]",children:[p.id,p.isDefault?" · default":"",p.model?` \xb7 ${p.model}`:""]})]})]}),(0,t.jsx)("button",{type:"button",disabled:b,onClick:()=>{T(null),R(!0)},className:"rounded-lg border border-[color:rgba(255,59,48,0.45)] bg-[color:rgba(255,59,48,0.08)] px-3 py-2 text-sm font-medium text-[color:var(--ck-accent-red)] shadow-[var(--ck-shadow-1)] transition-colors hover:bg-[color:rgba(255,59,48,0.12)] disabled:opacity-50",children:"Delete agent"})]}),p.workspace?(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Workspace: ",p.workspace]}):null,ep?(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:["Team: ",ep]}):null,k?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-white/10 bg-white/5 p-3 text-sm text-[color:var(--ck-text-primary)]",children:k}):null,(0,t.jsx)("div",{className:"mt-6 flex flex-wrap gap-2",children:[{id:"identity",label:"Identity"},{id:"config",label:"Config"},{id:"skills",label:"Skills"},{id:"files",label:"Files"}].map(e=>(0,t.jsx)("button",{onClick:()=>U(e.id),className:L===e.id?"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)]":"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] shadow-[var(--ck-shadow-1)] hover:bg-white/10",children:e.label},e.id))}),(0,t.jsxs)("div",{className:"mt-6 grid grid-cols-1 gap-4",children:["identity"===L&&(0,t.jsx)(n,{name:D,emoji:z,theme:q,avatar:W,saving:b,returnTo:l,onNameChange:F,onEmojiChange:B,onThemeChange:J,onAvatarChange:G,onSave:eg,router:h}),"config"===L&&(0,t.jsx)(d,{model:K,saving:b,onModelChange:H,onSave:ev}),"skills"===L&&(0,t.jsx)(c,{agentId:e,skillsList:X,availableSkills:Y,skillsLoading:Z,selectedSkill:et,installingSkill:ea,skillError:E,skillMsg:I,onSelectedSkillChange:er,onInstallSkill:async()=>{es(!0),P(""),_("");try{await (0,i.fetchJson)("/api/agents/skills/install",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agentId:e,skill:et})}),P(`Installed skill: ${et}`);try{let t=await (0,i.fetchJson)(`/api/agents/skills?agentId=${encodeURIComponent(e)}`,{cache:"no-store"});t.ok&&Array.isArray(t.skills)&&V(t.skills)}catch{}}catch(e){_((0,s.errorMessage)(e))}finally{es(!1)}}}),"files"===L&&(0,t.jsx)(m,{agentFiles:ei,agentFilesLoading:el,showOptionalFiles:ed,fileName:em,fileContent:ex,loadingFile:y,saving:b,fileError:S,onShowOptionalChange:ec,onLoadFile:eb,onFileContentChange:eh,onSaveFile:ew,onCreateMissingFile:ey})]}),(0,t.jsx)(o.DeleteAgentModal,{open:A,agentId:e,busy:O,error:$,onClose:()=>R(!1),onConfirm:()=>void ej()})]}):(0,t.jsxs)("div",{className:"w-full",children:["Agent not found: ",e]})}e.s(["FileListWithOptionalToggle",()=>l],72532),e.s(["default",()=>x],88810)},99252,e=>{"use strict";var t=e.i(18050),r=e.i(74080);function a({open:e}){return e?(0,r.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-[9999]",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-[color:var(--ck-bg-base)]/90 pointer-events-none"}),(0,t.jsx)("div",{className:"fixed inset-0 flex items-center justify-center p-6 sm:p-10",children:(0,t.jsxs)("div",{className:"w-full max-w-md rounded-2xl border border-white/10 bg-[color:var(--ck-bg-soft)] p-8 sm:p-10 shadow-[var(--ck-shadow-2)]",children:[(0,t.jsx)("div",{className:"text-xl font-semibold text-[color:var(--ck-text-primary)]",children:"Gathering your ingredients.."}),(0,t.jsx)("div",{className:"mt-6 h-1.5 w-full overflow-hidden rounded-full bg-white/10",children:(0,t.jsx)("div",{className:"h-full w-1/3 animate-[loading-bar_1.5s_ease-in-out_infinite] rounded-full bg-[var(--ck-accent-red)]"})})]})}),(0,t.jsx)("style",{children:`
|
|
2
|
+
@keyframes loading-bar {
|
|
3
|
+
0% { transform: translateX(-100%); }
|
|
4
|
+
50% { transform: translateX(200%); }
|
|
5
|
+
100% { transform: translateX(-100%); }
|
|
6
|
+
}
|
|
7
|
+
`})]}),document.body):null}e.s(["RunLoadingOverlay",()=>a])},92140,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(22016),s=e.i(18566),i=e.i(42771),o=e.i(82310),l=e.i(44355),n=e.i(99252);function d(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function c({teamId:e,llmTaskEnabled:c}){let m=(0,s.useRouter)(),[u,x]=(0,r.useState)([]),[h,p]=(0,r.useState)(!0),[f,g]=(0,r.useState)(!1),[v,b]=(0,r.useState)(""),[w,y]=(0,r.useState)(""),[j,k]=(0,r.useState)({}),[N,S]=(0,r.useState)({}),[C,I]=(0,r.useState)(""),[P,E]=(0,r.useState)(""),[_,A]=(0,r.useState)(null),[R,O]=(0,r.useState)(""),[M,$]=(0,r.useState)(""),[T,L]=(0,r.useState)(!1),[U,D]=(0,r.useState)(""),[F,z]=(0,r.useState)(""),[B,q]=(0,r.useState)([]),[J,W]=(0,r.useState)(""),[G,K]=(0,r.useState)(!1),H=(0,r.useCallback)(async t=>{D(t),K(!0),W("");let r=!1;try{let a=await (0,i.fetchJson)(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`,{cache:"no-store"});if(!a.ok||!a.workflow)throw Error(a.error||"Failed to load workflow");let s=a.workflow,o=d(s.meta)?s.meta:{};if(!0!==o.skipCronCheck){let e=Array.isArray(s.nodes)?s.nodes:[],r=Array.from(new Set(e.filter(e=>e.type&&!["start","end","human_approval"].includes(String(e.type))).map(e=>{let t=d(e.config)?e.config:{};return String(t.agentId??"").trim()}).filter(Boolean))),a=await (0,i.fetchJson)("/api/cron/jobs",{cache:"no-store"});if(!a.ok)throw Error(a.error||"Failed to load cron jobs");let o=Array.isArray(a.jobs)?a.jobs:[],l={};for(let e of o){if(!e||!e.enabled)continue;let t=String(e.name??""),r=String(e.payload?.message??"");if(!(t.startsWith("workflow-worker:")||r.includes("worker-tick")))continue;let a=t.match(/^workflow-worker:[^:]+:(.+)$/);if(a?.[1]){l[a[1]]=!0;continue}let s=r.match(/--agent-id\s+(\S+)/);s?.[1]&&(l[s[1]]=!0)}let n=r.filter(e=>!l[e]);if(n.length){q(n),z(t);return}}let l=await (0,i.fetchJson)("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:t,mode:"run_now"})});if(!l.ok)throw Error(l.error||"Failed to create run");let n=String(l.runId??"").trim();n?(m.push(`/teams/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}/${encodeURIComponent(n)}`),r=!0):y(t)}catch(e){q([]),z(""),W((0,o.errorMessage)(e))}finally{D(""),r||K(!1)}},[e,m]),X=(0,r.useCallback)(async t=>{let r=!!t?.quiet;b(""),r||p(!0);try{let t=await (0,i.fetchJson)(`/api/teams/workflows?teamId=${encodeURIComponent(e)}`,{cache:"no-store"});if(!t.ok)throw Error("Failed to load workflows");let r=(Array.isArray(t.files)?t.files:[]).map(e=>e.endsWith(".workflow.json")?e.slice(0,-14):null).filter(e=>!!e);x(r.map(e=>({id:e,name:e})))}catch(e){b((0,o.errorMessage)(e))}finally{r||p(!1)}},[e]);async function V(){g(!0);try{await X({quiet:!0})}finally{g(!1)}}async function Y(t){if(confirm(`Delete workflow “${t}”? This removes the .workflow.json file from the team workspace.`)){b("");try{let r=await (0,i.fetchJson)(`/api/teams/workflows?teamId=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`,{method:"DELETE"});if(!r.ok)throw Error(r.error||"Failed to delete workflow");await X({quiet:!0}),w===t&&(y(""),I(""),A(null))}catch(e){b((0,o.errorMessage)(e))}}}async function Q(t){S(e=>({...e,[t]:!0})),O("");try{let r=await (0,i.fetchJson)(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}`,{cache:"no-store"});if(!r.ok)throw Error(r.error||"Failed to load runs");let a=Array.isArray(r.runIds)?r.runIds.map(e=>String(e||"").trim()).filter(Boolean):Array.isArray(r.files)?r.files.map(e=>"string"==typeof e&&e.endsWith(".run.json")?e.slice(0,-9):null).filter(e=>!!e):[];k(e=>({...e,[t]:a}))}catch(e){O((0,o.errorMessage)(e)),k(e=>({...e,[t]:[]}))}finally{S(e=>({...e,[t]:!1}))}}async function Z(t,r){E(t),I(r),A(null),O(""),$("");try{let a=await (0,i.fetchJson)(`/api/teams/workflow-runs?teamId=${encodeURIComponent(e)}&workflowId=${encodeURIComponent(t)}&runId=${encodeURIComponent(r)}`,{cache:"no-store"});if(!a.ok)throw Error(a.error||"Failed to load run");let s=d(a.run)?a.run:null;if(!s)throw Error("Invalid run format");A({id:String(s.id??r),status:"string"==typeof s.status?s.status:void 0,startedAt:"string"==typeof s.startedAt?s.startedAt:void 0,finishedAt:"string"==typeof s.finishedAt?String(s.finishedAt):void 0,meta:s.meta,memoryUsed:s.memoryUsed,approval:s.approval,raw:s})}catch(e){O((0,o.errorMessage)(e)),A(null)}}async function ee(t){if(confirm(`Add workflow from template “${t}”?`)){b("");try{let r=await (0,i.fetchJson)("/api/teams/workflow-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,templateId:t})});if(!r.ok)throw Error(r.error||"Failed to apply template");let a=String(r.workflowId??"").trim();if(!a)throw Error("Template applied but workflowId missing");await X({quiet:!0}),m.push(`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(a)}`)}catch(e){b((0,o.errorMessage)(e))}}}(0,r.useEffect)(()=>{X()},[X]);let et=(0,r.useMemo)(()=>{if(!_)return[];let e=_.memoryUsed??(d(_.meta)?_.meta.memoryUsed:void 0);return Array.isArray(e)?e.map(e=>d(e)?e:null).filter(Boolean).map(e=>({ts:String(e.ts??"").trim(),author:String(e.author??"").trim(),type:String(e.type??"").trim(),content:String(e.content??"").trim(),source:e.source})).filter(e=>e.ts&&e.author&&e.type&&e.content):[]},[_]);if(h)return(0,t.jsx)("div",{className:"ck-card p-4",children:"Loading workflows…"});let er=!1===c?(0,t.jsxs)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 p-4 text-sm",children:[(0,t.jsx)("div",{className:"font-medium text-amber-200",children:"LLM support is not enabled"}),(0,t.jsxs)("div",{className:"mt-1 text-[color:var(--ck-text-secondary)]",children:["Workflow LLM nodes require the optional built-in ",(0,t.jsx)("code",{className:"px-1",children:"llm-task"})," plugin."]}),(0,t.jsxs)("div",{className:"mt-2 text-[color:var(--ck-text-secondary)]",children:["Enable it with: ",(0,t.jsx)("code",{className:"px-1",children:"openclaw plugins enable llm-task"})," then run"," ",(0,t.jsx)("code",{className:"px-1",children:"openclaw gateway restart"}),"."]}),(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"If you’re doing a non-interactive install, keep this command in your setup docs as a fallback."})]}):null;return(0,t.jsxs)("div",{className:"ck-card p-6",children:[(0,t.jsx)(n.RunLoadingOverlay,{open:G}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Workflows (file-first)"}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-[color:var(--ck-text-secondary)]",children:["Stored in ",(0,t.jsx)("code",{children:"shared-context/workflows/<id>.workflow.json"})," inside the team workspace."]}),er,(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-start gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{let t=`new-${Date.now()}`;m.push(`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(t)}?draft=1`)},className:"rounded-lg bg-[var(--ck-accent-red)] px-3 py-2 text-sm font-medium text-white shadow-[var(--ck-shadow-1)]",children:"Add workflow"}),(0,t.jsx)("button",{type:"button",onClick:()=>void ee("marketing-cadence-v1"),className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Add example template"}),(0,t.jsx)("button",{type:"button",onClick:V,disabled:f,className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-60",children:f?"Refreshing…":"Refresh"})]})]}),v?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-red-400/30 bg-red-500/10 p-4 text-sm text-red-100",children:v}):null,J?(0,t.jsx)("div",{className:"mt-4 rounded-lg border border-red-400/30 bg-red-500/10 p-4 text-sm text-red-100",children:J}):null,(0,t.jsx)(l.ConfirmationModal,{open:!!F,title:"Worker crons not set up",confirmLabel:"Edit workflow",onClose:()=>{z(""),q([])},onConfirm:()=>{z(""),q([]),F&&m.push(`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(F)}`)},children:(0,t.jsxs)("div",{className:"space-y-2 text-sm text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("p",{children:"This workflow can’t run because worker cron jobs aren’t installed for the required agents. Open the workflow editor to install them, or choose to skip the cron check (once or permanently) from the same screen."}),B.length?(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2 font-mono text-[11px] text-[color:var(--ck-text-primary)]",children:["Missing for: ",B.join(", ")]}):null]})}),0===u.length?(0,t.jsx)("p",{className:"mt-4 text-sm text-[color:var(--ck-text-secondary)]",children:"No workflows yet."}):(0,t.jsx)("ul",{className:"mt-4 divide-y divide-white/10 overflow-hidden rounded-lg border border-white/10",children:u.map(r=>{let s=w===r.id,i=j[r.id]??[],l=!!N[r.id];return(0,t.jsxs)("li",{className:"bg-white/5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[(0,t.jsxs)("button",{type:"button",onClick:async()=>{let e=s?"":r.id;y(e),I(""),A(null),O(""),e&&await Q(e)},className:"min-w-0 flex-1 text-left",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-[color:var(--ck-text-primary)]",children:r.name||r.id}),(0,t.jsx)("div",{className:"truncate text-xs text-[color:var(--ck-text-tertiary)]",children:r.id}),(0,t.jsxs)("div",{className:"mt-1 text-[10px] text-[color:var(--ck-text-tertiary)]",children:["Click to ",s?"collapse":"expand"," run details"]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:U===r.id,onClick:()=>void H(r.id),className:"rounded-lg border border-emerald-400/30 bg-emerald-500/10 px-3 py-1.5 text-sm font-medium text-emerald-50 transition-colors hover:bg-emerald-500/15 disabled:opacity-60",title:"Enqueue a run for this workflow",children:U===r.id?"Starting…":"Run"}),(0,t.jsx)(a.default,{href:`/teams/${encodeURIComponent(e)}/workflows/${encodeURIComponent(r.id)}`,className:"rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Edit"}),(0,t.jsx)("button",{type:"button",onClick:()=>void Y(r.id),className:"rounded-lg border border-[color:rgba(255,59,48,0.45)] bg-[color:rgba(255,59,48,0.08)] px-3 py-1.5 text-sm font-medium text-[color:var(--ck-accent-red)] transition-colors hover:bg-[color:rgba(255,59,48,0.12)]",children:"Delete"})]})]}),s?(0,t.jsxs)("div",{className:"border-t border-white/10 bg-white/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Runs"}),(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>void Q(r.id),className:"rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-60",children:l?"Loading…":"Refresh runs"})]}),R?(0,t.jsx)("div",{className:"mt-2 rounded-lg border border-red-400/30 bg-red-500/10 p-2 text-xs text-red-100",children:R}):null,(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,t.jsx)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2",children:i.length?(0,t.jsx)("div",{className:"space-y-1",children:i.slice(0,8).map(e=>{let a=C===e;return(0,t.jsx)("button",{type:"button",onClick:()=>void Z(r.id,e),className:a?"w-full rounded-lg bg-white/10 px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-primary)]":"w-full rounded-lg px-2 py-1 text-left text-[11px] text-[color:var(--ck-text-secondary)] hover:bg-white/5",children:(0,t.jsx)("span",{className:"font-mono",children:e})},e)})}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"No runs yet."})}),(0,t.jsx)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-3",children:_?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Run detail"}),(0,t.jsxs)("div",{className:"mt-1 text-[11px] text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:_.id}),_.status?(0,t.jsxs)("span",{children:[" • ",_.status]}):null]})]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Approval"}),(()=>{let r=_.approval;if(!d(r))return(0,t.jsx)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:"(No approval info recorded.)"});let a=String(r.state??"").trim(),s="string"==typeof r.requestedAt?r.requestedAt:"",i="string"==typeof r.decidedAt?r.decidedAt:"",l="string"==typeof r.decidedBy?r.decidedBy:"",n="string"==typeof r.note?r.note:"",c=d(r.outbound)?r.outbound:null,m="pending"===a||"waiting_for_approval"===_.status;return(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2 text-[11px] text-[color:var(--ck-text-secondary)]",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"state"}),": ",(0,t.jsx)("span",{className:"font-mono text-[color:var(--ck-text-primary)]",children:a||"(unknown)"})]}),s?(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"requestedAt"}),": ",(0,t.jsx)("span",{className:"font-mono",children:s})]}):null,i?(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"decidedAt"}),": ",(0,t.jsx)("span",{className:"font-mono",children:i})]}):null,l?(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:"decidedBy"}),": ",(0,t.jsx)("span",{className:"font-mono",children:l})]}):null,n?(0,t.jsx)("div",{className:"mt-1 whitespace-pre-wrap text-xs text-[color:var(--ck-text-primary)]",children:n}):null,c?(0,t.jsxs)("div",{className:"mt-2 rounded-lg border border-white/10 bg-black/30 p-2 text-[10px]",children:[(0,t.jsx)("div",{className:"text-[color:var(--ck-text-tertiary)]",children:"Outbound"}),(0,t.jsx)("pre",{className:"mt-1 overflow-auto whitespace-pre-wrap",children:JSON.stringify(c,null,2)})]}):null]}),m?(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"approval note (optional)"}),(0,t.jsx)("textarea",{value:M,onChange:e=>$(e.target.value),rows:3,className:"mt-1 w-full rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-xs text-[color:var(--ck-text-primary)]",placeholder:"e.g. Ship it / please tweak hook"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:[{action:"approve",label:"Approve"},{action:"request_changes",label:"Request changes"},{action:"cancel",label:"Cancel"}].map(r=>(0,t.jsx)("button",{type:"button",disabled:T,onClick:async()=>{if(P&&C&&confirm(`${r.label} run ${C}?`)){L(!0),O("");try{let t=await fetch("/api/teams/workflow-runs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({teamId:e,workflowId:P,runId:C,action:r.action,note:M||void 0,decidedBy:"ClawKitchen UI"})}),a=await t.json();if(!t.ok||!a.ok)throw Error(a.error||"Failed to apply approval action");await Z(P,C)}catch(e){O((0,o.errorMessage)(e))}finally{L(!1)}}},className:"rounded-lg border border-white/10 bg-white/5 px-2 py-1 text-[11px] font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10 disabled:opacity-60",children:r.label},r.action))})]}):null]})})()]}),(0,t.jsxs)("div",{className:"border-t border-white/10 pt-3",children:[(0,t.jsx)("div",{className:"text-xs font-medium text-[color:var(--ck-text-secondary)]",children:"Memory used in this run"}),et.length?(0,t.jsx)("div",{className:"mt-2 space-y-2",children:et.slice(0,20).map((e,r)=>(0,t.jsxs)("div",{className:"rounded-lg border border-white/10 bg-white/5 p-2",children:[(0,t.jsxs)("div",{className:"text-[10px] text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:e.ts})," • ",(0,t.jsx)("span",{className:"font-mono",children:e.type})," • ",(0,t.jsx)("span",{className:"font-mono",children:e.author})]}),(0,t.jsx)("div",{className:"mt-1 whitespace-pre-wrap text-xs text-[color:var(--ck-text-primary)]",children:e.content}),void 0!==e.source?(0,t.jsx)("pre",{className:"mt-2 overflow-auto rounded-lg border border-white/10 bg-black/30 p-2 text-[10px] text-[color:var(--ck-text-secondary)]",children:JSON.stringify(e.source,null,2)}):null]},`${e.ts}-${r}`))}):(0,t.jsxs)("div",{className:"mt-2 text-xs text-[color:var(--ck-text-tertiary)]",children:["(None recorded yet.)",(0,t.jsxs)("div",{className:"mt-1",children:["Next step: have the workflow runner write an explicit ",(0,t.jsx)("span",{className:"font-mono",children:"memoryUsed[]"})," list into the run file."]})]})]})]}):C?(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-secondary)]",children:"Loading run…"}):(0,t.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)]",children:"Select a run to see details."})})]})]}):null]},r.id)})})]})}e.s(["default",()=>c])},88143,(e,t,r)=>{"use strict";function a({widthInt:e,heightInt:t,blurWidth:r,blurHeight:a,blurDataURL:s,objectFit:i}){let o=r?40*r:e,l=a?40*a:t,n=o&&l?`viewBox='0 0 ${o} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${n}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${n?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${s}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return a}})},87690,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return o}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let i=["default","imgix","cloudinary","akamai","custom"],o={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},8927,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return d}}),e.r(33525);let a=e.r(43369),s=e.r(88143),i=e.r(87690),o=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function n(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function d({src:e,sizes:t,unoptimized:r=!1,priority:d=!1,preload:c=!1,loading:m,className:u,quality:x,width:h,height:p,fill:f=!1,style:g,overrideSrc:v,onLoad:b,onLoadingComplete:w,placeholder:y="empty",blurDataURL:j,fetchPriority:k,decoding:N="async",layout:S,objectFit:C,objectPosition:I,lazyBoundary:P,lazyRoot:E,..._},A){var R;let O,M,$,{imgConf:T,showAltText:L,blurComplete:U,defaultLoader:D}=A,F=T||i.imageConfigDefault;if("allSizes"in F)O=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),r=F.qualities?.sort((e,t)=>e-t);O={...F,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===D)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let z=_.loader||D;delete _.loader,delete _.srcSet;let B="__next_img_default"in z;if(B){if("custom"===O.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
|
|
8
|
+
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=z;z=t=>{let{config:r,...a}=t;return e(a)}}if(S){"fill"===S&&(f=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[S];e&&(g={...g,...e});let r={responsive:"100vw",fill:"100vw"}[S];r&&!t&&(t=r)}let q="",J=n(h),W=n(p);if((R=e)&&"object"==typeof R&&(l(R)||void 0!==R.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(M=t.blurWidth,$=t.blurHeight,j=j||t.blurDataURL,q=t.src,!f)if(J||W){if(J&&!W){let e=J/t.width;W=Math.round(t.height*e)}else if(!J&&W){let e=W/t.height;J=Math.round(t.width*e)}}else J=t.width,W=t.height}let G=!d&&!c&&("lazy"===m||void 0===m);(!(e="string"==typeof e?e:q)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,G=!1),O.unoptimized&&(r=!0),B&&!O.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let K=n(x),H=Object.assign(f?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:I}:{},L?{}:{color:"transparent"},g),X=U||"empty"===y?null:"blur"===y?`url("data:image/svg+xml;charset=utf-8,${(0,s.getImageBlurSvg)({widthInt:J,heightInt:W,blurWidth:M,blurHeight:$,blurDataURL:j||"",objectFit:H.objectFit})}")`:`url("${y}")`,V=o.includes(H.objectFit)?"fill"===H.objectFit?"100% 100%":"cover":H.objectFit,Y=X?{backgroundSize:V,backgroundPosition:H.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},Q=function({config:e,src:t,unoptimized:r,width:s,quality:i,sizes:o,loader:l}){if(r){let e=(0,a.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")&&e){let r=t.includes("?")?"&":"?";t=`${t}${r}dpl=${e}`}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:n,kind:d}=function({deviceSizes:e,allSizes:t},r,a){if(a){let r=/(^|\s)(1?\d?\d)vw/g,s=[];for(let e;e=r.exec(a);)s.push(parseInt(e[2]));if(s.length){let r=.01*Math.min(...s);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,s,o),c=n.length-1;return{sizes:o||"w"!==d?o:"100vw",srcSet:n.map((r,a)=>`${l({config:e,src:t,quality:i,width:r})} ${"w"===d?r:a+1}${d}`).join(", "),src:l({config:e,src:t,quality:i,width:n[c]})}}({config:O,src:e,unoptimized:r,width:J,quality:K,sizes:t,loader:z}),Z=G?"lazy":m;return{props:{..._,loading:Z,fetchPriority:k,width:J,height:W,decoding:N,className:u,style:{...H,...Y},sizes:Q.sizes,srcSet:Q.srcSet,src:v||Q.src},meta:{unoptimized:r,preload:c||d,placeholder:y,fill:f}}}},98879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let a=e.r(71645),s="u"<typeof window,i=s?()=>{}:a.useLayoutEffect,o=s?()=>{}:a.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let e=a.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return s&&(t?.mountedInstances?.add(e.children),l()),i(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),i(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),o(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},25633,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return p},defaultHead:function(){return m}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let i=e.r(55682),o=e.r(90809),l=e.r(18050),n=o._(e.r(71645)),d=i._(e.r(98879)),c=e.r(42732);function m(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function u(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===n.default.Fragment?e.concat(n.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(33525);let x=["name","httpEquiv","charSet","itemProp"];function h(e){let t,r,a,s;return e.reduce(u,[]).reverse().concat(m().reverse()).filter((t=new Set,r=new Set,a=new Set,s={},e=>{let i=!0,o=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){o=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?i=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?i=!1:r.add(e.type);break;case"meta":for(let t=0,r=x.length;t<r;t++){let r=x[t];if(e.props.hasOwnProperty(r))if("charSet"===r)a.has(r)?i=!1:a.add(r);else{let t=e.props[r],a=s[r]||new Set;("name"!==r||!o)&&a.has(t)?i=!1:(a.add(t),s[r]=a)}}}return i})).reverse().map((e,t)=>{let r=e.key||t;return n.default.cloneElement(e,{key:r})})}let p=function({children:e}){let t=(0,n.useContext)(c.HeadManagerContext);return(0,l.jsx)(d.default,{reduceComponentsToState:h,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18556,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let a=e.r(55682)._(e.r(71645)),s=e.r(87690),i=a.default.createContext(s.imageConfigDefault)},65856,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return a}});let a=e.r(55682)._(e.r(71645)).default.createContext(null)},70965,(e,t,r)=>{"use strict";function a(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,0):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return a}})},1948,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let a=e.r(70965),s=e.r(43369);function i({config:e,src:t,width:r,quality:i}){if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
|
|
9
|
+
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let o=(0,a.findClosestQuality)(i,e),l=(0,s.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${o}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}i.__next_img_default=!0;let o=i},5500,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return w}});let a=e.r(55682),s=e.r(90809),i=e.r(18050),o=s._(e.r(71645)),l=a._(e.r(74080)),n=a._(e.r(25633)),d=e.r(8927),c=e.r(87690),m=e.r(18556);e.r(33525);let u=e.r(65856),x=a._(e.r(1948)),h=e.r(18581),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function f(e,t,r,a,s,i,o){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&s(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let a=!1,s=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>a,isPropagationStopped:()=>s,persist:()=>{},preventDefault:()=>{a=!0,t.preventDefault()},stopPropagation:()=>{s=!0,t.stopPropagation()}})}a?.current&&a.current(e)}}))}function g(e){return o.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let v=(0,o.forwardRef)(({src:e,srcSet:t,sizes:r,height:a,width:s,decoding:l,className:n,style:d,fetchPriority:c,placeholder:m,loading:u,unoptimized:x,fill:p,onLoadRef:v,onLoadingCompleteRef:b,setBlurComplete:w,setShowAltText:y,sizesInput:j,onLoad:k,onError:N,...S},C)=>{let I=(0,o.useCallback)(e=>{e&&(N&&(e.src=e.src),e.complete&&f(e,m,v,b,w,x,j))},[e,m,v,b,w,N,x,j]),P=(0,h.useMergedRef)(C,I);return(0,i.jsx)("img",{...S,...g(c),loading:u,width:s,height:a,decoding:l,"data-nimg":p?"fill":"1",className:n,style:d,sizes:r,srcSet:t,src:e,ref:P,onLoad:e=>{f(e.currentTarget,m,v,b,w,x,j)},onError:e=>{y(!0),"empty"!==m&&w(!0),N&&N(e)}})});function b({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...g(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,i.jsx)(n.default,{children:(0,i.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let w=(0,o.forwardRef)((e,t)=>{let r=(0,o.useContext)(u.RouterContext),a=(0,o.useContext)(m.ImageConfigContext),s=(0,o.useMemo)(()=>{let e=p||a||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),s=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:s,localPatterns:"u"<typeof window?a?.localPatterns:e.localPatterns}},[a]),{onLoad:l,onLoadingComplete:n}=e,h=(0,o.useRef)(l);(0,o.useEffect)(()=>{h.current=l},[l]);let f=(0,o.useRef)(n);(0,o.useEffect)(()=>{f.current=n},[n]);let[g,w]=(0,o.useState)(!1),[y,j]=(0,o.useState)(!1),{props:k,meta:N}=(0,d.getImgProps)(e,{defaultLoader:x.default,imgConf:s,blurComplete:g,showAltText:y});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v,{...k,unoptimized:N.unoptimized,placeholder:N.placeholder,fill:N.fill,onLoadRef:h,onLoadingCompleteRef:f,setBlurComplete:w,setShowAltText:j,sizesInput:e.sizes,ref:t}),N.preload?(0,i.jsx)(b,{isAppRouter:!r,imgAttributes:k}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},94909,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return c},getImageProps:function(){return d}};for(var s in a)Object.defineProperty(r,s,{enumerable:!0,get:a[s]});let i=e.r(55682),o=e.r(8927),l=e.r(5500),n=i._(e.r(1948));function d(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:n.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let c=l.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},37121,34011,e=>{"use strict";let t=new Set(["png","jpg","jpeg","gif","webp","svg"]),r=new Set(["mp4","webm","mov","avi","mkv","ogv"]),a=new Set(["mp3","wav","ogg","m4a","aac","flac","webm"]);function s(e){return e.toLowerCase().split(".").pop()??""}function i(e){return t.has(s(e))}function o(e){return r.has(s(e))}function l(e){return a.has(s(e))}let n={mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",ogv:"video/ogg",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",m4a:"audio/mp4",aac:"audio/aac",flac:"audio/flac"};function d(e){return n[s(e)]??""}e.s(["isAudioFile",()=>l,"isImageFile",()=>i,"isVideoFile",()=>o,"mimeForFile",()=>d],37121);var c=e.i(18050),m=e.i(57688);function u(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(1))+" "+["B","KB","MB","GB"][t]}function x(e){return({png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",webp:"🖼️",svg:"🖼️",mp4:"🎬",webm:"🎬",mov:"🎬",avi:"🎬",mkv:"🎬",ogv:"🎬",mp3:"🎵",wav:"🎵",ogg:"🎵",m4a:"🎵",aac:"🎵",flac:"🎵",json:"📋",md:"📝",txt:"📄",html:"🌐",pdf:"📕"})[e.toLowerCase().split(".").pop()??""]??"📎"}function h({deliverable:e,fileUrl:t,maxMediaHeight:r="400px",onDownload:a}){return e?(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"mb-3 pb-3 border-b border-white/10",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)("span",{className:"text-lg",children:x(e.fileName)}),(0,c.jsx)("span",{className:"font-medium text-[color:var(--ck-text-primary)] text-sm break-all",children:e.fileName})]}),(0,c.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] space-y-1",children:[(0,c.jsxs)("div",{children:["Size: ",u(e.size)]}),(0,c.jsxs)("div",{children:["Modified: ",function(e){try{return new Date(e).toLocaleString()}catch{return e}}(e.mtime)]}),(0,c.jsxs)("div",{children:["Path: ",e.relativePath]})]})]}),i(e.fileName)?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Image Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-2 overflow-hidden",children:(0,c.jsx)(m.default,{src:t,alt:e.fileName,width:800,height:600,className:"w-full h-auto rounded-lg object-contain",style:{maxHeight:r},unoptimized:!0})}),(0,c.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,c.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Open full size ↗"}),(0,c.jsx)("button",{onClick:a,className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download"})]})]}):o(e.fileName)?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Video Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-2 overflow-hidden",children:(0,c.jsxs)("video",{src:t,controls:!0,className:"w-full rounded-lg",style:{maxHeight:r},preload:"metadata",children:[(0,c.jsx)("source",{src:t,type:d(e.fileName)}),"Your browser does not support video playback."]})}),(0,c.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,c.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Open full size ↗"}),(0,c.jsx)("button",{onClick:a,className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download"})]})]}):l(e.fileName)?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Audio Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-2",children:(0,c.jsxs)("audio",{src:t,controls:!0,className:"w-full",preload:"metadata",children:[(0,c.jsx)("source",{src:t,type:d(e.fileName)}),"Your browser does not support audio playback."]})}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("button",{onClick:a,className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download"})})]}):e.isText&&e.contentPreview?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] mb-2",children:"Content Preview:"}),(0,c.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-3 overflow-auto",style:{maxHeight:r},children:(0,c.jsx)("pre",{className:"text-xs text-[color:var(--ck-text-primary)] whitespace-pre-wrap break-words",children:e.contentPreview})})]}):(0,c.jsxs)("div",{className:"text-center py-6",children:[(0,c.jsx)("div",{className:"text-3xl mb-2",children:x(e.fileName)}),(0,c.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-secondary)] mb-2",children:[u(e.size)," · ",e.fileName.split(".").pop()?.toUpperCase()," file"]}),(0,c.jsx)("button",{onClick:a,className:"text-xs px-3 py-1.5 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"Download file"})]})]}):(0,c.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)] italic",children:"Select a deliverable to preview"})}e.s(["DeliverablePreviewPanel",()=>h],34011)},529,e=>{"use strict";var t=e.i(18050),r=e.i(57688),a=e.i(22016),s=e.i(71645),i=e.i(18566),o=e.i(37121),l=e.i(34011);function n(e,t){return`/api/teams/workflow-deliverables/file?teamId=${encodeURIComponent(e)}&runId=${encodeURIComponent(t.runId)}&path=${encodeURIComponent(t.relativePath)}`}function d(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(1))+" "+["B","KB","MB","GB"][t]}function c(e){try{return new Date(e).toLocaleString()}catch{return e}}function m(e){switch(e.toLowerCase().split(".").pop()){case"md":return"📝";case"json":return"🔧";case"txt":default:return"📄";case"html":case"htm":return"🌐";case"css":return"🎨";case"js":case"ts":case"tsx":case"jsx":return"⚙️";case"png":case"jpg":case"jpeg":case"gif":case"webp":return"🖼️";case"pdf":return"📋";case"zip":case"tar":case"gz":return"📦"}}function u({teamId:e,deliverables:u,workflows:x}){let h=(0,i.useRouter)(),[p,f]=(0,s.useState)(""),[g,v]=(0,s.useState)(""),[b,w]=(0,s.useState)(""),[y,j]=(0,s.useState)(null),k=(0,s.useMemo)(()=>{let e=b.trim().toLowerCase();return u.filter(t=>{if(p&&t.workflowId!==p||g&&t.runId!==g)return!1;if(!e)return!0;let r=x[t.workflowId]?.name??"";return t.fileName.toLowerCase().includes(e)||t.workflowId.toLowerCase().includes(e)||t.runId.toLowerCase().includes(e)||r.toLowerCase().includes(e)||t.contentPreview&&t.contentPreview.toLowerCase().includes(e)})},[u,b,p,g,x]),N=(0,s.useMemo)(()=>Array.from(new Set(u.map(e=>e.workflowId).filter(Boolean))).sort(),[u]),S=(0,s.useMemo)(()=>Array.from(new Set((p?u.filter(e=>e.workflowId===p):u).map(e=>e.runId).filter(Boolean))).sort(),[u,p]),C=async t=>{try{if(t.isText&&t.contentPreview)await navigator.clipboard.writeText(t.contentPreview),alert("Content copied to clipboard!");else{let r=n(e,t),a=document.createElement("a");a.href=r,a.download=t.fileName,document.body.appendChild(a),a.click(),a.remove()}}catch{alert("Failed to download file")}};return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("div",{className:"rounded-3xl border border-white/10 bg-black/10 p-4",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"workflow"}),(0,t.jsxs)("select",{value:p,onChange:e=>{f(e.target.value||""),v("")},className:"mt-1 w-64 max-w-full rounded-lg border border-white/10 bg-white/5 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"All workflows"}),N.map(e=>(0,t.jsx)("option",{value:e,children:x[e]?.name?`${x[e]?.name} (${e})`:e},e))]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"run"}),(0,t.jsxs)("select",{value:g,onChange:e=>v(e.target.value||""),className:"mt-1 w-56 max-w-full rounded-lg border border-white/10 bg-white/5 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]",children:[(0,t.jsx)("option",{value:"",children:"All runs"}),S.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]})]}),(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-[color:var(--ck-text-tertiary)]",children:"search"}),(0,t.jsx)("input",{value:b,onChange:e=>w(e.target.value),placeholder:"filename / content",className:"mt-1 w-72 max-w-full rounded-lg border border-white/10 bg-white/5 px-2 py-2 text-sm text-[color:var(--ck-text-primary)]"})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("button",{type:"button",onClick:()=>h.refresh(),className:"rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm font-medium text-[color:var(--ck-text-primary)] hover:bg-white/10",children:"Refresh"})})]})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[(0,t.jsxs)("div",{className:"lg:col-span-2 rounded-3xl border border-white/10 bg-black/10 p-4",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-[color:var(--ck-text-primary)] mb-4",children:"Workflow Deliverables"}),k.length>0?(0,t.jsx)("div",{className:"space-y-2",children:k.map((s,i)=>{let l=y?.absolutePath===s.absolutePath,u=x[s.workflowId]?.name||s.workflowId;return(0,t.jsx)("div",{className:`cursor-pointer rounded-lg border p-3 transition-colors ${l?"border-white/20 bg-white/10":"border-white/5 bg-black/5 hover:bg-white/5"}`,onClick:()=>j(s),children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,o.isImageFile)(s.fileName)&&(0,t.jsx)("div",{className:"flex-shrink-0 w-12 h-12 rounded overflow-hidden bg-white/5 border border-white/10",children:(0,t.jsx)(r.default,{src:n(e,s),alt:s.fileName,width:48,height:48,className:"w-full h-full object-cover",unoptimized:!0})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-lg",children:m(s.fileName)}),(0,t.jsx)("span",{className:"font-medium text-[color:var(--ck-text-primary)] truncate",children:s.fileName}),s.isText&&(0,t.jsx)("span",{className:"text-xs bg-green-500/20 text-green-400 px-1.5 py-0.5 rounded",children:"TEXT"})]}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:[(0,t.jsx)("span",{className:"font-mono",children:u})," · ",(0,t.jsx)("span",{className:"font-mono",children:s.runId})]}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-[color:var(--ck-text-tertiary)]",children:[s.relativePath!==s.fileName&&(0,t.jsxs)("span",{children:[s.relativePath," · "]}),d(s.size)," · ",c(s.mtime)]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),C(s)},className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:s.isText?"Copy":"Download"}),(0,t.jsx)(a.default,{href:`/teams/${e}/runs/${s.workflowId}/${s.runId}`,onClick:e=>e.stopPropagation(),className:"text-xs px-2 py-1 border border-white/10 rounded hover:bg-white/5 text-[color:var(--ck-text-secondary)]",children:"View Run →"})]})]})},`${s.runId}-${s.relativePath}`)})}):(0,t.jsxs)("div",{className:"text-center py-8 text-[color:var(--ck-text-secondary)]",children:[(0,t.jsx)("div",{className:"text-4xl mb-2",children:"📋"}),(0,t.jsx)("div",{className:"text-lg mb-1",children:"No deliverables found"}),(0,t.jsx)("div",{className:"text-sm",children:"Workflow runs will create deliverables that appear here when they complete."})]}),k.length>0&&(0,t.jsxs)("div",{className:"mt-4 text-xs text-[color:var(--ck-text-tertiary)]",children:["Showing ",k.length," of ",u.length," deliverables."]})]}),(0,t.jsxs)("div",{className:"lg:col-span-1 rounded-3xl border border-white/10 bg-black/10 p-4",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-[color:var(--ck-text-primary)] mb-3",children:"Preview"}),y?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-3 pb-3 border-b border-white/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-lg",children:m(y.fileName)}),(0,t.jsx)("span",{className:"font-medium text-[color:var(--ck-text-primary)] text-sm break-all",children:y.fileName})]}),(0,t.jsxs)("div",{className:"text-xs text-[color:var(--ck-text-tertiary)] space-y-1",children:[(0,t.jsxs)("div",{children:["Size: ",d(y.size)]}),(0,t.jsxs)("div",{children:["Modified: ",c(y.mtime)]}),(0,t.jsxs)("div",{children:["Path: ",y.relativePath]})]})]}),(0,t.jsx)(l.DeliverablePreviewPanel,{deliverable:y,fileUrl:n(e,y),maxMediaHeight:"500px",onDownload:()=>C(y)})]}):(0,t.jsx)("div",{className:"text-sm text-[color:var(--ck-text-secondary)] italic",children:"Select a deliverable to preview"})]})]})]})}e.s(["default",()=>u])},32246,e=>{e.v(e=>Promise.resolve().then(()=>e(74080)))}]);
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[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"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},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 o(){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 i(){let e=await o();return n.default.join(e,"recipes")}async function s(){let e=await o(),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 c(e){let t=e.replace(/\\/g,"/");if(!t||t.startsWith("/")||t.includes(".."))throw Error("Invalid file name");return t}async function d(){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",()=>c,"getBuiltinRecipesDir",()=>d,"getTeamWorkspaceDir",()=>l,"getWorkspaceDir",()=>o,"getWorkspaceGoalsDir",()=>s,"getWorkspaceRecipesDir",()=>i,"readOpenClawConfig",()=>a,"teamDirFromBaseWorkspace",()=>u])},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 o(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)}function i(e){let t=e.trim();if(!t)return e;let r=t[0];if("["===r||"{"===r||'"'===r)return e;let n=t.split("\n"),a=n.findIndex(e=>/^\s*[[\{"]/.test(e));if(a>0){let e=n.slice(a).join("\n");try{return JSON.parse(e),e}catch{}}return e}async function s(e,t={}){let{sanitizeStdout:r=!0}=t;try{process.platform;let t=await n("openclaw",e,{timeout:12e4,windowsHide:!0,maxBuffer:0xa00000}),a=String(t.stdout??"");return{ok:!0,exitCode:0,stdout:r?i(a):a,stderr:String(t.stderr??"")}}catch(t){let e="number"==typeof t.code?t.code:1;return{ok:!1,exitCode:e,stdout:a(t),stderr:o(t,t)}}}function l(e){let t=e.trim();if(!t)return null;try{return JSON.parse(t)}catch{}let r=t.split("\n"),n=r.findIndex(e=>/^\s*[[\{]/.test(e));if(n>=0){let e=r.slice(n).join("\n");try{return JSON.parse(e)}catch{}}for(let e=r.length-1;e>=0;e--)if(/^\s*[\]}]/.test(r[e])){for(let t=e;t>=0;t--)if(/^\s*[[\{]/.test(r[t]))try{return JSON.parse(r.slice(t,e+1).join("\n"))}catch{}}return null}async function u(e){return s(e,{sanitizeStdout:!1})}async function c(e){if("cron"===e[0]||"recipes"===e[0]&&"workflows"===e[1]&&["runner-once","runner-tick","worker-tick"].includes(e[2]))return s(e);let r=(0,t.getKitchenApi)();try{let t=await r.runtime.system.runCommandWithTimeout(["openclaw",...e],{timeoutMs:12e4}),n=i(String(t.stdout??"")),a=String(t.stderr??""),o="number"==typeof t.exitCode?t.exitCode:"number"==typeof t.code?t.code:"number"==typeof t.status?t.status:0;if(0!==o)return{ok:!1,exitCode:o,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:o(t,t)}}}e.s(["extractJson",()=>l,"runOpenClaw",()=>c,"runOpenClawRaw",()=>u])},76509,e=>{"use strict";var t=e.i(7367);async function r(){let e=await (0,t.readOpenClawConfig)(),r=e.gateway?.port??18789,n=e.gateway?.auth?.token;if(!n)throw Error("Missing gateway token (gateway.auth.token in ~/.openclaw/openclaw.json)");return{baseUrl:`http://127.0.0.1:${r}`,token:n}}async function n(e){let{baseUrl:t,token:n}=await r(),a=await fetch(`${t}/tools/invoke`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${n}`},body:JSON.stringify(e)}),o=await a.json();if(!a.ok||!o.ok)throw Error("object"==typeof o.error&&o.error?.message||("string"==typeof o.error?o.error:null)||`tools/invoke failed (${a.status})`);return o.result}function a(e){return e?.find(e=>"text"===e.type)?.text}async function o(){let e=await n({tool:"gateway",args:{action:"config.get",raw:"{}"}}),t=a(e?.content);if(!t)throw Error("gateway config.get: missing text payload");let r=JSON.parse(t),o=String(r?.result?.raw??""),i=String(r?.result?.hash??"");if(!o)throw Error("gateway config.get: missing result.raw");if(!i)throw Error("gateway config.get: missing result.hash");return{raw:o,hash:i}}async function i(e,t){let{hash:r}=await o();return n({tool:"gateway",args:{action:"config.patch",raw:JSON.stringify(e,null,2),baseHash:r,note:t??"ClawKitchen settings update",restartDelayMs:1e3}})}e.s(["gatewayConfigGet",()=>o,"gatewayConfigPatch",()=>i,"getContentText",()=>a,"toolsInvoke",()=>n])},63915,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),a=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),p=e.i(66012),f=e.i(70101),g=e.i(74838),h=e.i(10372),w=e.i(93695);e.i(52474);var y=e.i(220),x=e.i(12714),m=e.i(50227),v=e.i(89171),R=e.i(76509),C=e.i(5003),k=e.i(7367);async function S(e){return JSON.parse(await x.default.readFile(e,"utf8"))}async function E(e){let t=String(new URL(e.url).searchParams.get("teamId")??"").trim();if(!t)return v.NextResponse.json({ok:!1,error:"teamId is required"},{status:400});let r=await (0,R.toolsInvoke)({tool:"gateway",args:{action:"config.get",raw:"{}"}}),n=(0,R.getContentText)(r?.content)??"";if(!n)return v.NextResponse.json({ok:!1,error:"Failed to fetch config via gateway"},{status:500});let a=JSON.parse(n),o=String(a.result?.raw??""),i=o?JSON.parse(o):null,s=String(i?.agents?.defaults?.workspace??"").trim();if(!s)return v.NextResponse.json({ok:!1,error:"agents.defaults.workspace not set"},{status:500});let l=(0,k.teamDirFromBaseWorkspace)(s,t),u=m.default.join(l,"notes","cron-jobs.json"),c=null;try{c=await S(u)}catch{c=null}let d=new Set(Object.values(c?.entries??{}).filter(e=>e&&"string"==typeof e.installedCronId&&!e.orphaned).map(e=>e.installedCronId)),p=await (0,C.runOpenClaw)(["cron","list","--all","--json"]);if(!p.ok)return v.NextResponse.json({ok:!1,error:p.stderr||p.stdout},{status:500});let f=(JSON.parse(String(p.stdout||"{}")).jobs??[]).filter(e=>d.has(String(e.id??e.jobId??"").trim()));return v.NextResponse.json({ok:!0,teamId:t,teamDir:l,mappingPath:u,jobCount:f.length,jobs:f})}e.s(["GET",()=>E],4904);var j=e.i(4904);let b=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/cron/recipe-installed/route",pathname:"/api/cron/recipe-installed",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/cron/recipe-installed/route.ts",nextConfigOutput:"standalone",userland:j}),{workAsyncStorage:N,workUnitAsyncStorage:O,serverHooks:A}=b;function T(){return(0,n.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:O})}async function P(e,t,n){b.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/cron/recipe-installed/route";x=x.replace(/\/index$/,"")||"/";let m=await b.prepare(e,t,{srcPage:x,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:v,params:R,nextConfig:C,parsedUrl:k,isDraftMode:S,prerenderManifest:E,routerServerContext:j,isOnDemandRevalidate:N,revalidateOnlyGenerated:O,resolvedPathname:A,clientReferenceManifest:T,serverActionsManifest:P}=m,q=(0,s.normalizeAppPath)(x),I=!!(E.dynamicRoutes[q]||E.routes[A]),_=async()=>((null==j?void 0:j.render404)?await j.render404(e,t,k,!1):t.end("This page could not be found"),null);if(I&&!S){let e=!!E.routes[A],t=E.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(C.experimental.adapterPath)return await _();throw new w.NoFallbackError}}let D=null;!I||b.isDev||S||(D="/index"===(D=A)?"/":D);let H=!0===b.isDev||!I,U=I&&!H;P&&T&&(0,i.setManifestsSingleton)({page:x,clientReferenceManifest:T,serverActionsManifest:P});let F=e.method||"GET",M=(0,o.getTracer)(),$=M.getActiveScopeSpan(),J={params:R,prerenderManifest:E,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:C.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>b.onRequestError(e,t,n,a,j)},sharedContext:{buildId:v}},K=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),W=u.NextRequestAdapter.fromNodeNextRequest(K,(0,u.signalFromNodeResponse)(t));try{let i=async e=>b.handle(W,J).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.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=`${F} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${F} ${x}`)}),s=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var o,l;let u=async({previousCacheEntry:r})=>{try{if(!s&&N&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(a);e.fetchMetrics=J.renderOpts.fetchMetrics;let l=J.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let u=J.renderOpts.collectedTags;if(!I)return await (0,p.sendResponse)(K,B,o,J.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[h.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==J.renderOpts.collectedRevalidate&&!(J.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&J.renderOpts.collectedRevalidate,n=void 0===J.renderOpts.collectedExpire||J.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:J.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await b.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,j),t}},c=await b.handleResponse({req:e,nextConfig:C,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:E,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:s});if(!I)return null;if((null==c||null==(o=c.value)?void 0:o.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",N?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let w=(0,f.fromNodeOutgoingHttpHeaders)(c.value.headers);return s&&I||w.delete(h.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||w.get("Cache-Control")||w.set("Cache-Control",(0,g.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)(K,B,new Response(c.value.body,{headers:w,status:c.value.status||200})),null};$?await l($):await M.withPropagatedContext(e.headers,()=>M.trace(c.BaseServerSpan.handleRequest,{spanName:`${F} ${x}`,kind:o.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},l))}catch(t){if(t instanceof w.NoFallbackError||await b.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,j),I)throw t;return await (0,p.sendResponse)(K,B,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>T,"routeModule",()=>b,"serverHooks",()=>A,"workAsyncStorage",()=>N,"workUnitAsyncStorage",()=>O],63915)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__2705b289._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/paths.ts","../../../src/lib/kitchen-api.ts","../../../src/lib/openclaw.ts","../../../src/lib/gateway.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/cron/recipe-installed/route.ts","../../../src/lib/cron.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\ntype OpenClawConfig = {\n agents?: { defaults?: { workspace?: string } };\n gateway?: { port?: number; auth?: { token?: string } };\n tools?: {\n agentToAgent?: {\n enabled?: boolean;\n allow?: string[];\n };\n };\n plugins?: {\n installs?: { recipes?: { installPath?: string; sourcePath?: string } };\n load?: { paths?: string[] };\n };\n // OpenClaw message routing bindings (used for HITL approvals, etc.)\n bindings?: unknown[];\n};\n\nexport async function readOpenClawConfig(): Promise<OpenClawConfig> {\n const p = path.join(os.homedir(), \".openclaw\", \"openclaw.json\");\n const text = await fs.readFile(p, \"utf8\");\n return JSON.parse(text) as OpenClawConfig;\n}\n\nexport async function getWorkspaceDir() {\n const cfg = await readOpenClawConfig();\n const ws = cfg.agents?.defaults?.workspace;\n if (!ws) throw new Error(\"agents.defaults.workspace is not set in ~/.openclaw/openclaw.json\");\n return ws;\n}\n\nexport async function getWorkspaceRecipesDir() {\n const ws = await getWorkspaceDir();\n return path.join(ws, \"recipes\");\n}\n\nexport async function getWorkspaceGoalsDir() {\n const ws = await getWorkspaceDir();\n\n // Back-compat: some installs keep goals at <workspace>/goals.\n // Prefer that when present, otherwise fall back to <workspace>/notes/goals.\n const direct = path.join(ws, \"goals\");\n try {\n const st = await fs.stat(direct);\n if (st.isDirectory()) return direct;\n } catch {\n // ignore\n }\n\n return path.join(ws, \"notes\", \"goals\");\n}\n\nexport async function getTeamWorkspaceDir(teamId: string) {\n const home = os.homedir();\n if (!home) throw new Error(\"Could not resolve home directory\");\n return path.join(home, \".openclaw\", `workspace-${teamId}`);\n}\n\n/** Team workspace dir derived from agents.defaults.workspace (sibling: .. / workspace-{teamId}) */\nexport function teamDirFromBaseWorkspace(baseWorkspace: string, teamId: string) {\n // Special-case: treat \"main\" as the personal workspace (agents.defaults.workspace).\n // This lets Kitchen expose a selectable \"main\" scope without creating a separate\n // ~/.openclaw/workspace-main folder.\n if (teamId === \"main\") return path.resolve(baseWorkspace);\n return path.resolve(baseWorkspace, \"..\", `workspace-${teamId}`);\n}\n\n/** Rejects path traversal and empty names; returns normalized name. */\nexport function assertSafeRelativeFileName(name: string): string {\n const n = name.replace(/\\\\/g, \"/\");\n if (!n || n.startsWith(\"/\") || n.includes(\"..\")) throw new Error(\"Invalid file name\");\n return n;\n}\n\nexport async function getBuiltinRecipesDir() {\n const cfg = await readOpenClawConfig();\n const p =\n cfg.plugins?.installs?.recipes?.installPath ||\n cfg.plugins?.installs?.recipes?.sourcePath ||\n cfg.plugins?.load?.paths?.[0];\n if (!p) throw new Error(\"Could not determine recipes plugin install path from ~/.openclaw/openclaw.json\");\n return path.join(p, \"recipes\", \"default\");\n}\n","// 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\n/**\n * Strip non-JSON diagnostic lines from stdout.\n *\n * OpenClaw may print plugin/doctor/diagnostic lines to stdout before the\n * actual JSON payload (e.g. \"[doctor] ...\", \"[plugins] ...\", \"🦞 OpenClaw ...\").\n * This breaks callers that do JSON.parse(stdout).\n *\n * If stdout looks like it contains a JSON payload with leading noise, strip the\n * noise lines. Otherwise return as-is (non-JSON commands like `config get` may\n * return plain text).\n */\nfunction sanitizeStdout(raw: string): string {\n const trimmed = raw.trim();\n if (!trimmed) return raw;\n\n // Fast path: already starts with JSON\n const firstChar = trimmed[0];\n if (firstChar === \"[\" || firstChar === \"{\" || firstChar === '\"') return raw;\n\n // Look for the first line starting with a JSON token\n const lines = trimmed.split(\"\\n\");\n const jsonStartIdx = lines.findIndex((l) => /^\\s*[[\\{\"]/.test(l));\n if (jsonStartIdx > 0) {\n // Verify the remainder is valid JSON before stripping\n const candidate = lines.slice(jsonStartIdx).join(\"\\n\");\n try {\n JSON.parse(candidate);\n return candidate;\n } catch {\n // Not valid JSON after stripping — return original\n }\n }\n\n return raw;\n}\n\nasync function runOpenClawLocal(args: string[], options: { sanitizeStdout?: boolean } = {}): Promise<OpenClawExecResult> {\n const { sanitizeStdout: shouldSanitize = true } = options;\n \n try {\n const isWindows = process.platform === \"win32\";\n const res = await execFileAsync(\"openclaw\", args, {\n timeout: 120000,\n windowsHide: true,\n maxBuffer: 10 * 1024 * 1024,\n // Windows requires shell:true to resolve executables on PATH via PATHEXT.\n // Without it, execFile throws ENOENT even when openclaw is installed globally.\n ...(isWindows ? { shell: true } : {}),\n });\n\n const rawStdout = String(res.stdout ?? \"\");\n \n return {\n ok: true,\n exitCode: 0,\n stdout: shouldSanitize ? sanitizeStdout(rawStdout) : rawStdout,\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\n/**\n * Extract a JSON payload from stdout that may contain non-JSON diagnostic lines\n * (e.g. [doctor], [plugins], [recipes] log lines before the actual JSON).\n * Returns the parsed value or null if no JSON found.\n */\nexport function extractJson<T = unknown>(stdout: string): T | null {\n const trimmed = stdout.trim();\n if (!trimmed) return null;\n\n // Fast path: pure JSON\n try {\n return JSON.parse(trimmed) as T;\n } catch {\n // fall through\n }\n\n // Find the first line starting with [ or { (JSON array/object)\n const lines = trimmed.split(\"\\n\");\n const jsonStartIdx = lines.findIndex((l) => /^\\s*[[\\{]/.test(l));\n if (jsonStartIdx >= 0) {\n const jsonSlice = lines.slice(jsonStartIdx).join(\"\\n\");\n try {\n return JSON.parse(jsonSlice) as T;\n } catch {\n // fall through\n }\n }\n\n // Last resort: find the last JSON block (scan from end)\n for (let i = lines.length - 1; i >= 0; i--) {\n if (/^\\s*[\\]}]/.test(lines[i])) {\n // Walk backward to find the matching open\n for (let j = i; j >= 0; j--) {\n if (/^\\s*[[\\{]/.test(lines[j])) {\n try {\n return JSON.parse(lines.slice(j, i + 1).join(\"\\n\")) as T;\n } catch {\n // continue searching\n }\n }\n }\n }\n }\n\n return null;\n}\n\n/**\n * Run OpenClaw without stdout sanitization (for raw text output like recipe markdown)\n */\nexport async function runOpenClawRaw(args: string[]): Promise<OpenClawExecResult> {\n // Always use local exec for raw content to avoid Kitchen runtime restrictions\n return runOpenClawLocal(args, { sanitizeStdout: false });\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 // Workflow runner/worker commands are long-running orchestration processes that\n // acquire locks and claims. The runtime command wrapper (runCommandWithTimeout)\n // has a 120s hard timeout that can kill these mid-execution, orphaning locks and\n // leaving runs stuck in waiting_workers. Route them through local exec instead.\n if (\n args[0] === \"recipes\" &&\n args[1] === \"workflows\" &&\n [\"runner-once\", \"runner-tick\", \"worker-tick\"].includes(args[2])\n ) {\n return runOpenClawLocal(args);\n }\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 = sanitizeStdout(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 { readOpenClawConfig } from \"@/lib/paths\";\n\ntype ToolsInvokeRequest = {\n tool: string;\n action?: string;\n args?: Record<string, unknown>;\n sessionKey?: string;\n dryRun?: boolean;\n};\n\ntype ToolsInvokeResponse = {\n ok: boolean;\n result?: unknown;\n error?: { message?: string } | string;\n};\n\ntype GatewayConfigGetResult = {\n path: string;\n exists: boolean;\n raw: string;\n hash: string;\n};\n\ntype ToolTextEnvelope = {\n ok: boolean;\n result: GatewayConfigGetResult;\n};\n\nasync function getGatewayBaseUrlAndToken() {\n // ClawKitchen runs in-process with the OpenClaw Gateway (as a plugin), so we can read\n // the gateway port/token from the loaded config.\n const cfg = await readOpenClawConfig();\n const port = cfg.gateway?.port ?? 18789;\n const token = cfg.gateway?.auth?.token;\n if (!token) throw new Error(\"Missing gateway token (gateway.auth.token in ~/.openclaw/openclaw.json)\");\n\n const baseUrl = `http://127.0.0.1:${port}`;\n return { baseUrl, token };\n}\n\nexport async function toolsInvoke<T = unknown>(req: ToolsInvokeRequest): Promise<T> {\n const { baseUrl, token } = await getGatewayBaseUrlAndToken();\n\n const res = await fetch(`${baseUrl}/tools/invoke`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n authorization: `Bearer ${token}`,\n },\n body: JSON.stringify(req),\n });\n\n const json = (await res.json()) as ToolsInvokeResponse;\n if (!res.ok || !json.ok) {\n const msg =\n (typeof json.error === \"object\" && json.error?.message) ||\n (typeof json.error === \"string\" ? json.error : null) ||\n `tools/invoke failed (${res.status})`;\n throw new Error(msg);\n }\n\n return json.result as T;\n}\n\nexport function getContentText(content: Array<{ type: string; text?: string }> | undefined): string | undefined {\n return content?.find((c) => c.type === \"text\")?.text;\n}\n\nexport async function gatewayConfigGet(): Promise<{ raw: string; hash: string }> {\n const toolResult = await toolsInvoke<{ content: Array<{ type: string; text?: string }> }>({\n tool: \"gateway\",\n args: { action: \"config.get\", raw: \"{}\" },\n });\n\n const text = getContentText(toolResult?.content);\n if (!text) throw new Error(\"gateway config.get: missing text payload\");\n\n const parsed = JSON.parse(text) as ToolTextEnvelope;\n const raw = String(parsed?.result?.raw ?? \"\");\n const hash = String(parsed?.result?.hash ?? \"\");\n if (!raw) throw new Error(\"gateway config.get: missing result.raw\");\n if (!hash) throw new Error(\"gateway config.get: missing result.hash\");\n return { raw, hash };\n}\n\nexport async function gatewayConfigPatch(patch: unknown, note?: string) {\n const { hash } = await gatewayConfigGet();\n const raw = JSON.stringify(patch, null, 2);\n\n return toolsInvoke({\n tool: \"gateway\",\n args: {\n action: \"config.patch\",\n raw,\n baseHash: hash,\n note: note ?? \"ClawKitchen settings update\",\n restartDelayMs: 1000,\n },\n });\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"standalone\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/cron/recipe-installed/route\",\n pathname: \"/api/cron/recipe-installed\",\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/recipe-installed/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/recipe-installed/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 { cronJobId, type CronJobShape } from \"@/lib/cron\";\nimport { getContentText, toolsInvoke } from \"@/lib/gateway\";\nimport { runOpenClaw } from \"@/lib/openclaw\";\nimport { teamDirFromBaseWorkspace } from \"@/lib/paths\";\n\ntype MappingStateV1 = {\n version: 1;\n entries: Record<string, { installedCronId: string; orphaned?: boolean }>;\n};\n\nasync function readJson<T>(p: string): Promise<T> {\n const raw = await fs.readFile(p, \"utf8\");\n return JSON.parse(raw) as T;\n}\n\nexport async function GET(req: Request) {\n const url = new URL(req.url);\n const teamId = String(url.searchParams.get(\"teamId\") ?? \"\").trim();\n if (!teamId) {\n return NextResponse.json({ ok: false, error: \"teamId is required\" }, { status: 400 });\n }\n\n // Team workspace root is a sibling of agents.defaults.workspace: ~/.openclaw/workspace-<teamId>\n const result = await toolsInvoke<{ content: Array<{ type: string; text?: string }> }>({\n tool: \"gateway\",\n args: { action: \"config.get\", raw: \"{}\" },\n });\n const cfgText = getContentText(result?.content) ?? \"\";\n if (!cfgText) {\n return NextResponse.json({ ok: false, error: \"Failed to fetch config via gateway\" }, { status: 500 });\n }\n const env = JSON.parse(cfgText) as { result?: { raw?: string } };\n const raw = String(env.result?.raw ?? \"\");\n const parsedRaw = raw ? (JSON.parse(raw) as { agents?: { defaults?: { workspace?: string } } }) : null;\n const baseWorkspace = String(parsedRaw?.agents?.defaults?.workspace ?? \"\").trim();\n if (!baseWorkspace) {\n return NextResponse.json({ ok: false, error: \"agents.defaults.workspace not set\" }, { status: 500 });\n }\n const teamDir = teamDirFromBaseWorkspace(baseWorkspace, teamId);\n const mappingPath = path.join(teamDir, \"notes\", \"cron-jobs.json\");\n\n let mapping: MappingStateV1 | null = null;\n try {\n mapping = await readJson<MappingStateV1>(mappingPath);\n } catch {\n // no mapping (yet)\n mapping = null;\n }\n\n const ids = new Set(\n Object.values(mapping?.entries ?? {})\n .filter((e) => e && typeof e.installedCronId === \"string\" && !e.orphaned)\n .map((e) => e.installedCronId)\n );\n\n const res = await runOpenClaw([\"cron\", \"list\", \"--all\", \"--json\"]);\n if (!res.ok) {\n return NextResponse.json({ ok: false, error: res.stderr || res.stdout }, { status: 500 });\n }\n const parsed = JSON.parse(String(res.stdout || \"{}\")) as { jobs?: unknown[] };\n const jobs = (parsed.jobs ?? []).filter((j) => ids.has(cronJobId(j as CronJobShape)));\n\n return NextResponse.json({ ok: true, teamId, teamDir, mappingPath, jobCount: jobs.length, jobs });\n}\n","/**\n * Shared shape for cron job objects returned by the gateway cron tool.\n * Different callers may receive slightly different structures; these helpers normalize access.\n */\nexport type CronJobShape = {\n id?: unknown;\n jobId?: unknown;\n name?: unknown;\n enabled?: unknown;\n state?: { enabled?: unknown };\n};\n\n/** Typed cron job for UI display. API returns jobs that match this structure. */\nexport type CronJob = {\n id: string;\n name?: string;\n enabled?: boolean;\n schedule?: { kind?: string; expr?: string; everyMs?: number };\n state?: { nextRunAtMs?: number };\n agentId?: string;\n sessionTarget?: string;\n};\n\nexport function cronJobId(j: CronJobShape): string {\n return String(j.id ?? j.jobId ?? \"\").trim();\n}\n\nexport function cronJobLabel(j: CronJobShape): string {\n return String(j.name ?? j.id ?? j.jobId ?? \"(unnamed)\");\n}\n\nexport function fmtCronSchedule(s?: CronJob[\"schedule\"]): string {\n if (!s) return \"\";\n if (s.kind === \"cron\" && s.expr) return s.expr;\n if (s.kind === \"every\" && s.everyMs) {\n const mins = Math.round(s.everyMs / 60000);\n return mins >= 60 ? `every ${Math.round(mins / 60)}h` : `every ${mins}m`;\n }\n return s.kind ?? \"\";\n}\n"],"names":[],"mappings":"2sCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAmBO,eAAe,IACpB,IAAM,EAAI,EAAA,OAAI,CAAC,IAAI,CAAC,EAAA,OAAE,CAAC,OAAO,GAAI,YAAa,iBAE/C,OAAO,KAAK,KAAK,CAAC,AADL,MAAM,EAAA,OAAE,CAAC,QAAQ,CAAC,EAAG,QAEpC,CAEO,eAAe,IACpB,IAAM,EAAM,MAAM,IACZ,EAAK,EAAI,MAAM,EAAE,UAAU,UACjC,GAAI,CAAC,EAAI,MAAM,AAAI,MAAM,qEACzB,OAAO,CACT,CAEO,eAAe,IACpB,IAAM,EAAK,MAAM,IACjB,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAI,UACvB,CAEO,eAAe,IACpB,IAAM,EAAK,MAAM,IAIX,EAAS,EAAA,OAAI,CAAC,IAAI,CAAC,EAAI,SAC7B,GAAI,CAEF,GAAI,CADO,MAAM,EAAA,OAAE,CAAC,IAAI,CAAC,EAAA,EAClB,WAAW,GAAI,OAAO,CAC/B,CAAE,KAAM,CAER,CAEA,OAAO,EAAA,OAAI,CAAC,IAAI,CAAC,EAAI,QAAS,QAChC,CAEO,eAAe,EAAoB,CAAc,EACtD,IAAM,EAAO,EAAA,OAAE,CA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