@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.
- package/README.md +89 -127
- package/dist/TaskforceCore.js +1 -1
- package/dist/components/context/ContextAttachmentManager.js +4 -3
- package/dist/components/features/InitiativesModule.js +1 -1
- package/dist/components/features/TaskSettings.js +1 -1
- package/dist/components/ui/DisclosureSectionHeader.d.ts +12 -0
- package/dist/components/ui/DisclosureSectionHeader.js +8 -0
- package/dist/components/views/PlanComparisonPage.js +1 -1
- package/dist/components/views/StandaloneLayout.js +18 -4
- package/dist/components/views/panels/PlanningDrawer.js +2 -1
- package/dist/components/views/standalone/modals/AccountHubModal.js +1 -1
- package/dist/components/views/standalone/modals/HelpModal.d.ts +3 -1
- package/dist/components/views/standalone/modals/HelpModal.js +17 -2
- package/dist/core/PlanEntitlementService.d.ts +2 -0
- package/dist/core/PlanEntitlementService.js +57 -4
- package/dist/hooks/useFilterSort.js +1 -1
- package/dist/hooks/useTaskforce.js +2 -2
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +5 -2
- package/dist/localization/locales/en-US.js +1 -1
- package/dist/localization/locales/es-419.js +1 -1
- package/dist/localization/locales/pt-BR.js +1 -1
- package/dist/mcp/runtime.js +49 -14
- package/dist/server/routes/billing.js +0 -1
- package/dist/ui/assets/AgentsModule-BULqIo8e.js +1 -0
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-CCckzWYZ.js → AnnotatedAttachmentWorkspace-DHr4rHK9.js} +1 -1
- package/dist/ui/assets/ContextAttachmentManager-DoMe2OpY.js +3 -0
- package/dist/ui/assets/{DocumentWorkspace-BVaWPA25.js → DocumentWorkspace-DumBWhvb.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-DSj0ThaK.js → EntityActivityTimeline-sHk8Nzbq.js} +1 -1
- package/dist/ui/assets/{InitiativesModule-AxMkWtxH.js → InitiativesModule-3X9UNzHh.js} +1 -1
- package/dist/ui/assets/PlansPage-C3A3EYaV.js +1 -0
- package/dist/ui/assets/PlansPage-DeAzWYTb.css +1 -0
- package/dist/ui/assets/{TaskContextUpload-Dw4rTF4i.js → TaskContextUpload-C8G7pWkX.js} +1 -1
- package/dist/ui/assets/{TaskSettings-f2ga42_V.js → TaskSettings-DM1o9Wla.js} +2 -2
- package/dist/ui/assets/{WorkflowsModule-E4UL3mov.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-BvAbqx5Q.css → index-DcK_8tuE.css} +1 -1
- package/dist/ui/assets/{vendor-icons-B32hGuF2.js → vendor-icons-CLnehDTw.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/supportContact.d.ts +9 -0
- package/dist/utils/supportContact.js +32 -0
- 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 -757
- 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 -66
- 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 -204
- 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 -5120
- 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 -3455
- 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/AgentsModule-BS4Pi_nC.js +0 -1
- package/dist/ui/assets/ContextAttachmentManager-CfG_ER7C.js +0 -3
- package/dist/ui/assets/PlansPage-B_z-D6Nh.css +0 -1
- package/dist/ui/assets/PlansPage-Ndt7mYfo.js +0 -1
- package/dist/ui/assets/documentReferences-BOUcJm6-.js +0 -1
- package/dist/ui/assets/index-MAHKvFqp.js +0 -4
- 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/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,311 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { act, renderHook, waitFor } from '@testing-library/react';
|
|
3
|
-
import { useRealtimeSync } from './useRealtimeSync';
|
|
4
|
-
class MockWebSocket {
|
|
5
|
-
static instances = [];
|
|
6
|
-
static OPEN = 1;
|
|
7
|
-
static CLOSED = 3;
|
|
8
|
-
url;
|
|
9
|
-
readyState = 0;
|
|
10
|
-
sent = [];
|
|
11
|
-
listeners = {
|
|
12
|
-
open: [],
|
|
13
|
-
message: [],
|
|
14
|
-
close: [],
|
|
15
|
-
error: []
|
|
16
|
-
};
|
|
17
|
-
constructor(url) {
|
|
18
|
-
this.url = url;
|
|
19
|
-
MockWebSocket.instances.push(this);
|
|
20
|
-
}
|
|
21
|
-
addEventListener(type, listener) {
|
|
22
|
-
this.listeners[type] = this.listeners[type] || [];
|
|
23
|
-
this.listeners[type].push(listener);
|
|
24
|
-
}
|
|
25
|
-
close() {
|
|
26
|
-
this.readyState = MockWebSocket.CLOSED;
|
|
27
|
-
this.emit('close', {});
|
|
28
|
-
}
|
|
29
|
-
send(payload) {
|
|
30
|
-
this.sent.push(payload);
|
|
31
|
-
}
|
|
32
|
-
emit(type, event) {
|
|
33
|
-
const handlers = this.listeners[type] || [];
|
|
34
|
-
handlers.forEach((handler) => handler(event));
|
|
35
|
-
}
|
|
36
|
-
open() {
|
|
37
|
-
this.readyState = MockWebSocket.OPEN;
|
|
38
|
-
this.emit('open', {});
|
|
39
|
-
}
|
|
40
|
-
message(payload) {
|
|
41
|
-
this.emit('message', { data: JSON.stringify(payload) });
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
describe('useRealtimeSync', () => {
|
|
45
|
-
afterEach(() => {
|
|
46
|
-
vi.useRealTimers();
|
|
47
|
-
vi.unstubAllGlobals();
|
|
48
|
-
MockWebSocket.instances = [];
|
|
49
|
-
});
|
|
50
|
-
it('connects, subscribes, and emits coalesced signal on update', async () => {
|
|
51
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
52
|
-
const onSignal = vi.fn();
|
|
53
|
-
const { result } = renderHook(() => useRealtimeSync({
|
|
54
|
-
enabled: true,
|
|
55
|
-
workspaceId: 'ws-1',
|
|
56
|
-
websocketUrl: 'wss://example.com/taskforce-ws',
|
|
57
|
-
onSignal
|
|
58
|
-
}));
|
|
59
|
-
expect(MockWebSocket.instances).toHaveLength(1);
|
|
60
|
-
const socket = MockWebSocket.instances[0];
|
|
61
|
-
act(() => {
|
|
62
|
-
socket.open();
|
|
63
|
-
socket.message({ type: 'taskforce:update', workspaceId: 'ws-1' });
|
|
64
|
-
socket.message({ type: 'taskforce:update', workspaceId: 'ws-1' });
|
|
65
|
-
});
|
|
66
|
-
await waitFor(() => {
|
|
67
|
-
expect(result.current.connectionState).toBe('connected');
|
|
68
|
-
});
|
|
69
|
-
await waitFor(() => {
|
|
70
|
-
expect(onSignal).toHaveBeenCalledTimes(1);
|
|
71
|
-
});
|
|
72
|
-
const outboundTypes = socket.sent.map((entry) => JSON.parse(entry).type);
|
|
73
|
-
expect(outboundTypes).toContain('taskforce:subscribe');
|
|
74
|
-
expect(outboundTypes).toContain('taskforce:replay');
|
|
75
|
-
});
|
|
76
|
-
it('includes the resolved authenticated userId in subscribe payloads', async () => {
|
|
77
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
78
|
-
renderHook(() => useRealtimeSync({
|
|
79
|
-
enabled: true,
|
|
80
|
-
workspaceId: 'ws-1',
|
|
81
|
-
websocketUrl: 'wss://example.com/taskforce-ws',
|
|
82
|
-
userId: 'user-42'
|
|
83
|
-
}));
|
|
84
|
-
const socket = MockWebSocket.instances[0];
|
|
85
|
-
act(() => {
|
|
86
|
-
socket.open();
|
|
87
|
-
});
|
|
88
|
-
await waitFor(() => {
|
|
89
|
-
expect(socket.sent.length).toBeGreaterThan(0);
|
|
90
|
-
});
|
|
91
|
-
const subscribePayload = socket.sent
|
|
92
|
-
.map((entry) => JSON.parse(entry))
|
|
93
|
-
.find((entry) => entry.type === 'taskforce:subscribe');
|
|
94
|
-
expect(subscribePayload).toMatchObject({
|
|
95
|
-
type: 'taskforce:subscribe',
|
|
96
|
-
workspaceId: 'ws-1',
|
|
97
|
-
userId: 'user-42'
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
it('reconnects with backoff and degrades after threshold', async () => {
|
|
101
|
-
vi.useFakeTimers();
|
|
102
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
103
|
-
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => { });
|
|
104
|
-
const { result } = renderHook(() => useRealtimeSync({
|
|
105
|
-
enabled: true,
|
|
106
|
-
workspaceId: 'ws-1',
|
|
107
|
-
websocketUrl: 'wss://example.com/taskforce-ws',
|
|
108
|
-
reconnectBaseMs: 100,
|
|
109
|
-
reconnectMaxMs: 100,
|
|
110
|
-
degradeAfterAttempts: 2
|
|
111
|
-
}));
|
|
112
|
-
const first = MockWebSocket.instances[0];
|
|
113
|
-
act(() => {
|
|
114
|
-
first.open();
|
|
115
|
-
first.emit('close', { code: 1006, reason: 'transport-lost' });
|
|
116
|
-
});
|
|
117
|
-
expect(result.current.connectionState).toBe('reconnecting');
|
|
118
|
-
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Realtime socket closed workspace=ws-1'));
|
|
119
|
-
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('code=1006'));
|
|
120
|
-
act(() => {
|
|
121
|
-
vi.advanceTimersByTime(100);
|
|
122
|
-
});
|
|
123
|
-
expect(MockWebSocket.instances).toHaveLength(2);
|
|
124
|
-
const second = MockWebSocket.instances[1];
|
|
125
|
-
act(() => {
|
|
126
|
-
second.close();
|
|
127
|
-
});
|
|
128
|
-
expect(result.current.connectionState).toBe('degraded-fallback');
|
|
129
|
-
});
|
|
130
|
-
it('does not connect when disabled', () => {
|
|
131
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
132
|
-
const { result } = renderHook(() => useRealtimeSync({
|
|
133
|
-
enabled: false,
|
|
134
|
-
workspaceId: 'ws-1',
|
|
135
|
-
websocketUrl: 'wss://example.com/taskforce-ws'
|
|
136
|
-
}));
|
|
137
|
-
expect(MockWebSocket.instances).toHaveLength(0);
|
|
138
|
-
expect(result.current.connectionState).toBe('degraded-fallback');
|
|
139
|
-
});
|
|
140
|
-
it('resumes replay from last acknowledged cursor after reconnect', async () => {
|
|
141
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
142
|
-
renderHook(() => useRealtimeSync({
|
|
143
|
-
enabled: true,
|
|
144
|
-
workspaceId: 'ws-1',
|
|
145
|
-
websocketUrl: 'wss://example.com/taskforce-ws'
|
|
146
|
-
}));
|
|
147
|
-
const first = MockWebSocket.instances[0];
|
|
148
|
-
act(() => {
|
|
149
|
-
first.open();
|
|
150
|
-
first.message({
|
|
151
|
-
type: 'taskforce:mutation',
|
|
152
|
-
workspaceId: 'ws-1',
|
|
153
|
-
serverEpoch: 'epoch-1',
|
|
154
|
-
seq: 5
|
|
155
|
-
});
|
|
156
|
-
first.close();
|
|
157
|
-
});
|
|
158
|
-
await waitFor(() => {
|
|
159
|
-
expect(MockWebSocket.instances.length).toBeGreaterThanOrEqual(2);
|
|
160
|
-
});
|
|
161
|
-
const second = MockWebSocket.instances[1];
|
|
162
|
-
act(() => {
|
|
163
|
-
second.open();
|
|
164
|
-
});
|
|
165
|
-
const replayPayloads = second.sent
|
|
166
|
-
.map((entry) => JSON.parse(entry))
|
|
167
|
-
.filter((entry) => entry.type === 'taskforce:replay');
|
|
168
|
-
expect(replayPayloads.length).toBeGreaterThanOrEqual(1);
|
|
169
|
-
expect(replayPayloads[0].cursor).toBe('epoch-1:5');
|
|
170
|
-
});
|
|
171
|
-
it('triggers full-resync signal once on replay-gap/reset until cursor recovers', async () => {
|
|
172
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
173
|
-
const onSignal = vi.fn();
|
|
174
|
-
renderHook(() => useRealtimeSync({
|
|
175
|
-
enabled: true,
|
|
176
|
-
workspaceId: 'ws-1',
|
|
177
|
-
websocketUrl: 'wss://example.com/taskforce-ws',
|
|
178
|
-
onSignal
|
|
179
|
-
}));
|
|
180
|
-
const socket = MockWebSocket.instances[0];
|
|
181
|
-
act(() => {
|
|
182
|
-
socket.open();
|
|
183
|
-
socket.message({ type: 'taskforce:replay-gap', workspaceId: 'ws-1' });
|
|
184
|
-
socket.message({ type: 'taskforce:replay-reset', workspaceId: 'ws-1' });
|
|
185
|
-
});
|
|
186
|
-
await waitFor(() => {
|
|
187
|
-
expect(onSignal).toHaveBeenCalledTimes(1);
|
|
188
|
-
});
|
|
189
|
-
expect(onSignal.mock.calls[0][0]?.type).toBe('taskforce:replay-gap');
|
|
190
|
-
act(() => {
|
|
191
|
-
socket.message({
|
|
192
|
-
type: 'taskforce:mutation',
|
|
193
|
-
workspaceId: 'ws-1',
|
|
194
|
-
serverEpoch: 'epoch-2',
|
|
195
|
-
seq: 1
|
|
196
|
-
});
|
|
197
|
-
socket.message({ type: 'taskforce:replay-reset', workspaceId: 'ws-1' });
|
|
198
|
-
});
|
|
199
|
-
await waitFor(() => {
|
|
200
|
-
expect(onSignal.mock.calls.length).toBeGreaterThanOrEqual(2);
|
|
201
|
-
});
|
|
202
|
-
expect(onSignal.mock.calls[1][0]?.type).toBe('taskforce:replay-reset');
|
|
203
|
-
});
|
|
204
|
-
it('converts out-of-order mutation delivery into replay-gap recovery signal and telemetry', async () => {
|
|
205
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
206
|
-
const onSignal = vi.fn();
|
|
207
|
-
const onTelemetry = vi.fn();
|
|
208
|
-
renderHook(() => useRealtimeSync({
|
|
209
|
-
enabled: true,
|
|
210
|
-
workspaceId: 'ws-1',
|
|
211
|
-
websocketUrl: 'wss://example.com/taskforce-ws',
|
|
212
|
-
onSignal,
|
|
213
|
-
onTelemetry
|
|
214
|
-
}));
|
|
215
|
-
const socket = MockWebSocket.instances[0];
|
|
216
|
-
act(() => {
|
|
217
|
-
socket.open();
|
|
218
|
-
socket.message({
|
|
219
|
-
type: 'taskforce:mutation',
|
|
220
|
-
workspaceId: 'ws-1',
|
|
221
|
-
eventId: 'epoch-1:1',
|
|
222
|
-
serverEpoch: 'epoch-1',
|
|
223
|
-
seq: 1
|
|
224
|
-
});
|
|
225
|
-
socket.message({
|
|
226
|
-
type: 'taskforce:mutation',
|
|
227
|
-
workspaceId: 'ws-1',
|
|
228
|
-
eventId: 'epoch-1:3',
|
|
229
|
-
serverEpoch: 'epoch-1',
|
|
230
|
-
seq: 3
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
await waitFor(() => {
|
|
234
|
-
expect(onSignal.mock.calls.some((call) => call?.[0]?.type === 'taskforce:replay-gap')).toBe(true);
|
|
235
|
-
});
|
|
236
|
-
await waitFor(() => {
|
|
237
|
-
expect(onTelemetry).toHaveBeenCalled();
|
|
238
|
-
});
|
|
239
|
-
const lastTelemetry = onTelemetry.mock.calls.at(-1)?.[0];
|
|
240
|
-
expect(lastTelemetry?.outOfOrderDiscarded).toBeGreaterThanOrEqual(1);
|
|
241
|
-
expect(lastTelemetry?.recoveryTriggered).toBeGreaterThanOrEqual(1);
|
|
242
|
-
});
|
|
243
|
-
it('prioritizes mutation over trailing update and keeps mutation eventId', async () => {
|
|
244
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
245
|
-
const onSignal = vi.fn();
|
|
246
|
-
renderHook(() => useRealtimeSync({
|
|
247
|
-
enabled: true,
|
|
248
|
-
workspaceId: 'ws-1',
|
|
249
|
-
websocketUrl: 'wss://example.com/taskforce-ws',
|
|
250
|
-
onSignal
|
|
251
|
-
}));
|
|
252
|
-
const socket = MockWebSocket.instances[0];
|
|
253
|
-
act(() => {
|
|
254
|
-
socket.open();
|
|
255
|
-
socket.message({
|
|
256
|
-
type: 'taskforce:mutation',
|
|
257
|
-
workspaceId: 'ws-1',
|
|
258
|
-
eventId: 'epoch-1:10',
|
|
259
|
-
serverEpoch: 'epoch-1',
|
|
260
|
-
seq: 10
|
|
261
|
-
});
|
|
262
|
-
socket.message({
|
|
263
|
-
type: 'taskforce:update',
|
|
264
|
-
workspaceId: 'ws-1'
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
await waitFor(() => {
|
|
268
|
-
expect(onSignal).toHaveBeenCalledTimes(1);
|
|
269
|
-
});
|
|
270
|
-
expect(onSignal.mock.calls[0][0]).toMatchObject({
|
|
271
|
-
type: 'taskforce:mutation',
|
|
272
|
-
workspaceId: 'ws-1',
|
|
273
|
-
eventId: 'epoch-1:10'
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
it('does not emit replay signal for duplicate-only replay batch', async () => {
|
|
277
|
-
vi.stubGlobal('WebSocket', MockWebSocket);
|
|
278
|
-
const onSignal = vi.fn();
|
|
279
|
-
renderHook(() => useRealtimeSync({
|
|
280
|
-
enabled: true,
|
|
281
|
-
workspaceId: 'ws-1',
|
|
282
|
-
websocketUrl: 'wss://example.com/taskforce-ws',
|
|
283
|
-
onSignal
|
|
284
|
-
}));
|
|
285
|
-
const socket = MockWebSocket.instances[0];
|
|
286
|
-
act(() => {
|
|
287
|
-
socket.open();
|
|
288
|
-
socket.message({
|
|
289
|
-
type: 'taskforce:replay',
|
|
290
|
-
workspaceId: 'ws-1',
|
|
291
|
-
events: [
|
|
292
|
-
{ eventId: 'epoch-1:1', serverEpoch: 'epoch-1', seq: 1 }
|
|
293
|
-
]
|
|
294
|
-
});
|
|
295
|
-
socket.message({
|
|
296
|
-
type: 'taskforce:replay',
|
|
297
|
-
workspaceId: 'ws-1',
|
|
298
|
-
events: [
|
|
299
|
-
{ eventId: 'epoch-1:1', serverEpoch: 'epoch-1', seq: 1 }
|
|
300
|
-
]
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
await waitFor(() => {
|
|
304
|
-
expect(onSignal).toHaveBeenCalledTimes(1);
|
|
305
|
-
});
|
|
306
|
-
expect(onSignal.mock.calls[0][0]).toMatchObject({
|
|
307
|
-
type: 'taskforce:replay',
|
|
308
|
-
workspaceId: 'ws-1'
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { normalizeWorkspaceSyncAiProfileSnapshotEntry } from './useSyncOrchestrator';
|
|
3
|
-
describe('normalizeWorkspaceSyncAiProfileSnapshotEntry', () => {
|
|
4
|
-
it('accepts snake_case ai profile payloads from sync snapshot routes', () => {
|
|
5
|
-
const entry = normalizeWorkspaceSyncAiProfileSnapshotEntry({
|
|
6
|
-
id: 'ai-profile-codex',
|
|
7
|
-
workspace_id: 'workspace-local-active',
|
|
8
|
-
profile_token: 'token-codex',
|
|
9
|
-
name: 'Codex',
|
|
10
|
-
username: 'codex',
|
|
11
|
-
icon: 'Bot',
|
|
12
|
-
color: '#0ea5e9',
|
|
13
|
-
description: 'Terminal-first coding agent',
|
|
14
|
-
role: 'Implementer',
|
|
15
|
-
provider: 'OpenAI',
|
|
16
|
-
model: 'gpt-5.4',
|
|
17
|
-
surface_type: 'coding_tool',
|
|
18
|
-
seat_scope: 'cloud_metered',
|
|
19
|
-
provider_metadata: { source: 'test' },
|
|
20
|
-
archived_at: '2026-03-16T18:00:00.000Z',
|
|
21
|
-
archived_by: 'owner-1',
|
|
22
|
-
archived_reason: 'manual_archive',
|
|
23
|
-
merged_into_profile_id: 'ai-profile-keeper',
|
|
24
|
-
roster_state_updated_at: '2026-03-16T18:00:00.000Z',
|
|
25
|
-
created_at: '2026-03-15T18:00:00.000Z',
|
|
26
|
-
updated_at: '2026-03-15T18:30:00.000Z',
|
|
27
|
-
last_active_at: '2026-03-15T18:45:00.000Z'
|
|
28
|
-
});
|
|
29
|
-
expect(entry).toEqual({
|
|
30
|
-
id: 'ai-profile-codex',
|
|
31
|
-
workspaceId: 'workspace-local-active',
|
|
32
|
-
profileToken: 'token-codex',
|
|
33
|
-
name: 'Codex',
|
|
34
|
-
username: 'codex',
|
|
35
|
-
icon: 'Bot',
|
|
36
|
-
color: '#0ea5e9',
|
|
37
|
-
description: 'Terminal-first coding agent',
|
|
38
|
-
role: 'Implementer',
|
|
39
|
-
provider: 'OpenAI',
|
|
40
|
-
model: 'gpt-5.4',
|
|
41
|
-
surfaceType: 'coding_tool',
|
|
42
|
-
seatScope: 'cloud_metered',
|
|
43
|
-
providerMetadata: { source: 'test' },
|
|
44
|
-
archivedAt: '2026-03-16T18:00:00.000Z',
|
|
45
|
-
archivedBy: 'owner-1',
|
|
46
|
-
archivedReason: 'manual_archive',
|
|
47
|
-
mergedIntoProfileId: 'ai-profile-keeper',
|
|
48
|
-
rosterStateUpdatedAt: '2026-03-16T18:00:00.000Z',
|
|
49
|
-
createdAt: '2026-03-15T18:00:00.000Z',
|
|
50
|
-
updatedAt: '2026-03-15T18:30:00.000Z',
|
|
51
|
-
lastActiveAt: '2026-03-15T18:45:00.000Z'
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { act, renderHook, waitFor } from '@testing-library/react';
|
|
3
|
-
import { useSyncOrchestrator } from './useSyncOrchestrator';
|
|
4
|
-
const { ensureCloudWorkspaceReadyForSyncServiceMock, runWorkspacePullSyncServiceMock, runWorkspacePushSyncServiceMock, syncUserGlobalSettingsServiceMock } = vi.hoisted(() => ({
|
|
5
|
-
ensureCloudWorkspaceReadyForSyncServiceMock: vi.fn(),
|
|
6
|
-
runWorkspacePullSyncServiceMock: vi.fn(),
|
|
7
|
-
runWorkspacePushSyncServiceMock: vi.fn(),
|
|
8
|
-
syncUserGlobalSettingsServiceMock: vi.fn()
|
|
9
|
-
}));
|
|
10
|
-
vi.mock('../sync/syncService', async () => {
|
|
11
|
-
const actual = await vi.importActual('../sync/syncService');
|
|
12
|
-
return {
|
|
13
|
-
...actual,
|
|
14
|
-
calculateWorkspaceRetryDelayMs: vi.fn(() => 100),
|
|
15
|
-
ensureCloudWorkspaceReadyForSyncService: ensureCloudWorkspaceReadyForSyncServiceMock,
|
|
16
|
-
runWorkspacePullSyncService: runWorkspacePullSyncServiceMock,
|
|
17
|
-
runWorkspacePushSyncService: runWorkspacePushSyncServiceMock,
|
|
18
|
-
syncUserGlobalSettingsService: syncUserGlobalSettingsServiceMock
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
function buildInput(overrides) {
|
|
22
|
-
return {
|
|
23
|
-
currentWorkspaceId: 'workspace-local-active',
|
|
24
|
-
cloudAuthConfigured: true,
|
|
25
|
-
runtimeMode: 'local',
|
|
26
|
-
authSessionResolved: true,
|
|
27
|
-
isAuthenticated: true,
|
|
28
|
-
authUserId: 'user-1',
|
|
29
|
-
projectName: 'Test Project',
|
|
30
|
-
resolveCloudAuthUrl: (path) => `https://cloud.example.com${path}`,
|
|
31
|
-
resolveWebSocketUrl: (path) => `wss://api.example.com${path}`,
|
|
32
|
-
realtimeSyncEnabled: false,
|
|
33
|
-
tasks: [],
|
|
34
|
-
archivedTasks: [],
|
|
35
|
-
initiatives: [],
|
|
36
|
-
workstreams: [],
|
|
37
|
-
taxonomies: [],
|
|
38
|
-
setupState: null,
|
|
39
|
-
globalTheme: 'dark',
|
|
40
|
-
locale: 'en-US',
|
|
41
|
-
globalWeekStartsOn: 'monday',
|
|
42
|
-
themeUseGlobalDefault: true,
|
|
43
|
-
setTasks: vi.fn(),
|
|
44
|
-
setArchivedTasks: vi.fn(),
|
|
45
|
-
setAuthBlocked: vi.fn(),
|
|
46
|
-
setIsAuthenticated: vi.fn(),
|
|
47
|
-
checkAuthSession: vi.fn(async () => true),
|
|
48
|
-
setGlobalTheme: vi.fn(),
|
|
49
|
-
setCurrentTheme: vi.fn(),
|
|
50
|
-
setSetupState: vi.fn(),
|
|
51
|
-
setLocale: vi.fn(),
|
|
52
|
-
setGlobalWeekStartsOn: vi.fn(),
|
|
53
|
-
fetchPlanningEntities: vi.fn(async () => { }),
|
|
54
|
-
...overrides
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
describe('useSyncOrchestrator context asset refreshes', () => {
|
|
58
|
-
beforeEach(() => {
|
|
59
|
-
ensureCloudWorkspaceReadyForSyncServiceMock.mockReset();
|
|
60
|
-
runWorkspacePullSyncServiceMock.mockReset();
|
|
61
|
-
runWorkspacePushSyncServiceMock.mockReset();
|
|
62
|
-
syncUserGlobalSettingsServiceMock.mockReset();
|
|
63
|
-
ensureCloudWorkspaceReadyForSyncServiceMock.mockResolvedValue({ success: true });
|
|
64
|
-
runWorkspacePullSyncServiceMock.mockResolvedValue({
|
|
65
|
-
success: true,
|
|
66
|
-
syncedAt: '2026-03-15T18:00:00.000Z',
|
|
67
|
-
cursor: null,
|
|
68
|
-
pages: 0,
|
|
69
|
-
appliedChanges: 0,
|
|
70
|
-
pullRequestMs: 1,
|
|
71
|
-
applyMs: 0,
|
|
72
|
-
pulledDeleteTaskIds: new Set(),
|
|
73
|
-
pulledActiveUpserts: false,
|
|
74
|
-
pulledArchivedUpserts: false,
|
|
75
|
-
documentDecryptFailures: []
|
|
76
|
-
});
|
|
77
|
-
runWorkspacePushSyncServiceMock.mockResolvedValue({
|
|
78
|
-
success: true,
|
|
79
|
-
syncedAt: '2026-03-15T18:00:00.000Z',
|
|
80
|
-
requestMs: 1,
|
|
81
|
-
changeCount: 0,
|
|
82
|
-
deleteCount: 0,
|
|
83
|
-
currentTaskIds: new Set(),
|
|
84
|
-
currentInitiativeIds: new Set(),
|
|
85
|
-
currentInitiativeWatermarks: new Map(),
|
|
86
|
-
currentWorkstreamIds: new Set(),
|
|
87
|
-
currentWorkstreamWatermarks: new Map(),
|
|
88
|
-
currentAiProfileIds: new Set(),
|
|
89
|
-
currentAiProfileWatermarks: new Map(),
|
|
90
|
-
currentDocumentPaths: new Set(),
|
|
91
|
-
currentDocumentWatermarks: new Map(),
|
|
92
|
-
currentAssetPaths: new Set(),
|
|
93
|
-
currentAssetWatermarks: new Map(),
|
|
94
|
-
currentDocumentReviewSessionIds: new Set(),
|
|
95
|
-
currentDocumentReviewSessionWatermarks: new Map(),
|
|
96
|
-
currentDocumentReviewCommentIds: new Set(),
|
|
97
|
-
currentDocumentReviewCommentWatermarks: new Map(),
|
|
98
|
-
currentAnnotatedAttachmentSessionIds: new Set(),
|
|
99
|
-
currentAnnotatedAttachmentSessionWatermarks: new Map(),
|
|
100
|
-
currentTaskEventWatermarks: new Map(),
|
|
101
|
-
deleteTaskIds: new Set(),
|
|
102
|
-
pushedWatermarks: new Map(),
|
|
103
|
-
emittedEventIds: []
|
|
104
|
-
});
|
|
105
|
-
syncUserGlobalSettingsServiceMock.mockResolvedValue({
|
|
106
|
-
success: true,
|
|
107
|
-
mode: 'pulled',
|
|
108
|
-
updatedAt: new Date().toISOString()
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
afterEach(() => {
|
|
112
|
-
vi.unstubAllGlobals();
|
|
113
|
-
vi.clearAllMocks();
|
|
114
|
-
});
|
|
115
|
-
it('refreshes only document and asset snapshots when task attachments change', async () => {
|
|
116
|
-
const fetchCounts = {
|
|
117
|
-
documents: 0,
|
|
118
|
-
assets: 0,
|
|
119
|
-
aiProfiles: 0,
|
|
120
|
-
documentReviews: 0,
|
|
121
|
-
annotatedAttachments: 0
|
|
122
|
-
};
|
|
123
|
-
vi.stubGlobal('fetch', vi.fn((url, init) => {
|
|
124
|
-
if (url.includes('/api/taskforce/ui-state?key=workspace-sync')) {
|
|
125
|
-
return Promise.resolve({
|
|
126
|
-
ok: true,
|
|
127
|
-
json: () => Promise.resolve({
|
|
128
|
-
success: true,
|
|
129
|
-
state: {
|
|
130
|
-
version: 2,
|
|
131
|
-
enabled: true,
|
|
132
|
-
phase: 'active',
|
|
133
|
-
pullCursor: null,
|
|
134
|
-
lastPullAt: null,
|
|
135
|
-
lastPushAt: null,
|
|
136
|
-
lastSyncedAt: null
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
if (url.includes('/api/taskforce/ui-state') && String(init?.method || '').toUpperCase() === 'POST') {
|
|
142
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ success: true }) });
|
|
143
|
-
}
|
|
144
|
-
if (url.includes('/api/taskforce/sync/workspace/documents')) {
|
|
145
|
-
fetchCounts.documents += 1;
|
|
146
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ documents: [] }) });
|
|
147
|
-
}
|
|
148
|
-
if (url.includes('/api/taskforce/sync/workspace/assets')) {
|
|
149
|
-
fetchCounts.assets += 1;
|
|
150
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ assets: [] }) });
|
|
151
|
-
}
|
|
152
|
-
if (url.includes('/api/taskforce/sync/workspace/ai-profiles')) {
|
|
153
|
-
fetchCounts.aiProfiles += 1;
|
|
154
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ aiProfiles: [] }) });
|
|
155
|
-
}
|
|
156
|
-
if (url.includes('/api/taskforce/sync/workspace/document-reviews')) {
|
|
157
|
-
fetchCounts.documentReviews += 1;
|
|
158
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ sessions: [], comments: [] }) });
|
|
159
|
-
}
|
|
160
|
-
if (url.includes('/api/taskforce/sync/workspace/annotated-attachments')) {
|
|
161
|
-
fetchCounts.annotatedAttachments += 1;
|
|
162
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ sessions: [] }) });
|
|
163
|
-
}
|
|
164
|
-
if (url.includes('/api/taskforce/sync/events')) {
|
|
165
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ success: true }) });
|
|
166
|
-
}
|
|
167
|
-
if (url.includes('/api/taskforce/tasks')) {
|
|
168
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ tasks: [] }) });
|
|
169
|
-
}
|
|
170
|
-
if (url.includes('/api/taskforce/archive')) {
|
|
171
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ archived: [] }) });
|
|
172
|
-
}
|
|
173
|
-
return Promise.resolve({ ok: true, json: () => Promise.resolve({ success: true }) });
|
|
174
|
-
}));
|
|
175
|
-
const baseTask = {
|
|
176
|
-
id: 'task-with-attachments',
|
|
177
|
-
title: 'Task with attachment refreshes',
|
|
178
|
-
description: '',
|
|
179
|
-
category: 'general',
|
|
180
|
-
type: 'task',
|
|
181
|
-
priority: 2,
|
|
182
|
-
complexity: 3,
|
|
183
|
-
status: 'task',
|
|
184
|
-
createdAt: '2026-03-15T12:00:00.000Z',
|
|
185
|
-
updatedAt: '2026-03-15T12:00:00.000Z',
|
|
186
|
-
attachments: [],
|
|
187
|
-
taskEvents: []
|
|
188
|
-
};
|
|
189
|
-
const initialInput = buildInput({
|
|
190
|
-
tasks: [baseTask]
|
|
191
|
-
});
|
|
192
|
-
const { result, rerender, unmount } = renderHook((props) => useSyncOrchestrator(props), {
|
|
193
|
-
initialProps: initialInput
|
|
194
|
-
});
|
|
195
|
-
act(() => {
|
|
196
|
-
result.current.applyWorkspaceSyncStateSnapshot({
|
|
197
|
-
enabled: true,
|
|
198
|
-
phase: 'active',
|
|
199
|
-
pullCursor: null
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
await waitFor(() => {
|
|
203
|
-
expect(fetchCounts.documents).toBeGreaterThan(0);
|
|
204
|
-
expect(fetchCounts.assets).toBeGreaterThan(0);
|
|
205
|
-
expect(fetchCounts.aiProfiles).toBeGreaterThan(0);
|
|
206
|
-
expect(fetchCounts.documentReviews).toBeGreaterThan(0);
|
|
207
|
-
});
|
|
208
|
-
const baselineCounts = { ...fetchCounts };
|
|
209
|
-
rerender({
|
|
210
|
-
...initialInput,
|
|
211
|
-
tasks: [{
|
|
212
|
-
...baseTask,
|
|
213
|
-
attachments: [{
|
|
214
|
-
id: 'asset-1',
|
|
215
|
-
path: 'workspaces/workspace-local-active/assets/file.txt'
|
|
216
|
-
}]
|
|
217
|
-
}]
|
|
218
|
-
});
|
|
219
|
-
await waitFor(() => {
|
|
220
|
-
expect(fetchCounts.documents).toBeGreaterThan(baselineCounts.documents);
|
|
221
|
-
expect(fetchCounts.assets).toBeGreaterThan(baselineCounts.assets);
|
|
222
|
-
});
|
|
223
|
-
expect(fetchCounts.aiProfiles).toBe(baselineCounts.aiProfiles);
|
|
224
|
-
expect(fetchCounts.documentReviews).toBe(baselineCounts.documentReviews);
|
|
225
|
-
expect(fetchCounts.annotatedAttachments).toBe(baselineCounts.annotatedAttachments);
|
|
226
|
-
unmount();
|
|
227
|
-
});
|
|
228
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|