@taskforcehq/taskforce 0.3.330 → 0.3.333
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 +7 -2
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +2 -2
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.js +2 -2
- package/dist/components/features/planning/PlanningModule.js +15 -3
- package/dist/components/features/planning/planningMetadata.d.ts +10 -0
- package/dist/components/features/planning/planningMetadata.js +8 -0
- package/dist/components/views/StandaloneLayout.js +35 -1
- package/dist/components/views/panels/PlanningDrawer.d.ts +2 -1
- package/dist/components/views/panels/PlanningDrawer.js +12 -8
- package/dist/config/envSchema.js +7 -0
- package/dist/core/McpTokenService.d.ts +2 -0
- package/dist/core/McpTokenService.js +13 -5
- package/dist/core/Taskforce.d.ts +11 -3
- package/dist/core/Taskforce.js +33 -3
- package/dist/core/types.d.ts +1 -0
- package/dist/documentReviews/DocumentReviewCommentStore.d.ts +2 -0
- package/dist/documentReviews/DocumentReviewCommentStore.js +28 -9
- package/dist/mcp/httpProtocolRouting.d.ts +1 -0
- package/dist/mcp/httpProtocolRouting.js +8 -5
- package/dist/mcp/runtime.js +24 -5
- package/dist/mcp/taskPlanningRegistrar.js +2 -2
- package/dist/mcp/toolProfiles.js +1 -0
- package/dist/mcp/toolRegistry.js +8 -8
- package/dist/server/buildInfo.d.ts +1 -0
- package/dist/server/buildInfo.js +5 -1
- package/dist/server/cloudMcpCapacityTelemetry.d.ts +68 -0
- package/dist/server/cloudMcpCapacityTelemetry.js +221 -0
- package/dist/server/localWorkspaceSyncServerRuntime.js +13 -5
- package/dist/server/routes/admin.js +14 -2
- package/dist/server/routes/localService.js +1 -0
- package/dist/server/routes/shared.d.ts +3 -0
- package/dist/server/routes/shared.js +280 -240
- package/dist/server/routes/syncPushRoutes.d.ts +3 -0
- package/dist/server/routes/syncPushRoutes.js +8 -2
- package/dist/service/localServiceCli.d.ts +2 -2
- package/dist/service/localServiceCli.js +4 -3
- package/dist/services/executorPhaseAIssuerCore.d.ts +13 -0
- package/dist/services/executorPhaseAIssuerCore.js +107 -0
- package/dist/services/taskforceAgentMcpBridge.d.ts +1 -1
- package/dist/services/taskforceAgentMcpBridge.js +35 -5
- package/dist/shared/executorPhaseASchemaValidation.js +1 -1
- package/dist/storage/postgresAdapter.js +3 -1
- package/dist/storage/postgresRequestDiagnostics.d.ts +9 -1
- package/dist/storage/postgresRequestDiagnostics.js +15 -2
- package/dist/storage/postgresWorker.js +13 -3
- package/dist/storage/postgresWorkerProtocol.d.ts +6 -0
- package/dist/storage/workflowStore.d.ts +2 -0
- package/dist/storage/workflowStore.js +39 -2
- package/dist/sync/cloudSyncApi.js +4 -2
- package/dist/sync/collaborationSyncState.js +5 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.d.ts +3 -1
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +18 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.d.ts +1 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.js +7 -6
- package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.js +2 -2
- package/dist/sync/engine/workspaceSyncEngineLocalApply.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.d.ts +6 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.js +34 -1
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +2 -2
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +4 -1
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +55 -10
- package/dist/sync/syncApplyHandlers.d.ts +1 -0
- package/dist/sync/syncApplyHandlers.js +72 -15
- package/dist/sync/syncService.d.ts +1 -0
- package/dist/sync/syncService.js +5 -2
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.d.ts +7 -7
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.js +50 -13
- package/dist/sync/v3/localOutboxRecoveryPreparationService.js +8 -2
- package/dist/sync/v3/localTaskCreateOutboxService.d.ts +3 -1
- package/dist/sync/v3/localTaskCreateOutboxService.js +6 -1
- package/dist/sync/v3/localTaskDeleteOutboxService.js +1 -0
- package/dist/sync/v3/localTaskLifecycleOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskLifecycleOutboxService.js +5 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.js +6 -2
- package/dist/sync/v3/localTaskStatusOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskStatusOutboxService.js +20 -5
- package/dist/sync/v3/syncDurabilityStore.d.ts +2 -1
- package/dist/sync/v3/syncDurabilityStore.js +34 -6
- package/dist/sync/v3/workflowRuntimeMutationService.d.ts +5 -0
- package/dist/sync/v3/workflowRuntimeMutationService.js +124 -71
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +25 -3
- package/dist/sync/v3/workspaceSyncV3Feed.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3Feed.js +6 -1
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +2 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +49 -18
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.js +50 -5
- package/dist/ui/assets/{AiIdentityRosterCard-OcSz1PkK.js → AiIdentityRosterCard-Cfvb9Nuv.js} +1 -1
- package/dist/ui/assets/{AiProfilesModule-ByhYW5Xi.js → AiProfilesModule-0oR70eFG.js} +1 -1
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-BTM6nIg_.js → AnnotatedAttachmentWorkspace-C33iH_r_.js} +1 -1
- package/dist/ui/assets/{AssetTraySortControl-DabEG8L4.js → AssetTraySortControl-BAqxUtke.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-Coa8yVGM.js → ContextAttachmentManager-BudIbOR9.js} +2 -2
- package/dist/ui/assets/{DocumentWorkspace-BB0qhdix.js → DocumentWorkspace-A8dFQyId.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-CZ8x4UJE.js → EntityActivityTimeline-g7vtdsx1.js} +1 -1
- package/dist/ui/assets/PlanningModule-D-DeQs4F.js +1 -0
- package/dist/ui/assets/{PlansPage-D86pZSSl.js → PlansPage-BWmfGi0Z.js} +1 -1
- package/dist/ui/assets/{TaskContextUpload-BVIkU9yT.js → TaskContextUpload-BA_lQmS9.js} +1 -1
- package/dist/ui/assets/{TaskSettings-Cv1mNhv_.js → TaskSettings-DAlH4YIP.js} +1 -1
- package/dist/ui/assets/{TaskforceAgentsModule-gmH-PD2q.js → TaskforceAgentsModule-DmeCf6pJ.js} +2 -2
- package/dist/ui/assets/{WorkflowManagerModule-DbfnHJ-f.js → WorkflowManagerModule-p08eDOaa.js} +1 -1
- package/dist/ui/assets/index-GHJgcW3j.js +7 -0
- package/dist/ui/index.html +1 -1
- package/package.json +3 -1
- package/dist/ui/assets/PlanningModule-pRPjR7v5.js +0 -1
- package/dist/ui/assets/index-CTsDBaef.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as s,j as t}from"./vendor-react-CKJs5o3c.js";import{an as ze,ao as $e,ap as Le,aq as We,ar as ye,as as le,T as Pe,at as ge,au as ne,av as ie,aw as G,ax as J,ay as De,az as Fe,aA as He,aB as Be,aC as Me,aD as Ue,aE as Ge,aF as be,aG as _e,aH as ce,aI as je,aJ as Ve,aK as Ke,aL as qe,aM as Qe,aN as Je}from"./index-GHJgcW3j.js";import{w as re,Z as ke,R as oe,a8 as Xe,a9 as Ye,S as Ze,X as et,al as tt,aj as nt,t as se,ak as me,V as ae,Y as it,a7 as st}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const at="_module_3zich_1",rt="_columns_3zich_15",ot="_column_3zich_15",lt="_columnHeader_3zich_36",ct="_columnHeadingGroup_3zich_49",dt="_paneHeading_3zich_56",ut="_responsiveBack_3zich_60",ht="_sectionLabel_3zich_64",vt="_sectionHeadingRow_3zich_68",pt="_headerActions_3zich_81",ft="_portfolioControls_3zich_87",yt="_searchRow_3zich_95",gt="_searchShell_3zich_101",kt="_clearSearch_3zich_139",mt="_controlActive_3zich_160",wt="_filterPanel_3zich_166",xt="_filterField_3zich_177",bt="_filterLabel_3zich_184",_t="_filterDropdown_3zich_190",jt="_sortTrigger_3zich_204",Ct="_scrollRegion_3zich_217",Et="_selectedEntityContext_3zich_227",St="_selectedEntityContextArchived_3zich_237",It="_selectedEntityReferenceRow_3zich_242",Nt="_selectedEntityReferenceIdentity_3zich_257",At="_selectedEntityReferenceActions_3zich_264",Rt="_workspaceEditor_3zich_278",Ot="_workspaceEditorField_3zich_294",Tt="_workspaceEditorActions_3zich_337",zt="_selectedEntityDescription_3zich_348",$t="_selectedEntityDescriptionMarkdown_3zich_355",Lt="_selectedEntityOwnerField_3zich_361",Wt="_selectedEntityOwnerDropdown_3zich_373",Pt="_selectedEntityDetailsSection_3zich_377",Dt="_activityTimelineList_3zich_382",Ft="_activityTimelineEmpty_3zich_389",Ht="_visuallyHidden_3zich_393",Bt="_entityCard_3zich_405",Mt="_entityCardTopRow_3zich_426",Ut="_entityCardBody_3zich_433",Gt="_entityCardContentButton_3zich_437",Vt="_entityCardSelected_3zich_447",Kt="_entityCardArchived_3zich_455",qt="_relationshipRecovery_3zich_466",Qt="_empty_3zich_488",Jt="_centerState_3zich_495",Xt="_inlineError_3zich_509",Yt="_spinner_3zich_524",Zt="_columnPortfolio_3zich_543",en="_columnActive_3zich_544",tn="_columnWorkstreams_3zich_545",nn="_columnTasks_3zich_550",sn="_workspaceEditorIdentity_3zich_592",i={module:at,columns:rt,column:ot,columnHeader:lt,columnHeadingGroup:ct,paneHeading:dt,responsiveBack:ut,sectionLabel:ht,sectionHeadingRow:vt,headerActions:pt,portfolioControls:ft,searchRow:yt,searchShell:gt,clearSearch:kt,controlActive:mt,filterPanel:wt,filterField:xt,filterLabel:bt,filterDropdown:_t,sortTrigger:jt,scrollRegion:Ct,selectedEntityContext:Et,selectedEntityContextArchived:St,selectedEntityReferenceRow:It,selectedEntityReferenceIdentity:Nt,selectedEntityReferenceActions:At,workspaceEditor:Rt,workspaceEditorField:Ot,workspaceEditorActions:Tt,selectedEntityDescription:zt,selectedEntityDescriptionMarkdown:$t,selectedEntityOwnerField:Lt,selectedEntityOwnerDropdown:Wt,selectedEntityDetailsSection:Pt,activityTimelineList:Dt,activityTimelineEmpty:Ft,visuallyHidden:Ht,entityCard:Bt,entityCardTopRow:Mt,entityCardBody:Ut,entityCardContentButton:Gt,entityCardSelected:Vt,entityCardArchived:Kt,relationshipRecovery:qt,empty:Qt,centerState:Jt,inlineError:Xt,spinner:Yt,columnPortfolio:Zt,columnActive:en,columnWorkstreams:tn,columnTasks:nn,workspaceEditorIdentity:sn};function ee({entityType:e,mode:l,initialTitle:m="",initialDescription:p="",ownerOptions:f,fixedInitiativeId:y,formId:j,showActions:C=!0,onSavingChange:b,onDirtyChange:N,onCancel:A,onSave:z}){const E=e==="initiative"?"Initiative":"Workstream",W=s.useId(),P=s.useId(),k=s.useId(),V=s.useRef(null),[D,S]=s.useState(m),[u,_]=s.useState(p),[I,R]=s.useState(""),[O,h]=s.useState(null),[g,$]=s.useState(null),[T,F]=s.useState(null),[H,L]=s.useState(null),[w,U]=s.useState(!1),x=l==="create"||Ge({title:m,description:p},{title:D,description:u});s.useEffect(()=>{N?.(x)},[x,N]),s.useEffect(()=>{V.current?.focus()},[]);const B=async c=>{if(c.preventDefault(),w)return;const a=D.trim();if(!a){F(`${E} title is required.`),V.current?.focus();return}if(x){F(null),L(null),U(!0),b?.(!0);try{await z({title:a,description:u.trim()||null,...l==="create"?{ownerId:I.trim()||null}:{},...e==="workstream"&&l==="create"?{initiativeId:y||null}:{},...l==="create"&&(O||g)?{icon:O,color:g}:{}})}catch(M){L(M instanceof Error?M.message:`Failed to save ${E.toLowerCase()}.`)}finally{U(!1),b?.(!1)}}};return t.jsxs("form",{id:j,className:i.workspaceEditor,onSubmit:c=>{B(c)},onKeyDown:c=>{c.key!=="Escape"||w||(c.preventDefault(),A())},noValidate:!0,children:[l==="create"?t.jsxs("div",{className:i.workspaceEditorIdentity,children:[t.jsx(be,{entityType:e,entityId:"create-preview",icon:O,color:g||"blue",size:"detail",onChange:c=>{Object.prototype.hasOwnProperty.call(c,"icon")&&h(c.icon??null),Object.prototype.hasOwnProperty.call(c,"color")&&$(c.color??null)}}),t.jsx("span",{children:"Choose an icon and color"})]}):null,t.jsxs("div",{className:i.workspaceEditorField,children:[t.jsxs("label",{htmlFor:W,children:[E," title"]}),t.jsx("input",{ref:V,id:W,value:D,disabled:w,required:!0,"aria-invalid":T?"true":void 0,"aria-describedby":T?P:void 0,onChange:c=>{S(c.target.value),T&&F(null)},placeholder:e==="initiative"?"Enter initiative title":"Enter workstream title"}),T?t.jsx("p",{id:P,className:"tf-text-error",children:T}):null]}),t.jsxs("div",{className:i.workspaceEditorField,children:[t.jsxs("label",{htmlFor:k,children:[E," description"]}),t.jsx("textarea",{id:k,value:u,disabled:w,rows:5,onChange:c=>_(c.target.value),placeholder:e==="initiative"?"Describe the broader outcome this initiative is meant to achieve.":"Describe the lane of work this workstream will coordinate."})]}),l==="create"&&f?t.jsxs("div",{className:i.workspaceEditorField,children:[t.jsxs("span",{children:[E," owner"]}),t.jsx(le,{value:I,options:f,onChange:R,disabled:w,ariaLabel:`${E} owner`,className:`${_e.control} ${i.selectedEntityOwnerDropdown}`})]}):null,H?t.jsx("p",{className:"tf-text-error",role:"alert",children:H}):null,C?t.jsxs("div",{className:i.workspaceEditorActions,children:[t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:A,disabled:w,children:"Cancel"}),t.jsxs("button",{type:"submit",className:"tf-button-primary tf-button-compact",disabled:w||!x,children:[w?t.jsx(re,{size:14,className:i.spinner,"aria-hidden":"true"}):null,l==="create"?`Create ${E}`:"Save"]})]}):null]})}function an({initiative:e,ownerOption:l,ownerOptions:m,workstreamCount:p,selected:f,onSelect:y,onChangeOwner:j,onChangeIdentity:C}){return t.jsxs("div",{className:`${i.entityCard} ${e.isArchived?i.entityCardArchived:""} ${f?i.entityCardSelected:""}`.trim(),children:[t.jsx(ce,{label:J(e),entityType:"initiative",entityName:e.title,interactive:!1}),t.jsx("div",{className:i.entityCardBody,children:t.jsx("div",{role:"button",tabIndex:0,className:i.entityCardContentButton,onClick:y,onKeyDown:b=>{b.key!=="Enter"&&b.key!==" "||(b.preventDefault(),y())},"aria-pressed":f,children:t.jsx(je,{item:e,entityType:"initiative",workstreamCount:p,ownerOption:l,ownerOptions:m,onChangeOwner:j,onChangeIdentity:C})})})]})}function we({workstream:e,ownerOption:l,ownerOptions:m,selected:p,onSelect:f,onChangeOwner:y,onChangeIdentity:j,referenceAction:C,feedback:b}){const N=G(e);return t.jsxs("div",{className:`${i.entityCard} ${e.isArchived?i.entityCardArchived:""} ${p?i.entityCardSelected:""}`.trim(),children:[t.jsxs("div",{className:i.entityCardTopRow,children:[C,t.jsx(ce,{label:N||"Reference pending",entityType:"workstream",entityName:e.title,interactive:!1,pending:!N})]}),b,t.jsx("div",{className:i.entityCardBody,children:t.jsx("div",{role:"button",tabIndex:0,className:i.entityCardContentButton,onClick:f,onKeyDown:A=>{A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),f())},"aria-pressed":p,children:t.jsx(je,{item:e,entityType:"workstream",ownerOption:l,ownerOptions:m,onChangeOwner:y,onChangeIdentity:j})})})]})}function xe({item:e,entityType:l,ownerOptions:m,onChangeOwner:p,onChangeIdentity:f,workspaceId:y,currentActorId:j,taskReferences:C,hydrationState:b,onRetryHydration:N,onAddContextFile:A,onRemoveContextFile:z,onUpdateContextCaption:E,onUpdate:W,onArchive:P,onUnarchive:k,referenceAction:V,relationshipActions:D,relationshipContent:S}){const u=l==="initiative"?"Initiative":"Workstream",_=l==="initiative"?J(e):G(e),[I,R]=s.useState(String(e.ownerId||"")),[O,h]=s.useState(!1),[g,$]=s.useState(!1),[T,F]=s.useState(!1),[H,L]=s.useState(!1),[w,U]=s.useState(!1),[x,B]=s.useState(!1),c=s.useId(),a=Ve({entityType:l,isArchived:e.isArchived,taskCount:e.taskCount,completedTaskCount:e.completedTaskCount,archiveReady:e.archiveReady,activeWorkstreamCount:e.archiveActiveWorkstreamCount}),M=a.mode==="archived"?`Unarchive ${u.toLowerCase()}`:a.mode==="blocked"?`Archive unavailable — active ${a.remainingKind==="task"?"tasks":"workstreams"} remain`:a.mode==="checking"?"Archive availability is still loading":`Archive ${u.toLowerCase()}`;s.useEffect(()=>{R(String(e.ownerId||"")),h(!1)},[e.id,e.ownerId]),s.useEffect(()=>{$(!1),F(!1),L(!1),U(!1),B(!1)},[e.id]);const r=async d=>{if(!p||e.isArchived||O||d===I)return;const K=I;R(d),h(!0);try{await p(d)}catch{R(K)}finally{h(!1)}},X=async()=>{if(x)return;if(a.mode==="ready"){U(!0);return}const d=a.mode==="archived"?k:P;if(!(!d||a.mode==="blocked"||a.mode==="checking")){B(!0);try{await d()}finally{B(!1)}}},Y=async()=>{if(!(!P||x)){B(!0);try{await P()!==!1&&U(!1)}finally{B(!1)}}};return t.jsxs("section",{className:`${i.selectedEntityContext} ${e.isArchived?i.selectedEntityContextArchived:""}`.trim(),"aria-label":`Selected ${u.toLowerCase()}`,"aria-busy":b?.status==="loading",children:[t.jsxs("div",{className:i.selectedEntityReferenceRow,children:[t.jsxs("div",{className:i.selectedEntityReferenceIdentity,children:[t.jsx(be,{entityType:l,entityId:e.id,icon:e.icon,color:e.color,size:"detail",disabled:!!e.isArchived,onChange:f?d=>f(l,e.id,d):void 0}),V,t.jsx(ce,{label:_||"Reference pending",entityType:l,entityName:e.title,interactive:!1,pending:!_})]}),t.jsxs("div",{className:i.selectedEntityReferenceActions,children:[t.jsx("span",{children:u}),D,!g&&(P||k)?t.jsx("button",{type:"button",className:"tf-control-icon",disabled:x||a.mode==="blocked"||a.mode==="checking"||(a.mode==="archived"?!k:!P),onClick:()=>{X()},"aria-label":M,title:M,"aria-expanded":a.mode==="ready"?w:void 0,children:a.mode==="archived"?t.jsx(oe,{size:14,"aria-hidden":"true"}):t.jsx(it,{size:14,"aria-hidden":"true"})}):null,!g&&!e.isArchived&&W?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>{L(!1),$(!0)},"aria-label":`Edit ${u.toLowerCase()}`,title:`Edit ${u.toLowerCase()}`,children:t.jsx(st,{size:14,"aria-hidden":"true"})}):null,g?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>$(!1),disabled:T,children:"Cancel"}),t.jsx("button",{type:"submit",form:c,className:"tf-button-primary tf-button-compact",disabled:T||!H,children:"Save"})]}):null]})]}),w&&a.mode==="ready"?t.jsx(Ke,{entityType:l,title:e.title,activeTaskCount:e.archiveActiveTaskCount,activeWorkstreamCount:e.archiveActiveWorkstreamCount,busy:x,onCancel:()=>U(!1),onConfirm:()=>{Y()}}):null,S,g&&W?t.jsx(ee,{entityType:l,mode:"edit",formId:c,showActions:!1,onSavingChange:F,onDirtyChange:L,initialTitle:e.title,initialDescription:e.description||"",onCancel:()=>$(!1),onSave:async d=>{await W(d),$(!1)}},`${l}:${e.id}`):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"tf-heading-card",children:e.title}),t.jsx(qe,{description:e.description,label:u,taskReferences:C,className:`${i.selectedEntityDescription} tf-scrollbar`.trim(),markdownClassName:i.selectedEntityDescriptionMarkdown})]}),t.jsxs("div",{className:i.selectedEntityOwnerField,children:[t.jsx("span",{children:"Owner"}),t.jsx(le,{value:I,options:m,onChange:d=>{r(d)},disabled:!p||!!e.isArchived||O,ariaLabel:`${u} owner`,className:`${_e.control} ${i.selectedEntityOwnerDropdown}`})]}),t.jsx("div",{className:i.selectedEntityDetailsSection,children:t.jsx(Qe,{entityType:l,entityId:e.id,referenceLabel:l==="initiative"?J(e):G(e),workspaceId:y,attachments:e.attachments,readOnly:!!e.isArchived,defaultExpanded:!1,onAddAttachment:!e.isArchived&&A?d=>A(l,e.id,d):void 0,onRemoveAttachment:!e.isArchived&&z?d=>z(l,e.id,d):void 0,onUpdateAttachmentCaption:!e.isArchived&&E?(d,K)=>E(l,e.id,d,K):void 0})}),t.jsx("div",{className:i.selectedEntityDetailsSection,children:t.jsx(Je,{entityType:l,item:e,assigneeOptions:m,currentActorId:j,taskReferences:C,defaultExpanded:!1,listClassName:i.activityTimelineList,emptyClassName:i.activityTimelineEmpty,hydrationState:b,onRetryHydration:N})})]})}function hn({model:e}){const[l,m]=s.useState(null),[p,f]=s.useState(null),[y,j]=s.useState("portfolio"),[C,b]=s.useState(""),[N,A]=s.useState("all"),[z,E]=s.useState("default"),[W,P]=s.useState(!1),[k,V]=s.useState(!1),D=e.taskArrangeMode||"execution",[S,u]=s.useState(null),[_,I]=s.useState(null),[R,O]=s.useState(null),[h,g]=s.useState(!1),$=s.useRef(null),T=s.useRef(null),F=s.useRef(null),H=s.useRef(null),L=s.useRef(null),w=s.useMemo(()=>new Map(e.assigneeOptions.filter(n=>!String(n.archivedAt||"").trim()).map(n=>[String(n.value),n])),[e.assigneeOptions]),U=s.useMemo(()=>{const n=String(e.currentOwnerId||"").trim(),o=n?ze(e.assigneeOptions,n).find(v=>v.value===n):void 0;return[{value:"all",label:"All owners",icon:"Users",color:"var(--text-secondary)",kind:"unassigned"},...n?[{...o,value:"mine",label:"Owned by me",icon:o?.icon||"User",color:o?.color||"var(--text-secondary)",kind:o?.kind||"member"}]:[],{value:"unassigned",label:"Unassigned",icon:Le,color:$e,kind:"unassigned"}]},[e.assigneeOptions,e.currentOwnerId]),x=s.useMemo(()=>We({initiatives:e.initiatives,standaloneWorkstreams:e.standaloneWorkstreams,showArchivedPlanning:k,searchQuery:C,ownerFilter:N,currentOwnerId:String(e.currentOwnerId||""),sort:z}),[e.currentOwnerId,e.initiatives,e.standaloneWorkstreams,N,C,k,z]),B=s.useMemo(()=>x.initiatives.map(({initiative:n})=>n),[x.initiatives]),c=x.standaloneWorkstreams,a=s.useMemo(()=>e.initiatives.find(n=>n.id===l)??null,[e.initiatives,l]),M=s.useMemo(()=>[...e.initiatives.flatMap(n=>n.allWorkstreams??n.workstreams),...e.standaloneWorkstreams],[e.initiatives,e.standaloneWorkstreams]),r=s.useMemo(()=>M.find(n=>n.id===p)??null,[M,p]),X=a?(a.allWorkstreams??a.workstreams).filter(n=>k||!n.isArchived):r&&!r.initiativeId?[r]:[],Y=s.useMemo(()=>ye((r?.tasks??[]).filter(n=>k||!n.isArchived),D),[r?.tasks,k,D]),d=s.useMemo(()=>new Set((a?.allWorkstreams??a?.workstreams??[]).map(n=>n.id)),[a]),K=s.useMemo(()=>new Set((r?.tasks??[]).map(n=>n.id)),[r]),Ce=s.useMemo(()=>e.linkOptions.workstreams.filter(n=>!d.has(n.id)),[d,e.linkOptions.workstreams]),Ee=s.useMemo(()=>e.linkOptions.tasks.filter(n=>!K.has(n.id)),[K,e.linkOptions.tasks]),q=r?"workstream":a?"initiative":null,Q=r?.id||a?.id||null,de=q&&Q?e.hydrationStateByEntity?.[`${q}:${Q}`]:void 0,ue=s.useMemo(()=>e.initiatives.some(o=>o.isArchived)?!0:[...e.initiatives.flatMap(o=>o.allWorkstreams??o.workstreams),...e.standaloneWorkstreams].some(o=>o.isArchived||(o.tasks??[]).some(v=>v.isArchived)),[e.initiatives,e.standaloneWorkstreams]);s.useEffect(()=>{const n=L.current;if(n){if(n.entityType==="initiative"){if(!e.initiatives.some(o=>o.id===n.entityId))return;L.current=null,m(n.entityId),f(null),H.current="workstreams",j("workstreams");return}M.some(o=>o.id===n.entityId)&&(L.current=null,m(n.initiativeId||null),f(n.entityId),H.current="tasks",j("tasks"))}},[M,e.initiatives]),s.useEffect(()=>{l&&!a&&(m(null),f(null),j("portfolio"))},[a,l]),s.useEffect(()=>{p&&!r&&(f(null),j(a?"workstreams":"portfolio"))},[a,r,p]),s.useEffect(()=>{!e.hydrateEntity||!q||!Q||e.hydrateEntity(q,Q)},[e.hydrateEntity,Q,q]),s.useEffect(()=>{I(null),O(null),g(!1)},[Q,q]),s.useLayoutEffect(()=>{if(H.current!==y)return;(y==="portfolio"?$.current:y==="workstreams"?T.current:F.current)?.focus({preventScroll:!0}),H.current=null},[y]);const Z=n=>{if(n===y){(n==="portfolio"?$.current:n==="workstreams"?T.current:F.current)?.focus({preventScroll:!0});return}H.current=n,j(n)},Se=n=>{m(n),f(null),Z("workstreams")},he=n=>{n.initiativeId||m(null),f(n.id),Z("tasks")},Ie=()=>{Z(a?"workstreams":"portfolio")},Ne=x.hasCriteria||z!=="default",Ae=()=>{b(""),A("all"),E("default")},te=async n=>{if(!S||!e.createEntity)return;const o=await e.createEntity(S.entityType,n);L.current={entityType:S.entityType,entityId:o.id,initiativeId:S.initiativeId},u(null)},ve=async(n,o)=>{if(h)return;const v=n==="workstream"?e.attachWorkstreamToInitiative:e.attachTaskToWorkstream,fe=n==="workstream"?a?.id:r?.id;if(!(!v||!fe)){g(!0);try{await v(fe,o.referenceLabel)}finally{g(!1)}}},Re=async n=>{if(!(!r||!e.assignWorkstreamToInitiative||h)){g(!0);try{await e.assignWorkstreamToInitiative(r.id,n.referenceLabel)!==!1&&m(n.id)}finally{g(!1)}}},Oe=async()=>{if(!(!_||h)){g(!0);try{if(_.entityType==="workstream"){if(!e.assignWorkstreamToInitiative)return;const n=a?J(a):null;if(await e.assignWorkstreamToInitiative(_.id,null)===!1)return;O({pane:_.id===r?.id?"tasks":"workstreams",message:`${_.referenceLabel} removed from its initiative.`,onUndo:async()=>{if(!n)return;await e.assignWorkstreamToInitiative?.(_.id,n)!==!1&&O(null)}})}else{if(!e.assignTaskToWorkstream||!r)return;const n=r.id;if(await e.assignTaskToWorkstream(_.id,null)===!1)return;O({pane:"tasks",message:`${_.referenceLabel} removed from this workstream.`,onUndo:async()=>{await e.assignTaskToWorkstream?.(_.id,n)!==!1&&O(null)}})}I(null)}finally{g(!1)}}},Te=async()=>{if(!(!R||h)){g(!0);try{await R.onUndo()}finally{g(!1)}}},pe=R?t.jsxs("div",{className:i.relationshipRecovery,role:"status",children:[t.jsx("span",{children:R.message}),t.jsx("button",{type:"button",className:"tf-button-ghost tf-button-compact",disabled:h,onClick:()=>{Te()},children:h?"Restoring…":"Undo"})]}):null;return e.loadState.status==="loading"&&e.initiatives.length===0&&e.standaloneWorkstreams.length===0?t.jsxs("main",{className:i.centerState,"aria-busy":"true","aria-label":"Loading planning workspace",children:[t.jsx(re,{size:22,className:i.spinner}),t.jsx("span",{children:"Loading planning…"})]}):e.loadState.status==="error"&&e.initiatives.length===0&&e.standaloneWorkstreams.length===0?t.jsxs("main",{className:i.centerState,role:"alert",children:[t.jsx(ke,{size:22}),t.jsx("strong",{children:"Planning could not be loaded."}),t.jsx("span",{children:e.loadState.error}),t.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:e.retry,disabled:e.loadState.isRefreshing,children:[e.loadState.isRefreshing?t.jsx(re,{size:15,className:i.spinner}):t.jsx(oe,{size:15}),"Retry"]})]}):t.jsxs("main",{className:i.module,"aria-label":"Planning workspace","aria-busy":e.loadState.isRefreshing,children:[e.loadState.isRefreshing?t.jsx("span",{className:i.visuallyHidden,role:"status","aria-live":"polite",children:"Refreshing planning"}):null,(e.loadState.status==="partial"||e.loadState.status==="error")&&t.jsxs("div",{className:i.inlineError,role:"alert",children:[t.jsx(ke,{size:16}),t.jsx("span",{children:e.loadState.error||"Some planning information could not be loaded."}),t.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:e.retry,children:"Retry"})]}),t.jsxs("div",{className:i.columns,"data-active-pane":y,children:[t.jsxs("section",{className:`${i.column} ${i.columnPortfolio} ${y==="portfolio"?i.columnActive:""}`.trim(),"aria-labelledby":"planning-portfolio-heading",children:[t.jsxs("div",{className:i.columnHeader,children:[t.jsx("h2",{ref:$,id:"planning-portfolio-heading",className:`tf-heading-section ${i.paneHeading}`,tabIndex:-1,children:"Portfolio"}),t.jsxs("div",{className:i.headerActions,children:[t.jsx("span",{children:B.length+c.length}),t.jsx("button",{type:"button",className:`tf-control-icon ${k?i.controlActive:""}`.trim(),onClick:()=>V(n=>!n),disabled:!ue,"aria-label":k?"Hide archived planning items":"Show archived planning items","aria-pressed":k,title:ue?k?"Hide archived planning items":"Show archived planning items":"No archived planning items",children:k?t.jsx(Xe,{size:15,"aria-hidden":"true"}):t.jsx(Ye,{size:15,"aria-hidden":"true"})})]})]}),t.jsxs("div",{className:i.portfolioControls,children:[t.jsxs("div",{className:i.searchRow,children:[t.jsxs("div",{className:i.searchShell,children:[t.jsx(Ze,{size:14,"aria-hidden":"true"}),t.jsx("input",{type:"search",value:C,onChange:n=>b(n.target.value),placeholder:"Search initiatives and workstreams","aria-label":"Search planning"}),C?t.jsx("button",{type:"button",className:i.clearSearch,onClick:()=>b(""),"aria-label":"Clear planning search",title:"Clear search",children:t.jsx(et,{size:13,"aria-hidden":"true"})}):null]}),t.jsx("button",{type:"button",className:`tf-control-icon ${W||N!=="all"||z!=="default"?i.controlActive:""}`.trim(),"aria-label":"Filter and sort planning",title:"Filter and sort planning","aria-expanded":W,"aria-controls":"planning-workspace-navigator-options",onClick:()=>P(n=>!n),children:t.jsx(tt,{size:15,"aria-hidden":"true"})})]}),W?t.jsxs("div",{id:"planning-workspace-navigator-options",className:i.filterPanel,children:[t.jsxs("div",{className:i.filterField,children:[t.jsx("span",{className:i.filterLabel,children:"Owner"}),t.jsx(le,{value:N,options:e.assigneeOptions,leadingOptions:U,includeUnassigned:!1,onChange:A,disabled:!1,ariaLabel:"Filter planning by owner",className:i.filterDropdown})]}),t.jsxs("div",{className:i.filterField,children:[t.jsx("span",{className:i.filterLabel,children:"Sort"}),t.jsx(Pe,{value:z,options:ge,onChange:n=>E(String(n)),ariaLabel:"Sort planning",className:i.filterDropdown,portalPanel:!0,panelAlign:"start",triggerContent:t.jsxs("span",{className:i.sortTrigger,children:[t.jsx(nt,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:ge.find(n=>n.value===z)?.label})]}),renderOptionContent:n=>n.label})]}),t.jsx("button",{type:"button",className:"tf-control-icon",onClick:Ae,disabled:!Ne,"aria-label":"Reset planning filters and sort",title:"Reset planning filters and sort",children:t.jsx(oe,{size:14,"aria-hidden":"true"})})]}):null]}),t.jsxs("div",{className:i.scrollRegion,children:[t.jsxs("div",{className:i.sectionHeadingRow,children:[t.jsx("h3",{className:`tf-heading-section ${i.sectionLabel}`,children:"Initiatives"}),e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>u({entityType:"initiative"}),"aria-label":"Create initiative",title:"Create initiative",children:t.jsx(se,{size:15,"aria-hidden":"true"})}):null]}),S?.entityType==="initiative"?t.jsx(ee,{entityType:"initiative",mode:"create",ownerOptions:e.assigneeOptions,onCancel:()=>u(null),onSave:te}):null,x.initiatives.map(({initiative:n,workstreams:o})=>t.jsx(an,{initiative:n,workstreamCount:o.length,ownerOption:n.ownerId?w.get(n.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:l===n.id,onSelect:()=>Se(n.id),onChangeOwner:e.changeOwner?v=>e.changeOwner?.("initiative",n.id,v==="unassigned"?"":v):void 0,onChangeIdentity:e.changeIdentity?v=>e.changeIdentity?.("initiative",n.id,v):void 0},n.id)),t.jsxs("div",{className:i.sectionHeadingRow,children:[t.jsx("h3",{className:`tf-heading-section ${i.sectionLabel}`,children:"Standalone workstreams"}),e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>u({entityType:"workstream",initiativeId:null}),"aria-label":"Create standalone workstream",title:"Create standalone workstream",children:t.jsx(se,{size:15,"aria-hidden":"true"})}):null]}),S?.entityType==="workstream"&&!S.initiativeId?t.jsx(ee,{entityType:"workstream",mode:"create",ownerOptions:e.assigneeOptions,fixedInitiativeId:null,onCancel:()=>u(null),onSave:te}):null,c.map(n=>t.jsx(we,{workstream:n,ownerOption:n.ownerId?w.get(n.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:p===n.id,onSelect:()=>he(n),onChangeOwner:e.changeOwner?o=>e.changeOwner?.("workstream",n.id,o==="unassigned"?"":o):void 0,onChangeIdentity:e.changeIdentity?o=>e.changeIdentity?.("workstream",n.id,o):void 0},n.id)),B.length===0&&c.length===0&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:x.hasCriteria?"No planning matches.":"No planning items yet."})]})]}),t.jsxs("section",{className:`${i.column} ${i.columnWorkstreams} ${y==="workstreams"?i.columnActive:""}`.trim(),"aria-labelledby":"planning-workstreams-heading",children:[t.jsxs("div",{className:i.columnHeader,children:[t.jsxs("div",{className:i.columnHeadingGroup,children:[t.jsx("button",{type:"button",className:`tf-control-icon ${i.responsiveBack}`.trim(),onClick:()=>Z("portfolio"),"aria-label":"Back to Portfolio",title:"Back to Portfolio",children:t.jsx(me,{size:15,"aria-hidden":"true"})}),t.jsxs("h2",{ref:T,id:"planning-workstreams-heading",className:`tf-heading-section ${i.paneHeading}`,tabIndex:-1,children:["Workstreams (",X.length,")"]})]}),t.jsx("div",{className:i.headerActions,children:a&&e.createEntity?t.jsx("button",{type:"button",className:"tf-control-icon",onClick:()=>u({entityType:"workstream",initiativeId:a.id}),"aria-label":`Create workstream in ${a.title}`,title:"Create workstream",children:t.jsx(se,{size:15,"aria-hidden":"true"})}):null})]}),t.jsxs("div",{className:i.scrollRegion,children:[a?t.jsxs(t.Fragment,{children:[t.jsx(xe,{item:a,entityType:"initiative",ownerOptions:e.assigneeOptions,onChangeOwner:e.changeOwner?n=>e.changeOwner?.("initiative",a.id,n):void 0,onChangeIdentity:e.changeIdentity,workspaceId:e.currentWorkspaceId,currentActorId:e.currentOwnerId,taskReferences:e.taskReferences,hydrationState:r?void 0:de,onRetryHydration:e.hydrateEntity?()=>{e.hydrateEntity?.("initiative",a.id)}:void 0,onAddContextFile:e.addContextFile,onRemoveContextFile:e.removeContextFile,onUpdateContextCaption:e.updateContextCaption,onUpdate:e.updateEntity?n=>e.updateEntity("initiative",a.id,n):void 0,onArchive:e.archiveEntity?()=>e.archiveEntity("initiative",a.id):void 0,onUnarchive:e.unarchiveEntity?()=>e.unarchiveEntity("initiative",a.id):void 0}),t.jsx(ne,{options:Ce,entityLabel:"workstream",onSelect:n=>ve("workstream",n),disabled:!e.attachWorkstreamToInitiative||h})]}):null,S?.entityType==="workstream"&&S.initiativeId===a?.id?t.jsx(ee,{entityType:"workstream",mode:"create",ownerOptions:e.assigneeOptions,fixedInitiativeId:a.id,onCancel:()=>u(null),onSave:te}):null,X.map(n=>t.jsx(we,{workstream:n,ownerOption:n.ownerId?w.get(n.ownerId):void 0,ownerOptions:e.assigneeOptions,selected:p===n.id,onSelect:()=>he(n),onChangeOwner:e.changeOwner?o=>e.changeOwner?.("workstream",n.id,o==="unassigned"?"":o):void 0,onChangeIdentity:e.changeIdentity?o=>e.changeIdentity?.("workstream",n.id,o):void 0,referenceAction:a?t.jsx(ie,{disabled:!e.assignWorkstreamToInitiative||h,onClick:()=>I({entityType:"workstream",id:n.id,referenceLabel:G(n),title:n.title,parentLabel:a?`${J(a)} ${a.title}`.trim():"its initiative"}),title:`Unlink ${G(n)||n.title} from initiative`,ariaLabel:`Unlink ${G(n)||n.title} from initiative`,children:t.jsx(ae,{size:14,"aria-hidden":"true"})}):void 0},n.id)),a&&R?.pane==="workstreams"?pe:null,X.length===0&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:"Select an initiative or standalone workstream."})]})]}),t.jsxs("section",{className:`${i.column} ${i.columnTasks} ${y==="tasks"?i.columnActive:""}`.trim(),"aria-labelledby":"planning-tasks-heading",children:[t.jsx("div",{className:i.columnHeader,children:t.jsxs("div",{className:i.columnHeadingGroup,children:[t.jsx("button",{type:"button",className:`tf-control-icon ${i.responsiveBack}`.trim(),onClick:Ie,"aria-label":a?"Back to Workstreams":"Back to Portfolio",title:a?"Back to Workstreams":"Back to Portfolio",children:t.jsx(me,{size:15,"aria-hidden":"true"})}),t.jsxs("h2",{ref:F,id:"planning-tasks-heading",className:`tf-heading-section ${i.paneHeading}`,tabIndex:-1,children:["Tasks (",Y.length,")"]})]})}),t.jsxs("div",{className:i.scrollRegion,children:[r?t.jsxs(t.Fragment,{children:[t.jsx(xe,{item:r,entityType:"workstream",ownerOptions:e.assigneeOptions,onChangeOwner:e.changeOwner?n=>e.changeOwner?.("workstream",r.id,n):void 0,workspaceId:e.currentWorkspaceId,currentActorId:e.currentOwnerId,taskReferences:e.taskReferences,hydrationState:de,onRetryHydration:e.hydrateEntity?()=>{e.hydrateEntity?.("workstream",r.id)}:void 0,onAddContextFile:e.addContextFile,onRemoveContextFile:e.removeContextFile,onUpdateContextCaption:e.updateContextCaption,onUpdate:e.updateEntity?n=>e.updateEntity("workstream",r.id,n):void 0,onArchive:e.archiveEntity?()=>e.archiveEntity("workstream",r.id):void 0,onUnarchive:e.unarchiveEntity?()=>e.unarchiveEntity("workstream",r.id):void 0,referenceAction:r.initiativeId?t.jsx(ie,{disabled:!e.assignWorkstreamToInitiative||h,onClick:()=>{I({entityType:"workstream",id:r.id,referenceLabel:G(r),title:r.title,parentLabel:a?`${J(a)} ${a.title}`.trim():"its initiative"})},title:"Unlink workstream from initiative",ariaLabel:"Unlink workstream from initiative",children:t.jsx(ae,{size:14,"aria-hidden":"true"})}):t.jsx(ne,{options:e.linkOptions.initiatives,entityLabel:"initiative",onSelect:Re,disabled:!e.assignWorkstreamToInitiative||h,iconTrigger:!0,triggerTitle:"Link initiative"})}),t.jsx(ne,{options:Ee,entityLabel:"task",onSelect:n=>ve("task",n),disabled:!e.attachTaskToWorkstream||h}),e.setTaskArrangeMode?t.jsx(De,{value:D,onChange:e.setTaskArrangeMode}):null]}):null,t.jsx(Fe,{tasks:Y,mode:D,onReorder:r&&e.reorderWorkstreamTasks?n=>e.reorderWorkstreamTasks?.(r.id,Me(ye(r.tasks??[],"execution"),n)):void 0,children:n=>{const o=He(n);return t.jsx(Be,{task:n,assigneeOption:n.assignee?w.get(n.assignee):void 0,assigneeOptions:e.assigneeOptions,showStatusLabel:e.showTaskCardStatusLabel,onOpen:()=>e.openTask(n.id),onAssigneeChange:e.setTaskAssignee?v=>e.setTaskAssignee?.(n.id,v):void 0,onStatusChange:e.setTaskStatus?v=>e.setTaskStatus?.(n.id,v):void 0,referenceInteractive:!1,referenceAction:t.jsx(ie,{disabled:!e.assignTaskToWorkstream||h,onClick:v=>{v.stopPropagation(),I({entityType:"task",id:n.id,referenceLabel:o||n.id,title:n.title,parentLabel:r?`${G(r)} ${r.title}`.trim():"its workstream"})},title:`Unlink ${o||n.title} from workstream`,ariaLabel:`Unlink ${o||n.title} from workstream`,children:t.jsx(ae,{size:14,"aria-hidden":"true"})})},n.id)}}),r&&R?.pane==="tasks"?pe:null,!r&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:"Select a workstream."}),r&&Y.length===0&&t.jsx("p",{className:`tf-text-helper ${i.empty}`,children:"No tasks are linked to this workstream."})]})]})]}),t.jsx(Ue,{item:_,busy:h,theme:e.theme,onCancel:()=>I(null),onConfirm:()=>{Oe()}})]})}export{hn as PlanningModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as e}from"./vendor-react-CKJs5o3c.js";import{aN as ye,t as Oe,aO as Ke,aP as ke,aQ as ge,aR as he,aS as He,aT as qe}from"./index-CTsDBaef.js";import{bn as ze,w as Ye,K as We}from"./vendor-icons-Bsq-mcEn.js";import{u as Ge,a as Qe}from"./vendor-router-AqJMU8Lz.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";const Je="_plansWrapper_ojftl_1",Xe="_contentFrame_ojftl_24",Ze="_shellOwnsScroll_ojftl_32",et="_withChrome_ojftl_38",tt="_siteVariant_ojftl_42",nt="_title_ojftl_56",rt="_subtitle_ojftl_71",at="_header_ojftl_78",it="_planCard_ojftl_93",st="_grid_ojftl_106",ot="_pricingNotes_ojftl_114",ct="_planName_ojftl_123",lt="_featureText_ojftl_130",ut="_currentBadge_ojftl_134",dt="_navAction_ojftl_138",mt="_backBtn_ojftl_139",pt="_priceRows_ojftl_150",ft="_foundingBeta_ojftl_154",gt="_cloudCapacityNote_ojftl_176",ht="_headerBar_ojftl_258",yt="_headerActions_ojftl_267",_t="_debugMeta_ojftl_318",Ct="_planNoticeCard_ojftl_381",bt="_planDescription_ojftl_392",St="_teamComingSoonCard_ojftl_397",jt="_clickablePlanCard_ojftl_416",wt="_activePlanCard_ojftl_431",vt="_callToAction_ojftl_495",xt="_primaryCta_ojftl_507",Nt="_secondaryCta_ojftl_518",kt="_currentCta_ojftl_530",Pt="_featuresList_ojftl_544",It="_priceRow_ojftl_150",At="_regularPriceLine_ojftl_568",Tt="_campaignPriceLine_ojftl_569",Lt="_priceRowWithCampaign_ojftl_576",Rt="_priceRowAmount_ojftl_580",Et="_regularPriceDiscounted_ojftl_586",Bt="_priceRowInterval_ojftl_592",$t="_campaignPriceLabel_ojftl_601",Mt="_campaignPriceAmount_ojftl_606",Ut="_campaignPriceInterval_ojftl_612",Dt="_ctaRow_ojftl_617",Ft="_featureItem_ojftl_623",Vt="_featureIcon_ojftl_629",Ot="_featureLimitAccent_ojftl_643",Kt="_featureLimitUnit_ojftl_654",Ht="_featureTextBlock_ojftl_660",qt="_featureDescription_ojftl_666",zt="_emptyState_ojftl_672",Yt="_marketingEmptyState_ojftl_681",Wt="_emptyBadge_ojftl_715",Gt="_emptyHighlights_ojftl_730",Qt="_loader_ojftl_752",Jt="_spinner_ojftl_762",Xt="_statusBanner_ojftl_815",Zt="_successBanner_ojftl_823",en="_infoBanner_ojftl_829",tn="_errorBanner_ojftl_835",r={plansWrapper:Je,contentFrame:Xe,shellOwnsScroll:Ze,withChrome:et,siteVariant:tt,title:nt,subtitle:rt,header:at,planCard:it,grid:st,pricingNotes:ot,planName:ct,featureText:lt,currentBadge:ut,navAction:dt,backBtn:mt,priceRows:pt,foundingBeta:ft,cloudCapacityNote:gt,headerBar:ht,headerActions:yt,debugMeta:_t,planNoticeCard:Ct,planDescription:bt,teamComingSoonCard:St,clickablePlanCard:jt,activePlanCard:wt,callToAction:vt,primaryCta:xt,secondaryCta:Nt,currentCta:kt,featuresList:Pt,priceRow:It,regularPriceLine:At,campaignPriceLine:Tt,priceRowWithCampaign:Lt,priceRowAmount:Rt,regularPriceDiscounted:Et,priceRowInterval:Bt,campaignPriceLabel:$t,campaignPriceAmount:Mt,campaignPriceInterval:Ut,ctaRow:Dt,featureItem:Ft,featureIcon:Vt,featureLimitAccent:Ot,featureLimitUnit:Kt,featureTextBlock:Ht,featureDescription:qt,emptyState:zt,marketingEmptyState:Yt,emptyBadge:Wt,emptyHighlights:Gt,loader:Qt,spinner:Jt,statusBanner:Xt,successBanner:Zt,infoBanner:en,errorBanner:tn};function nn(){const t=globalThis.__DEBUG_MODE__;return typeof t=="boolean"?t:!1}function rn(t){const a=String(t?.environment||"").trim(),c=String(t?.runtimeMode||"").trim();return!a&&!c?null:a&&c?`${a} (${c})`:a||c||null}const an=new Set(["a","b","br","em","i","li","ol","p","strong","u","ul"]);function sn(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function on(t){const a=String(t||"").trim();if(!a)return"";if(typeof document>"u")return sn(a);const c=document.createElement("template");c.innerHTML=a;const p=document.createElement("div"),l=C=>{if(C.nodeType===Node.TEXT_NODE)return document.createTextNode(C.textContent||"");if(C.nodeType!==Node.ELEMENT_NODE)return null;const E=C,P=E.tagName.toLowerCase();if(P==="script"||P==="style")return null;const $=Array.from(E.childNodes).map(l).filter(h=>!!h);if(!an.has(P)){const h=document.createDocumentFragment();for(const W of $)h.appendChild(W);return h}const v=document.createElement(P);if(P==="a"){const h=String(E.getAttribute("href")||"").trim();/^(https?:|mailto:|\/|#)/i.test(h)&&(v.setAttribute("href",h),v.setAttribute("rel","noopener noreferrer"))}for(const h of $)v.appendChild(h);return v};for(const C of Array.from(c.content.childNodes)){const E=l(C);E&&p.appendChild(E)}return p.innerHTML}function cn(t,a){if(t==null||!a)return"Contact Sales";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:a.toUpperCase(),minimumFractionDigits:0}).format(t/100)}catch{return`${a.toUpperCase()} ${t/100}`}}function ln(){return"$0"}function O(t){return t?t.pricingType==="free"?!0:t.unitAmount!=null&&t.currency!=null:!1}function Te(t){return t?t.pricingType==="free"?ln():cn(t.unitAmount,t.currency):"Unavailable"}function Le(t,a){return O(a)?{price:a,pricingAudience:"campaign"}:{price:t,pricingAudience:"public"}}function un(t,a,c,p){const l=O(t)||O(c),C=O(a)||O(p);if(!l&&!C)return null;const E=(P,$,v)=>{if(!O(P)&&!O($))return null;const h=O($),W=v==="year"?"year":"month";return e.jsxs("div",{className:`${r.priceRow} ${h?r.priceRowWithCampaign:""}`,children:[O(P)?e.jsxs("div",{className:r.regularPriceLine,children:[e.jsx("span",{className:`${r.priceRowAmount} ${h?r.regularPriceDiscounted:""}`,children:Te(P)}),e.jsxs("span",{className:r.priceRowInterval,children:["/ ",W]})]}):null,h?e.jsxs("div",{className:r.campaignPriceLine,children:[e.jsx("span",{className:r.campaignPriceLabel,children:"Founding Offer:"}),e.jsx("span",{className:r.campaignPriceAmount,children:Te($)}),e.jsxs("span",{className:r.campaignPriceInterval,children:["/ ",W]})]}):null]},v)};return e.jsxs("div",{className:r.priceRows,children:[E(t,c,"month"),E(a,p,"year")]})}function Re(t){const a=[t.pricing.month,t.pricing.year].filter(Boolean);if(a.some(p=>p.pricingType==="free"))return 0;const c=a.map(p=>p.pricingType==="stripe"&&typeof p.unitAmount=="number"?p.unitAmount:null).filter(p=>p!=null);return c.length>0?Math.min(...c):Number.POSITIVE_INFINITY}function dn(t){return String(t||"").replace(/[_\-.]+/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function Pe(t,a){const c=t?.[a],p=Number(c);return Number.isFinite(p)?Math.max(1,Math.floor(p)):null}const Ee="Unlimited";function we(t,a){return a!==1?t:t.replace(/\b([A-Za-z]+)ies\b$/,"$1y").replace(/\b([A-Za-z]+[^s\s])s\b$/,"$1")}function mn(t){return t<=1e3?{value:String(t),unit:"MB"}:{value:String(Math.round(t/1e3)),unit:"GB"}}function pn(t,a){const c=String(t.publicLabel||t.label||"").trim()||dn(t.featureKey),p=t.config&&typeof t.config=="object"?t.config:{};if(t.featureKey==="context.uploads"){const l=Pe(p,"storageLimitMb");if(l!==null){const C=mn(l);return{limitValue:C.value,limitUnit:C.unit,baseLabel:we(c,l)}}}if(t.featureKey==="workspace.workspaces"){const l=Pe(p,"maxWorkspaces");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.ai_profiles"){const l=Pe(p,"maxAiProfiles");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.team_management"){const l=Number(a);if(Number.isFinite(l)&&l>0){const C=Math.floor(l);return{limitValue:String(C),limitUnit:null,baseLabel:we(c,C)}}}return{limitValue:null,limitUnit:null,baseLabel:c}}function fn({heading:t,subtitle:a,variant:c="app",theme:p="dark",chrome:l,footer:C,isAuthenticated:E,authSessionResolved:P=!0,currentPlanId:$,currentPlanVersionId:v,currentEntitlementState:h,markCurrentPlan:W,canManageCurrentPlan:G=!0,pricingEndpoint:I,statusBanner:H,onBack:A,backLabel:T,backDisabled:M=!1,topActions:se,shellOwnsScroll:_e=!1,showPageBackButton:X=!0,showHeaderBarWithChrome:re=!1,preferPricingPageTitle:Ce=!0,currentPlanCardActionMode:be="manage",fallbackPricingSource:g=null,onSelectPlan:q}){const[Z,Q]=s.useState([]),[oe,F]=s.useState(null),[x,L]=s.useState({pageTitle:null,pageDescription:null}),[ce,z]=s.useState(!0),[le,ue]=s.useState(null),[Se,ee]=s.useState(0);s.useEffect(()=>{let i=!0;return(async()=>{const D=String(I||"/api/taskforce/public/pricing").trim()||"/api/taskforce/public/pricing";i&&(z(!0),ue(null));try{const w=await fetch(D,{method:"GET",credentials:"include"}),u=await w.json().catch(()=>({}));if(w.ok){i&&(Q(Array.isArray(u?.plans)?u.plans:[]),F(u?.pricingSource&&typeof u.pricingSource=="object"?u.pricingSource:null),L({pageTitle:typeof u?.pageTitle=="string"&&u.pageTitle.trim()||null,pageDescription:typeof u?.pageDescription=="string"&&u.pageDescription.trim()||null}));return}throw new Error(String(u?.error||`Failed to load pricing (${w.status})`))}catch(w){if(i){const u=w instanceof Error?w.message:"Failed to load pricing";ue(u||"Failed to load pricing"),F(null),L({pageTitle:null,pageDescription:null})}}finally{i&&z(!1)}})(),()=>{i=!1}},[I,Se]);const J=s.useMemo(()=>[...Z].sort((i,U)=>{const D=Re(i),w=Re(U);if(D!==w)return D-w;const u=i.defaultVersion?.versionNumber||0,V=U.defaultVersion?.versionNumber||0;return u!==V?u-V:String(i.displayName||i.planId).localeCompare(String(U.displayName||U.planId))}),[Z]),de=s.useMemo(()=>rn(oe||g),[g,oe]),ve=String((Ce?x.pageTitle:null)||t).trim()||t,me=String(x.pageDescription||a||"").trim(),j=s.useMemo(()=>on(me),[me]),te=P,pe=`${r.plansWrapper} ${_e?r.shellOwnsScroll:"tf-scrollbar"} ${c==="site"?r.siteVariant:""} ${l?r.withChrome:""}`.trim(),B=i=>_e?e.jsxs(e.Fragment,{children:[l,i,C]}):e.jsxs("div",{className:Oe.standaloneWrapper,"data-theme":p,children:[l,i,C]});return B(ce?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.loader,children:[e.jsx(Ye,{size:48,className:r.spinner}),e.jsx("p",{children:"Loading plans..."})]})})})}):le?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.emptyState,children:[e.jsx("h2",{children:"Connecting to plan pricing..."}),e.jsx("p",{children:le}),e.jsx("button",{className:r.backBtn,onClick:()=>ee(i=>i+1),children:"Retry"})]})})})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsxs("div",{className:r.contentFrame,children:[e.jsxs("div",{className:r.header,children:[(!l||re)&&(X||se)&&e.jsxs("div",{className:r.headerBar,children:[e.jsx("div",{children:X?e.jsx("button",{className:r.backBtn,onClick:A,disabled:M,children:T}):null}),e.jsx("div",{className:r.headerActions,children:se})]}),e.jsx("h1",{className:r.title,children:ve}),j&&e.jsx("div",{className:r.subtitle,dangerouslySetInnerHTML:{__html:j}}),nn()&&de?e.jsxs("p",{className:r.debugMeta,children:["Pricing source: ",de]}):null,H&&e.jsx("div",{className:`${r.statusBanner} ${H.type==="success"?r.successBanner:H.type==="info"?r.infoBanner:r.errorBanner}`,children:H.message})]}),e.jsxs("section",{className:r.foundingBeta,"aria-labelledby":"founding-beta-heading",children:[e.jsx("h2",{id:"founding-beta-heading",children:"Founding beta"}),e.jsx("p",{children:"Taskforce is in founding beta. You may run into rough edges while we improve cloud workspaces and agent workflows. Early members get access while the product is still forming, plus a direct role in shaping what comes next."})]}),J.length===0?e.jsxs("div",{className:`${r.emptyState} ${r.marketingEmptyState}`,children:[e.jsx("span",{className:r.emptyBadge,children:"Coming Soon"}),e.jsx("h2",{children:"Paid plans are getting their final polish."}),e.jsx("p",{children:"Taskforce pricing is on the way with flexible options for solo operators, teams, and larger rollouts. Check back soon for launch tiers, feature bundles, and early access details."}),e.jsxs("div",{className:r.emptyHighlights,"aria-label":"Upcoming pricing highlights",children:[e.jsx("span",{children:"Launch-ready tiers"}),e.jsx("span",{children:"Team billing controls"}),e.jsx("span",{children:"Feature-based packaging"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:r.grid,children:J.map(i=>{const U=i.pricing.month,D=i.pricing.year,w=i.campaignPricing?.month||null,u=i.campaignPricing?.year||null,V=Le(U,w),K=Le(D,u),Y=O(V.price),ae=O(K.price),ie=Y&&ae,N=String(i.defaultVersion?.planVersionId||"").trim(),xe=ye(h),fe=W??xe,Ne=!!(N&&v&&v===N)||!!(!v&&($&&$===i.planId)),ne=fe&&Ne&&h!=="canceled",n=Y?"month":ae?"year":null,o=n==="year"?K:V,_=be==="manage",f=be==="indicator",y=te&&!!N&&(ne?_&&G:!!n),m=()=>{if(N){if(ne){if(!_||!G)return;q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0});return}n&&q({planId:i.planId,planVersionId:N,interval:n,pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!1})}};return e.jsxs("div",{className:`${r.planCard} ${ne?r.activePlanCard:""} ${y?r.clickablePlanCard:""}`,"data-testid":`plan-card-${i.planId}`,role:y?"button":void 0,tabIndex:y?0:void 0,onClick:y?m:void 0,onKeyDown:y?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),m())}:void 0,children:[ne&&e.jsx("span",{className:r.currentBadge,children:"Current Plan"}),e.jsx("h3",{className:r.planName,children:i.displayName}),un(U,D,w,u),String(i.description||"").trim()&&e.jsx("p",{className:r.planDescription,children:String(i.description||"").trim()}),e.jsx("div",{className:r.featuresList,children:Array.isArray(i.features)&&i.features.length>0?i.features.map((d,S)=>e.jsxs("div",{className:r.featureItem,children:[e.jsx(ze,{className:r.featureIcon}),e.jsxs("div",{className:r.featureTextBlock,children:[(()=>{const{limitValue:k,limitUnit:b,baseLabel:R}=pn(d,i.defaultVersion?.seatLimit);return e.jsxs("span",{className:r.featureText,children:[k&&e.jsxs("span",{className:r.featureLimitAccent,children:[e.jsx("span",{children:k}),b?e.jsx("span",{className:r.featureLimitUnit,children:b}):null]}),e.jsx("span",{children:k?` ${R}`:R})]})})(),d.publicDescriptionVisible!==!1&&String(d.publicDescription||d.description||"").trim()&&e.jsx("span",{className:r.featureDescription,children:String(d.publicDescription||d.description||"").trim()})]})]},`${d.featureKey}-${S}`)):e.jsx("span",{className:r.featureText,children:"No additional features included"})}),ne?_?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-manage-${i.planId}`,onClick:d=>{d.stopPropagation(),G&&q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0})},disabled:!N||!G||!te,children:E&&G?"Manage Plan":"Current Plan"}):f?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-current-${i.planId}`,disabled:!0,children:"Current Plan"}):null:e.jsxs("div",{className:r.ctaRow,children:[Y?e.jsx("button",{className:`${r.callToAction} ${r.secondaryCta}`,"data-testid":`plan-select-${i.planId}-month`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"month",pricingType:V.price?.pricingType||"stripe",pricingAudience:V.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Monthly":"Get Started"}):null,ae?e.jsx("button",{className:`${r.callToAction} ${r.primaryCta}`,"data-testid":`plan-select-${i.planId}-year`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"year",pricingType:K.price?.pricingType||"stripe",pricingAudience:K.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Yearly":"Get Started"}):null]})]},i.planId)})}),e.jsxs("div",{className:r.pricingNotes,children:[e.jsx("p",{children:"Prices are listed in USD. Taxes may apply."}),e.jsx("p",{children:"Local install is free on every plan. Cloud limits apply only to hosted workspaces."})]}),e.jsxs("section",{className:`${r.foundingBeta} ${r.cloudCapacityNote}`,"aria-labelledby":"cloud-capacity-heading",children:[e.jsx("h2",{id:"cloud-capacity-heading",children:"Need more cloud capacity?"}),e.jsx("p",{children:"Pro users can request expanded limits for cloud workspaces, AI agents, and storage."}),e.jsxs("p",{children:["Contact ",e.jsx("a",{href:"mailto:support@taskforcehq.ai",children:"support@taskforcehq.ai"})," to discuss capacity needs."]})]}),e.jsxs("div",{className:`${r.planCard} ${r.planNoticeCard} ${r.teamComingSoonCard}`,children:[e.jsx("h2",{className:r.planName,children:"Team workspaces are coming soon."}),e.jsx("p",{className:r.planDescription,children:"Shared workspaces, collaborators, team agent rosters, admin controls, and larger cloud limits are in development."})]})]})]})})}))}const gn=1600,Be=[0,500,1e3,2e3],hn=5e3,yn=45e3,_n="Choose a plan to continue.";function Cn(t,a){if(t===401)return!0;const c=String(a||"").trim().toUpperCase();return c==="CHECKOUT_SESSION_INCOMPLETE"||c==="CHECKOUT_PLAN_VERSION_UNRESOLVED"}function bn(t){return t==="year"?"year":"month"}function Sn(t){return t==="campaign"?"campaign":"public"}function Ie(t){const a=String(t||"").trim().toLowerCase();return a==="year"?"year":a==="month"?"month":null}function $e(t){const a=String(t||"").trim();return a?a.replace(/\/+$/,""):""}function Ae(t={}){const a=new URLSearchParams;a.set("screen","plans");for(const[c,p]of Object.entries(t)){const l=String(p||"").trim();l&&a.set(c,l)}return`/?${a.toString()}`}function Tn({isAuthenticated:t,authUserId:a,runtimeMode:c,authSessionResolved:p,currentTheme:l="dark",projectName:C,currentWorkspaceId:E,apiBaseUrl:P,connectedEnvironmentSource:$,resolveCloudAuthUrl:v,embedded:h=!1,shellOwnsScroll:W=!1,onAccountProfileSummaryChange:G,onContinueToTaskforce:I,continueBusy:H=!1}){const A=Ge(),T=Qe(),[M,se]=s.useState(null),[_e,X]=s.useState(!1),[re,Ce]=s.useState(!1),[be,g]=s.useState(null),q=s.useRef(!1),Z=s.useRef(null),Q=s.useRef(null),oe=s.useRef(I),F=s.useMemo(()=>new URLSearchParams(T.search),[T.search]),x=String(F.get("checkout")||"").trim().toLowerCase(),L=String(F.get("gate")||"").trim().toLowerCase(),ce=String(F.get("planId")||"").trim(),z=String(F.get("planVersionId")||"").trim(),le=bn(F.get("interval")),ue=Sn(F.get("pricingAudience")),Se=Ie(F.get("interval")),ee=String(F.get("session_id")||"").trim(),J=s.useMemo(()=>$e(P),[P]),de=s.useMemo(()=>$e($),[$]),ve=s.useMemo(()=>({environment:Ke(de||J),runtimeMode:c==="cloud"?"cloud":"local"}),[J,de,c]),me=s.useCallback(n=>{const o=String(n||"").trim();return J?`${J}${o.startsWith("/")?o:`/${o}`}`:o},[J]),j=s.useCallback(n=>v?v(n):me(n),[me,v]),te=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("screen"),n.delete("gate"),n.delete("checkout"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval"),n.delete("pricingAudience");const o=n.toString();A(`/${o?`?${o}`:""}${T.hash||""}`)},[T.hash,T.search,A]),pe=s.useMemo(()=>j("/api/taskforce/public/pricing"),[j]),B=s.useMemo(()=>ke(M,L),[M,L]),i=s.useMemo(()=>B.allowReturnToApp,[B.allowReturnToApp]),U=s.useMemo(()=>{const n=String(B.message||"").trim();return!n||n===_n?null:n},[B.message]),D=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("checkout"),n.delete("session_id"),n.delete("gate"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval");const o=n.toString();A(`${T.pathname}${o?`?${o}`:""}${T.hash||""}`,{replace:!0})},[T.hash,T.pathname,T.search,A]),w=s.useCallback(()=>{Q.current!=null&&window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{D(),Q.current=null},gn)},[D]);s.useEffect(()=>{oe.current=I},[I]);const u=s.useCallback(async n=>{const o=j(ge);if(!t)return se(null),he(o,{identityKey:a}),null;try{const _=await He(o,{identityKey:a,force:n?.force===!0});return se(_),G?.(_),_}catch{return null}},[a,j,t,G]),V=s.useCallback((n,o,_)=>{const f=String(o||"").trim();if(_?.preferFallback&&f)return f;const y=ke(n,L).message;return y||f||"Unable to confirm checkout completion."},[L]),K=s.useCallback((n,o)=>!ke(n,o).allowReturnToApp,[]),Y=s.useCallback(async(n,o,_="public",f)=>{if(!n){g({type:"error",message:"Selected plan is missing a default plan version."});return}X(!0),g(null);try{const y=await fetch(j("/api/taskforce/billing/checkout-session"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({planVersionId:n,interval:o,pricingAudience:_})}),m=await y.json().catch(()=>({}));if(!y.ok){g({type:"error",message:String(m?.error||"Unable to start checkout for selected plan.")});return}const d=String(m?.checkoutState||"").trim().toLowerCase();if(d==="free"){g({type:"success",message:"Plan selected. Your access is ready."}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="updated"){g({type:"success",message:String(m?.message||"Your subscription was updated successfully.")}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="already_current_plan"){g({type:"success",message:String(m?.message||"You are already on this plan.")}),he(j(ge),{identityKey:a}),await u();return}const S=String(m?.returnBaseUrl||"").trim();if(c==="local"&&S)try{const b=window.location.origin,R=new URL(S,b).origin;if(R!==b){g({type:"error",message:`Checkout return is misconfigured for this runtime. Expected ${b} but got ${R}.`});return}}catch{g({type:"error",message:"Checkout return URL is invalid for this runtime."});return}const k=String(m?.url||"").trim();if(!k){g({type:"error",message:"Checkout did not return a redirect URL."});return}window.location.assign(k)}catch{g({type:"error",message:"Unable to start checkout for selected plan."})}finally{X(!1)}},[a,j,u,I,c]),ae=s.useCallback(async(n,o)=>{if(!n)return{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1};const _=async()=>{he(j(ge),{identityKey:a});const f=await u({force:!0}),y=String(f?.entitlementState||"").trim().toLowerCase();if(!ye(y))return!1;const m=ce,d=z,S=Se,k=String(f?.planId||"").trim(),b=String(f?.planVersionId||"").trim(),R=Ie(f?.billingInterval??null),je=o?.preConfirmationSummary??null,Me=String(je?.entitlementState||"").trim().toLowerCase(),Ue=ye(Me),De=String(je?.planId||"").trim(),Fe=String(je?.planVersionId||"").trim(),Ve=Ie(je?.billingInterval??null);return m&&k&&k!==m||d&&b&&b!==d||S&&R&&R!==S||Ue&&!(!!m&&k===m&&De!==k)&&!(!!d&&b===d&&Fe!==b)&&!(!!S&&R===S&&Ve!==R)?!1:(o?.autoContinueOnActivation===!0&&await oe.current?.(),!0)};try{const f=await fetch(j("/api/taskforce/billing/checkout-session/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n})}),y=await f.json().catch(()=>({}));if(!f.ok){const m=String(y?.code||"").trim(),d=Cn(f.status,m);return d&&await _()?{confirmed:!0}:{confirmed:!1,errorMessage:String(y?.error||"Unable to confirm checkout completion."),retryable:d}}return await _()?{confirmed:!0}:{confirmed:!0}}catch{return{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}}},[a,j,u,Se,ce,z]),ie=s.useCallback(async()=>{if(!t){A(`/login?mode=login&next=${encodeURIComponent(Ae())}`);return}X(!0),g({type:"info",message:"Opening billing portal..."});try{const n=await fetch(j("/api/taskforce/billing/portal-session"),{method:"POST",credentials:"include"}),o=await n.json().catch(()=>({}));if(!n.ok){g({type:"error",message:String(o?.error||"Failed to open billing portal.")});return}const _=String(o?.url||"").trim();if(!_){g({type:"error",message:"Portal session did not return a redirect URL."});return}window.location.assign(_)}catch{g({type:"error",message:"Failed to open billing portal."})}finally{X(!1)}},[j,t,A]),N=s.useCallback(async()=>{if(!(!I||re||H)){Ce(!0);try{await I()}finally{Ce(!1)}}},[re,H,I]);s.useEffect(()=>{u()},[u]),s.useEffect(()=>{i&&L==="missing_entitlement"&&D()},[D,L,i]),s.useEffect(()=>()=>{Q.current!=null&&window.clearTimeout(Q.current)},[]),s.useEffect(()=>{x!=="success"&&(Z.current=null)},[x]),s.useEffect(()=>{let n=!1;const o=new Set,_=async f=>{f<=0||await new Promise(y=>{const m=window.setTimeout(()=>{o.delete(m),y()},f);o.add(m)})};if(x==="success"){if(q.current=!0,g({type:"success",message:"Checkout completed successfully. Finalizing your plan..."}),!t&&!p)return()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};if(!t)return g({type:"error",message:"Sign in to finish activating your plan."}),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};const y=ee||"__missing_session__";return Z.current===y?()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()}:((async()=>{const m=Date.now(),d=await u({force:!0});if(n)return;let S=ee?{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}:{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},k=0;for(;;){const b=k<Be.length?Be[k]:hn;if(k+=1,await _(b),n||(S=ee?await ae(ee,{autoContinueOnActivation:K(d,L),preConfirmationSummary:d}):{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},n))return;if(S.confirmed){Z.current=y,g({type:"success",message:"Checkout completed successfully."}),w();return}if(!S.retryable||Date.now()-m>=yn)break}if(!n&&!S.confirmed){const b=await u({force:!0});if(n)return;S.retryable||(Z.current=y),g({type:"error",message:V(b,S.errorMessage,{preferFallback:!S.retryable})}),S.retryable||w();return}})(),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()})}if(x==="cancel"){(async()=>{const f=await u({force:!0});g({type:"error",message:V(f,"Checkout was canceled. No charge was made.")}),w()})();return}if((x==="start"||x==="free")&&t&&z&&!q.current){q.current=!0,(async()=>{const f=await u({force:!0});await Y(z,le,ue,{autoContinueOnActivation:K(f,L)})})();return}},[p,x,ae,L,t,u,le,z,ue,ee,V,w,K,Y]),s.useEffect(()=>{if(!(x==="success"||x==="cancel"||x==="start"||x==="free")){if(U){g({type:B.statusTone,message:U});return}g(n=>!n||n.type!=="error"?n:n.message===B.message?null:n)}},[x,U,B.message,B.statusTone]);const xe=s.useCallback(async n=>{if(!t){const _=n.pricingType==="free"?"free":"start",f=Ae({checkout:_,planId:n.planId,planVersionId:n.planVersionId,interval:n.interval,pricingAudience:n.pricingAudience});A(`/login?mode=register&planId=${encodeURIComponent(n.planId)}&planVersionId=${encodeURIComponent(n.planVersionId)}&interval=${encodeURIComponent(n.interval)}&pricingAudience=${encodeURIComponent(n.pricingAudience)}&next=${encodeURIComponent(f)}`);return}if(n.isCurrentPlan){if(!M?.stripeCustomerId){g({type:"success",message:"Your current plan does not use Stripe billing."});return}await ie();return}const o=K(M,L);if(n.pricingType==="free"){await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o});return}await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o})},[M,L,t,A,ie,K,Y]),fe=s.useCallback(()=>{if(i&&I){N();return}if(h){te();return}if(window.history.length>1){A(-1);return}A("/")},[te,h,N,i,A,I]),Ne=h?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{className:r.navAction,onClick:fe,disabled:H||re||t&&!i,children:i?"Take Me to Taskforce":"Back"}),t&&M?.stripeCustomerId&&e.jsx("button",{className:r.navAction,onClick:()=>{ie()},disabled:_e,children:"Manage billing"}),!t&&e.jsxs("button",{className:r.navAction,onClick:()=>A(`/login?mode=login&next=${encodeURIComponent(Ae())}`),children:[e.jsx(We,{size:16,style:{marginRight:"8px",verticalAlign:"text-bottom"}}),"Sign In"]})]}),ne=h?null:e.jsx(qe,{projectName:C,currentWorkspaceId:E,runtimeMode:c==="cloud"?"cloud":"local",theme:l,onBrandClick:fe,actions:Ne});return e.jsx(fn,{chrome:ne,heading:"Subscription Plans",subtitle:"Manage your subscription and explore available features. Your current plan is highlighted below.",variant:"site",theme:l,isAuthenticated:t,authSessionResolved:p,currentPlanId:String(M?.planId||ce||"").trim()||null,currentPlanVersionId:String(M?.planVersionId||z||"").trim()||null,currentEntitlementState:String(M?.entitlementState||"").trim()||null,markCurrentPlan:B.markCurrentPlan,canManageCurrentPlan:!!M?.stripeCustomerId,pricingEndpoint:pe,statusBanner:be,onBack:fe,backLabel:i?"Take Me to Taskforce":h?"Back to Board":"Back to App",backDisabled:H||re||t&&!i,topActions:null,shellOwnsScroll:W,showPageBackButton:!1,showHeaderBarWithChrome:!1,currentPlanCardActionMode:"manage",fallbackPricingSource:ve,onSelectPlan:xe})}export{Tn as PlansPage};
|
|
1
|
+
import{r as s,j as e}from"./vendor-react-CKJs5o3c.js";import{aO as ye,t as Oe,aP as Ke,aQ as ke,aR as ge,aS as he,aT as He,aU as qe}from"./index-GHJgcW3j.js";import{bn as ze,w as Ye,K as We}from"./vendor-icons-Bsq-mcEn.js";import{u as Ge,a as Qe}from"./vendor-router-AqJMU8Lz.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";const Je="_plansWrapper_ojftl_1",Xe="_contentFrame_ojftl_24",Ze="_shellOwnsScroll_ojftl_32",et="_withChrome_ojftl_38",tt="_siteVariant_ojftl_42",nt="_title_ojftl_56",rt="_subtitle_ojftl_71",at="_header_ojftl_78",it="_planCard_ojftl_93",st="_grid_ojftl_106",ot="_pricingNotes_ojftl_114",ct="_planName_ojftl_123",lt="_featureText_ojftl_130",ut="_currentBadge_ojftl_134",dt="_navAction_ojftl_138",mt="_backBtn_ojftl_139",pt="_priceRows_ojftl_150",ft="_foundingBeta_ojftl_154",gt="_cloudCapacityNote_ojftl_176",ht="_headerBar_ojftl_258",yt="_headerActions_ojftl_267",_t="_debugMeta_ojftl_318",Ct="_planNoticeCard_ojftl_381",bt="_planDescription_ojftl_392",St="_teamComingSoonCard_ojftl_397",jt="_clickablePlanCard_ojftl_416",wt="_activePlanCard_ojftl_431",vt="_callToAction_ojftl_495",xt="_primaryCta_ojftl_507",Nt="_secondaryCta_ojftl_518",kt="_currentCta_ojftl_530",Pt="_featuresList_ojftl_544",It="_priceRow_ojftl_150",At="_regularPriceLine_ojftl_568",Tt="_campaignPriceLine_ojftl_569",Lt="_priceRowWithCampaign_ojftl_576",Rt="_priceRowAmount_ojftl_580",Et="_regularPriceDiscounted_ojftl_586",Bt="_priceRowInterval_ojftl_592",$t="_campaignPriceLabel_ojftl_601",Mt="_campaignPriceAmount_ojftl_606",Ut="_campaignPriceInterval_ojftl_612",Dt="_ctaRow_ojftl_617",Ft="_featureItem_ojftl_623",Vt="_featureIcon_ojftl_629",Ot="_featureLimitAccent_ojftl_643",Kt="_featureLimitUnit_ojftl_654",Ht="_featureTextBlock_ojftl_660",qt="_featureDescription_ojftl_666",zt="_emptyState_ojftl_672",Yt="_marketingEmptyState_ojftl_681",Wt="_emptyBadge_ojftl_715",Gt="_emptyHighlights_ojftl_730",Qt="_loader_ojftl_752",Jt="_spinner_ojftl_762",Xt="_statusBanner_ojftl_815",Zt="_successBanner_ojftl_823",en="_infoBanner_ojftl_829",tn="_errorBanner_ojftl_835",r={plansWrapper:Je,contentFrame:Xe,shellOwnsScroll:Ze,withChrome:et,siteVariant:tt,title:nt,subtitle:rt,header:at,planCard:it,grid:st,pricingNotes:ot,planName:ct,featureText:lt,currentBadge:ut,navAction:dt,backBtn:mt,priceRows:pt,foundingBeta:ft,cloudCapacityNote:gt,headerBar:ht,headerActions:yt,debugMeta:_t,planNoticeCard:Ct,planDescription:bt,teamComingSoonCard:St,clickablePlanCard:jt,activePlanCard:wt,callToAction:vt,primaryCta:xt,secondaryCta:Nt,currentCta:kt,featuresList:Pt,priceRow:It,regularPriceLine:At,campaignPriceLine:Tt,priceRowWithCampaign:Lt,priceRowAmount:Rt,regularPriceDiscounted:Et,priceRowInterval:Bt,campaignPriceLabel:$t,campaignPriceAmount:Mt,campaignPriceInterval:Ut,ctaRow:Dt,featureItem:Ft,featureIcon:Vt,featureLimitAccent:Ot,featureLimitUnit:Kt,featureTextBlock:Ht,featureDescription:qt,emptyState:zt,marketingEmptyState:Yt,emptyBadge:Wt,emptyHighlights:Gt,loader:Qt,spinner:Jt,statusBanner:Xt,successBanner:Zt,infoBanner:en,errorBanner:tn};function nn(){const t=globalThis.__DEBUG_MODE__;return typeof t=="boolean"?t:!1}function rn(t){const a=String(t?.environment||"").trim(),c=String(t?.runtimeMode||"").trim();return!a&&!c?null:a&&c?`${a} (${c})`:a||c||null}const an=new Set(["a","b","br","em","i","li","ol","p","strong","u","ul"]);function sn(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function on(t){const a=String(t||"").trim();if(!a)return"";if(typeof document>"u")return sn(a);const c=document.createElement("template");c.innerHTML=a;const p=document.createElement("div"),l=C=>{if(C.nodeType===Node.TEXT_NODE)return document.createTextNode(C.textContent||"");if(C.nodeType!==Node.ELEMENT_NODE)return null;const E=C,P=E.tagName.toLowerCase();if(P==="script"||P==="style")return null;const $=Array.from(E.childNodes).map(l).filter(h=>!!h);if(!an.has(P)){const h=document.createDocumentFragment();for(const W of $)h.appendChild(W);return h}const v=document.createElement(P);if(P==="a"){const h=String(E.getAttribute("href")||"").trim();/^(https?:|mailto:|\/|#)/i.test(h)&&(v.setAttribute("href",h),v.setAttribute("rel","noopener noreferrer"))}for(const h of $)v.appendChild(h);return v};for(const C of Array.from(c.content.childNodes)){const E=l(C);E&&p.appendChild(E)}return p.innerHTML}function cn(t,a){if(t==null||!a)return"Contact Sales";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:a.toUpperCase(),minimumFractionDigits:0}).format(t/100)}catch{return`${a.toUpperCase()} ${t/100}`}}function ln(){return"$0"}function O(t){return t?t.pricingType==="free"?!0:t.unitAmount!=null&&t.currency!=null:!1}function Te(t){return t?t.pricingType==="free"?ln():cn(t.unitAmount,t.currency):"Unavailable"}function Le(t,a){return O(a)?{price:a,pricingAudience:"campaign"}:{price:t,pricingAudience:"public"}}function un(t,a,c,p){const l=O(t)||O(c),C=O(a)||O(p);if(!l&&!C)return null;const E=(P,$,v)=>{if(!O(P)&&!O($))return null;const h=O($),W=v==="year"?"year":"month";return e.jsxs("div",{className:`${r.priceRow} ${h?r.priceRowWithCampaign:""}`,children:[O(P)?e.jsxs("div",{className:r.regularPriceLine,children:[e.jsx("span",{className:`${r.priceRowAmount} ${h?r.regularPriceDiscounted:""}`,children:Te(P)}),e.jsxs("span",{className:r.priceRowInterval,children:["/ ",W]})]}):null,h?e.jsxs("div",{className:r.campaignPriceLine,children:[e.jsx("span",{className:r.campaignPriceLabel,children:"Founding Offer:"}),e.jsx("span",{className:r.campaignPriceAmount,children:Te($)}),e.jsxs("span",{className:r.campaignPriceInterval,children:["/ ",W]})]}):null]},v)};return e.jsxs("div",{className:r.priceRows,children:[E(t,c,"month"),E(a,p,"year")]})}function Re(t){const a=[t.pricing.month,t.pricing.year].filter(Boolean);if(a.some(p=>p.pricingType==="free"))return 0;const c=a.map(p=>p.pricingType==="stripe"&&typeof p.unitAmount=="number"?p.unitAmount:null).filter(p=>p!=null);return c.length>0?Math.min(...c):Number.POSITIVE_INFINITY}function dn(t){return String(t||"").replace(/[_\-.]+/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function Pe(t,a){const c=t?.[a],p=Number(c);return Number.isFinite(p)?Math.max(1,Math.floor(p)):null}const Ee="Unlimited";function we(t,a){return a!==1?t:t.replace(/\b([A-Za-z]+)ies\b$/,"$1y").replace(/\b([A-Za-z]+[^s\s])s\b$/,"$1")}function mn(t){return t<=1e3?{value:String(t),unit:"MB"}:{value:String(Math.round(t/1e3)),unit:"GB"}}function pn(t,a){const c=String(t.publicLabel||t.label||"").trim()||dn(t.featureKey),p=t.config&&typeof t.config=="object"?t.config:{};if(t.featureKey==="context.uploads"){const l=Pe(p,"storageLimitMb");if(l!==null){const C=mn(l);return{limitValue:C.value,limitUnit:C.unit,baseLabel:we(c,l)}}}if(t.featureKey==="workspace.workspaces"){const l=Pe(p,"maxWorkspaces");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.ai_profiles"){const l=Pe(p,"maxAiProfiles");if(l!==null)return{limitValue:String(l),limitUnit:null,baseLabel:we(c,l)};if(t.access!=="disabled")return{limitValue:Ee,limitUnit:null,baseLabel:c}}if(t.featureKey==="collaboration.team_management"){const l=Number(a);if(Number.isFinite(l)&&l>0){const C=Math.floor(l);return{limitValue:String(C),limitUnit:null,baseLabel:we(c,C)}}}return{limitValue:null,limitUnit:null,baseLabel:c}}function fn({heading:t,subtitle:a,variant:c="app",theme:p="dark",chrome:l,footer:C,isAuthenticated:E,authSessionResolved:P=!0,currentPlanId:$,currentPlanVersionId:v,currentEntitlementState:h,markCurrentPlan:W,canManageCurrentPlan:G=!0,pricingEndpoint:I,statusBanner:H,onBack:A,backLabel:T,backDisabled:M=!1,topActions:se,shellOwnsScroll:_e=!1,showPageBackButton:X=!0,showHeaderBarWithChrome:re=!1,preferPricingPageTitle:Ce=!0,currentPlanCardActionMode:be="manage",fallbackPricingSource:g=null,onSelectPlan:q}){const[Z,Q]=s.useState([]),[oe,F]=s.useState(null),[x,L]=s.useState({pageTitle:null,pageDescription:null}),[ce,z]=s.useState(!0),[le,ue]=s.useState(null),[Se,ee]=s.useState(0);s.useEffect(()=>{let i=!0;return(async()=>{const D=String(I||"/api/taskforce/public/pricing").trim()||"/api/taskforce/public/pricing";i&&(z(!0),ue(null));try{const w=await fetch(D,{method:"GET",credentials:"include"}),u=await w.json().catch(()=>({}));if(w.ok){i&&(Q(Array.isArray(u?.plans)?u.plans:[]),F(u?.pricingSource&&typeof u.pricingSource=="object"?u.pricingSource:null),L({pageTitle:typeof u?.pageTitle=="string"&&u.pageTitle.trim()||null,pageDescription:typeof u?.pageDescription=="string"&&u.pageDescription.trim()||null}));return}throw new Error(String(u?.error||`Failed to load pricing (${w.status})`))}catch(w){if(i){const u=w instanceof Error?w.message:"Failed to load pricing";ue(u||"Failed to load pricing"),F(null),L({pageTitle:null,pageDescription:null})}}finally{i&&z(!1)}})(),()=>{i=!1}},[I,Se]);const J=s.useMemo(()=>[...Z].sort((i,U)=>{const D=Re(i),w=Re(U);if(D!==w)return D-w;const u=i.defaultVersion?.versionNumber||0,V=U.defaultVersion?.versionNumber||0;return u!==V?u-V:String(i.displayName||i.planId).localeCompare(String(U.displayName||U.planId))}),[Z]),de=s.useMemo(()=>rn(oe||g),[g,oe]),ve=String((Ce?x.pageTitle:null)||t).trim()||t,me=String(x.pageDescription||a||"").trim(),j=s.useMemo(()=>on(me),[me]),te=P,pe=`${r.plansWrapper} ${_e?r.shellOwnsScroll:"tf-scrollbar"} ${c==="site"?r.siteVariant:""} ${l?r.withChrome:""}`.trim(),B=i=>_e?e.jsxs(e.Fragment,{children:[l,i,C]}):e.jsxs("div",{className:Oe.standaloneWrapper,"data-theme":p,children:[l,i,C]});return B(ce?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.loader,children:[e.jsx(Ye,{size:48,className:r.spinner}),e.jsx("p",{children:"Loading plans..."})]})})})}):le?e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsx("div",{className:r.contentFrame,children:e.jsxs("div",{className:r.emptyState,children:[e.jsx("h2",{children:"Connecting to plan pricing..."}),e.jsx("p",{children:le}),e.jsx("button",{className:r.backBtn,onClick:()=>ee(i=>i+1),children:"Retry"})]})})})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:pe,children:e.jsxs("div",{className:r.contentFrame,children:[e.jsxs("div",{className:r.header,children:[(!l||re)&&(X||se)&&e.jsxs("div",{className:r.headerBar,children:[e.jsx("div",{children:X?e.jsx("button",{className:r.backBtn,onClick:A,disabled:M,children:T}):null}),e.jsx("div",{className:r.headerActions,children:se})]}),e.jsx("h1",{className:r.title,children:ve}),j&&e.jsx("div",{className:r.subtitle,dangerouslySetInnerHTML:{__html:j}}),nn()&&de?e.jsxs("p",{className:r.debugMeta,children:["Pricing source: ",de]}):null,H&&e.jsx("div",{className:`${r.statusBanner} ${H.type==="success"?r.successBanner:H.type==="info"?r.infoBanner:r.errorBanner}`,children:H.message})]}),e.jsxs("section",{className:r.foundingBeta,"aria-labelledby":"founding-beta-heading",children:[e.jsx("h2",{id:"founding-beta-heading",children:"Founding beta"}),e.jsx("p",{children:"Taskforce is in founding beta. You may run into rough edges while we improve cloud workspaces and agent workflows. Early members get access while the product is still forming, plus a direct role in shaping what comes next."})]}),J.length===0?e.jsxs("div",{className:`${r.emptyState} ${r.marketingEmptyState}`,children:[e.jsx("span",{className:r.emptyBadge,children:"Coming Soon"}),e.jsx("h2",{children:"Paid plans are getting their final polish."}),e.jsx("p",{children:"Taskforce pricing is on the way with flexible options for solo operators, teams, and larger rollouts. Check back soon for launch tiers, feature bundles, and early access details."}),e.jsxs("div",{className:r.emptyHighlights,"aria-label":"Upcoming pricing highlights",children:[e.jsx("span",{children:"Launch-ready tiers"}),e.jsx("span",{children:"Team billing controls"}),e.jsx("span",{children:"Feature-based packaging"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:r.grid,children:J.map(i=>{const U=i.pricing.month,D=i.pricing.year,w=i.campaignPricing?.month||null,u=i.campaignPricing?.year||null,V=Le(U,w),K=Le(D,u),Y=O(V.price),ae=O(K.price),ie=Y&&ae,N=String(i.defaultVersion?.planVersionId||"").trim(),xe=ye(h),fe=W??xe,Ne=!!(N&&v&&v===N)||!!(!v&&($&&$===i.planId)),ne=fe&&Ne&&h!=="canceled",n=Y?"month":ae?"year":null,o=n==="year"?K:V,_=be==="manage",f=be==="indicator",y=te&&!!N&&(ne?_&&G:!!n),m=()=>{if(N){if(ne){if(!_||!G)return;q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0});return}n&&q({planId:i.planId,planVersionId:N,interval:n,pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!1})}};return e.jsxs("div",{className:`${r.planCard} ${ne?r.activePlanCard:""} ${y?r.clickablePlanCard:""}`,"data-testid":`plan-card-${i.planId}`,role:y?"button":void 0,tabIndex:y?0:void 0,onClick:y?m:void 0,onKeyDown:y?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),m())}:void 0,children:[ne&&e.jsx("span",{className:r.currentBadge,children:"Current Plan"}),e.jsx("h3",{className:r.planName,children:i.displayName}),un(U,D,w,u),String(i.description||"").trim()&&e.jsx("p",{className:r.planDescription,children:String(i.description||"").trim()}),e.jsx("div",{className:r.featuresList,children:Array.isArray(i.features)&&i.features.length>0?i.features.map((d,S)=>e.jsxs("div",{className:r.featureItem,children:[e.jsx(ze,{className:r.featureIcon}),e.jsxs("div",{className:r.featureTextBlock,children:[(()=>{const{limitValue:k,limitUnit:b,baseLabel:R}=pn(d,i.defaultVersion?.seatLimit);return e.jsxs("span",{className:r.featureText,children:[k&&e.jsxs("span",{className:r.featureLimitAccent,children:[e.jsx("span",{children:k}),b?e.jsx("span",{className:r.featureLimitUnit,children:b}):null]}),e.jsx("span",{children:k?` ${R}`:R})]})})(),d.publicDescriptionVisible!==!1&&String(d.publicDescription||d.description||"").trim()&&e.jsx("span",{className:r.featureDescription,children:String(d.publicDescription||d.description||"").trim()})]})]},`${d.featureKey}-${S}`)):e.jsx("span",{className:r.featureText,children:"No additional features included"})}),ne?_?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-manage-${i.planId}`,onClick:d=>{d.stopPropagation(),G&&q({planId:i.planId,planVersionId:N,interval:n||"month",pricingType:o.price?.pricingType||"stripe",pricingAudience:o.pricingAudience,isCurrentPlan:!0})},disabled:!N||!G||!te,children:E&&G?"Manage Plan":"Current Plan"}):f?e.jsx("button",{className:`${r.callToAction} ${r.currentCta}`,"data-testid":`plan-current-${i.planId}`,disabled:!0,children:"Current Plan"}):null:e.jsxs("div",{className:r.ctaRow,children:[Y?e.jsx("button",{className:`${r.callToAction} ${r.secondaryCta}`,"data-testid":`plan-select-${i.planId}-month`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"month",pricingType:V.price?.pricingType||"stripe",pricingAudience:V.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Monthly":"Get Started"}):null,ae?e.jsx("button",{className:`${r.callToAction} ${r.primaryCta}`,"data-testid":`plan-select-${i.planId}-year`,onClick:d=>{d.stopPropagation(),q({planId:i.planId,planVersionId:N,interval:"year",pricingType:K.price?.pricingType||"stripe",pricingAudience:K.pricingAudience,isCurrentPlan:!1})},disabled:!N||!te,children:ie?"Start Yearly":"Get Started"}):null]})]},i.planId)})}),e.jsxs("div",{className:r.pricingNotes,children:[e.jsx("p",{children:"Prices are listed in USD. Taxes may apply."}),e.jsx("p",{children:"Local install is free on every plan. Cloud limits apply only to hosted workspaces."})]}),e.jsxs("section",{className:`${r.foundingBeta} ${r.cloudCapacityNote}`,"aria-labelledby":"cloud-capacity-heading",children:[e.jsx("h2",{id:"cloud-capacity-heading",children:"Need more cloud capacity?"}),e.jsx("p",{children:"Pro users can request expanded limits for cloud workspaces, AI agents, and storage."}),e.jsxs("p",{children:["Contact ",e.jsx("a",{href:"mailto:support@taskforcehq.ai",children:"support@taskforcehq.ai"})," to discuss capacity needs."]})]}),e.jsxs("div",{className:`${r.planCard} ${r.planNoticeCard} ${r.teamComingSoonCard}`,children:[e.jsx("h2",{className:r.planName,children:"Team workspaces are coming soon."}),e.jsx("p",{className:r.planDescription,children:"Shared workspaces, collaborators, team agent rosters, admin controls, and larger cloud limits are in development."})]})]})]})})}))}const gn=1600,Be=[0,500,1e3,2e3],hn=5e3,yn=45e3,_n="Choose a plan to continue.";function Cn(t,a){if(t===401)return!0;const c=String(a||"").trim().toUpperCase();return c==="CHECKOUT_SESSION_INCOMPLETE"||c==="CHECKOUT_PLAN_VERSION_UNRESOLVED"}function bn(t){return t==="year"?"year":"month"}function Sn(t){return t==="campaign"?"campaign":"public"}function Ie(t){const a=String(t||"").trim().toLowerCase();return a==="year"?"year":a==="month"?"month":null}function $e(t){const a=String(t||"").trim();return a?a.replace(/\/+$/,""):""}function Ae(t={}){const a=new URLSearchParams;a.set("screen","plans");for(const[c,p]of Object.entries(t)){const l=String(p||"").trim();l&&a.set(c,l)}return`/?${a.toString()}`}function Tn({isAuthenticated:t,authUserId:a,runtimeMode:c,authSessionResolved:p,currentTheme:l="dark",projectName:C,currentWorkspaceId:E,apiBaseUrl:P,connectedEnvironmentSource:$,resolveCloudAuthUrl:v,embedded:h=!1,shellOwnsScroll:W=!1,onAccountProfileSummaryChange:G,onContinueToTaskforce:I,continueBusy:H=!1}){const A=Ge(),T=Qe(),[M,se]=s.useState(null),[_e,X]=s.useState(!1),[re,Ce]=s.useState(!1),[be,g]=s.useState(null),q=s.useRef(!1),Z=s.useRef(null),Q=s.useRef(null),oe=s.useRef(I),F=s.useMemo(()=>new URLSearchParams(T.search),[T.search]),x=String(F.get("checkout")||"").trim().toLowerCase(),L=String(F.get("gate")||"").trim().toLowerCase(),ce=String(F.get("planId")||"").trim(),z=String(F.get("planVersionId")||"").trim(),le=bn(F.get("interval")),ue=Sn(F.get("pricingAudience")),Se=Ie(F.get("interval")),ee=String(F.get("session_id")||"").trim(),J=s.useMemo(()=>$e(P),[P]),de=s.useMemo(()=>$e($),[$]),ve=s.useMemo(()=>({environment:Ke(de||J),runtimeMode:c==="cloud"?"cloud":"local"}),[J,de,c]),me=s.useCallback(n=>{const o=String(n||"").trim();return J?`${J}${o.startsWith("/")?o:`/${o}`}`:o},[J]),j=s.useCallback(n=>v?v(n):me(n),[me,v]),te=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("screen"),n.delete("gate"),n.delete("checkout"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval"),n.delete("pricingAudience");const o=n.toString();A(`/${o?`?${o}`:""}${T.hash||""}`)},[T.hash,T.search,A]),pe=s.useMemo(()=>j("/api/taskforce/public/pricing"),[j]),B=s.useMemo(()=>ke(M,L),[M,L]),i=s.useMemo(()=>B.allowReturnToApp,[B.allowReturnToApp]),U=s.useMemo(()=>{const n=String(B.message||"").trim();return!n||n===_n?null:n},[B.message]),D=s.useCallback(()=>{const n=new URLSearchParams(T.search);n.delete("checkout"),n.delete("session_id"),n.delete("gate"),n.delete("planId"),n.delete("planVersionId"),n.delete("interval");const o=n.toString();A(`${T.pathname}${o?`?${o}`:""}${T.hash||""}`,{replace:!0})},[T.hash,T.pathname,T.search,A]),w=s.useCallback(()=>{Q.current!=null&&window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{D(),Q.current=null},gn)},[D]);s.useEffect(()=>{oe.current=I},[I]);const u=s.useCallback(async n=>{const o=j(ge);if(!t)return se(null),he(o,{identityKey:a}),null;try{const _=await He(o,{identityKey:a,force:n?.force===!0});return se(_),G?.(_),_}catch{return null}},[a,j,t,G]),V=s.useCallback((n,o,_)=>{const f=String(o||"").trim();if(_?.preferFallback&&f)return f;const y=ke(n,L).message;return y||f||"Unable to confirm checkout completion."},[L]),K=s.useCallback((n,o)=>!ke(n,o).allowReturnToApp,[]),Y=s.useCallback(async(n,o,_="public",f)=>{if(!n){g({type:"error",message:"Selected plan is missing a default plan version."});return}X(!0),g(null);try{const y=await fetch(j("/api/taskforce/billing/checkout-session"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({planVersionId:n,interval:o,pricingAudience:_})}),m=await y.json().catch(()=>({}));if(!y.ok){g({type:"error",message:String(m?.error||"Unable to start checkout for selected plan.")});return}const d=String(m?.checkoutState||"").trim().toLowerCase();if(d==="free"){g({type:"success",message:"Plan selected. Your access is ready."}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="updated"){g({type:"success",message:String(m?.message||"Your subscription was updated successfully.")}),he(j(ge),{identityKey:a});const b=await u({force:!0}),R=String(b?.entitlementState||"").trim().toLowerCase();f?.autoContinueOnActivation===!0&&ye(R)&&await I?.();return}if(d==="already_current_plan"){g({type:"success",message:String(m?.message||"You are already on this plan.")}),he(j(ge),{identityKey:a}),await u();return}const S=String(m?.returnBaseUrl||"").trim();if(c==="local"&&S)try{const b=window.location.origin,R=new URL(S,b).origin;if(R!==b){g({type:"error",message:`Checkout return is misconfigured for this runtime. Expected ${b} but got ${R}.`});return}}catch{g({type:"error",message:"Checkout return URL is invalid for this runtime."});return}const k=String(m?.url||"").trim();if(!k){g({type:"error",message:"Checkout did not return a redirect URL."});return}window.location.assign(k)}catch{g({type:"error",message:"Unable to start checkout for selected plan."})}finally{X(!1)}},[a,j,u,I,c]),ae=s.useCallback(async(n,o)=>{if(!n)return{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1};const _=async()=>{he(j(ge),{identityKey:a});const f=await u({force:!0}),y=String(f?.entitlementState||"").trim().toLowerCase();if(!ye(y))return!1;const m=ce,d=z,S=Se,k=String(f?.planId||"").trim(),b=String(f?.planVersionId||"").trim(),R=Ie(f?.billingInterval??null),je=o?.preConfirmationSummary??null,Me=String(je?.entitlementState||"").trim().toLowerCase(),Ue=ye(Me),De=String(je?.planId||"").trim(),Fe=String(je?.planVersionId||"").trim(),Ve=Ie(je?.billingInterval??null);return m&&k&&k!==m||d&&b&&b!==d||S&&R&&R!==S||Ue&&!(!!m&&k===m&&De!==k)&&!(!!d&&b===d&&Fe!==b)&&!(!!S&&R===S&&Ve!==R)?!1:(o?.autoContinueOnActivation===!0&&await oe.current?.(),!0)};try{const f=await fetch(j("/api/taskforce/billing/checkout-session/confirm"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n})}),y=await f.json().catch(()=>({}));if(!f.ok){const m=String(y?.code||"").trim(),d=Cn(f.status,m);return d&&await _()?{confirmed:!0}:{confirmed:!1,errorMessage:String(y?.error||"Unable to confirm checkout completion."),retryable:d}}return await _()?{confirmed:!0}:{confirmed:!0}}catch{return{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}}},[a,j,u,Se,ce,z]),ie=s.useCallback(async()=>{if(!t){A(`/login?mode=login&next=${encodeURIComponent(Ae())}`);return}X(!0),g({type:"info",message:"Opening billing portal..."});try{const n=await fetch(j("/api/taskforce/billing/portal-session"),{method:"POST",credentials:"include"}),o=await n.json().catch(()=>({}));if(!n.ok){g({type:"error",message:String(o?.error||"Failed to open billing portal.")});return}const _=String(o?.url||"").trim();if(!_){g({type:"error",message:"Portal session did not return a redirect URL."});return}window.location.assign(_)}catch{g({type:"error",message:"Failed to open billing portal."})}finally{X(!1)}},[j,t,A]),N=s.useCallback(async()=>{if(!(!I||re||H)){Ce(!0);try{await I()}finally{Ce(!1)}}},[re,H,I]);s.useEffect(()=>{u()},[u]),s.useEffect(()=>{i&&L==="missing_entitlement"&&D()},[D,L,i]),s.useEffect(()=>()=>{Q.current!=null&&window.clearTimeout(Q.current)},[]),s.useEffect(()=>{x!=="success"&&(Z.current=null)},[x]),s.useEffect(()=>{let n=!1;const o=new Set,_=async f=>{f<=0||await new Promise(y=>{const m=window.setTimeout(()=>{o.delete(m),y()},f);o.add(m)})};if(x==="success"){if(q.current=!0,g({type:"success",message:"Checkout completed successfully. Finalizing your plan..."}),!t&&!p)return()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};if(!t)return g({type:"error",message:"Sign in to finish activating your plan."}),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()};const y=ee||"__missing_session__";return Z.current===y?()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()}:((async()=>{const m=Date.now(),d=await u({force:!0});if(n)return;let S=ee?{confirmed:!1,errorMessage:"Unable to confirm checkout completion.",retryable:!0}:{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},k=0;for(;;){const b=k<Be.length?Be[k]:hn;if(k+=1,await _(b),n||(S=ee?await ae(ee,{autoContinueOnActivation:K(d,L),preConfirmationSummary:d}):{confirmed:!1,errorMessage:"Checkout session is missing.",retryable:!1},n))return;if(S.confirmed){Z.current=y,g({type:"success",message:"Checkout completed successfully."}),w();return}if(!S.retryable||Date.now()-m>=yn)break}if(!n&&!S.confirmed){const b=await u({force:!0});if(n)return;S.retryable||(Z.current=y),g({type:"error",message:V(b,S.errorMessage,{preferFallback:!S.retryable})}),S.retryable||w();return}})(),()=>{n=!0,o.forEach(m=>window.clearTimeout(m)),o.clear()})}if(x==="cancel"){(async()=>{const f=await u({force:!0});g({type:"error",message:V(f,"Checkout was canceled. No charge was made.")}),w()})();return}if((x==="start"||x==="free")&&t&&z&&!q.current){q.current=!0,(async()=>{const f=await u({force:!0});await Y(z,le,ue,{autoContinueOnActivation:K(f,L)})})();return}},[p,x,ae,L,t,u,le,z,ue,ee,V,w,K,Y]),s.useEffect(()=>{if(!(x==="success"||x==="cancel"||x==="start"||x==="free")){if(U){g({type:B.statusTone,message:U});return}g(n=>!n||n.type!=="error"?n:n.message===B.message?null:n)}},[x,U,B.message,B.statusTone]);const xe=s.useCallback(async n=>{if(!t){const _=n.pricingType==="free"?"free":"start",f=Ae({checkout:_,planId:n.planId,planVersionId:n.planVersionId,interval:n.interval,pricingAudience:n.pricingAudience});A(`/login?mode=register&planId=${encodeURIComponent(n.planId)}&planVersionId=${encodeURIComponent(n.planVersionId)}&interval=${encodeURIComponent(n.interval)}&pricingAudience=${encodeURIComponent(n.pricingAudience)}&next=${encodeURIComponent(f)}`);return}if(n.isCurrentPlan){if(!M?.stripeCustomerId){g({type:"success",message:"Your current plan does not use Stripe billing."});return}await ie();return}const o=K(M,L);if(n.pricingType==="free"){await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o});return}await Y(n.planVersionId,n.interval,n.pricingAudience,{autoContinueOnActivation:o})},[M,L,t,A,ie,K,Y]),fe=s.useCallback(()=>{if(i&&I){N();return}if(h){te();return}if(window.history.length>1){A(-1);return}A("/")},[te,h,N,i,A,I]),Ne=h?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{className:r.navAction,onClick:fe,disabled:H||re||t&&!i,children:i?"Take Me to Taskforce":"Back"}),t&&M?.stripeCustomerId&&e.jsx("button",{className:r.navAction,onClick:()=>{ie()},disabled:_e,children:"Manage billing"}),!t&&e.jsxs("button",{className:r.navAction,onClick:()=>A(`/login?mode=login&next=${encodeURIComponent(Ae())}`),children:[e.jsx(We,{size:16,style:{marginRight:"8px",verticalAlign:"text-bottom"}}),"Sign In"]})]}),ne=h?null:e.jsx(qe,{projectName:C,currentWorkspaceId:E,runtimeMode:c==="cloud"?"cloud":"local",theme:l,onBrandClick:fe,actions:Ne});return e.jsx(fn,{chrome:ne,heading:"Subscription Plans",subtitle:"Manage your subscription and explore available features. Your current plan is highlighted below.",variant:"site",theme:l,isAuthenticated:t,authSessionResolved:p,currentPlanId:String(M?.planId||ce||"").trim()||null,currentPlanVersionId:String(M?.planVersionId||z||"").trim()||null,currentEntitlementState:String(M?.entitlementState||"").trim()||null,markCurrentPlan:B.markCurrentPlan,canManageCurrentPlan:!!M?.stripeCustomerId,pricingEndpoint:pe,statusBanner:be,onBack:fe,backLabel:i?"Take Me to Taskforce":h?"Back to Board":"Back to App",backDisabled:H||re||t&&!i,topActions:null,shellOwnsScroll:W,showPageBackButton:!1,showHeaderBarWithChrome:!1,currentPlanCardActionMode:"manage",fallbackPricingSource:ve,onSelectPlan:xe})}export{Tn as PlansPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,j as e}from"./vendor-react-CKJs5o3c.js";import{ContextAttachmentManager as g}from"./ContextAttachmentManager-
|
|
1
|
+
import{r as h,j as e}from"./vendor-react-CKJs5o3c.js";import{ContextAttachmentManager as g}from"./ContextAttachmentManager-BudIbOR9.js";import{f as v,aW as x,a_ as _}from"./index-GHJgcW3j.js";import{w as y,$ as j,aZ as w}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const I="_group_1y2qv_1",N="_list_1y2qv_9",b="_review_1y2qv_15",C="_icon_1y2qv_43",k="_openIcon_1y2qv_43",A="_copy_1y2qv_44",L="_kindLabel_1y2qv_45",q="_title_1y2qv_53",R="_loading_1y2qv_54",n={group:I,list:N,review:b,icon:C,openIcon:k,copy:A,kindLabel:L,title:q,loading:R};function U(o){return String(o.title||"").trim()||o.image?.displayName||"Image review"}function S({taskId:o,taskReferenceLabel:l,workspaceId:c,apiBaseUrl:r}){const[i,d]=h.useState(null),[m,p]=h.useState(!1);return h.useEffect(()=>{let a=!0;d(null),p(!1);const t=new URLSearchParams({workspaceId:c,taskId:o});return v(`/api/taskforce/annotated-attachments/sessions?${t.toString()}`,{credentials:"include"},r).then(async s=>{if(!s.ok)throw new Error("Failed to load image reviews.");return s.json()}).then(s=>{a&&d(Array.isArray(s?.sessions)?s.sessions:[])}).catch(()=>{a&&(d([]),p(!0))}),()=>{a=!1}},[r,o,c]),i!==null&&i.length===0&&!m?null:e.jsx("section",{className:n.group,"aria-label":"Image reviews",children:i===null?e.jsxs("div",{className:n.loading,"aria-live":"polite",children:[e.jsx(y,{size:14})," Loading image reviews"]}):m?e.jsx("div",{className:n.loading,role:"status",children:"Unable to load image reviews."}):e.jsx("div",{className:n.list,children:i.map(a=>{const t=a.image,s=a.annotations.length,u=!!(t?.assetId&&t.apiUrl);return e.jsxs("button",{type:"button",className:n.review,disabled:!u,onClick:()=>{t&&_({assetId:t.assetId,path:t.apiUrl,displayName:t.displayName,referenceLabel:t.referenceLabel||void 0},{taskId:o,taskReferenceLabel:l,sessionId:a.id})},children:[e.jsx("span",{className:n.icon,children:e.jsx(j,{size:14})}),e.jsxs("span",{className:n.copy,children:[e.jsx("span",{className:n.kindLabel,children:"Image review session"}),e.jsx("span",{className:`${n.title} tf-heading-card`,children:U(a)}),e.jsxs("span",{className:"tf-text-meta",children:[[t?.referenceLabel,t?.displayName].filter(Boolean).join(" · ")||"Image",a.updatedAt?` · Updated ${x(a.updatedAt,{month:"short",day:"numeric",year:"numeric"})}`:""]}),e.jsxs("span",{className:"tf-text-meta",children:[s," ",s===1?"marker":"markers"]})]}),e.jsx(w,{className:n.openIcon,size:14,"aria-hidden":"true"})]},a.id)})})})}function M(o){const{taskId:l,taskReferenceLabel:c,workspaceId:r,apiBaseUrl:i,showImageReviews:d=!1,contextFiles:m,onAddContextFile:p,onRemoveContextFile:a,onUpdateContextCaption:t,cardCoverAssetId:s,onSetCardCover:u,cardCoverDisabled:f}=o;return e.jsx(g,{ownerType:"task",ownerId:l,ownerReferenceLabel:c,workspaceId:r,apiBaseUrl:i,attachments:m,onAddAttachment:p,onRemoveAttachment:a,onUpdateAttachmentCaption:t,cardCoverAssetId:s,onSetCardCover:u,cardCoverDisabled:f,supplementalContent:d&&l&&r?e.jsx(S,{taskId:l,taskReferenceLabel:c,workspaceId:r,apiBaseUrl:i}):null})}export{M as TaskContextUpload};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as e,R as Us}from"./vendor-react-CKJs5o3c.js";import{g as Hn,t as s,T as qs,P as is,A as Js,I as be,r as ae,D as Wn,a as za,b as Vn,l as Xa,c as Kn,d as qn,M as Jn,n as Yn,e as Ga}from"./index-
|
|
1
|
+
import{r as o,j as e,R as Us}from"./vendor-react-CKJs5o3c.js";import{g as Hn,t as s,T as qs,P as is,A as Js,I as be,r as ae,D as Wn,a as za,b as Vn,l as Xa,c as Kn,d as qn,M as Jn,n as Yn,e as Ga}from"./index-GHJgcW3j.js";import{r as os,t as Cs,X as Vs,v as en,A as sn,I as At,aD as Et,_ as Zn,w as Pe,a0 as Qn,aE as Oa,Z as Y,l as Xn,aF as Fa,aG as Ua,aH as Rt,k as tn,aI as ei,u as te,x as Ae,aJ as si,aK as ti,a5 as ai,d as an,a as Bt,ah as Fe,aL as ni,au as Dt,ad as ii,a4 as oi,ay as Ha,aM as li,aN as ri,aO as ci}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";function di(i){return i==="general"?{}:{TASKFORCE_MCP_CLIENT_ID:i}}function pi(...i){const l=i.map(g=>String(g||"").trim().toLowerCase()).join("|");let p=2166136261,m=3339675911;for(let g=0;g<l.length;g+=1){const C=l.charCodeAt(g);p=Math.imul(p^C,16777619),m=Math.imul(m^C,2246822519)}return`mcp-${(p>>>0).toString(16).padStart(8,"0")}${(m>>>0).toString(16).padStart(8,"0")}`}const Hs=Hn();function zt(i,l){return String(i||"").toLowerCase().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^[-_]+|[-_]+$/g,"")||l.toLowerCase()}function ui(i,l){const m=zt(i||l||"workspace","workspace").slice(0,25)||"workspace";return zt(`taskforce-${m}`,"taskforce-workspace")}function mi(i){return{Authorization:`Bearer ${i.tokenValue}`,...i.clientId==="general"?{}:{"X-Taskforce-MCP-Client-ID":i.clientId}}}function ge(i,l){return`${i} Use the generated config exactly as shown. Resolve your AI profile before the first write; stateless clients should keep the returned profileToken only in private client state.`}function xe(i){return`${i} Use the generated config exactly as shown. No connection token is required for local stdio MCP. Resolve your AI profile before the first write; stateless clients should keep the returned profileToken only in private client state.`}function Ks(i){return JSON.stringify(i)}function Wa(i){return`[${i.map(l=>Ks(l)).join(", ")}]`}function Va(i){return!i||Object.keys(i).length===0?[]:[`env = { ${Object.entries(i).map(([l,p])=>`${l} = ${Ks(p)}`).join(", ")} }`]}function Ka(i){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(i)?i:`'${i.replace(/'/g,`'"'"'`)}'`}function hi(i){const{clientId:l,endpoint:p,tokenValue:m,serverId:g}=i,C=mi(i);C.Authorization;const w=Object.entries(C).filter(([S])=>S!=="Authorization").map(([S,I])=>` --header "${S}: ${I}"`).join("");switch(l){case"general":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,headers:C},instructionLabel:"General MCP Configuration Instructions",instructionText:ge("Add this server to your MCP client using its standard remote HTTP configuration format.")};case"cursor":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,headers:C},instructionLabel:"Cursor Configuration Instructions",instructionText:ge("Open Cursor settings, find MCP servers, and paste this config.")};case"cline":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,type:"streamableHttp",headers:C},instructionLabel:"Cline Configuration Instructions",instructionText:ge("Open Cline MCP Servers, add a remote server, or paste this into the Cline MCP config with Streamable HTTP selected.")};case"vscode":return{clientId:l,kind:"json",rootKey:"servers",serverConfig:{type:"http",url:p,headers:C},instructionLabel:"VS Code Configuration Instructions",instructionText:ge("Open .vscode/mcp.json or MCP: Open User Configuration and add this server under the servers object.")};case"kiro":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{url:p,headers:C},instructionLabel:"Kiro Configuration Instructions",instructionText:ge("Open .kiro/settings/mcp.json in your workspace (or ~/.kiro/settings/mcp.json for user-level config) and add this server under mcpServers.")};case"windsurf":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{serverUrl:p,headers:C},instructionLabel:"Windsurf Configuration Instructions",instructionText:ge("Open Windsurf MCP settings, add a server, and paste this config.")};case"antigravity":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:{serverUrl:p,headers:C},instructionLabel:"Antigravity Configuration Instructions",instructionText:ge("Open Antigravity MCP settings, view the raw config, and paste this Antigravity-specific configuration.")};case"openclaw":return{clientId:l,kind:"json",rootKey:"servers",wrapperKeys:["mcp"],serverConfig:{transport:"streamable-http",url:p,headers:C},instructionLabel:"OpenClaw Configuration Instructions",instructionText:ge("Open ~/.openclaw/openclaw.json and add this server under mcp.servers.")};case"codex":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${g}]`,`url = "${p}"`,`http_headers = { ${Object.entries(C).map(([S,I])=>`${S} = "${I}"`).join(", ")} }`].join(`
|
|
2
2
|
`),instructionLabel:"Codex Configuration Instructions",instructionText:ge("Open ~/.codex/config.toml and add this Codex MCP entry.")};case"grok":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${g}]`,`url = "${p}"`,`headers = { ${Object.entries(C).map(([S,I])=>`${S} = "${I}"`).join(", ")} }`].join(`
|
|
3
3
|
`),instructionLabel:"Grok CLI Configuration Instructions",instructionText:ge("Open ~/.grok/config.toml (or .grok/config.toml in your project for project-scoped config) and add this Grok CLI MCP entry.")};case"claude-code":return{clientId:l,kind:"text",renderedText:`claude mcp add --transport http ${g} ${p} --header "Authorization: Bearer ${m}"${w}`,instructionLabel:"Claude Code Configuration Instructions",instructionText:ge("Run this Claude Code command in your terminal to add the remote Taskforce MCP server.")};case"gemini-cli":return{clientId:l,kind:"text",renderedText:`gemini mcp add ${g} ${p} --transport http --header "Authorization: Bearer ${m}"${w}`,instructionLabel:"Gemini CLI Configuration Instructions",instructionText:ge("Run this Gemini CLI command in your terminal to add the remote Taskforce MCP server. Add --scope user if you want it available across all projects.")};case"claude-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Claude Chat Configuration Instructions",instructionText:"Open Claude Settings > Connectors, paste this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"grok-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Grok Configuration Instructions",instructionText:"Go to grok.com/connectors, create a custom connector with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"gemini-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Gemini Spark Configuration Instructions",instructionText:"Open Gemini Settings & help > Connected Apps, add a custom app for Spark with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"mistral-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Mistral Vibe Configuration Instructions",instructionText:"Open Mistral Vibe (formerly Le Chat) > Intelligence > Connectors, add a custom connector with this MCP server URL, and complete the Taskforce OAuth flow to authorize one workspace."};case"perplexity-chat":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"Perplexity Configuration Instructions",instructionText:"Open Perplexity Settings > Connectors, add a custom remote connector with this MCP server URL, choose OAuth, and complete the Taskforce authorization flow for one workspace."};case"chatgpt-desktop":return{clientId:l,kind:"text",renderedText:p,instructionLabel:"ChatGPT Desktop Configuration Instructions",instructionText:"Open ChatGPT Apps & Connectors / developer mode, paste this MCP server URL, and complete the Taskforce OAuth authorize flow when ChatGPT opens it."};default:{const S=l;throw new Error(`Unsupported MCP client: ${S}`)}}}function gi(i){const{clientId:l,serverId:p,serverConfig:m}=i,g={command:m.command,args:m.args,...m.env&&Object.keys(m.env).length>0?{env:m.env}:{}},C=Object.entries(m.env||{}).map(([S,I])=>` --env ${Ka(`${S}=${I}`)}`).join(""),w=[m.command,...m.args].map(S=>Ka(S)).join(" ");switch(l){case"general":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"General MCP Configuration Instructions",instructionText:xe("Add this server to your MCP client using its standard local stdio configuration format.")};case"cursor":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Cursor Configuration Instructions",instructionText:xe("Open Cursor settings, find MCP servers, and paste this local stdio config.")};case"cline":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Cline Configuration Instructions",instructionText:xe("Open Cline MCP Servers and paste this local stdio server config.")};case"vscode":return{clientId:l,kind:"json",rootKey:"servers",serverConfig:{type:"stdio",...g},instructionLabel:"VS Code Configuration Instructions",instructionText:xe("Open .vscode/mcp.json or MCP: Open User Configuration and add this server under the servers object.")};case"kiro":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Kiro Configuration Instructions",instructionText:xe("Open .kiro/settings/mcp.json in your workspace (or ~/.kiro/settings/mcp.json for user-level config) and add this server under mcpServers.")};case"windsurf":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Windsurf Configuration Instructions",instructionText:xe("Open Windsurf MCP settings and paste this local stdio config.")};case"antigravity":return{clientId:l,kind:"json",rootKey:"mcpServers",serverConfig:g,instructionLabel:"Antigravity Configuration Instructions",instructionText:xe("Open Antigravity MCP settings, view the raw config, and paste this local stdio configuration.")};case"openclaw":return{clientId:l,kind:"json",rootKey:"servers",wrapperKeys:["mcp"],serverConfig:{transport:"stdio",...g},instructionLabel:"OpenClaw Configuration Instructions",instructionText:xe("Open ~/.openclaw/openclaw.json and add this local stdio server under mcp.servers.")};case"codex":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${p}]`,`command = ${Ks(m.command)}`,`args = ${Wa(m.args)}`,...Va(m.env)].join(`
|
|
4
4
|
`),instructionLabel:"Codex Configuration Instructions",instructionText:xe("Open ~/.codex/config.toml and add this local MCP entry.")};case"grok":return{clientId:l,kind:"text",renderedText:[`[mcp_servers.${p}]`,`command = ${Ks(m.command)}`,`args = ${Wa(m.args)}`,...Va(m.env)].join(`
|
package/dist/ui/assets/{TaskforceAgentsModule-gmH-PD2q.js → TaskforceAgentsModule-DmeCf6pJ.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as e,r as a,a as qa}from"./vendor-react-CKJs5o3c.js";import{f as gt,B as ss,C as ns,E as lt,t as r,F as si,w as Mn,G as ya,H as ni,J as ba,K as xa,L as ja,N as ka,O as Wt,Q as ai,S as qs,U as Sa,V as hs,W as ri,M as ii,X as oi,Y as Va,Z as li,_ as ci,$ as di,a0 as Vs,a1 as Ca}from"./index-
|
|
1
|
+
import{j as e,r as a,a as qa}from"./vendor-react-CKJs5o3c.js";import{f as gt,B as ss,C as ns,E as lt,t as r,F as si,w as Mn,G as ya,H as ni,J as ba,K as xa,L as ja,N as ka,O as Wt,Q as ai,S as qs,U as Sa,V as hs,W as ri,M as ii,X as oi,Y as Va,Z as li,_ as ci,$ as di,a0 as Vs,a1 as Ca}from"./index-GHJgcW3j.js";import{a as Jt,A as ui,b as fi,w as Na,r as Aa}from"./AiIdentityRosterCard-Cfvb9Nuv.js";import{ay as vt,ba as tn,y as Cs,ao as mi,a0 as Wa,$ as pi,aJ as hi,aa as Dn,bb as gi,bc as ts,d as Lt,W as vi,bd as yi,q as bi,g as xi,be as ji,S as Bn,bf as ki,t as Pt,w as je,R as nn,a6 as On,u as Zt,X as yt,Z as st,bg as Si,Y as Ci,v as Ja,A as Ya,bh as Ws,ad as wa,ah as Qa,a2 as Xa,a7 as Za,ap as Ni,r as Ai,J as Xt,ak as wi,O as _a,bi as _i}from"./vendor-icons-Bsq-mcEn.js";import"./vendor-markdown-_lhNCyq-.js";import"./vendor-dnd-CJ-AjP-Y.js";import"./vendor-router-AqJMU8Lz.js";const An=1,Pe={name:80,shortDescription:240,purpose:2e3,listItem:1e3,listItems:24,workingGuidance:6e3,reference:200,promptContent:12e3};function Ta(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Ie(t,n,i,o){t.push({code:n,path:i,message:o})}function Ra(t,n,i,o){const f=new Set(n);Object.keys(t).forEach(w=>{f.has(w)||Ie(o,"unknown_field",i?`${i}.${w}`:w,"This field is not part of Agent Role v1.")})}function wn(t,n,i,o){if(typeof t!="string")return Ie(o,"required_string",n,"A string value is required."),"";const f=t.trim();return f?f.length>i&&Ie(o,"string_too_long",n,`Must be ${i} characters or less.`):Ie(o,"required_string",n,"A non-empty value is required."),f}function Ti(t,n,i,o){if(t==null||t==="")return;if(typeof t!="string"){Ie(o,"invalid_string",n,"Must be a string when provided.");return}const f=t.trim();if(f)return f.length>i&&Ie(o,"string_too_long",n,`Must be ${i} characters or less.`),f}function Js(t,n,i,o){if(!Array.isArray(t))return Ie(o,"invalid_list",n,"Must be an array of strings."),[];i.required&&t.length===0&&Ie(o,"required_list",n,"Provide at least one item."),i.maxItems&&t.length>i.maxItems&&Ie(o,"too_many_items",n,`Provide no more than ${i.maxItems} items.`);const f=new Set,w=[];return t.forEach((N,x)=>{if(typeof N!="string"){Ie(o,"invalid_string",`${n}[${x}]`,"Must be a string.");return}const k=N.trim();if(!k){Ie(o,"empty_list_item",`${n}[${x}]`,"List items cannot be blank.");return}k.length>i.maxItemLength&&Ie(o,"string_too_long",`${n}[${x}]`,`Must be ${i.maxItemLength} characters or less.`),!f.has(k)&&(f.add(k),w.push(k))}),w}function er(t){const n=[];if(!Ta(t))return{definition:null,issues:[{code:"invalid_definition",path:"",message:"Agent Role definition must be an object."}]};Ra(t,["schemaVersion","name","shortDescription","purpose","responsibilities","expectedOutputs","workingGuidance","recommendations"],"",n),t.schemaVersion!==An&&Ie(n,"unsupported_schema_version","schemaVersion",`Agent Role schemaVersion must be ${An}.`);const i=wn(t.name,"name",Pe.name,n),o=wn(t.shortDescription,"shortDescription",Pe.shortDescription,n),f=wn(t.purpose,"purpose",Pe.purpose,n),w=Js(t.responsibilities,"responsibilities",{required:!0,maxItems:Pe.listItems,maxItemLength:Pe.listItem},n),N=Js(t.expectedOutputs,"expectedOutputs",{required:!0,maxItems:Pe.listItems,maxItemLength:Pe.listItem},n),x=Ti(t.workingGuidance,"workingGuidance",Pe.workingGuidance,n),k=Ta(t.recommendations)?t.recommendations:null;k?Ra(k,["skillRefs","capabilityGroups"],"recommendations",n):Ie(n,"invalid_recommendations","recommendations","Recommendations must be an object.");const $=Js(k?.skillRefs??[],"recommendations.skillRefs",{maxItems:Pe.listItems,maxItemLength:Pe.reference},n),L=Js(k?.capabilityGroups??[],"recommendations.capabilityGroups",{maxItems:Pe.listItems,maxItemLength:Pe.reference},n),K={schemaVersion:An,name:i,shortDescription:o,purpose:f,responsibilities:w,expectedOutputs:N,...x?{workingGuidance:x}:{},recommendations:{skillRefs:$,capabilityGroups:L}};return n.length===0&&tr(K).length>Pe.promptContent&&Ie(n,"compiled_prompt_too_long","",`Compiled Role prompt content must be ${Pe.promptContent} characters or less.`),{definition:n.length===0?K:null,issues:n}}class Ri extends Error{constructor(n){super(n[0]?.message||"Agent Role definition is invalid."),this.issues=n,this.name="AgentRoleDefinitionValidationError"}code="AGENT_ROLE_DEFINITION_INVALID";statusCode=400}function Ei(t){const n=er(t);if(!n.definition)throw new Ri(n.issues);return n.definition}function Ea(t){return t.map(n=>`- ${n}`).join(`
|
|
2
2
|
`)}function tr(t){return[`Role: ${t.name}`,`Purpose and scope:
|
|
3
3
|
${t.purpose}`,`Responsibilities:
|
|
4
4
|
${Ea(t.responsibilities)}`,`Expected outputs:
|
|
5
5
|
${Ea(t.expectedOutputs)}`,t.workingGuidance?`Role-specific working guidance:
|
|
6
6
|
${t.workingGuidance}`:""].filter(Boolean).join(`
|
|
7
7
|
|
|
8
|
-
`)}function Ii(t){return tr(Ei(t))}const $i="_toolAccess_2stgb_1",Li="_skillSelector_2stgb_2",Pi="_effectiveSummary_2stgb_3",Mi="_sectionHeader_2stgb_13",Di="_workspaceHeader_2stgb_14",Oi="_titleLine_2stgb_32",zi="_moduleGrid_2stgb_36",Ui="_moduleOption_2stgb_42",Gi="_unavailableCapability_2stgb_43",Bi="_moduleOptionSelected_2stgb_66",Hi="_moduleIcon_2stgb_76",Fi="_selectedSkillIcon_2stgb_77",Ki="_provenanceIcon_2stgb_78",qi="_moduleCopy_2stgb_91",Vi="_futureGroups_2stgb_110",Wi="_unknownNotice_2stgb_122",Ji="_disabledExplanation_2stgb_123",Yi="_catalogError_2stgb_147",Qi="_selectedSkills_2stgb_160",Xi="_skillSearch_2stgb_168",Zi="_skillResults_2stgb_188",eo="_emptySelection_2stgb_266",to="_provenanceGrid_2stgb_275",so="_unavailableProvenance_2stgb_312",no="_previewCaveat_2stgb_316",ao="_librarySummary_2stgb_323",ro="_workspacePanel_2stgb_346",io="_futureAction_2stgb_356",oo="_workspaceTitleIcon_2stgb_370",lo="_previewCardIcon_2stgb_371",co="_relationshipFlow_2stgb_389",uo="_previewCards_2stgb_420",fo="_previewCard_2stgb_371",mo="_previewCardAvailable_2stgb_438",W={toolAccess:$i,skillSelector:Li,effectiveSummary:Pi,sectionHeader:Mi,workspaceHeader:Di,titleLine:Oi,moduleGrid:zi,moduleOption:Ui,unavailableCapability:Gi,moduleOptionSelected:Bi,moduleIcon:Hi,selectedSkillIcon:Fi,provenanceIcon:Ki,moduleCopy:qi,futureGroups:Vi,unknownNotice:Wi,disabledExplanation:Ji,catalogError:Yi,selectedSkills:Qi,skillSearch:Xi,skillResults:Zi,emptySelection:eo,provenanceGrid:to,unavailableProvenance:so,previewCaveat:no,librarySummary:ao,workspacePanel:ro,futureAction:io,workspaceTitleIcon:oo,previewCardIcon:lo,relationshipFlow:co,previewCards:uo,previewCard:fo,previewCardAvailable:mo},Hn=[{key:"tasks",label:"Tasks and schedule",description:"Read and update tasks, checklists, task workflows, and schedule context.",icon:Cs},{key:"planning",label:"Initiatives and workstreams",description:"Read planning structure and add planning comments.",icon:mi},{key:"documents",label:"Documents",description:"Find and read Taskforce documents and their review context.",icon:Wa},{key:"images",label:"Image Notes",description:"Find images and inspect annotation sessions.",icon:pi},{key:"workspace",label:"Workspace information",description:"Read workspace configuration, people, and managed Agent identity.",icon:hi}],po=Hn.map(t=>t.key);function Fn({selectedKeys:t,onChange:n,disabled:i=!1,mode:o="active",title:f="Tool Access",description:w,showFutureTools:N=!0,requireOne:x=!1,hasCustomOverrides:k=!1}){const $=new Set(t),L=new Set(po),K=t.filter(_=>!L.has(_)),I=o==="active"?"Available now":o==="requirement"?"Requirement preview":"Inheritance preview",R=o==="active"?"tf-chip-success":"tf-chip-warning",S=(_,H)=>{if(!n||i)return;const Y=H?[...t.filter(ie=>ie!==_),_]:t.filter(ie=>ie!==_),z=Y.filter(ie=>L.has(ie)).length;x&&z===0||n(Y)};return e.jsxs("section",{className:W.toolAccess,"aria-label":f,children:[e.jsxs("div",{className:W.sectionHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-section",children:f}),e.jsx("p",{className:"tf-text-helper",children:w||"Choose which Taskforce modules this Agent can use. Fewer enabled tools reduce runtime tool context."})]}),e.jsx("span",{className:R,children:I})]}),e.jsx("div",{className:W.moduleGrid,children:Hn.map(_=>{const H=_.icon,Y=$.has(_.key);return e.jsxs("label",{className:`${W.moduleOption} ${Y?W.moduleOptionSelected:""}`.trim(),children:[e.jsx("input",{type:"checkbox",checked:Y,disabled:i||!n,onChange:z=>S(_.key,z.target.checked)}),e.jsx("span",{className:W.moduleIcon,"aria-hidden":"true",children:e.jsx(H,{size:16})}),e.jsxs("span",{className:W.moduleCopy,children:[e.jsx("strong",{children:_.label}),e.jsx("small",{children:_.description})]})]},_.key)})}),k?e.jsxs("div",{className:W.unknownNotice,role:"status",children:[e.jsx(Dn,{size:14}),e.jsx("span",{children:"Custom per-tool overrides are active. Change any module selection to replace them with the module policy shown here."})]}):null,K.length>0?e.jsxs("div",{className:W.unknownNotice,role:"status",children:[e.jsx(Dn,{size:14}),e.jsxs("span",{children:["Preserved legacy keys: ",K.join(", "),". They are not available in the current managed Tool Access catalog."]}),n&&!i?e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>n(t.filter(_=>L.has(_))),children:"Remove unsupported keys"}):null]}):null,N?e.jsxs("div",{className:W.futureGroups,children:[e.jsx(Ia,{icon:e.jsx(vt,{size:16}),title:"Connected tools",description:"Workspace-approved APIs and external MCP tools will appear here.",status:"Connections not available yet"}),e.jsx(Ia,{icon:e.jsx(gi,{size:16}),title:"Code Workspace",description:"Repository read, edit, Git, and publication access will be configured separately.",status:"Code Workspace not configured"})]}):null]})}function ho({skills:t,selectedIds:n,onChange:i,disabled:o=!1,loading:f=!1,error:w="",onRetry:N}){const[x,k]=a.useState(""),$=a.useRef(null),L=new Set(n),K=x.trim().toLowerCase(),I=t.filter(S=>S.lifecycleStatus==="active"&&!L.has(S.id)).filter(S=>!K||S.name.toLowerCase().includes(K)||S.description.toLowerCase().includes(K)).slice(0,8),R=new Map(t.map(S=>[S.id,S]));return e.jsxs("section",{className:W.skillSelector,"aria-label":"Included Skills",children:[e.jsxs("div",{className:W.sectionHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-section",children:"Included Skills"}),e.jsx("p",{className:"tf-text-helper",children:"Select Skills by name. They are saved with this Role now; automatic Agent inheritance is preview-only."})]}),e.jsx("span",{className:"tf-chip-warning",children:"Inheritance preview"})]}),e.jsxs("label",{className:"tf-field-stack",children:[e.jsx("span",{className:"tf-field-label",children:"Find a Skill"}),e.jsxs("span",{className:W.skillSearch,children:[e.jsx(Bn,{size:15,"aria-hidden":"true"}),e.jsx("input",{ref:$,type:"search",className:"tf-field-shell","aria-label":"Find a Skill to include",placeholder:f?"Loading Skills…":"Search by name or description",value:x,disabled:o||f,onChange:S=>k(S.target.value)})]})]}),w?e.jsxs("div",{className:W.catalogError,role:"alert",children:[e.jsx("span",{children:w}),N?e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:N,children:"Retry"}):null]}):!f&&I.length>0?e.jsx("div",{className:W.skillResults,"aria-label":"Available Skills",children:I.map(S=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{i([...n,S.id]),k(""),$.current?.focus()},children:[e.jsxs("span",{children:[e.jsx("strong",{children:S.name}),e.jsx("small",{children:S.description||"No description"})]}),e.jsx("span",{className:"tf-chip-neutral",children:"Add"})]},S.id))}):f?null:e.jsx("p",{className:W.emptySelection,children:t.some(S=>S.lifecycleStatus==="active"&&!L.has(S.id))?"No Skills match this search.":"No additional Skills available."}),n.length>0?e.jsx("ul",{className:W.selectedSkills,children:n.map(S=>{const _=R.get(S);return e.jsxs("li",{children:[e.jsx("span",{className:W.selectedSkillIcon,"aria-hidden":"true",children:e.jsx(Lt,{size:15})}),e.jsxs("span",{children:[e.jsx("strong",{children:_?.name||"Missing Skill"}),e.jsx("small",{children:_?.description||S})]}),e.jsx("button",{type:"button",className:"tf-button-ghost tf-button-compact",disabled:o,onClick:()=>{i(n.filter(H=>H!==S)),$.current?.focus()},children:"Remove"})]},S)})}):e.jsx("p",{className:W.emptySelection,children:"No Skills included in this Role."})]})}function go({hasRole:t,directSkillCount:n,toolKeys:i}){const o=Hn.filter(f=>i.includes(f.key)).map(f=>f.label);return e.jsxs("section",{className:W.effectiveSummary,"aria-label":"Effective configuration preview",children:[e.jsxs("div",{className:W.sectionHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-section",children:"Effective configuration"}),e.jsx("p",{className:"tf-text-helper",children:"A preview of where this Agent’s behavior and access come from."})]}),e.jsx("span",{className:"tf-chip-warning",children:"Partial preview"})]}),e.jsxs("div",{className:W.provenanceGrid,children:[e.jsxs("div",{children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(ts,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"From Role"}),e.jsx("strong",{children:t?"Role guidance selected":"No Role selected"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(Lt,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"Added to Agent"}),e.jsxs("strong",{children:[n," direct ",n===1?"Skill":"Skills"]})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(vi,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"Runtime Tool Access"}),e.jsx("strong",{children:o.length>0?o.join(", "):"No modules selected"})]})]}),e.jsxs("div",{className:W.unavailableProvenance,children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(yi,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"Resources"}),e.jsx("strong",{children:"Not available yet"})]})]})]}),e.jsx("p",{className:W.previewCaveat,children:"Role guidance resolves today. Role-included Skills, Role Tool Access, Connections, and Resources are shown for experience review but are not yet inherited at runtime."})]})}function vo({kind:t}){return e.jsxs("div",{className:W.librarySummary,children:[t==="connections"?e.jsx(vt,{size:20}):e.jsx(tn,{size:20}),e.jsx("strong",{children:t==="connections"?"No Connections configured":"No Resource Collections yet"}),e.jsx("span",{children:t==="connections"?"Connections will make approved external tools and data providers available to Roles and Agents.":"Collections will tell Roles and Agents where to look for trusted information."}),e.jsx("span",{className:"tf-chip-neutral",children:"Preview only"})]})}function yo({kind:t}){const n=t==="connections";return e.jsxs("section",{className:W.workspacePanel,"aria-labelledby":`${t}-preview-title`,children:[e.jsxs("header",{className:W.workspaceHeader,children:[e.jsx("div",{className:W.workspaceTitleIcon,"aria-hidden":"true",children:n?e.jsx(vt,{size:20}):e.jsx(tn,{size:20})}),e.jsxs("div",{children:[e.jsxs("div",{className:W.titleLine,children:[e.jsx("h2",{id:`${t}-preview-title`,className:"tf-heading-page",children:n?"Connections":"Resources"}),e.jsx("span",{className:"tf-chip-warning",children:"Not available yet"})]}),e.jsx("p",{className:"tf-text-secondary",children:n?"Secure workspace integrations make external tools and provider data available for explicit Role and Agent access.":"Resource Collections define trusted places Agents can search without loading full source content into every prompt."})]}),e.jsxs("button",{type:"button",className:`tf-button-primary ${W.futureAction}`,disabled:!0,children:[n?e.jsx(bi,{size:15}):e.jsx(xi,{size:15}),n?"Add Connection":"New Collection"]})]}),e.jsxs("div",{className:W.relationshipFlow,"aria-label":"Configuration relationship",children:[e.jsx("span",{children:"Workspace"}),e.jsx("strong",{children:n?"Connection":"Resource Collection"}),e.jsx("span",{children:"Role"}),e.jsx("span",{children:"Agent"}),e.jsx("span",{children:"Runtime"})]}),e.jsx("div",{className:W.previewCards,children:n?e.jsxs(e.Fragment,{children:[e.jsx(Yt,{icon:e.jsx(Dn,{size:18}),title:"Taskforce managed tools",description:"Built-in modules use Taskforce-managed credentials and the current allowlisted runtime.",status:"Available now",available:!0}),e.jsx(Yt,{icon:e.jsx(tn,{size:18}),title:"Real estate data provider",description:"Example: search listings, retrieve property details, and read market statistics.",status:"Connection required"}),e.jsx(Yt,{icon:e.jsx(vt,{size:18}),title:"External MCP server",description:"Approved server tools will be imported individually with scopes and audit controls.",status:"Not available yet"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Yt,{icon:e.jsx(Wa,{size:18}),title:"Taskforce documents",description:"Curate existing workspace documents into a reusable source collection.",status:"Collection manager required"}),e.jsx(Yt,{icon:e.jsx(ji,{size:18}),title:"News sources",description:"Example: trusted publications, feeds, topics, regions, and recency rules.",status:"Provider required"}),e.jsx(Yt,{icon:e.jsx(Bn,{size:18}),title:"Web and data sources",description:"Allowed domains and connected datasets will be searched on demand.",status:"Not available yet"})]})}),e.jsxs("div",{className:W.disabledExplanation,children:[e.jsx(ki,{size:16}),e.jsxs("div",{children:[e.jsx("strong",{children:"Why this is disabled"}),e.jsx("span",{children:n?"Credential storage, scopes, connection health, and external tool allowlisting are not implemented.":"Collection persistence, authorization, retrieval, and marketplace portability are not implemented."})]})]})]})}function Ia({icon:t,title:n,description:i,status:o}){return e.jsxs("div",{className:W.unavailableCapability,"aria-disabled":"true",children:[e.jsx("span",{className:W.moduleIcon,"aria-hidden":"true",children:t}),e.jsxs("span",{className:W.moduleCopy,children:[e.jsx("strong",{children:n}),e.jsx("small",{children:i})]}),e.jsx("span",{className:"tf-chip-neutral",children:o})]})}function Yt({icon:t,title:n,description:i,status:o,available:f=!1}){return e.jsxs("article",{className:`${W.previewCard} ${f?W.previewCardAvailable:""}`.trim(),children:[e.jsx("div",{className:W.previewCardIcon,children:t}),e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-card",children:n}),e.jsx("p",{className:"tf-text-secondary",children:i})]}),e.jsx("span",{className:f?"tf-chip-success":"tf-chip-neutral",children:o})]})}const bo="_root_3ejva_1",xo="_rootExternalLibrary_3ejva_11",jo="_library_3ejva_15",ko="_libraryExternal_3ejva_26",So="_libraryHeader_3ejva_39",Co="_search_3ejva_50",No="_retiredToggle_3ejva_78",Ao="_libraryList_3ejva_86",wo="_libraryState_3ejva_95",_o="_libraryError_3ejva_107",To="_libraryStateIcon_3ejva_112",Ro="_libraryCard_3ejva_117",Eo="_libraryCardSelected_3ejva_139",Io="_libraryCardIcon_3ejva_145",$o="_libraryCardLogo_3ejva_156",Lo="_libraryCardBody_3ejva_168",Po="_editor_3ejva_192",Mo="_editorHeader_3ejva_199",Do="_editorTitle_3ejva_213",Oo="_editorTitleLine_3ejva_225",zo="_headerActions_3ejva_240",Uo="_feedbackError_3ejva_247",Go="_feedbackSuccess_3ejva_248",Bo="_confirmation_3ejva_249",Ho="_fieldError_3ejva_275",Fo="_empty_3ejva_300",Ko="_emptyIcon_3ejva_310",qo="_editorGrid_3ejva_321",Vo="_formColumn_3ejva_331",Wo="_previewColumn_3ejva_337",Jo="_previewHeader_3ejva_348",Yo="_previewNote_3ejva_359",Qo="_preview_3ejva_337",Xo="_previewEmpty_3ejva_380",Zo="_metrics_3ejva_394",el="_lifecycleAction_3ejva_412",tl="_history_3ejva_422",sl="_spinner_3ejva_477",nl="_visuallyHidden_3ejva_481",T={root:bo,rootExternalLibrary:xo,library:jo,libraryExternal:ko,libraryHeader:So,search:Co,retiredToggle:No,libraryList:Ao,libraryState:wo,libraryError:_o,libraryStateIcon:To,libraryCard:Ro,libraryCardSelected:Eo,libraryCardIcon:Io,libraryCardLogo:$o,libraryCardBody:Lo,editor:Po,editorHeader:Mo,editorTitle:Do,editorTitleLine:Oo,headerActions:zo,feedbackError:Uo,feedbackSuccess:Go,confirmation:Bo,fieldError:Ho,empty:Fo,emptyIcon:Ko,editorGrid:qo,formColumn:Vo,previewColumn:Wo,previewHeader:Jo,previewNote:Yo,preview:Qo,previewEmpty:Xo,metrics:Zo,lifecycleAction:el,history:tl,spinner:sl,visuallyHidden:nl};function sr({singularLabel:t,pluralLabel:n,description:i,icon:o,items:f,selectedId:w,searchValue:N,onSearchChange:x,showRetired:k,onShowRetiredChange:$,loading:L,error:K,emptyMessage:I,onRetry:R,onCreate:S,onSelect:_,libraryPortalTarget:H}){const Y=e.jsxs(e.Fragment,{children:[H?e.jsxs("button",{type:"button",className:"tf-button-primary tf-button-compact",onClick:S,children:[e.jsx(Pt,{size:14})," New ",t]}):e.jsxs("div",{className:T.libraryHeader,children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"tf-heading-card",children:["Available ",n]}),e.jsx("p",{className:"tf-text-helper",children:i})]}),e.jsxs("button",{type:"button",className:"tf-button-primary tf-button-compact",onClick:S,children:[e.jsx(Pt,{size:14})," New"]})]}),e.jsxs("label",{className:T.search,children:[e.jsx(Bn,{size:14,"aria-hidden":"true"}),e.jsxs("span",{className:T.visuallyHidden,children:["Search ",n]}),e.jsx("input",{"aria-label":`Search ${n}`,value:N,onChange:z=>x(z.target.value),placeholder:`Search ${n.toLowerCase()}`})]}),e.jsxs("label",{className:T.retiredToggle,children:[e.jsx("input",{type:"checkbox",checked:k,onChange:z=>$(z.target.checked)}),"Show retired"]}),e.jsx("div",{className:T.libraryList,"aria-busy":L,children:L?e.jsxs("div",{className:T.libraryState,children:[e.jsx(je,{size:16,className:T.spinner,"aria-hidden":"true"}),"Loading ",n,"…"]}):K?e.jsxs("div",{className:`${T.libraryState} ${T.libraryError}`,role:"alert",children:[e.jsx("span",{children:K}),R?e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:R,children:"Retry"}):null]}):f.length===0?e.jsxs("div",{className:T.libraryState,children:[e.jsx("span",{className:T.libraryStateIcon,"aria-hidden":"true",children:o}),I]}):f.map(z=>{const ie=z.id===w;return e.jsxs("button",{type:"button",className:`${T.libraryCard} ${ie?T.libraryCardSelected:""}`.trim(),onClick:()=>_(z.id),"aria-pressed":ie,children:[e.jsx("span",{className:T.libraryCardIcon,"aria-hidden":"true",children:o}),e.jsxs("span",{className:T.libraryCardBody,children:[e.jsx("strong",{children:z.name}),e.jsx("span",{children:z.description})]}),z.lifecycleStatus==="retired"?e.jsx("span",{className:"tf-chip-warning",children:"Retired"}):null]},z.id)})})]});return H?qa.createPortal(e.jsx("div",{className:`${T.library} ${T.libraryExternal}`,"aria-label":`${t} list`,children:Y}),H):e.jsx("aside",{className:T.library,"aria-label":`${t} Library`,children:Y})}function nr({icon:t,title:n,description:i,revision:o,retired:f=!1,showActions:w,dirty:N,saving:x,onReset:k,onSave:$}){return e.jsxs("header",{className:T.editorHeader,children:[e.jsxs("div",{className:T.editorTitle,children:[e.jsx("span",{"aria-hidden":"true",children:t}),e.jsxs("div",{children:[e.jsxs("div",{className:T.editorTitleLine,children:[e.jsx("h2",{className:"tf-heading-page",children:n}),f?e.jsx("span",{className:"tf-chip-warning",children:"Retired"}):null,!f&&o?e.jsxs("span",{className:"tf-chip-accent",children:["Revision ",o]}):null]}),e.jsx("p",{className:"tf-text-secondary",children:i})]})]}),w?e.jsxs("div",{className:T.headerActions,children:[e.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",disabled:!N||x,onClick:k,children:[e.jsx(nn,{size:14})," Reset"]}),e.jsxs("button",{type:"button",className:"tf-button-primary tf-button-compact",disabled:!N||x||f,onClick:$,children:[x?e.jsx(je,{size:14,className:T.spinner}):e.jsx(On,{size:14}),"Save"]})]}):null]})}function zn({type:t,message:n}){return e.jsxs("div",{className:t==="error"?T.feedbackError:T.feedbackSuccess,role:t==="error"?"alert":"status",children:[t==="error"?e.jsx(st,{size:15}):e.jsx(Cs,{size:15}),e.jsx("span",{children:n})]})}function ar(t,n){return new Map(n?t.map(i=>[i.path,i.message]):[])}function rr(t,n){const i=t.find(o=>n[o.path])?.path;i&&window.requestAnimationFrame(()=>n[i]?.focus())}function nt({id:t,message:n}){return n?e.jsx("small",{id:t,className:T.fieldError,children:n}):null}function ir({icon:t,title:n,description:i,actionLabel:o,onCreate:f}){return e.jsxs("div",{className:T.empty,children:[e.jsx("span",{className:T.emptyIcon,"aria-hidden":"true",children:t}),e.jsx("h3",{className:"tf-empty-title",children:n}),e.jsx("p",{className:"tf-empty-copy",children:i}),e.jsxs("button",{type:"button",className:"tf-button-primary",onClick:f,children:[e.jsx(Pt,{size:15})," ",o]})]})}function or({title:t,message:n,entityLabel:i,saving:o,onConfirm:f,onCancel:w}){const N=a.useId(),x=a.useId(),k=a.useRef(null);return a.useEffect(()=>{const $=document.activeElement instanceof HTMLElement?document.activeElement:null;return k.current?.focus(),()=>{$?.isConnected&&$.focus()}},[]),e.jsxs("div",{className:T.confirmation,role:"alertdialog","aria-modal":"false","aria-labelledby":N,"aria-describedby":x,onKeyDown:$=>{$.key!=="Escape"||o||($.preventDefault(),w())},children:[e.jsxs("div",{children:[e.jsx("strong",{id:N,children:t}),e.jsx("span",{id:x,children:n})]}),e.jsxs("button",{type:"button",className:"tf-button-destructive tf-button-compact",disabled:o,onClick:f,"aria-label":`Confirm ${i} retirement`,children:[e.jsx(Zt,{size:14})," Retire ",i]}),e.jsxs("button",{ref:k,type:"button",className:"tf-button-ghost tf-button-compact",disabled:o,onClick:w,"aria-label":`Cancel ${i} retirement`,children:[e.jsx(yt,{size:14})," Cancel"]})]})}function lr({entityLabel:t,note:n,meta:i,children:o,metrics:f=[],revisions:w=[],lifecycleStatus:N,saving:x=!1,retireDescription:k,restoreDescription:$,onRetire:L,onRestore:K}){const I=!!(N&&k&&$&&L&&K);return e.jsxs("aside",{className:T.previewColumn,"aria-label":`Compiled ${t} preview`,children:[e.jsxs("div",{className:T.previewHeader,children:[e.jsxs("div",{children:[e.jsx("span",{className:"tf-label-micro",children:"Runtime preview"}),e.jsx("h3",{className:"tf-heading-section",children:"Compiled runtime preview"})]}),i]}),e.jsx("p",{className:T.previewNote,children:n}),o,f.length>0?e.jsx("div",{className:T.metrics,children:f.map(R=>e.jsxs("div",{children:[e.jsx("span",{children:R.label}),e.jsx("strong",{children:R.value})]},R.label))}):null,w.length>0?e.jsxs("details",{className:T.history,children:[e.jsxs("summary",{children:[e.jsx(Si,{size:12})," Revision history"]}),e.jsx("ol",{children:w.map(R=>e.jsxs("li",{children:[e.jsxs("strong",{children:["Revision ",R.revision]}),e.jsx("span",{children:new Date(R.createdAt).toLocaleString()}),e.jsx("code",{children:R.contentHash.slice(0,12)})]},R.revision))})]}):null,I?e.jsxs("div",{className:T.lifecycleAction,children:[e.jsxs("div",{children:[e.jsx("strong",{children:N==="retired"?`Restore ${t}`:`Retire ${t}`}),e.jsx("span",{children:N==="retired"?$:k})]}),N==="retired"?e.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",disabled:x,onClick:K,children:[e.jsx(nn,{size:14})," Restore"]}):e.jsxs("button",{type:"button",className:"tf-button-destructive tf-button-compact",disabled:x,onClick:L,children:[e.jsx(Ci,{size:14})," Retire"]})]}):null]})}const al="_formSection_dyv9a_1",rl="_sectionHeader_dyv9a_9",il="_fieldGrid_dyv9a_13",ol="_configurationPreview_dyv9a_27",ll="_resourcesPreview_dyv9a_33",cl="_previewCode_dyv9a_49",ot={formSection:al,sectionHeader:rl,fieldGrid:il,configurationPreview:ol,resourcesPreview:ll,previewCode:cl},gs={name:"",shortDescription:"",purpose:"",responsibilities:"",expectedOutputs:"",workingGuidance:"",skillRefs:"",capabilityGroups:""};function es(t){return t.split(`
|
|
8
|
+
`)}function Ii(t){return tr(Ei(t))}const $i="_toolAccess_2stgb_1",Li="_skillSelector_2stgb_2",Pi="_effectiveSummary_2stgb_3",Mi="_sectionHeader_2stgb_13",Di="_workspaceHeader_2stgb_14",Oi="_titleLine_2stgb_32",zi="_moduleGrid_2stgb_36",Ui="_moduleOption_2stgb_42",Gi="_unavailableCapability_2stgb_43",Bi="_moduleOptionSelected_2stgb_66",Hi="_moduleIcon_2stgb_76",Fi="_selectedSkillIcon_2stgb_77",Ki="_provenanceIcon_2stgb_78",qi="_moduleCopy_2stgb_91",Vi="_futureGroups_2stgb_110",Wi="_unknownNotice_2stgb_122",Ji="_disabledExplanation_2stgb_123",Yi="_catalogError_2stgb_147",Qi="_selectedSkills_2stgb_160",Xi="_skillSearch_2stgb_168",Zi="_skillResults_2stgb_188",eo="_emptySelection_2stgb_266",to="_provenanceGrid_2stgb_275",so="_unavailableProvenance_2stgb_312",no="_previewCaveat_2stgb_316",ao="_librarySummary_2stgb_323",ro="_workspacePanel_2stgb_346",io="_futureAction_2stgb_356",oo="_workspaceTitleIcon_2stgb_370",lo="_previewCardIcon_2stgb_371",co="_relationshipFlow_2stgb_389",uo="_previewCards_2stgb_420",fo="_previewCard_2stgb_371",mo="_previewCardAvailable_2stgb_438",W={toolAccess:$i,skillSelector:Li,effectiveSummary:Pi,sectionHeader:Mi,workspaceHeader:Di,titleLine:Oi,moduleGrid:zi,moduleOption:Ui,unavailableCapability:Gi,moduleOptionSelected:Bi,moduleIcon:Hi,selectedSkillIcon:Fi,provenanceIcon:Ki,moduleCopy:qi,futureGroups:Vi,unknownNotice:Wi,disabledExplanation:Ji,catalogError:Yi,selectedSkills:Qi,skillSearch:Xi,skillResults:Zi,emptySelection:eo,provenanceGrid:to,unavailableProvenance:so,previewCaveat:no,librarySummary:ao,workspacePanel:ro,futureAction:io,workspaceTitleIcon:oo,previewCardIcon:lo,relationshipFlow:co,previewCards:uo,previewCard:fo,previewCardAvailable:mo},Hn=[{key:"tasks",label:"Tasks and schedule",description:"Read and update tasks, checklists, task workflows, and schedule context.",icon:Cs},{key:"planning",label:"Initiatives and workstreams",description:"Read planning structure and add planning comments.",icon:mi},{key:"documents",label:"Documents and reviews",description:"Find and read Taskforce documents, inspect review context, and post document review feedback.",icon:Wa},{key:"images",label:"Image Notes",description:"Find images and inspect annotation sessions.",icon:pi},{key:"workspace",label:"Workspace information",description:"Read workspace configuration, people, and managed Agent identity.",icon:hi}],po=Hn.map(t=>t.key);function Fn({selectedKeys:t,onChange:n,disabled:i=!1,mode:o="active",title:f="Tool Access",description:w,showFutureTools:N=!0,requireOne:x=!1,hasCustomOverrides:k=!1}){const $=new Set(t),L=new Set(po),K=t.filter(_=>!L.has(_)),I=o==="active"?"Available now":o==="requirement"?"Requirement preview":"Inheritance preview",R=o==="active"?"tf-chip-success":"tf-chip-warning",S=(_,H)=>{if(!n||i)return;const Y=H?[...t.filter(ie=>ie!==_),_]:t.filter(ie=>ie!==_),z=Y.filter(ie=>L.has(ie)).length;x&&z===0||n(Y)};return e.jsxs("section",{className:W.toolAccess,"aria-label":f,children:[e.jsxs("div",{className:W.sectionHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-section",children:f}),e.jsx("p",{className:"tf-text-helper",children:w||"Choose which Taskforce modules this Agent can use. Fewer enabled tools reduce runtime tool context."})]}),e.jsx("span",{className:R,children:I})]}),e.jsx("div",{className:W.moduleGrid,children:Hn.map(_=>{const H=_.icon,Y=$.has(_.key);return e.jsxs("label",{className:`${W.moduleOption} ${Y?W.moduleOptionSelected:""}`.trim(),children:[e.jsx("input",{type:"checkbox",checked:Y,disabled:i||!n,onChange:z=>S(_.key,z.target.checked)}),e.jsx("span",{className:W.moduleIcon,"aria-hidden":"true",children:e.jsx(H,{size:16})}),e.jsxs("span",{className:W.moduleCopy,children:[e.jsx("strong",{children:_.label}),e.jsx("small",{children:_.description})]})]},_.key)})}),k?e.jsxs("div",{className:W.unknownNotice,role:"status",children:[e.jsx(Dn,{size:14}),e.jsx("span",{children:"Custom per-tool overrides are active. Change any module selection to replace them with the module policy shown here."})]}):null,K.length>0?e.jsxs("div",{className:W.unknownNotice,role:"status",children:[e.jsx(Dn,{size:14}),e.jsxs("span",{children:["Preserved legacy keys: ",K.join(", "),". They are not available in the current managed Tool Access catalog."]}),n&&!i?e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:()=>n(t.filter(_=>L.has(_))),children:"Remove unsupported keys"}):null]}):null,N?e.jsxs("div",{className:W.futureGroups,children:[e.jsx(Ia,{icon:e.jsx(vt,{size:16}),title:"Connected tools",description:"Workspace-approved APIs and external MCP tools will appear here.",status:"Connections not available yet"}),e.jsx(Ia,{icon:e.jsx(gi,{size:16}),title:"Code Workspace",description:"Repository read, edit, Git, and publication access will be configured separately.",status:"Code Workspace not configured"})]}):null]})}function ho({skills:t,selectedIds:n,onChange:i,disabled:o=!1,loading:f=!1,error:w="",onRetry:N}){const[x,k]=a.useState(""),$=a.useRef(null),L=new Set(n),K=x.trim().toLowerCase(),I=t.filter(S=>S.lifecycleStatus==="active"&&!L.has(S.id)).filter(S=>!K||S.name.toLowerCase().includes(K)||S.description.toLowerCase().includes(K)).slice(0,8),R=new Map(t.map(S=>[S.id,S]));return e.jsxs("section",{className:W.skillSelector,"aria-label":"Included Skills",children:[e.jsxs("div",{className:W.sectionHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-section",children:"Included Skills"}),e.jsx("p",{className:"tf-text-helper",children:"Select Skills by name. They are saved with this Role now; automatic Agent inheritance is preview-only."})]}),e.jsx("span",{className:"tf-chip-warning",children:"Inheritance preview"})]}),e.jsxs("label",{className:"tf-field-stack",children:[e.jsx("span",{className:"tf-field-label",children:"Find a Skill"}),e.jsxs("span",{className:W.skillSearch,children:[e.jsx(Bn,{size:15,"aria-hidden":"true"}),e.jsx("input",{ref:$,type:"search",className:"tf-field-shell","aria-label":"Find a Skill to include",placeholder:f?"Loading Skills…":"Search by name or description",value:x,disabled:o||f,onChange:S=>k(S.target.value)})]})]}),w?e.jsxs("div",{className:W.catalogError,role:"alert",children:[e.jsx("span",{children:w}),N?e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:N,children:"Retry"}):null]}):!f&&I.length>0?e.jsx("div",{className:W.skillResults,"aria-label":"Available Skills",children:I.map(S=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{i([...n,S.id]),k(""),$.current?.focus()},children:[e.jsxs("span",{children:[e.jsx("strong",{children:S.name}),e.jsx("small",{children:S.description||"No description"})]}),e.jsx("span",{className:"tf-chip-neutral",children:"Add"})]},S.id))}):f?null:e.jsx("p",{className:W.emptySelection,children:t.some(S=>S.lifecycleStatus==="active"&&!L.has(S.id))?"No Skills match this search.":"No additional Skills available."}),n.length>0?e.jsx("ul",{className:W.selectedSkills,children:n.map(S=>{const _=R.get(S);return e.jsxs("li",{children:[e.jsx("span",{className:W.selectedSkillIcon,"aria-hidden":"true",children:e.jsx(Lt,{size:15})}),e.jsxs("span",{children:[e.jsx("strong",{children:_?.name||"Missing Skill"}),e.jsx("small",{children:_?.description||S})]}),e.jsx("button",{type:"button",className:"tf-button-ghost tf-button-compact",disabled:o,onClick:()=>{i(n.filter(H=>H!==S)),$.current?.focus()},children:"Remove"})]},S)})}):e.jsx("p",{className:W.emptySelection,children:"No Skills included in this Role."})]})}function go({hasRole:t,directSkillCount:n,toolKeys:i}){const o=Hn.filter(f=>i.includes(f.key)).map(f=>f.label);return e.jsxs("section",{className:W.effectiveSummary,"aria-label":"Effective configuration preview",children:[e.jsxs("div",{className:W.sectionHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-section",children:"Effective configuration"}),e.jsx("p",{className:"tf-text-helper",children:"A preview of where this Agent’s behavior and access come from."})]}),e.jsx("span",{className:"tf-chip-warning",children:"Partial preview"})]}),e.jsxs("div",{className:W.provenanceGrid,children:[e.jsxs("div",{children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(ts,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"From Role"}),e.jsx("strong",{children:t?"Role guidance selected":"No Role selected"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(Lt,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"Added to Agent"}),e.jsxs("strong",{children:[n," direct ",n===1?"Skill":"Skills"]})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(vi,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"Runtime Tool Access"}),e.jsx("strong",{children:o.length>0?o.join(", "):"No modules selected"})]})]}),e.jsxs("div",{className:W.unavailableProvenance,children:[e.jsx("span",{className:W.provenanceIcon,children:e.jsx(yi,{size:15})}),e.jsxs("span",{children:[e.jsx("small",{children:"Resources"}),e.jsx("strong",{children:"Not available yet"})]})]})]}),e.jsx("p",{className:W.previewCaveat,children:"Role guidance resolves today. Role-included Skills, Role Tool Access, Connections, and Resources are shown for experience review but are not yet inherited at runtime."})]})}function vo({kind:t}){return e.jsxs("div",{className:W.librarySummary,children:[t==="connections"?e.jsx(vt,{size:20}):e.jsx(tn,{size:20}),e.jsx("strong",{children:t==="connections"?"No Connections configured":"No Resource Collections yet"}),e.jsx("span",{children:t==="connections"?"Connections will make approved external tools and data providers available to Roles and Agents.":"Collections will tell Roles and Agents where to look for trusted information."}),e.jsx("span",{className:"tf-chip-neutral",children:"Preview only"})]})}function yo({kind:t}){const n=t==="connections";return e.jsxs("section",{className:W.workspacePanel,"aria-labelledby":`${t}-preview-title`,children:[e.jsxs("header",{className:W.workspaceHeader,children:[e.jsx("div",{className:W.workspaceTitleIcon,"aria-hidden":"true",children:n?e.jsx(vt,{size:20}):e.jsx(tn,{size:20})}),e.jsxs("div",{children:[e.jsxs("div",{className:W.titleLine,children:[e.jsx("h2",{id:`${t}-preview-title`,className:"tf-heading-page",children:n?"Connections":"Resources"}),e.jsx("span",{className:"tf-chip-warning",children:"Not available yet"})]}),e.jsx("p",{className:"tf-text-secondary",children:n?"Secure workspace integrations make external tools and provider data available for explicit Role and Agent access.":"Resource Collections define trusted places Agents can search without loading full source content into every prompt."})]}),e.jsxs("button",{type:"button",className:`tf-button-primary ${W.futureAction}`,disabled:!0,children:[n?e.jsx(bi,{size:15}):e.jsx(xi,{size:15}),n?"Add Connection":"New Collection"]})]}),e.jsxs("div",{className:W.relationshipFlow,"aria-label":"Configuration relationship",children:[e.jsx("span",{children:"Workspace"}),e.jsx("strong",{children:n?"Connection":"Resource Collection"}),e.jsx("span",{children:"Role"}),e.jsx("span",{children:"Agent"}),e.jsx("span",{children:"Runtime"})]}),e.jsx("div",{className:W.previewCards,children:n?e.jsxs(e.Fragment,{children:[e.jsx(Yt,{icon:e.jsx(Dn,{size:18}),title:"Taskforce managed tools",description:"Built-in modules use Taskforce-managed credentials and the current allowlisted runtime.",status:"Available now",available:!0}),e.jsx(Yt,{icon:e.jsx(tn,{size:18}),title:"Real estate data provider",description:"Example: search listings, retrieve property details, and read market statistics.",status:"Connection required"}),e.jsx(Yt,{icon:e.jsx(vt,{size:18}),title:"External MCP server",description:"Approved server tools will be imported individually with scopes and audit controls.",status:"Not available yet"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Yt,{icon:e.jsx(Wa,{size:18}),title:"Taskforce documents",description:"Curate existing workspace documents into a reusable source collection.",status:"Collection manager required"}),e.jsx(Yt,{icon:e.jsx(ji,{size:18}),title:"News sources",description:"Example: trusted publications, feeds, topics, regions, and recency rules.",status:"Provider required"}),e.jsx(Yt,{icon:e.jsx(Bn,{size:18}),title:"Web and data sources",description:"Allowed domains and connected datasets will be searched on demand.",status:"Not available yet"})]})}),e.jsxs("div",{className:W.disabledExplanation,children:[e.jsx(ki,{size:16}),e.jsxs("div",{children:[e.jsx("strong",{children:"Why this is disabled"}),e.jsx("span",{children:n?"Credential storage, scopes, connection health, and external tool allowlisting are not implemented.":"Collection persistence, authorization, retrieval, and marketplace portability are not implemented."})]})]})]})}function Ia({icon:t,title:n,description:i,status:o}){return e.jsxs("div",{className:W.unavailableCapability,"aria-disabled":"true",children:[e.jsx("span",{className:W.moduleIcon,"aria-hidden":"true",children:t}),e.jsxs("span",{className:W.moduleCopy,children:[e.jsx("strong",{children:n}),e.jsx("small",{children:i})]}),e.jsx("span",{className:"tf-chip-neutral",children:o})]})}function Yt({icon:t,title:n,description:i,status:o,available:f=!1}){return e.jsxs("article",{className:`${W.previewCard} ${f?W.previewCardAvailable:""}`.trim(),children:[e.jsx("div",{className:W.previewCardIcon,children:t}),e.jsxs("div",{children:[e.jsx("h3",{className:"tf-heading-card",children:n}),e.jsx("p",{className:"tf-text-secondary",children:i})]}),e.jsx("span",{className:f?"tf-chip-success":"tf-chip-neutral",children:o})]})}const bo="_root_3ejva_1",xo="_rootExternalLibrary_3ejva_11",jo="_library_3ejva_15",ko="_libraryExternal_3ejva_26",So="_libraryHeader_3ejva_39",Co="_search_3ejva_50",No="_retiredToggle_3ejva_78",Ao="_libraryList_3ejva_86",wo="_libraryState_3ejva_95",_o="_libraryError_3ejva_107",To="_libraryStateIcon_3ejva_112",Ro="_libraryCard_3ejva_117",Eo="_libraryCardSelected_3ejva_139",Io="_libraryCardIcon_3ejva_145",$o="_libraryCardLogo_3ejva_156",Lo="_libraryCardBody_3ejva_168",Po="_editor_3ejva_192",Mo="_editorHeader_3ejva_199",Do="_editorTitle_3ejva_213",Oo="_editorTitleLine_3ejva_225",zo="_headerActions_3ejva_240",Uo="_feedbackError_3ejva_247",Go="_feedbackSuccess_3ejva_248",Bo="_confirmation_3ejva_249",Ho="_fieldError_3ejva_275",Fo="_empty_3ejva_300",Ko="_emptyIcon_3ejva_310",qo="_editorGrid_3ejva_321",Vo="_formColumn_3ejva_331",Wo="_previewColumn_3ejva_337",Jo="_previewHeader_3ejva_348",Yo="_previewNote_3ejva_359",Qo="_preview_3ejva_337",Xo="_previewEmpty_3ejva_380",Zo="_metrics_3ejva_394",el="_lifecycleAction_3ejva_412",tl="_history_3ejva_422",sl="_spinner_3ejva_477",nl="_visuallyHidden_3ejva_481",T={root:bo,rootExternalLibrary:xo,library:jo,libraryExternal:ko,libraryHeader:So,search:Co,retiredToggle:No,libraryList:Ao,libraryState:wo,libraryError:_o,libraryStateIcon:To,libraryCard:Ro,libraryCardSelected:Eo,libraryCardIcon:Io,libraryCardLogo:$o,libraryCardBody:Lo,editor:Po,editorHeader:Mo,editorTitle:Do,editorTitleLine:Oo,headerActions:zo,feedbackError:Uo,feedbackSuccess:Go,confirmation:Bo,fieldError:Ho,empty:Fo,emptyIcon:Ko,editorGrid:qo,formColumn:Vo,previewColumn:Wo,previewHeader:Jo,previewNote:Yo,preview:Qo,previewEmpty:Xo,metrics:Zo,lifecycleAction:el,history:tl,spinner:sl,visuallyHidden:nl};function sr({singularLabel:t,pluralLabel:n,description:i,icon:o,items:f,selectedId:w,searchValue:N,onSearchChange:x,showRetired:k,onShowRetiredChange:$,loading:L,error:K,emptyMessage:I,onRetry:R,onCreate:S,onSelect:_,libraryPortalTarget:H}){const Y=e.jsxs(e.Fragment,{children:[H?e.jsxs("button",{type:"button",className:"tf-button-primary tf-button-compact",onClick:S,children:[e.jsx(Pt,{size:14})," New ",t]}):e.jsxs("div",{className:T.libraryHeader,children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"tf-heading-card",children:["Available ",n]}),e.jsx("p",{className:"tf-text-helper",children:i})]}),e.jsxs("button",{type:"button",className:"tf-button-primary tf-button-compact",onClick:S,children:[e.jsx(Pt,{size:14})," New"]})]}),e.jsxs("label",{className:T.search,children:[e.jsx(Bn,{size:14,"aria-hidden":"true"}),e.jsxs("span",{className:T.visuallyHidden,children:["Search ",n]}),e.jsx("input",{"aria-label":`Search ${n}`,value:N,onChange:z=>x(z.target.value),placeholder:`Search ${n.toLowerCase()}`})]}),e.jsxs("label",{className:T.retiredToggle,children:[e.jsx("input",{type:"checkbox",checked:k,onChange:z=>$(z.target.checked)}),"Show retired"]}),e.jsx("div",{className:T.libraryList,"aria-busy":L,children:L?e.jsxs("div",{className:T.libraryState,children:[e.jsx(je,{size:16,className:T.spinner,"aria-hidden":"true"}),"Loading ",n,"…"]}):K?e.jsxs("div",{className:`${T.libraryState} ${T.libraryError}`,role:"alert",children:[e.jsx("span",{children:K}),R?e.jsx("button",{type:"button",className:"tf-button-secondary tf-button-compact",onClick:R,children:"Retry"}):null]}):f.length===0?e.jsxs("div",{className:T.libraryState,children:[e.jsx("span",{className:T.libraryStateIcon,"aria-hidden":"true",children:o}),I]}):f.map(z=>{const ie=z.id===w;return e.jsxs("button",{type:"button",className:`${T.libraryCard} ${ie?T.libraryCardSelected:""}`.trim(),onClick:()=>_(z.id),"aria-pressed":ie,children:[e.jsx("span",{className:T.libraryCardIcon,"aria-hidden":"true",children:o}),e.jsxs("span",{className:T.libraryCardBody,children:[e.jsx("strong",{children:z.name}),e.jsx("span",{children:z.description})]}),z.lifecycleStatus==="retired"?e.jsx("span",{className:"tf-chip-warning",children:"Retired"}):null]},z.id)})})]});return H?qa.createPortal(e.jsx("div",{className:`${T.library} ${T.libraryExternal}`,"aria-label":`${t} list`,children:Y}),H):e.jsx("aside",{className:T.library,"aria-label":`${t} Library`,children:Y})}function nr({icon:t,title:n,description:i,revision:o,retired:f=!1,showActions:w,dirty:N,saving:x,onReset:k,onSave:$}){return e.jsxs("header",{className:T.editorHeader,children:[e.jsxs("div",{className:T.editorTitle,children:[e.jsx("span",{"aria-hidden":"true",children:t}),e.jsxs("div",{children:[e.jsxs("div",{className:T.editorTitleLine,children:[e.jsx("h2",{className:"tf-heading-page",children:n}),f?e.jsx("span",{className:"tf-chip-warning",children:"Retired"}):null,!f&&o?e.jsxs("span",{className:"tf-chip-accent",children:["Revision ",o]}):null]}),e.jsx("p",{className:"tf-text-secondary",children:i})]})]}),w?e.jsxs("div",{className:T.headerActions,children:[e.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",disabled:!N||x,onClick:k,children:[e.jsx(nn,{size:14})," Reset"]}),e.jsxs("button",{type:"button",className:"tf-button-primary tf-button-compact",disabled:!N||x||f,onClick:$,children:[x?e.jsx(je,{size:14,className:T.spinner}):e.jsx(On,{size:14}),"Save"]})]}):null]})}function zn({type:t,message:n}){return e.jsxs("div",{className:t==="error"?T.feedbackError:T.feedbackSuccess,role:t==="error"?"alert":"status",children:[t==="error"?e.jsx(st,{size:15}):e.jsx(Cs,{size:15}),e.jsx("span",{children:n})]})}function ar(t,n){return new Map(n?t.map(i=>[i.path,i.message]):[])}function rr(t,n){const i=t.find(o=>n[o.path])?.path;i&&window.requestAnimationFrame(()=>n[i]?.focus())}function nt({id:t,message:n}){return n?e.jsx("small",{id:t,className:T.fieldError,children:n}):null}function ir({icon:t,title:n,description:i,actionLabel:o,onCreate:f}){return e.jsxs("div",{className:T.empty,children:[e.jsx("span",{className:T.emptyIcon,"aria-hidden":"true",children:t}),e.jsx("h3",{className:"tf-empty-title",children:n}),e.jsx("p",{className:"tf-empty-copy",children:i}),e.jsxs("button",{type:"button",className:"tf-button-primary",onClick:f,children:[e.jsx(Pt,{size:15})," ",o]})]})}function or({title:t,message:n,entityLabel:i,saving:o,onConfirm:f,onCancel:w}){const N=a.useId(),x=a.useId(),k=a.useRef(null);return a.useEffect(()=>{const $=document.activeElement instanceof HTMLElement?document.activeElement:null;return k.current?.focus(),()=>{$?.isConnected&&$.focus()}},[]),e.jsxs("div",{className:T.confirmation,role:"alertdialog","aria-modal":"false","aria-labelledby":N,"aria-describedby":x,onKeyDown:$=>{$.key!=="Escape"||o||($.preventDefault(),w())},children:[e.jsxs("div",{children:[e.jsx("strong",{id:N,children:t}),e.jsx("span",{id:x,children:n})]}),e.jsxs("button",{type:"button",className:"tf-button-destructive tf-button-compact",disabled:o,onClick:f,"aria-label":`Confirm ${i} retirement`,children:[e.jsx(Zt,{size:14})," Retire ",i]}),e.jsxs("button",{ref:k,type:"button",className:"tf-button-ghost tf-button-compact",disabled:o,onClick:w,"aria-label":`Cancel ${i} retirement`,children:[e.jsx(yt,{size:14})," Cancel"]})]})}function lr({entityLabel:t,note:n,meta:i,children:o,metrics:f=[],revisions:w=[],lifecycleStatus:N,saving:x=!1,retireDescription:k,restoreDescription:$,onRetire:L,onRestore:K}){const I=!!(N&&k&&$&&L&&K);return e.jsxs("aside",{className:T.previewColumn,"aria-label":`Compiled ${t} preview`,children:[e.jsxs("div",{className:T.previewHeader,children:[e.jsxs("div",{children:[e.jsx("span",{className:"tf-label-micro",children:"Runtime preview"}),e.jsx("h3",{className:"tf-heading-section",children:"Compiled runtime preview"})]}),i]}),e.jsx("p",{className:T.previewNote,children:n}),o,f.length>0?e.jsx("div",{className:T.metrics,children:f.map(R=>e.jsxs("div",{children:[e.jsx("span",{children:R.label}),e.jsx("strong",{children:R.value})]},R.label))}):null,w.length>0?e.jsxs("details",{className:T.history,children:[e.jsxs("summary",{children:[e.jsx(Si,{size:12})," Revision history"]}),e.jsx("ol",{children:w.map(R=>e.jsxs("li",{children:[e.jsxs("strong",{children:["Revision ",R.revision]}),e.jsx("span",{children:new Date(R.createdAt).toLocaleString()}),e.jsx("code",{children:R.contentHash.slice(0,12)})]},R.revision))})]}):null,I?e.jsxs("div",{className:T.lifecycleAction,children:[e.jsxs("div",{children:[e.jsx("strong",{children:N==="retired"?`Restore ${t}`:`Retire ${t}`}),e.jsx("span",{children:N==="retired"?$:k})]}),N==="retired"?e.jsxs("button",{type:"button",className:"tf-button-secondary tf-button-compact",disabled:x,onClick:K,children:[e.jsx(nn,{size:14})," Restore"]}):e.jsxs("button",{type:"button",className:"tf-button-destructive tf-button-compact",disabled:x,onClick:L,children:[e.jsx(Ci,{size:14})," Retire"]})]}):null]})}const al="_formSection_dyv9a_1",rl="_sectionHeader_dyv9a_9",il="_fieldGrid_dyv9a_13",ol="_configurationPreview_dyv9a_27",ll="_resourcesPreview_dyv9a_33",cl="_previewCode_dyv9a_49",ot={formSection:al,sectionHeader:rl,fieldGrid:il,configurationPreview:ol,resourcesPreview:ll,previewCode:cl},gs={name:"",shortDescription:"",purpose:"",responsibilities:"",expectedOutputs:"",workingGuidance:"",skillRefs:"",capabilityGroups:""};function es(t){return t.split(`
|
|
9
9
|
`).map(n=>n.trim()).filter(Boolean)}function dl(t){return{schemaVersion:1,name:t.name,shortDescription:t.shortDescription,purpose:t.purpose,responsibilities:es(t.responsibilities),expectedOutputs:es(t.expectedOutputs),...t.workingGuidance.trim()?{workingGuidance:t.workingGuidance}:{},recommendations:{skillRefs:es(t.skillRefs),capabilityGroups:es(t.capabilityGroups)}}}function vs(t){return{name:t.definition.name,shortDescription:t.definition.shortDescription,purpose:t.definition.purpose,responsibilities:t.definition.responsibilities.join(`
|
|
10
10
|
`),expectedOutputs:t.definition.expectedOutputs.join(`
|
|
11
11
|
`),workingGuidance:t.definition.workingGuidance||"",skillRefs:t.definition.recommendations.skillRefs.join(`
|