@taskforcehq/taskforce 0.3.311 → 0.3.313

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.
Files changed (454) hide show
  1. package/README.md +40 -2
  2. package/dist/TaskforceCore.js +1 -1
  3. package/dist/components/features/InitiativesModule.js +1 -1
  4. package/dist/components/features/TaskSettings.js +1 -1
  5. package/dist/components/views/StandaloneLayout.js +3 -6
  6. package/dist/components/views/standalone/modals/AccountHubModal.d.ts +1 -2
  7. package/dist/components/views/standalone/modals/AccountHubModal.js +2 -3
  8. package/dist/components/views/standalone/modals/HelpModal.js +15 -2
  9. package/dist/hooks/useFilterSort.js +1 -1
  10. package/dist/hooks/useTaskforce.js +2 -2
  11. package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +5 -2
  12. package/dist/ui/assets/{AgentsModule-D8u9P5dZ.js → AgentsModule-BULqIo8e.js} +1 -1
  13. package/dist/ui/assets/{AnnotatedAttachmentWorkspace-CsUauFA2.js → AnnotatedAttachmentWorkspace-DHr4rHK9.js} +1 -1
  14. package/dist/ui/assets/{ContextAttachmentManager-DbQvDHFz.js → ContextAttachmentManager-DoMe2OpY.js} +1 -1
  15. package/dist/ui/assets/{DocumentWorkspace-BmTkN1A8.js → DocumentWorkspace-DumBWhvb.js} +1 -1
  16. package/dist/ui/assets/{EntityActivityTimeline-BXHTM-Nh.js → EntityActivityTimeline-sHk8Nzbq.js} +1 -1
  17. package/dist/ui/assets/{InitiativesModule-D33RyXx0.js → InitiativesModule-3X9UNzHh.js} +1 -1
  18. package/dist/ui/assets/{PlansPage-D0RXlT9_.js → PlansPage-C3A3EYaV.js} +1 -1
  19. package/dist/ui/assets/{TaskContextUpload-Vsg67lpR.js → TaskContextUpload-C8G7pWkX.js} +1 -1
  20. package/dist/ui/assets/{TaskSettings-DshLw7_d.js → TaskSettings-DM1o9Wla.js} +2 -2
  21. package/dist/ui/assets/{WorkflowsModule-CLM-1BnF.js → WorkflowsModule-CW0crzvD.js} +1 -1
  22. package/dist/ui/assets/documentReferences-BZB3nMRb.js +1 -0
  23. package/dist/ui/assets/index-BWFQ9mGn.js +5 -0
  24. package/dist/ui/assets/{index-DOR9PRqt.css → index-DcK_8tuE.css} +1 -1
  25. package/dist/ui/index.html +2 -2
  26. package/package.json +12 -4
  27. package/scripts/postinstall.js +4 -3
  28. package/dist/TaskforceCore.CategoryFallback.test.d.ts +0 -1
  29. package/dist/TaskforceCore.CategoryFallback.test.js +0 -101
  30. package/dist/TaskforceCore.filter-persistence.test.d.ts +0 -1
  31. package/dist/TaskforceCore.filter-persistence.test.js +0 -402
  32. package/dist/TaskforceCore.routing.test.d.ts +0 -1
  33. package/dist/TaskforceCore.routing.test.js +0 -311
  34. package/dist/TaskforceCore.test.d.ts +0 -1
  35. package/dist/TaskforceCore.test.js +0 -7910
  36. package/dist/TaskforceWidget.test.d.ts +0 -1
  37. package/dist/TaskforceWidget.test.js +0 -92
  38. package/dist/UnsavedChangesRelaxed.test.d.ts +0 -1
  39. package/dist/UnsavedChangesRelaxed.test.js +0 -16
  40. package/dist/__tests__/localizationCatalogs.test.d.ts +0 -1
  41. package/dist/__tests__/localizationCatalogs.test.js +0 -54
  42. package/dist/__tests__/workflowSimulation.test.d.ts +0 -1
  43. package/dist/__tests__/workflowSimulation.test.js +0 -113
  44. package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.d.ts +0 -1
  45. package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.js +0 -278
  46. package/dist/annotatedAttachments/payload.test.d.ts +0 -1
  47. package/dist/annotatedAttachments/payload.test.js +0 -67
  48. package/dist/compat/workspaceSyncCompat.test.d.ts +0 -1
  49. package/dist/compat/workspaceSyncCompat.test.js +0 -124
  50. package/dist/components/features/AgentsModule.test.d.ts +0 -1
  51. package/dist/components/features/AgentsModule.test.js +0 -601
  52. package/dist/components/features/AnnotatedAttachmentWorkspace.test.d.ts +0 -1
  53. package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +0 -2883
  54. package/dist/components/features/DocumentWorkspace.test.d.ts +0 -1
  55. package/dist/components/features/DocumentWorkspace.test.js +0 -1439
  56. package/dist/components/features/TaskSettings.test.d.ts +0 -1
  57. package/dist/components/features/TaskSettings.test.js +0 -1674
  58. package/dist/components/features/settings/TaxonomyLibraryManager.test.d.ts +0 -1
  59. package/dist/components/features/settings/TaxonomyLibraryManager.test.js +0 -141
  60. package/dist/components/task/TaskActionHeader.test.d.ts +0 -1
  61. package/dist/components/task/TaskActionHeader.test.js +0 -91
  62. package/dist/components/task/TaskCard.test.d.ts +0 -1
  63. package/dist/components/task/TaskCard.test.js +0 -513
  64. package/dist/components/task/TaskContextUpload.test.d.ts +0 -1
  65. package/dist/components/task/TaskContextUpload.test.js +0 -506
  66. package/dist/components/task/TaskForm.test.d.ts +0 -1
  67. package/dist/components/task/TaskForm.test.js +0 -946
  68. package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +0 -1
  69. package/dist/components/task/TaskKanban.empty-column-drop.test.js +0 -66
  70. package/dist/components/task/TaskKanban.planning-drop.test.d.ts +0 -1
  71. package/dist/components/task/TaskKanban.planning-drop.test.js +0 -93
  72. package/dist/components/task/TaskKanban.test.d.ts +0 -1
  73. package/dist/components/task/TaskKanban.test.js +0 -99
  74. package/dist/components/task/TaskList.test.d.ts +0 -1
  75. package/dist/components/task/TaskList.test.js +0 -473
  76. package/dist/components/task/TaskStatusActions.test.d.ts +0 -1
  77. package/dist/components/task/TaskStatusActions.test.js +0 -54
  78. package/dist/components/task/taskKanbanDropRules.test.d.ts +0 -1
  79. package/dist/components/task/taskKanbanDropRules.test.js +0 -114
  80. package/dist/components/ui/LevelSelector.test.d.ts +0 -1
  81. package/dist/components/ui/LevelSelector.test.js +0 -55
  82. package/dist/components/ui/Markdown.test.d.ts +0 -1
  83. package/dist/components/ui/Markdown.test.js +0 -38
  84. package/dist/components/ui/MultiSelectFilter.test.d.ts +0 -1
  85. package/dist/components/ui/MultiSelectFilter.test.js +0 -74
  86. package/dist/components/ui/TaxonomyDropdown.test.d.ts +0 -1
  87. package/dist/components/ui/TaxonomyDropdown.test.js +0 -130
  88. package/dist/components/ui/TopNoticeLayer.test.d.ts +0 -1
  89. package/dist/components/ui/TopNoticeLayer.test.js +0 -25
  90. package/dist/components/views/AppShellHeader.test.d.ts +0 -1
  91. package/dist/components/views/AppShellHeader.test.js +0 -42
  92. package/dist/components/views/PlanComparisonPage.test.d.ts +0 -1
  93. package/dist/components/views/PlanComparisonPage.test.js +0 -758
  94. package/dist/components/views/PlansPage.test.d.ts +0 -1
  95. package/dist/components/views/PlansPage.test.js +0 -710
  96. package/dist/components/views/chrome/WorkspaceChromeSections.test.d.ts +0 -1
  97. package/dist/components/views/chrome/WorkspaceChromeSections.test.js +0 -54
  98. package/dist/components/views/chrome/workspaceChrome.test.d.ts +0 -1
  99. package/dist/components/views/chrome/workspaceChrome.test.js +0 -52
  100. package/dist/components/views/panels/DocumentFilterToolbar.test.d.ts +0 -1
  101. package/dist/components/views/panels/DocumentFilterToolbar.test.js +0 -19
  102. package/dist/components/views/panels/FilterToolbar.test.d.ts +0 -1
  103. package/dist/components/views/panels/FilterToolbar.test.js +0 -47
  104. package/dist/components/views/panels/PlanningDrawer.test.d.ts +0 -1
  105. package/dist/components/views/panels/PlanningDrawer.test.js +0 -529
  106. package/dist/components/views/planningScope.test.d.ts +0 -1
  107. package/dist/components/views/planningScope.test.js +0 -60
  108. package/dist/components/views/standalone/modals/AccountHubModal.test.d.ts +0 -1
  109. package/dist/components/views/standalone/modals/AccountHubModal.test.js +0 -72
  110. package/dist/components/views/standalone/modals/HelpModal.test.d.ts +0 -1
  111. package/dist/components/views/standalone/modals/HelpModal.test.js +0 -23
  112. package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +0 -1
  113. package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +0 -24
  114. package/dist/components/views/teamManagementAccess.test.d.ts +0 -1
  115. package/dist/components/views/teamManagementAccess.test.js +0 -44
  116. package/dist/config/deployment.test.d.ts +0 -1
  117. package/dist/config/deployment.test.js +0 -90
  118. package/dist/config/envSchema.test.d.ts +0 -1
  119. package/dist/config/envSchema.test.js +0 -125
  120. package/dist/core/AiProfileService.test.d.ts +0 -1
  121. package/dist/core/AiProfileService.test.js +0 -184
  122. package/dist/core/AiProfiles.test.d.ts +0 -1
  123. package/dist/core/AiProfiles.test.js +0 -1873
  124. package/dist/core/AuthTokenService.test.d.ts +0 -1
  125. package/dist/core/AuthTokenService.test.js +0 -78
  126. package/dist/core/BulkUpdateFieldsPreview.test.d.ts +0 -1
  127. package/dist/core/BulkUpdateFieldsPreview.test.js +0 -62
  128. package/dist/core/CompletedAt.test.d.ts +0 -1
  129. package/dist/core/CompletedAt.test.js +0 -44
  130. package/dist/core/CreatedBy.test.d.ts +0 -1
  131. package/dist/core/CreatedBy.test.js +0 -188
  132. package/dist/core/DeletedTaskTrash.test.d.ts +0 -1
  133. package/dist/core/DeletedTaskTrash.test.js +0 -104
  134. package/dist/core/EntitlementsPolicy.test.d.ts +0 -1
  135. package/dist/core/EntitlementsPolicy.test.js +0 -280
  136. package/dist/core/GlobalSettingsService.test.d.ts +0 -1
  137. package/dist/core/GlobalSettingsService.test.js +0 -45
  138. package/dist/core/JsonBackupRuntime.test.d.ts +0 -1
  139. package/dist/core/JsonBackupRuntime.test.js +0 -155
  140. package/dist/core/PlanFeatureCatalog.test.d.ts +0 -1
  141. package/dist/core/PlanFeatureCatalog.test.js +0 -139
  142. package/dist/core/PlanVersionPolicy.test.d.ts +0 -1
  143. package/dist/core/PlanVersionPolicy.test.js +0 -236
  144. package/dist/core/PlanningEntities.test.d.ts +0 -1
  145. package/dist/core/PlanningEntities.test.js +0 -509
  146. package/dist/core/ScheduleFields.test.d.ts +0 -1
  147. package/dist/core/ScheduleFields.test.js +0 -193
  148. package/dist/core/SetupState.test.d.ts +0 -1
  149. package/dist/core/SetupState.test.js +0 -113
  150. package/dist/core/SignupMonetizationSettings.test.d.ts +0 -1
  151. package/dist/core/SignupMonetizationSettings.test.js +0 -515
  152. package/dist/core/Stats.test.d.ts +0 -1
  153. package/dist/core/Stats.test.js +0 -36
  154. package/dist/core/SystemAdmin.test.d.ts +0 -1
  155. package/dist/core/SystemAdmin.test.js +0 -1106
  156. package/dist/core/TaskActivitySync.test.d.ts +0 -1
  157. package/dist/core/TaskActivitySync.test.js +0 -90
  158. package/dist/core/TaskAttachmentsCanonical.test.d.ts +0 -1
  159. package/dist/core/TaskAttachmentsCanonical.test.js +0 -356
  160. package/dist/core/TaskAuditTimeline.test.d.ts +0 -1
  161. package/dist/core/TaskAuditTimeline.test.js +0 -319
  162. package/dist/core/TaskTaxonomyValidation.test.d.ts +0 -1
  163. package/dist/core/TaskTaxonomyValidation.test.js +0 -440
  164. package/dist/core/Taskforce.ids.test.d.ts +0 -1
  165. package/dist/core/Taskforce.ids.test.js +0 -611
  166. package/dist/core/Taskforce.listTasksSlim.test.d.ts +0 -1
  167. package/dist/core/Taskforce.listTasksSlim.test.js +0 -91
  168. package/dist/core/Taskforce.mcpAuth.test.d.ts +0 -1
  169. package/dist/core/Taskforce.mcpAuth.test.js +0 -450
  170. package/dist/core/Taskforce.realtimeMutation.test.d.ts +0 -1
  171. package/dist/core/Taskforce.realtimeMutation.test.js +0 -131
  172. package/dist/core/UserProfileAvatarDrafts.test.d.ts +0 -1
  173. package/dist/core/UserProfileAvatarDrafts.test.js +0 -138
  174. package/dist/core/WorkspaceDelete.test.d.ts +0 -1
  175. package/dist/core/WorkspaceDelete.test.js +0 -159
  176. package/dist/core/WorkspacePermissions.test.d.ts +0 -1
  177. package/dist/core/WorkspacePermissions.test.js +0 -270
  178. package/dist/core/WorkspacePlanMode.test.d.ts +0 -1
  179. package/dist/core/WorkspacePlanMode.test.js +0 -383
  180. package/dist/core/WorkspaceSyncSettings.test.d.ts +0 -1
  181. package/dist/core/WorkspaceSyncSettings.test.js +0 -65
  182. package/dist/core/__tests__/TaskAttachmentsCanonical.test.d.ts +0 -1
  183. package/dist/core/__tests__/TaskAttachmentsCanonical.test.js +0 -212
  184. package/dist/documentReviews/DocumentReviewSessionStore.test.d.ts +0 -1
  185. package/dist/documentReviews/DocumentReviewSessionStore.test.js +0 -127
  186. package/dist/hooks/authGuardPolicy.test.d.ts +0 -1
  187. package/dist/hooks/authGuardPolicy.test.js +0 -76
  188. package/dist/hooks/bootstrapTimeouts.test.d.ts +0 -1
  189. package/dist/hooks/bootstrapTimeouts.test.js +0 -12
  190. package/dist/hooks/sync/controlPlane.test.d.ts +0 -1
  191. package/dist/hooks/sync/controlPlane.test.js +0 -121
  192. package/dist/hooks/sync/lifecyclePolicy.test.d.ts +0 -1
  193. package/dist/hooks/sync/lifecyclePolicy.test.js +0 -124
  194. package/dist/hooks/sync/orchestratorShared.test.d.ts +0 -1
  195. package/dist/hooks/sync/orchestratorShared.test.js +0 -98
  196. package/dist/hooks/sync/pullLifecycle.test.d.ts +0 -1
  197. package/dist/hooks/sync/pullLifecycle.test.js +0 -80
  198. package/dist/hooks/sync/recovery.test.d.ts +0 -1
  199. package/dist/hooks/sync/recovery.test.js +0 -292
  200. package/dist/hooks/sync/transfers.test.d.ts +0 -1
  201. package/dist/hooks/sync/transfers.test.js +0 -928
  202. package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +0 -1
  203. package/dist/hooks/sync/useRecentSyncEvents.test.js +0 -124
  204. package/dist/hooks/sync/useSyncStatusActions.test.d.ts +0 -1
  205. package/dist/hooks/sync/useSyncStatusActions.test.js +0 -133
  206. package/dist/hooks/sync/useSyncStatusControls.test.d.ts +0 -1
  207. package/dist/hooks/sync/useSyncStatusControls.test.js +0 -88
  208. package/dist/hooks/useFilterSort.test.d.ts +0 -1
  209. package/dist/hooks/useFilterSort.test.js +0 -419
  210. package/dist/hooks/useRealtimeSync.test.d.ts +0 -1
  211. package/dist/hooks/useRealtimeSync.test.js +0 -311
  212. package/dist/hooks/useSyncOrchestrator.aiProfiles.test.d.ts +0 -1
  213. package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +0 -54
  214. package/dist/hooks/useSyncOrchestrator.context-assets.test.d.ts +0 -1
  215. package/dist/hooks/useSyncOrchestrator.context-assets.test.js +0 -228
  216. package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +0 -1
  217. package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +0 -2027
  218. package/dist/hooks/useTaskData.test.d.ts +0 -1
  219. package/dist/hooks/useTaskData.test.js +0 -291
  220. package/dist/hooks/useTaskMutations.test.d.ts +0 -1
  221. package/dist/hooks/useTaskMutations.test.js +0 -256
  222. package/dist/hooks/useTaskforce.contract.test.d.ts +0 -1
  223. package/dist/hooks/useTaskforce.contract.test.js +0 -7
  224. package/dist/hooks/useTaskforce.priority-filters.test.d.ts +0 -1
  225. package/dist/hooks/useTaskforce.priority-filters.test.js +0 -28
  226. package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +0 -1
  227. package/dist/hooks/useTaskforce.runtime-routing.test.js +0 -246
  228. package/dist/hooks/useTaskforce.sync-behavior.test.d.ts +0 -1
  229. package/dist/hooks/useTaskforce.sync-behavior.test.js +0 -3644
  230. package/dist/hooks/useWorkspaceSyncController.test.d.ts +0 -1
  231. package/dist/hooks/useWorkspaceSyncController.test.js +0 -192
  232. package/dist/hooks/workspace/useTaskforceApiRouting.test.d.ts +0 -1
  233. package/dist/hooks/workspace/useTaskforceApiRouting.test.js +0 -77
  234. package/dist/hooks/workspace/workspaceLocalState.test.d.ts +0 -1
  235. package/dist/hooks/workspace/workspaceLocalState.test.js +0 -59
  236. package/dist/localization/localizationCatalogs.test.d.ts +0 -1
  237. package/dist/localization/localizationCatalogs.test.js +0 -37
  238. package/dist/mcp/aiProfileBootstrap.test.d.ts +0 -1
  239. package/dist/mcp/aiProfileBootstrap.test.js +0 -68
  240. package/dist/mcp/canonicalAssetHelpers.test.d.ts +0 -1
  241. package/dist/mcp/canonicalAssetHelpers.test.js +0 -67
  242. package/dist/mcp/clientIntegrations.test.d.ts +0 -1
  243. package/dist/mcp/clientIntegrations.test.js +0 -219
  244. package/dist/mcp/optionResolution.test.d.ts +0 -1
  245. package/dist/mcp/optionResolution.test.js +0 -43
  246. package/dist/mcp/runtime.test.d.ts +0 -1
  247. package/dist/mcp/runtime.test.js +0 -5211
  248. package/dist/mcp/structuredCommentValidation.test.d.ts +0 -1
  249. package/dist/mcp/structuredCommentValidation.test.js +0 -31
  250. package/dist/mcp/structuredDocValidation.test.d.ts +0 -1
  251. package/dist/mcp/structuredDocValidation.test.js +0 -35
  252. package/dist/mcp/toolRegistry.test.d.ts +0 -1
  253. package/dist/mcp/toolRegistry.test.js +0 -34
  254. package/dist/migrations/billingSchemaParity.test.d.ts +0 -1
  255. package/dist/migrations/billingSchemaParity.test.js +0 -160
  256. package/dist/migrations/taskSchemaMigrations.test.d.ts +0 -1
  257. package/dist/migrations/taskSchemaMigrations.test.js +0 -225
  258. package/dist/qaOpen.test.d.ts +0 -1
  259. package/dist/qaOpen.test.js +0 -56
  260. package/dist/releaseVersion.test.d.ts +0 -1
  261. package/dist/releaseVersion.test.js +0 -32
  262. package/dist/runtime/appGates.test.d.ts +0 -1
  263. package/dist/runtime/appGates.test.js +0 -42
  264. package/dist/server/aiProfileAvatarAssets.test.d.ts +0 -1
  265. package/dist/server/aiProfileAvatarAssets.test.js +0 -213
  266. package/dist/server/annotatedAttachmentsRoutes.test.d.ts +0 -1
  267. package/dist/server/annotatedAttachmentsRoutes.test.js +0 -532
  268. package/dist/server/auth.test.d.ts +0 -1
  269. package/dist/server/auth.test.js +0 -131
  270. package/dist/server/buildInfo.test.d.ts +0 -1
  271. package/dist/server/buildInfo.test.js +0 -29
  272. package/dist/server/cors.test.d.ts +0 -1
  273. package/dist/server/cors.test.js +0 -77
  274. package/dist/server/documentReviewRoutes.test.d.ts +0 -1
  275. package/dist/server/documentReviewRoutes.test.js +0 -190
  276. package/dist/server/email.test.d.ts +0 -1
  277. package/dist/server/email.test.js +0 -113
  278. package/dist/server/index.cookieProxy.test.d.ts +0 -1
  279. package/dist/server/index.cookieProxy.test.js +0 -67
  280. package/dist/server/index.rateLimit.test.d.ts +0 -1
  281. package/dist/server/index.rateLimit.test.js +0 -22
  282. package/dist/server/index.test.d.ts +0 -1
  283. package/dist/server/index.test.js +0 -283
  284. package/dist/server/rateLimit.test.d.ts +0 -1
  285. package/dist/server/rateLimit.test.js +0 -107
  286. package/dist/server/realtimeSync.auth.test.d.ts +0 -1
  287. package/dist/server/realtimeSync.auth.test.js +0 -62
  288. package/dist/server/realtimeSync.replay.test.d.ts +0 -1
  289. package/dist/server/realtimeSync.replay.test.js +0 -192
  290. package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +0 -1
  291. package/dist/server/realtimeSync.workspaceIsolation.test.js +0 -101
  292. package/dist/server/routes/billing.test.d.ts +0 -1
  293. package/dist/server/routes/billing.test.js +0 -3515
  294. package/dist/server/routes/shared.test.d.ts +0 -1
  295. package/dist/server/routes/shared.test.js +0 -32
  296. package/dist/server/routes/sync.integration.test.d.ts +0 -1
  297. package/dist/server/routes/sync.integration.test.js +0 -2932
  298. package/dist/server/routes/syncAuxRoutes.test.d.ts +0 -1
  299. package/dist/server/routes/syncAuxRoutes.test.js +0 -158
  300. package/dist/server/routes/syncRouteGuards.test.d.ts +0 -1
  301. package/dist/server/routes/syncRouteGuards.test.js +0 -94
  302. package/dist/server/routes.test.d.ts +0 -1
  303. package/dist/server/routes.test.js +0 -15612
  304. package/dist/server/runtimeMode.test.d.ts +0 -1
  305. package/dist/server/runtimeMode.test.js +0 -26
  306. package/dist/server/securityHeaders.test.d.ts +0 -1
  307. package/dist/server/securityHeaders.test.js +0 -70
  308. package/dist/services/templateEngine.test.d.ts +0 -1
  309. package/dist/services/templateEngine.test.js +0 -150
  310. package/dist/services/templates.test.d.ts +0 -1
  311. package/dist/services/templates.test.js +0 -45
  312. package/dist/services/workflowDocumentFixtures.test.d.ts +0 -1
  313. package/dist/services/workflowDocumentFixtures.test.js +0 -78
  314. package/dist/services/workflowExportMatrix.test.d.ts +0 -1
  315. package/dist/services/workflowExportMatrix.test.js +0 -113
  316. package/dist/services/workflowExportSnapshots.test.d.ts +0 -1
  317. package/dist/services/workflowExportSnapshots.test.js +0 -30
  318. package/dist/services/workflowGeneration.test.d.ts +0 -1
  319. package/dist/services/workflowGeneration.test.js +0 -12
  320. package/dist/services/workflowSimulation.test.d.ts +0 -1
  321. package/dist/services/workflowSimulation.test.js +0 -113
  322. package/dist/services/workflowV2Policy.test.d.ts +0 -1
  323. package/dist/services/workflowV2Policy.test.js +0 -80
  324. package/dist/shared/customTaxonomyLibrary.test.d.ts +0 -1
  325. package/dist/shared/customTaxonomyLibrary.test.js +0 -20
  326. package/dist/shared/passwordPolicy.test.d.ts +0 -1
  327. package/dist/shared/passwordPolicy.test.js +0 -34
  328. package/dist/shared/runtimeContract.test.d.ts +0 -1
  329. package/dist/shared/runtimeContract.test.js +0 -23
  330. package/dist/shared/taxonomyLibrary.test.d.ts +0 -1
  331. package/dist/shared/taxonomyLibrary.test.js +0 -26
  332. package/dist/shared/taxonomyState.test.d.ts +0 -1
  333. package/dist/shared/taxonomyState.test.js +0 -71
  334. package/dist/soak/preflight.cli.d.ts +0 -1
  335. package/dist/soak/preflight.cli.js +0 -28
  336. package/dist/soak/preflight.d.ts +0 -26
  337. package/dist/soak/preflight.js +0 -113
  338. package/dist/soak/preflight.test.d.ts +0 -1
  339. package/dist/soak/preflight.test.js +0 -39
  340. package/dist/storage/objectStorageClient.test.d.ts +0 -1
  341. package/dist/storage/objectStorageClient.test.js +0 -82
  342. package/dist/storage/objectStorageConfig.test.d.ts +0 -1
  343. package/dist/storage/objectStorageConfig.test.js +0 -50
  344. package/dist/storage/postgresAdapter.test.d.ts +0 -1
  345. package/dist/storage/postgresAdapter.test.js +0 -29
  346. package/dist/storage/workspaceAssetStore.test.d.ts +0 -1
  347. package/dist/storage/workspaceAssetStore.test.js +0 -588
  348. package/dist/sync/cloudSyncApi.test.d.ts +0 -1
  349. package/dist/sync/cloudSyncApi.test.js +0 -111
  350. package/dist/sync/collaborationSyncPayload.test.d.ts +0 -1
  351. package/dist/sync/collaborationSyncPayload.test.js +0 -125
  352. package/dist/sync/contentSyncPayload.test.d.ts +0 -1
  353. package/dist/sync/contentSyncPayload.test.js +0 -143
  354. package/dist/sync/encryptionService.test.d.ts +0 -1
  355. package/dist/sync/encryptionService.test.js +0 -52
  356. package/dist/sync/planningSyncPayload.test.d.ts +0 -1
  357. package/dist/sync/planningSyncPayload.test.js +0 -92
  358. package/dist/sync/realtimeFeature.test.d.ts +0 -1
  359. package/dist/sync/realtimeFeature.test.js +0 -30
  360. package/dist/sync/realtimeReconcile.test.d.ts +0 -1
  361. package/dist/sync/realtimeReconcile.test.js +0 -43
  362. package/dist/sync/syncApplyHandlers.test.d.ts +0 -1
  363. package/dist/sync/syncApplyHandlers.test.js +0 -626
  364. package/dist/sync/syncService.test.d.ts +0 -1
  365. package/dist/sync/syncService.test.js +0 -903
  366. package/dist/sync/taskSyncPayload.test.d.ts +0 -1
  367. package/dist/sync/taskSyncPayload.test.js +0 -54
  368. package/dist/sync/workspacePullFeed.test.d.ts +0 -1
  369. package/dist/sync/workspacePullFeed.test.js +0 -438
  370. package/dist/sync/workspaceSyncModel.test.d.ts +0 -1
  371. package/dist/sync/workspaceSyncModel.test.js +0 -1442
  372. package/dist/test/setup.d.ts +0 -1
  373. package/dist/test/setup.js +0 -15
  374. package/dist/ui/assets/documentReferences-BPWp6ce0.js +0 -1
  375. package/dist/ui/assets/index-zvbo2Jse.js +0 -5
  376. package/dist/utils/accountProfileSummaryCache.test.d.ts +0 -1
  377. package/dist/utils/accountProfileSummaryCache.test.js +0 -63
  378. package/dist/utils/annotatedAttachments.test.d.ts +0 -1
  379. package/dist/utils/annotatedAttachments.test.js +0 -108
  380. package/dist/utils/assignees.test.d.ts +0 -1
  381. package/dist/utils/assignees.test.js +0 -25
  382. package/dist/utils/avatarUpload.test.d.ts +0 -1
  383. package/dist/utils/avatarUpload.test.js +0 -40
  384. package/dist/utils/canonicalAssetKind.test.d.ts +0 -1
  385. package/dist/utils/canonicalAssetKind.test.js +0 -24
  386. package/dist/utils/coalescedRefresh.test.d.ts +0 -1
  387. package/dist/utils/coalescedRefresh.test.js +0 -30
  388. package/dist/utils/constants.icons.test.d.ts +0 -1
  389. package/dist/utils/constants.icons.test.js +0 -41
  390. package/dist/utils/planParser.test.d.ts +0 -1
  391. package/dist/utils/planParser.test.js +0 -183
  392. package/dist/utils/planningReferences.test.d.ts +0 -1
  393. package/dist/utils/planningReferences.test.js +0 -17
  394. package/dist/utils/supportContact.test.d.ts +0 -1
  395. package/dist/utils/supportContact.test.js +0 -19
  396. package/dist/utils/syncEventDetails.test.d.ts +0 -1
  397. package/dist/utils/syncEventDetails.test.js +0 -23
  398. package/dist/utils/syncEventPresentation.test.d.ts +0 -1
  399. package/dist/utils/syncEventPresentation.test.js +0 -64
  400. package/dist/utils/syncStatusPresentation.test.d.ts +0 -1
  401. package/dist/utils/syncStatusPresentation.test.js +0 -164
  402. package/dist/utils/taskActivity.test.d.ts +0 -1
  403. package/dist/utils/taskActivity.test.js +0 -218
  404. package/dist/utils/taskDraftDefaults.test.d.ts +0 -1
  405. package/dist/utils/taskDraftDefaults.test.js +0 -34
  406. package/dist/utils/taskDragZones.test.d.ts +0 -1
  407. package/dist/utils/taskDragZones.test.js +0 -14
  408. package/dist/utils/taskNormalization.test.d.ts +0 -1
  409. package/dist/utils/taskNormalization.test.js +0 -158
  410. package/dist/utils/taskSearch.test.d.ts +0 -1
  411. package/dist/utils/taskSearch.test.js +0 -69
  412. package/dist/utils/taskUtils.test.d.ts +0 -1
  413. package/dist/utils/taskUtils.test.js +0 -19
  414. package/dist/utils/taskforceApiClient.test.d.ts +0 -1
  415. package/dist/utils/taskforceApiClient.test.js +0 -44
  416. package/dist/utils/taxonomyFormDefaults.test.d.ts +0 -1
  417. package/dist/utils/taxonomyFormDefaults.test.js +0 -63
  418. package/dist/utils/uiNotice.test.d.ts +0 -1
  419. package/dist/utils/uiNotice.test.js +0 -18
  420. package/dist/utils/workspaceIdentity.test.d.ts +0 -1
  421. package/dist/utils/workspaceIdentity.test.js +0 -61
  422. package/dist/utils/workspaceLifecycle.test.d.ts +0 -1
  423. package/dist/utils/workspaceLifecycle.test.js +0 -64
  424. package/dist/utils/workspaceSyncPresentation.test.d.ts +0 -1
  425. package/dist/utils/workspaceSyncPresentation.test.js +0 -71
  426. package/scripts/bootstrap-playwright-auth.mjs +0 -155
  427. package/scripts/check-cloud-mcp.mjs +0 -83
  428. package/scripts/check-compat-boundaries.mjs +0 -41
  429. package/scripts/check-env.ts +0 -31
  430. package/scripts/check-localization-strings.mjs +0 -49
  431. package/scripts/check-runtime-boundaries.mjs +0 -44
  432. package/scripts/debug-global.mjs +0 -34
  433. package/scripts/debug-login.mjs +0 -32
  434. package/scripts/debug-server.mjs +0 -36
  435. package/scripts/deploy-prod.sh +0 -41
  436. package/scripts/deploy-staging.sh +0 -23
  437. package/scripts/export-sqlite-to-postgres.mjs +0 -123
  438. package/scripts/generate-env-example.ts +0 -8
  439. package/scripts/mcp-stdio-adapter.mjs +0 -160
  440. package/scripts/migrate-task-data-assets.mjs +0 -408
  441. package/scripts/playwright-auth.sh +0 -19
  442. package/scripts/qa-open-lib.mjs +0 -175
  443. package/scripts/qa-open-lib.mjs.d.ts +0 -49
  444. package/scripts/qa-open.mjs +0 -352
  445. package/scripts/release-version-lib.mjs +0 -88
  446. package/scripts/release-version.mjs +0 -72
  447. package/scripts/run-billing-performance-smoke.sh +0 -24
  448. package/scripts/run-dev-proxy.sh +0 -51
  449. package/scripts/run-e2e-realtime.sh +0 -30
  450. package/scripts/run-smoke.sh +0 -35
  451. package/scripts/run-soak.sh +0 -41
  452. package/scripts/test-global.js +0 -143
  453. package/scripts/update-homebrew-formula.sh +0 -108
  454. package/scripts/with-esbuild.sh +0 -11
