@taskforcehq/taskforce 0.3.305 → 0.3.307
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 +0 -2
- package/dist/Taskforce.module.css +603 -107
- package/dist/TaskforceCore.js +216 -43
- package/dist/TaskforceCore.test.js +611 -28
- 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 +46 -2
- package/dist/compat/workspaceSyncCompat.test.js +38 -1
- package/dist/components/activity/EntityActivityTimeline.d.ts +34 -0
- package/dist/components/activity/EntityActivityTimeline.js +81 -0
- package/dist/components/context/ContextAttachmentManager.d.ts +14 -0
- package/dist/components/context/ContextAttachmentManager.js +561 -0
- package/dist/components/features/AgentsModule.d.ts +14 -1
- package/dist/components/features/AgentsModule.js +366 -18
- package/dist/components/features/AgentsModule.test.js +507 -8
- package/dist/components/features/AnnotatedAttachmentWorkspace.d.ts +3 -1
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +118 -4
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +52 -0
- package/dist/components/features/DocumentIndex.d.ts +2 -2
- package/dist/components/features/DocumentIndex.js +3 -4
- package/dist/components/features/DocumentViewer.d.ts +7 -1
- package/dist/components/features/DocumentViewer.js +62 -4
- package/dist/components/features/DocumentWorkspace.d.ts +10 -2
- package/dist/components/features/DocumentWorkspace.js +15 -4
- package/dist/components/features/DocumentWorkspace.test.js +51 -1
- package/dist/components/features/TaskSettings.d.ts +2 -0
- package/dist/components/features/TaskSettings.js +83 -78
- package/dist/components/features/TaskSettings.test.js +171 -82
- package/dist/components/features/documentWorkspaceModel.d.ts +1 -1
- package/dist/components/task/TaskActionHeader.js +11 -5
- package/dist/components/task/TaskActionHeader.test.js +10 -0
- package/dist/components/task/TaskCard.js +24 -29
- package/dist/components/task/TaskCard.test.js +38 -3
- package/dist/components/task/TaskContextUpload.js +4 -526
- package/dist/components/task/TaskContextUpload.test.js +3 -3
- package/dist/components/task/TaskForm.js +61 -116
- package/dist/components/task/TaskForm.test.js +110 -8
- package/dist/components/task/TaskKanban.d.ts +2 -1
- package/dist/components/task/TaskKanban.js +94 -21
- package/dist/components/task/TaskKanban.test.js +36 -0
- package/dist/components/task/TaskList.js +5 -1
- package/dist/components/task/TaskList.test.js +4 -0
- package/dist/components/ui/EditableAvatarButton.d.ts +18 -0
- package/dist/components/ui/EditableAvatarButton.js +18 -0
- package/dist/components/ui/HierarchyActionBadge.d.ts +10 -0
- package/dist/components/ui/HierarchyActionBadge.js +5 -0
- package/dist/components/views/AppShellHeader.d.ts +3 -1
- package/dist/components/views/AppShellHeader.js +27 -11
- package/dist/components/views/AppShellHeader.test.js +18 -1
- package/dist/components/views/PlanComparisonPage.d.ts +9 -1
- package/dist/components/views/PlanComparisonPage.js +78 -14
- package/dist/components/views/PlanComparisonPage.test.js +257 -0
- package/dist/components/views/PlansPage.js +127 -36
- package/dist/components/views/PlansPage.test.js +294 -12
- package/dist/components/views/StandaloneLayout.js +529 -592
- package/dist/components/views/WidgetView.js +10 -8
- package/dist/components/views/panels/PlanningDrawer.d.ts +25 -5
- package/dist/components/views/panels/PlanningDrawer.js +270 -55
- package/dist/components/views/panels/PlanningDrawer.test.d.ts +1 -0
- package/dist/components/views/panels/PlanningDrawer.test.js +529 -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 +26 -1
- package/dist/components/views/standalone/modals/AccountHubModal.js +76 -2
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +20 -3
- 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 -0
- package/dist/core/AiProfileService.d.ts +46 -2
- package/dist/core/AiProfileService.js +1073 -82
- package/dist/core/AiProfileService.test.js +19 -1
- package/dist/core/AiProfiles.test.js +1249 -44
- package/dist/core/AttachmentLinkService.d.ts +3 -0
- package/dist/core/AttachmentLinkService.js +110 -23
- 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.js +3 -3
- package/dist/core/EntitlementsPolicy.test.js +2 -2
- package/dist/core/GlobalSettingsService.js +127 -6
- package/dist/core/McpTokenService.d.ts +12 -0
- package/dist/core/McpTokenService.js +44 -1
- package/dist/core/PlanEntitlementService.d.ts +23 -2
- package/dist/core/PlanEntitlementService.js +343 -57
- package/dist/core/PlanFeatureCatalog.test.d.ts +1 -0
- package/dist/core/PlanFeatureCatalog.test.js +84 -0
- package/dist/core/PlanVersionPolicy.test.js +35 -2
- package/dist/core/PlanningEntities.test.js +418 -4
- package/dist/core/SignupMonetizationSettings.test.js +199 -27
- package/dist/core/SyncReconciliationService.js +2 -65
- package/dist/core/SystemAdmin.test.js +42 -42
- package/dist/core/TaskActivityService.d.ts +28 -1
- package/dist/core/TaskActivityService.js +227 -46
- package/dist/core/TaskActivitySync.test.d.ts +1 -0
- package/dist/core/TaskActivitySync.test.js +90 -0
- package/dist/core/TaskAttachmentsCanonical.test.js +51 -1
- package/dist/core/TaskAuditTimeline.test.js +96 -0
- package/dist/core/Taskforce.d.ts +415 -40
- package/dist/core/Taskforce.ids.test.js +58 -0
- package/dist/core/Taskforce.js +1543 -266
- package/dist/core/Taskforce.listTasksSlim.test.d.ts +1 -0
- package/dist/core/Taskforce.listTasksSlim.test.js +91 -0
- package/dist/core/Taskforce.mcpAuth.test.js +109 -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 +117 -16
- package/dist/core/shared.d.ts +1 -1
- package/dist/core/shared.js +5 -1
- package/dist/core/types.d.ts +75 -2
- package/dist/hooks/auth/useTaskforceAuthBootstrap.js +28 -2
- package/dist/hooks/bootstrapTimeouts.d.ts +4 -0
- package/dist/hooks/bootstrapTimeouts.js +8 -0
- package/dist/hooks/bootstrapTimeouts.test.d.ts +1 -0
- package/dist/hooks/bootstrapTimeouts.test.js +12 -0
- 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 +13 -4
- package/dist/hooks/sync/orchestratorShared.js +129 -48
- 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 +179 -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 +210 -66
- package/dist/hooks/sync/transfers.test.d.ts +1 -0
- package/dist/hooks/sync/transfers.test.js +928 -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/useFilterSort.js +13 -13
- package/dist/hooks/useFilterSort.test.js +87 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +12 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +9 -2
- package/dist/hooks/useSyncOrchestrator.js +409 -183
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +407 -0
- package/dist/hooks/useTaskData.js +8 -3
- package/dist/hooks/useTaskData.test.js +45 -0
- package/dist/hooks/useTaskforce.d.ts +145 -52
- package/dist/hooks/useTaskforce.js +592 -253
- package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.runtime-routing.test.js +246 -0
- package/dist/hooks/useTaskforce.sync-behavior.test.js +2468 -201
- package/dist/hooks/useWorkspaceSyncController.d.ts +1 -0
- package/dist/hooks/useWorkspaceSyncController.js +13 -2
- package/dist/hooks/useWorkspaceSyncController.test.js +48 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.d.ts +16 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +328 -40
- 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/canonicalAssetHelpers.d.ts +16 -4
- package/dist/mcp/canonicalAssetHelpers.js +18 -10
- package/dist/mcp/canonicalAssetHelpers.test.d.ts +1 -0
- package/dist/mcp/canonicalAssetHelpers.test.js +67 -0
- package/dist/mcp/clientIntegrations.d.ts +1 -0
- package/dist/mcp/clientIntegrations.js +25 -0
- package/dist/mcp/clientIntegrations.test.js +14 -3
- package/dist/mcp/clientProfileDefaults.js +3 -3
- package/dist/mcp/collaborationRegistrar.js +7 -7
- package/dist/mcp/documentAssetRegistrar.js +116 -10
- package/dist/mcp/runtime.d.ts +3 -0
- package/dist/mcp/runtime.js +1099 -185
- package/dist/mcp/runtime.test.js +1491 -140
- package/dist/mcp/taskAttachmentTypes.d.ts +1 -1
- package/dist/mcp/taskPlanningRegistrar.js +48 -0
- package/dist/mcp/toolRegistry.d.ts +56 -0
- package/dist/mcp/toolRegistry.js +8 -0
- package/dist/mcp/toolRegistry.test.js +4 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +1 -1
- package/dist/migrations/taskSchemaMigrations.js +192 -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/aiProfileAvatarAssets.d.ts +49 -0
- package/dist/server/aiProfileAvatarAssets.js +319 -0
- package/dist/server/aiProfileAvatarAssets.test.d.ts +1 -0
- package/dist/server/aiProfileAvatarAssets.test.js +213 -0
- package/dist/server/annotatedAttachmentsRoutes.test.js +69 -10
- 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 +124 -9
- package/dist/server/index.rateLimit.test.js +3 -0
- package/dist/server/index.test.js +111 -3
- package/dist/server/routes/admin.d.ts +3 -0
- package/dist/server/routes/admin.js +459 -28
- package/dist/server/routes/annotatedAttachments.js +51 -0
- package/dist/server/routes/auth.d.ts +26 -2
- package/dist/server/routes/auth.js +1170 -71
- package/dist/server/routes/authSupport.d.ts +5 -1
- package/dist/server/routes/authSupport.js +13 -2
- package/dist/server/routes/billing.js +372 -35
- package/dist/server/routes/billing.test.js +595 -12
- package/dist/server/routes/documents.d.ts +1 -0
- package/dist/server/routes/documents.js +182 -70
- package/dist/server/routes/shared.d.ts +28 -2
- package/dist/server/routes/shared.js +69 -14
- package/dist/server/routes/sync.integration.test.js +658 -39
- package/dist/server/routes/sync.js +74 -608
- 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 +182 -0
- package/dist/server/routes/tasks.js +55 -10
- package/dist/server/routes/workspaces.js +36 -5
- package/dist/server/routes.js +147 -11
- package/dist/server/routes.test.js +2704 -183
- 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/aiProfileSurfaceType.d.ts +1 -1
- package/dist/shared/aiProfileSurfaceType.js +10 -8
- 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/objectStorage.d.ts +1 -0
- package/dist/storage/objectStorage.js +2 -1
- package/dist/storage/objectStorageClient.d.ts +1 -0
- package/dist/storage/objectStorageClient.js +41 -8
- package/dist/storage/objectStorageClient.test.js +26 -1
- package/dist/storage/objectStorageConfig.js +3 -1
- package/dist/storage/objectStorageConfig.test.js +13 -1
- 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 +19 -11
- package/dist/sync/collaborationSyncPayload.test.js +14 -1
- package/dist/sync/collaborationSyncState.d.ts +3 -3
- package/dist/sync/collaborationSyncState.js +19 -12
- package/dist/sync/contentSyncPayload.d.ts +5 -1
- package/dist/sync/contentSyncPayload.js +9 -0
- package/dist/sync/contentSyncPayload.test.js +39 -0
- package/dist/sync/contentSyncState.d.ts +9 -9
- package/dist/sync/contentSyncState.js +248 -107
- package/dist/sync/planningSyncPayload.js +5 -0
- package/dist/sync/planningSyncPayload.test.js +24 -0
- package/dist/sync/syncApplyHandlers.d.ts +11 -4
- package/dist/sync/syncApplyHandlers.js +115 -42
- package/dist/sync/syncApplyHandlers.test.js +251 -4
- package/dist/sync/syncFieldSemantics.d.ts +12 -0
- package/dist/sync/syncFieldSemantics.js +55 -0
- package/dist/sync/syncResourceAdapters.d.ts +46 -0
- package/dist/sync/syncResourceAdapters.js +79 -0
- package/dist/sync/syncService.d.ts +6 -0
- package/dist/sync/syncService.js +65 -1
- package/dist/sync/syncService.test.js +96 -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.d.ts +4 -0
- package/dist/sync/workspacePullFeed.js +132 -72
- package/dist/sync/workspacePullFeed.test.js +92 -0
- package/dist/sync/workspaceRepair.js +5 -2
- package/dist/sync/workspaceSyncModel.d.ts +73 -6
- package/dist/sync/workspaceSyncModel.js +342 -73
- package/dist/sync/workspaceSyncModel.test.js +559 -14
- package/dist/sync/workspaceSyncState.d.ts +17 -0
- package/dist/sync/workspaceSyncState.js +2 -1
- package/dist/sync/workspaceSyncSurface.js +3 -8
- package/dist/types.d.ts +50 -2
- package/dist/ui/assets/AgentsModule-2y82_3DO.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BTLZZCiQ.js +3 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BVKew-mH.css +1 -0
- package/dist/ui/assets/ContextAttachmentManager-D2epuNnG.js +3 -0
- 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-D4rJKXzd.css +1 -0
- package/dist/ui/assets/DocumentWorkspace-sVa-3Do6.js +252 -0
- package/dist/ui/assets/EntityActivityTimeline-DyqvvhuF.css +1 -0
- package/dist/ui/assets/EntityActivityTimeline-Zods27y_.js +1 -0
- package/dist/ui/assets/{InitiativesModule-Dhm7M8e7.js → InitiativesModule-D4XseTwW.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-D5AcbO0L.js +1 -0
- package/dist/ui/assets/PlansPage-Dvqsz5zc.css +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/TaskContextUpload-uC5qx4Bv.js +1 -0
- package/dist/ui/assets/TaskSettings-CqvPAsTv.js +9 -0
- package/dist/ui/assets/{WorkflowsModule-BcS4afRn.js → WorkflowsModule-oOA9bcdK.js} +4 -4
- package/dist/ui/assets/documentReferences-DPZuTgHh.js +1 -0
- package/dist/ui/assets/index-607WPo_X.js +4 -0
- package/dist/ui/assets/index-CYyodXsg.css +1 -0
- package/dist/ui/assets/{vendor-icons-BSUaRwF8.js → vendor-icons-B32hGuF2.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/ui/product/agent manager.png +0 -0
- package/dist/ui/product/agent_manager_02.png +0 -0
- package/dist/utils/accountProfileSummaryCache.d.ts +5 -0
- package/dist/utils/aiProfileEvents.d.ts +7 -0
- package/dist/utils/aiProfileEvents.js +6 -0
- package/dist/utils/assignees.d.ts +8 -0
- package/dist/utils/assignees.js +10 -1
- package/dist/utils/assignees.test.d.ts +1 -0
- package/dist/utils/assignees.test.js +25 -0
- package/dist/utils/avatarDisplay.d.ts +1 -0
- package/dist/utils/avatarDisplay.js +15 -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.js +3 -0
- package/dist/utils/contextAssetEvents.d.ts +2 -0
- package/dist/utils/contextFiles.d.ts +3 -1
- package/dist/utils/contextFiles.js +2 -1
- 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 +9 -1
- package/dist/utils/taskActivity.js +290 -22
- package/dist/utils/taskActivity.test.js +141 -8
- package/dist/utils/taskSearch.d.ts +22 -0
- package/dist/utils/taskSearch.js +87 -0
- package/dist/utils/taskSearch.test.d.ts +1 -0
- package/dist/utils/taskSearch.test.js +69 -0
- package/dist/utils/taskUtils.js +10 -3
- package/dist/utils/taskUtils.test.d.ts +1 -0
- package/dist/utils/taskUtils.test.js +19 -0
- 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 +3 -2
- package/scripts/export-sqlite-to-postgres.mjs +7 -9
- 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-N2MnQBZk.js +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BG6P_GVW.js +0 -3
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BaS2VwIr.css +0 -1
- package/dist/ui/assets/DocumentWorkspace-B3nV_Gc5.css +0 -1
- package/dist/ui/assets/DocumentWorkspace-DRbDMwh8.js +0 -252
- package/dist/ui/assets/PlansPage-C2dd2n1X.css +0 -1
- package/dist/ui/assets/PlansPage-Cq0zXj3I.js +0 -1
- package/dist/ui/assets/RussoOne-Regular-C3BxZIj7.ttf +0 -0
- package/dist/ui/assets/TaskSettings-ln0aF7xc.js +0 -9
- package/dist/ui/assets/index-C2-OXZV7.css +0 -1
- package/dist/ui/assets/index-DcSI5F86.js +0 -6
- package/scripts/migrate-planning-model.ts +0 -233
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
|
2
|
+
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
|
|
3
3
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
4
4
|
import { MemoryRouter } from 'react-router-dom';
|
|
5
5
|
import { PlansPage } from './PlansPage';
|
|
6
|
+
import { ACCOUNT_PROFILE_SUMMARY_PATH, invalidateAccountProfileSummaryCache } from '../../utils/accountProfileSummaryCache';
|
|
6
7
|
vi.mock('./PlanComparisonPage', () => ({
|
|
7
|
-
PlanComparisonPage: ({ heading, statusBanner, topActions, onSelectPlan, onBack, backLabel, backDisabled }) => (_jsxs("div", { children: [_jsx("h1", { children: heading }), statusBanner?.message ? _jsx("div", { "data-status-type": statusBanner.type, children: statusBanner.message }) : null, topActions, onSelectPlan ? (_jsx("button", { onClick: () => onSelectPlan({
|
|
8
|
+
PlanComparisonPage: ({ heading, pricingEndpoint, statusBanner, topActions, onSelectPlan, onBack, backLabel, backDisabled }) => (_jsxs("div", { children: [_jsx("h1", { children: heading }), pricingEndpoint ? _jsx("div", { "data-testid": "pricing-endpoint", children: pricingEndpoint }) : null, statusBanner?.message ? _jsx("div", { "data-status-type": statusBanner.type, children: statusBanner.message }) : null, topActions, onSelectPlan ? (_jsx("button", { onClick: () => onSelectPlan({
|
|
8
9
|
planId: 'free',
|
|
9
10
|
planVersionId: 'free-v1',
|
|
10
11
|
interval: 'month',
|
|
@@ -17,7 +18,16 @@ describe('PlansPage', () => {
|
|
|
17
18
|
vi.useRealTimers();
|
|
18
19
|
vi.unstubAllGlobals();
|
|
19
20
|
});
|
|
21
|
+
it('builds the pricing endpoint through resolveCloudAuthUrl', async () => {
|
|
22
|
+
vi.stubGlobal('fetch', vi.fn(async () => ({
|
|
23
|
+
ok: true,
|
|
24
|
+
json: async () => ({})
|
|
25
|
+
})));
|
|
26
|
+
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans'], children: _jsx(PlansPage, { isAuthenticated: false, runtimeMode: "local", authSessionResolved: true, apiBaseUrl: "https://performance-app.taskforcehq.ai/api", resolveCloudAuthUrl: (path) => `/api/proxy?path=${encodeURIComponent(path)}` }) }));
|
|
27
|
+
expect(await screen.findByTestId('pricing-endpoint')).toHaveTextContent('/api/proxy?path=%2Fapi%2Ftaskforce%2Fpublic%2Fpricing');
|
|
28
|
+
});
|
|
20
29
|
it('shows recovery messaging only after bounded retries are exhausted', async () => {
|
|
30
|
+
vi.useFakeTimers();
|
|
21
31
|
let profileSummaryCalls = 0;
|
|
22
32
|
let confirmCalls = 0;
|
|
23
33
|
const fetchMock = vi.fn(async (url) => {
|
|
@@ -65,14 +75,16 @@ describe('PlansPage', () => {
|
|
|
65
75
|
});
|
|
66
76
|
vi.stubGlobal('fetch', fetchMock);
|
|
67
77
|
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_123'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u1", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
|
|
68
|
-
expect(
|
|
78
|
+
expect(screen.getByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
|
|
79
|
+
await act(async () => {
|
|
80
|
+
await Promise.resolve();
|
|
81
|
+
});
|
|
69
82
|
expect(confirmCalls).toBe(1);
|
|
70
|
-
await
|
|
71
|
-
|
|
72
|
-
}, { timeout: 4500 });
|
|
73
|
-
await waitFor(() => {
|
|
74
|
-
expect(screen.getByText('Your previous checkout expired. Choose a plan to continue.')).toBeInTheDocument();
|
|
83
|
+
await act(async () => {
|
|
84
|
+
await vi.advanceTimersByTimeAsync(50000);
|
|
75
85
|
});
|
|
86
|
+
expect(confirmCalls).toBeGreaterThanOrEqual(12);
|
|
87
|
+
expect(screen.getByText('Your previous checkout expired. Choose a plan to continue.')).toBeInTheDocument();
|
|
76
88
|
expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
|
|
77
89
|
}, 10000);
|
|
78
90
|
it('retries checkout confirmation when the first confirm is incomplete and later succeeds', async () => {
|
|
@@ -134,8 +146,153 @@ describe('PlansPage', () => {
|
|
|
134
146
|
expect(await screen.findByText('Checkout completed successfully.')).toBeInTheDocument();
|
|
135
147
|
expect(confirmCalls).toBe(2);
|
|
136
148
|
}, 10000);
|
|
137
|
-
it('
|
|
149
|
+
it('treats an active entitlement summary as checkout success even when confirm still reports incomplete', async () => {
|
|
150
|
+
let profileSummaryCalls = 0;
|
|
151
|
+
let confirmCalls = 0;
|
|
152
|
+
const fetchMock = vi.fn(async (url) => {
|
|
153
|
+
if (url.includes('/api/taskforce/account/profile-summary')) {
|
|
154
|
+
profileSummaryCalls += 1;
|
|
155
|
+
if (profileSummaryCalls === 1) {
|
|
156
|
+
return {
|
|
157
|
+
ok: true,
|
|
158
|
+
json: async () => ({
|
|
159
|
+
planId: 'basic',
|
|
160
|
+
planVersionId: 'basic-v1',
|
|
161
|
+
entitlementState: 'checkout_pending',
|
|
162
|
+
gate: 'checkout_pending',
|
|
163
|
+
message: 'Complete checkout to continue.'
|
|
164
|
+
})
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
ok: true,
|
|
169
|
+
json: async () => ({
|
|
170
|
+
entitlementState: 'active',
|
|
171
|
+
planId: 'basic',
|
|
172
|
+
planVersionId: 'basic-v1',
|
|
173
|
+
billingInterval: 'month',
|
|
174
|
+
gate: 'ok',
|
|
175
|
+
message: null
|
|
176
|
+
})
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
|
|
180
|
+
confirmCalls += 1;
|
|
181
|
+
return {
|
|
182
|
+
ok: false,
|
|
183
|
+
status: 409,
|
|
184
|
+
json: async () => ({
|
|
185
|
+
error: 'Checkout session is still finalizing your plan.',
|
|
186
|
+
code: 'CHECKOUT_SESSION_INCOMPLETE'
|
|
187
|
+
})
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
ok: true,
|
|
192
|
+
json: async () => ({})
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
196
|
+
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_summary_settled'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u1", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
|
|
197
|
+
expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
|
|
198
|
+
expect(await screen.findByText('Checkout completed successfully.')).toBeInTheDocument();
|
|
199
|
+
expect(confirmCalls).toBe(1);
|
|
200
|
+
}, 10000);
|
|
201
|
+
it('does not treat an already-active account as settled until the requested interval change is visible', async () => {
|
|
202
|
+
vi.useFakeTimers();
|
|
203
|
+
let confirmCalls = 0;
|
|
204
|
+
const fetchMock = vi.fn(async (url) => {
|
|
205
|
+
if (url.includes('/api/taskforce/account/profile-summary')) {
|
|
206
|
+
return {
|
|
207
|
+
ok: true,
|
|
208
|
+
json: async () => ({
|
|
209
|
+
entitlementState: 'active',
|
|
210
|
+
planId: 'basic',
|
|
211
|
+
planVersionId: 'basic-v1',
|
|
212
|
+
billingInterval: 'month',
|
|
213
|
+
gate: 'ok',
|
|
214
|
+
message: null
|
|
215
|
+
})
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
|
|
219
|
+
confirmCalls += 1;
|
|
220
|
+
return {
|
|
221
|
+
ok: false,
|
|
222
|
+
status: 409,
|
|
223
|
+
json: async () => ({
|
|
224
|
+
error: 'Checkout session is still finalizing your plan.',
|
|
225
|
+
code: 'CHECKOUT_SESSION_INCOMPLETE'
|
|
226
|
+
})
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
ok: true,
|
|
231
|
+
json: async () => ({})
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
235
|
+
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_existing_active_interval&planId=basic&planVersionId=basic-v1&interval=year'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u1", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
|
|
236
|
+
expect(screen.getByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
|
|
237
|
+
await act(async () => {
|
|
238
|
+
await Promise.resolve();
|
|
239
|
+
});
|
|
240
|
+
expect(confirmCalls).toBe(1);
|
|
241
|
+
expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
|
|
242
|
+
await act(async () => {
|
|
243
|
+
await vi.advanceTimersByTimeAsync(50000);
|
|
244
|
+
});
|
|
245
|
+
expect(confirmCalls).toBeGreaterThanOrEqual(12);
|
|
246
|
+
expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
|
|
247
|
+
}, 10000);
|
|
248
|
+
it('does not retry checkout confirmation for account mismatch responses', async () => {
|
|
249
|
+
let confirmCalls = 0;
|
|
250
|
+
const fetchMock = vi.fn(async (url) => {
|
|
251
|
+
if (url.includes('/api/taskforce/account/profile-summary')) {
|
|
252
|
+
return {
|
|
253
|
+
ok: true,
|
|
254
|
+
json: async () => ({
|
|
255
|
+
planId: 'basic',
|
|
256
|
+
planVersionId: 'basic-v1',
|
|
257
|
+
entitlementState: 'checkout_pending',
|
|
258
|
+
gate: 'checkout_pending',
|
|
259
|
+
message: 'Complete checkout to continue.'
|
|
260
|
+
})
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
|
|
264
|
+
confirmCalls += 1;
|
|
265
|
+
return {
|
|
266
|
+
ok: false,
|
|
267
|
+
status: 403,
|
|
268
|
+
json: async () => ({
|
|
269
|
+
error: 'Checkout session does not belong to the current account.',
|
|
270
|
+
code: 'CHECKOUT_SESSION_ACCOUNT_MISMATCH'
|
|
271
|
+
})
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
ok: true,
|
|
276
|
+
json: async () => ({})
|
|
277
|
+
};
|
|
278
|
+
});
|
|
279
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
280
|
+
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_wrong_account'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u1", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
|
|
281
|
+
expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
|
|
282
|
+
await waitFor(() => {
|
|
283
|
+
expect(confirmCalls).toBe(1);
|
|
284
|
+
});
|
|
285
|
+
await act(async () => {
|
|
286
|
+
await new Promise((resolve) => setTimeout(resolve, 1200));
|
|
287
|
+
});
|
|
288
|
+
expect(confirmCalls).toBe(1);
|
|
289
|
+
expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
|
|
290
|
+
expect(screen.getByText('Checkout session does not belong to the current account.')).toBeInTheDocument();
|
|
291
|
+
expect(screen.queryByText('Complete checkout to continue.')).not.toBeInTheDocument();
|
|
292
|
+
}, 10000);
|
|
293
|
+
it('attempts checkout confirmation immediately when the user is already authenticated even if auth session is still resolving', async () => {
|
|
138
294
|
let profileSummaryCalls = 0;
|
|
295
|
+
let confirmCalls = 0;
|
|
139
296
|
const fetchMock = vi.fn(async (url) => {
|
|
140
297
|
if (url.includes('/api/taskforce/account/profile-summary')) {
|
|
141
298
|
profileSummaryCalls += 1;
|
|
@@ -163,6 +320,7 @@ describe('PlansPage', () => {
|
|
|
163
320
|
};
|
|
164
321
|
}
|
|
165
322
|
if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
|
|
323
|
+
confirmCalls += 1;
|
|
166
324
|
return {
|
|
167
325
|
ok: true,
|
|
168
326
|
status: 200,
|
|
@@ -177,12 +335,112 @@ describe('PlansPage', () => {
|
|
|
177
335
|
vi.stubGlobal('fetch', fetchMock);
|
|
178
336
|
const view = render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_auth_wait'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u_auth", runtimeMode: "cloud", authSessionResolved: false, resolveCloudAuthUrl: (path) => path }) }));
|
|
179
337
|
expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
|
|
180
|
-
|
|
338
|
+
await waitFor(() => {
|
|
339
|
+
expect(confirmCalls).toBe(1);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
it('waits to confirm checkout when auth is still unresolved and the user is not yet authenticated', async () => {
|
|
343
|
+
let profileSummaryCalls = 0;
|
|
344
|
+
let confirmCalls = 0;
|
|
345
|
+
const fetchMock = vi.fn(async (url) => {
|
|
346
|
+
if (url.includes('/api/taskforce/account/profile-summary')) {
|
|
347
|
+
profileSummaryCalls += 1;
|
|
348
|
+
return {
|
|
349
|
+
ok: true,
|
|
350
|
+
json: async () => ({
|
|
351
|
+
planId: 'basic',
|
|
352
|
+
planVersionId: 'basic-v1',
|
|
353
|
+
entitlementState: 'checkout_pending',
|
|
354
|
+
gate: 'checkout_pending',
|
|
355
|
+
message: 'Complete checkout to continue.'
|
|
356
|
+
})
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
|
|
360
|
+
confirmCalls += 1;
|
|
361
|
+
return {
|
|
362
|
+
ok: true,
|
|
363
|
+
status: 200,
|
|
364
|
+
json: async () => ({ success: true })
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
return {
|
|
368
|
+
ok: true,
|
|
369
|
+
json: async () => ({})
|
|
370
|
+
};
|
|
371
|
+
});
|
|
372
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
373
|
+
const view = render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_auth_wait'], children: _jsx(PlansPage, { isAuthenticated: false, authUserId: "u_auth", runtimeMode: "cloud", authSessionResolved: false, resolveCloudAuthUrl: (path) => path }) }));
|
|
374
|
+
expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
|
|
375
|
+
expect(confirmCalls).toBe(0);
|
|
181
376
|
view.rerender(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_auth_wait'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u_auth", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
|
|
182
377
|
await waitFor(() => {
|
|
183
378
|
expect(fetchMock.mock.calls.some(([url]) => String(url).includes('/api/taskforce/billing/checkout-session/confirm'))).toBe(true);
|
|
184
379
|
});
|
|
185
380
|
});
|
|
381
|
+
it('restarts checkout confirmation after a mid-flight rerender before the first confirm attempt', async () => {
|
|
382
|
+
let confirmCalls = 0;
|
|
383
|
+
let profileSummaryCalls = 0;
|
|
384
|
+
let releaseBlockedProfileSummaries = false;
|
|
385
|
+
const blockedProfileSummaryResolvers = [];
|
|
386
|
+
const fetchMock = vi.fn(async (url) => {
|
|
387
|
+
if (url.includes('/api/taskforce/account/profile-summary')) {
|
|
388
|
+
profileSummaryCalls += 1;
|
|
389
|
+
if (!releaseBlockedProfileSummaries) {
|
|
390
|
+
return await new Promise((resolve) => {
|
|
391
|
+
blockedProfileSummaryResolvers.push(resolve);
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
return {
|
|
395
|
+
ok: true,
|
|
396
|
+
json: async () => ({
|
|
397
|
+
entitlementState: 'checkout_pending',
|
|
398
|
+
planId: 'basic',
|
|
399
|
+
planVersionId: 'basic-v1',
|
|
400
|
+
gate: 'checkout_pending',
|
|
401
|
+
message: 'Complete checkout to continue.'
|
|
402
|
+
})
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
|
|
406
|
+
confirmCalls += 1;
|
|
407
|
+
return {
|
|
408
|
+
ok: true,
|
|
409
|
+
status: 200,
|
|
410
|
+
json: async () => ({ success: true })
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
ok: true,
|
|
415
|
+
json: async () => ({})
|
|
416
|
+
};
|
|
417
|
+
});
|
|
418
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
419
|
+
const firstResolveCloudAuthUrl = (path) => path;
|
|
420
|
+
const secondResolveCloudAuthUrl = (path) => path;
|
|
421
|
+
const view = render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_rerender'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u_rerender", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: firstResolveCloudAuthUrl }) }));
|
|
422
|
+
await waitFor(() => {
|
|
423
|
+
expect(profileSummaryCalls).toBeGreaterThan(0);
|
|
424
|
+
});
|
|
425
|
+
view.rerender(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_rerender'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u_rerender", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: secondResolveCloudAuthUrl }) }));
|
|
426
|
+
releaseBlockedProfileSummaries = true;
|
|
427
|
+
for (const resolve of blockedProfileSummaryResolvers.splice(0)) {
|
|
428
|
+
resolve({
|
|
429
|
+
ok: true,
|
|
430
|
+
json: async () => ({
|
|
431
|
+
entitlementState: 'checkout_pending',
|
|
432
|
+
planId: 'basic',
|
|
433
|
+
planVersionId: 'basic-v1',
|
|
434
|
+
gate: 'checkout_pending',
|
|
435
|
+
message: 'Complete checkout to continue.'
|
|
436
|
+
})
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
await waitFor(() => {
|
|
440
|
+
expect(confirmCalls).toBe(1);
|
|
441
|
+
});
|
|
442
|
+
expect(await screen.findByText('Checkout completed successfully.')).toBeInTheDocument();
|
|
443
|
+
});
|
|
186
444
|
it('shows conflict-specific recovery messaging when the account lands on plans already blocked', async () => {
|
|
187
445
|
const fetchMock = vi.fn()
|
|
188
446
|
.mockResolvedValueOnce({
|
|
@@ -258,7 +516,8 @@ describe('PlansPage', () => {
|
|
|
258
516
|
});
|
|
259
517
|
vi.stubGlobal('fetch', fetchMock);
|
|
260
518
|
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&gate=plan_selection_required'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u4", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path, onContinueToTaskforce: onContinueToTaskforce }) }));
|
|
261
|
-
|
|
519
|
+
await screen.findByRole('heading', { name: 'Subscription Plans' });
|
|
520
|
+
expect(screen.queryByText('Choose a plan to continue.')).not.toBeInTheDocument();
|
|
262
521
|
fireEvent.click(screen.getByRole('button', { name: 'Select Free Plan' }));
|
|
263
522
|
await waitFor(() => {
|
|
264
523
|
expect(onContinueToTaskforce).toHaveBeenCalledTimes(1);
|
|
@@ -278,7 +537,7 @@ describe('PlansPage', () => {
|
|
|
278
537
|
vi.stubGlobal('fetch', fetchMock);
|
|
279
538
|
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&gate=plan_selection_required'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u5", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
|
|
280
539
|
expect(await screen.findByRole('button', { name: 'Back to App' })).toBeDisabled();
|
|
281
|
-
expect(screen.
|
|
540
|
+
expect(screen.queryByText('Choose a plan to continue.')).not.toBeInTheDocument();
|
|
282
541
|
});
|
|
283
542
|
it('does not auto-continue after an in-place paid interval update for an already active account', async () => {
|
|
284
543
|
const onContinueToTaskforce = vi.fn();
|
|
@@ -390,6 +649,29 @@ describe('PlansPage', () => {
|
|
|
390
649
|
expect(await screen.findByText(/Your trial is active through/)).toBeInTheDocument();
|
|
391
650
|
expect(screen.getByRole('button', { name: 'Take Me to Taskforce' })).toBeEnabled();
|
|
392
651
|
});
|
|
652
|
+
it('does not claim an expired trial is still active through a past date', async () => {
|
|
653
|
+
const nowSpy = vi.spyOn(Date, 'now').mockReturnValue(new Date('2026-04-20T12:00:00.000Z').getTime());
|
|
654
|
+
const fetchMock = vi.fn().mockResolvedValue({
|
|
655
|
+
ok: true,
|
|
656
|
+
json: async () => ({
|
|
657
|
+
entitlementState: 'trialing',
|
|
658
|
+
planId: 'starter',
|
|
659
|
+
planVersionId: 'starter-v1',
|
|
660
|
+
gate: 'ok',
|
|
661
|
+
trialEnd: '2026-04-12T16:09:09.000Z'
|
|
662
|
+
})
|
|
663
|
+
});
|
|
664
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
665
|
+
invalidateAccountProfileSummaryCache(ACCOUNT_PROFILE_SUMMARY_PATH, { identityKey: 'u8' });
|
|
666
|
+
try {
|
|
667
|
+
render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u8", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path, onContinueToTaskforce: vi.fn() }) }));
|
|
668
|
+
expect(await screen.findByText('Your trial end date has passed. Billing status is updating.')).toBeInTheDocument();
|
|
669
|
+
expect(screen.queryByText(/Your trial is active through/)).not.toBeInTheDocument();
|
|
670
|
+
}
|
|
671
|
+
finally {
|
|
672
|
+
nowSpy.mockRestore();
|
|
673
|
+
}
|
|
674
|
+
});
|
|
393
675
|
it('shows suspended accounts a billing-recovery message and keeps return blocked', async () => {
|
|
394
676
|
const fetchMock = vi.fn().mockResolvedValue({
|
|
395
677
|
ok: true,
|