@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,532 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
-
import { Readable, Writable } from 'stream';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import os from 'os';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { TaskforceCore } from '../core/Taskforce.js';
|
|
7
|
-
import { createRoutes, matchRoute } from './routes.js';
|
|
8
|
-
import { registerAnnotatedAttachmentRoutes } from './routes/annotatedAttachments.js';
|
|
9
|
-
import { ANNOTATED_ATTACHMENTS_WORKSPACE_FEATURE_KEY, APP_GATE_DEFINITIONS, } from '../runtime/appGates.js';
|
|
10
|
-
import { TaskforceRuleError } from '../core/Taskforce.js';
|
|
11
|
-
function createProjectRoot() {
|
|
12
|
-
return fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-annotated-attachment-routes-'));
|
|
13
|
-
}
|
|
14
|
-
function createMockReq(method, url, body, headers) {
|
|
15
|
-
const req = new Readable();
|
|
16
|
-
req._read = () => { };
|
|
17
|
-
if (body === undefined) {
|
|
18
|
-
req.push(null);
|
|
19
|
-
}
|
|
20
|
-
else if (typeof body === 'string') {
|
|
21
|
-
req.push(body);
|
|
22
|
-
req.push(null);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
req.push(JSON.stringify(body));
|
|
26
|
-
req.push(null);
|
|
27
|
-
}
|
|
28
|
-
req.method = method;
|
|
29
|
-
req.url = url;
|
|
30
|
-
req.headers = headers || {};
|
|
31
|
-
return req;
|
|
32
|
-
}
|
|
33
|
-
function createMockRes() {
|
|
34
|
-
const bodyChunks = [];
|
|
35
|
-
let writableEnded = false;
|
|
36
|
-
const headers = new Map();
|
|
37
|
-
const res = new Writable({
|
|
38
|
-
write(chunk, _encoding, callback) {
|
|
39
|
-
bodyChunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));
|
|
40
|
-
callback();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
res.statusCode = 200;
|
|
44
|
-
Object.defineProperty(res, 'writableEnded', {
|
|
45
|
-
configurable: true,
|
|
46
|
-
get: () => writableEnded,
|
|
47
|
-
});
|
|
48
|
-
res.writeHead = ((statusCode, nextHeaders) => {
|
|
49
|
-
res.statusCode = statusCode;
|
|
50
|
-
if (nextHeaders) {
|
|
51
|
-
for (const [key, value] of Object.entries(nextHeaders)) {
|
|
52
|
-
headers.set(key.toLowerCase(), value);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return res;
|
|
56
|
-
});
|
|
57
|
-
res.setHeader = ((name, value) => {
|
|
58
|
-
headers.set(name.toLowerCase(), value);
|
|
59
|
-
});
|
|
60
|
-
res.getHeader = ((name) => headers.get(name.toLowerCase()));
|
|
61
|
-
const originalEnd = res.end.bind(res);
|
|
62
|
-
res.end = ((chunk) => {
|
|
63
|
-
if (chunk !== undefined) {
|
|
64
|
-
bodyChunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk)));
|
|
65
|
-
}
|
|
66
|
-
writableEnded = true;
|
|
67
|
-
return originalEnd();
|
|
68
|
-
});
|
|
69
|
-
res.__getBody = () => Buffer.concat(bodyChunks).toString('utf8');
|
|
70
|
-
return res;
|
|
71
|
-
}
|
|
72
|
-
describe('annotated attachment routes', () => {
|
|
73
|
-
let previousGateEnabled = false;
|
|
74
|
-
beforeEach(() => {
|
|
75
|
-
previousGateEnabled = APP_GATE_DEFINITIONS[ANNOTATED_ATTACHMENTS_WORKSPACE_FEATURE_KEY].enabled;
|
|
76
|
-
APP_GATE_DEFINITIONS[ANNOTATED_ATTACHMENTS_WORKSPACE_FEATURE_KEY].enabled = true;
|
|
77
|
-
});
|
|
78
|
-
afterEach(() => {
|
|
79
|
-
APP_GATE_DEFINITIONS[ANNOTATED_ATTACHMENTS_WORKSPACE_FEATURE_KEY].enabled = previousGateEnabled;
|
|
80
|
-
});
|
|
81
|
-
it('creates, lists, updates, and reads annotated attachment session payloads', async () => {
|
|
82
|
-
const projectRoot = createProjectRoot();
|
|
83
|
-
const core = new TaskforceCore({
|
|
84
|
-
projectRoot,
|
|
85
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
86
|
-
});
|
|
87
|
-
try {
|
|
88
|
-
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
89
|
-
const category = core.getCategories()[0]?.value;
|
|
90
|
-
const type = core.getTypes()[0]?.value;
|
|
91
|
-
const task = core.createTask({ title: 'Review image', category, type }, { workspaceId: 'workspace-1', actorRef: 'owner-1' });
|
|
92
|
-
const assetStore = core.getWorkspaceAssetStore();
|
|
93
|
-
assetStore.upsertAsset({
|
|
94
|
-
assetId: 'asset-image-1',
|
|
95
|
-
workspaceId: 'workspace-1',
|
|
96
|
-
kind: 'image',
|
|
97
|
-
originalFilename: 'ui-review.png',
|
|
98
|
-
logicalName: 'UI Review',
|
|
99
|
-
mimeType: 'image/png',
|
|
100
|
-
storageProvider: 'local',
|
|
101
|
-
storageKey: 'workspaces/workspace-1/assets/images/asset-image-1-ui-review.png',
|
|
102
|
-
contentSha256: 'sha-image-1',
|
|
103
|
-
sizeBytes: 256,
|
|
104
|
-
});
|
|
105
|
-
assetStore.upsertLink({
|
|
106
|
-
workspaceId: 'workspace-1',
|
|
107
|
-
assetId: 'asset-image-1',
|
|
108
|
-
taskId: task.id,
|
|
109
|
-
role: 'attachment',
|
|
110
|
-
});
|
|
111
|
-
const routes = createRoutes(core);
|
|
112
|
-
const createMatch = matchRoute('POST', '/api/taskforce/annotated-attachments/sessions', routes);
|
|
113
|
-
const createReq = createMockReq('POST', '/api/taskforce/annotated-attachments/sessions?workspaceId=workspace-1', {
|
|
114
|
-
taskId: task.id,
|
|
115
|
-
baseImageAssetId: 'asset-image-1',
|
|
116
|
-
title: 'Homepage review',
|
|
117
|
-
globalInstruction: 'Answer each marker in order.',
|
|
118
|
-
annotations: [
|
|
119
|
-
{
|
|
120
|
-
id: 'marker-1',
|
|
121
|
-
kind: 'pin',
|
|
122
|
-
order: 0,
|
|
123
|
-
markerType: 'question',
|
|
124
|
-
instruction: 'What should change here?',
|
|
125
|
-
x: 0.2,
|
|
126
|
-
y: 0.3,
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
}, { 'x-taskforce-user-id': 'owner-1' });
|
|
130
|
-
const createRes = createMockRes();
|
|
131
|
-
await createMatch?.handler(createReq, createRes, {});
|
|
132
|
-
expect(createRes.statusCode).toBe(200);
|
|
133
|
-
const created = JSON.parse(createRes.__getBody());
|
|
134
|
-
expect(created.success).toBe(true);
|
|
135
|
-
expect(created.session).toMatchObject({
|
|
136
|
-
taskId: task.id,
|
|
137
|
-
baseImageAssetId: 'asset-image-1',
|
|
138
|
-
title: 'Homepage review',
|
|
139
|
-
globalInstruction: 'Answer each marker in order.',
|
|
140
|
-
});
|
|
141
|
-
const sessionId = String(created.session.id);
|
|
142
|
-
const listMatch = matchRoute('GET', '/api/taskforce/annotated-attachments/sessions', routes);
|
|
143
|
-
const listReq = createMockReq('GET', `/api/taskforce/annotated-attachments/sessions?workspaceId=workspace-1&taskId=${encodeURIComponent(task.id)}&imageAssetId=asset-image-1`);
|
|
144
|
-
const listRes = createMockRes();
|
|
145
|
-
await listMatch?.handler(listReq, listRes, {});
|
|
146
|
-
const listed = JSON.parse(listRes.__getBody());
|
|
147
|
-
expect(listRes.statusCode).toBe(200);
|
|
148
|
-
expect(listed.sessions).toHaveLength(1);
|
|
149
|
-
expect(listed.sessions[0].id).toBe(sessionId);
|
|
150
|
-
const patchMatch = matchRoute('PATCH', `/api/taskforce/annotated-attachments/sessions/${sessionId}`, routes);
|
|
151
|
-
const patchReq = createMockReq('PATCH', `/api/taskforce/annotated-attachments/sessions/${sessionId}?workspaceId=workspace-1`, {
|
|
152
|
-
title: 'Homepage review revised',
|
|
153
|
-
annotations: [
|
|
154
|
-
{
|
|
155
|
-
id: 'marker-1',
|
|
156
|
-
kind: 'box',
|
|
157
|
-
order: 0,
|
|
158
|
-
markerType: 'issue',
|
|
159
|
-
instruction: 'Review this whole panel.',
|
|
160
|
-
x: 0.1,
|
|
161
|
-
y: 0.15,
|
|
162
|
-
width: 0.3,
|
|
163
|
-
height: 0.2,
|
|
164
|
-
}
|
|
165
|
-
],
|
|
166
|
-
}, { 'x-taskforce-user-id': 'owner-1' });
|
|
167
|
-
const patchRes = createMockRes();
|
|
168
|
-
await patchMatch?.handler(patchReq, patchRes, { id: sessionId });
|
|
169
|
-
const patched = JSON.parse(patchRes.__getBody());
|
|
170
|
-
expect(patchRes.statusCode).toBe(200);
|
|
171
|
-
expect(patched.session.title).toBe('Homepage review revised');
|
|
172
|
-
expect(patched.session.annotations[0]).toMatchObject({
|
|
173
|
-
kind: 'box',
|
|
174
|
-
instruction: 'Review this whole panel.',
|
|
175
|
-
});
|
|
176
|
-
const payloadMatch = matchRoute('GET', `/api/taskforce/annotated-attachments/sessions/${sessionId}/payload`, routes);
|
|
177
|
-
const payloadReq = createMockReq('GET', `/api/taskforce/annotated-attachments/sessions/${sessionId}/payload?workspaceId=workspace-1`);
|
|
178
|
-
const payloadRes = createMockRes();
|
|
179
|
-
await payloadMatch?.handler(payloadReq, payloadRes, { id: sessionId });
|
|
180
|
-
const payload = JSON.parse(payloadRes.__getBody());
|
|
181
|
-
expect(payloadRes.statusCode).toBe(200);
|
|
182
|
-
expect(payload.payload).toMatchObject({
|
|
183
|
-
taskId: task.id,
|
|
184
|
-
sessionId,
|
|
185
|
-
title: 'Homepage review revised',
|
|
186
|
-
image: {
|
|
187
|
-
assetId: 'asset-image-1',
|
|
188
|
-
referenceLabel: 'I-1',
|
|
189
|
-
apiUrl: '/api/taskforce/context/workspaces%2Fworkspace-1%2Fassets%2Fimages%2Fasset-image-1-ui-review.png',
|
|
190
|
-
},
|
|
191
|
-
});
|
|
192
|
-
expect(payload.payload.annotations[0].cropHint.x).toBeCloseTo(0.06, 10);
|
|
193
|
-
expect(payload.payload.annotations[0].cropHint.y).toBeCloseTo(0.11, 10);
|
|
194
|
-
expect(payload.payload.annotations[0].cropHint.width).toBeCloseTo(0.38, 10);
|
|
195
|
-
expect(payload.payload.annotations[0].cropHint.height).toBeCloseTo(0.28, 10);
|
|
196
|
-
}
|
|
197
|
-
finally {
|
|
198
|
-
core.close();
|
|
199
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
it('lists canonical image assets for the Image Notes tray', async () => {
|
|
203
|
-
const projectRoot = createProjectRoot();
|
|
204
|
-
const core = new TaskforceCore({
|
|
205
|
-
projectRoot,
|
|
206
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
207
|
-
});
|
|
208
|
-
try {
|
|
209
|
-
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
210
|
-
const category = core.getCategories()[0]?.value;
|
|
211
|
-
const type = core.getTypes()[0]?.value;
|
|
212
|
-
const task = core.createTask({ title: 'Review image', category, type }, { workspaceId: 'workspace-1', actorRef: 'owner-1' });
|
|
213
|
-
const assetStore = core.getWorkspaceAssetStore();
|
|
214
|
-
const asset = assetStore.upsertAsset({
|
|
215
|
-
assetId: 'asset-image-1',
|
|
216
|
-
workspaceId: 'workspace-1',
|
|
217
|
-
kind: 'image',
|
|
218
|
-
originalFilename: 'ui-review.png',
|
|
219
|
-
logicalName: 'UI Review',
|
|
220
|
-
mimeType: 'image/png',
|
|
221
|
-
storageProvider: 'local',
|
|
222
|
-
storageKey: 'workspaces/workspace-1/assets/images/asset-image-1-ui-review.png',
|
|
223
|
-
contentSha256: 'sha-image-1',
|
|
224
|
-
sizeBytes: 256,
|
|
225
|
-
});
|
|
226
|
-
assetStore.upsertLink({
|
|
227
|
-
workspaceId: 'workspace-1',
|
|
228
|
-
assetId: asset.assetId,
|
|
229
|
-
taskId: task.id,
|
|
230
|
-
role: 'attachment',
|
|
231
|
-
});
|
|
232
|
-
core.createAnnotatedAttachmentSession({
|
|
233
|
-
workspaceId: 'workspace-1',
|
|
234
|
-
taskId: '',
|
|
235
|
-
baseImageAssetId: asset.assetId,
|
|
236
|
-
title: 'UI Review session',
|
|
237
|
-
actorId: 'owner-1',
|
|
238
|
-
});
|
|
239
|
-
const routes = createRoutes(core);
|
|
240
|
-
const listImagesMatch = matchRoute('GET', '/api/taskforce/annotated-attachments/images', routes);
|
|
241
|
-
const listImagesReq = createMockReq('GET', '/api/taskforce/annotated-attachments/images?workspaceId=workspace-1');
|
|
242
|
-
const listImagesRes = createMockRes();
|
|
243
|
-
await listImagesMatch?.handler(listImagesReq, listImagesRes, {});
|
|
244
|
-
expect(listImagesRes.statusCode).toBe(200);
|
|
245
|
-
expect(listImagesRes.getHeader('cache-control')).toBe('no-store');
|
|
246
|
-
const listed = JSON.parse(listImagesRes.__getBody());
|
|
247
|
-
expect(listed.images).toHaveLength(1);
|
|
248
|
-
expect(listed.images[0]).toMatchObject({
|
|
249
|
-
assetId: asset.assetId,
|
|
250
|
-
displayName: 'UI Review',
|
|
251
|
-
path: '/api/taskforce/context/workspaces%2Fworkspace-1%2Fassets%2Fimages%2Fasset-image-1-ui-review.png',
|
|
252
|
-
attachmentCount: 1,
|
|
253
|
-
sessionCount: 1,
|
|
254
|
-
taskId: task.id,
|
|
255
|
-
taskReferenceLabel: task.referenceLabel,
|
|
256
|
-
});
|
|
257
|
-
expect(listed.images[0].imageReferenceLabel).toMatch(/^I-\d+$/);
|
|
258
|
-
}
|
|
259
|
-
finally {
|
|
260
|
-
core.close();
|
|
261
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
it('rejects local mutation attribution when only an active workspace user fallback is available', async () => {
|
|
265
|
-
const projectRoot = createProjectRoot();
|
|
266
|
-
const core = new TaskforceCore({
|
|
267
|
-
projectRoot,
|
|
268
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
269
|
-
});
|
|
270
|
-
try {
|
|
271
|
-
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
272
|
-
const now = new Date().toISOString();
|
|
273
|
-
core.db.prepare(`
|
|
274
|
-
INSERT INTO users (id, tenant_id, email, display_name, beta_access, is_disabled, created_at, updated_at)
|
|
275
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
276
|
-
`).run('user-local-1', core.getTenantId(), 'local@example.com', 'Local User', 1, 0, now, now);
|
|
277
|
-
core.db.prepare(`
|
|
278
|
-
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
279
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
280
|
-
`).run('membership-local-1', core.getTenantId(), 'workspace-1', 'user-local-1', 'owner', 'active', now, now);
|
|
281
|
-
core.getWorkspaceAssetStore().upsertAsset({
|
|
282
|
-
assetId: 'asset-image-1',
|
|
283
|
-
workspaceId: 'workspace-1',
|
|
284
|
-
kind: 'image',
|
|
285
|
-
originalFilename: 'ui-review.png',
|
|
286
|
-
logicalName: 'UI Review',
|
|
287
|
-
mimeType: 'image/png',
|
|
288
|
-
storageProvider: 'local',
|
|
289
|
-
storageKey: 'workspaces/workspace-1/assets/images/asset-image-1-ui-review.png',
|
|
290
|
-
contentSha256: 'sha-image-1',
|
|
291
|
-
sizeBytes: 256,
|
|
292
|
-
});
|
|
293
|
-
const routes = createRoutes(core, {
|
|
294
|
-
authConfig: {
|
|
295
|
-
runtimeMode: 'local',
|
|
296
|
-
enabled: true,
|
|
297
|
-
requiredForApi: false,
|
|
298
|
-
excludedPaths: [],
|
|
299
|
-
defaultRole: 'member',
|
|
300
|
-
defaultWorkspaceId: 'default',
|
|
301
|
-
sessionCookieName: 'taskforce_session',
|
|
302
|
-
sessionSecret: 'test-secret',
|
|
303
|
-
sessionTtlSeconds: 3600,
|
|
304
|
-
sessionCookieSameSite: 'Lax',
|
|
305
|
-
sessionCookieSecure: false,
|
|
306
|
-
},
|
|
307
|
-
});
|
|
308
|
-
const createMatch = matchRoute('POST', '/api/taskforce/annotated-attachments/sessions', routes);
|
|
309
|
-
const createReq = createMockReq('POST', '/api/taskforce/annotated-attachments/sessions?workspaceId=workspace-1', {
|
|
310
|
-
taskId: '',
|
|
311
|
-
baseImageAssetId: 'asset-image-1',
|
|
312
|
-
title: 'Fallback session',
|
|
313
|
-
annotations: [],
|
|
314
|
-
});
|
|
315
|
-
const createRes = createMockRes();
|
|
316
|
-
await createMatch?.handler(createReq, createRes, {});
|
|
317
|
-
expect(createRes.statusCode).toBe(401);
|
|
318
|
-
expect(JSON.parse(createRes.__getBody())).toMatchObject({
|
|
319
|
-
success: false,
|
|
320
|
-
code: 'MUTATION_AUTH_REQUIRED',
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
finally {
|
|
324
|
-
core.close();
|
|
325
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
it('rejects session creation when mutation identity is unresolved', async () => {
|
|
329
|
-
const projectRoot = createProjectRoot();
|
|
330
|
-
const core = new TaskforceCore({
|
|
331
|
-
projectRoot,
|
|
332
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
333
|
-
});
|
|
334
|
-
try {
|
|
335
|
-
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
336
|
-
const routes = [];
|
|
337
|
-
registerAnnotatedAttachmentRoutes({
|
|
338
|
-
addRoute: (method, path, handler) => {
|
|
339
|
-
const keys = [];
|
|
340
|
-
const pattern = new RegExp(`^${`${method}:${path}`.replace(/:([^/]+)/g, (_match, key) => {
|
|
341
|
-
keys.push(key);
|
|
342
|
-
return '([^/]+)';
|
|
343
|
-
})}$`);
|
|
344
|
-
routes.push({ pattern, keys, handler });
|
|
345
|
-
},
|
|
346
|
-
core,
|
|
347
|
-
requestWorkspaceId: () => 'workspace-1',
|
|
348
|
-
resolveAuthenticatedUserId: () => {
|
|
349
|
-
throw new TaskforceRuleError('Authenticated user required for mutation attribution.', 401, 'MUTATION_AUTH_REQUIRED');
|
|
350
|
-
},
|
|
351
|
-
ensureAppAccess: () => true,
|
|
352
|
-
});
|
|
353
|
-
const createMatch = matchRoute('POST', '/api/taskforce/annotated-attachments/sessions', routes);
|
|
354
|
-
const createReq = createMockReq('POST', '/api/taskforce/annotated-attachments/sessions?workspaceId=workspace-1', {
|
|
355
|
-
taskId: '',
|
|
356
|
-
baseImageAssetId: 'asset-image-1',
|
|
357
|
-
title: 'Should fail',
|
|
358
|
-
annotations: [],
|
|
359
|
-
});
|
|
360
|
-
const createRes = createMockRes();
|
|
361
|
-
await createMatch?.handler(createReq, createRes, {});
|
|
362
|
-
expect(createRes.statusCode).toBe(401);
|
|
363
|
-
expect(JSON.parse(createRes.__getBody())).toMatchObject({
|
|
364
|
-
success: false,
|
|
365
|
-
code: 'MUTATION_AUTH_REQUIRED',
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
finally {
|
|
369
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
it('resolves an image target by image reference label', async () => {
|
|
373
|
-
const projectRoot = createProjectRoot();
|
|
374
|
-
const core = new TaskforceCore({
|
|
375
|
-
projectRoot,
|
|
376
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
377
|
-
});
|
|
378
|
-
try {
|
|
379
|
-
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
380
|
-
const category = core.getCategories()[0]?.value;
|
|
381
|
-
const type = core.getTypes()[0]?.value;
|
|
382
|
-
const task = core.createTask({ title: 'Reference image task', category, type }, { workspaceId: 'workspace-1', actorRef: 'owner-1' });
|
|
383
|
-
const assetStore = core.getWorkspaceAssetStore();
|
|
384
|
-
assetStore.upsertAsset({
|
|
385
|
-
assetId: 'asset-image-24',
|
|
386
|
-
workspaceId: 'workspace-1',
|
|
387
|
-
kind: 'image',
|
|
388
|
-
originalFilename: 'reference-image.png',
|
|
389
|
-
logicalName: 'Reference image',
|
|
390
|
-
mimeType: 'image/png',
|
|
391
|
-
storageProvider: 'local',
|
|
392
|
-
storageKey: 'workspaces/workspace-1/assets/images/asset-image-24-reference-image.png',
|
|
393
|
-
contentSha256: 'sha-image-24',
|
|
394
|
-
sizeBytes: 256,
|
|
395
|
-
referenceNumber: 24,
|
|
396
|
-
});
|
|
397
|
-
assetStore.upsertLink({
|
|
398
|
-
workspaceId: 'workspace-1',
|
|
399
|
-
assetId: 'asset-image-24',
|
|
400
|
-
taskId: task.id,
|
|
401
|
-
role: 'image',
|
|
402
|
-
});
|
|
403
|
-
const routes = createRoutes(core);
|
|
404
|
-
const match = matchRoute('GET', '/api/taskforce/annotated-attachments/images/I-24', routes);
|
|
405
|
-
const req = createMockReq('GET', '/api/taskforce/annotated-attachments/images/I-24?workspaceId=workspace-1');
|
|
406
|
-
const res = createMockRes();
|
|
407
|
-
await match?.handler(req, res, { reference: 'I-24' });
|
|
408
|
-
expect(res.statusCode).toBe(200);
|
|
409
|
-
expect(JSON.parse(res.__getBody())).toEqual({
|
|
410
|
-
target: expect.objectContaining({
|
|
411
|
-
assetId: 'asset-image-24',
|
|
412
|
-
taskId: task.id,
|
|
413
|
-
taskReferenceLabel: task.referenceLabel,
|
|
414
|
-
imageReferenceLabel: 'I-24',
|
|
415
|
-
path: '/api/taskforce/context/workspaces%2Fworkspace-1%2Fassets%2Fimages%2Fasset-image-24-reference-image.png',
|
|
416
|
-
displayName: 'Reference image',
|
|
417
|
-
}),
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
finally {
|
|
421
|
-
core.close();
|
|
422
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
423
|
-
}
|
|
424
|
-
});
|
|
425
|
-
it('resolves an image target by canonical asset id without requiring a task link', async () => {
|
|
426
|
-
const projectRoot = createProjectRoot();
|
|
427
|
-
const core = new TaskforceCore({
|
|
428
|
-
projectRoot,
|
|
429
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
430
|
-
});
|
|
431
|
-
try {
|
|
432
|
-
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
433
|
-
core.getWorkspaceAssetStore().upsertAsset({
|
|
434
|
-
assetId: 'asset-image-42',
|
|
435
|
-
workspaceId: 'workspace-1',
|
|
436
|
-
kind: 'image',
|
|
437
|
-
originalFilename: 'standalone-image.png',
|
|
438
|
-
logicalName: 'Standalone image',
|
|
439
|
-
mimeType: 'image/png',
|
|
440
|
-
storageProvider: 'local',
|
|
441
|
-
storageKey: 'workspaces/workspace-1/assets/images/asset-image-42-standalone-image.png',
|
|
442
|
-
contentSha256: 'sha-image-42',
|
|
443
|
-
sizeBytes: 256,
|
|
444
|
-
referenceNumber: 42,
|
|
445
|
-
});
|
|
446
|
-
const routes = createRoutes(core);
|
|
447
|
-
const match = matchRoute('GET', '/api/taskforce/annotated-attachments/images/asset-image-42', routes);
|
|
448
|
-
const req = createMockReq('GET', '/api/taskforce/annotated-attachments/images/asset-image-42?workspaceId=workspace-1');
|
|
449
|
-
const res = createMockRes();
|
|
450
|
-
await match?.handler(req, res, { reference: 'asset-image-42' });
|
|
451
|
-
expect(res.statusCode).toBe(200);
|
|
452
|
-
expect(JSON.parse(res.__getBody())).toEqual({
|
|
453
|
-
target: expect.objectContaining({
|
|
454
|
-
assetId: 'asset-image-42',
|
|
455
|
-
taskId: null,
|
|
456
|
-
taskReferenceLabel: null,
|
|
457
|
-
imageReferenceLabel: 'I-42',
|
|
458
|
-
path: '/api/taskforce/context/workspaces%2Fworkspace-1%2Fassets%2Fimages%2Fasset-image-42-standalone-image.png',
|
|
459
|
-
displayName: 'Standalone image',
|
|
460
|
-
}),
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
finally {
|
|
464
|
-
core.close();
|
|
465
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
it('rejects access when the annotated attachments gate is disabled', async () => {
|
|
469
|
-
APP_GATE_DEFINITIONS[ANNOTATED_ATTACHMENTS_WORKSPACE_FEATURE_KEY].enabled = false;
|
|
470
|
-
const projectRoot = createProjectRoot();
|
|
471
|
-
const core = new TaskforceCore({
|
|
472
|
-
projectRoot,
|
|
473
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
474
|
-
});
|
|
475
|
-
try {
|
|
476
|
-
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
477
|
-
const routes = createRoutes(core);
|
|
478
|
-
const match = matchRoute('GET', '/api/taskforce/annotated-attachments/sessions', routes);
|
|
479
|
-
const req = createMockReq('GET', '/api/taskforce/annotated-attachments/sessions?workspaceId=workspace-1&taskId=task-1');
|
|
480
|
-
const res = createMockRes();
|
|
481
|
-
await match?.handler(req, res, {});
|
|
482
|
-
expect(res.statusCode).toBe(403);
|
|
483
|
-
const body = JSON.parse(res.__getBody());
|
|
484
|
-
expect(body.error).toBe('Annotated attachments are unavailable for this workspace.');
|
|
485
|
-
expect(typeof body.code).toBe('string');
|
|
486
|
-
}
|
|
487
|
-
finally {
|
|
488
|
-
core.close();
|
|
489
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
490
|
-
}
|
|
491
|
-
});
|
|
492
|
-
it('uses the authenticated user resolver for created session actors', async () => {
|
|
493
|
-
const handlers = new Map();
|
|
494
|
-
const core = {
|
|
495
|
-
createAnnotatedAttachmentSession: (input) => ({
|
|
496
|
-
id: 'session-1',
|
|
497
|
-
workspaceId: input.workspaceId,
|
|
498
|
-
taskId: input.taskId,
|
|
499
|
-
baseImageAssetId: input.baseImageAssetId,
|
|
500
|
-
title: input.title,
|
|
501
|
-
globalInstruction: input.globalInstruction,
|
|
502
|
-
annotations: input.annotations,
|
|
503
|
-
createdByActorId: input.actorId,
|
|
504
|
-
updatedByActorId: input.actorId,
|
|
505
|
-
}),
|
|
506
|
-
};
|
|
507
|
-
registerAnnotatedAttachmentRoutes({
|
|
508
|
-
addRoute: (method, routePath, handler) => {
|
|
509
|
-
handlers.set(`${method} ${routePath}`, handler);
|
|
510
|
-
},
|
|
511
|
-
core,
|
|
512
|
-
requestWorkspaceId: () => 'workspace-1',
|
|
513
|
-
resolveAuthenticatedUserId: () => 'ross.burke',
|
|
514
|
-
ensureAppAccess: () => true,
|
|
515
|
-
});
|
|
516
|
-
const handler = handlers.get('POST /api/taskforce/annotated-attachments/sessions');
|
|
517
|
-
expect(handler).toBeDefined();
|
|
518
|
-
const req = createMockReq('POST', '/api/taskforce/annotated-attachments/sessions?workspaceId=workspace-1', {
|
|
519
|
-
taskId: 'task-1',
|
|
520
|
-
baseImageAssetId: 'asset-image-1',
|
|
521
|
-
title: 'Homepage review',
|
|
522
|
-
globalInstruction: '',
|
|
523
|
-
annotations: [],
|
|
524
|
-
});
|
|
525
|
-
const res = createMockRes();
|
|
526
|
-
await handler?.(req, res, {});
|
|
527
|
-
expect(res.statusCode).toBe(200);
|
|
528
|
-
const payload = JSON.parse(res.__getBody());
|
|
529
|
-
expect(payload.session.createdByActorId).toBe('ross.burke');
|
|
530
|
-
expect(payload.session.updatedByActorId).toBe('ross.burke');
|
|
531
|
-
});
|
|
532
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/server/auth.test.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { createClearSessionCookie, createSessionTokenCookie, hasValidSession, isRequestAuthorized, resolveAuthConfigFromEnv, resolveRequestAccess, resolveSessionCookieAttributesForRequest } from './auth';
|
|
3
|
-
function mockReq(url, headers = {}) {
|
|
4
|
-
return {
|
|
5
|
-
url,
|
|
6
|
-
headers,
|
|
7
|
-
socket: { encrypted: false }
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
describe('server/auth', () => {
|
|
11
|
-
it('defaults to disabled auth when no explicit config in local mode', () => {
|
|
12
|
-
const config = resolveAuthConfigFromEnv('local', {});
|
|
13
|
-
expect(config.enabled).toBe(false);
|
|
14
|
-
expect(config.requiredForApi).toBe(false);
|
|
15
|
-
expect(config.sessionCookieSecure).toBe(false);
|
|
16
|
-
expect(config.excludedPaths).toEqual([
|
|
17
|
-
'/api/taskforce/health',
|
|
18
|
-
'/api/taskforce/version',
|
|
19
|
-
'/api/taskforce/auth',
|
|
20
|
-
'/api/taskforce/public/pricing',
|
|
21
|
-
'/api/taskforce/public/site-config',
|
|
22
|
-
'/api/taskforce/public/site-config-script'
|
|
23
|
-
]);
|
|
24
|
-
});
|
|
25
|
-
it('defaults to auth-required in cloud mode', () => {
|
|
26
|
-
const config = resolveAuthConfigFromEnv('cloud', {});
|
|
27
|
-
expect(config.enabled).toBe(true);
|
|
28
|
-
expect(config.requiredForApi).toBe(true);
|
|
29
|
-
expect(config.sessionCookieSecure).toBe(true);
|
|
30
|
-
});
|
|
31
|
-
it('infers a shared cookie domain for official cloud environments', () => {
|
|
32
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
33
|
-
TASKFORCE_CLOUD_ENVIRONMENT: 'performance'
|
|
34
|
-
});
|
|
35
|
-
expect(config.sessionCookieDomain).toBe('taskforcehq.ai');
|
|
36
|
-
});
|
|
37
|
-
it('prefers an explicitly configured session cookie domain', () => {
|
|
38
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
39
|
-
TASKFORCE_CLOUD_ENVIRONMENT: 'performance',
|
|
40
|
-
TASKFORCE_AUTH_SESSION_DOMAIN: 'performance-app.taskforcehq.ai'
|
|
41
|
-
});
|
|
42
|
-
expect(config.sessionCookieDomain).toBe('performance-app.taskforcehq.ai');
|
|
43
|
-
});
|
|
44
|
-
it('allows excluded health path without session', () => {
|
|
45
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
46
|
-
TASKFORCE_AUTH_ENABLED: 'true',
|
|
47
|
-
TASKFORCE_AUTH_SESSION_SECRET: 'secret'
|
|
48
|
-
});
|
|
49
|
-
const result = isRequestAuthorized(mockReq('/api/taskforce/health'), config);
|
|
50
|
-
expect(result.allowed).toBe(true);
|
|
51
|
-
});
|
|
52
|
-
it('denies protected api path without session', () => {
|
|
53
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
54
|
-
TASKFORCE_AUTH_ENABLED: 'true',
|
|
55
|
-
TASKFORCE_AUTH_SESSION_SECRET: 'secret'
|
|
56
|
-
});
|
|
57
|
-
const result = isRequestAuthorized(mockReq('/api/taskforce/tasks'), config);
|
|
58
|
-
expect(result.allowed).toBe(false);
|
|
59
|
-
expect(result.reason).toContain('Missing auth session');
|
|
60
|
-
});
|
|
61
|
-
it('allows protected api path with valid signed session cookie', () => {
|
|
62
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
63
|
-
TASKFORCE_AUTH_ENABLED: 'true',
|
|
64
|
-
TASKFORCE_AUTH_SESSION_SECRET: 'session-secret'
|
|
65
|
-
});
|
|
66
|
-
const cookieHeader = createSessionTokenCookie('session-1', config);
|
|
67
|
-
const cookieValue = cookieHeader.split(';')[0];
|
|
68
|
-
const result = isRequestAuthorized(mockReq('/api/taskforce/tasks', { cookie: cookieValue }), config);
|
|
69
|
-
expect(result.allowed).toBe(true);
|
|
70
|
-
expect(hasValidSession(mockReq('/api/taskforce/tasks', { cookie: cookieValue }), config)).toBe(true);
|
|
71
|
-
});
|
|
72
|
-
it('resolves role/workspace/user from session claims', () => {
|
|
73
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
74
|
-
TASKFORCE_AUTH_ENABLED: 'true',
|
|
75
|
-
TASKFORCE_AUTH_SESSION_SECRET: 'session-secret'
|
|
76
|
-
});
|
|
77
|
-
const cookieHeader = createSessionTokenCookie('session-2', config, {
|
|
78
|
-
role: 'admin',
|
|
79
|
-
workspaceId: 'workspace-123',
|
|
80
|
-
userId: 'user-abc'
|
|
81
|
-
});
|
|
82
|
-
const cookieValue = cookieHeader.split(';')[0];
|
|
83
|
-
const access = resolveRequestAccess(mockReq('/api/taskforce/tasks', { cookie: cookieValue }), config);
|
|
84
|
-
expect(access.authenticated).toBe(true);
|
|
85
|
-
expect(access.role).toBe('admin');
|
|
86
|
-
expect(access.workspaceId).toBe('workspace-123');
|
|
87
|
-
expect(access.userId).toBe('user-abc');
|
|
88
|
-
});
|
|
89
|
-
it('uses requested workspace header for unauthenticated access context', () => {
|
|
90
|
-
const config = resolveAuthConfigFromEnv('local', {});
|
|
91
|
-
const access = resolveRequestAccess(mockReq('/api/taskforce/tasks', { 'x-taskforce-workspace-id': 'project-acme' }), config);
|
|
92
|
-
expect(access.authenticated).toBe(false);
|
|
93
|
-
expect(access.workspaceId).toBe('project-acme');
|
|
94
|
-
});
|
|
95
|
-
it('downgrades SameSite=None to Lax when request is HTTP and secure cookies are unavailable', () => {
|
|
96
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
97
|
-
TASKFORCE_AUTH_ENABLED: 'true',
|
|
98
|
-
TASKFORCE_AUTH_SESSION_SECRET: 'session-secret'
|
|
99
|
-
});
|
|
100
|
-
const attrs = resolveSessionCookieAttributesForRequest(mockReq('/api/taskforce/auth/login', { 'x-forwarded-proto': 'http' }), config);
|
|
101
|
-
expect(attrs.secure).toBe(false);
|
|
102
|
-
expect(attrs.sameSite).toBe('Lax');
|
|
103
|
-
const cookie = createSessionTokenCookie('session-http', config, attrs);
|
|
104
|
-
expect(cookie).toContain('SameSite=Lax');
|
|
105
|
-
expect(cookie).not.toContain('; Secure');
|
|
106
|
-
const clearCookie = createClearSessionCookie(config, attrs);
|
|
107
|
-
expect(clearCookie).toContain('SameSite=Lax');
|
|
108
|
-
expect(clearCookie).not.toContain('; Secure');
|
|
109
|
-
});
|
|
110
|
-
it('keeps secure cookie attributes for non-loopback hosts when TLS is terminated upstream', () => {
|
|
111
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
112
|
-
TASKFORCE_AUTH_ENABLED: 'true',
|
|
113
|
-
TASKFORCE_AUTH_SESSION_SECRET: 'session-secret'
|
|
114
|
-
});
|
|
115
|
-
const attrs = resolveSessionCookieAttributesForRequest(mockReq('/api/taskforce/auth/login', { host: 'app.taskforcehq.ai' }), config);
|
|
116
|
-
expect(attrs.secure).toBe(true);
|
|
117
|
-
expect(attrs.sameSite).toBe('None');
|
|
118
|
-
const cookie = createSessionTokenCookie('session-proxy', config, attrs);
|
|
119
|
-
expect(cookie).toContain('SameSite=None');
|
|
120
|
-
expect(cookie).toContain('; Secure');
|
|
121
|
-
});
|
|
122
|
-
it('uses non-secure cookie attributes on loopback hosts without https forwarding headers', () => {
|
|
123
|
-
const config = resolveAuthConfigFromEnv('cloud', {
|
|
124
|
-
TASKFORCE_AUTH_ENABLED: 'true',
|
|
125
|
-
TASKFORCE_AUTH_SESSION_SECRET: 'session-secret'
|
|
126
|
-
});
|
|
127
|
-
const attrs = resolveSessionCookieAttributesForRequest(mockReq('/api/taskforce/auth/login', { host: 'localhost:3000' }), config);
|
|
128
|
-
expect(attrs.secure).toBe(false);
|
|
129
|
-
expect(attrs.sameSite).toBe('Lax');
|
|
130
|
-
});
|
|
131
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|