@@ -1,710 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
3
- import { afterEach, describe, expect, it, vi } from 'vitest';
4
- import { MemoryRouter } from 'react-router-dom';
5
- import { PlansPage } from './PlansPage';
6
- import { ACCOUNT_PROFILE_SUMMARY_PATH, invalidateAccountProfileSummaryCache } from '../../utils/accountProfileSummaryCache';
7
- vi.mock('./PlanComparisonPage', () => ({
8
- PlanComparisonPage: ({ heading, variant, pricingEndpoint, statusBanner, topActions, onSelectPlan, onBack, backLabel, backDisabled }) => (_jsxs("div", { children: [_jsx("h1", { children: heading }), variant ? _jsx("div", { "data-testid": "plans-variant", children: variant }) : null, 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({
9
- planId: 'free',
10
- planVersionId: 'free-v1',
11
- interval: 'month',
12
- pricingType: 'free',
13
- pricingAudience: 'public',
14
- isCurrentPlan: false
15
- }), children: "Select Free Plan" })) : null, onBack ? (_jsx("button", { onClick: onBack, disabled: backDisabled, children: backLabel || 'Back' })) : null] }))
16
- }));
17
- describe('PlansPage', () => {
18
- afterEach(() => {
19
- vi.useRealTimers();
20
- vi.unstubAllGlobals();
21
- });
22
- it('builds the pricing endpoint through resolveCloudAuthUrl', async () => {
23
- vi.stubGlobal('fetch', vi.fn(async () => ({
24
- ok: true,
25
- json: async () => ({})
26
- })));
27
- 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)}` }) }));
28
- expect(await screen.findByTestId('pricing-endpoint')).toHaveTextContent('/api/proxy?path=%2Fapi%2Ftaskforce%2Fpublic%2Fpricing');
29
- expect(screen.getByTestId('plans-variant')).toHaveTextContent('site');
30
- });
31
- it('shows recovery messaging only after bounded retries are exhausted', async () => {
32
- vi.useFakeTimers();
33
- let profileSummaryCalls = 0;
34
- let confirmCalls = 0;
35
- const fetchMock = vi.fn(async (url) => {
36
- if (url.includes('/api/taskforce/account/profile-summary')) {
37
- profileSummaryCalls += 1;
38
- if (profileSummaryCalls <= 2) {
39
- return {
40
- ok: true,
41
- json: async () => ({
42
- planId: 'basic',
43
- planVersionId: 'basic-v1',
44
- entitlementState: 'checkout_pending',
45
- gate: 'checkout_pending',
46
- message: 'Complete checkout to continue.'
47
- })
48
- };
49
- }
50
- return {
51
- ok: true,
52
- json: async () => ({
53
- planId: 'basic',
54
- planVersionId: 'basic-v1',
55
- entitlementState: 'pending_plan_selection',
56
- gate: 'plan_selection_required',
57
- message: 'Your previous checkout expired. Choose a plan to continue.',
58
- planSelectionRequired: true
59
- })
60
- };
61
- }
62
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
63
- confirmCalls += 1;
64
- return {
65
- ok: false,
66
- status: 409,
67
- json: async () => ({
68
- error: 'Checkout session has not completed yet.',
69
- code: 'CHECKOUT_SESSION_INCOMPLETE'
70
- })
71
- };
72
- }
73
- return {
74
- ok: true,
75
- json: async () => ({})
76
- };
77
- });
78
- vi.stubGlobal('fetch', fetchMock);
79
- 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 }) }));
80
- expect(screen.getByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
81
- await act(async () => {
82
- await Promise.resolve();
83
- });
84
- expect(confirmCalls).toBe(1);
85
- await act(async () => {
86
- await vi.advanceTimersByTimeAsync(50000);
87
- });
88
- expect(confirmCalls).toBeGreaterThanOrEqual(12);
89
- expect(screen.getByText('Your previous checkout expired. Choose a plan to continue.')).toBeInTheDocument();
90
- expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
91
- }, 10000);
92
- it('retries checkout confirmation when the first confirm is incomplete and later succeeds', async () => {
93
- let profileSummaryCalls = 0;
94
- let confirmCalls = 0;
95
- const fetchMock = vi.fn(async (url) => {
96
- if (url.includes('/api/taskforce/account/profile-summary')) {
97
- profileSummaryCalls += 1;
98
- if (profileSummaryCalls <= 2) {
99
- return {
100
- ok: true,
101
- json: async () => ({
102
- planId: 'basic',
103
- planVersionId: 'basic-v1',
104
- entitlementState: 'checkout_pending',
105
- gate: 'checkout_pending',
106
- message: 'Complete checkout to continue.'
107
- })
108
- };
109
- }
110
- return {
111
- ok: true,
112
- json: async () => ({
113
- entitlementState: 'active',
114
- planId: 'basic',
115
- planVersionId: 'basic-v1',
116
- billingInterval: 'month',
117
- gate: 'ok',
118
- message: null
119
- })
120
- };
121
- }
122
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
123
- confirmCalls += 1;
124
- if (confirmCalls === 1) {
125
- return {
126
- ok: false,
127
- status: 409,
128
- json: async () => ({
129
- error: 'Checkout session has not completed yet.',
130
- code: 'CHECKOUT_SESSION_INCOMPLETE'
131
- })
132
- };
133
- }
134
- return {
135
- ok: true,
136
- status: 200,
137
- json: async () => ({ success: true })
138
- };
139
- }
140
- return {
141
- ok: true,
142
- json: async () => ({})
143
- };
144
- });
145
- vi.stubGlobal('fetch', fetchMock);
146
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_retry_success'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u1", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
147
- expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
148
- expect(await screen.findByText('Checkout completed successfully.')).toBeInTheDocument();
149
- expect(confirmCalls).toBe(2);
150
- }, 10000);
151
- it('treats an active entitlement summary as checkout success even when confirm still reports incomplete', async () => {
152
- let profileSummaryCalls = 0;
153
- let confirmCalls = 0;
154
- const fetchMock = vi.fn(async (url) => {
155
- if (url.includes('/api/taskforce/account/profile-summary')) {
156
- profileSummaryCalls += 1;
157
- if (profileSummaryCalls === 1) {
158
- return {
159
- ok: true,
160
- json: async () => ({
161
- planId: 'basic',
162
- planVersionId: 'basic-v1',
163
- entitlementState: 'checkout_pending',
164
- gate: 'checkout_pending',
165
- message: 'Complete checkout to continue.'
166
- })
167
- };
168
- }
169
- return {
170
- ok: true,
171
- json: async () => ({
172
- entitlementState: 'active',
173
- planId: 'basic',
174
- planVersionId: 'basic-v1',
175
- billingInterval: 'month',
176
- gate: 'ok',
177
- message: null
178
- })
179
- };
180
- }
181
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
182
- confirmCalls += 1;
183
- return {
184
- ok: false,
185
- status: 409,
186
- json: async () => ({
187
- error: 'Checkout session is still finalizing your plan.',
188
- code: 'CHECKOUT_SESSION_INCOMPLETE'
189
- })
190
- };
191
- }
192
- return {
193
- ok: true,
194
- json: async () => ({})
195
- };
196
- });
197
- vi.stubGlobal('fetch', fetchMock);
198
- 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 }) }));
199
- expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
200
- expect(await screen.findByText('Checkout completed successfully.')).toBeInTheDocument();
201
- expect(confirmCalls).toBe(1);
202
- }, 10000);
203
- it('does not treat an already-active account as settled until the requested interval change is visible', async () => {
204
- vi.useFakeTimers();
205
- let confirmCalls = 0;
206
- const fetchMock = vi.fn(async (url) => {
207
- if (url.includes('/api/taskforce/account/profile-summary')) {
208
- return {
209
- ok: true,
210
- json: async () => ({
211
- entitlementState: 'active',
212
- planId: 'basic',
213
- planVersionId: 'basic-v1',
214
- billingInterval: 'month',
215
- gate: 'ok',
216
- message: null
217
- })
218
- };
219
- }
220
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
221
- confirmCalls += 1;
222
- return {
223
- ok: false,
224
- status: 409,
225
- json: async () => ({
226
- error: 'Checkout session is still finalizing your plan.',
227
- code: 'CHECKOUT_SESSION_INCOMPLETE'
228
- })
229
- };
230
- }
231
- return {
232
- ok: true,
233
- json: async () => ({})
234
- };
235
- });
236
- vi.stubGlobal('fetch', fetchMock);
237
- 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 }) }));
238
- expect(screen.getByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
239
- await act(async () => {
240
- await Promise.resolve();
241
- });
242
- expect(confirmCalls).toBe(1);
243
- expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
244
- await act(async () => {
245
- await vi.advanceTimersByTimeAsync(50000);
246
- });
247
- expect(confirmCalls).toBeGreaterThanOrEqual(12);
248
- expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
249
- }, 10000);
250
- it('does not retry checkout confirmation for account mismatch responses', async () => {
251
- let confirmCalls = 0;
252
- const fetchMock = vi.fn(async (url) => {
253
- if (url.includes('/api/taskforce/account/profile-summary')) {
254
- return {
255
- ok: true,
256
- json: async () => ({
257
- planId: 'basic',
258
- planVersionId: 'basic-v1',
259
- entitlementState: 'checkout_pending',
260
- gate: 'checkout_pending',
261
- message: 'Complete checkout to continue.'
262
- })
263
- };
264
- }
265
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
266
- confirmCalls += 1;
267
- return {
268
- ok: false,
269
- status: 403,
270
- json: async () => ({
271
- error: 'Checkout session does not belong to the current account.',
272
- code: 'CHECKOUT_SESSION_ACCOUNT_MISMATCH'
273
- })
274
- };
275
- }
276
- return {
277
- ok: true,
278
- json: async () => ({})
279
- };
280
- });
281
- vi.stubGlobal('fetch', fetchMock);
282
- 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 }) }));
283
- expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
284
- await waitFor(() => {
285
- expect(confirmCalls).toBe(1);
286
- });
287
- await act(async () => {
288
- await new Promise((resolve) => setTimeout(resolve, 1200));
289
- });
290
- expect(confirmCalls).toBe(1);
291
- expect(screen.queryByText('Checkout completed successfully.')).not.toBeInTheDocument();
292
- expect(screen.getByText('Checkout session does not belong to the current account.')).toBeInTheDocument();
293
- expect(screen.queryByText('Complete checkout to continue.')).not.toBeInTheDocument();
294
- }, 10000);
295
- it('attempts checkout confirmation immediately when the user is already authenticated even if auth session is still resolving', async () => {
296
- let profileSummaryCalls = 0;
297
- let confirmCalls = 0;
298
- const fetchMock = vi.fn(async (url) => {
299
- if (url.includes('/api/taskforce/account/profile-summary')) {
300
- profileSummaryCalls += 1;
301
- if (profileSummaryCalls <= 2) {
302
- return {
303
- ok: true,
304
- json: async () => ({
305
- planId: 'basic',
306
- planVersionId: 'basic-v1',
307
- entitlementState: 'checkout_pending',
308
- gate: 'checkout_pending',
309
- message: 'Complete checkout to continue.'
310
- })
311
- };
312
- }
313
- return {
314
- ok: true,
315
- json: async () => ({
316
- entitlementState: 'active',
317
- planId: 'basic',
318
- planVersionId: 'basic-v1',
319
- gate: 'ok',
320
- message: null
321
- })
322
- };
323
- }
324
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
325
- confirmCalls += 1;
326
- return {
327
- ok: true,
328
- status: 200,
329
- json: async () => ({ success: true })
330
- };
331
- }
332
- return {
333
- ok: true,
334
- json: async () => ({})
335
- };
336
- });
337
- vi.stubGlobal('fetch', fetchMock);
338
- 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 }) }));
339
- expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
340
- await waitFor(() => {
341
- expect(confirmCalls).toBe(1);
342
- });
343
- });
344
- it('waits to confirm checkout when auth is still unresolved and the user is not yet authenticated', async () => {
345
- let profileSummaryCalls = 0;
346
- let confirmCalls = 0;
347
- const fetchMock = vi.fn(async (url) => {
348
- if (url.includes('/api/taskforce/account/profile-summary')) {
349
- profileSummaryCalls += 1;
350
- return {
351
- ok: true,
352
- json: async () => ({
353
- planId: 'basic',
354
- planVersionId: 'basic-v1',
355
- entitlementState: 'checkout_pending',
356
- gate: 'checkout_pending',
357
- message: 'Complete checkout to continue.'
358
- })
359
- };
360
- }
361
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
362
- confirmCalls += 1;
363
- return {
364
- ok: true,
365
- status: 200,
366
- json: async () => ({ success: true })
367
- };
368
- }
369
- return {
370
- ok: true,
371
- json: async () => ({})
372
- };
373
- });
374
- vi.stubGlobal('fetch', fetchMock);
375
- 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 }) }));
376
- expect(await screen.findByText('Checkout completed successfully. Finalizing your plan...')).toBeInTheDocument();
377
- expect(confirmCalls).toBe(0);
378
- 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 }) }));
379
- await waitFor(() => {
380
- expect(fetchMock.mock.calls.some(([url]) => String(url).includes('/api/taskforce/billing/checkout-session/confirm'))).toBe(true);
381
- });
382
- });
383
- it('restarts checkout confirmation after a mid-flight rerender before the first confirm attempt', async () => {
384
- let confirmCalls = 0;
385
- let profileSummaryCalls = 0;
386
- let releaseBlockedProfileSummaries = false;
387
- const blockedProfileSummaryResolvers = [];
388
- const fetchMock = vi.fn(async (url) => {
389
- if (url.includes('/api/taskforce/account/profile-summary')) {
390
- profileSummaryCalls += 1;
391
- if (!releaseBlockedProfileSummaries) {
392
- return await new Promise((resolve) => {
393
- blockedProfileSummaryResolvers.push(resolve);
394
- });
395
- }
396
- return {
397
- ok: true,
398
- json: async () => ({
399
- entitlementState: 'checkout_pending',
400
- planId: 'basic',
401
- planVersionId: 'basic-v1',
402
- gate: 'checkout_pending',
403
- message: 'Complete checkout to continue.'
404
- })
405
- };
406
- }
407
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
408
- confirmCalls += 1;
409
- return {
410
- ok: true,
411
- status: 200,
412
- json: async () => ({ success: true })
413
- };
414
- }
415
- return {
416
- ok: true,
417
- json: async () => ({})
418
- };
419
- });
420
- vi.stubGlobal('fetch', fetchMock);
421
- const firstResolveCloudAuthUrl = (path) => path;
422
- const secondResolveCloudAuthUrl = (path) => path;
423
- 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 }) }));
424
- await waitFor(() => {
425
- expect(profileSummaryCalls).toBeGreaterThan(0);
426
- });
427
- 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 }) }));
428
- releaseBlockedProfileSummaries = true;
429
- for (const resolve of blockedProfileSummaryResolvers.splice(0)) {
430
- resolve({
431
- ok: true,
432
- json: async () => ({
433
- entitlementState: 'checkout_pending',
434
- planId: 'basic',
435
- planVersionId: 'basic-v1',
436
- gate: 'checkout_pending',
437
- message: 'Complete checkout to continue.'
438
- })
439
- });
440
- }
441
- await waitFor(() => {
442
- expect(confirmCalls).toBe(1);
443
- });
444
- expect(await screen.findByText('Checkout completed successfully.')).toBeInTheDocument();
445
- });
446
- it('shows conflict-specific recovery messaging when the account lands on plans already blocked', async () => {
447
- const fetchMock = vi.fn()
448
- .mockResolvedValueOnce({
449
- ok: true,
450
- json: async () => ({
451
- planId: 'basic',
452
- planVersionId: 'basic-v1',
453
- entitlementState: 'pending_plan_selection',
454
- gate: 'plan_selection_required',
455
- message: 'Choose a plan to continue.',
456
- billingConflictCode: 'CHECKOUT_SESSION_SUPERSEDED',
457
- planSelectionRequired: true
458
- })
459
- });
460
- vi.stubGlobal('fetch', fetchMock);
461
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u2", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
462
- expect(await screen.findByText('A newer checkout replaced your previous checkout. Choose a plan to continue.')).toBeInTheDocument();
463
- });
464
- it('shows conflict-specific recovery messaging after checkout cancel when the latest attempt expired', async () => {
465
- const fetchMock = vi.fn()
466
- .mockResolvedValueOnce({
467
- ok: true,
468
- json: async () => ({
469
- planId: 'basic',
470
- planVersionId: 'basic-v1',
471
- entitlementState: 'checkout_pending',
472
- gate: 'checkout_pending',
473
- message: 'Complete checkout to continue.'
474
- })
475
- })
476
- .mockResolvedValueOnce({
477
- ok: true,
478
- json: async () => ({
479
- planId: 'basic',
480
- planVersionId: 'basic-v1',
481
- entitlementState: 'pending_plan_selection',
482
- gate: 'plan_selection_required',
483
- message: 'Choose a plan to continue.',
484
- billingConflictCode: 'CHECKOUT_SESSION_EXPIRED',
485
- planSelectionRequired: true
486
- })
487
- });
488
- vi.stubGlobal('fetch', fetchMock);
489
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=cancel'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u3", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
490
- expect(await screen.findByText('Your previous checkout expired. Choose a plan to continue.')).toBeInTheDocument();
491
- });
492
- it('auto-continues after a free plan grant and exposes a taskforce CTA once access is active', async () => {
493
- const onContinueToTaskforce = vi.fn();
494
- const fetchMock = vi.fn()
495
- .mockResolvedValueOnce({
496
- ok: true,
497
- json: async () => ({
498
- entitlementState: 'pending_plan_selection',
499
- gate: 'plan_selection_required',
500
- message: 'Choose a plan to continue.'
501
- })
502
- })
503
- .mockResolvedValueOnce({
504
- ok: true,
505
- json: async () => ({
506
- checkoutState: 'free'
507
- })
508
- })
509
- .mockResolvedValueOnce({
510
- ok: true,
511
- json: async () => ({
512
- entitlementState: 'active',
513
- planId: 'free',
514
- planVersionId: 'free-v1',
515
- gate: 'ok',
516
- message: null
517
- })
518
- });
519
- vi.stubGlobal('fetch', fetchMock);
520
- 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 }) }));
521
- await screen.findByRole('heading', { name: 'Subscription Plans' });
522
- expect(screen.queryByText('Choose a plan to continue.')).not.toBeInTheDocument();
523
- fireEvent.click(screen.getByRole('button', { name: 'Select Free Plan' }));
524
- await waitFor(() => {
525
- expect(onContinueToTaskforce).toHaveBeenCalledTimes(1);
526
- });
527
- expect(screen.getByRole('button', { name: 'Take Me to Taskforce' })).toBeInTheDocument();
528
- });
529
- it('disables the back action while the account is still entitlement-blocked', async () => {
530
- const fetchMock = vi.fn()
531
- .mockResolvedValueOnce({
532
- ok: true,
533
- json: async () => ({
534
- entitlementState: 'pending_plan_selection',
535
- gate: 'plan_selection_required',
536
- message: 'Choose a plan to continue.'
537
- })
538
- });
539
- vi.stubGlobal('fetch', fetchMock);
540
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&gate=plan_selection_required'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u5", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
541
- expect(await screen.findByRole('button', { name: 'Back to App' })).toBeDisabled();
542
- expect(screen.queryByText('Choose a plan to continue.')).not.toBeInTheDocument();
543
- });
544
- it('does not auto-continue after an in-place paid interval update for an already active account', async () => {
545
- const onContinueToTaskforce = vi.fn();
546
- let profileSummaryCalls = 0;
547
- const fetchMock = vi.fn(async (url) => {
548
- if (url.includes('/api/taskforce/account/profile-summary')) {
549
- profileSummaryCalls += 1;
550
- if (profileSummaryCalls <= 2) {
551
- return {
552
- ok: true,
553
- json: async () => ({
554
- entitlementState: 'active',
555
- planId: 'basic',
556
- planVersionId: 'basic-v1',
557
- gate: 'ok',
558
- message: null
559
- })
560
- };
561
- }
562
- return {
563
- ok: true,
564
- json: async () => ({
565
- entitlementState: 'active',
566
- planId: 'basic',
567
- planVersionId: 'basic-v1',
568
- billingInterval: 'year',
569
- gate: 'ok',
570
- message: null
571
- })
572
- };
573
- }
574
- if (url.includes('/api/taskforce/billing/checkout-session')) {
575
- return {
576
- ok: true,
577
- json: async () => ({
578
- checkoutState: 'updated',
579
- message: 'Your subscription was updated successfully.'
580
- })
581
- };
582
- }
583
- return {
584
- ok: true,
585
- json: async () => ({})
586
- };
587
- });
588
- vi.stubGlobal('fetch', fetchMock);
589
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=start&planId=basic&planVersionId=basic-v1&interval=year'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u6", runtimeMode: "local", authSessionResolved: true, resolveCloudAuthUrl: (path) => path, onContinueToTaskforce: onContinueToTaskforce }) }));
590
- expect(await screen.findByText('Your subscription was updated successfully.')).toBeInTheDocument();
591
- expect(onContinueToTaskforce).not.toHaveBeenCalled();
592
- });
593
- it('does not auto-continue after confirming checkout when the account was already active', async () => {
594
- const onContinueToTaskforce = vi.fn();
595
- let profileSummaryCalls = 0;
596
- const fetchMock = vi.fn(async (url) => {
597
- if (url.includes('/api/taskforce/account/profile-summary')) {
598
- profileSummaryCalls += 1;
599
- if (profileSummaryCalls <= 2) {
600
- return {
601
- ok: true,
602
- json: async () => ({
603
- entitlementState: 'active',
604
- planId: 'basic',
605
- planVersionId: 'basic-v1',
606
- gate: 'ok',
607
- message: null
608
- })
609
- };
610
- }
611
- return {
612
- ok: true,
613
- json: async () => ({
614
- entitlementState: 'active',
615
- planId: 'team-5',
616
- planVersionId: 'team-5-v1',
617
- gate: 'ok',
618
- message: null
619
- })
620
- };
621
- }
622
- if (url.includes('/api/taskforce/billing/checkout-session/confirm')) {
623
- return {
624
- ok: true,
625
- json: async () => ({ success: true })
626
- };
627
- }
628
- return {
629
- ok: true,
630
- json: async () => ({})
631
- };
632
- });
633
- vi.stubGlobal('fetch', fetchMock);
634
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans&checkout=success&session_id=cs_test_existing_active'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u7", runtimeMode: "local", authSessionResolved: true, resolveCloudAuthUrl: (path) => path, onContinueToTaskforce: onContinueToTaskforce }) }));
635
- expect(await screen.findByText('Checkout completed successfully.')).toBeInTheDocument();
636
- expect(onContinueToTaskforce).not.toHaveBeenCalled();
637
- });
638
- it('shows trial-specific messaging while still allowing return to Taskforce', async () => {
639
- const fetchMock = vi.fn().mockResolvedValue({
640
- ok: true,
641
- json: async () => ({
642
- entitlementState: 'trialing',
643
- planId: 'starter',
644
- planVersionId: 'starter-v1',
645
- gate: 'ok',
646
- trialEnd: '2026-06-01T12:00:00.000Z'
647
- })
648
- });
649
- vi.stubGlobal('fetch', fetchMock);
650
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u8", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path, onContinueToTaskforce: vi.fn() }) }));
651
- expect(await screen.findByText(/Your trial is active through/)).toBeInTheDocument();
652
- expect(screen.getByRole('button', { name: 'Take Me to Taskforce' })).toBeEnabled();
653
- });
654
- it('does not claim an expired trial is still active through a past date', async () => {
655
- const nowSpy = vi.spyOn(Date, 'now').mockReturnValue(new Date('2026-04-20T12:00:00.000Z').getTime());
656
- const fetchMock = vi.fn().mockResolvedValue({
657
- ok: true,
658
- json: async () => ({
659
- entitlementState: 'trialing',
660
- planId: 'starter',
661
- planVersionId: 'starter-v1',
662
- gate: 'ok',
663
- trialEnd: '2026-04-12T16:09:09.000Z'
664
- })
665
- });
666
- vi.stubGlobal('fetch', fetchMock);
667
- invalidateAccountProfileSummaryCache(ACCOUNT_PROFILE_SUMMARY_PATH, { identityKey: 'u8' });
668
- try {
669
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u8", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path, onContinueToTaskforce: vi.fn() }) }));
670
- expect(await screen.findByText('Your trial end date has passed. Billing status is updating.')).toBeInTheDocument();
671
- expect(screen.queryByText(/Your trial is active through/)).not.toBeInTheDocument();
672
- }
673
- finally {
674
- nowSpy.mockRestore();
675
- }
676
- });
677
- it('shows suspended accounts a billing-recovery message and keeps return blocked', async () => {
678
- const fetchMock = vi.fn().mockResolvedValue({
679
- ok: true,
680
- json: async () => ({
681
- entitlementState: 'suspended',
682
- planId: 'pro',
683
- planVersionId: 'pro-v1',
684
- gate: 'missing_entitlement',
685
- stripeCustomerId: 'cus_123'
686
- })
687
- });
688
- vi.stubGlobal('fetch', fetchMock);
689
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u9", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
690
- expect(await screen.findByText('Your access is suspended because billing needs attention. Update billing to restore access.')).toBeInTheDocument();
691
- expect(screen.getByRole('button', { name: 'Back to App' })).toBeDisabled();
692
- expect(screen.getByText('Your access is suspended because billing needs attention. Update billing to restore access.')).toHaveAttribute('data-status-type', 'error');
693
- });
694
- it('shows canceled accounts reactivation messaging instead of generic inactive copy', async () => {
695
- const fetchMock = vi.fn().mockResolvedValue({
696
- ok: true,
697
- json: async () => ({
698
- entitlementState: 'canceled',
699
- planId: 'pro',
700
- planVersionId: 'pro-v1',
701
- gate: 'missing_entitlement',
702
- message: 'This generic message should be ignored.'
703
- })
704
- });
705
- vi.stubGlobal('fetch', fetchMock);
706
- render(_jsx(MemoryRouter, { initialEntries: ['/?screen=plans'], children: _jsx(PlansPage, { isAuthenticated: true, authUserId: "u10", runtimeMode: "cloud", authSessionResolved: true, resolveCloudAuthUrl: (path) => path }) }));
707
- expect(await screen.findByText('Your access has ended. Choose a plan to reactivate your workspace.')).toBeInTheDocument();
708
- expect(screen.queryByText('This generic message should be ignored.')).not.toBeInTheDocument();
709
- });
710
- });