@useorgx/openclaw-plugin 0.4.8 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dashboard/dist/assets/BJgZIVUQ.js +53 -0
- package/dashboard/dist/assets/BJgZIVUQ.js.br +0 -0
- package/dashboard/dist/assets/BJgZIVUQ.js.gz +0 -0
- package/dashboard/dist/assets/BXWDRGm-.js +1 -0
- package/dashboard/dist/assets/BXWDRGm-.js.br +0 -0
- package/dashboard/dist/assets/BXWDRGm-.js.gz +0 -0
- package/dashboard/dist/assets/BgOYB78t.js +4 -0
- package/dashboard/dist/assets/BgOYB78t.js.br +0 -0
- package/dashboard/dist/assets/BgOYB78t.js.gz +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js.br +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js.gz +0 -0
- package/dashboard/dist/assets/CE38zU4U.js +1 -0
- package/dashboard/dist/assets/CE38zU4U.js.br +0 -0
- package/dashboard/dist/assets/CE38zU4U.js.gz +0 -0
- package/dashboard/dist/assets/CFGKRAzG.js +1 -0
- package/dashboard/dist/assets/CFGKRAzG.js.br +0 -0
- package/dashboard/dist/assets/CFGKRAzG.js.gz +0 -0
- package/dashboard/dist/assets/CGGR2GZh.js +1 -0
- package/dashboard/dist/assets/CGGR2GZh.js.br +0 -0
- package/dashboard/dist/assets/CGGR2GZh.js.gz +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js +1 -0
- package/dashboard/dist/assets/CL_wXqR7.js.br +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js.gz +0 -0
- package/dashboard/dist/assets/CPFiTmlw.js +8 -0
- package/dashboard/dist/assets/CPFiTmlw.js.br +0 -0
- package/dashboard/dist/assets/CPFiTmlw.js.gz +0 -0
- package/dashboard/dist/assets/CZZTvkQZ.js +1 -0
- package/dashboard/dist/assets/CZZTvkQZ.js.br +0 -0
- package/dashboard/dist/assets/CZZTvkQZ.js.gz +0 -0
- package/dashboard/dist/assets/{CpJsfbXo.js → CxQ08qFN.js} +2 -2
- package/dashboard/dist/assets/CxQ08qFN.js.br +0 -0
- package/dashboard/dist/assets/CxQ08qFN.js.gz +0 -0
- package/dashboard/dist/assets/D-bf6hEI.js +213 -0
- package/dashboard/dist/assets/D-bf6hEI.js.br +0 -0
- package/dashboard/dist/assets/D-bf6hEI.js.gz +0 -0
- package/dashboard/dist/assets/DG6y9wJI.js +2 -0
- package/dashboard/dist/assets/DG6y9wJI.js.br +0 -0
- package/dashboard/dist/assets/DG6y9wJI.js.gz +0 -0
- package/dashboard/dist/assets/DNxKz-GV.js +1 -0
- package/dashboard/dist/assets/DNxKz-GV.js.br +0 -0
- package/dashboard/dist/assets/DNxKz-GV.js.gz +0 -0
- package/dashboard/dist/assets/DW_rKUic.js +11 -0
- package/dashboard/dist/assets/DW_rKUic.js.br +0 -0
- package/dashboard/dist/assets/DW_rKUic.js.gz +0 -0
- package/dashboard/dist/assets/DbNoijHm.js +1 -0
- package/dashboard/dist/assets/DbNoijHm.js.br +0 -0
- package/dashboard/dist/assets/DbNoijHm.js.gz +0 -0
- package/dashboard/dist/assets/DjcdE6jC.js +2 -0
- package/dashboard/dist/assets/DjcdE6jC.js.br +0 -0
- package/dashboard/dist/assets/DjcdE6jC.js.gz +0 -0
- package/dashboard/dist/assets/FZYuCDnt.js +1 -0
- package/dashboard/dist/assets/FZYuCDnt.js.br +0 -0
- package/dashboard/dist/assets/FZYuCDnt.js.gz +0 -0
- package/dashboard/dist/assets/PAUiij_z.js +1 -0
- package/dashboard/dist/assets/PAUiij_z.js.br +0 -0
- package/dashboard/dist/assets/PAUiij_z.js.gz +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js +8 -0
- package/dashboard/dist/assets/cNrhgGc1.js.br +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js.gz +0 -0
- package/dashboard/dist/assets/h5biQs2I.css +1 -0
- package/dashboard/dist/assets/h5biQs2I.css.br +0 -0
- package/dashboard/dist/assets/h5biQs2I.css.gz +0 -0
- package/dashboard/dist/assets/ic2FaMnh.js +1 -0
- package/dashboard/dist/assets/ic2FaMnh.js.br +0 -0
- package/dashboard/dist/assets/ic2FaMnh.js.gz +0 -0
- package/dashboard/dist/assets/nByHNHoW.js +1 -0
- package/dashboard/dist/assets/nByHNHoW.js.br +0 -0
- package/dashboard/dist/assets/nByHNHoW.js.gz +0 -0
- package/dashboard/dist/assets/qm8xLgv-.css +1 -0
- package/dashboard/dist/assets/qm8xLgv-.css.br +0 -0
- package/dashboard/dist/assets/qm8xLgv-.css.gz +0 -0
- package/dashboard/dist/assets/tS9mbYZi.js +1 -0
- package/dashboard/dist/assets/tS9mbYZi.js.br +0 -0
- package/dashboard/dist/assets/tS9mbYZi.js.gz +0 -0
- package/dashboard/dist/brand/anthropic-mark.svg.br +0 -0
- package/dashboard/dist/brand/anthropic-mark.svg.gz +0 -0
- package/dashboard/dist/brand/openai-mark.svg.br +0 -0
- package/dashboard/dist/brand/openai-mark.svg.gz +0 -0
- package/dashboard/dist/brand/openclaw-mark.svg.br +0 -0
- package/dashboard/dist/brand/openclaw-mark.svg.gz +0 -0
- package/dashboard/dist/brand/xandy-orchestrator.png +0 -0
- package/dashboard/dist/index.html +7 -5
- package/dashboard/dist/index.html.br +0 -0
- package/dashboard/dist/index.html.gz +0 -0
- package/dist/activity-actor-fields.js +26 -4
- package/dist/activity-store.js +38 -26
- package/dist/agent-context-store.js +84 -42
- package/dist/agent-run-store.js +49 -28
- package/dist/agent-suite.d.ts +9 -0
- package/dist/agent-suite.js +150 -17
- package/dist/artifacts/artifact-domain-schemas.d.ts +66 -0
- package/dist/artifacts/artifact-domain-schemas.js +357 -0
- package/dist/artifacts/register-artifact.d.ts +4 -3
- package/dist/artifacts/register-artifact.js +170 -57
- package/dist/auth/flows.d.ts +47 -0
- package/dist/auth/flows.js +169 -0
- package/dist/auth-store.js +6 -26
- package/dist/byok-store.js +5 -19
- package/dist/chat-store.d.ts +157 -0
- package/dist/chat-store.js +586 -0
- package/dist/cli/orgx.d.ts +66 -0
- package/dist/cli/orgx.js +102 -0
- package/dist/config/refresh.d.ts +32 -0
- package/dist/config/refresh.js +55 -0
- package/dist/config/resolution.d.ts +37 -0
- package/dist/config/resolution.js +178 -0
- package/dist/contracts/client.d.ts +43 -3
- package/dist/contracts/client.js +159 -30
- package/dist/contracts/retro-schema.d.ts +81 -0
- package/dist/contracts/retro-schema.js +80 -0
- package/dist/contracts/shared-types.d.ts +306 -0
- package/dist/contracts/shared-types.js +179 -0
- package/dist/contracts/skill-pack-schema.d.ts +192 -0
- package/dist/contracts/skill-pack-schema.js +180 -0
- package/dist/contracts/types.d.ts +224 -132
- package/dist/contracts/types.js +5 -0
- package/dist/entities/auto-assignment.d.ts +36 -0
- package/dist/entities/auto-assignment.js +141 -0
- package/dist/entity-comment-store.js +5 -25
- package/dist/event-sanitization.d.ts +11 -0
- package/dist/event-sanitization.js +113 -0
- package/dist/fs-utils.js +13 -1
- package/dist/gateway-watchdog.d.ts +5 -0
- package/dist/gateway-watchdog.js +50 -0
- package/dist/hash-utils.d.ts +2 -0
- package/dist/hash-utils.js +12 -0
- package/dist/hooks/post-reporting-event.mjs +1 -5
- package/dist/http/helpers/activity-headline.d.ts +10 -0
- package/dist/http/helpers/activity-headline.js +73 -0
- package/dist/http/helpers/artifact-fallback.d.ts +13 -0
- package/dist/http/helpers/artifact-fallback.js +148 -0
- package/dist/http/helpers/auto-continue-engine.d.ts +486 -0
- package/dist/http/helpers/auto-continue-engine.js +3563 -0
- package/dist/http/helpers/autopilot-operations.d.ts +176 -0
- package/dist/http/helpers/autopilot-operations.js +554 -0
- package/dist/http/helpers/autopilot-runtime.d.ts +43 -0
- package/dist/http/helpers/autopilot-runtime.js +607 -0
- package/dist/http/helpers/autopilot-slice-utils.d.ts +56 -0
- package/dist/http/helpers/autopilot-slice-utils.js +899 -0
- package/dist/http/helpers/decision-mapper.d.ts +52 -0
- package/dist/http/helpers/decision-mapper.js +260 -0
- package/dist/http/helpers/dispatch-lifecycle.d.ts +119 -0
- package/dist/http/helpers/dispatch-lifecycle.js +809 -0
- package/dist/http/helpers/hash-utils.d.ts +1 -0
- package/dist/http/helpers/hash-utils.js +1 -0
- package/dist/http/helpers/kickoff-context.d.ts +12 -0
- package/dist/http/helpers/kickoff-context.js +228 -0
- package/dist/http/helpers/llm-client.d.ts +47 -0
- package/dist/http/helpers/llm-client.js +256 -0
- package/dist/http/helpers/mission-control.d.ts +193 -0
- package/dist/http/helpers/mission-control.js +1383 -0
- package/dist/http/helpers/openclaw-cli.d.ts +37 -0
- package/dist/http/helpers/openclaw-cli.js +283 -0
- package/dist/http/helpers/runtime-sse.d.ts +20 -0
- package/dist/http/helpers/runtime-sse.js +110 -0
- package/dist/http/helpers/sentinel-catalog.d.ts +23 -0
- package/dist/http/helpers/sentinel-catalog.js +193 -0
- package/dist/http/helpers/session-classification.d.ts +9 -0
- package/dist/http/helpers/session-classification.js +564 -0
- package/dist/http/helpers/slice-experience-v2.d.ts +137 -0
- package/dist/http/helpers/slice-experience-v2.js +677 -0
- package/dist/http/helpers/slice-run-projections.d.ts +72 -0
- package/dist/http/helpers/slice-run-projections.js +860 -0
- package/dist/http/helpers/triage-mapper.d.ts +43 -0
- package/dist/http/helpers/triage-mapper.js +549 -0
- package/dist/http/helpers/value-utils.d.ts +6 -0
- package/dist/http/helpers/value-utils.js +72 -0
- package/dist/http/helpers/workspace-scope.d.ts +15 -0
- package/dist/http/helpers/workspace-scope.js +170 -0
- package/dist/http/index.d.ts +88 -0
- package/dist/http/index.js +3610 -0
- package/dist/http/router.d.ts +23 -0
- package/dist/http/router.js +23 -0
- package/dist/http/routes/agent-control.d.ts +79 -0
- package/dist/http/routes/agent-control.js +684 -0
- package/dist/http/routes/agent-suite.d.ts +38 -0
- package/dist/http/routes/agent-suite.js +397 -0
- package/dist/http/routes/agents-catalog.d.ts +40 -0
- package/dist/http/routes/agents-catalog.js +128 -0
- package/dist/http/routes/billing.d.ts +23 -0
- package/dist/http/routes/billing.js +55 -0
- package/dist/http/routes/chat.d.ts +19 -0
- package/dist/http/routes/chat.js +522 -0
- package/dist/http/routes/debug.d.ts +14 -0
- package/dist/http/routes/debug.js +21 -0
- package/dist/http/routes/decision-actions.d.ts +20 -0
- package/dist/http/routes/decision-actions.js +103 -0
- package/dist/http/routes/delegation.d.ts +19 -0
- package/dist/http/routes/delegation.js +32 -0
- package/dist/http/routes/dispatch-gateway-envelope.d.ts +25 -0
- package/dist/http/routes/dispatch-gateway-envelope.js +26 -0
- package/dist/http/routes/entities.d.ts +63 -0
- package/dist/http/routes/entities.js +440 -0
- package/dist/http/routes/entity-dynamic.d.ts +25 -0
- package/dist/http/routes/entity-dynamic.js +191 -0
- package/dist/http/routes/health.d.ts +22 -0
- package/dist/http/routes/health.js +49 -0
- package/dist/http/routes/live-legacy.d.ts +115 -0
- package/dist/http/routes/live-legacy.js +112 -0
- package/dist/http/routes/live-misc.d.ts +81 -0
- package/dist/http/routes/live-misc.js +426 -0
- package/dist/http/routes/live-snapshot.d.ts +136 -0
- package/dist/http/routes/live-snapshot.js +916 -0
- package/dist/http/routes/live-terminal.d.ts +11 -0
- package/dist/http/routes/live-terminal.js +261 -0
- package/dist/http/routes/live-triage.d.ts +61 -0
- package/dist/http/routes/live-triage.js +248 -0
- package/dist/http/routes/mission-control-actions.d.ts +131 -0
- package/dist/http/routes/mission-control-actions.js +1791 -0
- package/dist/http/routes/mission-control-read.d.ts +73 -0
- package/dist/http/routes/mission-control-read.js +1640 -0
- package/dist/http/routes/onboarding.d.ts +34 -0
- package/dist/http/routes/onboarding.js +101 -0
- package/dist/http/routes/realtime-orchestrator.d.ts +10 -0
- package/dist/http/routes/realtime-orchestrator.js +74 -0
- package/dist/http/routes/run-control.d.ts +27 -0
- package/dist/http/routes/run-control.js +96 -0
- package/dist/http/routes/runtime-hooks.d.ts +69 -0
- package/dist/http/routes/runtime-hooks.js +437 -0
- package/dist/http/routes/sentinels-catalog.d.ts +7 -0
- package/dist/http/routes/sentinels-catalog.js +24 -0
- package/dist/http/routes/settings-byok.d.ts +23 -0
- package/dist/http/routes/settings-byok.js +163 -0
- package/dist/http/routes/summary.d.ts +18 -0
- package/dist/http/routes/summary.js +49 -0
- package/dist/http/routes/usage.d.ts +24 -0
- package/dist/http/routes/usage.js +362 -0
- package/dist/http/routes/work-artifacts.d.ts +9 -0
- package/dist/http/routes/work-artifacts.js +55 -0
- package/dist/http/shared-state.d.ts +16 -0
- package/dist/http/shared-state.js +1 -0
- package/dist/http-handler.d.ts +1 -88
- package/dist/http-handler.js +1 -10605
- package/dist/index.js +287 -2284
- package/dist/json-utils.d.ts +1 -0
- package/dist/json-utils.js +8 -0
- package/dist/local-openclaw.js +29 -6
- package/dist/mcp-client-setup.js +3 -3
- package/dist/mcp-http-handler.js +33 -59
- package/dist/next-up-queue-store.d.ts +16 -1
- package/dist/next-up-queue-store.js +93 -25
- package/dist/outbox.d.ts +5 -0
- package/dist/outbox.js +113 -9
- package/dist/paths.js +24 -5
- package/dist/reporting/rollups.d.ts +53 -0
- package/dist/reporting/rollups.js +148 -0
- package/dist/retro/domain-templates.d.ts +45 -0
- package/dist/retro/domain-templates.js +297 -0
- package/dist/retro/quality-rubric.d.ts +33 -0
- package/dist/retro/quality-rubric.js +213 -0
- package/dist/runtime-cleanup.d.ts +18 -0
- package/dist/runtime-cleanup.js +87 -0
- package/dist/runtime-instance-store.js +5 -31
- package/dist/services/background.d.ts +34 -0
- package/dist/services/background.js +45 -0
- package/dist/services/experiment-randomization.d.ts +21 -0
- package/dist/services/experiment-randomization.js +63 -0
- package/dist/services/instrumentation.d.ts +29 -0
- package/dist/services/instrumentation.js +136 -0
- package/dist/skill-pack-state.d.ts +36 -5
- package/dist/skill-pack-state.js +273 -29
- package/dist/snapshot-store.js +5 -25
- package/dist/stores/json-store.d.ts +11 -0
- package/dist/stores/json-store.js +42 -0
- package/dist/sync/local-agent-telemetry.d.ts +13 -0
- package/dist/sync/local-agent-telemetry.js +128 -0
- package/dist/sync/outbox-replay.d.ts +55 -0
- package/dist/sync/outbox-replay.js +621 -0
- package/dist/team-context-store.d.ts +23 -0
- package/dist/team-context-store.js +116 -0
- package/dist/telemetry/posthog.js +4 -2
- package/dist/tools/core-tools.d.ts +72 -0
- package/dist/tools/core-tools.js +2270 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -0
- package/dist/worker-supervisor.js +23 -0
- package/package.json +14 -4
- package/dashboard/dist/assets/B3ziCA02.js +0 -8
- package/dashboard/dist/assets/BNeJ0kpF.js +0 -1
- package/dashboard/dist/assets/BzkiMPmM.js +0 -215
- package/dashboard/dist/assets/CUV9IHHi.js +0 -1
- package/dashboard/dist/assets/Ie7d9Iq2.css +0 -1
- package/dashboard/dist/assets/sAhvFnpk.js +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as Ft,r as h,a as Bt,b as Ee,j as e}from"./cNrhgGc1.js";import{i as Lt,q as Te,b as Be,N as et,B as Rt,u as Mt,P as Et,w as he,C as tt,K as st,x as se,A as ot,E as Ne,h as Ke,y as nt,z as Tt,U as Pt}from"./D-bf6hEI.js";import{S as G}from"./nByHNHoW.js";import{A as Pe,m as ce,R as At,b as _t,a as zt}from"./CxQ08qFN.js";function Kt({initiativeId:t=null,authToken:r=null,embedMode:o=!1,enabled:s=!0}){var R,A,oe;const g=Ft(),y=Lt(),j=h.useMemo(()=>Te.autoContinueStatus({initiativeId:t??"__global__",authToken:r,embedMode:o}),[t,r,o]),w=Bt({queryKey:j,enabled:s&&(!!t||t===null),queryFn:async()=>{if(y)return{ok:!0,initiativeId:t,run:null,defaults:{tokenBudget:null,tickMs:0}};const x=new URLSearchParams;t&&x.set("initiative_id",t);const m=await fetch(`/orgx/api/mission-control/auto-continue/status?${x.toString()}`,{headers:Be({authToken:r,embedMode:o})}),u=await m.json().catch(()=>null);if(!m.ok){const c=typeof(u==null?void 0:u.error)=="string"&&u.error||typeof(u==null?void 0:u.message)=="string"&&u.message||`Failed to load auto-continue status (${m.status})`;return{ok:!1,initiativeId:t,run:null,defaults:{tokenBudget:null,tickMs:0},error:c}}return u},refetchInterval:x=>{var M,f;const m=x.state.data;if((m==null?void 0:m.ok)===!1)return!1;const u=((M=m==null?void 0:m.error)==null?void 0:M.toLowerCase())??"";if(u.includes("404")||u.includes("400")||u.includes("not found")||u.includes("bad request"))return!1;const v=((f=m==null?void 0:m.run)==null?void 0:f.status)??null;return v==="running"||v==="stopping"?2500:12e3}}),$=async()=>{await g.invalidateQueries({queryKey:j}),await g.invalidateQueries({queryKey:Te.missionControlGraph({initiativeId:t,authToken:r,embedMode:o})}),await g.invalidateQueries({queryKey:Te.liveData({authToken:r,embedMode:o})})},T=Ee({mutationFn:async x=>{if(y){const v=w.data??null;return{ok:!0,initiativeId:t,run:(v==null?void 0:v.run)??null,defaults:(v==null?void 0:v.defaults)??{tokenBudget:null,tickMs:0}}}const m={};t&&(m.initiativeId=t),m.ignoreSpawnGuardRateLimit=!0,x&&typeof x=="object"&&(typeof x.tokenBudgetTokens=="number"&&(m.tokenBudgetTokens=x.tokenBudgetTokens),typeof x.agentId=="string"&&x.agentId.trim().length>0&&(m.agentId=x.agentId.trim()),typeof x.maxParallelSlices=="number"&&Number.isFinite(x.maxParallelSlices)&&(m.maxParallelSlices=x.maxParallelSlices),x.parallelMode==="iwmt"&&(m.parallelMode=x.parallelMode));const u=await fetch("/orgx/api/mission-control/auto-continue/start",{method:"POST",headers:Be({authToken:r,embedMode:o,contentTypeJson:!0}),body:JSON.stringify(m)}),c=await u.json().catch(()=>null);if(!u.ok){const v=et(c);if(v)throw v;const M=typeof(c==null?void 0:c.error)=="string"&&c.error||typeof(c==null?void 0:c.message)=="string"&&c.message||`Failed to start auto-continue (${u.status})`;throw new Error(M)}if(c&&typeof c=="object"&&"run"in c){const v=w.data??null;return{ok:!0,initiativeId:t,run:c.run??null,defaults:(v==null?void 0:v.defaults)??{tokenBudget:null,tickMs:0}}}return c},onSuccess:()=>{$()}}),te=Ee({mutationFn:async()=>{if(y){const c=w.data??null;return{ok:!0,initiativeId:t,run:null,defaults:(c==null?void 0:c.defaults)??{tokenBudget:null,tickMs:0}}}const x={};t&&(x.initiativeId=t);const m=await fetch("/orgx/api/mission-control/auto-continue/stop",{method:"POST",headers:Be({authToken:r,embedMode:o,contentTypeJson:!0}),body:JSON.stringify(x)}),u=await m.json().catch(()=>null);if(!m.ok){const c=typeof(u==null?void 0:u.error)=="string"&&u.error||typeof(u==null?void 0:u.message)=="string"&&u.message||`Failed to stop auto-continue (${m.status})`;throw new Error(c)}if(u&&typeof u=="object"&&"run"in u){const c=w.data??null;return{ok:!0,initiativeId:t,run:u.run??null,defaults:(c==null?void 0:c.defaults)??{tokenBudget:null,tickMs:0}}}return u},onSuccess:()=>{$()}}),Z=Ee({mutationFn:async x=>{var v;if(y)return{ok:!0,dispatched:((v=x.workstreamIds)==null?void 0:v.length)??1};const m={initiativeId:x.initiativeId};x.workstreamIds&&x.workstreamIds.length>0&&(m.workstreamIds=x.workstreamIds),x.agentId&&(m.agentId=x.agentId),x.scope&&(m.scope=x.scope),m.ignoreSpawnGuardRateLimit=!0;const u=await fetch("/orgx/api/mission-control/next-up/launch",{method:"POST",headers:Be({authToken:r,embedMode:o,contentTypeJson:!0}),body:JSON.stringify(m)}),c=await u.json().catch(()=>null);if(!u.ok){const M=et(c);if(M)throw M;const f=typeof(c==null?void 0:c.error)=="string"&&c.error||typeof(c==null?void 0:c.message)=="string"&&c.message||`Failed to launch (${u.status})`;throw new Error(f)}return c??{ok:!0,dispatched:0}},onSuccess:()=>{$()}}),N=((R=w.data)==null?void 0:R.run)??null,P=(N==null?void 0:N.status)==="running"||(N==null?void 0:N.status)==="stopping";return{status:w.data??null,run:N,isRunning:P,isLoading:w.isLoading,error:((A=w.data)==null?void 0:A.error)??((oe=w.error)==null?void 0:oe.message)??null,start:T.mutateAsync,stop:te.mutateAsync,launchSingle:Z.mutateAsync,isStarting:T.isPending,isStopping:te.isPending,isLaunching:Z.isPending,refetch:w.refetch}}async function it(t,r){var y;const s=await(await fetch(t,r)).json().catch(()=>null),g=((y=s==null?void 0:s.data)==null?void 0:y.url)??(s==null?void 0:s.url)??null;if(typeof g=="string"&&g.trim())return g.trim();throw new Error((s==null?void 0:s.error)??"Billing link unavailable")}async function Qt(t){var g;const r=((g=t==null?void 0:t.actions)==null?void 0:g.checkout)??"/orgx/api/billing/checkout",o=((t==null?void 0:t.requiredPlan)??"starter").trim().toLowerCase()||"starter",s=await it(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:o})});window.open(s,"_blank","noopener,noreferrer")}async function Ut(t){var s;const r=((s=t==null?void 0:t.actions)==null?void 0:s.portal)??"/orgx/api/billing/portal",o=await it(r,{method:"POST"});window.open(o,"_blank","noopener,noreferrer")}function Wt(t){return t==="success"?"border-emerald-400/30 bg-[#0A1210]/95 text-emerald-100":t==="warning"?"border-amber-300/30 bg-[#12100A]/95 text-amber-100":t==="error"?"border-red-400/32 bg-[#120A0A]/95 text-red-100":t==="info"?"border-cyan-300/28 bg-[#0A1012]/95 text-cyan-100":"border-strong bg-[#0B0F16]/95 text-primary"}function Dt({open:t,tone:r="neutral",title:o,message:s=null,className:g,primaryAction:y=null,secondaryAction:j=null,onDismiss:w=null,autoDismissMs:$=null}){return h.useEffect(()=>{if(!t||!w||!$)return;const T=window.setTimeout(()=>w(),$);return()=>window.clearTimeout(T)},[$,w,t,o,s]),e.jsx(Pe,{initial:!1,children:t?e.jsx(ce.div,{initial:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.985},transition:{duration:.2,ease:[.22,1,.36,1]},className:`pointer-events-none ${g??""}`,children:e.jsxs("div",{className:`pointer-events-none min-w-[220px] max-w-[420px] rounded-xl border px-3 py-2 shadow-[0_16px_36px_rgba(0,0,0,0.42)] backdrop-blur ${Wt(r)}`,children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-caption font-semibold",children:o}),s?e.jsx("p",{className:"mt-0.5 text-caption opacity-85",children:s}):null]}),w?e.jsx("button",{type:"button",onClick:w,className:"pointer-events-auto inline-flex h-6 w-6 items-center justify-center rounded-md text-current/70 transition-colors hover:bg-white/[0.08] hover:text-current","aria-label":"Dismiss toast",title:"Dismiss",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})}):null]}),y||j?e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[j?e.jsx("button",{type:"button",onClick:j.onClick,className:"pointer-events-auto h-7 rounded-md border border-strong bg-white/[0.06] px-2.5 text-micro font-semibold text-current transition-colors hover:bg-white/[0.12]",children:j.label}):null,y?e.jsx("button",{type:"button",onClick:y.onClick,className:"pointer-events-auto h-7 rounded-md border border-white/25 bg-white/[0.14] px-2.5 text-micro font-semibold text-current transition-colors hover:bg-white/[0.2]",children:y.label}):null]}):null]})}):null})}function Ae({className:t=""}){return e.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:t,children:e.jsx("path",{d:"M7 5.4v9.2c0 .7.75 1.15 1.38.83l7.6-4.6a.95.95 0 0 0 0-1.62l-7.6-4.64A.95.95 0 0 0 7 5.4Z",fill:"currentColor"})})}function Vt({className:t=""}){return e.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:t,children:e.jsx("path",{d:"M6.1 13.25C4.25 13.25 2.8 11.8 2.8 10s1.45-3.25 3.3-3.25c3.15 0 4.35 6.5 8.05 6.5 1.85 0 3.3-1.45 3.3-3.25s-1.45-3.25-3.3-3.25c-3.7 0-4.9 6.5-8.05 6.5Z",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ht({className:t=""}){return e.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:t,children:[e.jsx("path",{d:"M6.2 9.4V6.7c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v2.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M8.4 8.9V5.8c0-.7.5-1.3 1.1-1.3s1.1.6 1.1 1.3v3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M10.6 8.9V6.2c0-.7.5-1.3 1.1-1.3s1.1.6 1.1 1.3v3.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M12.8 9.6V7.2c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v4.2c0 2.7-1.9 4.6-4.6 4.6H9.2c-2.1 0-3.7-1-4.6-2.8l-.9-1.7c-.3-.6 0-1.4.6-1.7.6-.3 1.3 0 1.6.6l.7 1.4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Jt({className:t=""}){return e.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:t,children:[e.jsx("path",{d:"M6.4 9.2V7.4c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v1.3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M8.6 8.9V7c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M10.8 9.2V7.3c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v2.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M13 9.8V8.2c0-.7.5-1.2 1.1-1.2s1.1.5 1.1 1.2v3.6c0 2.4-1.7 4-4.1 4H9.7c-2 0-3.4-.9-4.2-2.5l-.8-1.4c-.3-.6 0-1.3.5-1.6.6-.3 1.2-.1 1.6.5l.6 1",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}const Gt=[{value:"initiative",label:"Initiative"},{value:"workstream",label:"Workstream"},{value:"milestone",label:"Milestone"}];function Zt({value:t,onChange:r}){return e.jsx("div",{className:"flex gap-1 p-1 rounded-lg bg-white/5 border border-white/[0.08]",children:Gt.map(o=>e.jsx("button",{type:"button",onClick:()=>r(o.value),className:he("px-3 py-1 text-[11px] font-medium rounded-md transition-all duration-150",t===o.value?"bg-white/10 text-white shadow-[inset_0_0_8px_rgba(191,255,0,0.08)]":"text-white/50 hover:text-white/70"),children:o.label},o.value))})}function at(t){return t==="running"?"from-teal-300/0 via-teal-300/60 to-teal-300/0":t==="blocked"?"from-amber-300/0 via-amber-300/55 to-amber-300/0":t==="idle"?"from-white/0 via-white/35 to-white/0":"from-[#BFFF00]/0 via-[#BFFF00]/70 to-[#BFFF00]/0"}function _e(t){return t==="running"?"Current":t==="blocked"?"Blocked on":"Next"}function ze(t){const r=typeof t.sliceTaskCount=="number"&&Number.isFinite(t.sliceTaskCount)?Math.max(0,Math.floor(t.sliceTaskCount)):null,o=t.sliceScope==="task"?"task":t.sliceScope==="milestone"?"milestone slice":"workstream slice",s=r&&r>0?`${r} ${r===1?"task":"tasks"}`:null;return t.queueState==="running"?s?`Executing ${s} in ${o}.`:"Execution in progress. Task detail will appear as the scheduler advances.":t.queueState==="blocked"?t.blockReason?"Blocked while waiting for dependency resolution.":"Blocked. Waiting for dependency or review.":t.queueState==="queued"?s?`Queued with ${s} in ${o}.`:"Queued at workstream scope. Task detail will populate after dispatch.":t.queueState==="completed"?"Completed. No queued tasks remain.":"Idle. Ready to dispatch when started."}function lt(t){const r=typeof t.initiativePriority=="string"?t.initiativePriority.trim().toLowerCase():"",o=typeof t.initiativePriorityNum=="number"&&Number.isFinite(t.initiativePriorityNum)?Math.max(1,Math.min(100,Math.round(t.initiativePriorityNum))):null,s=r==="urgent"||r==="high"||r==="medium"||r==="low"?r:o!==null?o<=12?"urgent":o<=30?"high":o<=60?"medium":"low":null;if(!s)return null;const g=s==="urgent"?"P1":s==="high"?"P2":s==="medium"?"P3":"P4",y=s==="urgent"?"Urgent":s==="high"?"High":s==="medium"?"Medium":"Low",j=s==="urgent"?"border-red-300/35 bg-red-500/[0.14] text-red-100":s==="high"?"border-amber-300/35 bg-amber-500/[0.14] text-amber-100":s==="medium"?"border-[#BFFF00]/35 bg-[#BFFF00]/14 text-[#E1FFB2]":"border-white/[0.2] bg-white/[0.08] text-white/70";return{shortLabel:`${g} ${y}`,longLabel:`Initiative priority ${y} (${g})`,toneClass:j}}function Xt(t){const r=t.trim().toLowerCase();if(r.includes("timed out")||r.includes("timeout")||r.includes("request cancelled")||r.includes("signal is aborted"))return"Next Up is still syncing. Keep this panel open and it will repopulate automatically.";if(r.includes("unauthorized")||r.includes("forbidden")||r.includes("api key")||r.includes("auth"))return"Next Up is unavailable until OrgX authentication is reconnected in Settings.";if(r.includes("unknown api endpoint")||r.includes("route is unavailable"))return"This runtime is missing queue routes. Restart and update the plugin build.";const o=t.split("|").map(s=>s.trim()).filter(Boolean).map(s=>s.replace(/^[^:]+:\s*/,"").trim()).filter(Boolean).slice(0,2).join(" ");return Ke(o||t)||"Next Up is temporarily unavailable."}function Ot(t){const r=t.trim().toLowerCase();return r.includes("timed out")||r.includes("timeout")||r.includes("request cancelled")||r.includes("signal is aborted")?"Signal is delayed right now. Queue data will appear as soon as sync catches up.":r.includes("fallback")?"Showing fallback queue data while full signal refreshes.":r.includes("unknown api endpoint")||r.includes("route is unavailable")?"Some queue controls are unavailable in this plugin build. Update and restart to restore full controls.":Ke(t.trim())}function Le(t,r,o){const s=typeof t=="string"?t.trim():"";if(s&&!nt(s))return se(s);const g=typeof r=="string"?r.trim():"";return g?nt(g)?`${o} ${Tt(g)}`:se(g):o}function ct(t){const r=typeof t.runnerAgentName=="string"?t.runnerAgentName.trim():"";if(!r)return"Unassigned";const o=r.toLowerCase();return o==="undefined"||o==="null"||o==="main"&&(t.runnerAgentId==="unassigned"||t.runnerSource==="fallback")?"Unassigned":r}function ut(t){return t.runnerSource==="inferred"?"inferred":null}function dt(t,r){const o=t.runnerSource==="assigned"?"assigned":t.runnerSource==="inferred"?"inferred":"fallback";return r==="Unassigned"?`Runner ${o}`:`${r} · ${o}`}function re(t,r){return!t||t.trim().length===0?r:Ke(t.trim())||r}function rt(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function mt(t,r){const o=se(t.workstreamTitle),s=rt(r),g=s&&typeof s.dispatchMode=="string"?s.dispatchMode:null,y=rt(s==null?void 0:s.run);return(y&&typeof y.stopReason=="string"?y.stopReason:y&&typeof y.stop_reason=="string"?y.stop_reason:null)==="budget_exhausted"?`Dispatch acknowledged for ${o}, but autopilot stopped: budget exhausted.`:g==="pending"?`Dispatching ${o}; waiting for slice start…`:g==="fallback"?`Dispatched ${o} using fallback runner.`:`Dispatched ${o}.`}function pt({className:t=""}){return e.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:t,children:[e.jsx("circle",{cx:"4.5",cy:"10",r:"1.4",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.4",fill:"currentColor"}),e.jsx("circle",{cx:"15.5",cy:"10",r:"1.4",fill:"currentColor"})]})}function Yt({compact:t}){const r=t?3:6;return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 pt-1 text-micro uppercase tracking-[0.12em] text-muted",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#BFFF00]/70 status-breathe"}),e.jsx("span",{children:"Calibrating queue"})]}),Array.from({length:r}).map((o,s)=>e.jsxs("div",{className:"nextup-skeleton-card rounded-2xl border border-white/[0.08] bg-white/[0.02] px-3 py-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-2.5",children:[e.jsx(G,{className:"h-8 w-8 rounded-full"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(G,{className:"h-3 w-40 rounded-md"}),e.jsx(G,{className:"mt-2 h-4 w-56 rounded-md"})]})]}),e.jsx(G,{className:"h-5 w-16 rounded-full"})]}),e.jsxs("div",{className:"mt-3 rounded-lg border border-white/[0.07] bg-black/[0.18] px-2.5 py-2",children:[e.jsx(G,{className:"h-3 w-14 rounded"}),e.jsx(G,{className:"mt-2 h-3 w-full rounded"}),e.jsx(G,{className:"mt-2 h-3 w-3/5 rounded"})]}),e.jsxs("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:[e.jsx(G,{className:"h-8 w-24 rounded-full"}),e.jsx(G,{className:"h-8 w-20 rounded-full"}),e.jsx(G,{className:"h-8 w-24 rounded-full"})]})]},`nextup-skeleton-${s}`))]})}function en({initiativeId:t=null,projectId:r=null,authToken:o=null,embedMode:s=!1,title:g="Next Up",showHeader:y=!0,compact:j=!1,className:w,disableEnterAnimation:$=!1,allowCompactToggle:T=!1,onToggleCompact:te,onOpenInitiative:Z,onOpenSettings:N,onUpgradeGate:P,onOpenSliceDetail:R,selectionEnabled:A=!0,panelStyle:oe="card",showQueueSettings:x=!0,queueModel:m,queueActions:u,snapshotVersion:c=null}){var Ye;const[v,M]=h.useState(j);h.useEffect(()=>M(j),[j]);const f=T&&!te?v:j,fe=n=>{te?te(n):M(n)},[K,C]=h.useState(null),[S,be]=h.useState("workstream"),[Q,U]=h.useState(null),ge="bottom",[I,ne]=h.useState(null),[X,ie]=h.useState(null),[W,D]=h.useState(null),[b,ue]=h.useState(new Set),[Se,de]=h.useState(null),[ye,we]=h.useState(!1),[xt,Ce]=h.useState(!1),Qe=h.useRef(null),ht=Rt({initiativeId:t,projectId:r,authToken:o,embedMode:s,enabled:!m,snapshotVersion:c,zoomLevel:S}),ft=m??ht,{items:me,degraded:ae,isLoading:O,isFetching:Ue,error:Ie,refetch:bt,playWorkstream:We,startWorkstreamAutoContinue:De,initiativeGroups:nn,milestoneGroups:rn}=ft,$e=Kt({initiativeId:t,authToken:o,embedMode:s,enabled:!!t}),gt=Mt({authToken:o,embedMode:s}),Y=u??gt,V=n=>`${n.initiativeId}:${n.workstreamId}`,ke=h.useMemo(()=>me.filter(n=>n.queueState==="running").length,[me]),H=h.useMemo(()=>{const n=me.filter(i=>i.queueState!=="running");return n.length>0?n:me},[me]),Ve=h.useMemo(()=>H.length===0?"empty":H.some(n=>n.queueState!=="running"&&n.queueState!=="blocked")?"queued":H.some(n=>n.queueState==="blocked")?"blocked":H.some(n=>n.queueState==="running")?"running":"queued",[H]),F=h.useMemo(()=>f?H.slice(0,5):H,[f,H]),yt=h.useMemo(()=>F.filter(n=>b.has(V(n))),[b,F]),[pe,J]=h.useState([]),ee=h.useRef([]),He=h.useMemo(()=>{const n=new Map;for(const i of F)n.set(V(i),i);return n},[F]),B=h.useMemo(()=>F.map(V),[F]),wt=h.useMemo(()=>B.join("|"),[B]);h.useEffect(()=>{J(n=>{if(f)return[];const i=[],a=new Set(B);for(const l of n)a.has(l)&&i.push(l);for(const l of B)i.includes(l)||i.push(l);return i})},[f,wt]),h.useEffect(()=>{ee.current=pe},[pe]),h.useEffect(()=>{Se&&(B.includes(Se)||de(null))},[Se,B]),h.useEffect(()=>{ue(n=>{if(n.size===0)return n;const i=new Set(F.map(V)),a=new Set;for(const l of n)i.has(l)&&a.add(l);return a.size===n.size?n:a})},[F]),h.useEffect(()=>{if(!W)return;F.some(i=>V(i)===W)||D(null)},[W,F]),h.useEffect(()=>{if(!Q)return;const n=window.setTimeout(()=>U(null),4e3);return()=>window.clearTimeout(n)},[Q]),h.useEffect(()=>{if(ae.length===0){Ce(!1);return}Ce(!1)},[ae]),h.useEffect(()=>{A&&!f&&b.size>0&&we(!1)},[f,b.size,A]),h.useEffect(()=>{if(!ye)return;const n=a=>{var p;const l=a.target;l&&((p=Qe.current)!=null&&p.contains(l)||we(!1))},i=a=>{a.key==="Escape"&&we(!1)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),document.addEventListener("keydown",i),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n),document.removeEventListener("keydown",i)}},[ye]);const Je=async n=>{const i=V(n),a=se(n.workstreamTitle),l=ee.current.slice();Ge(new Set([i]));try{await Y.remove({initiativeId:n.initiativeId,workstreamId:n.workstreamId}),ue(p=>{if(!p.has(i))return p;const d=new Set(p);return d.delete(i),d}),de(p=>p===i?null:p),C(`Removed ${a} from queue.`)}catch(p){f||J(l);const d=p instanceof Error?p.message:"";C(re(d,"Failed to remove from queue"))}},kt=(n,i,a)=>{const l=f?B:pe.length>0?pe:B;ue(p=>{const d=new Set(p),k=Se;if(a&&k&&l.includes(k)){const E=l.indexOf(n),_=l.indexOf(k);if(E>=0&&_>=0){const[z,Fe]=E<_?[E,_]:[_,E];for(const je of l.slice(z,Fe+1))i?d.add(je):d.delete(je)}else i?d.add(n):d.delete(n)}else i?d.add(n):d.delete(n);return d}),de(n)},vt=()=>{ue(new Set(B)),de(B.length>0?B[B.length-1]:null)},jt=()=>{ue(new Set),de(null)},xe=(n,i)=>{n.size!==0&&J(a=>{const l=a.length>0?a:B,p=[],d=[];for(const k of l)n.has(k)?p.push(k):d.push(k);return p.length===0?a:i==="top"?[...p,...d]:[...d,...p]})},Ge=n=>{n.size!==0&&J(i=>i.filter(a=>!n.has(a)))},Re=async n=>{if(b.size===0){C("Select one or more queue items first.");return}const i=F.map(p=>({key:V(p),item:p})).filter(p=>b.has(p.key));if(i.length===0){C("Selected queue items are no longer visible.");return}const a=new Set(i.map(({key:p})=>p)),l=ee.current.slice();n==="move_top"?xe(a,"top"):n==="move_bottom"?xe(a,"bottom"):n==="remove"&&Ge(a),ie(`bulk:${n}`),C(null);try{const p=i.map(({item:z})=>({initiativeId:z.initiativeId,workstreamId:z.workstreamId})),d=await Y.bulk({action:n,items:p}),k=typeof(d==null?void 0:d.updated)=="number"?d.updated??0:0,L=typeof(d==null?void 0:d.failed)=="number"?d.failed??0:0,E=Array.isArray(d==null?void 0:d.errors)?d.errors.filter(z=>typeof z=="string").map(z=>z.trim()).filter(Boolean):[],_=n==="remove"?"removed":n==="move_top"?"moved to top":"moved to bottom";k===0&&L>0&&E.length>0?C(re(E[0],`${L} queue action${L===1?"":"s"} failed.`)):C(L>0?`${k} item${k===1?"":"s"} ${_}; ${L} failed.`:`${k} item${k===1?"":"s"} ${_}.`),ue(new Set),de(null)}catch(p){f||J(l);const d=p instanceof Error?p.message:"";C(re(d,"Bulk queue action failed"))}finally{ie(null)}},Nt=async()=>{const n=ee.current.map(i=>He.get(i)).filter(Boolean).map(i=>({initiativeId:i.initiativeId,workstreamId:i.workstreamId}));n.length!==0&&await Y.reorder({order:n})},ve=async(n,i,a,l)=>{var p,d;C(null),ne(null),P==null||P(null),(p=l==null?void 0:l.optimistic)==null||p.call(l),ie(n);try{const k=await i();C(typeof a=="function"?a(k):a)}catch(k){if((d=l==null?void 0:l.rollback)==null||d.call(l),k instanceof Pt)ne(k),P==null||P(k);else{const L=k instanceof Error?k.message:"";C(re(L,"Action failed"))}}finally{ie(null)}},St=async()=>{if(t){U("Dispatching...");try{const n=me.filter(l=>l.queueState!=="running"&&l.queueState!=="completed").map(l=>l.workstreamId),i=await $e.launchSingle({initiativeId:t,workstreamIds:n.length>0?n:void 0}),a=(i==null?void 0:i.dispatched)??n.length;U(`${a} workstream${a===1?"":"s"} dispatched`)}catch(n){const i=n instanceof Error?n.message:"";U(re(i,"Launch failed"))}}},Ct=async()=>{if(t){U("Enabling autopilot...");try{await $e.start({}),U("Autopilot enabled")}catch(n){const i=n instanceof Error?n.message:"";U(re(i,"Autopilot failed"))}}},qe=I?"upgrade":Ie?"error":K?"notice":null,Ze=Ie?Xt(Ie):null,Me=ae.length>0?Ot(ae[0]):null,It=qe!==null,$t=ae.length>0&&!xt&&W===null&&!ye,le=yt.length,Xe=A&&!f&&le>0,qt=ke>0?`No queued workstreams yet. ${ke} running item${ke===1?"":"s"} still in-flight.`:ae.length>0?"Queue signal is delayed right now.":"No queued workstreams right now.",Oe=e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:vt,className:"control-pill h-8 px-2.5 text-caption font-semibold",children:"Select all"}),e.jsx("button",{type:"button",onClick:jt,disabled:b.size===0,className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Clear"}),e.jsx("button",{type:"button",disabled:le===0||X==="bulk:move_top",onClick:()=>void Re("move_top"),className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Move top"}),e.jsx("button",{type:"button",disabled:le===0||X==="bulk:move_bottom",onClick:()=>void Re("move_bottom"),className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Move bottom"}),e.jsx("button",{type:"button",disabled:le===0||X==="bulk:remove",onClick:()=>void Re("remove"),className:"control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",children:"Remove"})]});return e.jsxs(Et,{surface:oe==="card",className:`flex h-full min-h-0 flex-col overflow-hidden ${$?"":"card-enter"} ${oe==="flat"?"!rounded-none !border-none !bg-transparent !shadow-none":""} ${w??""}`,children:[y?e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-subtle px-4 py-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("h2",{className:"truncate text-heading font-semibold text-white",children:g}),e.jsx("span",{className:"chip inline-flex min-w-[52px] justify-center text-micro tabular-nums",children:O?e.jsx("span",{"aria-hidden":!0,className:"h-2.5 w-5 rounded bg-white/15 animate-pulse"}):H.length}),e.jsx("span",{className:he("chip inline-flex min-w-[148px] justify-center text-micro tabular-nums transition-opacity",!O&&ke>0?"text-secondary opacity-100":"pointer-events-none opacity-0"),children:`${ke} active elsewhere`}),e.jsx("span",{className:he("inline-flex min-w-[92px] justify-end text-micro text-muted transition-opacity",Ue&&!O?"opacity-100":"opacity-0"),"aria-live":"polite",children:"refreshing…"})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:T?e.jsx("button",{type:"button",onClick:()=>fe(!f),className:"control-pill h-8 flex-shrink-0 whitespace-nowrap px-3 text-caption font-semibold",title:f?"Switch to expanded cards":"Switch to compact list","aria-label":f?"Expand Next Up queue":"Compact Next Up queue",children:f?"Expand":"Compact"}):null})]}):null,e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-subtle px-3 py-2",children:[e.jsx(Zt,{value:S,onChange:be}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{type:"button",disabled:$e.isLaunching||!t,onClick:()=>void St(),className:"border border-[#BFFF00]/30 text-[#BFFF00] hover:bg-[#BFFF00]/10 px-3 py-1.5 rounded-lg text-[11px] font-medium flex items-center gap-1.5 disabled:opacity-40 transition-colors",title:"Launch queued workstreams",children:[e.jsx(Ae,{className:"h-3 w-3"}),e.jsx("span",{children:"Launch"})]}),e.jsxs("button",{type:"button",disabled:$e.isStarting||!t,onClick:()=>void Ct(),className:"border border-[#14B8A6]/30 text-[#14B8A6] hover:bg-[#14B8A6]/10 px-3 py-1.5 rounded-lg text-[11px] font-medium flex items-center gap-1.5 disabled:opacity-40 transition-colors",title:"Enable autopilot for this initiative",children:[e.jsx(Vt,{className:"h-3 w-3"}),e.jsx("span",{children:"Autopilot"})]})]})]}),Q&&e.jsx("div",{className:"px-3 pt-1.5",children:e.jsx(ce.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.18},className:"rounded-lg border border-[#BFFF00]/20 bg-[#BFFF00]/[0.06] px-2.5 py-1.5 text-[11px] text-[#E1FFB2]",children:Q})}),It&&e.jsx("div",{className:"px-3 pt-2",children:e.jsx(Pe,{initial:!1,mode:"wait",children:qe==="upgrade"&&I?e.jsx(ce.div,{initial:{opacity:0,y:-4,scale:.99},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.99},transition:{duration:.18,ease:[.22,1,.36,1]},className:"rounded-xl border border-amber-200/25 bg-amber-200/10 px-3 py-2 text-caption text-amber-100",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-full border border-amber-200/25 bg-amber-200/10 px-2 py-0.5 text-micro font-semibold uppercase tracking-[0.08em] text-amber-100/90",children:"Upgrade required"}),e.jsxs("span",{className:"truncate text-micro text-secondary",children:[tt(I.currentPlan)," →"," ",tt(I.requiredPlan)]})]}),e.jsx("div",{className:"mt-1 line-clamp-2 text-caption leading-snug text-amber-50/90",title:I.message,children:I.message}),K?e.jsx("div",{className:"mt-1 text-micro text-rose-50/85",children:K}):null]}),e.jsxs("div",{className:"flex flex-shrink-0 flex-col items-end gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:()=>void Qt({actions:I.actions,requiredPlan:I.requiredPlan}).catch(n=>C(re(n instanceof Error?n.message:"","Checkout failed"))),className:"h-7 rounded-full border border-amber-200/25 bg-amber-200/15 px-3 text-micro font-semibold text-amber-50 transition-colors hover:bg-amber-200/20",children:"Upgrade"}),e.jsx("button",{type:"button",onClick:()=>void Ut({actions:I.actions}).catch(n=>C(re(n instanceof Error?n.message:"","Portal failed"))),className:"h-7 rounded-full border border-strong bg-white/[0.04] px-3 text-micro font-semibold text-primary transition-colors hover:bg-white/[0.08]",children:"Billing"}),N&&e.jsx("button",{type:"button",onClick:N,className:"h-7 rounded-full border border-strong bg-white/[0.04] px-2.5 text-micro font-semibold text-primary transition-colors hover:bg-white/[0.08]",children:"Settings"})]}),(Ye=I.actions)!=null&&Ye.pricing?e.jsx("a",{href:I.actions.pricing,target:"_blank",rel:"noopener noreferrer",className:"text-micro text-secondary underline decoration-white/20 hover:text-primary",children:"View pricing"}):null]})]})},"upgrade"):qe==="error"&&Ze?e.jsx(ce.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.18},className:"rounded-xl border border-red-400/25 bg-red-500/[0.08] px-3 py-2 text-caption text-red-100",children:Ze},"error"):qe==="notice"&&K?e.jsx(ce.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.18},className:"rounded-xl border border-white/[0.1] bg-white/[0.03] px-3 py-2 text-caption text-primary",children:K},"notice"):null})}),e.jsxs("div",{className:`flex-1 space-y-2.5 overflow-y-auto overscroll-y-contain px-3 pb-3 ${y?"pt-1":"pt-2.5"}`,children:[!O&&H.length>0?e.jsxs("div",{className:"flex flex-col gap-2.5 px-0.5 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-micro uppercase tracking-[0.08em] text-muted",children:Ve==="blocked"?"Needs attention":Ve==="running"?"Running now":"Queue"}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[le>0?e.jsxs("span",{className:"chip text-micro",children:[le," selected"]}):null,e.jsx("span",{className:he("inline-flex min-w-[92px] text-micro text-muted transition-opacity",Ue&&!O?"opacity-100":"opacity-0"),"aria-live":"polite",children:"refreshing…"}),A&&!f&&le===0?e.jsx("span",{className:"text-micro text-muted",children:"Shift+select to pick ranges."}):null]})]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5 sm:justify-end",children:[T?e.jsx("button",{type:"button",onClick:()=>fe(!f),className:"control-pill h-8 px-2.5 text-caption font-semibold",title:f?"Switch to expanded cards":"Switch to compact list","aria-label":f?"Expand Next Up queue":"Compact Next Up queue",children:f?"Expand":"Compact"}):null,Xe?e.jsx("div",{className:"flex flex-wrap justify-end gap-1.5",children:Oe}):null,!Xe&&x?e.jsxs("div",{ref:Qe,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>we(n=>!n),className:"control-pill h-8 px-2.5 text-caption font-semibold","aria-haspopup":"menu","aria-expanded":ye,title:"Queue settings",children:[e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-85","aria-hidden":!0,children:[e.jsx("path",{d:"M4 6h16"}),e.jsx("path",{d:"M7 12h10"}),e.jsx("path",{d:"M10 18h4"})]}),e.jsx("span",{children:"Queue"})]}),ye?e.jsx("div",{className:"surface-tier-2 absolute right-0 top-[calc(100%+8px)] z-[280] w-[320px] max-w-[86vw] rounded-xl p-3 shadow-[0_18px_42px_rgba(0,0,0,0.46)] backdrop-blur-xl",children:e.jsxs("div",{className:"space-y-2.5",children:[A&&!f?e.jsxs("div",{children:[e.jsx("p",{className:"section-kicker",children:"Bulk actions"}),e.jsx("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:Oe})]}):null,N?e.jsx("button",{type:"button",onClick:()=>{we(!1),N()},className:"control-pill h-7 px-2.5 text-micro font-semibold",children:"Open settings"}):null]})}):null]}):null]})]}):null,O?e.jsx(Yt,{compact:f}):null,!O&&F.length===0&&!Ie&&e.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.02] px-3 py-4 text-center",children:[e.jsx("p",{className:"text-body text-secondary",children:qt}),Me?e.jsx("p",{className:"mt-1 text-micro text-muted",children:Me}):null,ae.length>0?e.jsx("div",{className:"mt-2.5 flex items-center justify-center gap-1.5",children:e.jsx("button",{type:"button",onClick:()=>{Ce(!1),bt()},className:"control-pill h-7 px-2.5 text-micro font-semibold",children:"Retry now"})}):null]}),!O&&f?e.jsx(Pe,{initial:!1,children:F.map((n,i)=>{const a=V(n),l=X===a,p=n.queueState==="running",d=n.nextTaskDueAt?st(n.nextTaskDueAt):null,k=Le(n.initiativeTitle,n.initiativeId,"Initiative"),L=Le(n.workstreamTitle,n.workstreamId,"Workstream"),E=lt(n),_=n.nextTaskTitle?se(n.nextTaskTitle):null,z=n.blockReason?se(n.blockReason):null,Fe=ct(n),je=ut(n);return e.jsxs(ce.article,{layout:!0,initial:{opacity:0,y:6,scale:.99},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.99},transition:{duration:.22,delay:Math.min(i,7)*.018,ease:[.22,1,.36,1]},className:"group relative overflow-visible rounded-2xl border border-white/[0.08] bg-white/[0.02] px-2.5 py-2 cursor-pointer transition-colors hover:border-white/[0.14]",onClick:()=>R==null?void 0:R(n),role:"button",tabIndex:0,onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),R==null||R(n))},children:[e.jsx("div",{className:`pointer-events-none absolute inset-x-2.5 top-0 h-px bg-gradient-to-r ${at(n.queueState)}`,"aria-hidden":!0}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[e.jsx(ot,{name:Fe,hint:dt(n,Fe),size:"xs"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(Ne,{type:"initiative",size:11,className:"flex-shrink-0 opacity-85"}),e.jsx("button",{type:"button",onClick:()=>Z==null?void 0:Z(n.initiativeId,n.initiativeTitle),className:"block min-w-0 flex-1 truncate text-left text-micro uppercase tracking-[0.08em] text-muted transition-colors hover:text-white/72",title:k,children:k}),E?e.jsx("span",{className:he("inline-flex flex-shrink-0 items-center rounded-full border px-2 py-0.5 text-[9px] font-semibold uppercase tracking-[0.08em]",E.toneClass),title:E.longLabel,children:E.shortLabel}):null]}),e.jsxs("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 text-caption font-semibold leading-snug text-white",title:L,children:[e.jsx(Ne,{type:"workstream",size:12,className:"flex-shrink-0 opacity-95"}),e.jsx("span",{className:"line-clamp-2",children:L})]}),_?e.jsxs("p",{className:"mt-0.5 line-clamp-2 text-micro leading-snug text-secondary",title:`${_e(n.queueState)}: ${_}${d?` · ${d}`:""}`,children:[_e(n.queueState),": ",_,d?` · ${d}`:""]}):e.jsx("p",{className:"mt-0.5 line-clamp-2 text-micro leading-snug text-secondary",title:ze(n),children:ze(n)}),je?e.jsxs("p",{className:"mt-0.5 text-micro text-muted",children:["Runner ",je]}):null]})]}),z&&e.jsxs("div",{className:"mt-1.5 rounded-lg border border-red-400/24 bg-red-500/[0.08] px-2.5 py-1 text-micro text-red-100/85",children:["Blocked: ",z]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",onClick:q=>q.stopPropagation(),children:[e.jsx("button",{type:"button",disabled:l||p,onClick:()=>void ve(a,()=>We({initiativeId:n.initiativeId,workstreamId:n.workstreamId,agentId:n.runnerAgentId}),q=>mt(n,q)),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:p?"Already running":"Start now",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:p?"Running":"Start"})]})}),e.jsxs("div",{className:"relative ml-auto",children:[e.jsx("button",{type:"button",disabled:l,onClick:()=>D(q=>q===a?null:a),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:"Queue actions",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(pt,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:"More"})]})}),W===a&&e.jsxs("div",{className:"absolute right-0 top-[calc(100%+6px)] z-[320] min-w-[178px] rounded-xl border border-white/[0.1] bg-[#080d14]/95 p-1.5 shadow-[0_16px_36px_rgba(0,0,0,0.42)] backdrop-blur",children:[e.jsx("button",{type:"button",onClick:()=>{D(null);const q=ee.current.slice();ve(`${a}:top`,()=>Y.move({initiativeId:n.initiativeId,workstreamId:n.workstreamId,placement:"top"}),`Moved ${L} to top of queue.`,{optimistic:()=>xe(new Set([a]),"top"),rollback:()=>J(q)})},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to top"}),e.jsx("button",{type:"button",onClick:()=>{D(null);const q=ee.current.slice();ve(`${a}:bottom`,()=>Y.move({initiativeId:n.initiativeId,workstreamId:n.workstreamId,placement:"bottom"}),`Moved ${L} to bottom of queue.`,{optimistic:()=>xe(new Set([a]),"bottom"),rollback:()=>J(q)})},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to bottom"}),e.jsx("button",{type:"button",onClick:()=>{D(null);const q=ee.current.slice();ve(`${a}:auto`,async()=>(await Y.move({initiativeId:n.initiativeId,workstreamId:n.workstreamId,placement:"top"}),De({initiativeId:n.initiativeId,workstreamId:n.workstreamId,agentId:n.runnerAgentId,scope:"initiative"})),`Start+Auto enabled for ${k}.`,{optimistic:()=>xe(new Set([a]),"top"),rollback:()=>J(q)})},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Start with auto"}),e.jsx("button",{type:"button",disabled:Y.isRemoving,onClick:()=>{D(null),Je(n)},className:"mt-1 flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-red-100 transition-colors hover:bg-red-500/[0.12] disabled:opacity-45",children:"Remove from queue"})]})]})]})]},a)})}):O?null:e.jsx(At,{axis:"y",values:pe,onReorder:n=>{ee.current=n,J(n)},className:"space-y-2.5",children:pe.map(n=>He.get(n)).filter(Boolean).map((n,i)=>e.jsx(tn,{item:n,index:i,actionKey:X,setNotice:C,setUpgradeGate:ne,onUpgradeGate:P,onOpenInitiative:Z,onOpenSliceDetail:R,selected:b.has(V(n)),selectionEnabled:A,onToggleSelection:kt,menuKey:W,setMenuKey:D,playWorkstream:We,startWorkstreamAutoContinue:De,triagePlacement:ge,onPauseWorkstream:(a,l)=>Y.stopTriage({initiativeId:a.initiativeId,workstreamId:a.workstreamId,placement:l,resetToTodo:!1}),onMoveWorkstream:(a,l)=>Y.move({initiativeId:a.initiativeId,workstreamId:a.workstreamId,placement:l}),onApplyLocalPlacement:xe,onRestoreOrder:a=>J(a),captureOrder:()=>ee.current.slice(),onCommitReorder:()=>void Nt().catch(()=>null),onDismiss:Je,runAction:ve},V(n)))})]}),e.jsx("div",{className:"pointer-events-none absolute bottom-3 right-3 z-[250]",children:e.jsx(Dt,{open:$t,tone:"warning",title:"Limited signal",message:Me,autoDismissMs:6e3,onDismiss:()=>Ce(!0)})})]})}function tn({item:t,index:r,actionKey:o,setNotice:s,setUpgradeGate:g,onUpgradeGate:y,onOpenInitiative:j,onOpenSliceDetail:w,selected:$,selectionEnabled:T,onToggleSelection:te,menuKey:Z,setMenuKey:N,playWorkstream:P,startWorkstreamAutoContinue:R,triagePlacement:A,onPauseWorkstream:oe,onMoveWorkstream:x,onApplyLocalPlacement:m,onRestoreOrder:u,captureOrder:c,onCommitReorder:v,onDismiss:M,runAction:f}){const fe=_t(),[K,C]=h.useState(!1),S=`${t.initiativeId}:${t.workstreamId}`,be=o===S,Q=t.queueState==="running",U=t.nextTaskDueAt?st(t.nextTaskDueAt):null,ge=Le(t.initiativeTitle,t.initiativeId,"Initiative"),I=Le(t.workstreamTitle,t.workstreamId,"Workstream"),ne=lt(t),X=t.nextTaskTitle?se(t.nextTaskTitle):null,ie=t.blockReason?se(t.blockReason):null,W=ct(t),D=ut(t);return e.jsx(zt,{value:S,id:S,dragListener:!1,dragControls:fe,onDragStart:()=>C(!0),onDragEnd:()=>{C(!1),v()},whileDrag:{scale:1.02,boxShadow:"0 20px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(191,255,0,0.15)",zIndex:50,cursor:"grabbing"},className:"relative",children:e.jsxs(ce.article,{layout:!0,initial:{opacity:0,y:12,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.98},transition:{duration:.4,ease:[.25,.1,.25,1],delay:Math.min(r,7)*.05,opacity:{duration:.32,ease:[.25,.1,.25,1]}},className:"group relative overflow-visible rounded-2xl border border-white/[0.08] bg-white/[0.02] px-3 py-3 cursor-pointer transition-colors hover:border-white/[0.14]",onClick:()=>w==null?void 0:w(t),role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),w==null||w(t))},children:[e.jsx("div",{className:`pointer-events-none absolute inset-x-3 top-0 h-px bg-gradient-to-r ${at(t.queueState)}`,"aria-hidden":!0}),e.jsx("div",{className:"flex items-start justify-between gap-2.5",children:e.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-2.5",children:[e.jsxs("div",{className:"relative h-8 w-8 flex-shrink-0",children:[e.jsx("div",{className:`absolute inset-0 transition-[opacity,transform] duration-200 ease-out ${T?$?"opacity-0 scale-90":"opacity-100 scale-100 group-hover:opacity-0 group-hover:scale-90 group-focus-within:opacity-0 group-focus-within:scale-90":"opacity-100 scale-100"}`,children:e.jsx(ot,{name:W,hint:dt(t,W),size:"sm"})}),T?e.jsx("button",{type:"button",role:"checkbox","aria-checked":$,"aria-label":"Select queue row",title:$?"Selected (Shift+click for range)":"Select (Shift+click for range)",onClick:b=>{b.stopPropagation(),te(S,!$,b.shiftKey)},onMouseDown:b=>b.stopPropagation(),onKeyDown:b=>b.stopPropagation(),className:`absolute inset-0 flex items-center justify-center rounded-full border transition-[opacity,transform,background-color,border-color,color] duration-200 ease-out ${$?"opacity-100 scale-100 border-[#BFFF00]/40 bg-[#BFFF00]/18 text-[#E1FFB2]":"opacity-0 scale-90 border-white/[0.24] bg-black/55 text-white/78 group-hover:opacity-100 group-hover:scale-100 group-focus-within:opacity-100 group-focus-within:scale-100 hover:bg-black/62"}`,children:e.jsx("span",{className:"inline-flex h-4 w-4 items-center justify-center rounded-full border border-current/45 bg-black/30",children:$?e.jsx("svg",{viewBox:"0 0 16 16",className:"h-2.5 w-2.5",fill:"none","aria-hidden":!0,children:e.jsx("path",{d:"M3.2 8.3 6.2 11l6.6-6.1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null})}):null]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(Ne,{type:"initiative",size:11,className:"flex-shrink-0 opacity-85"}),e.jsx("button",{type:"button",onClick:()=>j==null?void 0:j(t.initiativeId,t.initiativeTitle),className:"block min-w-0 flex-1 truncate text-left text-micro uppercase tracking-[0.08em] text-muted transition-colors hover:text-white/72",title:ge,children:ge}),ne?e.jsx("span",{className:he("inline-flex flex-shrink-0 items-center rounded-full border px-2 py-0.5 text-[9px] font-semibold uppercase tracking-[0.08em]",ne.toneClass),title:ne.longLabel,children:ne.shortLabel}):null]}),e.jsxs("div",{className:"mt-0.5 flex min-w-0 items-start gap-1.5",children:[e.jsx(Ne,{type:"workstream",size:12,className:"mt-[3px] flex-shrink-0 opacity-95"}),e.jsx("p",{className:"min-w-0 line-clamp-2 text-body font-semibold leading-snug text-white",title:I,children:I})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-micro text-secondary",children:[e.jsx("span",{className:"rounded-full border border-strong bg-white/[0.03] px-2 py-0.5 text-micro uppercase tracking-[0.08em] text-secondary",children:"Runner"}),e.jsxs("span",{className:"truncate text-white/68",children:[W,D?` · ${D}`:""]})]})]})]})}),e.jsx("div",{className:"mt-2 rounded-lg border border-white/[0.07] bg-black/[0.18] px-2.5 py-2 text-caption text-white/68",children:X?e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-micro uppercase tracking-[0.08em] text-white/44",children:[e.jsx(Ne,{type:"task",size:10,className:"flex-shrink-0 opacity-80"}),e.jsx("span",{children:_e(t.queueState)}),U?e.jsxs("span",{className:"truncate text-micro normal-case tracking-normal text-muted",children:["· ",U]}):null]}),e.jsx("p",{className:"line-clamp-2 break-words text-caption leading-snug text-white/84",title:X,children:X})]}):e.jsx("span",{className:"text-secondary",children:ze(t)})}),ie&&e.jsxs("div",{className:"mt-1.5 rounded-lg border border-red-400/24 bg-red-500/[0.08] px-2.5 py-1 text-micro text-red-100/85",children:["Blocked: ",ie]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",onClick:b=>b.stopPropagation(),children:[e.jsx("button",{type:"button",disabled:be||Q,onClick:()=>void f(S,()=>P({initiativeId:t.initiativeId,workstreamId:t.workstreamId,agentId:t.runnerAgentId}),b=>mt(t,b)),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:Q?"Already running":"Start this workstream now",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:Q?"Running":"Start"})]})}),e.jsxs("button",{type:"button",onPointerDown:b=>fe.start(b),"aria-label":"Drag to reorder",title:K?"Reordering":"Drag to reorder",className:`control-pill flex h-7 items-center justify-center gap-1 px-2 text-micro font-semibold transition-colors ${K?"border-[#BFFF00]/35 bg-[#BFFF00]/14 text-[#E1FFB2] cursor-grabbing":"cursor-grab hover:bg-white/[0.08] hover:text-bright"}`,children:[K?e.jsx(Jt,{className:"h-3.5 w-3.5 opacity-90"}):e.jsx(Ht,{className:"h-3.5 w-3.5 opacity-90"}),e.jsx("span",{children:K?"Reordering":"Drag"})]}),e.jsxs("div",{className:"relative ml-auto",children:[e.jsx("button",{type:"button",disabled:be,onClick:()=>N(b=>b===S?null:S),className:"control-pill flex h-7 items-center justify-center px-2.5 text-micro font-semibold disabled:opacity-40",title:"Queue actions",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(pt,{className:"h-3 w-3 opacity-85"}),e.jsx("span",{children:"More"})]})}),Z===S&&e.jsxs("div",{className:"absolute right-0 top-[calc(100%+6px)] z-[320] min-w-[198px] rounded-xl border border-white/[0.1] bg-[#080d14]/95 p-1.5 shadow-[0_16px_36px_rgba(0,0,0,0.42)] backdrop-blur",children:[e.jsx("button",{type:"button",onClick:()=>{N(null);const b=c();f(`${S}:top`,()=>x(t,"top"),`Moved ${I} to top of queue.`,{optimistic:()=>m(new Set([S]),"top"),rollback:()=>u(b)})},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to top"}),e.jsx("button",{type:"button",onClick:()=>{N(null);const b=c();f(`${S}:bottom`,()=>x(t,"bottom"),`Moved ${I} to bottom of queue.`,{optimistic:()=>m(new Set([S]),"bottom"),rollback:()=>u(b)})},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Move to bottom"}),e.jsx("button",{type:"button",onClick:()=>{N(null);const b=c();f(`${S}:auto`,async()=>(await x(t,"top"),R({initiativeId:t.initiativeId,workstreamId:t.workstreamId,agentId:t.runnerAgentId,scope:"initiative"})),`Start+Auto enabled for ${ge}.`,{optimistic:()=>m(new Set([S]),"top"),rollback:()=>u(b)})},className:"flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Start with auto"}),Q?e.jsx("button",{type:"button",onClick:()=>{N(null),f(`${S}:pause`,()=>oe(t,A),`Paused ${I}.`)},className:"mt-1 flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Pause run"}):null,e.jsx("button",{type:"button",disabled:be||Q,onClick:()=>{N(null),M(t)},className:"mt-1 flex h-8 w-full items-center rounded-md px-2.5 text-left text-caption text-red-100 transition-colors hover:bg-red-500/[0.12] disabled:opacity-45",children:"Remove from queue"})]})]})]})]})})}const cn=Object.freeze(Object.defineProperty({__proto__:null,NextUpPanel:en},Symbol.toStringTag,{value:"Module"}));export{Dt as I,en as N,cn as a,Qt as o,Kt as u};
|
|
Binary file
|
|
Binary file
|