@taskforcehq/taskforce 0.3.309 → 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 (470) hide show
  1. package/README.md +89 -127
  2. package/dist/TaskforceCore.js +1 -1
  3. package/dist/components/context/ContextAttachmentManager.js +4 -3
  4. package/dist/components/features/InitiativesModule.js +1 -1
  5. package/dist/components/features/TaskSettings.js +1 -1
  6. package/dist/components/ui/DisclosureSectionHeader.d.ts +12 -0
  7. package/dist/components/ui/DisclosureSectionHeader.js +8 -0
  8. package/dist/components/views/PlanComparisonPage.js +1 -1
  9. package/dist/components/views/StandaloneLayout.js +18 -4
  10. package/dist/components/views/panels/PlanningDrawer.js +2 -1
  11. package/dist/components/views/standalone/modals/AccountHubModal.js +1 -1
  12. package/dist/components/views/standalone/modals/HelpModal.d.ts +3 -1
  13. package/dist/components/views/standalone/modals/HelpModal.js +17 -2
  14. package/dist/core/PlanEntitlementService.d.ts +2 -0
  15. package/dist/core/PlanEntitlementService.js +57 -4
  16. package/dist/hooks/useFilterSort.js +1 -1
  17. package/dist/hooks/useTaskforce.js +2 -2
  18. package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +5 -2
  19. package/dist/localization/locales/en-US.js +1 -1
  20. package/dist/localization/locales/es-419.js +1 -1
  21. package/dist/localization/locales/pt-BR.js +1 -1
  22. package/dist/mcp/runtime.js +49 -14
  23. package/dist/server/routes/billing.js +0 -1
  24. package/dist/ui/assets/AgentsModule-BULqIo8e.js +1 -0
  25. package/dist/ui/assets/{AnnotatedAttachmentWorkspace-CCckzWYZ.js → AnnotatedAttachmentWorkspace-DHr4rHK9.js} +1 -1
  26. package/dist/ui/assets/ContextAttachmentManager-DoMe2OpY.js +3 -0
  27. package/dist/ui/assets/{DocumentWorkspace-BVaWPA25.js → DocumentWorkspace-DumBWhvb.js} +1 -1
  28. package/dist/ui/assets/{EntityActivityTimeline-DSj0ThaK.js → EntityActivityTimeline-sHk8Nzbq.js} +1 -1
  29. package/dist/ui/assets/{InitiativesModule-AxMkWtxH.js → InitiativesModule-3X9UNzHh.js} +1 -1
  30. package/dist/ui/assets/PlansPage-C3A3EYaV.js +1 -0
  31. package/dist/ui/assets/PlansPage-DeAzWYTb.css +1 -0
  32. package/dist/ui/assets/{TaskContextUpload-Dw4rTF4i.js → TaskContextUpload-C8G7pWkX.js} +1 -1
  33. package/dist/ui/assets/{TaskSettings-f2ga42_V.js → TaskSettings-DM1o9Wla.js} +2 -2
  34. package/dist/ui/assets/{WorkflowsModule-E4UL3mov.js → WorkflowsModule-CW0crzvD.js} +1 -1
  35. package/dist/ui/assets/documentReferences-BZB3nMRb.js +1 -0
  36. package/dist/ui/assets/index-BWFQ9mGn.js +5 -0
  37. package/dist/ui/assets/{index-BvAbqx5Q.css → index-DcK_8tuE.css} +1 -1
  38. package/dist/ui/assets/{vendor-icons-B32hGuF2.js → vendor-icons-CLnehDTw.js} +1 -1
  39. package/dist/ui/index.html +3 -3
  40. package/dist/utils/supportContact.d.ts +9 -0
  41. package/dist/utils/supportContact.js +32 -0
  42. package/package.json +12 -4
  43. package/scripts/postinstall.js +4 -3
  44. package/dist/TaskforceCore.CategoryFallback.test.d.ts +0 -1
  45. package/dist/TaskforceCore.CategoryFallback.test.js +0 -101
  46. package/dist/TaskforceCore.filter-persistence.test.d.ts +0 -1
  47. package/dist/TaskforceCore.filter-persistence.test.js +0 -402
  48. package/dist/TaskforceCore.routing.test.d.ts +0 -1
  49. package/dist/TaskforceCore.routing.test.js +0 -311
  50. package/dist/TaskforceCore.test.d.ts +0 -1
  51. package/dist/TaskforceCore.test.js +0 -7910
  52. package/dist/TaskforceWidget.test.d.ts +0 -1
  53. package/dist/TaskforceWidget.test.js +0 -92
  54. package/dist/UnsavedChangesRelaxed.test.d.ts +0 -1
  55. package/dist/UnsavedChangesRelaxed.test.js +0 -16
  56. package/dist/__tests__/localizationCatalogs.test.d.ts +0 -1
  57. package/dist/__tests__/localizationCatalogs.test.js +0 -54
  58. package/dist/__tests__/workflowSimulation.test.d.ts +0 -1
  59. package/dist/__tests__/workflowSimulation.test.js +0 -113
  60. package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.d.ts +0 -1
  61. package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.js +0 -278
  62. package/dist/annotatedAttachments/payload.test.d.ts +0 -1
  63. package/dist/annotatedAttachments/payload.test.js +0 -67
  64. package/dist/compat/workspaceSyncCompat.test.d.ts +0 -1
  65. package/dist/compat/workspaceSyncCompat.test.js +0 -124
  66. package/dist/components/features/AgentsModule.test.d.ts +0 -1
  67. package/dist/components/features/AgentsModule.test.js +0 -601
  68. package/dist/components/features/AnnotatedAttachmentWorkspace.test.d.ts +0 -1
  69. package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +0 -2883
  70. package/dist/components/features/DocumentWorkspace.test.d.ts +0 -1
  71. package/dist/components/features/DocumentWorkspace.test.js +0 -1439
  72. package/dist/components/features/TaskSettings.test.d.ts +0 -1
  73. package/dist/components/features/TaskSettings.test.js +0 -1674
  74. package/dist/components/features/settings/TaxonomyLibraryManager.test.d.ts +0 -1
  75. package/dist/components/features/settings/TaxonomyLibraryManager.test.js +0 -141
  76. package/dist/components/task/TaskActionHeader.test.d.ts +0 -1
  77. package/dist/components/task/TaskActionHeader.test.js +0 -91
  78. package/dist/components/task/TaskCard.test.d.ts +0 -1
  79. package/dist/components/task/TaskCard.test.js +0 -513
  80. package/dist/components/task/TaskContextUpload.test.d.ts +0 -1
  81. package/dist/components/task/TaskContextUpload.test.js +0 -506
  82. package/dist/components/task/TaskForm.test.d.ts +0 -1
  83. package/dist/components/task/TaskForm.test.js +0 -946
  84. package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +0 -1
  85. package/dist/components/task/TaskKanban.empty-column-drop.test.js +0 -66
  86. package/dist/components/task/TaskKanban.planning-drop.test.d.ts +0 -1
  87. package/dist/components/task/TaskKanban.planning-drop.test.js +0 -93
  88. package/dist/components/task/TaskKanban.test.d.ts +0 -1
  89. package/dist/components/task/TaskKanban.test.js +0 -99
  90. package/dist/components/task/TaskList.test.d.ts +0 -1
  91. package/dist/components/task/TaskList.test.js +0 -473
  92. package/dist/components/task/TaskStatusActions.test.d.ts +0 -1
  93. package/dist/components/task/TaskStatusActions.test.js +0 -54
  94. package/dist/components/task/taskKanbanDropRules.test.d.ts +0 -1
  95. package/dist/components/task/taskKanbanDropRules.test.js +0 -114
  96. package/dist/components/ui/LevelSelector.test.d.ts +0 -1
  97. package/dist/components/ui/LevelSelector.test.js +0 -55
  98. package/dist/components/ui/Markdown.test.d.ts +0 -1
  99. package/dist/components/ui/Markdown.test.js +0 -38
  100. package/dist/components/ui/MultiSelectFilter.test.d.ts +0 -1
  101. package/dist/components/ui/MultiSelectFilter.test.js +0 -74
  102. package/dist/components/ui/TaxonomyDropdown.test.d.ts +0 -1
  103. package/dist/components/ui/TaxonomyDropdown.test.js +0 -130
  104. package/dist/components/ui/TopNoticeLayer.test.d.ts +0 -1
  105. package/dist/components/ui/TopNoticeLayer.test.js +0 -25
  106. package/dist/components/views/AppShellHeader.test.d.ts +0 -1
  107. package/dist/components/views/AppShellHeader.test.js +0 -42
  108. package/dist/components/views/PlanComparisonPage.test.d.ts +0 -1
  109. package/dist/components/views/PlanComparisonPage.test.js +0 -757
  110. package/dist/components/views/PlansPage.test.d.ts +0 -1
  111. package/dist/components/views/PlansPage.test.js +0 -710
  112. package/dist/components/views/chrome/WorkspaceChromeSections.test.d.ts +0 -1
  113. package/dist/components/views/chrome/WorkspaceChromeSections.test.js +0 -54
  114. package/dist/components/views/chrome/workspaceChrome.test.d.ts +0 -1
  115. package/dist/components/views/chrome/workspaceChrome.test.js +0 -52
  116. package/dist/components/views/panels/DocumentFilterToolbar.test.d.ts +0 -1
  117. package/dist/components/views/panels/DocumentFilterToolbar.test.js +0 -19
  118. package/dist/components/views/panels/FilterToolbar.test.d.ts +0 -1
  119. package/dist/components/views/panels/FilterToolbar.test.js +0 -47
  120. package/dist/components/views/panels/PlanningDrawer.test.d.ts +0 -1
  121. package/dist/components/views/panels/PlanningDrawer.test.js +0 -529
  122. package/dist/components/views/planningScope.test.d.ts +0 -1
  123. package/dist/components/views/planningScope.test.js +0 -60
  124. package/dist/components/views/standalone/modals/AccountHubModal.test.d.ts +0 -1
  125. package/dist/components/views/standalone/modals/AccountHubModal.test.js +0 -66
  126. package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +0 -1
  127. package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +0 -24
  128. package/dist/components/views/teamManagementAccess.test.d.ts +0 -1
  129. package/dist/components/views/teamManagementAccess.test.js +0 -44
  130. package/dist/config/deployment.test.d.ts +0 -1
  131. package/dist/config/deployment.test.js +0 -90
  132. package/dist/config/envSchema.test.d.ts +0 -1
  133. package/dist/config/envSchema.test.js +0 -125
  134. package/dist/core/AiProfileService.test.d.ts +0 -1
  135. package/dist/core/AiProfileService.test.js +0 -184
  136. package/dist/core/AiProfiles.test.d.ts +0 -1
  137. package/dist/core/AiProfiles.test.js +0 -1873
  138. package/dist/core/AuthTokenService.test.d.ts +0 -1
  139. package/dist/core/AuthTokenService.test.js +0 -78
  140. package/dist/core/BulkUpdateFieldsPreview.test.d.ts +0 -1
  141. package/dist/core/BulkUpdateFieldsPreview.test.js +0 -62
  142. package/dist/core/CompletedAt.test.d.ts +0 -1
  143. package/dist/core/CompletedAt.test.js +0 -44
  144. package/dist/core/CreatedBy.test.d.ts +0 -1
  145. package/dist/core/CreatedBy.test.js +0 -188
  146. package/dist/core/DeletedTaskTrash.test.d.ts +0 -1
  147. package/dist/core/DeletedTaskTrash.test.js +0 -104
  148. package/dist/core/EntitlementsPolicy.test.d.ts +0 -1
  149. package/dist/core/EntitlementsPolicy.test.js +0 -280
  150. package/dist/core/GlobalSettingsService.test.d.ts +0 -1
  151. package/dist/core/GlobalSettingsService.test.js +0 -45
  152. package/dist/core/JsonBackupRuntime.test.d.ts +0 -1
  153. package/dist/core/JsonBackupRuntime.test.js +0 -155
  154. package/dist/core/PlanFeatureCatalog.test.d.ts +0 -1
  155. package/dist/core/PlanFeatureCatalog.test.js +0 -139
  156. package/dist/core/PlanVersionPolicy.test.d.ts +0 -1
  157. package/dist/core/PlanVersionPolicy.test.js +0 -204
  158. package/dist/core/PlanningEntities.test.d.ts +0 -1
  159. package/dist/core/PlanningEntities.test.js +0 -509
  160. package/dist/core/ScheduleFields.test.d.ts +0 -1
  161. package/dist/core/ScheduleFields.test.js +0 -193
  162. package/dist/core/SetupState.test.d.ts +0 -1
  163. package/dist/core/SetupState.test.js +0 -113
  164. package/dist/core/SignupMonetizationSettings.test.d.ts +0 -1
  165. package/dist/core/SignupMonetizationSettings.test.js +0 -515
  166. package/dist/core/Stats.test.d.ts +0 -1
  167. package/dist/core/Stats.test.js +0 -36
  168. package/dist/core/SystemAdmin.test.d.ts +0 -1
  169. package/dist/core/SystemAdmin.test.js +0 -1106
  170. package/dist/core/TaskActivitySync.test.d.ts +0 -1
  171. package/dist/core/TaskActivitySync.test.js +0 -90
  172. package/dist/core/TaskAttachmentsCanonical.test.d.ts +0 -1
  173. package/dist/core/TaskAttachmentsCanonical.test.js +0 -356
  174. package/dist/core/TaskAuditTimeline.test.d.ts +0 -1
  175. package/dist/core/TaskAuditTimeline.test.js +0 -319
  176. package/dist/core/TaskTaxonomyValidation.test.d.ts +0 -1
  177. package/dist/core/TaskTaxonomyValidation.test.js +0 -440
  178. package/dist/core/Taskforce.ids.test.d.ts +0 -1
  179. package/dist/core/Taskforce.ids.test.js +0 -611
  180. package/dist/core/Taskforce.listTasksSlim.test.d.ts +0 -1
  181. package/dist/core/Taskforce.listTasksSlim.test.js +0 -91
  182. package/dist/core/Taskforce.mcpAuth.test.d.ts +0 -1
  183. package/dist/core/Taskforce.mcpAuth.test.js +0 -450
  184. package/dist/core/Taskforce.realtimeMutation.test.d.ts +0 -1
  185. package/dist/core/Taskforce.realtimeMutation.test.js +0 -131
  186. package/dist/core/UserProfileAvatarDrafts.test.d.ts +0 -1
  187. package/dist/core/UserProfileAvatarDrafts.test.js +0 -138
  188. package/dist/core/WorkspaceDelete.test.d.ts +0 -1
  189. package/dist/core/WorkspaceDelete.test.js +0 -159
  190. package/dist/core/WorkspacePermissions.test.d.ts +0 -1
  191. package/dist/core/WorkspacePermissions.test.js +0 -270
  192. package/dist/core/WorkspacePlanMode.test.d.ts +0 -1
  193. package/dist/core/WorkspacePlanMode.test.js +0 -383
  194. package/dist/core/WorkspaceSyncSettings.test.d.ts +0 -1
  195. package/dist/core/WorkspaceSyncSettings.test.js +0 -65
  196. package/dist/core/__tests__/TaskAttachmentsCanonical.test.d.ts +0 -1
  197. package/dist/core/__tests__/TaskAttachmentsCanonical.test.js +0 -212
  198. package/dist/documentReviews/DocumentReviewSessionStore.test.d.ts +0 -1
  199. package/dist/documentReviews/DocumentReviewSessionStore.test.js +0 -127
  200. package/dist/hooks/authGuardPolicy.test.d.ts +0 -1
  201. package/dist/hooks/authGuardPolicy.test.js +0 -76
  202. package/dist/hooks/bootstrapTimeouts.test.d.ts +0 -1
  203. package/dist/hooks/bootstrapTimeouts.test.js +0 -12
  204. package/dist/hooks/sync/controlPlane.test.d.ts +0 -1
  205. package/dist/hooks/sync/controlPlane.test.js +0 -121
  206. package/dist/hooks/sync/lifecyclePolicy.test.d.ts +0 -1
  207. package/dist/hooks/sync/lifecyclePolicy.test.js +0 -124
  208. package/dist/hooks/sync/orchestratorShared.test.d.ts +0 -1
  209. package/dist/hooks/sync/orchestratorShared.test.js +0 -98
  210. package/dist/hooks/sync/pullLifecycle.test.d.ts +0 -1
  211. package/dist/hooks/sync/pullLifecycle.test.js +0 -80
  212. package/dist/hooks/sync/recovery.test.d.ts +0 -1
  213. package/dist/hooks/sync/recovery.test.js +0 -292
  214. package/dist/hooks/sync/transfers.test.d.ts +0 -1
  215. package/dist/hooks/sync/transfers.test.js +0 -928
  216. package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +0 -1
  217. package/dist/hooks/sync/useRecentSyncEvents.test.js +0 -124
  218. package/dist/hooks/sync/useSyncStatusActions.test.d.ts +0 -1
  219. package/dist/hooks/sync/useSyncStatusActions.test.js +0 -133
  220. package/dist/hooks/sync/useSyncStatusControls.test.d.ts +0 -1
  221. package/dist/hooks/sync/useSyncStatusControls.test.js +0 -88
  222. package/dist/hooks/useFilterSort.test.d.ts +0 -1
  223. package/dist/hooks/useFilterSort.test.js +0 -419
  224. package/dist/hooks/useRealtimeSync.test.d.ts +0 -1
  225. package/dist/hooks/useRealtimeSync.test.js +0 -311
  226. package/dist/hooks/useSyncOrchestrator.aiProfiles.test.d.ts +0 -1
  227. package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +0 -54
  228. package/dist/hooks/useSyncOrchestrator.context-assets.test.d.ts +0 -1
  229. package/dist/hooks/useSyncOrchestrator.context-assets.test.js +0 -228
  230. package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +0 -1
  231. package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +0 -2027
  232. package/dist/hooks/useTaskData.test.d.ts +0 -1
  233. package/dist/hooks/useTaskData.test.js +0 -291
  234. package/dist/hooks/useTaskMutations.test.d.ts +0 -1
  235. package/dist/hooks/useTaskMutations.test.js +0 -256
  236. package/dist/hooks/useTaskforce.contract.test.d.ts +0 -1
  237. package/dist/hooks/useTaskforce.contract.test.js +0 -7
  238. package/dist/hooks/useTaskforce.priority-filters.test.d.ts +0 -1
  239. package/dist/hooks/useTaskforce.priority-filters.test.js +0 -28
  240. package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +0 -1
  241. package/dist/hooks/useTaskforce.runtime-routing.test.js +0 -246
  242. package/dist/hooks/useTaskforce.sync-behavior.test.d.ts +0 -1
  243. package/dist/hooks/useTaskforce.sync-behavior.test.js +0 -3644
  244. package/dist/hooks/useWorkspaceSyncController.test.d.ts +0 -1
  245. package/dist/hooks/useWorkspaceSyncController.test.js +0 -192
  246. package/dist/hooks/workspace/useTaskforceApiRouting.test.d.ts +0 -1
  247. package/dist/hooks/workspace/useTaskforceApiRouting.test.js +0 -77
  248. package/dist/hooks/workspace/workspaceLocalState.test.d.ts +0 -1
  249. package/dist/hooks/workspace/workspaceLocalState.test.js +0 -59
  250. package/dist/localization/localizationCatalogs.test.d.ts +0 -1
  251. package/dist/localization/localizationCatalogs.test.js +0 -37
  252. package/dist/mcp/aiProfileBootstrap.test.d.ts +0 -1
  253. package/dist/mcp/aiProfileBootstrap.test.js +0 -68
  254. package/dist/mcp/canonicalAssetHelpers.test.d.ts +0 -1
  255. package/dist/mcp/canonicalAssetHelpers.test.js +0 -67
  256. package/dist/mcp/clientIntegrations.test.d.ts +0 -1
  257. package/dist/mcp/clientIntegrations.test.js +0 -219
  258. package/dist/mcp/optionResolution.test.d.ts +0 -1
  259. package/dist/mcp/optionResolution.test.js +0 -43
  260. package/dist/mcp/runtime.test.d.ts +0 -1
  261. package/dist/mcp/runtime.test.js +0 -5120
  262. package/dist/mcp/structuredCommentValidation.test.d.ts +0 -1
  263. package/dist/mcp/structuredCommentValidation.test.js +0 -31
  264. package/dist/mcp/structuredDocValidation.test.d.ts +0 -1
  265. package/dist/mcp/structuredDocValidation.test.js +0 -35
  266. package/dist/mcp/toolRegistry.test.d.ts +0 -1
  267. package/dist/mcp/toolRegistry.test.js +0 -34
  268. package/dist/migrations/billingSchemaParity.test.d.ts +0 -1
  269. package/dist/migrations/billingSchemaParity.test.js +0 -160
  270. package/dist/migrations/taskSchemaMigrations.test.d.ts +0 -1
  271. package/dist/migrations/taskSchemaMigrations.test.js +0 -225
  272. package/dist/qaOpen.test.d.ts +0 -1
  273. package/dist/qaOpen.test.js +0 -56
  274. package/dist/releaseVersion.test.d.ts +0 -1
  275. package/dist/releaseVersion.test.js +0 -32
  276. package/dist/runtime/appGates.test.d.ts +0 -1
  277. package/dist/runtime/appGates.test.js +0 -42
  278. package/dist/server/aiProfileAvatarAssets.test.d.ts +0 -1
  279. package/dist/server/aiProfileAvatarAssets.test.js +0 -213
  280. package/dist/server/annotatedAttachmentsRoutes.test.d.ts +0 -1
  281. package/dist/server/annotatedAttachmentsRoutes.test.js +0 -532
  282. package/dist/server/auth.test.d.ts +0 -1
  283. package/dist/server/auth.test.js +0 -131
  284. package/dist/server/buildInfo.test.d.ts +0 -1
  285. package/dist/server/buildInfo.test.js +0 -29
  286. package/dist/server/cors.test.d.ts +0 -1
  287. package/dist/server/cors.test.js +0 -77
  288. package/dist/server/documentReviewRoutes.test.d.ts +0 -1
  289. package/dist/server/documentReviewRoutes.test.js +0 -190
  290. package/dist/server/email.test.d.ts +0 -1
  291. package/dist/server/email.test.js +0 -113
  292. package/dist/server/index.cookieProxy.test.d.ts +0 -1
  293. package/dist/server/index.cookieProxy.test.js +0 -67
  294. package/dist/server/index.rateLimit.test.d.ts +0 -1
  295. package/dist/server/index.rateLimit.test.js +0 -22
  296. package/dist/server/index.test.d.ts +0 -1
  297. package/dist/server/index.test.js +0 -283
  298. package/dist/server/rateLimit.test.d.ts +0 -1
  299. package/dist/server/rateLimit.test.js +0 -107
  300. package/dist/server/realtimeSync.auth.test.d.ts +0 -1
  301. package/dist/server/realtimeSync.auth.test.js +0 -62
  302. package/dist/server/realtimeSync.replay.test.d.ts +0 -1
  303. package/dist/server/realtimeSync.replay.test.js +0 -192
  304. package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +0 -1
  305. package/dist/server/realtimeSync.workspaceIsolation.test.js +0 -101
  306. package/dist/server/routes/billing.test.d.ts +0 -1
  307. package/dist/server/routes/billing.test.js +0 -3455
  308. package/dist/server/routes/shared.test.d.ts +0 -1
  309. package/dist/server/routes/shared.test.js +0 -32
  310. package/dist/server/routes/sync.integration.test.d.ts +0 -1
  311. package/dist/server/routes/sync.integration.test.js +0 -2932
  312. package/dist/server/routes/syncAuxRoutes.test.d.ts +0 -1
  313. package/dist/server/routes/syncAuxRoutes.test.js +0 -158
  314. package/dist/server/routes/syncRouteGuards.test.d.ts +0 -1
  315. package/dist/server/routes/syncRouteGuards.test.js +0 -94
  316. package/dist/server/routes.test.d.ts +0 -1
  317. package/dist/server/routes.test.js +0 -15612
  318. package/dist/server/runtimeMode.test.d.ts +0 -1
  319. package/dist/server/runtimeMode.test.js +0 -26
  320. package/dist/server/securityHeaders.test.d.ts +0 -1
  321. package/dist/server/securityHeaders.test.js +0 -70
  322. package/dist/services/templateEngine.test.d.ts +0 -1
  323. package/dist/services/templateEngine.test.js +0 -150
  324. package/dist/services/templates.test.d.ts +0 -1
  325. package/dist/services/templates.test.js +0 -45
  326. package/dist/services/workflowDocumentFixtures.test.d.ts +0 -1
  327. package/dist/services/workflowDocumentFixtures.test.js +0 -78
  328. package/dist/services/workflowExportMatrix.test.d.ts +0 -1
  329. package/dist/services/workflowExportMatrix.test.js +0 -113
  330. package/dist/services/workflowExportSnapshots.test.d.ts +0 -1
  331. package/dist/services/workflowExportSnapshots.test.js +0 -30
  332. package/dist/services/workflowGeneration.test.d.ts +0 -1
  333. package/dist/services/workflowGeneration.test.js +0 -12
  334. package/dist/services/workflowSimulation.test.d.ts +0 -1
  335. package/dist/services/workflowSimulation.test.js +0 -113
  336. package/dist/services/workflowV2Policy.test.d.ts +0 -1
  337. package/dist/services/workflowV2Policy.test.js +0 -80
  338. package/dist/shared/customTaxonomyLibrary.test.d.ts +0 -1
  339. package/dist/shared/customTaxonomyLibrary.test.js +0 -20
  340. package/dist/shared/passwordPolicy.test.d.ts +0 -1
  341. package/dist/shared/passwordPolicy.test.js +0 -34
  342. package/dist/shared/runtimeContract.test.d.ts +0 -1
  343. package/dist/shared/runtimeContract.test.js +0 -23
  344. package/dist/shared/taxonomyLibrary.test.d.ts +0 -1
  345. package/dist/shared/taxonomyLibrary.test.js +0 -26
  346. package/dist/shared/taxonomyState.test.d.ts +0 -1
  347. package/dist/shared/taxonomyState.test.js +0 -71
  348. package/dist/soak/preflight.cli.d.ts +0 -1
  349. package/dist/soak/preflight.cli.js +0 -28
  350. package/dist/soak/preflight.d.ts +0 -26
  351. package/dist/soak/preflight.js +0 -113
  352. package/dist/soak/preflight.test.d.ts +0 -1
  353. package/dist/soak/preflight.test.js +0 -39
  354. package/dist/storage/objectStorageClient.test.d.ts +0 -1
  355. package/dist/storage/objectStorageClient.test.js +0 -82
  356. package/dist/storage/objectStorageConfig.test.d.ts +0 -1
  357. package/dist/storage/objectStorageConfig.test.js +0 -50
  358. package/dist/storage/postgresAdapter.test.d.ts +0 -1
  359. package/dist/storage/postgresAdapter.test.js +0 -29
  360. package/dist/storage/workspaceAssetStore.test.d.ts +0 -1
  361. package/dist/storage/workspaceAssetStore.test.js +0 -588
  362. package/dist/sync/cloudSyncApi.test.d.ts +0 -1
  363. package/dist/sync/cloudSyncApi.test.js +0 -111
  364. package/dist/sync/collaborationSyncPayload.test.d.ts +0 -1
  365. package/dist/sync/collaborationSyncPayload.test.js +0 -125
  366. package/dist/sync/contentSyncPayload.test.d.ts +0 -1
  367. package/dist/sync/contentSyncPayload.test.js +0 -143
  368. package/dist/sync/encryptionService.test.d.ts +0 -1
  369. package/dist/sync/encryptionService.test.js +0 -52
  370. package/dist/sync/planningSyncPayload.test.d.ts +0 -1
  371. package/dist/sync/planningSyncPayload.test.js +0 -92
  372. package/dist/sync/realtimeFeature.test.d.ts +0 -1
  373. package/dist/sync/realtimeFeature.test.js +0 -30
  374. package/dist/sync/realtimeReconcile.test.d.ts +0 -1
  375. package/dist/sync/realtimeReconcile.test.js +0 -43
  376. package/dist/sync/syncApplyHandlers.test.d.ts +0 -1
  377. package/dist/sync/syncApplyHandlers.test.js +0 -626
  378. package/dist/sync/syncService.test.d.ts +0 -1
  379. package/dist/sync/syncService.test.js +0 -903
  380. package/dist/sync/taskSyncPayload.test.d.ts +0 -1
  381. package/dist/sync/taskSyncPayload.test.js +0 -54
  382. package/dist/sync/workspacePullFeed.test.d.ts +0 -1
  383. package/dist/sync/workspacePullFeed.test.js +0 -438
  384. package/dist/sync/workspaceSyncModel.test.d.ts +0 -1
  385. package/dist/sync/workspaceSyncModel.test.js +0 -1442
  386. package/dist/test/setup.d.ts +0 -1
  387. package/dist/test/setup.js +0 -15
  388. package/dist/ui/assets/AgentsModule-BS4Pi_nC.js +0 -1
  389. package/dist/ui/assets/ContextAttachmentManager-CfG_ER7C.js +0 -3
  390. package/dist/ui/assets/PlansPage-B_z-D6Nh.css +0 -1
  391. package/dist/ui/assets/PlansPage-Ndt7mYfo.js +0 -1
  392. package/dist/ui/assets/documentReferences-BOUcJm6-.js +0 -1
  393. package/dist/ui/assets/index-MAHKvFqp.js +0 -4
  394. package/dist/utils/accountProfileSummaryCache.test.d.ts +0 -1
  395. package/dist/utils/accountProfileSummaryCache.test.js +0 -63
  396. package/dist/utils/annotatedAttachments.test.d.ts +0 -1
  397. package/dist/utils/annotatedAttachments.test.js +0 -108
  398. package/dist/utils/assignees.test.d.ts +0 -1
  399. package/dist/utils/assignees.test.js +0 -25
  400. package/dist/utils/avatarUpload.test.d.ts +0 -1
  401. package/dist/utils/avatarUpload.test.js +0 -40
  402. package/dist/utils/canonicalAssetKind.test.d.ts +0 -1
  403. package/dist/utils/canonicalAssetKind.test.js +0 -24
  404. package/dist/utils/coalescedRefresh.test.d.ts +0 -1
  405. package/dist/utils/coalescedRefresh.test.js +0 -30
  406. package/dist/utils/constants.icons.test.d.ts +0 -1
  407. package/dist/utils/constants.icons.test.js +0 -41
  408. package/dist/utils/planParser.test.d.ts +0 -1
  409. package/dist/utils/planParser.test.js +0 -183
  410. package/dist/utils/planningReferences.test.d.ts +0 -1
  411. package/dist/utils/planningReferences.test.js +0 -17
  412. package/dist/utils/syncEventDetails.test.d.ts +0 -1
  413. package/dist/utils/syncEventDetails.test.js +0 -23
  414. package/dist/utils/syncEventPresentation.test.d.ts +0 -1
  415. package/dist/utils/syncEventPresentation.test.js +0 -64
  416. package/dist/utils/syncStatusPresentation.test.d.ts +0 -1
  417. package/dist/utils/syncStatusPresentation.test.js +0 -164
  418. package/dist/utils/taskActivity.test.d.ts +0 -1
  419. package/dist/utils/taskActivity.test.js +0 -218
  420. package/dist/utils/taskDraftDefaults.test.d.ts +0 -1
  421. package/dist/utils/taskDraftDefaults.test.js +0 -34
  422. package/dist/utils/taskDragZones.test.d.ts +0 -1
  423. package/dist/utils/taskDragZones.test.js +0 -14
  424. package/dist/utils/taskNormalization.test.d.ts +0 -1
  425. package/dist/utils/taskNormalization.test.js +0 -158
  426. package/dist/utils/taskSearch.test.d.ts +0 -1
  427. package/dist/utils/taskSearch.test.js +0 -69
  428. package/dist/utils/taskUtils.test.d.ts +0 -1
  429. package/dist/utils/taskUtils.test.js +0 -19
  430. package/dist/utils/taskforceApiClient.test.d.ts +0 -1
  431. package/dist/utils/taskforceApiClient.test.js +0 -44
  432. package/dist/utils/taxonomyFormDefaults.test.d.ts +0 -1
  433. package/dist/utils/taxonomyFormDefaults.test.js +0 -63
  434. package/dist/utils/uiNotice.test.d.ts +0 -1
  435. package/dist/utils/uiNotice.test.js +0 -18
  436. package/dist/utils/workspaceIdentity.test.d.ts +0 -1
  437. package/dist/utils/workspaceIdentity.test.js +0 -61
  438. package/dist/utils/workspaceLifecycle.test.d.ts +0 -1
  439. package/dist/utils/workspaceLifecycle.test.js +0 -64
  440. package/dist/utils/workspaceSyncPresentation.test.d.ts +0 -1
  441. package/dist/utils/workspaceSyncPresentation.test.js +0 -71
  442. package/scripts/bootstrap-playwright-auth.mjs +0 -155
  443. package/scripts/check-cloud-mcp.mjs +0 -83
  444. package/scripts/check-compat-boundaries.mjs +0 -41
  445. package/scripts/check-env.ts +0 -31
  446. package/scripts/check-localization-strings.mjs +0 -49
  447. package/scripts/check-runtime-boundaries.mjs +0 -44
  448. package/scripts/debug-global.mjs +0 -34
  449. package/scripts/debug-login.mjs +0 -32
  450. package/scripts/debug-server.mjs +0 -36
  451. package/scripts/deploy-prod.sh +0 -41
  452. package/scripts/deploy-staging.sh +0 -23
  453. package/scripts/export-sqlite-to-postgres.mjs +0 -123
  454. package/scripts/generate-env-example.ts +0 -8
  455. package/scripts/mcp-stdio-adapter.mjs +0 -160
  456. package/scripts/migrate-task-data-assets.mjs +0 -408
  457. package/scripts/playwright-auth.sh +0 -19
  458. package/scripts/qa-open-lib.mjs +0 -175
  459. package/scripts/qa-open-lib.mjs.d.ts +0 -49
  460. package/scripts/qa-open.mjs +0 -352
  461. package/scripts/release-version-lib.mjs +0 -88
  462. package/scripts/release-version.mjs +0 -72
  463. package/scripts/run-billing-performance-smoke.sh +0 -24
  464. package/scripts/run-dev-proxy.sh +0 -51
  465. package/scripts/run-e2e-realtime.sh +0 -30
  466. package/scripts/run-smoke.sh +0 -35
  467. package/scripts/run-soak.sh +0 -41
  468. package/scripts/test-global.js +0 -143
  469. package/scripts/update-homebrew-formula.sh +0 -108
  470. package/scripts/with-esbuild.sh +0 -11
