@taskforcehq/taskforce 0.3.304 → 0.3.306
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 +140 -247
- package/dist/Taskforce.module.css +295 -89
- package/dist/TaskforceCore.js +378 -111
- package/dist/TaskforceCore.test.js +1221 -107
- package/dist/assets/fonts/CourierPrime-Bold.woff2 +0 -0
- package/dist/assets/fonts/CourierPrime-BoldItalic.woff2 +0 -0
- package/dist/assets/fonts/CourierPrime-Italic.woff2 +0 -0
- package/dist/assets/fonts/CourierPrime-Regular.woff2 +0 -0
- package/dist/assets/fonts/Noir_medium.woff2 +0 -0
- package/dist/assets/fonts/Noir_regular.woff2 +0 -0
- package/dist/assets/fonts/RussoOne-Regular.woff2 +0 -0
- package/dist/assets/fonts/SpecialElite-Regular.woff2 +0 -0
- package/dist/compat/workspaceSyncCompat.js +52 -2
- package/dist/compat/workspaceSyncCompat.test.js +38 -1
- package/dist/components/context/ContextAttachmentManager.d.ts +14 -0
- package/dist/components/context/ContextAttachmentManager.js +549 -0
- package/dist/components/features/AgentsModule.d.ts +10 -1
- package/dist/components/features/AgentsModule.js +260 -15
- package/dist/components/features/AgentsModule.test.js +255 -5
- package/dist/components/features/DocumentIndex.d.ts +1 -1
- package/dist/components/features/DocumentIndex.js +1 -1
- package/dist/components/features/DocumentViewer.d.ts +6 -2
- package/dist/components/features/DocumentViewer.js +90 -10
- package/dist/components/features/DocumentWorkspace.d.ts +5 -22
- package/dist/components/features/DocumentWorkspace.js +12 -155
- package/dist/components/features/DocumentWorkspace.test.js +226 -6
- package/dist/components/features/TaskSettings.js +29 -3
- package/dist/components/features/TaskSettings.test.js +42 -1
- package/dist/components/features/documentWorkspaceModel.d.ts +24 -0
- package/dist/components/features/documentWorkspaceModel.js +57 -0
- package/dist/components/features/useDocumentWorkspaceController.d.ts +34 -0
- package/dist/components/features/useDocumentWorkspaceController.js +113 -0
- package/dist/components/task/TaskCard.js +19 -28
- package/dist/components/task/TaskCard.test.js +38 -3
- package/dist/components/task/TaskContextUpload.js +4 -526
- package/dist/components/task/TaskForm.d.ts +8 -8
- package/dist/components/task/TaskForm.js +362 -230
- package/dist/components/task/TaskForm.test.js +558 -381
- package/dist/components/task/TaskKanban.d.ts +2 -1
- package/dist/components/task/TaskKanban.js +96 -14
- package/dist/components/task/TaskKanban.test.js +36 -0
- package/dist/components/ui/EditableAvatarButton.d.ts +18 -0
- package/dist/components/ui/EditableAvatarButton.js +18 -0
- package/dist/components/views/PlanComparisonPage.d.ts +9 -1
- package/dist/components/views/PlanComparisonPage.js +70 -17
- package/dist/components/views/PlanComparisonPage.test.js +289 -41
- package/dist/components/views/PlansPage.js +239 -106
- package/dist/components/views/PlansPage.test.js +593 -42
- package/dist/components/views/StandaloneLayout.js +310 -554
- package/dist/components/views/panels/FilterToolbar.test.js +6 -4
- package/dist/components/views/panels/PlanningDrawer.d.ts +8 -1
- package/dist/components/views/panels/PlanningDrawer.js +18 -11
- package/dist/components/views/panels/PlanningDrawer.test.d.ts +1 -0
- package/dist/components/views/panels/PlanningDrawer.test.js +141 -0
- package/dist/components/views/planningScope.d.ts +20 -0
- package/dist/components/views/planningScope.js +25 -0
- package/dist/components/views/planningScope.test.d.ts +1 -0
- package/dist/components/views/planningScope.test.js +60 -0
- package/dist/components/views/standalone/modals/AccountHubModal.d.ts +27 -14
- package/dist/components/views/standalone/modals/AccountHubModal.js +87 -15
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +42 -2
- package/dist/components/views/standalone/modals/AvatarImageManagerModal.d.ts +20 -0
- package/dist/components/views/standalone/modals/AvatarImageManagerModal.js +127 -0
- package/dist/components/views/standalone/modals/EditProfileModal.d.ts +2 -9
- package/dist/components/views/standalone/modals/EditProfileModal.js +3 -2
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.d.ts +9 -0
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.js +6 -0
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +1 -0
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +24 -0
- package/dist/components/views/standalone/modals/SyncStatusModal.d.ts +2 -1
- package/dist/components/views/standalone/modals/SyncStatusModal.js +2 -2
- package/dist/config/envSchema.js +1 -1
- package/dist/core/AiProfileService.d.ts +45 -3
- package/dist/core/AiProfileService.js +774 -63
- package/dist/core/AiProfileService.test.js +22 -2
- package/dist/core/AiProfiles.test.js +761 -2
- package/dist/core/AttachmentLinkService.js +57 -15
- package/dist/core/AuthIdentityService.d.ts +107 -0
- package/dist/core/AuthIdentityService.js +284 -0
- package/dist/core/AuthTokenService.d.ts +4 -0
- package/dist/core/AuthTokenService.js +34 -6
- package/dist/core/AuthTokenService.test.d.ts +1 -0
- package/dist/core/AuthTokenService.test.js +78 -0
- package/dist/core/EntitlementsPolicy.test.js +77 -15
- package/dist/core/GlobalSettingsService.js +115 -6
- package/dist/core/PlanEntitlementService.d.ts +30 -3
- package/dist/core/PlanEntitlementService.js +454 -93
- package/dist/core/PlanFeatureCatalog.test.d.ts +1 -0
- package/dist/core/PlanFeatureCatalog.test.js +84 -0
- package/dist/core/PlanVersionPolicy.test.js +54 -28
- package/dist/core/PlanningEntities.test.js +52 -0
- package/dist/core/SignupMonetizationSettings.test.js +241 -44
- package/dist/core/SyncReconciliationService.js +2 -65
- package/dist/core/SystemAdmin.test.js +244 -88
- package/dist/core/TaskAttachmentsCanonical.test.js +51 -1
- package/dist/core/TaskTaxonomyValidation.test.js +53 -0
- package/dist/core/Taskforce.d.ts +228 -14
- package/dist/core/Taskforce.js +814 -201
- package/dist/core/Taskforce.listTasksSlim.test.d.ts +1 -0
- package/dist/core/Taskforce.listTasksSlim.test.js +91 -0
- package/dist/core/UserProfileAvatarDrafts.test.js +30 -3
- package/dist/core/WorkspaceLifecycleService.js +0 -5
- package/dist/core/WorkspacePermissions.test.js +25 -1
- package/dist/core/WorkspacePlanMode.test.js +128 -27
- package/dist/core/shared.d.ts +3 -1
- package/dist/core/shared.js +16 -1
- package/dist/core/types.d.ts +68 -2
- package/dist/hooks/auth/useTaskforceAuthBootstrap.js +26 -1
- package/dist/hooks/sync/auth.js +3 -1
- package/dist/hooks/sync/bootstrap.js +2 -0
- package/dist/hooks/sync/controlPlane.d.ts +37 -0
- package/dist/hooks/sync/controlPlane.js +78 -0
- package/dist/hooks/sync/controlPlane.test.d.ts +1 -0
- package/dist/hooks/sync/controlPlane.test.js +121 -0
- package/dist/hooks/sync/lifecyclePolicy.d.ts +45 -0
- package/dist/hooks/sync/lifecyclePolicy.js +93 -0
- package/dist/hooks/sync/lifecyclePolicy.test.d.ts +1 -0
- package/dist/hooks/sync/lifecyclePolicy.test.js +124 -0
- package/dist/hooks/sync/orchestratorShared.d.ts +10 -1
- package/dist/hooks/sync/orchestratorShared.js +68 -47
- package/dist/hooks/sync/orchestratorShared.test.js +50 -1
- package/dist/hooks/sync/pullLifecycle.d.ts +31 -0
- package/dist/hooks/sync/pullLifecycle.js +24 -0
- package/dist/hooks/sync/pullLifecycle.test.d.ts +1 -0
- package/dist/hooks/sync/pullLifecycle.test.js +80 -0
- package/dist/hooks/sync/recovery.d.ts +16 -2
- package/dist/hooks/sync/recovery.js +171 -53
- package/dist/hooks/sync/recovery.test.d.ts +1 -0
- package/dist/hooks/sync/recovery.test.js +292 -0
- package/dist/hooks/sync/transfers.d.ts +16 -3
- package/dist/hooks/sync/transfers.js +186 -65
- package/dist/hooks/sync/transfers.test.d.ts +1 -0
- package/dist/hooks/sync/transfers.test.js +396 -0
- package/dist/hooks/sync/useRecentSyncEvents.d.ts +21 -0
- package/dist/hooks/sync/useRecentSyncEvents.js +92 -0
- package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +1 -0
- package/dist/hooks/sync/useRecentSyncEvents.test.js +124 -0
- package/dist/hooks/sync/useSyncStatusActions.d.ts +30 -0
- package/dist/hooks/sync/useSyncStatusActions.js +88 -0
- package/dist/hooks/sync/useSyncStatusActions.test.d.ts +1 -0
- package/dist/hooks/sync/useSyncStatusActions.test.js +133 -0
- package/dist/hooks/sync/useSyncStatusControls.d.ts +25 -0
- package/dist/hooks/sync/useSyncStatusControls.js +60 -0
- package/dist/hooks/sync/useSyncStatusControls.test.d.ts +1 -0
- package/dist/hooks/sync/useSyncStatusControls.test.js +88 -0
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +12 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +16 -6
- package/dist/hooks/useSyncOrchestrator.js +424 -175
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +487 -10
- package/dist/hooks/useTaskData.js +8 -3
- package/dist/hooks/useTaskData.test.js +45 -0
- package/dist/hooks/useTaskMutations.d.ts +2 -1
- package/dist/hooks/useTaskMutations.js +12 -1
- package/dist/hooks/useTaskMutations.test.js +30 -1
- package/dist/hooks/useTaskforce.d.ts +65 -4
- package/dist/hooks/useTaskforce.js +564 -243
- package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.runtime-routing.test.js +152 -0
- package/dist/hooks/useTaskforce.sync-behavior.test.js +2454 -208
- package/dist/hooks/useWorkspaceSyncController.d.ts +4 -1
- package/dist/hooks/useWorkspaceSyncController.js +17 -2
- package/dist/hooks/useWorkspaceSyncController.test.js +1 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.d.ts +16 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +316 -35
- package/dist/localization/locales/en-US.d.ts +0 -1
- package/dist/localization/locales/en-US.js +0 -1
- package/dist/localization/locales/es-419.js +0 -1
- package/dist/localization/locales/pt-BR.js +0 -1
- package/dist/mcp/adminWorkspaceRegistrar.d.ts +2 -0
- package/dist/mcp/adminWorkspaceRegistrar.js +154 -0
- package/dist/mcp/collaborationRegistrar.d.ts +2 -0
- package/dist/mcp/collaborationRegistrar.js +71 -0
- package/dist/mcp/documentAssetRegistrar.d.ts +2 -0
- package/dist/mcp/documentAssetRegistrar.js +346 -0
- package/dist/mcp/runtime.d.ts +2 -0
- package/dist/mcp/runtime.js +2433 -3534
- package/dist/mcp/runtime.test.js +440 -2
- package/dist/mcp/taskPlanningRegistrar.d.ts +2 -0
- package/dist/mcp/taskPlanningRegistrar.js +418 -0
- package/dist/mcp/toolCatalog.d.ts +35 -0
- package/dist/mcp/toolCatalog.js +3 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +1 -1
- package/dist/migrations/taskSchemaMigrations.js +171 -61
- package/dist/migrations/taskSchemaMigrations.test.js +15 -0
- package/dist/resources/templates/workflow-sources/workflowDocs.mjs +6 -6
- package/dist/resources/templates/workflows/collaborate.yaml +1 -1
- package/dist/resources/templates/workflows/evaluate.yaml +2 -2
- package/dist/resources/templates/workflows/plan.yaml +1 -1
- package/dist/resources/templates/workflows/review.yaml +2 -2
- package/dist/server/annotatedAttachmentsRoutes.test.js +3 -3
- package/dist/server/auth/providers/apple.d.ts +33 -0
- package/dist/server/auth/providers/apple.js +82 -0
- package/dist/server/auth/providers/appleClientSecret.d.ts +37 -0
- package/dist/server/auth/providers/appleClientSecret.js +65 -0
- package/dist/server/auth/providers/github.d.ts +26 -0
- package/dist/server/auth/providers/github.js +86 -0
- package/dist/server/auth/providers/google.d.ts +21 -0
- package/dist/server/auth/providers/google.js +56 -0
- package/dist/server/auth/providers/types.d.ts +21 -0
- package/dist/server/auth/providers/types.js +1 -0
- package/dist/server/auth.d.ts +2 -0
- package/dist/server/auth.js +6 -3
- package/dist/server/documentReviewRoutes.test.js +36 -3
- package/dist/server/index.cookieProxy.test.js +1 -0
- package/dist/server/index.d.ts +12 -0
- package/dist/server/index.js +120 -9
- package/dist/server/index.rateLimit.test.js +3 -0
- package/dist/server/index.test.js +106 -3
- package/dist/server/routes/admin.d.ts +4 -5
- package/dist/server/routes/admin.js +410 -80
- package/dist/server/routes/annotatedAttachments.d.ts +1 -1
- package/dist/server/routes/annotatedAttachments.js +1 -1
- package/dist/server/routes/auth.d.ts +16 -6
- package/dist/server/routes/auth.js +1015 -118
- package/dist/server/routes/authSupport.d.ts +30 -0
- package/dist/server/routes/authSupport.js +81 -0
- package/dist/server/routes/billing.d.ts +1 -1
- package/dist/server/routes/billing.js +276 -34
- package/dist/server/routes/billing.test.js +760 -52
- package/dist/server/routes/documentReviews.d.ts +1 -1
- package/dist/server/routes/documentReviews.js +1 -1
- package/dist/server/routes/documents.d.ts +5 -2
- package/dist/server/routes/documents.js +242 -74
- package/dist/server/routes/primitives.d.ts +11 -0
- package/dist/server/routes/primitives.js +73 -0
- package/dist/server/routes/resources.d.ts +1 -1
- package/dist/server/routes/resources.js +1 -1
- package/dist/server/routes/shared.d.ts +29 -3
- package/dist/server/routes/shared.js +69 -4
- package/dist/server/routes/sync.d.ts +1 -1
- package/dist/server/routes/sync.integration.test.js +437 -39
- package/dist/server/routes/sync.js +62 -606
- package/dist/server/routes/syncAuxRoutes.d.ts +15 -0
- package/dist/server/routes/syncAuxRoutes.js +91 -0
- package/dist/server/routes/syncAuxRoutes.test.d.ts +1 -0
- package/dist/server/routes/syncAuxRoutes.test.js +158 -0
- package/dist/server/routes/syncPullApplyRoutes.d.ts +36 -0
- package/dist/server/routes/syncPullApplyRoutes.js +204 -0
- package/dist/server/routes/syncPushRoutes.d.ts +24 -0
- package/dist/server/routes/syncPushRoutes.js +212 -0
- package/dist/server/routes/syncRouteGuards.d.ts +36 -0
- package/dist/server/routes/syncRouteGuards.js +67 -0
- package/dist/server/routes/syncRouteGuards.test.d.ts +1 -0
- package/dist/server/routes/syncRouteGuards.test.js +94 -0
- package/dist/server/routes/syncRouteTypes.d.ts +13 -0
- package/dist/server/routes/syncRouteTypes.js +1 -0
- package/dist/server/routes/syncSnapshotRoutes.d.ts +66 -0
- package/dist/server/routes/syncSnapshotRoutes.js +180 -0
- package/dist/server/routes/tasks.d.ts +1 -1
- package/dist/server/routes/tasks.js +44 -2
- package/dist/server/routes/workspaces.d.ts +1 -1
- package/dist/server/routes/workspaces.js +37 -6
- package/dist/server/routes.d.ts +2 -9
- package/dist/server/routes.js +136 -165
- package/dist/server/routes.test.js +2457 -162
- package/dist/services/workflowExportSnapshots.test.js +2 -0
- package/dist/shared/aiProfileSeatScope.d.ts +5 -0
- package/dist/shared/aiProfileSeatScope.js +21 -0
- package/dist/shared/passwordPolicy.d.ts +13 -0
- package/dist/shared/passwordPolicy.js +84 -0
- package/dist/shared/passwordPolicy.test.d.ts +1 -0
- package/dist/shared/passwordPolicy.test.js +34 -0
- package/dist/storage/workspaceAssetStore.d.ts +15 -3
- package/dist/storage/workspaceAssetStore.js +132 -44
- package/dist/storage/workspaceAssetStore.test.js +93 -6
- package/dist/styles/fonts.css +70 -0
- package/dist/sync/collaborationSyncPayload.d.ts +6 -1
- package/dist/sync/collaborationSyncPayload.js +17 -11
- package/dist/sync/collaborationSyncPayload.test.js +13 -1
- package/dist/sync/contentSyncState.d.ts +4 -8
- package/dist/sync/contentSyncState.js +33 -77
- package/dist/sync/syncApplyHandlers.d.ts +7 -0
- package/dist/sync/syncApplyHandlers.js +28 -13
- package/dist/sync/syncApplyHandlers.test.js +72 -3
- package/dist/sync/syncFieldSemantics.d.ts +12 -0
- package/dist/sync/syncFieldSemantics.js +55 -0
- package/dist/sync/syncResourceAdapters.d.ts +44 -0
- package/dist/sync/syncResourceAdapters.js +77 -0
- package/dist/sync/syncService.d.ts +6 -0
- package/dist/sync/syncService.js +60 -0
- package/dist/sync/syncService.test.js +71 -3
- package/dist/sync/taskSyncChangeKey.d.ts +2 -0
- package/dist/sync/taskSyncChangeKey.js +143 -0
- package/dist/sync/taskSyncPayload.js +3 -8
- package/dist/sync/workspacePullFeed.js +4 -3
- package/dist/sync/workspacePullFeed.test.js +43 -0
- package/dist/sync/workspaceRepair.js +5 -2
- package/dist/sync/workspaceSyncModel.d.ts +48 -0
- package/dist/sync/workspaceSyncModel.js +195 -31
- package/dist/sync/workspaceSyncModel.test.js +325 -12
- package/dist/sync/workspaceSyncState.d.ts +19 -0
- package/dist/sync/workspaceSyncState.js +3 -1
- package/dist/sync/workspaceSyncSurface.js +3 -8
- package/dist/types.d.ts +17 -0
- package/dist/ui/assets/AgentsModule-DrLawwNl.js +1 -0
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-BlS-cqnl.js → AnnotatedAttachmentWorkspace-Z9_whf7F.js} +1 -1
- package/dist/ui/assets/CourierPrime-Bold-BuLj_dpw.woff2 +0 -0
- package/dist/ui/assets/CourierPrime-BoldItalic-BrK2pUkZ.woff2 +0 -0
- package/dist/ui/assets/CourierPrime-Italic-DFUZK5Ey.woff2 +0 -0
- package/dist/ui/assets/CourierPrime-Regular-BsKphzVf.woff2 +0 -0
- package/dist/ui/assets/DocumentWorkspace-B03MaSkw.js +252 -0
- package/dist/ui/assets/DocumentWorkspace-Dhdso07p.css +1 -0
- package/dist/ui/assets/{InitiativesModule-BjR6iBf9.js → InitiativesModule-9E6ParrY.js} +1 -1
- package/dist/ui/assets/Noir_medium-bxQwKGzB.woff2 +0 -0
- package/dist/ui/assets/Noir_regular-ojf2kxlG.woff2 +0 -0
- package/dist/ui/assets/PlansPage-CvfnMiWq.css +1 -0
- package/dist/ui/assets/PlansPage-DRXscYxH.js +1 -0
- package/dist/ui/assets/RussoOne-Regular-Cu_qq_qC.woff2 +0 -0
- package/dist/ui/assets/SpecialElite-Regular-Di6gSvAS.woff2 +0 -0
- package/dist/ui/assets/TaskSettings-DZX4jk7e.js +9 -0
- package/dist/ui/assets/{WorkflowsModule-DnFqdUME.js → WorkflowsModule-BA7jcEpH.js} +1 -1
- package/dist/ui/assets/index-9eT8e0Lu.css +1 -0
- package/dist/ui/assets/index-C6k75jr8.js +6 -0
- package/dist/ui/assets/{vendor-icons-I7ZwG1z_.js → vendor-icons-DuEd_65c.js} +1 -1
- package/dist/ui/fonts/CourierPrime-Bold.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-Bold.woff2 +0 -0
- package/dist/ui/fonts/CourierPrime-BoldItalic.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-BoldItalic.woff2 +0 -0
- package/dist/ui/fonts/CourierPrime-Italic.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-Italic.woff2 +0 -0
- package/dist/ui/fonts/CourierPrime-Regular.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-Regular.woff2 +0 -0
- package/dist/ui/fonts/Noir_medium.otf +0 -0
- package/dist/ui/fonts/Noir_medium.woff2 +0 -0
- package/dist/ui/fonts/Noir_regular.otf +0 -0
- package/dist/ui/fonts/Noir_regular.woff2 +0 -0
- package/dist/ui/fonts/RussoOne-Regular.woff2 +0 -0
- package/dist/ui/fonts/SpecialElite-Regular.ttf +0 -0
- package/dist/ui/fonts/SpecialElite-Regular.woff2 +0 -0
- package/dist/ui/index.html +3 -3
- package/dist/utils/accountProfileSummaryCache.d.ts +5 -0
- package/dist/utils/assignees.d.ts +2 -0
- package/dist/utils/assignees.js +2 -0
- package/dist/utils/avatarUpload.d.ts +27 -0
- package/dist/utils/avatarUpload.js +132 -0
- package/dist/utils/avatarUpload.test.d.ts +1 -0
- package/dist/utils/avatarUpload.test.js +40 -0
- package/dist/utils/bootstrapTrace.d.ts +7 -0
- package/dist/utils/bootstrapTrace.js +29 -0
- package/dist/utils/commercialLifecyclePresentation.d.ts +19 -0
- package/dist/utils/commercialLifecyclePresentation.js +199 -0
- package/dist/utils/contextAssetEvents.d.ts +2 -0
- package/dist/utils/syncEventDetails.d.ts +3 -0
- package/dist/utils/syncEventDetails.js +64 -0
- package/dist/utils/syncEventDetails.test.d.ts +1 -0
- package/dist/utils/syncEventDetails.test.js +23 -0
- package/dist/utils/syncEventPresentation.d.ts +15 -0
- package/dist/utils/syncEventPresentation.js +129 -0
- package/dist/utils/syncEventPresentation.test.d.ts +1 -0
- package/dist/utils/syncEventPresentation.test.js +64 -0
- package/dist/utils/syncStatusPresentation.d.ts +72 -0
- package/dist/utils/syncStatusPresentation.js +217 -0
- package/dist/utils/syncStatusPresentation.test.d.ts +1 -0
- package/dist/utils/syncStatusPresentation.test.js +164 -0
- package/dist/utils/taskActivity.d.ts +2 -0
- package/dist/utils/taskActivity.js +228 -22
- package/dist/utils/taskActivity.test.js +119 -8
- package/dist/utils/workspaceSyncPresentation.d.ts +4 -0
- package/dist/utils/workspaceSyncPresentation.js +68 -2
- package/dist/utils/workspaceSyncPresentation.test.js +36 -1
- package/package.json +10 -2
- package/scripts/check-cloud-mcp.mjs +83 -0
- package/scripts/export-sqlite-to-postgres.mjs +7 -9
- package/scripts/playwright-auth.sh +5 -1
- package/scripts/run-billing-performance-smoke.sh +24 -0
- package/scripts/run-e2e-realtime.sh +17 -3
- package/scripts/run-smoke.sh +17 -5
- package/scripts/run-soak.sh +17 -5
- package/src/resources/templates/workflow-sources/workflowDocs.mjs +6 -6
- package/src/resources/templates/workflows/collaborate.yaml +1 -1
- package/src/resources/templates/workflows/evaluate.yaml +2 -2
- package/src/resources/templates/workflows/plan.yaml +1 -1
- package/src/resources/templates/workflows/review.yaml +2 -2
- package/dist/ui/assets/AgentsModule-BLWVbuKP.js +0 -1
- package/dist/ui/assets/DocumentWorkspace-BH_6DF6x.js +0 -250
- package/dist/ui/assets/DocumentWorkspace-C_8T8oz-.css +0 -1
- package/dist/ui/assets/PlansPage-C2dd2n1X.css +0 -1
- package/dist/ui/assets/PlansPage-CSDQ4sLa.js +0 -1
- package/dist/ui/assets/RussoOne-Regular-C3BxZIj7.ttf +0 -0
- package/dist/ui/assets/TaskSettings-CEDy34Jo.js +0 -9
- package/dist/ui/assets/index-DXUdtH1B.js +0 -6
- package/dist/ui/assets/index-Ii0B0rTO.css +0 -1
- package/scripts/migrate-planning-model.ts +0 -233
|
@@ -1,25 +1,65 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { AlertTriangle, Bot, Check,
|
|
3
|
+
import { AlertTriangle, Bot, Check, Cloud, LaptopMinimal, Loader2 } from 'lucide-react';
|
|
4
4
|
import styles from '../../Taskforce.module.css';
|
|
5
|
+
import { EditableAvatarButton } from '../ui/EditableAvatarButton';
|
|
6
|
+
import { AvatarImageManagerModal } from '../views/standalone/modals/AvatarImageManagerModal';
|
|
7
|
+
import { prepareAvatarUploadFile } from '../../utils/avatarUpload';
|
|
5
8
|
import { AI_PROFILE_SURFACE_TYPE_SECTION_ORDER, formatAiProfileSurfaceTypeLabel, formatAiProfileSurfaceTypeSectionLabel, getAiProfileSurfaceTypeSection, parseAiProfileSurfaceType } from '../../shared/aiProfileSurfaceType.js';
|
|
6
|
-
|
|
9
|
+
import { formatAiProfileSeatScopeLabel, parseAiProfileSeatScope } from '../../shared/aiProfileSeatScope.js';
|
|
10
|
+
function parseAiProfileSeatUsage(value) {
|
|
11
|
+
if (!value || typeof value !== 'object')
|
|
12
|
+
return null;
|
|
13
|
+
return {
|
|
14
|
+
used: Math.max(0, Number(value.used || 0)),
|
|
15
|
+
limit: value.limit === null || value.limit === undefined
|
|
16
|
+
? null
|
|
17
|
+
: Math.max(0, Number(value.limit || 0)),
|
|
18
|
+
remaining: value.remaining === null || value.remaining === undefined
|
|
19
|
+
? null
|
|
20
|
+
: Math.max(0, Number(value.remaining || 0)),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function renderAiProfileSeatScopeIcon(seatScope, options) {
|
|
24
|
+
const className = options?.variant === 'inline'
|
|
25
|
+
? `${styles.aiProfileSeatScopeIcon} ${styles.aiProfileSeatScopeIconInline}`
|
|
26
|
+
: options?.variant === 'detail'
|
|
27
|
+
? `${styles.aiProfileSeatScopeIcon} ${styles.aiProfileSeatScopeIconDetail}`
|
|
28
|
+
: styles.aiProfileSeatScopeIcon;
|
|
29
|
+
if (seatScope === 'cloud_metered') {
|
|
30
|
+
return (_jsx("span", { className: `${className} ${styles.aiProfileSeatScopeIconCloud}`, title: "Cloud MCP", "aria-label": "Cloud MCP", children: _jsx(Cloud, { size: 20 }) }));
|
|
31
|
+
}
|
|
32
|
+
if (seatScope === 'local_unmetered') {
|
|
33
|
+
return (_jsx("span", { className: `${className} ${styles.aiProfileSeatScopeIconLocal}`, title: "Local MCP", "aria-label": "Local MCP", children: _jsx(LaptopMinimal, { size: 20 }) }));
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
export function AgentsModule({ workspaceId, cloudAuthConfigured = false, authSessionResolved = false, isAuthenticated = false, cloudAiProfileSeatUsage = null, }) {
|
|
7
38
|
const [aiProfiles, setAiProfiles] = useState([]);
|
|
39
|
+
const [localAiProfileSeatUsage, setLocalAiProfileSeatUsage] = useState(null);
|
|
8
40
|
const [aiProfilesLoading, setAiProfilesLoading] = useState(false);
|
|
9
41
|
const [aiProfileMergeState, setAiProfileMergeState] = useState(null);
|
|
10
42
|
const [aiProfileMergeStatus, setAiProfileMergeStatus] = useState(null);
|
|
43
|
+
const [aiProfileArchiveError, setAiProfileArchiveError] = useState(null);
|
|
11
44
|
const [selectedGroupId, setSelectedGroupId] = useState(null);
|
|
45
|
+
const [avatarEditorProfileId, setAvatarEditorProfileId] = useState(null);
|
|
46
|
+
const [aiAvatarBusy, setAiAvatarBusy] = useState(false);
|
|
47
|
+
const [aiAvatarError, setAiAvatarError] = useState(null);
|
|
12
48
|
const loadAiProfiles = useCallback(async () => {
|
|
13
49
|
if (!workspaceId)
|
|
14
50
|
return;
|
|
15
51
|
setAiProfilesLoading(true);
|
|
16
52
|
try {
|
|
17
|
-
const
|
|
53
|
+
const rosterUrl = `/api/taskforce/workspace/assignee-options?workspaceId=${encodeURIComponent(workspaceId)}`;
|
|
54
|
+
const rosterResponse = await fetch(rosterUrl, {
|
|
18
55
|
credentials: 'include',
|
|
19
56
|
});
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
57
|
+
const rosterData = rosterResponse.ok
|
|
58
|
+
? await rosterResponse.json().catch(() => ({}))
|
|
59
|
+
: {};
|
|
60
|
+
const fallbackSeatUsage = parseAiProfileSeatUsage(rosterData?.aiProfileSeatUsage);
|
|
61
|
+
const agents = Array.isArray(rosterData?.assignees)
|
|
62
|
+
? rosterData.assignees
|
|
23
63
|
.filter((assignee) => assignee.kind === 'agent')
|
|
24
64
|
.map((assignee) => ({
|
|
25
65
|
id: String(assignee.value || ''),
|
|
@@ -27,18 +67,26 @@ export function AgentsModule({ workspaceId }) {
|
|
|
27
67
|
username: String(assignee.username || assignee.value || ''),
|
|
28
68
|
icon: String(assignee.icon || 'Bot'),
|
|
29
69
|
color: String(assignee.color || '#6B7280'),
|
|
70
|
+
avatarUrl: typeof assignee.avatarUrl === 'string' ? assignee.avatarUrl : null,
|
|
71
|
+
avatarSourceUrl: typeof assignee.avatarSourceUrl === 'string' ? assignee.avatarSourceUrl : null,
|
|
30
72
|
kind: String(assignee.kind || 'agent'),
|
|
31
73
|
description: typeof assignee.description === 'string' ? assignee.description : null,
|
|
32
74
|
role: typeof assignee.role === 'string' ? assignee.role : null,
|
|
33
75
|
provider: typeof assignee.provider === 'string' ? assignee.provider : null,
|
|
34
76
|
model: typeof assignee.model === 'string' ? assignee.model : null,
|
|
35
77
|
surfaceType: parseAiProfileSurfaceType(assignee.surfaceType),
|
|
78
|
+
seatScope: parseAiProfileSeatScope(assignee.seatScope),
|
|
79
|
+
archivedAt: typeof assignee.archivedAt === 'string' ? assignee.archivedAt : null,
|
|
36
80
|
createdAt: String(assignee.createdAt || ''),
|
|
37
81
|
updatedAt: String(assignee.updatedAt || assignee.createdAt || ''),
|
|
38
82
|
lastActiveAt: typeof assignee.lastActiveAt === 'string' ? assignee.lastActiveAt : null,
|
|
39
83
|
}))
|
|
40
84
|
: [];
|
|
41
85
|
setAiProfiles(agents);
|
|
86
|
+
setLocalAiProfileSeatUsage(fallbackSeatUsage);
|
|
87
|
+
setAiProfileArchiveError((current) => (current && !agents.some((agent) => agent.id === current.profileId)
|
|
88
|
+
? null
|
|
89
|
+
: current));
|
|
42
90
|
}
|
|
43
91
|
finally {
|
|
44
92
|
setAiProfilesLoading(false);
|
|
@@ -75,6 +123,7 @@ export function AgentsModule({ workspaceId }) {
|
|
|
75
123
|
}, [aiProfiles]);
|
|
76
124
|
const allGroups = useMemo(() => groupedProfilesBySurfaceType.flatMap((section) => section.groups), [groupedProfilesBySurfaceType]);
|
|
77
125
|
const selectedGroup = useMemo(() => allGroups.find((group) => group.groupId === selectedGroupId) || allGroups[0] || null, [allGroups, selectedGroupId]);
|
|
126
|
+
const avatarEditorProfile = useMemo(() => aiProfiles.find((profile) => profile.id === avatarEditorProfileId) || null, [aiProfiles, avatarEditorProfileId]);
|
|
78
127
|
useEffect(() => {
|
|
79
128
|
if (!allGroups.length) {
|
|
80
129
|
if (selectedGroupId !== null)
|
|
@@ -87,6 +136,7 @@ export function AgentsModule({ workspaceId }) {
|
|
|
87
136
|
}, [allGroups, selectedGroupId]);
|
|
88
137
|
const handleMerge = async (keepId, mergeId) => {
|
|
89
138
|
setAiProfileMergeStatus(null);
|
|
139
|
+
setAiProfileArchiveError(null);
|
|
90
140
|
try {
|
|
91
141
|
const res = await fetch('/api/taskforce/workspace/ai-profiles/merge', {
|
|
92
142
|
method: 'POST',
|
|
@@ -107,6 +157,152 @@ export function AgentsModule({ workspaceId }) {
|
|
|
107
157
|
setAiProfileMergeStatus({ type: 'error', message: 'Failed to merge AI profiles.' });
|
|
108
158
|
}
|
|
109
159
|
};
|
|
160
|
+
const handleArchive = async (profile) => {
|
|
161
|
+
const confirmed = window.confirm(`Remove ${profile.name} from the active roster? This frees an AI profile seat and preserves task and comment history.`);
|
|
162
|
+
if (!confirmed)
|
|
163
|
+
return;
|
|
164
|
+
setAiProfileArchiveError(null);
|
|
165
|
+
setAiProfileMergeStatus(null);
|
|
166
|
+
try {
|
|
167
|
+
const res = await fetch('/api/taskforce/workspace/ai-profiles/archive', {
|
|
168
|
+
method: 'POST',
|
|
169
|
+
credentials: 'include',
|
|
170
|
+
headers: { 'Content-Type': 'application/json' },
|
|
171
|
+
body: JSON.stringify({ profileId: profile.id, reason: 'manual_archive' }),
|
|
172
|
+
});
|
|
173
|
+
const data = await res.json().catch(() => ({}));
|
|
174
|
+
if (!res.ok) {
|
|
175
|
+
setAiProfileArchiveError({
|
|
176
|
+
profileId: profile.id,
|
|
177
|
+
message: String(data?.error || 'Failed to remove AI profile from roster.')
|
|
178
|
+
});
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (aiProfileMergeState?.keepId === profile.id || aiProfileMergeState?.mergeId === profile.id) {
|
|
182
|
+
setAiProfileMergeState(null);
|
|
183
|
+
}
|
|
184
|
+
setAiProfileMergeStatus({ type: 'success', message: 'AI profile removed from active roster.' });
|
|
185
|
+
await loadAiProfiles();
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
setAiProfileArchiveError({
|
|
189
|
+
profileId: profile.id,
|
|
190
|
+
message: 'Failed to remove AI profile from roster.'
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const fileToDataUrl = (file) => new Promise((resolve, reject) => {
|
|
195
|
+
const reader = new FileReader();
|
|
196
|
+
reader.onload = () => resolve(String(reader.result || ''));
|
|
197
|
+
reader.onerror = () => reject(new Error('Failed to read image file.'));
|
|
198
|
+
reader.readAsDataURL(file);
|
|
199
|
+
});
|
|
200
|
+
const applyAiProfileAvatarUpdate = (updatedProfile) => {
|
|
201
|
+
const updatedId = String(updatedProfile?.id || '').trim();
|
|
202
|
+
if (!updatedId)
|
|
203
|
+
return;
|
|
204
|
+
setAiProfiles((current) => current.map((profile) => (profile.id === updatedId
|
|
205
|
+
? {
|
|
206
|
+
...profile,
|
|
207
|
+
avatarUrl: typeof updatedProfile.avatarUrl === 'string' ? updatedProfile.avatarUrl : null,
|
|
208
|
+
avatarSourceUrl: typeof updatedProfile.avatarSourceUrl === 'string' ? updatedProfile.avatarSourceUrl : null,
|
|
209
|
+
updatedAt: typeof updatedProfile.updatedAt === 'string' ? updatedProfile.updatedAt : profile.updatedAt
|
|
210
|
+
}
|
|
211
|
+
: profile)));
|
|
212
|
+
};
|
|
213
|
+
const updateAiProfileAvatar = async (profileId, avatarUrl, avatarSourceUrl) => {
|
|
214
|
+
const res = await fetch('/api/taskforce/workspace/ai-profiles/avatar', {
|
|
215
|
+
method: 'POST',
|
|
216
|
+
credentials: 'include',
|
|
217
|
+
headers: { 'Content-Type': 'application/json' },
|
|
218
|
+
body: JSON.stringify({
|
|
219
|
+
profileId,
|
|
220
|
+
avatarUrl,
|
|
221
|
+
...(avatarSourceUrl !== undefined ? { avatarSourceUrl } : {})
|
|
222
|
+
}),
|
|
223
|
+
});
|
|
224
|
+
const data = await res.json().catch(() => ({}));
|
|
225
|
+
if (!res.ok || !data?.profile) {
|
|
226
|
+
throw new Error(String(data?.error || 'Failed to update AI profile avatar.'));
|
|
227
|
+
}
|
|
228
|
+
applyAiProfileAvatarUpdate(data.profile);
|
|
229
|
+
};
|
|
230
|
+
const uploadAiProfileAvatarFile = async (file, profile, kind) => {
|
|
231
|
+
const dataUrl = await fileToDataUrl(file);
|
|
232
|
+
const uploadRes = await fetch('/api/taskforce/context-upload', {
|
|
233
|
+
method: 'POST',
|
|
234
|
+
credentials: 'include',
|
|
235
|
+
headers: { 'Content-Type': 'application/json' },
|
|
236
|
+
body: JSON.stringify({
|
|
237
|
+
workspaceId,
|
|
238
|
+
file: dataUrl,
|
|
239
|
+
originalName: `${kind}-${file.name}`,
|
|
240
|
+
folderPath: `ai-profiles/${profile.id}/avatar`
|
|
241
|
+
})
|
|
242
|
+
});
|
|
243
|
+
const uploadData = await uploadRes.json().catch(() => ({}));
|
|
244
|
+
const avatarUrl = typeof uploadData?.path === 'string' ? uploadData.path : '';
|
|
245
|
+
if (!uploadRes.ok || !avatarUrl) {
|
|
246
|
+
throw new Error(String(uploadData?.error || 'Failed to upload AI profile photo.'));
|
|
247
|
+
}
|
|
248
|
+
return avatarUrl;
|
|
249
|
+
};
|
|
250
|
+
const handleAiProfileAvatarSelected = async (file, sourceFile) => {
|
|
251
|
+
if (!avatarEditorProfile)
|
|
252
|
+
return false;
|
|
253
|
+
if (!file.type.startsWith('image/')) {
|
|
254
|
+
setAiAvatarError('AI profile photo must be an image file.');
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
setAiAvatarBusy(true);
|
|
258
|
+
setAiAvatarError(null);
|
|
259
|
+
try {
|
|
260
|
+
const preparedAvatar = await prepareAvatarUploadFile(file, { maxBytes: 5 * 1024 * 1024 });
|
|
261
|
+
if (preparedAvatar.exceededLimit) {
|
|
262
|
+
throw new Error(file.type === 'image/gif'
|
|
263
|
+
? 'Animated GIF AI profile photos must be 5 MB or smaller.'
|
|
264
|
+
: 'AI profile photo must be 5 MB or smaller.');
|
|
265
|
+
}
|
|
266
|
+
const uploadFile = preparedAvatar.file;
|
|
267
|
+
const avatarUrl = await uploadAiProfileAvatarFile(uploadFile, avatarEditorProfile, 'cropped');
|
|
268
|
+
let avatarSourceUrl;
|
|
269
|
+
if (sourceFile) {
|
|
270
|
+
const preparedSource = await prepareAvatarUploadFile(sourceFile, { maxBytes: 5 * 1024 * 1024 });
|
|
271
|
+
if (preparedSource.exceededLimit) {
|
|
272
|
+
throw new Error(sourceFile.type === 'image/gif'
|
|
273
|
+
? 'Animated GIF AI profile photos must be 5 MB or smaller.'
|
|
274
|
+
: 'AI profile source photo must be 5 MB or smaller.');
|
|
275
|
+
}
|
|
276
|
+
avatarSourceUrl = sourceFile.type === 'image/gif'
|
|
277
|
+
? avatarUrl
|
|
278
|
+
: await uploadAiProfileAvatarFile(preparedSource.file, avatarEditorProfile, 'source');
|
|
279
|
+
}
|
|
280
|
+
await updateAiProfileAvatar(avatarEditorProfile.id, avatarUrl, avatarSourceUrl);
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
setAiAvatarError(String(error?.message || 'Failed to update AI profile photo.'));
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
finally {
|
|
288
|
+
setAiAvatarBusy(false);
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const handleAiProfileAvatarRemove = async () => {
|
|
292
|
+
if (!avatarEditorProfile)
|
|
293
|
+
return;
|
|
294
|
+
setAiAvatarBusy(true);
|
|
295
|
+
setAiAvatarError(null);
|
|
296
|
+
try {
|
|
297
|
+
await updateAiProfileAvatar(avatarEditorProfile.id, null, null);
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
setAiAvatarError(String(error?.message || 'Failed to remove AI profile photo.'));
|
|
301
|
+
}
|
|
302
|
+
finally {
|
|
303
|
+
setAiAvatarBusy(false);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
110
306
|
const formatTimestamp = (value) => {
|
|
111
307
|
const normalized = String(value || '').trim();
|
|
112
308
|
if (!normalized)
|
|
@@ -119,13 +315,62 @@ export function AgentsModule({ workspaceId }) {
|
|
|
119
315
|
timeStyle: 'short'
|
|
120
316
|
});
|
|
121
317
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
318
|
+
const selectedProfileDataGroups = useMemo(() => {
|
|
319
|
+
if (!selectedGroup)
|
|
320
|
+
return { attributes: [], dates: [] };
|
|
321
|
+
const profile = selectedGroup.primaryProfile;
|
|
322
|
+
const formatRowValue = (value) => value || 'Not set';
|
|
323
|
+
return {
|
|
324
|
+
attributes: [
|
|
325
|
+
{ label: 'Category', value: profile.surfaceType ? formatAiProfileSurfaceTypeLabel(profile.surfaceType) : '' },
|
|
326
|
+
{ label: 'Connection', value: profile.seatScope ? formatAiProfileSeatScopeLabel(profile.seatScope) : '' },
|
|
327
|
+
{ label: 'Provider', value: profile.provider || '' },
|
|
328
|
+
{ label: 'Model', value: profile.model || '' },
|
|
329
|
+
].map((row) => ({ ...row, value: formatRowValue(row.value) })),
|
|
330
|
+
dates: [
|
|
331
|
+
{ label: 'Recruited', value: formatTimestamp(profile.createdAt) },
|
|
332
|
+
{ label: 'Last updated', value: formatTimestamp(profile.updatedAt) },
|
|
333
|
+
{ label: 'Last active', value: formatTimestamp(profile.lastActiveAt) },
|
|
334
|
+
{ label: 'Status', value: profile.archivedAt ? 'Retired' : 'Active' },
|
|
335
|
+
].map((row) => ({ ...row, value: formatRowValue(row.value) })),
|
|
336
|
+
};
|
|
337
|
+
}, [selectedGroup]);
|
|
338
|
+
const selectedGroupHasDuplicates = !!selectedGroup && selectedGroup.profiles.length > 1;
|
|
339
|
+
const shouldPromptForCloudLogin = cloudAuthConfigured && authSessionResolved && !isAuthenticated;
|
|
340
|
+
const displayedSeatUsage = cloudAuthConfigured
|
|
341
|
+
? parseAiProfileSeatUsage(cloudAiProfileSeatUsage)
|
|
342
|
+
: localAiProfileSeatUsage;
|
|
343
|
+
const cloudAgentSeatLabel = shouldPromptForCloudLogin
|
|
344
|
+
? 'Log into account for Cloud agents'
|
|
345
|
+
: displayedSeatUsage
|
|
346
|
+
? `${displayedSeatUsage.used}/${displayedSeatUsage.limit === null ? 'Unlimited' : displayedSeatUsage.limit}`
|
|
347
|
+
: null;
|
|
348
|
+
return (_jsxs("section", { className: styles.agentsModuleRoot, children: [_jsx("div", { className: styles.agentsModuleContent, children: _jsx("div", { className: `${styles.settingGroup} ${styles.agentsModuleGroup}`, children: _jsxs("div", { children: [_jsx("h4", { className: styles.settingSubTitle, children: "Registered AI Profiles" }), _jsx("p", { className: `${styles.settingsHint} ${styles.marginBottom12}`, children: "AI agents register profiles when connecting via MCP. Merge duplicates created when a token was lost, or remove inactive profiles from the active roster to free seats while preserving history." }), cloudAgentSeatLabel && (_jsx("div", { className: styles.aiProfileSeatSummary, children: shouldPromptForCloudLogin
|
|
349
|
+
? cloudAgentSeatLabel
|
|
350
|
+
: `Registered Cloud Agents: ${cloudAgentSeatLabel}` })), aiProfilesLoading && (_jsxs("div", { className: styles.settingsHint, children: [_jsx(Loader2, { size: 13, className: styles.spinner }), " Loading profiles\u2026"] })), !aiProfilesLoading && aiProfiles.length === 0 && (_jsx("div", { className: styles.settingsHint, children: "No AI profiles registered yet." })), !aiProfilesLoading && groupedProfilesBySurfaceType.length > 0 && (_jsxs("div", { className: styles.aiProfilesExplorer, children: [_jsx("div", { className: `${styles.aiProfilesListPane} tf-scrollbar tf-scrollbar--track-transparent`, children: _jsx("div", { className: styles.aiProfilesList, children: groupedProfilesBySurfaceType.map((section) => (_jsxs("div", { className: styles.aiProfilesSection, children: [_jsx("div", { className: styles.aiProfilesSectionHeader, children: section.label }), section.groups.map((group) => {
|
|
351
|
+
const isSelected = selectedGroup?.groupId === group.groupId;
|
|
352
|
+
const primary = group.primaryProfile;
|
|
353
|
+
return (_jsxs("div", { role: "button", tabIndex: 0, className: `${styles.aiProfileGroup} ${group.profiles.length > 1 ? styles.aiProfileGroupDuplicate : ''} ${isSelected ? styles.aiProfileGroupSelected : ''}`, onClick: () => setSelectedGroupId(group.groupId), onKeyDown: (event) => {
|
|
354
|
+
if (event.key !== 'Enter' && event.key !== ' ')
|
|
355
|
+
return;
|
|
356
|
+
event.preventDefault();
|
|
357
|
+
setSelectedGroupId(group.groupId);
|
|
358
|
+
}, "aria-pressed": isSelected, children: [renderAiProfileSeatScopeIcon(primary.seatScope), _jsxs("div", { className: styles.aiProfileGroupHeader, children: [_jsx("span", { className: styles.aiProfileGroupAvatar, style: { color: primary.color }, children: primary.avatarUrl ? (_jsx("img", { src: primary.avatarUrl, alt: "" })) : (_jsx(Bot, { size: 22 })) }), _jsxs("span", { className: styles.aiProfileGroupIdentity, children: [_jsx("span", { className: styles.aiProfileName, children: primary.name }), _jsxs("span", { className: styles.aiProfileHandle, children: ["@", primary.username] }), _jsx("span", { className: styles.aiProfileRole, children: primary.role || 'Role not set' }), group.profiles.length > 1 && (_jsxs("span", { className: styles.aiProfileDuplicateBadge, children: [_jsx(AlertTriangle, { size: 11 }), " ", group.profiles.length, " duplicates"] }))] })] })] }, group.groupId));
|
|
359
|
+
})] }, section.section))) }) }), selectedGroup && (_jsx("div", { className: styles.aiProfileDetailPane, children: _jsxs("div", { className: styles.aiProfileDetailCard, children: [renderAiProfileSeatScopeIcon(selectedGroup.primaryProfile.seatScope, { variant: 'detail' }), _jsxs("div", { className: styles.aiProfileDetailHero, children: [_jsx(EditableAvatarButton, { label: "Edit AI profile photo", imageUrl: selectedGroup.primaryProfile.avatarUrl, fallback: _jsx(Bot, { size: 38 }), accentColor: selectedGroup.primaryProfile.color, size: 176, width: 153, height: 207, radius: 6, editBadgeSize: 28, editIconSize: 14, className: styles.aiProfileDetailAvatar, onClick: () => {
|
|
360
|
+
setAiAvatarError(null);
|
|
361
|
+
setAvatarEditorProfileId(selectedGroup.primaryProfile.id);
|
|
362
|
+
} }), _jsxs("div", { className: styles.aiProfileDetailHeading, children: [_jsx("div", { className: styles.aiProfileDetailTitleRow, children: _jsx("h5", { className: styles.aiProfileDetailTitle, children: selectedGroup.primaryProfile.name }) }), _jsxs("div", { className: styles.aiProfileDetailMetaRow, children: [_jsxs("span", { className: styles.aiProfileDetailHandle, children: ["@", selectedGroup.primaryProfile.username] }), selectedGroup.profiles.length > 1 && (_jsxs("span", { className: styles.aiProfileDetailLinkedCount, children: [selectedGroup.profiles.length, " linked"] }))] }), _jsxs("div", { className: styles.aiProfileDetailRole, children: ["Role: ", selectedGroup.primaryProfile.role || 'Not set'] }), selectedGroup.primaryProfile.description && (_jsx("div", { className: styles.aiProfileDetailDescription, children: selectedGroup.primaryProfile.description }))] })] }), _jsxs("div", { className: styles.aiProfileDetailDataList, children: [_jsx("div", { className: styles.aiProfileDetailDataGroup, children: selectedProfileDataGroups.attributes.map((row) => (_jsxs("div", { className: styles.aiProfileDetailDataRow, children: [_jsx("span", { className: styles.aiProfileDetailDataLabel, children: row.label }), _jsx("span", { className: styles.aiProfileDetailDataValue, children: row.value })] }, row.label))) }), _jsx("div", { className: `${styles.aiProfileDetailDataGroup} ${styles.aiProfileDetailDateGroup}`, children: selectedProfileDataGroups.dates.map((row) => (_jsxs("div", { className: styles.aiProfileDetailDataRow, children: [_jsx("span", { className: styles.aiProfileDetailDataLabel, children: row.label }), row.label === 'Status' ? (_jsx("span", { className: styles.aiProfileDetailDataValue, children: _jsxs("select", { className: styles.aiProfileStatusSelect, "aria-label": "Agent roster status", value: selectedGroup.primaryProfile.archivedAt ? 'retired' : 'active', onChange: (event) => {
|
|
363
|
+
if (event.target.value === 'retire') {
|
|
364
|
+
void handleArchive(selectedGroup.primaryProfile);
|
|
365
|
+
}
|
|
366
|
+
}, children: [_jsx("option", { value: "active", children: "Active" }), selectedGroup.primaryProfile.archivedAt ? (_jsx("option", { value: "retired", children: "Retired" })) : (_jsx("option", { value: "retire", children: "Retire from roster" }))] }) })) : (_jsx("span", { className: styles.aiProfileDetailDataValue, children: row.value }))] }, row.label))) })] }), selectedGroupHasDuplicates ? (_jsxs("div", { className: styles.aiProfileInstanceSection, children: [_jsxs("div", { className: styles.aiProfileInstanceSectionHeader, children: [_jsx("span", { children: "Profile instances" }), _jsx("span", { className: styles.settingsHint, children: "Choose a keeper here if duplicates need to be merged." })] }), _jsx("div", { className: styles.aiProfileInstanceList, children: selectedGroup.profiles.map((profile) => (_jsxs("div", { className: styles.aiProfileInstanceCard, children: [_jsxs("div", { className: styles.aiProfileInstanceTopRow, children: [_jsxs("div", { children: [_jsxs("div", { className: styles.aiProfileInstanceName, children: ["@", profile.username] }), _jsx("div", { className: styles.aiProfileIdChip, children: profile.id })] }), aiProfileMergeState?.keepId === profile.id && (_jsx("span", { className: styles.aiProfileKeepBadge, children: "Keeping" }))] }), _jsxs("div", { className: styles.aiProfileInstanceMeta, children: [_jsxs("span", { children: ["Created ", formatTimestamp(profile.createdAt)] }), _jsxs("span", { children: ["Updated ", formatTimestamp(profile.updatedAt)] })] }), aiProfileMergeState?.keepId !== profile.id && (_jsx("button", { className: styles.secondaryHeaderBtn, title: "Keep this profile, merge others into it", onClick: () => {
|
|
367
|
+
const otherId = selectedGroup.profiles.find((candidate) => candidate.id !== profile.id)?.id;
|
|
368
|
+
if (otherId)
|
|
369
|
+
setAiProfileMergeState({ keepId: profile.id, mergeId: otherId });
|
|
370
|
+
}, children: "Keep this" })), aiProfileArchiveError?.profileId === profile.id && (_jsxs("div", { className: styles.aiProfileInlineError, role: "alert", children: [_jsx(AlertTriangle, { size: 12 }), _jsx("span", { children: aiProfileArchiveError.message })] })), _jsx("button", { className: styles.aiProfileDangerTextButton, title: "Remove this profile from the active roster", onClick: () => { void handleArchive(profile); }, children: "Remove from roster" })] }, profile.id))) }), aiProfileMergeState && selectedGroup.profiles.some((profile) => profile.id === aiProfileMergeState.keepId) && (_jsxs("div", { className: styles.aiProfileMergeActions, children: [_jsx("button", { className: styles.dangerBtn, onClick: () => { void handleMerge(aiProfileMergeState.keepId, aiProfileMergeState.mergeId); }, children: "Merge duplicates" }), _jsx("button", { className: styles.secondaryHeaderBtn, onClick: () => setAiProfileMergeState(null), children: "Cancel" })] }))] })) : (_jsxs("div", { className: styles.aiProfileIdFooter, children: [_jsx("div", { className: styles.aiProfileIdFooterValue, children: selectedGroup.primaryProfile.id }), aiProfileArchiveError?.profileId === selectedGroup.primaryProfile.id && (_jsxs("div", { className: styles.aiProfileInlineError, role: "alert", children: [_jsx(AlertTriangle, { size: 12 }), _jsx("span", { children: aiProfileArchiveError.message })] }))] }))] }) }))] })), aiProfileMergeStatus && (_jsxs("div", { className: `${aiProfileMergeStatus.type === 'success' ? styles.successMessage : styles.errorMessage} ${styles.marginTop12}`, children: [aiProfileMergeStatus.type === 'success' ? _jsx(Check, { size: 14 }) : _jsx(AlertTriangle, { size: 14 }), aiProfileMergeStatus.message] }))] }) }) }), _jsx(AvatarImageManagerModal, { isOpen: !!avatarEditorProfile, theme: "dark", title: "Edit AI Profile Photo", currentImageUrl: avatarEditorProfile?.avatarUrl || '', editorImageUrl: avatarEditorProfile?.avatarSourceUrl || '', fallbackInitial: (avatarEditorProfile?.name || 'AI').charAt(0).toUpperCase(), accept: "image/png,image/jpeg,image/webp,image/gif", busy: aiAvatarBusy, hasPendingImage: false, canRemove: !!avatarEditorProfile?.avatarUrl, error: aiAvatarError, notice: null, onClose: () => {
|
|
371
|
+
if (aiAvatarBusy)
|
|
372
|
+
return;
|
|
373
|
+
setAvatarEditorProfileId(null);
|
|
374
|
+
setAiAvatarError(null);
|
|
375
|
+
}, onApplyImage: handleAiProfileAvatarSelected, onRemoveImage: handleAiProfileAvatarRemove })] }));
|
|
131
376
|
}
|