@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.
- package/README.md +40 -2
- package/dist/TaskforceCore.js +1 -1
- package/dist/components/features/InitiativesModule.js +1 -1
- package/dist/components/features/TaskSettings.js +1 -1
- package/dist/components/views/StandaloneLayout.js +3 -6
- package/dist/components/views/standalone/modals/AccountHubModal.d.ts +1 -2
- package/dist/components/views/standalone/modals/AccountHubModal.js +2 -3
- package/dist/components/views/standalone/modals/HelpModal.js +15 -2
- package/dist/hooks/useFilterSort.js +1 -1
- package/dist/hooks/useTaskforce.js +2 -2
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +5 -2
- package/dist/ui/assets/{AgentsModule-D8u9P5dZ.js → AgentsModule-BULqIo8e.js} +1 -1
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-CsUauFA2.js → AnnotatedAttachmentWorkspace-DHr4rHK9.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-DbQvDHFz.js → ContextAttachmentManager-DoMe2OpY.js} +1 -1
- package/dist/ui/assets/{DocumentWorkspace-BmTkN1A8.js → DocumentWorkspace-DumBWhvb.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-BXHTM-Nh.js → EntityActivityTimeline-sHk8Nzbq.js} +1 -1
- package/dist/ui/assets/{InitiativesModule-D33RyXx0.js → InitiativesModule-3X9UNzHh.js} +1 -1
- package/dist/ui/assets/{PlansPage-D0RXlT9_.js → PlansPage-C3A3EYaV.js} +1 -1
- package/dist/ui/assets/{TaskContextUpload-Vsg67lpR.js → TaskContextUpload-C8G7pWkX.js} +1 -1
- package/dist/ui/assets/{TaskSettings-DshLw7_d.js → TaskSettings-DM1o9Wla.js} +2 -2
- package/dist/ui/assets/{WorkflowsModule-CLM-1BnF.js → WorkflowsModule-CW0crzvD.js} +1 -1
- package/dist/ui/assets/documentReferences-BZB3nMRb.js +1 -0
- package/dist/ui/assets/index-BWFQ9mGn.js +5 -0
- package/dist/ui/assets/{index-DOR9PRqt.css → index-DcK_8tuE.css} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +12 -4
- package/scripts/postinstall.js +4 -3
- package/dist/TaskforceCore.CategoryFallback.test.d.ts +0 -1
- package/dist/TaskforceCore.CategoryFallback.test.js +0 -101
- package/dist/TaskforceCore.filter-persistence.test.d.ts +0 -1
- package/dist/TaskforceCore.filter-persistence.test.js +0 -402
- package/dist/TaskforceCore.routing.test.d.ts +0 -1
- package/dist/TaskforceCore.routing.test.js +0 -311
- package/dist/TaskforceCore.test.d.ts +0 -1
- package/dist/TaskforceCore.test.js +0 -7910
- package/dist/TaskforceWidget.test.d.ts +0 -1
- package/dist/TaskforceWidget.test.js +0 -92
- package/dist/UnsavedChangesRelaxed.test.d.ts +0 -1
- package/dist/UnsavedChangesRelaxed.test.js +0 -16
- package/dist/__tests__/localizationCatalogs.test.d.ts +0 -1
- package/dist/__tests__/localizationCatalogs.test.js +0 -54
- package/dist/__tests__/workflowSimulation.test.d.ts +0 -1
- package/dist/__tests__/workflowSimulation.test.js +0 -113
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.d.ts +0 -1
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.js +0 -278
- package/dist/annotatedAttachments/payload.test.d.ts +0 -1
- package/dist/annotatedAttachments/payload.test.js +0 -67
- package/dist/compat/workspaceSyncCompat.test.d.ts +0 -1
- package/dist/compat/workspaceSyncCompat.test.js +0 -124
- package/dist/components/features/AgentsModule.test.d.ts +0 -1
- package/dist/components/features/AgentsModule.test.js +0 -601
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.d.ts +0 -1
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +0 -2883
- package/dist/components/features/DocumentWorkspace.test.d.ts +0 -1
- package/dist/components/features/DocumentWorkspace.test.js +0 -1439
- package/dist/components/features/TaskSettings.test.d.ts +0 -1
- package/dist/components/features/TaskSettings.test.js +0 -1674
- package/dist/components/features/settings/TaxonomyLibraryManager.test.d.ts +0 -1
- package/dist/components/features/settings/TaxonomyLibraryManager.test.js +0 -141
- package/dist/components/task/TaskActionHeader.test.d.ts +0 -1
- package/dist/components/task/TaskActionHeader.test.js +0 -91
- package/dist/components/task/TaskCard.test.d.ts +0 -1
- package/dist/components/task/TaskCard.test.js +0 -513
- package/dist/components/task/TaskContextUpload.test.d.ts +0 -1
- package/dist/components/task/TaskContextUpload.test.js +0 -506
- package/dist/components/task/TaskForm.test.d.ts +0 -1
- package/dist/components/task/TaskForm.test.js +0 -946
- package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.empty-column-drop.test.js +0 -66
- package/dist/components/task/TaskKanban.planning-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.planning-drop.test.js +0 -93
- package/dist/components/task/TaskKanban.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.test.js +0 -99
- package/dist/components/task/TaskList.test.d.ts +0 -1
- package/dist/components/task/TaskList.test.js +0 -473
- package/dist/components/task/TaskStatusActions.test.d.ts +0 -1
- package/dist/components/task/TaskStatusActions.test.js +0 -54
- package/dist/components/task/taskKanbanDropRules.test.d.ts +0 -1
- package/dist/components/task/taskKanbanDropRules.test.js +0 -114
- package/dist/components/ui/LevelSelector.test.d.ts +0 -1
- package/dist/components/ui/LevelSelector.test.js +0 -55
- package/dist/components/ui/Markdown.test.d.ts +0 -1
- package/dist/components/ui/Markdown.test.js +0 -38
- package/dist/components/ui/MultiSelectFilter.test.d.ts +0 -1
- package/dist/components/ui/MultiSelectFilter.test.js +0 -74
- package/dist/components/ui/TaxonomyDropdown.test.d.ts +0 -1
- package/dist/components/ui/TaxonomyDropdown.test.js +0 -130
- package/dist/components/ui/TopNoticeLayer.test.d.ts +0 -1
- package/dist/components/ui/TopNoticeLayer.test.js +0 -25
- package/dist/components/views/AppShellHeader.test.d.ts +0 -1
- package/dist/components/views/AppShellHeader.test.js +0 -42
- package/dist/components/views/PlanComparisonPage.test.d.ts +0 -1
- package/dist/components/views/PlanComparisonPage.test.js +0 -758
- package/dist/components/views/PlansPage.test.d.ts +0 -1
- package/dist/components/views/PlansPage.test.js +0 -710
- package/dist/components/views/chrome/WorkspaceChromeSections.test.d.ts +0 -1
- package/dist/components/views/chrome/WorkspaceChromeSections.test.js +0 -54
- package/dist/components/views/chrome/workspaceChrome.test.d.ts +0 -1
- package/dist/components/views/chrome/workspaceChrome.test.js +0 -52
- package/dist/components/views/panels/DocumentFilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/DocumentFilterToolbar.test.js +0 -19
- package/dist/components/views/panels/FilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/FilterToolbar.test.js +0 -47
- package/dist/components/views/panels/PlanningDrawer.test.d.ts +0 -1
- package/dist/components/views/panels/PlanningDrawer.test.js +0 -529
- package/dist/components/views/planningScope.test.d.ts +0 -1
- package/dist/components/views/planningScope.test.js +0 -60
- package/dist/components/views/standalone/modals/AccountHubModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +0 -72
- package/dist/components/views/standalone/modals/HelpModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/HelpModal.test.js +0 -23
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +0 -24
- package/dist/components/views/teamManagementAccess.test.d.ts +0 -1
- package/dist/components/views/teamManagementAccess.test.js +0 -44
- package/dist/config/deployment.test.d.ts +0 -1
- package/dist/config/deployment.test.js +0 -90
- package/dist/config/envSchema.test.d.ts +0 -1
- package/dist/config/envSchema.test.js +0 -125
- package/dist/core/AiProfileService.test.d.ts +0 -1
- package/dist/core/AiProfileService.test.js +0 -184
- package/dist/core/AiProfiles.test.d.ts +0 -1
- package/dist/core/AiProfiles.test.js +0 -1873
- package/dist/core/AuthTokenService.test.d.ts +0 -1
- package/dist/core/AuthTokenService.test.js +0 -78
- package/dist/core/BulkUpdateFieldsPreview.test.d.ts +0 -1
- package/dist/core/BulkUpdateFieldsPreview.test.js +0 -62
- package/dist/core/CompletedAt.test.d.ts +0 -1
- package/dist/core/CompletedAt.test.js +0 -44
- package/dist/core/CreatedBy.test.d.ts +0 -1
- package/dist/core/CreatedBy.test.js +0 -188
- package/dist/core/DeletedTaskTrash.test.d.ts +0 -1
- package/dist/core/DeletedTaskTrash.test.js +0 -104
- package/dist/core/EntitlementsPolicy.test.d.ts +0 -1
- package/dist/core/EntitlementsPolicy.test.js +0 -280
- package/dist/core/GlobalSettingsService.test.d.ts +0 -1
- package/dist/core/GlobalSettingsService.test.js +0 -45
- package/dist/core/JsonBackupRuntime.test.d.ts +0 -1
- package/dist/core/JsonBackupRuntime.test.js +0 -155
- package/dist/core/PlanFeatureCatalog.test.d.ts +0 -1
- package/dist/core/PlanFeatureCatalog.test.js +0 -139
- package/dist/core/PlanVersionPolicy.test.d.ts +0 -1
- package/dist/core/PlanVersionPolicy.test.js +0 -236
- package/dist/core/PlanningEntities.test.d.ts +0 -1
- package/dist/core/PlanningEntities.test.js +0 -509
- package/dist/core/ScheduleFields.test.d.ts +0 -1
- package/dist/core/ScheduleFields.test.js +0 -193
- package/dist/core/SetupState.test.d.ts +0 -1
- package/dist/core/SetupState.test.js +0 -113
- package/dist/core/SignupMonetizationSettings.test.d.ts +0 -1
- package/dist/core/SignupMonetizationSettings.test.js +0 -515
- package/dist/core/Stats.test.d.ts +0 -1
- package/dist/core/Stats.test.js +0 -36
- package/dist/core/SystemAdmin.test.d.ts +0 -1
- package/dist/core/SystemAdmin.test.js +0 -1106
- package/dist/core/TaskActivitySync.test.d.ts +0 -1
- package/dist/core/TaskActivitySync.test.js +0 -90
- package/dist/core/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/TaskAttachmentsCanonical.test.js +0 -356
- package/dist/core/TaskAuditTimeline.test.d.ts +0 -1
- package/dist/core/TaskAuditTimeline.test.js +0 -319
- package/dist/core/TaskTaxonomyValidation.test.d.ts +0 -1
- package/dist/core/TaskTaxonomyValidation.test.js +0 -440
- package/dist/core/Taskforce.ids.test.d.ts +0 -1
- package/dist/core/Taskforce.ids.test.js +0 -611
- package/dist/core/Taskforce.listTasksSlim.test.d.ts +0 -1
- package/dist/core/Taskforce.listTasksSlim.test.js +0 -91
- package/dist/core/Taskforce.mcpAuth.test.d.ts +0 -1
- package/dist/core/Taskforce.mcpAuth.test.js +0 -450
- package/dist/core/Taskforce.realtimeMutation.test.d.ts +0 -1
- package/dist/core/Taskforce.realtimeMutation.test.js +0 -131
- package/dist/core/UserProfileAvatarDrafts.test.d.ts +0 -1
- package/dist/core/UserProfileAvatarDrafts.test.js +0 -138
- package/dist/core/WorkspaceDelete.test.d.ts +0 -1
- package/dist/core/WorkspaceDelete.test.js +0 -159
- package/dist/core/WorkspacePermissions.test.d.ts +0 -1
- package/dist/core/WorkspacePermissions.test.js +0 -270
- package/dist/core/WorkspacePlanMode.test.d.ts +0 -1
- package/dist/core/WorkspacePlanMode.test.js +0 -383
- package/dist/core/WorkspaceSyncSettings.test.d.ts +0 -1
- package/dist/core/WorkspaceSyncSettings.test.js +0 -65
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.js +0 -212
- package/dist/documentReviews/DocumentReviewSessionStore.test.d.ts +0 -1
- package/dist/documentReviews/DocumentReviewSessionStore.test.js +0 -127
- package/dist/hooks/authGuardPolicy.test.d.ts +0 -1
- package/dist/hooks/authGuardPolicy.test.js +0 -76
- package/dist/hooks/bootstrapTimeouts.test.d.ts +0 -1
- package/dist/hooks/bootstrapTimeouts.test.js +0 -12
- package/dist/hooks/sync/controlPlane.test.d.ts +0 -1
- package/dist/hooks/sync/controlPlane.test.js +0 -121
- package/dist/hooks/sync/lifecyclePolicy.test.d.ts +0 -1
- package/dist/hooks/sync/lifecyclePolicy.test.js +0 -124
- package/dist/hooks/sync/orchestratorShared.test.d.ts +0 -1
- package/dist/hooks/sync/orchestratorShared.test.js +0 -98
- package/dist/hooks/sync/pullLifecycle.test.d.ts +0 -1
- package/dist/hooks/sync/pullLifecycle.test.js +0 -80
- package/dist/hooks/sync/recovery.test.d.ts +0 -1
- package/dist/hooks/sync/recovery.test.js +0 -292
- package/dist/hooks/sync/transfers.test.d.ts +0 -1
- package/dist/hooks/sync/transfers.test.js +0 -928
- package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +0 -1
- package/dist/hooks/sync/useRecentSyncEvents.test.js +0 -124
- package/dist/hooks/sync/useSyncStatusActions.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusActions.test.js +0 -133
- package/dist/hooks/sync/useSyncStatusControls.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusControls.test.js +0 -88
- package/dist/hooks/useFilterSort.test.d.ts +0 -1
- package/dist/hooks/useFilterSort.test.js +0 -419
- package/dist/hooks/useRealtimeSync.test.d.ts +0 -1
- package/dist/hooks/useRealtimeSync.test.js +0 -311
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +0 -54
- package/dist/hooks/useSyncOrchestrator.context-assets.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.context-assets.test.js +0 -228
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +0 -2027
- package/dist/hooks/useTaskData.test.d.ts +0 -1
- package/dist/hooks/useTaskData.test.js +0 -291
- package/dist/hooks/useTaskMutations.test.d.ts +0 -1
- package/dist/hooks/useTaskMutations.test.js +0 -256
- package/dist/hooks/useTaskforce.contract.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.contract.test.js +0 -7
- package/dist/hooks/useTaskforce.priority-filters.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.priority-filters.test.js +0 -28
- package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.runtime-routing.test.js +0 -246
- package/dist/hooks/useTaskforce.sync-behavior.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.sync-behavior.test.js +0 -3644
- package/dist/hooks/useWorkspaceSyncController.test.d.ts +0 -1
- package/dist/hooks/useWorkspaceSyncController.test.js +0 -192
- package/dist/hooks/workspace/useTaskforceApiRouting.test.d.ts +0 -1
- package/dist/hooks/workspace/useTaskforceApiRouting.test.js +0 -77
- package/dist/hooks/workspace/workspaceLocalState.test.d.ts +0 -1
- package/dist/hooks/workspace/workspaceLocalState.test.js +0 -59
- package/dist/localization/localizationCatalogs.test.d.ts +0 -1
- package/dist/localization/localizationCatalogs.test.js +0 -37
- package/dist/mcp/aiProfileBootstrap.test.d.ts +0 -1
- package/dist/mcp/aiProfileBootstrap.test.js +0 -68
- package/dist/mcp/canonicalAssetHelpers.test.d.ts +0 -1
- package/dist/mcp/canonicalAssetHelpers.test.js +0 -67
- package/dist/mcp/clientIntegrations.test.d.ts +0 -1
- package/dist/mcp/clientIntegrations.test.js +0 -219
- package/dist/mcp/optionResolution.test.d.ts +0 -1
- package/dist/mcp/optionResolution.test.js +0 -43
- package/dist/mcp/runtime.test.d.ts +0 -1
- package/dist/mcp/runtime.test.js +0 -5211
- package/dist/mcp/structuredCommentValidation.test.d.ts +0 -1
- package/dist/mcp/structuredCommentValidation.test.js +0 -31
- package/dist/mcp/structuredDocValidation.test.d.ts +0 -1
- package/dist/mcp/structuredDocValidation.test.js +0 -35
- package/dist/mcp/toolRegistry.test.d.ts +0 -1
- package/dist/mcp/toolRegistry.test.js +0 -34
- package/dist/migrations/billingSchemaParity.test.d.ts +0 -1
- package/dist/migrations/billingSchemaParity.test.js +0 -160
- package/dist/migrations/taskSchemaMigrations.test.d.ts +0 -1
- package/dist/migrations/taskSchemaMigrations.test.js +0 -225
- package/dist/qaOpen.test.d.ts +0 -1
- package/dist/qaOpen.test.js +0 -56
- package/dist/releaseVersion.test.d.ts +0 -1
- package/dist/releaseVersion.test.js +0 -32
- package/dist/runtime/appGates.test.d.ts +0 -1
- package/dist/runtime/appGates.test.js +0 -42
- package/dist/server/aiProfileAvatarAssets.test.d.ts +0 -1
- package/dist/server/aiProfileAvatarAssets.test.js +0 -213
- package/dist/server/annotatedAttachmentsRoutes.test.d.ts +0 -1
- package/dist/server/annotatedAttachmentsRoutes.test.js +0 -532
- package/dist/server/auth.test.d.ts +0 -1
- package/dist/server/auth.test.js +0 -131
- package/dist/server/buildInfo.test.d.ts +0 -1
- package/dist/server/buildInfo.test.js +0 -29
- package/dist/server/cors.test.d.ts +0 -1
- package/dist/server/cors.test.js +0 -77
- package/dist/server/documentReviewRoutes.test.d.ts +0 -1
- package/dist/server/documentReviewRoutes.test.js +0 -190
- package/dist/server/email.test.d.ts +0 -1
- package/dist/server/email.test.js +0 -113
- package/dist/server/index.cookieProxy.test.d.ts +0 -1
- package/dist/server/index.cookieProxy.test.js +0 -67
- package/dist/server/index.rateLimit.test.d.ts +0 -1
- package/dist/server/index.rateLimit.test.js +0 -22
- package/dist/server/index.test.d.ts +0 -1
- package/dist/server/index.test.js +0 -283
- package/dist/server/rateLimit.test.d.ts +0 -1
- package/dist/server/rateLimit.test.js +0 -107
- package/dist/server/realtimeSync.auth.test.d.ts +0 -1
- package/dist/server/realtimeSync.auth.test.js +0 -62
- package/dist/server/realtimeSync.replay.test.d.ts +0 -1
- package/dist/server/realtimeSync.replay.test.js +0 -192
- package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +0 -1
- package/dist/server/realtimeSync.workspaceIsolation.test.js +0 -101
- package/dist/server/routes/billing.test.d.ts +0 -1
- package/dist/server/routes/billing.test.js +0 -3515
- package/dist/server/routes/shared.test.d.ts +0 -1
- package/dist/server/routes/shared.test.js +0 -32
- package/dist/server/routes/sync.integration.test.d.ts +0 -1
- package/dist/server/routes/sync.integration.test.js +0 -2932
- package/dist/server/routes/syncAuxRoutes.test.d.ts +0 -1
- package/dist/server/routes/syncAuxRoutes.test.js +0 -158
- package/dist/server/routes/syncRouteGuards.test.d.ts +0 -1
- package/dist/server/routes/syncRouteGuards.test.js +0 -94
- package/dist/server/routes.test.d.ts +0 -1
- package/dist/server/routes.test.js +0 -15612
- package/dist/server/runtimeMode.test.d.ts +0 -1
- package/dist/server/runtimeMode.test.js +0 -26
- package/dist/server/securityHeaders.test.d.ts +0 -1
- package/dist/server/securityHeaders.test.js +0 -70
- package/dist/services/templateEngine.test.d.ts +0 -1
- package/dist/services/templateEngine.test.js +0 -150
- package/dist/services/templates.test.d.ts +0 -1
- package/dist/services/templates.test.js +0 -45
- package/dist/services/workflowDocumentFixtures.test.d.ts +0 -1
- package/dist/services/workflowDocumentFixtures.test.js +0 -78
- package/dist/services/workflowExportMatrix.test.d.ts +0 -1
- package/dist/services/workflowExportMatrix.test.js +0 -113
- package/dist/services/workflowExportSnapshots.test.d.ts +0 -1
- package/dist/services/workflowExportSnapshots.test.js +0 -30
- package/dist/services/workflowGeneration.test.d.ts +0 -1
- package/dist/services/workflowGeneration.test.js +0 -12
- package/dist/services/workflowSimulation.test.d.ts +0 -1
- package/dist/services/workflowSimulation.test.js +0 -113
- package/dist/services/workflowV2Policy.test.d.ts +0 -1
- package/dist/services/workflowV2Policy.test.js +0 -80
- package/dist/shared/customTaxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/customTaxonomyLibrary.test.js +0 -20
- package/dist/shared/passwordPolicy.test.d.ts +0 -1
- package/dist/shared/passwordPolicy.test.js +0 -34
- package/dist/shared/runtimeContract.test.d.ts +0 -1
- package/dist/shared/runtimeContract.test.js +0 -23
- package/dist/shared/taxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/taxonomyLibrary.test.js +0 -26
- package/dist/shared/taxonomyState.test.d.ts +0 -1
- package/dist/shared/taxonomyState.test.js +0 -71
- package/dist/soak/preflight.cli.d.ts +0 -1
- package/dist/soak/preflight.cli.js +0 -28
- package/dist/soak/preflight.d.ts +0 -26
- package/dist/soak/preflight.js +0 -113
- package/dist/soak/preflight.test.d.ts +0 -1
- package/dist/soak/preflight.test.js +0 -39
- package/dist/storage/objectStorageClient.test.d.ts +0 -1
- package/dist/storage/objectStorageClient.test.js +0 -82
- package/dist/storage/objectStorageConfig.test.d.ts +0 -1
- package/dist/storage/objectStorageConfig.test.js +0 -50
- package/dist/storage/postgresAdapter.test.d.ts +0 -1
- package/dist/storage/postgresAdapter.test.js +0 -29
- package/dist/storage/workspaceAssetStore.test.d.ts +0 -1
- package/dist/storage/workspaceAssetStore.test.js +0 -588
- package/dist/sync/cloudSyncApi.test.d.ts +0 -1
- package/dist/sync/cloudSyncApi.test.js +0 -111
- package/dist/sync/collaborationSyncPayload.test.d.ts +0 -1
- package/dist/sync/collaborationSyncPayload.test.js +0 -125
- package/dist/sync/contentSyncPayload.test.d.ts +0 -1
- package/dist/sync/contentSyncPayload.test.js +0 -143
- package/dist/sync/encryptionService.test.d.ts +0 -1
- package/dist/sync/encryptionService.test.js +0 -52
- package/dist/sync/planningSyncPayload.test.d.ts +0 -1
- package/dist/sync/planningSyncPayload.test.js +0 -92
- package/dist/sync/realtimeFeature.test.d.ts +0 -1
- package/dist/sync/realtimeFeature.test.js +0 -30
- package/dist/sync/realtimeReconcile.test.d.ts +0 -1
- package/dist/sync/realtimeReconcile.test.js +0 -43
- package/dist/sync/syncApplyHandlers.test.d.ts +0 -1
- package/dist/sync/syncApplyHandlers.test.js +0 -626
- package/dist/sync/syncService.test.d.ts +0 -1
- package/dist/sync/syncService.test.js +0 -903
- package/dist/sync/taskSyncPayload.test.d.ts +0 -1
- package/dist/sync/taskSyncPayload.test.js +0 -54
- package/dist/sync/workspacePullFeed.test.d.ts +0 -1
- package/dist/sync/workspacePullFeed.test.js +0 -438
- package/dist/sync/workspaceSyncModel.test.d.ts +0 -1
- package/dist/sync/workspaceSyncModel.test.js +0 -1442
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -15
- package/dist/ui/assets/documentReferences-BPWp6ce0.js +0 -1
- package/dist/ui/assets/index-zvbo2Jse.js +0 -5
- package/dist/utils/accountProfileSummaryCache.test.d.ts +0 -1
- package/dist/utils/accountProfileSummaryCache.test.js +0 -63
- package/dist/utils/annotatedAttachments.test.d.ts +0 -1
- package/dist/utils/annotatedAttachments.test.js +0 -108
- package/dist/utils/assignees.test.d.ts +0 -1
- package/dist/utils/assignees.test.js +0 -25
- package/dist/utils/avatarUpload.test.d.ts +0 -1
- package/dist/utils/avatarUpload.test.js +0 -40
- package/dist/utils/canonicalAssetKind.test.d.ts +0 -1
- package/dist/utils/canonicalAssetKind.test.js +0 -24
- package/dist/utils/coalescedRefresh.test.d.ts +0 -1
- package/dist/utils/coalescedRefresh.test.js +0 -30
- package/dist/utils/constants.icons.test.d.ts +0 -1
- package/dist/utils/constants.icons.test.js +0 -41
- package/dist/utils/planParser.test.d.ts +0 -1
- package/dist/utils/planParser.test.js +0 -183
- package/dist/utils/planningReferences.test.d.ts +0 -1
- package/dist/utils/planningReferences.test.js +0 -17
- package/dist/utils/supportContact.test.d.ts +0 -1
- package/dist/utils/supportContact.test.js +0 -19
- package/dist/utils/syncEventDetails.test.d.ts +0 -1
- package/dist/utils/syncEventDetails.test.js +0 -23
- package/dist/utils/syncEventPresentation.test.d.ts +0 -1
- package/dist/utils/syncEventPresentation.test.js +0 -64
- package/dist/utils/syncStatusPresentation.test.d.ts +0 -1
- package/dist/utils/syncStatusPresentation.test.js +0 -164
- package/dist/utils/taskActivity.test.d.ts +0 -1
- package/dist/utils/taskActivity.test.js +0 -218
- package/dist/utils/taskDraftDefaults.test.d.ts +0 -1
- package/dist/utils/taskDraftDefaults.test.js +0 -34
- package/dist/utils/taskDragZones.test.d.ts +0 -1
- package/dist/utils/taskDragZones.test.js +0 -14
- package/dist/utils/taskNormalization.test.d.ts +0 -1
- package/dist/utils/taskNormalization.test.js +0 -158
- package/dist/utils/taskSearch.test.d.ts +0 -1
- package/dist/utils/taskSearch.test.js +0 -69
- package/dist/utils/taskUtils.test.d.ts +0 -1
- package/dist/utils/taskUtils.test.js +0 -19
- package/dist/utils/taskforceApiClient.test.d.ts +0 -1
- package/dist/utils/taskforceApiClient.test.js +0 -44
- package/dist/utils/taxonomyFormDefaults.test.d.ts +0 -1
- package/dist/utils/taxonomyFormDefaults.test.js +0 -63
- package/dist/utils/uiNotice.test.d.ts +0 -1
- package/dist/utils/uiNotice.test.js +0 -18
- package/dist/utils/workspaceIdentity.test.d.ts +0 -1
- package/dist/utils/workspaceIdentity.test.js +0 -61
- package/dist/utils/workspaceLifecycle.test.d.ts +0 -1
- package/dist/utils/workspaceLifecycle.test.js +0 -64
- package/dist/utils/workspaceSyncPresentation.test.d.ts +0 -1
- package/dist/utils/workspaceSyncPresentation.test.js +0 -71
- package/scripts/bootstrap-playwright-auth.mjs +0 -155
- package/scripts/check-cloud-mcp.mjs +0 -83
- package/scripts/check-compat-boundaries.mjs +0 -41
- package/scripts/check-env.ts +0 -31
- package/scripts/check-localization-strings.mjs +0 -49
- package/scripts/check-runtime-boundaries.mjs +0 -44
- package/scripts/debug-global.mjs +0 -34
- package/scripts/debug-login.mjs +0 -32
- package/scripts/debug-server.mjs +0 -36
- package/scripts/deploy-prod.sh +0 -41
- package/scripts/deploy-staging.sh +0 -23
- package/scripts/export-sqlite-to-postgres.mjs +0 -123
- package/scripts/generate-env-example.ts +0 -8
- package/scripts/mcp-stdio-adapter.mjs +0 -160
- package/scripts/migrate-task-data-assets.mjs +0 -408
- package/scripts/playwright-auth.sh +0 -19
- package/scripts/qa-open-lib.mjs +0 -175
- package/scripts/qa-open-lib.mjs.d.ts +0 -49
- package/scripts/qa-open.mjs +0 -352
- package/scripts/release-version-lib.mjs +0 -88
- package/scripts/release-version.mjs +0 -72
- package/scripts/run-billing-performance-smoke.sh +0 -24
- package/scripts/run-dev-proxy.sh +0 -51
- package/scripts/run-e2e-realtime.sh +0 -30
- package/scripts/run-smoke.sh +0 -35
- package/scripts/run-soak.sh +0 -41
- package/scripts/test-global.js +0 -143
- package/scripts/update-homebrew-formula.sh +0 -108
- 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 {};
|