@@ -1,138 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import fs from 'fs';
3
- import os from 'os';
4
- import path from 'path';
5
- import { TaskforceCore } from './Taskforce';
6
- function makeProjectRoot() {
7
- return fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-user-avatar-'));
8
- }
9
- function seedPlans(core) {
10
- core.upsertPlanCatalog({ planId: 'starter', displayName: 'Starter', status: 'active' });
11
- core.updatePlanVersion({
12
- planId: 'starter',
13
- versionNumber: 1,
14
- seatLimit: 1
15
- });
16
- const db = core.db;
17
- const now = new Date().toISOString();
18
- db.prepare(`
19
- INSERT OR IGNORE INTO billing_price_mappings (
20
- tenant_id, plan_version_id, billing_interval, stripe_price_id, pricing_type, active, unit_amount, currency, created_at, updated_at
21
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
22
- `).run(core.getTenantId(), 'starter-v1', 'month', 'free:starter-v1:month', 'free', 1, 0, null, now, now);
23
- core.updateGlobalSettings({
24
- billing: {
25
- onboardingPolicy: {
26
- mode: 'auto_grant_free',
27
- planId: 'starter'
28
- }
29
- }
30
- });
31
- }
32
- function openCore(projectRoot) {
33
- const core = new TaskforceCore({
34
- projectRoot,
35
- storagePath: path.join(projectRoot, '.taskforce')
36
- });
37
- seedPlans(core);
38
- return core;
39
- }
40
- describe('TaskforceCore user profile avatar drafts', () => {
41
- it('persists avatarUrl on profile updates and exposes it in resolved identity', () => {
42
- const projectRoot = makeProjectRoot();
43
- const core = openCore(projectRoot);
44
- try {
45
- const created = core.registerPasswordUser({
46
- email: 'avatar-user@example.com',
47
- password: 'ValidPassphrase123!'
48
- });
49
- const updated = core.updateUserProfile(created.userId, {
50
- displayName: 'Avatar User',
51
- avatarUrl: `/api/taskforce/context/${encodeURIComponent(`users/${created.userId}/profile/avatar/headshot.png`)}`
52
- });
53
- expect(updated).toMatchObject({
54
- userId: created.userId,
55
- displayName: 'Avatar User',
56
- avatarUrl: `/api/taskforce/context/${encodeURIComponent(`users/${created.userId}/profile/avatar/headshot.png`)}`
57
- });
58
- expect(core.resolveUserIdentity(created.userId)?.avatarUrl).toBe(`/api/taskforce/context/${encodeURIComponent(`users/${created.userId}/profile/avatar/headshot.png`)}`);
59
- }
60
- finally {
61
- core.close();
62
- fs.rmSync(projectRoot, { recursive: true, force: true });
63
- }
64
- });
65
- it('exposes cloud-owned user avatarUrl on live workspace member records', () => {
66
- const projectRoot = makeProjectRoot();
67
- const core = openCore(projectRoot);
68
- try {
69
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
70
- const created = core.registerPasswordUser({
71
- email: 'member-avatar@example.com',
72
- password: 'ValidPassphrase123!',
73
- workspaceId: 'workspace-1'
74
- });
75
- const avatarUrl = `/api/taskforce/context/${encodeURIComponent(`users/${created.userId}/profile/avatar/headshot.webp`)}`;
76
- core.updateUserProfile(created.userId, {
77
- displayName: 'Member Avatar',
78
- avatarUrl
79
- });
80
- const members = core.listWorkspaceUsers('workspace-1');
81
- expect(members.find((member) => member.userId === created.userId)).toEqual(expect.objectContaining({
82
- userId: created.userId,
83
- displayName: 'Member Avatar',
84
- avatarUrl
85
- }));
86
- }
87
- finally {
88
- core.close();
89
- fs.rmSync(projectRoot, { recursive: true, force: true });
90
- }
91
- });
92
- it('tracks, finalizes, discards, and cleans up stale avatar upload drafts', () => {
93
- const projectRoot = makeProjectRoot();
94
- const core = openCore(projectRoot);
95
- try {
96
- const created = core.registerPasswordUser({
97
- email: 'draft-user@example.com',
98
- password: 'ValidPassphrase123!'
99
- });
100
- const draft = core.createUserAvatarUploadDraft({
101
- userId: created.userId,
102
- draftId: 'avatar-draft-1',
103
- storageKey: `users/${created.userId}/profile/avatar/avatar-draft-1-headshot.png`,
104
- mimeType: 'image/png',
105
- originalFilename: 'headshot.png',
106
- sizeBytes: 1024,
107
- storageProvider: 'r2'
108
- });
109
- expect(draft.finalizedAt).toBeNull();
110
- expect(core.markUserAvatarUploadDraftFinalized(created.userId, draft.draftId)?.finalizedAt).toEqual(expect.any(String));
111
- expect(core.markUserAvatarUploadDraftConsumed(created.userId, draft.draftId)?.consumedAt).toEqual(expect.any(String));
112
- expect(core.discardUserAvatarUploadDraft(created.userId, draft.draftId)?.discardedAt).toEqual(expect.any(String));
113
- core.createUserAvatarUploadDraft({
114
- userId: created.userId,
115
- draftId: 'avatar-draft-stale',
116
- storageKey: `users/${created.userId}/profile/avatar/avatar-draft-stale-headshot.png`,
117
- mimeType: 'image/png',
118
- originalFilename: 'stale.png',
119
- sizeBytes: 512,
120
- storageProvider: 'r2'
121
- });
122
- const db = core.db;
123
- db.prepare(`
124
- UPDATE user_avatar_upload_drafts
125
- SET created_at = ?, updated_at = ?
126
- WHERE tenant_id = ? AND user_id = ? AND draft_id = ?
127
- `).run('2026-01-01T00:00:00.000Z', '2026-01-01T00:00:00.000Z', core.getTenantId(), created.userId, 'avatar-draft-stale');
128
- const stale = core.cleanupStaleUserAvatarUploadDrafts(created.userId, '2026-02-01T00:00:00.000Z');
129
- expect(stale).toHaveLength(1);
130
- expect(stale[0]?.draftId).toBe('avatar-draft-stale');
131
- expect(core.getUserAvatarUploadDraft(created.userId, 'avatar-draft-stale')?.discardedAt).toEqual(expect.any(String));
132
- }
133
- finally {
134
- core.close();
135
- fs.rmSync(projectRoot, { recursive: true, force: true });
136
- }
137
- });
138
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,159 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import fs from 'fs';
3
- import os from 'os';
4
- import path from 'path';
5
- import { TaskforceCore } from './Taskforce';
6
- function makeCore() {
7
- const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-workspace-delete-'));
8
- const core = new TaskforceCore({
9
- projectRoot,
10
- storagePath: path.join(projectRoot, '.taskforce')
11
- });
12
- const db = core.getDatabaseAdapter();
13
- const now = new Date().toISOString();
14
- const addFreeMapping = (planVersionId) => {
15
- db.prepare(`
16
- INSERT OR IGNORE INTO billing_price_mappings (
17
- tenant_id, plan_version_id, billing_interval, stripe_price_id, pricing_type, active, unit_amount, currency, created_at, updated_at
18
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
19
- `).run('default', planVersionId, 'month', `free:${planVersionId}:month`, 'free', 1, 0, null, now, now);
20
- };
21
- core.upsertPlanCatalog({ planId: 'starter', displayName: 'Starter' });
22
- addFreeMapping('starter-v1');
23
- core.upsertPlanCatalog({ planId: 'starter', displayName: 'Starter', status: 'active' });
24
- core.upsertPlanCatalog({ planId: 'collab', displayName: 'Collab' });
25
- addFreeMapping('collab-v1');
26
- core.upsertPlanCatalog({ planId: 'collab', displayName: 'Collab', status: 'active' });
27
- core.updatePlanVersion({
28
- planId: 'collab',
29
- versionNumber: 1,
30
- seatLimit: 5
31
- });
32
- core.updatePlanVersionFeatures({
33
- planVersionId: 'collab-v1',
34
- features: [
35
- { featureKey: 'collaboration.team_management', access: 'enabled' }
36
- ]
37
- });
38
- return {
39
- core,
40
- cleanup: () => {
41
- core.close();
42
- fs.rmSync(projectRoot, { recursive: true, force: true });
43
- }
44
- };
45
- }
46
- function countByWorkspace(core, table, workspaceId) {
47
- const row = core.getDatabaseAdapter().prepare(`
48
- SELECT COUNT(*) AS count
49
- FROM ${table}
50
- WHERE tenant_id = ? AND workspace_id = ?
51
- `).get(core.getTenantId(), workspaceId);
52
- return Number(row?.count || 0);
53
- }
54
- describe('TaskforceCore deleteWorkspace', () => {
55
- it('cascades deletion for workspace-scoped rows and preserves other workspaces', () => {
56
- const { core, cleanup } = makeCore();
57
- try {
58
- const tenantId = core.getTenantId();
59
- const wsDelete = 'workspace-delete';
60
- const wsKeep = 'workspace-keep';
61
- const now = '2026-03-03T10:00:00.000Z';
62
- core.createWorkspace({ workspaceId: wsDelete, name: 'Workspace Delete' });
63
- core.createWorkspace({ workspaceId: wsKeep, name: 'Workspace Keep' });
64
- core.ensureBootstrapUserAccess({ userId: 'owner-del', workspaceId: wsDelete, role: 'owner', email: 'del@example.com' });
65
- core.ensureBootstrapUserAccess({ userId: 'owner-keep', workspaceId: wsKeep, role: 'owner', email: 'keep@example.com' });
66
- const workstream = core.createWorkstream({ title: 'Delete Workstream' }, wsDelete);
67
- const parent = core.createTask({ title: 'Parent Delete', workstreamId: workstream.id }, { workspaceId: wsDelete });
68
- const child = core.createTask({ title: 'Child Delete', workstreamId: workstream.id }, { workspaceId: wsDelete });
69
- const sibling = core.createTask({ title: 'Sibling Delete' }, { workspaceId: wsDelete });
70
- const keepTask = core.createTask({ title: 'Keep Task' }, { workspaceId: wsKeep });
71
- core.addComment(parent.id, 'comment delete', 'owner-del', wsDelete);
72
- core.getDatabaseAdapter().prepare(`
73
- INSERT INTO auth_tokens (id, tenant_id, user_id, workspace_id, purpose, token_hash, expires_at, used_at, revoked_at, created_at)
74
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
75
- `).run('token-delete', tenantId, 'owner-del', wsDelete, 'password_reset', 'hash-delete', '2099-01-01T00:00:00.000Z', null, null, now);
76
- core.getDatabaseAdapter().prepare(`
77
- INSERT INTO auth_tokens (id, tenant_id, user_id, workspace_id, purpose, token_hash, expires_at, used_at, revoked_at, created_at)
78
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
79
- `).run('token-keep', tenantId, 'owner-keep', wsKeep, 'password_reset', 'hash-keep', '2099-01-01T00:00:00.000Z', null, null, now);
80
- core.updateUiState(wsDelete, 'owner-del', { stateKey: 'workspace-sync', patch: { enabled: true } });
81
- core.updateUiState(wsKeep, 'owner-keep', { stateKey: 'workspace-sync', patch: { enabled: true } });
82
- core.setWorkspacePlanMode(wsDelete, 'team', 'test');
83
- core.setWorkspacePlanMode(wsKeep, 'team', 'test');
84
- core.addAdminAuditLog({ action: 'test-delete', actorUserId: 'owner-del', actorRole: 'owner', workspaceId: wsDelete, details: { phase: 'before' } });
85
- core.addAdminAuditLog({ action: 'test-keep', actorUserId: 'owner-keep', actorRole: 'owner', workspaceId: wsKeep, details: { phase: 'before' } });
86
- core.recordSyncEvent(wsDelete, { eventType: 'pull', status: 'success' });
87
- core.recordSyncEvent(wsKeep, { eventType: 'pull', status: 'success' });
88
- core.writePushIdempotency(wsDelete, 'delete-key', '{}');
89
- core.writePushIdempotency(wsKeep, 'keep-key', '{}');
90
- core.deleteTask(child.id, wsDelete);
91
- core.upsertDocumentWatermark(wsDelete, `docs/workspaces/${wsDelete}/notes.md`, 'hash-delete', now);
92
- core.upsertDocumentWatermark(wsKeep, `docs/workspaces/${wsKeep}/notes.md`, 'hash-keep', now);
93
- core.getDatabaseAdapter().prepare(`
94
- INSERT INTO task_assets (
95
- tenant_id, workspace_id, path, provider, version, content_type, size_bytes, sha256,
96
- uploaded_at, scan_engine, scan_verdict, scan_details, scan_scanned_at, quarantine_status,
97
- deleted_at, purge_after, updated_at
98
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
99
- `).run(tenantId, wsDelete, `workspaces/${wsDelete}/tasks/${parent.id}/attachments/spec.md`, 'local', 1, 'text/markdown', 10, 'sha-delete', now, 'none', 'clean', null, now, 'none', null, null, now);
100
- core.getDatabaseAdapter().prepare(`
101
- INSERT INTO task_assets (
102
- tenant_id, workspace_id, path, provider, version, content_type, size_bytes, sha256,
103
- uploaded_at, scan_engine, scan_verdict, scan_details, scan_scanned_at, quarantine_status,
104
- deleted_at, purge_after, updated_at
105
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
106
- `).run(tenantId, wsKeep, `workspaces/${wsKeep}/tasks/${keepTask.id}/attachments/spec.md`, 'local', 1, 'text/markdown', 10, 'sha-keep', now, 'none', 'clean', null, now, 'none', null, null, now);
107
- const summary = core.deleteWorkspace({ workspaceId: wsDelete });
108
- expect(summary.deletedWorkspaceId).toBe(wsDelete);
109
- expect(summary.deletedTaskIds).toEqual(expect.arrayContaining([parent.id, sibling.id]));
110
- expect(summary.deletedDocumentPaths).toContain(`docs/workspaces/${wsDelete}/notes.md`);
111
- expect(summary.deletedAssets.some((asset) => asset.workspaceId === wsDelete)).toBe(true);
112
- expect(summary.counts.workspaces).toBe(1);
113
- expect(summary.counts.workspace_memberships).toBeGreaterThan(0);
114
- expect(summary.counts.tasks).toBeGreaterThan(0);
115
- const workspaceDeleteExists = core.getDatabaseAdapter().prepare(`
116
- SELECT 1 FROM workspaces WHERE tenant_id = ? AND id = ? LIMIT 1
117
- `).get(tenantId, wsDelete);
118
- const workspaceKeepExists = core.getDatabaseAdapter().prepare(`
119
- SELECT 1 FROM workspaces WHERE tenant_id = ? AND id = ? LIMIT 1
120
- `).get(tenantId, wsKeep);
121
- expect(Boolean(workspaceDeleteExists)).toBe(false);
122
- expect(Boolean(workspaceKeepExists)).toBe(true);
123
- const scopedTables = [
124
- 'tasks',
125
- 'comments',
126
- 'task_events',
127
- 'workspace_memberships',
128
- 'auth_tokens',
129
- 'ui_state',
130
- 'workspace_settings',
131
- 'admin_audit_logs',
132
- 'workspace_sync_deletes',
133
- 'sync_idempotency',
134
- 'sync_events',
135
- 'workspace_documents',
136
- 'task_assets'
137
- ];
138
- for (const table of scopedTables) {
139
- expect(countByWorkspace(core, table, wsDelete)).toBe(0);
140
- }
141
- expect(countByWorkspace(core, 'tasks', wsKeep)).toBeGreaterThan(0);
142
- expect(countByWorkspace(core, 'workspace_memberships', wsKeep)).toBeGreaterThan(0);
143
- expect(countByWorkspace(core, 'workspace_documents', wsKeep)).toBeGreaterThan(0);
144
- expect(countByWorkspace(core, 'task_assets', wsKeep)).toBeGreaterThan(0);
145
- }
146
- finally {
147
- cleanup();
148
- }
149
- });
150
- it('rejects deleting the reserved default workspace', () => {
151
- const { core, cleanup } = makeCore();
152
- try {
153
- expect(() => core.deleteWorkspace({ workspaceId: 'default' })).toThrowError(/reserved/i);
154
- }
155
- finally {
156
- cleanup();
157
- }
158
- });
159
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,270 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import fs from 'fs';
3
- import os from 'os';
4
- import path from 'path';
5
- import { TaskforceCore } from './Taskforce';
6
- function makeCore() {
7
- const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-workspace-perm-'));
8
- const core = new TaskforceCore({
9
- projectRoot,
10
- storagePath: path.join(projectRoot, '.taskforce')
11
- });
12
- return {
13
- core,
14
- cleanup: () => {
15
- core.close();
16
- fs.rmSync(projectRoot, { recursive: true, force: true });
17
- }
18
- };
19
- }
20
- describe('TaskforceCore workspace permission invariants', () => {
21
- it('enforces member read-only via permission_mode in resolveUserAccess', () => {
22
- const { core, cleanup } = makeCore();
23
- try {
24
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
25
- core.ensureBootstrapUserAccess({
26
- userId: 'owner-1',
27
- workspaceId: 'workspace-1',
28
- role: 'owner',
29
- email: 'owner@example.com'
30
- });
31
- core.ensureBootstrapUserAccess({
32
- userId: 'member-1',
33
- workspaceId: 'workspace-1',
34
- role: 'member',
35
- email: 'member@example.com'
36
- });
37
- expect(core.setWorkspaceUserPermissionMode('member-1', 'workspace-1', 'read-only')).toBe(true);
38
- const access = core.resolveUserAccess('member-1', 'workspace-1', 'member');
39
- expect(access?.permissionMode).toBe('read-only');
40
- expect(access?.role).toBe('read-only');
41
- }
42
- finally {
43
- cleanup();
44
- }
45
- });
46
- it('rejects permission_mode updates for owner/admin', () => {
47
- const { core, cleanup } = makeCore();
48
- try {
49
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
50
- core.ensureBootstrapUserAccess({
51
- userId: 'owner-1',
52
- workspaceId: 'workspace-1',
53
- role: 'owner',
54
- email: 'owner@example.com'
55
- });
56
- expect(() => core.setWorkspaceUserPermissionMode('owner-1', 'workspace-1', 'read-only')).toThrowError(/members/i);
57
- }
58
- finally {
59
- cleanup();
60
- }
61
- });
62
- it('prevents demoting the last workspace owner', () => {
63
- const { core, cleanup } = makeCore();
64
- try {
65
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
66
- core.ensureBootstrapUserAccess({
67
- userId: 'owner-1',
68
- workspaceId: 'workspace-1',
69
- role: 'owner',
70
- email: 'owner@example.com'
71
- });
72
- expect(() => core.updateWorkspaceUserRole('owner-1', 'workspace-1', 'admin')).toThrowError(/last workspace owner/i);
73
- }
74
- finally {
75
- cleanup();
76
- }
77
- });
78
- it('prevents disabling and removing the last workspace owner', () => {
79
- const { core, cleanup } = makeCore();
80
- try {
81
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
82
- core.ensureBootstrapUserAccess({
83
- userId: 'owner-1',
84
- workspaceId: 'workspace-1',
85
- role: 'owner',
86
- email: 'owner@example.com'
87
- });
88
- expect(() => core.setWorkspaceUserDisabled('owner-1', 'workspace-1', true)).toThrowError(/last workspace owner/i);
89
- expect(() => core.removeWorkspaceUser('owner-1', 'workspace-1')).toThrowError(/last workspace owner/i);
90
- }
91
- finally {
92
- cleanup();
93
- }
94
- });
95
- it('transfers ownership and keeps one active owner', () => {
96
- const { core, cleanup } = makeCore();
97
- try {
98
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
99
- core.ensureBootstrapUserAccess({
100
- userId: 'owner-1',
101
- workspaceId: 'workspace-1',
102
- role: 'owner',
103
- email: 'owner@example.com'
104
- });
105
- core.ensureBootstrapUserAccess({
106
- userId: 'member-1',
107
- workspaceId: 'workspace-1',
108
- role: 'member',
109
- email: 'member@example.com'
110
- });
111
- expect(core.transferWorkspaceOwnership({
112
- workspaceId: 'workspace-1',
113
- fromUserId: 'owner-1',
114
- toUserId: 'member-1'
115
- })).toBe(true);
116
- const users = core.listWorkspaceUsers('workspace-1');
117
- const newOwner = users.find((u) => u.userId === 'member-1');
118
- const previousOwner = users.find((u) => u.userId === 'owner-1');
119
- expect(newOwner?.role).toBe('owner');
120
- expect(previousOwner?.role).toBe('admin');
121
- expect(core.countWorkspaceOwners('workspace-1')).toBe(1);
122
- }
123
- finally {
124
- cleanup();
125
- }
126
- });
127
- it('marks deactivated workspace memberships as disabled without disabling the global account', () => {
128
- const { core, cleanup } = makeCore();
129
- try {
130
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
131
- core.createWorkspace({ workspaceId: 'workspace-home', name: 'Workspace Home' });
132
- core.ensureBootstrapUserAccess({
133
- userId: 'owner-1',
134
- workspaceId: 'workspace-1',
135
- role: 'owner',
136
- email: 'owner@example.com'
137
- });
138
- core.ensureBootstrapUserAccess({
139
- userId: 'member-1',
140
- workspaceId: 'workspace-1',
141
- role: 'member',
142
- email: 'member@example.com'
143
- });
144
- core.ensureBootstrapUserAccess({
145
- userId: 'member-1',
146
- workspaceId: 'workspace-home',
147
- role: 'owner',
148
- email: 'member@example.com'
149
- });
150
- expect(core.setWorkspaceUserDisabled('member-1', 'workspace-1', true)).toBe(true);
151
- const access = core.resolveUserAccess('member-1', 'workspace-1', 'member');
152
- expect(access?.disabled).toBe(true);
153
- expect(access?.accountDisabled).toBe(false);
154
- expect(access?.workspaceDisabled).toBe(true);
155
- expect(core.resolveUserAccess('member-1', 'workspace-home', 'owner')).toEqual(expect.objectContaining({
156
- role: 'owner',
157
- disabled: false,
158
- accountDisabled: false,
159
- workspaceDisabled: false
160
- }));
161
- expect(core.listUserWorkspaces('member-1').map((workspace) => workspace.id)).toEqual(['workspace-home']);
162
- expect(core.listWorkspaceUsers('workspace-1').find((user) => user.userId === 'member-1')).toEqual(expect.objectContaining({
163
- status: 'disabled',
164
- disabled: true
165
- }));
166
- const row = core.db.prepare(`
167
- SELECT is_disabled FROM users WHERE tenant_id = ? AND id = ? LIMIT 1
168
- `).get('default', 'member-1');
169
- expect(Boolean(row?.is_disabled)).toBe(false);
170
- }
171
- finally {
172
- cleanup();
173
- }
174
- });
175
- it('clears active task assignments when a workspace user is disabled', () => {
176
- const { core, cleanup } = makeCore();
177
- try {
178
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
179
- core.ensureBootstrapUserAccess({
180
- userId: 'owner-1',
181
- workspaceId: 'workspace-1',
182
- role: 'owner',
183
- email: 'owner@example.com'
184
- });
185
- core.ensureBootstrapUserAccess({
186
- userId: 'member-1',
187
- workspaceId: 'workspace-1',
188
- role: 'member',
189
- email: 'member@example.com'
190
- });
191
- const active = core.createTask({ title: 'Assigned Active', assignee: 'member-1' }, { workspaceId: 'workspace-1' });
192
- const archived = core.createTask({ title: 'Assigned Archived', assignee: 'member-1' }, { workspaceId: 'workspace-1' });
193
- core.bulkArchive([archived.id], false, 'workspace-1');
194
- expect(core.setWorkspaceUserDisabled('member-1', 'workspace-1', true)).toBe(true);
195
- expect(core.getTask(active.id, 'workspace-1')?.assignee).toBe('unassigned');
196
- expect(core.listArchive('workspace-1').archived.find((task) => task.id === archived.id)?.assignee).toBe('member-1');
197
- }
198
- finally {
199
- cleanup();
200
- }
201
- });
202
- it('clears active task assignments when a workspace user is removed', () => {
203
- const { core, cleanup } = makeCore();
204
- try {
205
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
206
- core.ensureBootstrapUserAccess({
207
- userId: 'owner-1',
208
- workspaceId: 'workspace-1',
209
- role: 'owner',
210
- email: 'owner@example.com'
211
- });
212
- core.ensureBootstrapUserAccess({
213
- userId: 'member-1',
214
- workspaceId: 'workspace-1',
215
- role: 'member',
216
- email: 'member@example.com'
217
- });
218
- const active = core.createTask({ title: 'Assigned Active', assignee: 'member-1' }, { workspaceId: 'workspace-1' });
219
- expect(core.removeWorkspaceUser('member-1', 'workspace-1')).toBe(true);
220
- expect(core.getTask(active.id, 'workspace-1')?.assignee).toBe('unassigned');
221
- }
222
- finally {
223
- cleanup();
224
- }
225
- });
226
- it('preserves existing workspace members when sync receives a partial member snapshot', () => {
227
- const { core, cleanup } = makeCore();
228
- try {
229
- core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
230
- core.ensureBootstrapUserAccess({
231
- userId: 'owner-1',
232
- workspaceId: 'workspace-1',
233
- role: 'owner',
234
- email: 'owner@example.com'
235
- });
236
- core.ensureBootstrapUserAccess({
237
- userId: 'member-1',
238
- workspaceId: 'workspace-1',
239
- role: 'member',
240
- email: 'member1@example.com'
241
- });
242
- core.ensureBootstrapUserAccess({
243
- userId: 'member-2',
244
- workspaceId: 'workspace-1',
245
- role: 'member',
246
- email: 'member2@example.com'
247
- });
248
- core.replaceWorkspaceUsersForSync({
249
- workspaceId: 'workspace-1',
250
- users: [
251
- {
252
- userId: 'owner-1',
253
- email: 'owner@example.com',
254
- displayName: 'Owner One',
255
- role: 'owner',
256
- permissionMode: 'read-write',
257
- betaAccess: true,
258
- status: 'active',
259
- disabled: false
260
- }
261
- ]
262
- });
263
- const users = core.listWorkspaceUsers('workspace-1');
264
- expect(users.map((user) => user.userId)).toEqual(expect.arrayContaining(['owner-1', 'member-1', 'member-2']));
265
- }
266
- finally {
267
- cleanup();
268
- }
269
- });
270
- });
@@ -1 +0,0 @@
1
- export {};