@taskforcehq/taskforce 0.3.170 → 0.3.301
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 +71 -21
- package/dist/Taskforce.module.css +3394 -5981
- package/dist/TaskforceCore.CategoryFallback.test.js +5 -2
- package/dist/TaskforceCore.filter-persistence.test.js +402 -0
- package/dist/TaskforceCore.js +388 -71
- package/dist/TaskforceCore.routing.test.js +311 -0
- package/dist/TaskforceCore.test.js +3344 -615
- package/dist/TaskforceWidget.js +3 -2
- package/dist/__tests__/localizationCatalogs.test.js +48 -31
- package/dist/__tests__/workflowSimulation.test.js +2 -2
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.d.ts +60 -0
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.js +324 -0
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.js +278 -0
- package/dist/annotatedAttachments/payload.d.ts +2 -0
- package/dist/annotatedAttachments/payload.js +54 -0
- package/dist/annotatedAttachments/payload.test.js +67 -0
- package/dist/annotatedAttachments/service.d.ts +49 -0
- package/dist/annotatedAttachments/service.js +121 -0
- package/dist/annotatedAttachments/types.d.ts +86 -0
- package/dist/cli.js +74 -25
- package/dist/compat/deploymentCompat.d.ts +12 -0
- package/dist/compat/deploymentCompat.js +43 -0
- package/dist/compat/workspaceSyncCompat.d.ts +6 -0
- package/dist/compat/workspaceSyncCompat.js +79 -0
- package/dist/compat/workspaceSyncCompat.test.js +87 -0
- package/dist/components/features/AgentsModule.d.ts +5 -0
- package/dist/components/features/AgentsModule.js +131 -0
- package/dist/components/features/AgentsModule.test.js +102 -0
- package/dist/components/features/AnnotatedAttachmentWorkspace.d.ts +24 -0
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +1942 -0
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +2831 -0
- package/dist/components/features/DocumentGenerateModal.js +8 -16
- package/dist/components/features/DocumentIndex.d.ts +3 -4
- package/dist/components/features/DocumentIndex.js +22 -10
- package/dist/components/features/DocumentViewer.d.ts +6 -2
- package/dist/components/features/DocumentViewer.js +1000 -18
- package/dist/components/features/DocumentWorkspace.d.ts +40 -2
- package/dist/components/features/DocumentWorkspace.js +96 -16
- package/dist/components/features/DocumentWorkspace.test.js +1202 -0
- package/dist/components/features/InitiativesModule.d.ts +22 -0
- package/dist/components/features/InitiativesModule.js +33 -0
- package/dist/components/features/TaskSettings.d.ts +41 -32
- package/dist/components/features/TaskSettings.js +798 -313
- package/dist/components/features/TaskSettings.test.js +1221 -47
- package/dist/components/features/WorkflowsModule.d.ts +27 -0
- package/dist/components/features/WorkflowsModule.js +21 -0
- package/dist/components/features/documentWorkspaceFilters.d.ts +10 -0
- package/dist/components/features/documentWorkspaceFilters.js +11 -0
- package/dist/components/features/settings/CategoryManager.d.ts +2 -0
- package/dist/components/features/settings/CategoryManager.js +15 -8
- package/dist/components/features/settings/PriorityManager.d.ts +18 -0
- package/dist/components/features/settings/PriorityManager.js +51 -0
- package/dist/components/features/settings/TaxonomyEditor.d.ts +2 -1
- package/dist/components/features/settings/TaxonomyEditor.js +41 -18
- package/dist/components/features/settings/TaxonomyLibraryManager.d.ts +26 -0
- package/dist/components/features/settings/TaxonomyLibraryManager.js +301 -0
- package/dist/components/features/settings/TaxonomyLibraryManager.test.js +141 -0
- package/dist/components/features/settings/TaxonomyManager.d.ts +35 -12
- package/dist/components/features/settings/TaxonomyManager.js +59 -27
- package/dist/components/features/settings/TypeManager.d.ts +11 -0
- package/dist/components/features/settings/TypeManager.js +48 -11
- package/dist/components/features/settings/{WorkflowEditorPrototype.d.ts → WorkflowEditor.d.ts} +2 -2
- package/dist/components/features/settings/{WorkflowEditorPrototype.js → WorkflowEditor.js} +3 -3
- package/dist/components/task/TaskActionHeader.d.ts +12 -2
- package/dist/components/task/TaskActionHeader.js +64 -8
- package/dist/components/task/TaskActionHeader.test.js +73 -0
- package/dist/components/task/TaskCard.d.ts +14 -16
- package/dist/components/task/TaskCard.js +144 -174
- package/dist/components/task/TaskCard.test.js +416 -64
- package/dist/components/task/TaskContextUpload.d.ts +6 -5
- package/dist/components/task/TaskContextUpload.js +199 -64
- package/dist/components/task/TaskContextUpload.test.js +331 -14
- package/dist/components/task/TaskForm.d.ts +23 -29
- package/dist/components/task/TaskForm.js +348 -169
- package/dist/components/task/TaskForm.test.js +419 -23
- package/dist/components/task/TaskKanban.d.ts +20 -21
- package/dist/components/task/TaskKanban.js +176 -316
- package/dist/components/task/TaskKanban.planning-drop.test.js +93 -0
- package/dist/components/task/TaskList.d.ts +22 -11
- package/dist/components/task/TaskList.js +98 -12
- package/dist/components/task/TaskList.test.js +206 -7
- package/dist/components/task/TaskReferenceBadge.d.ts +12 -0
- package/dist/components/task/TaskReferenceBadge.js +5 -0
- package/dist/components/task/TaskStatusActions.d.ts +12 -0
- package/dist/components/task/TaskStatusActions.js +18 -0
- package/dist/components/task/TaskStatusActions.test.js +45 -0
- package/dist/components/ui/ImageReferenceBadge.d.ts +12 -0
- package/dist/components/ui/ImageReferenceBadge.js +5 -0
- package/dist/components/ui/LevelSelector.d.ts +2 -1
- package/dist/components/ui/LevelSelector.js +2 -2
- package/dist/components/ui/Markdown.d.ts +1 -2
- package/dist/components/ui/Markdown.js +2 -13
- package/dist/components/ui/Modal.d.ts +3 -2
- package/dist/components/ui/Modal.js +4 -3
- package/dist/components/ui/MultiSelectFilter.d.ts +3 -1
- package/dist/components/ui/MultiSelectFilter.js +2 -2
- package/dist/components/ui/ReferenceBadgeButton.d.ts +13 -0
- package/dist/components/ui/ReferenceBadgeButton.js +6 -0
- package/dist/components/ui/TaxonomyDropdown.d.ts +7 -1
- package/dist/components/ui/TaxonomyDropdown.js +58 -23
- package/dist/components/ui/TopNoticeLayer.d.ts +7 -0
- package/dist/components/ui/TopNoticeLayer.js +14 -0
- package/dist/components/ui/TopNoticeLayer.test.js +25 -0
- package/dist/components/views/AppShellHeader.d.ts +13 -0
- package/dist/components/views/AppShellHeader.js +19 -0
- package/dist/components/views/AppShellHeader.test.js +21 -0
- package/dist/components/views/PlanComparisonPage.d.ts +73 -0
- package/dist/components/views/PlanComparisonPage.js +196 -0
- package/dist/components/views/PlanComparisonPage.test.js +251 -0
- package/dist/components/views/PlansPage.d.ts +14 -0
- package/dist/components/views/PlansPage.js +355 -0
- package/dist/components/views/StandaloneLayout.d.ts +2 -2
- package/dist/components/views/StandaloneLayout.js +2227 -1188
- package/dist/components/views/WidgetView.d.ts +2 -2
- package/dist/components/views/WidgetView.js +149 -43
- package/dist/components/views/chrome/WorkspaceChromeSections.d.ts +57 -0
- package/dist/components/views/chrome/WorkspaceChromeSections.js +38 -0
- package/dist/components/views/chrome/WorkspaceChromeSections.test.js +54 -0
- package/dist/components/views/chrome/workspaceChrome.d.ts +31 -0
- package/dist/components/views/chrome/workspaceChrome.js +108 -0
- package/dist/components/views/chrome/workspaceChrome.test.js +52 -0
- package/dist/components/views/panels/DocumentFilterToolbar.d.ts +10 -0
- package/dist/components/views/panels/DocumentFilterToolbar.js +7 -0
- package/dist/components/views/panels/DocumentFilterToolbar.test.js +19 -0
- package/dist/components/views/panels/FilterToolbar.d.ts +68 -0
- package/dist/components/views/panels/FilterToolbar.js +21 -0
- package/dist/components/views/panels/FilterToolbar.test.d.ts +1 -0
- package/dist/components/views/panels/FilterToolbar.test.js +45 -0
- package/dist/components/views/panels/FilterToolbarControls.d.ts +47 -0
- package/dist/components/views/panels/FilterToolbarControls.js +61 -0
- package/dist/components/views/panels/PlanningDrawer.d.ts +115 -0
- package/dist/components/views/panels/PlanningDrawer.js +220 -0
- package/dist/components/views/panels/ScheduleSidebar.d.ts +52 -0
- package/dist/components/views/panels/ScheduleSidebar.js +127 -0
- package/dist/components/views/panels/scheduleUtils.d.ts +14 -0
- package/dist/components/views/panels/scheduleUtils.js +79 -0
- package/dist/components/views/teamManagementAccess.d.ts +6 -0
- package/dist/components/views/teamManagementAccess.js +18 -0
- package/dist/components/views/teamManagementAccess.test.d.ts +1 -0
- package/dist/components/views/teamManagementAccess.test.js +44 -0
- package/dist/config/clientDeployment.d.ts +2 -0
- package/dist/config/clientDeployment.js +13 -0
- package/dist/config/cloudEnvironment.d.ts +15 -0
- package/dist/config/cloudEnvironment.js +60 -0
- package/dist/config/deployment.d.ts +20 -0
- package/dist/config/deployment.js +67 -0
- package/dist/config/deployment.test.d.ts +1 -0
- package/dist/config/deployment.test.js +88 -0
- package/dist/config/envSchema.js +36 -8
- package/dist/config/envSchema.test.js +28 -0
- package/dist/core/AiProfileService.d.ts +66 -0
- package/dist/core/AiProfileService.js +320 -0
- package/dist/core/AiProfileService.test.d.ts +1 -0
- package/dist/core/AiProfileService.test.js +164 -0
- package/dist/core/AiProfiles.test.d.ts +1 -0
- package/dist/core/AiProfiles.test.js +449 -0
- package/dist/core/AttachmentLinkService.d.ts +15 -0
- package/dist/core/AttachmentLinkService.js +157 -0
- package/dist/core/AuthTokenService.d.ts +44 -0
- package/dist/core/AuthTokenService.js +207 -0
- package/dist/core/CreatedBy.test.js +134 -6
- package/dist/core/DeletedTaskLifecycleService.d.ts +33 -0
- package/dist/core/DeletedTaskLifecycleService.js +158 -0
- package/dist/core/DeletedTaskTrash.test.d.ts +1 -0
- package/dist/core/DeletedTaskTrash.test.js +104 -0
- package/dist/core/EntitlementsPolicy.test.js +78 -5
- package/dist/core/GlobalSettingsService.d.ts +16 -0
- package/dist/core/GlobalSettingsService.js +370 -0
- package/dist/core/JsonBackupRuntime.test.d.ts +1 -0
- package/dist/core/JsonBackupRuntime.test.js +155 -0
- package/dist/core/McpTokenService.d.ts +118 -0
- package/dist/core/McpTokenService.js +921 -0
- package/dist/core/PlanEntitlementService.d.ts +201 -0
- package/dist/core/PlanEntitlementService.js +1442 -0
- package/dist/core/PlanVersionPolicy.test.d.ts +1 -0
- package/dist/core/PlanVersionPolicy.test.js +178 -0
- package/dist/core/PlanningEntities.test.d.ts +1 -0
- package/dist/core/PlanningEntities.test.js +95 -0
- package/dist/core/ScheduleFields.test.js +15 -19
- package/dist/core/SignupMonetizationSettings.test.d.ts +1 -0
- package/dist/core/SignupMonetizationSettings.test.js +159 -0
- package/dist/core/Stats.test.d.ts +1 -0
- package/dist/core/Stats.test.js +36 -0
- package/dist/core/SyncReconciliationService.d.ts +93 -0
- package/dist/core/SyncReconciliationService.js +406 -0
- package/dist/core/SystemAdmin.test.js +578 -13
- package/dist/core/TaskActivityService.d.ts +21 -0
- package/dist/core/TaskActivityService.js +130 -0
- package/dist/core/TaskAttachmentsCanonical.test.d.ts +1 -0
- package/dist/core/TaskAttachmentsCanonical.test.js +306 -0
- package/dist/core/TaskAuditTimeline.test.d.ts +1 -0
- package/dist/core/TaskAuditTimeline.test.js +132 -0
- package/dist/core/TaskTaxonomyValidation.test.js +338 -15
- package/dist/core/Taskforce.d.ts +930 -183
- package/dist/core/Taskforce.ids.test.js +252 -0
- package/dist/core/Taskforce.js +3848 -2532
- package/dist/core/Taskforce.mcpAuth.test.d.ts +1 -0
- package/dist/core/Taskforce.mcpAuth.test.js +343 -0
- package/dist/core/Taskforce.realtimeMutation.test.js +57 -2
- package/dist/core/TaxonomySettingsService.d.ts +18 -0
- package/dist/core/TaxonomySettingsService.js +162 -0
- package/dist/core/WorkspaceDelete.test.js +32 -13
- package/dist/core/WorkspaceLifecycleService.d.ts +11 -0
- package/dist/core/WorkspaceLifecycleService.js +88 -0
- package/dist/core/WorkspacePermissions.test.js +95 -0
- package/dist/core/WorkspacePlanMode.test.js +114 -1
- package/dist/core/WorkspacePreferenceService.d.ts +41 -0
- package/dist/core/WorkspacePreferenceService.js +246 -0
- package/dist/core/WorkspaceSyncSettings.test.d.ts +1 -0
- package/dist/core/WorkspaceSyncSettings.test.js +65 -0
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.d.ts +1 -0
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.js +212 -0
- package/dist/core/shared.d.ts +36 -0
- package/dist/core/shared.js +128 -0
- package/dist/core/types.d.ts +614 -0
- package/dist/core/types.js +27 -0
- package/dist/documentReviews/DocumentReviewCommentStore.d.ts +56 -0
- package/dist/documentReviews/DocumentReviewCommentStore.js +230 -0
- package/dist/documentReviews/DocumentReviewSessionStore.d.ts +52 -0
- package/dist/documentReviews/DocumentReviewSessionStore.js +193 -0
- package/dist/documentReviews/DocumentReviewSessionStore.test.d.ts +1 -0
- package/dist/documentReviews/DocumentReviewSessionStore.test.js +127 -0
- package/dist/documentReviews/service.d.ts +68 -0
- package/dist/documentReviews/service.js +210 -0
- package/dist/documentReviews/types.d.ts +58 -0
- package/dist/documentReviews/types.js +1 -0
- package/dist/hooks/auth/useAuthGuardPolicy.d.ts +2 -0
- package/dist/hooks/auth/useAuthGuardPolicy.js +1 -0
- package/dist/hooks/tasks/useCurrentTaskRelations.d.ts +15 -0
- package/dist/hooks/tasks/useCurrentTaskRelations.js +37 -0
- package/dist/hooks/tasks/useTaskActions.d.ts +3 -0
- package/dist/hooks/tasks/useTaskActions.js +2 -0
- package/dist/hooks/tasks/useTaskEditorNavigation.d.ts +65 -0
- package/dist/hooks/tasks/useTaskEditorNavigation.js +235 -0
- package/dist/hooks/tasks/useTaskFilters.d.ts +2 -0
- package/dist/hooks/tasks/useTaskFilters.js +2 -0
- package/dist/hooks/tasks/useTaskFormActions.d.ts +58 -0
- package/dist/hooks/tasks/useTaskFormActions.js +365 -0
- package/dist/hooks/tasks/useTaskRelationships.d.ts +16 -0
- package/dist/hooks/tasks/useTaskRelationships.js +64 -0
- package/dist/hooks/ui/useResourceExport.d.ts +19 -0
- package/dist/hooks/ui/useResourceExport.js +84 -0
- package/dist/hooks/ui/useSettingsModel.d.ts +203 -0
- package/dist/hooks/ui/useSettingsModel.js +125 -0
- package/dist/hooks/ui/useSettingsPersistence.d.ts +36 -0
- package/dist/hooks/ui/useSettingsPersistence.js +254 -0
- package/dist/hooks/ui/useSettingsTaxonomyManagement.d.ts +119 -0
- package/dist/hooks/ui/useSettingsTaxonomyManagement.js +536 -0
- package/dist/hooks/ui/useUiNotice.d.ts +1 -0
- package/dist/hooks/ui/useUiNotice.js +1 -0
- package/dist/hooks/ui/useWorkflowTemplates.d.ts +37 -0
- package/dist/hooks/ui/useWorkflowTemplates.js +111 -0
- package/dist/hooks/ui/useZenMode.d.ts +5 -0
- package/dist/hooks/ui/useZenMode.js +32 -0
- package/dist/hooks/useFilterSort.d.ts +60 -0
- package/dist/hooks/useFilterSort.js +362 -0
- package/dist/hooks/useFilterSort.test.d.ts +1 -0
- package/dist/hooks/useFilterSort.test.js +333 -0
- package/dist/hooks/useRealtimeSync.d.ts +1 -0
- package/dist/hooks/useRealtimeSync.js +24 -9
- package/dist/hooks/useRealtimeSync.test.js +28 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.d.ts +1 -0
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +34 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +65 -103
- package/dist/hooks/useSyncOrchestrator.js +1538 -670
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +700 -174
- package/dist/hooks/useTaskData.d.ts +35 -0
- package/dist/hooks/useTaskData.js +243 -0
- package/dist/hooks/useTaskData.test.d.ts +1 -0
- package/dist/hooks/useTaskData.test.js +180 -0
- package/dist/hooks/useTaskMutations.d.ts +46 -0
- package/dist/hooks/useTaskMutations.js +472 -0
- package/dist/hooks/useTaskMutations.test.d.ts +1 -0
- package/dist/hooks/useTaskMutations.test.js +80 -0
- package/dist/hooks/useTaskforce.contract.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.contract.test.js +7 -0
- package/dist/hooks/useTaskforce.d.ts +260 -295
- package/dist/hooks/useTaskforce.js +1954 -2623
- package/dist/hooks/useTaskforce.priority-filters.test.js +6 -11
- package/dist/hooks/useTaskforce.sync-behavior.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.sync-behavior.test.js +1120 -0
- package/dist/hooks/useUiNotice.d.ts +16 -0
- package/dist/hooks/useUiNotice.js +49 -0
- package/dist/hooks/useWorkspaceSyncController.d.ts +23 -46
- package/dist/hooks/useWorkspaceSyncController.js +280 -461
- package/dist/hooks/useWorkspaceSyncController.test.js +106 -199
- package/dist/hooks/workspace/useTaskforceApiRouting.d.ts +8 -0
- package/dist/hooks/workspace/useTaskforceApiRouting.js +91 -0
- package/dist/hooks/workspace/useTaskforceApiRouting.test.d.ts +1 -0
- package/dist/hooks/workspace/useTaskforceApiRouting.test.js +60 -0
- package/dist/hooks/workspace/useWorkspaceSyncController.d.ts +1 -0
- package/dist/hooks/workspace/useWorkspaceSyncController.js +1 -0
- package/dist/hooks/workspace/workspaceLocalState.d.ts +30 -0
- package/dist/hooks/workspace/workspaceLocalState.js +101 -0
- package/dist/localization/locales/en-US.d.ts +1 -8
- package/dist/localization/locales/en-US.js +4 -11
- package/dist/localization/locales/es-419.js +2 -9
- package/dist/localization/locales/pt-BR.js +2 -9
- package/dist/localization/localizationCatalogs.test.d.ts +1 -0
- package/dist/localization/localizationCatalogs.test.js +37 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +9 -15
- package/dist/mcp/clientIntegrations.d.ts +33 -0
- package/dist/mcp/clientIntegrations.js +199 -0
- package/dist/mcp/clientIntegrations.test.d.ts +1 -0
- package/dist/mcp/clientIntegrations.test.js +110 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/optionResolution.test.js +6 -2
- package/dist/mcp/runtime.d.ts +120 -0
- package/dist/mcp/runtime.js +5668 -0
- package/dist/mcp/runtime.test.d.ts +1 -0
- package/dist/mcp/runtime.test.js +3299 -0
- package/dist/mcp/server.js +2 -1793
- package/dist/mcp/structuredCommentValidation.test.d.ts +1 -0
- package/dist/{__tests__ → mcp}/structuredCommentValidation.test.js +1 -1
- package/dist/mcp/structuredDocValidation.js +1 -2
- package/dist/mcp/structuredDocValidation.test.d.ts +1 -0
- package/dist/{__tests__ → mcp}/structuredDocValidation.test.js +9 -4
- package/dist/mcp/toolRegistry.d.ts +570 -0
- package/dist/mcp/toolRegistry.js +90 -0
- package/dist/mcp/toolRegistry.test.d.ts +1 -0
- package/dist/mcp/toolRegistry.test.js +30 -0
- package/dist/migrations/billingSchemaParity.test.js +111 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +5 -0
- package/dist/migrations/taskSchemaMigrations.js +681 -39
- package/dist/migrations/taskSchemaMigrations.test.d.ts +1 -0
- package/dist/migrations/taskSchemaMigrations.test.js +210 -0
- package/dist/plugins/vite.js +13 -7
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/archive/phoenix/apple-touch-icon.png +0 -0
- package/dist/public/archive/phoenix/favicon.ico +0 -0
- package/dist/public/archive/phoenix/site.webmanifest +1 -0
- package/dist/public/favicon-96x96.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/favicon.svg +17 -0
- package/dist/public/site.webmanifest +21 -1
- package/dist/public/web-app-manifest-192x192.png +0 -0
- package/dist/public/web-app-manifest-512x512.png +0 -0
- package/dist/releaseVersion.test.d.ts +1 -0
- package/dist/{__tests__/releaseVersion.test.js → releaseVersion.test.js} +1 -1
- package/dist/resources/templates/WORKFLOW_V2_POLICY.md +1 -1
- package/dist/resources/templates/workflow-sources/workflowDocs.mjs +62 -52
- package/dist/resources/templates/workflows/collaborate.yaml +11 -5
- package/dist/resources/templates/workflows/do.yaml +8 -2
- package/dist/resources/templates/workflows/evaluate.yaml +13 -7
- package/dist/resources/templates/workflows/execute.yaml +40 -23
- package/dist/resources/templates/workflows/plan.yaml +15 -8
- package/dist/resources/templates/workflows/review.yaml +14 -8
- package/dist/runtime/appGateDefinitions.d.ts +32 -0
- package/dist/runtime/appGateDefinitions.js +32 -0
- package/dist/runtime/appGates.d.ts +29 -0
- package/dist/runtime/appGates.js +53 -0
- package/dist/runtime/appGates.test.d.ts +1 -0
- package/dist/runtime/appGates.test.js +42 -0
- package/dist/runtime/migrationFlags.d.ts +1 -0
- package/dist/runtime/migrationFlags.js +1 -0
- package/dist/server/annotatedAttachmentsRoutes.test.d.ts +1 -0
- package/dist/server/annotatedAttachmentsRoutes.test.js +473 -0
- package/dist/server/auth.js +14 -2
- package/dist/server/auth.test.js +21 -1
- package/dist/server/cors.js +11 -5
- package/dist/server/cors.test.js +6 -0
- package/dist/server/documentReviewRoutes.test.d.ts +1 -0
- package/dist/server/documentReviewRoutes.test.js +157 -0
- package/dist/server/index.cookieProxy.test.js +46 -1
- package/dist/server/index.d.ts +20 -0
- package/dist/server/index.js +168 -41
- package/dist/server/index.rateLimit.test.js +6 -0
- package/dist/server/index.test.js +133 -2
- package/dist/server/mockStripe.d.ts +72 -0
- package/dist/server/mockStripe.js +357 -0
- package/dist/server/realtimeSyncWs.js +4 -0
- package/dist/server/routes/admin.d.ts +114 -0
- package/dist/server/routes/admin.js +2226 -0
- package/dist/server/routes/annotatedAttachments.d.ts +24 -0
- package/dist/server/routes/annotatedAttachments.js +235 -0
- package/dist/server/routes/auth.d.ts +61 -0
- package/dist/server/routes/auth.js +1296 -0
- package/dist/server/{routes.billing.d.ts → routes/billing.d.ts} +3 -2
- package/dist/server/routes/billing.js +2001 -0
- package/dist/server/routes/billing.test.d.ts +1 -0
- package/dist/server/routes/billing.test.js +1631 -0
- package/dist/server/routes/documentReviews.d.ts +11 -0
- package/dist/server/routes/documentReviews.js +191 -0
- package/dist/server/routes/documents.d.ts +118 -0
- package/dist/server/routes/documents.js +1113 -0
- package/dist/server/routes/resources.d.ts +25 -0
- package/dist/server/routes/resources.js +225 -0
- package/dist/server/routes/shared.d.ts +35 -0
- package/dist/server/routes/shared.js +305 -0
- package/dist/server/routes/shared.test.d.ts +1 -0
- package/dist/server/routes/shared.test.js +32 -0
- package/dist/server/{routes.sync.d.ts → routes/sync.d.ts} +5 -5
- package/dist/server/routes/sync.integration.test.d.ts +1 -0
- package/dist/server/routes/sync.integration.test.js +2003 -0
- package/dist/server/routes/sync.js +3143 -0
- package/dist/server/routes/tasks.d.ts +72 -0
- package/dist/server/routes/tasks.js +1252 -0
- package/dist/server/routes/workspaces.d.ts +32 -0
- package/dist/server/routes/workspaces.js +307 -0
- package/dist/server/routes.d.ts +8 -9
- package/dist/server/routes.js +968 -4092
- package/dist/server/routes.test.js +9043 -2415
- package/dist/server/runtimeMode.d.ts +1 -1
- package/dist/server/runtimeMode.js +3 -18
- package/dist/server/runtimeMode.test.js +3 -3
- package/dist/server/securityHeaders.d.ts +1 -1
- package/dist/server/securityHeaders.js +65 -6
- package/dist/server/securityHeaders.test.js +40 -2
- package/dist/services/templateEngine.test.d.ts +1 -0
- package/dist/{__tests__ → services}/templateEngine.test.js +1 -1
- package/dist/services/templates.test.d.ts +1 -0
- package/dist/{__tests__ → services}/templates.test.js +1 -1
- package/dist/services/workflowDocumentFixtures.test.d.ts +1 -0
- package/dist/{__tests__ → services}/workflowDocumentFixtures.test.js +4 -4
- package/dist/services/workflowExportMatrix.test.d.ts +1 -0
- package/dist/{__tests__ → services}/workflowExportMatrix.test.js +1 -1
- package/dist/services/workflowExportSnapshots.test.d.ts +1 -0
- package/dist/services/workflowGeneration.test.d.ts +1 -0
- package/dist/services/workflowSimulation.test.d.ts +1 -0
- package/dist/services/workflowSimulation.test.js +113 -0
- package/dist/services/workflowV2Policy.test.d.ts +1 -0
- package/dist/{__tests__ → services}/workflowV2Policy.test.js +2 -2
- package/dist/shared/aiProfileSurfaceType.d.ts +9 -0
- package/dist/shared/aiProfileSurfaceType.js +49 -0
- package/dist/shared/customTaxonomyLibrary.d.ts +11 -0
- package/dist/shared/customTaxonomyLibrary.js +276 -0
- package/dist/shared/customTaxonomyLibrary.test.d.ts +1 -0
- package/dist/shared/customTaxonomyLibrary.test.js +20 -0
- package/dist/shared/taxonomyCatalog.d.ts +19 -0
- package/dist/shared/taxonomyCatalog.js +36 -0
- package/dist/shared/taxonomyDefaults.d.ts +29 -0
- package/dist/shared/taxonomyDefaults.js +26 -0
- package/dist/shared/taxonomyLibrary.d.ts +15 -0
- package/dist/shared/taxonomyLibrary.js +98 -0
- package/dist/shared/taxonomyLibrary.test.d.ts +1 -0
- package/dist/shared/taxonomyLibrary.test.js +26 -0
- package/dist/shared/taxonomyState.d.ts +36 -0
- package/dist/shared/taxonomyState.js +73 -0
- package/dist/shared/taxonomyState.test.d.ts +1 -0
- package/dist/shared/taxonomyState.test.js +71 -0
- package/dist/shared/workflowDefaults.d.ts +9 -0
- package/dist/shared/workflowDefaults.js +11 -0
- package/dist/storage/documentIntegrity.d.ts +2 -0
- package/dist/storage/documentIntegrity.js +34 -17
- package/dist/storage/documentPurge.d.ts +2 -1
- package/dist/storage/documentPurge.js +35 -8
- package/dist/storage/index.d.ts +4 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/objectStorage.d.ts +1 -1
- package/dist/storage/objectStorageClient.d.ts +6 -4
- package/dist/storage/objectStorageClient.js +77 -29
- package/dist/storage/objectStorageClient.test.d.ts +1 -0
- package/dist/storage/objectStorageClient.test.js +57 -0
- package/dist/storage/objectStorageConfig.js +3 -1
- package/dist/storage/objectStorageConfig.test.d.ts +1 -0
- package/dist/storage/objectStorageConfig.test.js +38 -0
- package/dist/storage/postgresAdapter.d.ts +5 -0
- package/dist/storage/postgresAdapter.js +2 -2
- package/dist/storage/postgresAdapter.test.d.ts +1 -0
- package/dist/storage/postgresAdapter.test.js +29 -0
- package/dist/storage/taskAssetStore.d.ts +7 -4
- package/dist/storage/taskAssetStore.js +65 -60
- package/dist/storage/workspaceAssetStore.d.ts +122 -0
- package/dist/storage/workspaceAssetStore.js +496 -0
- package/dist/storage/workspaceAssetStore.test.d.ts +1 -0
- package/dist/storage/workspaceAssetStore.test.js +501 -0
- package/dist/sync/cloudSyncApi.d.ts +33 -2
- package/dist/sync/cloudSyncApi.js +37 -15
- package/dist/sync/cloudSyncApi.test.js +60 -3
- package/dist/sync/index.d.ts +2 -0
- package/dist/sync/index.js +3 -0
- package/dist/sync/syncService.d.ts +25 -0
- package/dist/sync/syncService.js +184 -16
- package/dist/sync/syncService.test.js +289 -25
- package/dist/sync/workspaceRepair.d.ts +114 -0
- package/dist/sync/workspaceRepair.js +566 -0
- package/dist/sync/workspaceSyncModel.d.ts +230 -2
- package/dist/sync/workspaceSyncModel.js +456 -17
- package/dist/sync/workspaceSyncModel.test.js +642 -0
- package/dist/sync/workspaceSyncState.d.ts +12 -0
- package/dist/sync/workspaceSyncState.js +12 -0
- package/dist/sync/workspaceSyncSurface.d.ts +33 -0
- package/dist/sync/workspaceSyncSurface.js +74 -0
- package/dist/types.d.ts +143 -18
- package/dist/types.js +9 -24
- package/dist/ui/assets/AgentsModule-Bdq3T1Ts.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BaS2VwIr.css +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-jKUVo-PJ.js +3 -0
- package/dist/ui/assets/DocumentWorkspace-C_8T8oz-.css +1 -0
- package/dist/ui/assets/DocumentWorkspace-DuQa-uIC.js +250 -0
- package/dist/ui/assets/InitiativesModule-C8Pi2VTk.js +1 -0
- package/dist/ui/assets/PlansPage-B6BDECSi.js +1 -0
- package/dist/ui/assets/PlansPage-BlVC_lRq.css +1 -0
- package/dist/ui/assets/TaskSettings-BwB9NtmJ.css +1 -0
- package/dist/ui/assets/TaskSettings-DUJgRTPU.js +8 -0
- package/dist/ui/assets/WorkflowsModule-b6TLuHwJ.js +5 -0
- package/dist/ui/assets/index-BiiF1cLQ.css +1 -0
- package/dist/ui/assets/index-xBWLPOEb.js +6 -0
- package/dist/ui/assets/vendor-dnd-DRzYolkg.js +5 -0
- package/dist/ui/assets/{vendor-icons-ZFG3SGwo.js → vendor-icons-QZyhEwgT.js} +1 -1
- package/dist/ui/assets/{vendor-markdown-CKYkQHfj.js → vendor-markdown-BUxTU7dS.js} +1 -1
- package/dist/ui/assets/vendor-react-CKJs5o3c.js +61 -0
- package/dist/ui/assets/vendor-router-BbWMxlnO.js +3 -0
- package/dist/ui/branding/logos/logo.png +0 -0
- package/dist/ui/branding/logos/logo_dark.svg +27 -0
- package/dist/ui/branding/logos/logo_favicon.svg +35 -0
- package/dist/ui/branding/logos/logo_light.svg +27 -0
- package/dist/ui/favicon/apple-touch-icon.png +0 -0
- package/dist/ui/favicon/archive/phoenix/apple-touch-icon.png +0 -0
- package/dist/ui/favicon/archive/phoenix/favicon.ico +0 -0
- package/dist/ui/favicon/archive/phoenix/site.webmanifest +1 -0
- package/dist/ui/favicon/favicon-96x96.png +0 -0
- package/dist/ui/favicon/favicon.ico +0 -0
- package/dist/ui/favicon/favicon.svg +17 -0
- package/dist/ui/favicon/site.webmanifest +21 -1
- package/dist/ui/favicon/web-app-manifest-192x192.png +0 -0
- package/dist/ui/favicon/web-app-manifest-512x512.png +0 -0
- package/dist/ui/index.html +10 -7
- package/dist/ui/product/screen_01.png +0 -0
- package/dist/ui/product/screen_02.png +0 -0
- package/dist/ui/product/screen_03.png +0 -0
- package/dist/utils/annotatedAttachments.d.ts +20 -0
- package/dist/utils/annotatedAttachments.js +74 -0
- package/dist/utils/annotatedAttachments.test.d.ts +1 -0
- package/dist/utils/annotatedAttachments.test.js +108 -0
- package/dist/utils/assignees.d.ts +26 -0
- package/dist/utils/assignees.js +132 -0
- package/dist/utils/canonicalAssetKind.d.ts +16 -0
- package/dist/utils/canonicalAssetKind.js +39 -0
- package/dist/utils/canonicalAssetKind.test.d.ts +1 -0
- package/dist/utils/canonicalAssetKind.test.js +24 -0
- package/dist/utils/coalescedRefresh.d.ts +5 -0
- package/dist/utils/coalescedRefresh.js +16 -0
- package/dist/utils/coalescedRefresh.test.d.ts +1 -0
- package/dist/utils/coalescedRefresh.test.js +30 -0
- package/dist/utils/constants.d.ts +16 -3
- package/dist/utils/constants.icons.test.js +2 -1
- package/dist/utils/constants.js +70 -13
- package/dist/utils/contextAssetEvents.d.ts +7 -0
- package/dist/utils/contextAssetEvents.js +6 -0
- package/dist/utils/contextFiles.d.ts +14 -3
- package/dist/utils/contextFiles.js +40 -8
- package/dist/utils/documentManagerApi.d.ts +6 -0
- package/dist/utils/documentManagerApi.js +19 -0
- package/dist/utils/documentNames.d.ts +24 -0
- package/dist/utils/documentNames.js +91 -0
- package/dist/utils/documentReferences.d.ts +9 -0
- package/dist/utils/documentReferences.js +11 -0
- package/dist/utils/entityReferences.d.ts +9 -0
- package/dist/utils/entityReferences.js +32 -0
- package/dist/utils/imageReferences.d.ts +9 -0
- package/dist/utils/imageReferences.js +11 -0
- package/dist/utils/planParser.d.ts +2 -2
- package/dist/utils/planParser.js +11 -11
- package/dist/utils/planParser.test.d.ts +1 -0
- package/dist/{__tests__ → utils}/planParser.test.js +22 -22
- package/dist/utils/planningReferences.d.ts +17 -0
- package/dist/utils/planningReferences.js +30 -0
- package/dist/utils/planningReferences.test.d.ts +1 -0
- package/dist/utils/planningReferences.test.js +17 -0
- package/dist/utils/taskActivity.d.ts +9 -0
- package/dist/utils/taskActivity.js +147 -0
- package/dist/utils/taskActivity.test.d.ts +1 -0
- package/dist/utils/taskActivity.test.js +34 -0
- package/dist/utils/taskDraftDefaults.d.ts +21 -0
- package/dist/utils/taskDraftDefaults.js +40 -0
- package/dist/utils/taskDraftDefaults.test.d.ts +1 -0
- package/dist/utils/taskDraftDefaults.test.js +34 -0
- package/dist/utils/taskNormalization.d.ts +25 -0
- package/dist/utils/taskNormalization.js +161 -0
- package/dist/utils/taskNormalization.test.d.ts +1 -0
- package/dist/utils/taskNormalization.test.js +158 -0
- package/dist/utils/taskReferences.d.ts +5 -0
- package/dist/utils/taskReferences.js +11 -0
- package/dist/utils/taskforceApiClient.d.ts +2 -0
- package/dist/utils/taskforceApiClient.js +101 -3
- package/dist/utils/taskforceApiClient.test.d.ts +1 -0
- package/dist/utils/taskforceApiClient.test.js +44 -0
- package/dist/utils/taxonomyFilterOptions.d.ts +2 -0
- package/dist/utils/taxonomyFilterOptions.js +17 -0
- package/dist/utils/taxonomyFormDefaults.d.ts +3 -0
- package/dist/utils/taxonomyFormDefaults.js +28 -0
- package/dist/utils/taxonomyFormDefaults.test.d.ts +1 -0
- package/dist/utils/taxonomyFormDefaults.test.js +63 -0
- package/dist/utils/taxonomyLifecycle.d.ts +3 -0
- package/dist/utils/taxonomyLifecycle.js +17 -0
- package/dist/utils/taxonomySorting.d.ts +7 -0
- package/dist/utils/taxonomySorting.js +74 -0
- package/dist/utils/theme.d.ts +15 -0
- package/dist/utils/theme.js +23 -0
- package/dist/utils/uiNotice.d.ts +7 -0
- package/dist/utils/uiNotice.js +6 -0
- package/dist/utils/uiNotice.test.d.ts +1 -0
- package/dist/utils/uiNotice.test.js +18 -0
- package/dist/utils/workspaceIdentity.d.ts +14 -0
- package/dist/utils/workspaceIdentity.js +21 -0
- package/dist/utils/workspaceIdentity.test.js +30 -1
- package/dist/utils/workspaceSyncPresentation.d.ts +20 -0
- package/dist/utils/workspaceSyncPresentation.js +21 -0
- package/dist/utils/workspaceSyncPresentation.test.d.ts +1 -0
- package/dist/utils/workspaceSyncPresentation.test.js +36 -0
- package/package.json +30 -23
- package/scripts/bootstrap-playwright-auth.mjs +155 -0
- package/scripts/check-compat-boundaries.mjs +41 -0
- package/scripts/check-env.ts +9 -2
- package/scripts/debug-login.mjs +32 -0
- package/scripts/deploy-prod.sh +41 -0
- package/scripts/deploy-staging.sh +23 -0
- package/scripts/migrate-planning-model.ts +233 -0
- package/scripts/migrate-task-data-assets.mjs +408 -0
- package/scripts/playwright-auth.sh +11 -0
- package/scripts/run-dev-proxy.sh +2 -0
- package/scripts/update-homebrew-formula.sh +2 -2
- package/scripts/with-esbuild.sh +11 -0
- package/src/resources/templates/WORKFLOW_V2_POLICY.md +1 -1
- package/src/resources/templates/workflow-sources/workflowDocs.mjs +62 -52
- package/src/resources/templates/workflows/collaborate.yaml +11 -5
- package/src/resources/templates/workflows/do.yaml +8 -2
- package/src/resources/templates/workflows/evaluate.yaml +13 -7
- package/src/resources/templates/workflows/execute.yaml +40 -23
- package/src/resources/templates/workflows/plan.yaml +15 -8
- package/src/resources/templates/workflows/review.yaml +14 -8
- package/dist/TaskforceScreenshot.d.ts +0 -11
- package/dist/TaskforceScreenshot.js +0 -113
- package/dist/compat/priorityCompat.d.ts +0 -2
- package/dist/compat/priorityCompat.js +0 -24
- package/dist/components/features/settings/TaxonomyManager 2.d.ts +0 -52
- package/dist/components/features/settings/TaxonomyManager 2.js +0 -75
- package/dist/components/task/TaskKanban 2.d.ts +0 -76
- package/dist/components/task/TaskKanban 2.js +0 -1004
- package/dist/components/task/TaskScreenshotSection.d.ts +0 -15
- package/dist/components/task/TaskScreenshotSection.js +0 -22
- package/dist/components/views/StandaloneLayout 2.d.ts +0 -8
- package/dist/components/views/StandaloneLayout 2.js +0 -1660
- package/dist/core/InitiativeTemplates.test.js +0 -50
- package/dist/core/ParentLifecycle.test.js +0 -98
- package/dist/migrations/clientMigrations.d.ts +0 -9
- package/dist/migrations/clientMigrations.js +0 -74
- package/dist/migrations/flags.d.ts +0 -6
- package/dist/migrations/flags.js +0 -8
- package/dist/migrations/taskMigrations.d.ts +0 -71
- package/dist/migrations/taskMigrations.js +0 -236
- package/dist/migrations/taskMigrations.test.js +0 -34
- package/dist/server/routes.billing.js +0 -991
- package/dist/server/routes.billing.test.js +0 -387
- package/dist/server/routes.sync.integration.test.js +0 -470
- package/dist/server/routes.sync.js +0 -1141
- package/dist/soak/syncSoakHarness.d.ts +0 -6
- package/dist/soak/syncSoakHarness.js +0 -10
- package/dist/ui/assets/index-0W5vyCpn.css +0 -1
- package/dist/ui/assets/index-MCZuNNfn.js +0 -23
- package/dist/ui/assets/logo_white_01-0Vx-iIIv.png +0 -0
- package/dist/ui/assets/vendor-dnd-BI1K77C1.js +0 -5
- package/dist/ui/assets/vendor-react-DdIDsh7f.js +0 -9
- package/dist/ui/assets/vendor-router-BtiNU7Dl.js +0 -3
- package/dist/utils/taskHierarchy.d.ts +0 -4
- package/dist/utils/taskHierarchy.js +0 -69
- package/dist/utils/taskHierarchy.test.js +0 -38
- package/dist/utils/taskParenting.d.ts +0 -3
- package/dist/utils/taskParenting.js +0 -24
- package/dist/utils/taskParenting.test.js +0 -21
- package/dist/utils/taskRelations.d.ts +0 -6
- package/dist/utils/taskRelations.js +0 -24
- package/dist/utils/taskRelations.test.js +0 -34
- package/scripts/check-compat-boundaries.js +0 -48
- /package/dist/{__tests__/planParser.test.d.ts → TaskforceCore.filter-persistence.test.d.ts} +0 -0
- /package/dist/{__tests__/releaseVersion.test.d.ts → TaskforceCore.routing.test.d.ts} +0 -0
- /package/dist/{__tests__/structuredCommentValidation.test.d.ts → annotatedAttachments/AnnotatedAttachmentSessionStore.test.d.ts} +0 -0
- /package/dist/{__tests__/structuredDocValidation.test.d.ts → annotatedAttachments/payload.test.d.ts} +0 -0
- /package/dist/{__tests__/templateEngine.test.d.ts → annotatedAttachments/types.js} +0 -0
- /package/dist/{__tests__/templates.test.d.ts → compat/workspaceSyncCompat.test.d.ts} +0 -0
- /package/dist/{__tests__/workflowDocumentFixtures.test.d.ts → components/features/AgentsModule.test.d.ts} +0 -0
- /package/dist/{__tests__/workflowExportMatrix.test.d.ts → components/features/AnnotatedAttachmentWorkspace.test.d.ts} +0 -0
- /package/dist/{__tests__/workflowExportSnapshots.test.d.ts → components/features/DocumentWorkspace.test.d.ts} +0 -0
- /package/dist/{__tests__/workflowGeneration.test.d.ts → components/features/settings/TaxonomyLibraryManager.test.d.ts} +0 -0
- /package/dist/{__tests__/workflowV2Policy.test.d.ts → components/task/TaskActionHeader.test.d.ts} +0 -0
- /package/dist/{core/InitiativeTemplates.test.d.ts → components/task/TaskKanban.planning-drop.test.d.ts} +0 -0
- /package/dist/{core/ParentLifecycle.test.d.ts → components/task/TaskStatusActions.test.d.ts} +0 -0
- /package/dist/{migrations/taskMigrations.test.d.ts → components/ui/TopNoticeLayer.test.d.ts} +0 -0
- /package/dist/{server/routes.billing.test.d.ts → components/views/AppShellHeader.test.d.ts} +0 -0
- /package/dist/{server/routes.sync.integration.test.d.ts → components/views/PlanComparisonPage.test.d.ts} +0 -0
- /package/dist/{utils/taskHierarchy.test.d.ts → components/views/chrome/WorkspaceChromeSections.test.d.ts} +0 -0
- /package/dist/{utils/taskParenting.test.d.ts → components/views/chrome/workspaceChrome.test.d.ts} +0 -0
- /package/dist/{utils/taskRelations.test.d.ts → components/views/panels/DocumentFilterToolbar.test.d.ts} +0 -0
- /package/dist/public/{android-chrome-192x192.png → archive/phoenix/android-chrome-192x192.png} +0 -0
- /package/dist/public/{android-chrome-512x512.png → archive/phoenix/android-chrome-512x512.png} +0 -0
- /package/dist/public/{favicon-16x16.png → archive/phoenix/favicon-16x16.png} +0 -0
- /package/dist/public/{favicon-32x32.png → archive/phoenix/favicon-32x32.png} +0 -0
- /package/dist/public/{favicon.png → archive/phoenix/favicon.png} +0 -0
- /package/dist/{__tests__ → services}/workflowExportSnapshots.test.js +0 -0
- /package/dist/{__tests__ → services}/workflowGeneration.test.js +0 -0
- /package/dist/ui/favicon/{android-chrome-192x192.png → archive/phoenix/android-chrome-192x192.png} +0 -0
- /package/dist/ui/favicon/{android-chrome-512x512.png → archive/phoenix/android-chrome-512x512.png} +0 -0
- /package/dist/ui/favicon/{favicon-16x16.png → archive/phoenix/favicon-16x16.png} +0 -0
- /package/dist/ui/favicon/{favicon-32x32.png → archive/phoenix/favicon-32x32.png} +0 -0
- /package/dist/ui/favicon/{favicon.png → archive/phoenix/favicon.png} +0 -0
package/dist/TaskforceCore.js
CHANGED
|
@@ -1,18 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { MemoryRouter, useInRouterContext, useLocation, useNavigate } from 'react-router-dom';
|
|
3
|
+
import { MemoryRouter, Navigate, useInRouterContext, useLocation, useNavigate } from 'react-router-dom';
|
|
4
4
|
import { useTaskforce } from './hooks/useTaskforce';
|
|
5
5
|
import { WidgetView } from './components/views/WidgetView';
|
|
6
6
|
import { StandaloneLayout } from './components/views/StandaloneLayout';
|
|
7
7
|
import styles from './Taskforce.module.css';
|
|
8
|
+
import shellStyles from './components/views/WorkspaceShell.module.css';
|
|
9
|
+
import authStyles from './components/views/AuthShell.module.css';
|
|
8
10
|
import { t } from './localization';
|
|
9
11
|
import { resolveWorkspaceLifecycleState } from './utils/workspaceLifecycle';
|
|
10
|
-
import
|
|
12
|
+
import { listBuiltInTaxonomyLibraryPacks } from './shared/taxonomyLibrary.js';
|
|
13
|
+
import logoLight from './assets/branding/logos/logo_light.svg';
|
|
14
|
+
import logoDark from './assets/branding/logos/logo_dark.svg';
|
|
11
15
|
import taskforceBg from './assets/images/taskforce.png';
|
|
16
|
+
import { isLightThemeFamily } from './utils/theme';
|
|
17
|
+
function isDebugModeEnabled() {
|
|
18
|
+
const runtimeOverride = globalThis.__DEBUG_MODE__;
|
|
19
|
+
if (typeof runtimeOverride === 'boolean')
|
|
20
|
+
return runtimeOverride;
|
|
21
|
+
return typeof __DEBUG_MODE__ !== 'undefined' && __DEBUG_MODE__;
|
|
22
|
+
}
|
|
23
|
+
function buildDebugRegistrationCredentials() {
|
|
24
|
+
const suffix = Date.now().toString(36);
|
|
25
|
+
return {
|
|
26
|
+
email: `debug+${suffix}@example.com`,
|
|
27
|
+
password: 'DebugPass123!',
|
|
28
|
+
displayName: `Debug ${suffix.slice(-4).toUpperCase()}`
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function defaultSetupTaxonomySections(pack) {
|
|
32
|
+
return {
|
|
33
|
+
categories: Boolean(pack?.categories?.length),
|
|
34
|
+
types: Boolean(pack?.types?.length),
|
|
35
|
+
priorities: Boolean(pack?.priorities?.length),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
12
38
|
function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange, onHeaderMouseDown, isDragging, onClose, mode = 'standalone' }) {
|
|
13
39
|
const location = useLocation();
|
|
40
|
+
const routeQuery = useMemo(() => new URLSearchParams(location.search), [location.search]);
|
|
41
|
+
const selectedSignupPlanId = String(routeQuery.get('planId') || '').trim();
|
|
42
|
+
const selectedSignupPlanVersionId = String(routeQuery.get('planVersionId') || '').trim();
|
|
43
|
+
const selectedSignupInterval = String(routeQuery.get('interval') || '').trim();
|
|
44
|
+
const isPricingRoute = location.pathname === '/pricing';
|
|
45
|
+
const isPlansRoute = location.pathname === '/plans';
|
|
46
|
+
const isPlansScreen = location.pathname === '/' && String(routeQuery.get('screen') || '').trim().toLowerCase() === 'plans';
|
|
47
|
+
const planSelectionPath = '/?screen=plans&gate=plan_selection_required';
|
|
14
48
|
const navigate = useNavigate();
|
|
15
49
|
const [loginEmail, setLoginEmail] = useState('');
|
|
50
|
+
const [loginDisplayName, setLoginDisplayName] = useState('');
|
|
16
51
|
const [loginPassword, setLoginPassword] = useState('');
|
|
17
52
|
const [authMode, setAuthMode] = useState('login');
|
|
18
53
|
const [verificationToken, setVerificationToken] = useState('');
|
|
@@ -20,6 +55,8 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
20
55
|
const [inviteToken, setInviteToken] = useState('');
|
|
21
56
|
const [inviteEmail, setInviteEmail] = useState(null);
|
|
22
57
|
const [inviteWorkspaceId, setInviteWorkspaceId] = useState(null);
|
|
58
|
+
const [inviteResolution, setInviteResolution] = useState('unknown');
|
|
59
|
+
const [invitePasswordRequired, setInvitePasswordRequired] = useState(false);
|
|
23
60
|
const [loginNotice, setLoginNotice] = useState(null);
|
|
24
61
|
const [loginError, setLoginError] = useState(null);
|
|
25
62
|
const [loginErrorCode, setLoginErrorCode] = useState(null);
|
|
@@ -39,7 +76,14 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
39
76
|
const [cloudWorkspaceLoading, setCloudWorkspaceLoading] = useState(false);
|
|
40
77
|
const [cloudWorkspaceError, setCloudWorkspaceError] = useState(null);
|
|
41
78
|
const [syncNewLocalWorkspaceToCloud, setSyncNewLocalWorkspaceToCloud] = useState(false);
|
|
79
|
+
const fallbackSetupLibraryPacks = useMemo(() => listBuiltInTaxonomyLibraryPacks(), []);
|
|
80
|
+
const [setupLibraryPacks, setSetupLibraryPacks] = useState(fallbackSetupLibraryPacks);
|
|
81
|
+
const [selectedSetupPackId, setSelectedSetupPackId] = useState(() => (fallbackSetupLibraryPacks.find((pack) => pack.isDefaultStarter)?.id || fallbackSetupLibraryPacks[0]?.id || ''));
|
|
82
|
+
const [setupTaxonomySections, setSetupTaxonomySections] = useState(() => (defaultSetupTaxonomySections(fallbackSetupLibraryPacks.find((pack) => pack.isDefaultStarter) || fallbackSetupLibraryPacks[0] || null)));
|
|
83
|
+
const [setupLibraryLoading, setSetupLibraryLoading] = useState(false);
|
|
84
|
+
const [setupLibraryError, setSetupLibraryError] = useState(null);
|
|
42
85
|
const [bootstrapRetryBusy, setBootstrapRetryBusy] = useState(false);
|
|
86
|
+
const [accountAccessGate, setAccountAccessGate] = useState(null);
|
|
43
87
|
// Initialize the hook
|
|
44
88
|
const taskforceState = useTaskforce({
|
|
45
89
|
config,
|
|
@@ -47,7 +91,15 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
47
91
|
onTaskCountChange,
|
|
48
92
|
onClose
|
|
49
93
|
});
|
|
50
|
-
const { runtimeMode, workspaceSwitchingEnabled, currentWorkspaceId, configLoaded, cloudAuthConfigured, authRequiredForApi, authBlocked, isAuthenticated, hasBetaAccess, authSessionResolved, workspaceBootstrapPending, bootstrapPhase, bootstrapError, setupState, runtimeCapabilities, refreshSetupContext, retryBootstrapChecks, saveWorkspaceProfile, fetchWorkspaces, applyWorkspaceSyncStateSnapshot, loginWithCredentials, registerWithCredentials, requestEmailVerification, confirmEmailVerification, requestPasswordReset, confirmPasswordReset, inspectInviteAcceptance, acceptInviteWithToken, currentTheme, logout } = taskforceState;
|
|
94
|
+
const { runtimeMode, workspaceSwitchingEnabled, currentWorkspaceId, configLoaded, cloudAuthConfigured, authRequiredForApi, authBlocked, isAuthenticated, hasBetaAccess, authSessionResolved, workspaceBootstrapPending, bootstrapPhase, bootstrapError, setupState, runtimeCapabilities, refreshSetupContext, retryBootstrapChecks, createWorkspace, saveWorkspaceProfile, fetchWorkspaces, applyWorkspaceSyncStateSnapshot, settingsModel, fetchTasks, loginWithCredentials, registerWithCredentials, requestEmailVerification, confirmEmailVerification, requestPasswordReset, confirmPasswordReset, inspectInviteAcceptance, acceptInviteWithToken, joinInviteWithToken, authUserEmail, currentTheme, logout } = taskforceState;
|
|
95
|
+
const selectedSetupPack = useMemo(() => {
|
|
96
|
+
return setupLibraryPacks.find((pack) => pack.id === selectedSetupPackId)
|
|
97
|
+
|| setupLibraryPacks.find((pack) => pack.isDefaultStarter)
|
|
98
|
+
|| setupLibraryPacks[0]
|
|
99
|
+
|| null;
|
|
100
|
+
}, [selectedSetupPackId, setupLibraryPacks]);
|
|
101
|
+
const brandLogo = isLightThemeFamily(currentTheme) ? logoDark : logoLight;
|
|
102
|
+
const authBrandLogo = logoLight;
|
|
51
103
|
const normalizedCloudAuthBase = useMemo(() => {
|
|
52
104
|
const raw = String(config.cloudAuthBaseUrl || config.apiBaseUrl || '').trim();
|
|
53
105
|
if (!raw)
|
|
@@ -59,18 +111,31 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
59
111
|
const isLikelyCloudAppHost = typeof window !== 'undefined' && /^app\./i.test(window.location.hostname);
|
|
60
112
|
const isCloudAuthRequired = runtimeMode === 'cloud' && authRequiredForApi;
|
|
61
113
|
const shouldForceForAuthBlocked = runtimeMode === 'cloud' && authBlocked;
|
|
62
|
-
const shouldForceLogin = isLikelyCloudAppHost
|
|
63
|
-
? (!isAuthenticated || authBlocked)
|
|
64
|
-
: ((isCloudAuthRequired && !isAuthenticated) || shouldForceForAuthBlocked);
|
|
65
|
-
const shouldForceComingSoon = runtimeMode === 'cloud' && isAuthenticated && !hasBetaAccess;
|
|
66
114
|
const isLoginRoute = location.pathname === '/login';
|
|
67
115
|
const isSetupRoute = location.pathname === '/setup';
|
|
68
116
|
const isComingSoonRoute = location.pathname === '/coming-soon';
|
|
117
|
+
const shouldForceLogin = isLikelyCloudAppHost
|
|
118
|
+
? ((!isAuthenticated || authBlocked) && !isPricingRoute && !isPlansRoute && !isPlansScreen)
|
|
119
|
+
: (((isCloudAuthRequired && !isAuthenticated) || shouldForceForAuthBlocked) && !isPricingRoute && !isPlansRoute && !isPlansScreen);
|
|
120
|
+
const shouldForceComingSoon = runtimeMode === 'cloud' && isAuthenticated && !hasBetaAccess && !isPricingRoute && !isPlansRoute && !isPlansScreen;
|
|
121
|
+
const shouldForceAccountAccessGate = runtimeMode === 'cloud'
|
|
122
|
+
&& isAuthenticated
|
|
123
|
+
&& authSessionResolved
|
|
124
|
+
&& accountAccessGate?.canAccessApp === false
|
|
125
|
+
&& accountAccessGate?.canAccessPlans !== false
|
|
126
|
+
&& !isPricingRoute
|
|
127
|
+
&& !isPlansRoute
|
|
128
|
+
&& !isPlansScreen;
|
|
69
129
|
const setupStep = useMemo(() => String(new URLSearchParams(location.search).get('step') || '').trim().toLowerCase(), [location.search]);
|
|
130
|
+
const setupIntent = useMemo(() => String(new URLSearchParams(location.search).get('intent') || '').trim().toLowerCase(), [location.search]);
|
|
131
|
+
const isCreateWorkspaceIntent = isSetupRoute && setupStep === 'workspace' && setupIntent === 'create-workspace';
|
|
70
132
|
const shouldHoldForAuthBootstrap = mode !== 'widget'
|
|
71
133
|
&& !authSessionResolved
|
|
72
134
|
&& !isLoginRoute
|
|
73
135
|
&& !isSetupRoute
|
|
136
|
+
&& !isPricingRoute
|
|
137
|
+
&& !isPlansRoute
|
|
138
|
+
&& !isPlansScreen
|
|
74
139
|
&& (runtimeMode === 'cloud' || isLikelyCloudAppHost);
|
|
75
140
|
const workspaceLifecycle = useMemo(() => resolveWorkspaceLifecycleState({
|
|
76
141
|
setupState: setupState
|
|
@@ -96,6 +161,9 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
96
161
|
&& authSessionResolved
|
|
97
162
|
&& !shouldForceLogin
|
|
98
163
|
&& !shouldForceComingSoon
|
|
164
|
+
&& !isPricingRoute
|
|
165
|
+
&& !isPlansRoute
|
|
166
|
+
&& !isPlansScreen
|
|
99
167
|
&& (!configLoaded || workspaceBootstrapPending || bootstrapPhase === 'stalled')
|
|
100
168
|
&& (isSetupRoute || runtimeMode === 'cloud' || isLikelyCloudAppHost);
|
|
101
169
|
const bootstrapSubtitle = useMemo(() => {
|
|
@@ -123,6 +191,48 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
123
191
|
setSetupModeChoice(modeValue);
|
|
124
192
|
}, [setupState?.mode]);
|
|
125
193
|
useEffect(() => {
|
|
194
|
+
if (runtimeMode !== 'cloud' || !isAuthenticated || !authSessionResolved) {
|
|
195
|
+
setAccountAccessGate(null);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
setAccountAccessGate(null);
|
|
199
|
+
let cancelled = false;
|
|
200
|
+
(async () => {
|
|
201
|
+
try {
|
|
202
|
+
const res = await fetch('/api/taskforce/account/access-status', {
|
|
203
|
+
method: 'GET',
|
|
204
|
+
credentials: 'include'
|
|
205
|
+
});
|
|
206
|
+
const payload = await res.json().catch(() => ({}));
|
|
207
|
+
if (cancelled || !res.ok)
|
|
208
|
+
return;
|
|
209
|
+
const gate = String(payload?.gate || '').trim().toLowerCase();
|
|
210
|
+
if (gate !== 'ok' && gate !== 'plan_selection_required' && gate !== 'misconfigured' && gate !== 'missing_entitlement') {
|
|
211
|
+
setAccountAccessGate(null);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
setAccountAccessGate({
|
|
215
|
+
gate,
|
|
216
|
+
canAccessApp: payload?.canAccessApp === true,
|
|
217
|
+
canAccessPlans: payload?.canAccessPlans !== false,
|
|
218
|
+
message: typeof payload?.message === 'string' ? payload.message : null
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
if (!cancelled)
|
|
223
|
+
setAccountAccessGate(null);
|
|
224
|
+
}
|
|
225
|
+
})();
|
|
226
|
+
return () => {
|
|
227
|
+
cancelled = true;
|
|
228
|
+
};
|
|
229
|
+
}, [authSessionResolved, isAuthenticated, runtimeMode, location.pathname, location.search]);
|
|
230
|
+
useEffect(() => {
|
|
231
|
+
if (isCreateWorkspaceIntent) {
|
|
232
|
+
setWorkspaceNameInput('');
|
|
233
|
+
setWorkspaceDescriptionInput('');
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
126
236
|
if (!setupState)
|
|
127
237
|
return;
|
|
128
238
|
const currentName = String(setupState.workspace?.name || '').trim();
|
|
@@ -137,6 +247,7 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
137
247
|
setupState?.workspace?.description,
|
|
138
248
|
setupState?.suggestedWorkspaceName,
|
|
139
249
|
setupState?.workspaceId,
|
|
250
|
+
isCreateWorkspaceIntent,
|
|
140
251
|
isPlaceholderWorkspaceName
|
|
141
252
|
]);
|
|
142
253
|
useEffect(() => {
|
|
@@ -200,6 +311,45 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
200
311
|
return;
|
|
201
312
|
void fetchCloudWorkspaceOptions();
|
|
202
313
|
}, [fetchCloudWorkspaceOptions, workspaceSetupSource]);
|
|
314
|
+
useEffect(() => {
|
|
315
|
+
if (!isSetupRoute || setupStep !== 'workspace' || workspaceSetupSource === 'cloud')
|
|
316
|
+
return;
|
|
317
|
+
let cancelled = false;
|
|
318
|
+
setSetupLibraryLoading(true);
|
|
319
|
+
setSetupLibraryError(null);
|
|
320
|
+
void fetch('/api/taskforce/taxonomy-library', {
|
|
321
|
+
method: 'GET',
|
|
322
|
+
credentials: 'include'
|
|
323
|
+
})
|
|
324
|
+
.then(async (res) => {
|
|
325
|
+
if (!res.ok)
|
|
326
|
+
throw new Error(`Failed to load starter libraries (${res.status})`);
|
|
327
|
+
const payload = await res.json().catch(() => ({}));
|
|
328
|
+
const nextPacks = Array.isArray(payload?.packs) ? payload.packs : [];
|
|
329
|
+
if (cancelled || nextPacks.length === 0)
|
|
330
|
+
return;
|
|
331
|
+
setSetupLibraryPacks(nextPacks);
|
|
332
|
+
setSelectedSetupPackId((current) => (nextPacks.some((pack) => pack.id === current)
|
|
333
|
+
? current
|
|
334
|
+
: (nextPacks.find((pack) => pack.isDefaultStarter)?.id || nextPacks[0]?.id || '')));
|
|
335
|
+
})
|
|
336
|
+
.catch((error) => {
|
|
337
|
+
if (cancelled)
|
|
338
|
+
return;
|
|
339
|
+
setSetupLibraryPacks(fallbackSetupLibraryPacks);
|
|
340
|
+
setSetupLibraryError(error instanceof Error ? error.message : 'Failed to load starter libraries.');
|
|
341
|
+
})
|
|
342
|
+
.finally(() => {
|
|
343
|
+
if (!cancelled)
|
|
344
|
+
setSetupLibraryLoading(false);
|
|
345
|
+
});
|
|
346
|
+
return () => {
|
|
347
|
+
cancelled = true;
|
|
348
|
+
};
|
|
349
|
+
}, [fallbackSetupLibraryPacks, isSetupRoute, setupStep, workspaceSetupSource]);
|
|
350
|
+
useEffect(() => {
|
|
351
|
+
setSetupTaxonomySections(defaultSetupTaxonomySections(selectedSetupPack));
|
|
352
|
+
}, [selectedSetupPackId, selectedSetupPack]);
|
|
203
353
|
const nextPath = useMemo(() => {
|
|
204
354
|
const raw = new URLSearchParams(location.search).get('next') || '/';
|
|
205
355
|
if (!raw.startsWith('/'))
|
|
@@ -269,19 +419,47 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
269
419
|
if (inspected.success) {
|
|
270
420
|
setInviteEmail(inspected.email || null);
|
|
271
421
|
setInviteWorkspaceId(inspected.workspaceId || null);
|
|
272
|
-
|
|
422
|
+
setInvitePasswordRequired(inspected.passwordRequired === true);
|
|
423
|
+
const inviteMatchesAuthenticatedUser = Boolean(isAuthenticated
|
|
424
|
+
&& authUserEmail
|
|
425
|
+
&& inspected.email
|
|
426
|
+
&& authUserEmail.trim().toLowerCase() === inspected.email.trim().toLowerCase());
|
|
427
|
+
const nextResolution = inspected.passwordRequired === true
|
|
428
|
+
? 'new_user'
|
|
429
|
+
: (inviteMatchesAuthenticatedUser ? 'existing_user_ready' : 'existing_user_signed_out');
|
|
430
|
+
setInviteResolution(nextResolution);
|
|
431
|
+
if (nextResolution === 'new_user') {
|
|
432
|
+
setLoginNotice('Create your account password to join this workspace.');
|
|
433
|
+
}
|
|
434
|
+
else if (nextResolution === 'existing_user_ready') {
|
|
435
|
+
setLoginNotice('Invite ready. Confirm to join this workspace.');
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
setLoginNotice('Sign in with the invited account to join this workspace.');
|
|
439
|
+
}
|
|
273
440
|
setLoginError(null);
|
|
274
441
|
setLoginErrorCode(null);
|
|
275
442
|
}
|
|
276
443
|
else {
|
|
277
444
|
setInviteEmail(null);
|
|
278
445
|
setInviteWorkspaceId(null);
|
|
446
|
+
setInviteResolution('invalid');
|
|
447
|
+
setInvitePasswordRequired(false);
|
|
279
448
|
setLoginError(formatAuthError(inspected));
|
|
280
449
|
setLoginErrorCode(inspected.code || inspected.state || null);
|
|
281
450
|
}
|
|
282
451
|
})();
|
|
283
452
|
return () => { active = false; };
|
|
284
|
-
}, [isLoginRoute, authMode, inviteToken, inspectInviteAcceptance]);
|
|
453
|
+
}, [isLoginRoute, authMode, inviteToken, inspectInviteAcceptance, isAuthenticated, authUserEmail]);
|
|
454
|
+
useEffect(() => {
|
|
455
|
+
if (authMode !== 'invite')
|
|
456
|
+
return;
|
|
457
|
+
if (inviteResolution !== 'existing_user_signed_out')
|
|
458
|
+
return;
|
|
459
|
+
if (!inviteEmail)
|
|
460
|
+
return;
|
|
461
|
+
setLoginEmail((prev) => prev.trim() ? prev : inviteEmail);
|
|
462
|
+
}, [authMode, inviteResolution, inviteEmail]);
|
|
285
463
|
useEffect(() => {
|
|
286
464
|
const hasCooldown = verifyCooldownUntil > Date.now() || resetCooldownUntil > Date.now();
|
|
287
465
|
if (!hasCooldown)
|
|
@@ -313,7 +491,10 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
313
491
|
return;
|
|
314
492
|
}
|
|
315
493
|
if (!shouldForceLogin) {
|
|
316
|
-
|
|
494
|
+
const shouldStayOnInviteRoute = isLoginRoute
|
|
495
|
+
&& authMode === 'invite'
|
|
496
|
+
&& inviteToken.trim().length > 0;
|
|
497
|
+
if (isLoginRoute && isAuthenticated && !shouldStayOnInviteRoute)
|
|
317
498
|
navigate(nextPath, { replace: true });
|
|
318
499
|
}
|
|
319
500
|
else {
|
|
@@ -324,6 +505,13 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
324
505
|
}
|
|
325
506
|
return;
|
|
326
507
|
}
|
|
508
|
+
if (shouldForceAccountAccessGate) {
|
|
509
|
+
if (!isPlansScreen) {
|
|
510
|
+
const gate = encodeURIComponent(String(accountAccessGate?.gate || 'plan_selection_required'));
|
|
511
|
+
navigate(`/?screen=plans&gate=${gate}`, { replace: true });
|
|
512
|
+
}
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
327
515
|
if (setupGateActive) {
|
|
328
516
|
if (hasSetupReadError) {
|
|
329
517
|
if (!isSetupRoute || setupStep !== 'error') {
|
|
@@ -348,19 +536,24 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
348
536
|
}
|
|
349
537
|
return;
|
|
350
538
|
}
|
|
351
|
-
if (isSetupRoute && setupState) {
|
|
539
|
+
if (isSetupRoute && setupState && !isCreateWorkspaceIntent) {
|
|
352
540
|
navigate('/', { replace: true });
|
|
353
541
|
}
|
|
354
542
|
}, [
|
|
355
543
|
mode,
|
|
356
544
|
shouldForceLogin,
|
|
357
545
|
shouldForceComingSoon,
|
|
546
|
+
shouldForceAccountAccessGate,
|
|
358
547
|
isLoginRoute,
|
|
359
548
|
isSetupRoute,
|
|
360
549
|
isComingSoonRoute,
|
|
550
|
+
isPlansRoute,
|
|
551
|
+
isPlansScreen,
|
|
552
|
+
accountAccessGate?.gate,
|
|
361
553
|
setupGateActive,
|
|
362
554
|
setupState,
|
|
363
555
|
hasSetupReadError,
|
|
556
|
+
isCreateWorkspaceIntent,
|
|
364
557
|
needsGlobalSetup,
|
|
365
558
|
needsWorkspaceSetup,
|
|
366
559
|
setupStep,
|
|
@@ -402,16 +595,45 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
402
595
|
if (mode === 'widget') {
|
|
403
596
|
return (_jsx(WidgetView, { ...taskforceState, onHeaderMouseDown: onHeaderMouseDown, isDragging: isDragging, onClose: onClose }));
|
|
404
597
|
}
|
|
598
|
+
if (isPricingRoute) {
|
|
599
|
+
const params = new URLSearchParams(location.search);
|
|
600
|
+
params.set('screen', 'plans');
|
|
601
|
+
return _jsx(Navigate, { to: `/?${params.toString()}${location.hash || ''}`, replace: true });
|
|
602
|
+
}
|
|
603
|
+
if (isPlansRoute) {
|
|
604
|
+
const params = new URLSearchParams(location.search);
|
|
605
|
+
params.set('screen', 'plans');
|
|
606
|
+
return _jsx(Navigate, { to: `/?${params.toString()}${location.hash || ''}`, replace: true });
|
|
607
|
+
}
|
|
405
608
|
if (shouldHoldForAuthBootstrap) {
|
|
406
|
-
return (_jsx("div", { className:
|
|
609
|
+
return (_jsx("div", { className: shellStyles.standaloneWrapper, "data-theme": currentTheme, children: _jsx("div", { className: authStyles.loginView, children: _jsxs("div", { className: authStyles.loginCard, children: [_jsxs("div", { className: authStyles.authBrandRow, children: [_jsx("img", { src: authBrandLogo, alt: "Taskforce", className: authStyles.loginLogo }), _jsx("h1", { className: authStyles.loginTitle, children: "Loading Taskforce" })] }), _jsx("p", { className: authStyles.loginSubtitle, children: "Checking your session..." })] }) }) }));
|
|
407
610
|
}
|
|
408
611
|
if (shouldHoldForSetupBootstrap) {
|
|
409
|
-
return (_jsx("div", { className:
|
|
612
|
+
return (_jsx("div", { className: shellStyles.standaloneWrapper, "data-theme": currentTheme, children: _jsx("div", { className: authStyles.loginView, children: _jsxs("div", { className: authStyles.loginCard, children: [_jsxs("div", { className: authStyles.authBrandRow, children: [_jsx("img", { src: authBrandLogo, alt: "Taskforce", className: authStyles.loginLogo }), _jsx("h1", { className: authStyles.loginTitle, children: "Loading Taskforce" })] }), _jsx("p", { className: authStyles.loginSubtitle, children: bootstrapSubtitle }), bootstrapPhase === 'stalled' && (_jsxs(_Fragment, { children: [_jsx("p", { className: authStyles.loginError, children: bootstrapError || 'Startup checks timed out.' }), _jsx("button", { className: styles.submitBtn, disabled: bootstrapRetryBusy, onClick: handleRetryBootstrap, children: bootstrapRetryBusy ? 'Retrying...' : 'Retry checks' }), isCloudRuntime && (_jsx("button", { className: styles.cancelBtn, disabled: bootstrapRetryBusy, onClick: handleGoToSignIn, children: "Go to sign-in" }))] }))] }) }) }));
|
|
410
613
|
}
|
|
411
614
|
if (isLoginRoute) {
|
|
412
|
-
return (_jsx("div", { className:
|
|
615
|
+
return (_jsx("div", { className: shellStyles.standaloneWrapper, "data-theme": currentTheme, children: _jsx("div", { className: authStyles.loginView, style: {
|
|
413
616
|
backgroundImage: `linear-gradient(rgba(15, 15, 26, 0.88), rgba(15, 15, 26, 0.9)), url(${taskforceBg})`
|
|
414
|
-
}, children: _jsxs("div", { className:
|
|
617
|
+
}, children: _jsxs("div", { className: authStyles.loginCard, children: [!isCloudRuntime && !shouldForceLogin && (_jsx("button", { className: authStyles.loginCloseBtn, "aria-label": "Close sign in", onClick: () => navigate(nextPath, { replace: true }), children: "\u00D7" })), _jsxs("div", { className: authStyles.authBrandRow, children: [_jsx("img", { src: authBrandLogo, alt: "Taskforce", className: authStyles.loginLogo }), _jsxs("h1", { className: authStyles.loginTitle, children: ["TASKFORCE ", _jsx("span", { className: authStyles.loginTitleAccent, children: "HQ" })] })] }), _jsxs("p", { className: authStyles.loginSubtitle, children: [authMode === 'login' && 'Sign in with your account credentials.', authMode === 'register' && 'Create your Taskforce account.', authMode === 'verify' && 'Enter your verification token.', authMode === 'forgot' && 'Request a password reset link.', authMode === 'reset' && 'Set a new password using your reset token.', authMode === 'invite' && (inviteResolution === 'existing_user_ready'
|
|
618
|
+
? `You've been invited to join ${inviteWorkspaceId || 'this workspace'}.`
|
|
619
|
+
: inviteResolution === 'existing_user_signed_out'
|
|
620
|
+
? 'Sign in to join this workspace.'
|
|
621
|
+
: 'Create your account to join this workspace.')] }), (authMode === 'login' || authMode === 'register' || authMode === 'forgot' || (authMode === 'invite' && inviteResolution === 'existing_user_signed_out')) && (_jsx("input", { className: `${styles.input} ${authStyles.loginInput}`, type: "email", value: loginEmail, placeholder: "Email", onChange: (event) => setLoginEmail(event.target.value) })), authMode === 'register' && (_jsx("input", { className: `${styles.input} ${authStyles.loginInput}`, type: "text", value: loginDisplayName, placeholder: "Display name", onChange: (event) => setLoginDisplayName(event.target.value) })), (authMode === 'login'
|
|
622
|
+
|| authMode === 'register'
|
|
623
|
+
|| authMode === 'reset'
|
|
624
|
+
|| (authMode === 'invite' && (invitePasswordRequired || inviteResolution === 'existing_user_signed_out'))) && (_jsx("input", { className: `${styles.input} ${authStyles.loginInput}`, type: "password", value: loginPassword, placeholder: authMode === 'reset'
|
|
625
|
+
? 'New password'
|
|
626
|
+
: (authMode === 'invite'
|
|
627
|
+
? (invitePasswordRequired ? 'Create password' : 'Password')
|
|
628
|
+
: 'Password'), onChange: (event) => setLoginPassword(event.target.value) })), authMode === 'register' && isDebugModeEnabled() && (_jsx("button", { className: authStyles.authModeLink, type: "button", disabled: loginBusy, onClick: () => {
|
|
629
|
+
const credentials = buildDebugRegistrationCredentials();
|
|
630
|
+
setLoginEmail(credentials.email);
|
|
631
|
+
setLoginDisplayName(credentials.displayName);
|
|
632
|
+
setLoginPassword(credentials.password);
|
|
633
|
+
setLoginNotice(null);
|
|
634
|
+
setLoginError(null);
|
|
635
|
+
setLoginErrorCode(null);
|
|
636
|
+
}, children: "Fill Form" })), authMode === 'verify' && (_jsx("input", { className: `${styles.input} ${authStyles.loginInput}`, type: "text", value: verificationToken, placeholder: "Verification token", onChange: (event) => setVerificationToken(event.target.value) })), authMode === 'reset' && (_jsx("input", { className: `${styles.input} ${authStyles.loginInput}`, type: "text", value: resetToken, placeholder: "Reset token", onChange: (event) => setResetToken(event.target.value) })), authMode === 'invite' && (_jsxs(_Fragment, { children: [_jsx("input", { className: `${styles.input} ${authStyles.loginInput}`, type: "text", value: inviteToken, placeholder: "Invite token", onChange: (event) => setInviteToken(event.target.value) }), inviteEmail && (_jsxs("p", { className: authStyles.loginSubtitle, children: ["Invite for: ", _jsx("strong", { children: inviteEmail }), inviteWorkspaceId ? ` · Workspace: ${inviteWorkspaceId}` : ''] }))] })), loginNotice && _jsx("p", { className: authStyles.loginSubtitle, children: loginNotice }), loginError && _jsx("p", { className: authStyles.loginError, children: loginError }), authMode === 'login' && loginErrorCode === 'EMAIL_NOT_VERIFIED' && loginEmail.trim() && (_jsx("button", { className: authStyles.authModeLink, disabled: loginBusy || verifyCooldownActive, onClick: async () => {
|
|
415
637
|
setLoginBusy(true);
|
|
416
638
|
setLoginNotice(null);
|
|
417
639
|
const sent = await requestEmailVerification(loginEmail);
|
|
@@ -428,17 +650,27 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
428
650
|
setLoginError(formatAuthError(sent));
|
|
429
651
|
}
|
|
430
652
|
setLoginBusy(false);
|
|
431
|
-
}, children: verifyCooldownActive ? `Resend in ${verifyCooldownSeconds}s` : 'Resend Verification Email' })), _jsx("button", { className: styles.submitBtn
|
|
653
|
+
}, children: verifyCooldownActive ? `Resend in ${verifyCooldownSeconds}s` : 'Resend Verification Email' })), _jsx("button", { className: `${styles.submitBtn} ${authStyles.loginPrimaryBtn}`, disabled: loginBusy || (authMode === 'verify' && verifyCooldownActive) || (authMode === 'forgot' && resetCooldownActive), onClick: async () => {
|
|
432
654
|
setLoginBusy(true);
|
|
433
655
|
setLoginNotice(null);
|
|
434
656
|
setLoginError(null);
|
|
435
657
|
setLoginErrorCode(null);
|
|
658
|
+
if (authMode === 'register' && !loginDisplayName.trim()) {
|
|
659
|
+
setLoginError('Display name is required.');
|
|
660
|
+
setLoginBusy(false);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
436
663
|
let result = { success: false };
|
|
437
664
|
if (authMode === 'login') {
|
|
438
665
|
result = await loginWithCredentials(loginEmail, loginPassword);
|
|
439
666
|
}
|
|
440
667
|
else if (authMode === 'register') {
|
|
441
|
-
result = await registerWithCredentials(loginEmail, loginPassword
|
|
668
|
+
result = await registerWithCredentials(loginEmail, loginPassword, {
|
|
669
|
+
displayName: loginDisplayName,
|
|
670
|
+
planId: selectedSignupPlanId || undefined,
|
|
671
|
+
planVersionId: selectedSignupPlanVersionId || undefined,
|
|
672
|
+
interval: selectedSignupInterval || undefined
|
|
673
|
+
});
|
|
442
674
|
}
|
|
443
675
|
else if (authMode === 'verify') {
|
|
444
676
|
result = await confirmEmailVerification(verificationToken);
|
|
@@ -450,9 +682,24 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
450
682
|
result = await confirmPasswordReset(resetToken, loginPassword);
|
|
451
683
|
}
|
|
452
684
|
else if (authMode === 'invite') {
|
|
453
|
-
|
|
685
|
+
if (inviteResolution === 'existing_user_signed_out') {
|
|
686
|
+
result = await loginWithCredentials(loginEmail, loginPassword);
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
result = invitePasswordRequired
|
|
690
|
+
? await acceptInviteWithToken(inviteToken, loginPassword)
|
|
691
|
+
: await joinInviteWithToken(inviteToken);
|
|
692
|
+
}
|
|
454
693
|
}
|
|
455
694
|
if (!result.success) {
|
|
695
|
+
if (authMode === 'register'
|
|
696
|
+
&& (result.code === 'SIGNUP_PLAN_NOT_ENABLED'
|
|
697
|
+
|| result.code === 'SIGNUP_PLAN_VERSION_NOT_FOUND'
|
|
698
|
+
|| result.code === 'SIGNUP_PLAN_VERSION_REQUIRED')) {
|
|
699
|
+
navigate(planSelectionPath, { replace: true });
|
|
700
|
+
setLoginBusy(false);
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
456
703
|
setLoginError(formatAuthError(result));
|
|
457
704
|
setLoginErrorCode(result.code || null);
|
|
458
705
|
if (authMode === 'login' && (result.code === 'WORKSPACE_NOT_FOUND' || result.code === 'WORKSPACE_ID_REQUIRED')) {
|
|
@@ -478,17 +725,27 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
478
725
|
setLoginBusy(false);
|
|
479
726
|
return;
|
|
480
727
|
}
|
|
481
|
-
if (result.
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
728
|
+
if (result.verificationRequired) {
|
|
729
|
+
if (result.verificationToken)
|
|
730
|
+
setVerificationToken(result.verificationToken);
|
|
731
|
+
setVerifyCooldownUntil(Date.now() + 30_000);
|
|
732
|
+
setLoginMode('verify');
|
|
733
|
+
setLoginNotice(result.emailSent === false
|
|
734
|
+
? `Account created, but verification email failed to send. ${result.emailError || 'Try Resend Verification again.'}`
|
|
735
|
+
: 'Account created. Check your email for verification instructions.');
|
|
736
|
+
}
|
|
737
|
+
else {
|
|
738
|
+
setLoginEmail('');
|
|
739
|
+
setLoginDisplayName('');
|
|
740
|
+
setLoginPassword('');
|
|
741
|
+
navigate(nextPath, { replace: true });
|
|
742
|
+
}
|
|
488
743
|
}
|
|
489
744
|
else if (authMode === 'verify') {
|
|
490
|
-
|
|
491
|
-
|
|
745
|
+
await retryBootstrapChecks();
|
|
746
|
+
setLoginEmail('');
|
|
747
|
+
setLoginPassword('');
|
|
748
|
+
navigate(nextPath, { replace: true });
|
|
492
749
|
}
|
|
493
750
|
else if (authMode === 'forgot') {
|
|
494
751
|
if (result.resetToken)
|
|
@@ -504,6 +761,13 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
504
761
|
setLoginNotice('Password updated. Sign in with your new password.');
|
|
505
762
|
}
|
|
506
763
|
else if (authMode === 'invite') {
|
|
764
|
+
if (inviteResolution === 'existing_user_signed_out') {
|
|
765
|
+
setAuthMode('invite');
|
|
766
|
+
setLoginPassword('');
|
|
767
|
+
setLoginNotice('Signed in. Review the invite details to continue.');
|
|
768
|
+
setLoginBusy(false);
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
507
771
|
if (result.workspaceSetupRequired) {
|
|
508
772
|
navigate('/setup?step=workspace', { replace: true });
|
|
509
773
|
setLoginBusy(false);
|
|
@@ -512,17 +776,26 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
512
776
|
navigate(nextPath, { replace: true });
|
|
513
777
|
}
|
|
514
778
|
else if (authMode === 'login') {
|
|
779
|
+
if (inviteToken.trim()) {
|
|
780
|
+
setAuthMode('invite');
|
|
781
|
+
setLoginPassword('');
|
|
782
|
+
setLoginNotice('Signed in. Review the invite details to continue.');
|
|
783
|
+
setLoginBusy(false);
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
515
786
|
if (result.workspaceSetupRequired) {
|
|
516
787
|
navigate('/setup?step=workspace', { replace: true });
|
|
517
788
|
setLoginBusy(false);
|
|
518
789
|
return;
|
|
519
790
|
}
|
|
520
791
|
setLoginEmail('');
|
|
792
|
+
setLoginDisplayName('');
|
|
521
793
|
setLoginPassword('');
|
|
522
794
|
navigate(nextPath, { replace: true });
|
|
523
795
|
}
|
|
524
796
|
else {
|
|
525
797
|
setLoginEmail('');
|
|
798
|
+
setLoginDisplayName('');
|
|
526
799
|
setLoginPassword('');
|
|
527
800
|
navigate(nextPath, { replace: true });
|
|
528
801
|
}
|
|
@@ -535,40 +808,51 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
535
808
|
? (resetCooldownActive ? `Retry in ${resetCooldownSeconds}s` : 'Send Reset Link')
|
|
536
809
|
: authMode === 'reset'
|
|
537
810
|
? 'Reset Password'
|
|
538
|
-
:
|
|
811
|
+
: (inviteResolution === 'existing_user_signed_out'
|
|
812
|
+
? 'Sign In to Continue'
|
|
813
|
+
: (invitePasswordRequired ? 'Create Account and Join' : 'Join Workspace'))) }), authMode === 'register' && (_jsxs("p", { className: authStyles.registerConsent, children: ["By creating an account, you agree to the", ' ', _jsx("a", { className: authStyles.registerConsentLink, href: "https://taskforcehq.com/legal/terms", target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }), ' ', "and acknowledge the", ' ', _jsx("a", { className: authStyles.registerConsentLink, href: "https://taskforcehq.com/legal/privacy", target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }), "."] })), (authMode === 'login' || authMode === 'register') && (_jsxs("p", { className: authStyles.authModeSwitch, children: [authMode === 'login' ? 'Need an account?' : 'Already have an account?', ' ', _jsx("button", { className: authStyles.authModeSwitchLink, disabled: loginBusy, onClick: () => {
|
|
539
814
|
setLoginError(null);
|
|
540
815
|
setLoginErrorCode(null);
|
|
541
816
|
setLoginNotice(null);
|
|
542
817
|
setLoginMode(authMode === 'login' ? 'register' : 'login');
|
|
543
|
-
}, children: authMode === 'login' ? 'Register' : 'Sign In' })] })), _jsxs("div", { className:
|
|
818
|
+
}, children: authMode === 'login' ? 'Register' : 'Sign In' })] })), _jsxs("div", { className: authStyles.authModeLinks, children: [(authMode === 'login' || authMode === 'register') && (_jsxs(_Fragment, { children: [_jsx("button", { className: authStyles.authModeLink, disabled: loginBusy || resetCooldownActive, onClick: () => { setLoginError(null); setLoginErrorCode(null); setLoginNotice(null); setLoginMode('forgot'); }, children: resetCooldownActive ? `Forgot Password (${resetCooldownSeconds}s)` : 'Forgot Password' }), _jsx("button", { className: authStyles.authModeLink, disabled: loginBusy || verifyCooldownActive, onClick: () => { setLoginError(null); setLoginErrorCode(null); setLoginNotice(null); setLoginMode('verify'); }, children: verifyCooldownActive ? `Resend Verification (${verifyCooldownSeconds}s)` : 'Resend Verification' }), _jsx("button", { className: authStyles.authModeLink, disabled: loginBusy, onClick: () => { setLoginError(null); setLoginErrorCode(null); setLoginNotice(null); setLoginMode('invite'); }, children: "Accept Invite" })] })), (authMode !== 'login' && authMode !== 'register') && (_jsxs(_Fragment, { children: [_jsx("button", { className: authStyles.authModeLink, disabled: loginBusy, onClick: () => { setLoginError(null); setLoginErrorCode(null); setLoginNotice(null); setLoginMode('login'); }, children: "Sign In" }), _jsx("button", { className: authStyles.authModeLink, disabled: loginBusy, onClick: () => { setLoginError(null); setLoginErrorCode(null); setLoginNotice(null); setLoginMode('register'); }, children: "Register" }), authMode === 'reset' && (_jsx("button", { className: authStyles.authModeLink, disabled: loginBusy || resetCooldownActive, onClick: () => { setLoginError(null); setLoginErrorCode(null); setLoginNotice(null); setLoginMode('forgot'); }, children: resetCooldownActive ? `Forgot Password (${resetCooldownSeconds}s)` : 'Forgot Password' }))] }))] })] }) }) }));
|
|
544
819
|
}
|
|
545
820
|
if (shouldForceLogin && !isLoginRoute) {
|
|
546
|
-
return (_jsx("div", { className:
|
|
821
|
+
return (_jsx("div", { className: shellStyles.standaloneWrapper, "data-theme": currentTheme, children: _jsx("div", { className: authStyles.loginView, children: _jsxs("div", { className: authStyles.loginCard, children: [_jsxs("div", { className: authStyles.authBrandRow, children: [_jsx("img", { src: authBrandLogo, alt: "Taskforce", className: authStyles.loginLogo }), _jsx("h1", { className: authStyles.loginTitle, children: "Loading Taskforce" })] }), _jsx("p", { className: authStyles.loginSubtitle, children: "Redirecting to sign in..." })] }) }) }));
|
|
547
822
|
}
|
|
548
823
|
if (isComingSoonRoute && shouldForceComingSoon) {
|
|
549
|
-
return (_jsx("div", { className:
|
|
824
|
+
return (_jsx("div", { className: shellStyles.standaloneWrapper, "data-theme": currentTheme, children: _jsx("div", { className: authStyles.loginView, style: {
|
|
550
825
|
backgroundImage: `linear-gradient(rgba(15, 15, 26, 0.88), rgba(15, 15, 26, 0.9)), url(${taskforceBg})`
|
|
551
|
-
}, children: _jsxs("div", { className:
|
|
826
|
+
}, children: _jsxs("div", { className: authStyles.loginCard, children: [_jsxs("div", { className: authStyles.authBrandRow, children: [_jsx("img", { src: authBrandLogo, alt: "Taskforce", className: authStyles.loginLogo }), _jsx("h1", { className: authStyles.loginTitle, children: "Private Beta" })] }), _jsx("p", { className: authStyles.loginSubtitle, children: "You are signed in, but your account is not in the beta allowlist yet." }), _jsx("p", { className: authStyles.loginSubtitle, children: "You will see the full app as soon as beta access is enabled." }), _jsx("button", { className: styles.cancelBtn, onClick: async () => { await taskforceState.logout(); navigate('/login', { replace: true }); }, children: "Sign Out" })] }) }) }));
|
|
552
827
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
828
|
+
const showGuidedWorkspaceSetup = isCreateWorkspaceIntent
|
|
829
|
+
|| (isSetupRoute && setupGateActive && (hasSetupReadError || needsGlobalSetup || needsWorkspaceSetup));
|
|
830
|
+
if (showGuidedWorkspaceSetup) {
|
|
831
|
+
const isError = !isCreateWorkspaceIntent && (hasSetupReadError || setupStep === 'error');
|
|
832
|
+
const isGlobal = !isCreateWorkspaceIntent && !isError && (needsGlobalSetup || setupStep === 'global');
|
|
556
833
|
const heading = isError
|
|
557
834
|
? t('setup.headingCheckFailed')
|
|
558
|
-
: (isGlobal
|
|
835
|
+
: (isGlobal
|
|
836
|
+
? t('setup.headingGlobalRequired')
|
|
837
|
+
: (isCreateWorkspaceIntent ? 'Create Workspace' : t('setup.headingWorkspaceRequired')));
|
|
559
838
|
const subtitle = isError
|
|
560
839
|
? t('setup.subtitleUnreadable')
|
|
561
840
|
: isGlobal
|
|
562
841
|
? t('setup.subtitleGlobalRequired')
|
|
563
|
-
:
|
|
842
|
+
: (isCreateWorkspaceIntent
|
|
843
|
+
? 'Set up the new workspace before it is created.'
|
|
844
|
+
: t('setup.subtitleWorkspaceRequired'));
|
|
564
845
|
const workspaceLabel = setupModeChoice === 'operations'
|
|
565
846
|
? t('setup.workspaceTermMission')
|
|
566
847
|
: t('setup.workspaceTermProject');
|
|
567
|
-
return (_jsx("div", { className:
|
|
848
|
+
return (_jsx("div", { className: shellStyles.standaloneWrapper, "data-theme": currentTheme, children: _jsx("div", { className: authStyles.loginView, style: {
|
|
568
849
|
backgroundImage: `linear-gradient(rgba(15, 15, 26, 0.88), rgba(15, 15, 26, 0.9)), url(${taskforceBg})`
|
|
569
|
-
}, children: _jsxs("div", { className:
|
|
850
|
+
}, children: _jsxs("div", { className: authStyles.loginCard, children: [_jsxs("div", { className: authStyles.authBrandRow, children: [_jsx("img", { src: authBrandLogo, alt: "Taskforce", className: authStyles.loginLogo }), _jsxs("h1", { className: authStyles.loginTitle, children: ["TASKFORCE ", _jsx("span", { className: authStyles.loginTitleAccent, children: "HQ" })] })] }), _jsx("p", { className: authStyles.loginSubtitle, children: _jsx("strong", { children: heading }) }), _jsx("p", { className: authStyles.loginSubtitle, children: subtitle }), runtimeCapabilities && (_jsxs("p", { className: authStyles.loginSubtitle, children: [t('setup.runtimeLabel'), ": ", _jsx("strong", { children: runtimeCapabilities.runtimeMode })] })), setupNotice && _jsx("p", { className: authStyles.loginSubtitle, children: setupNotice }), setupError && _jsx("p", { className: authStyles.loginError, children: setupError }), isGlobal && (_jsxs("div", { className: authStyles.optionGrid, children: [_jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "radio", name: "setup-mode", value: "core", checked: setupModeChoice === 'core', onChange: () => setSetupModeChoice('core'), disabled: setupBusy }), _jsx("span", { children: t('setup.coreModeOption', { workspaceLabel }) })] }), _jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "radio", name: "setup-mode", value: "operations", checked: setupModeChoice === 'operations', onChange: () => setSetupModeChoice('operations'), disabled: setupBusy }), _jsx("span", { children: t('setup.operationsModeOption') })] })] })), !isError && !isGlobal && (_jsxs("div", { className: authStyles.optionGrid, children: [!isCloudRuntime && canUseCloudWorkspaceSetup && (_jsxs("div", { className: authStyles.optionGroup, children: [_jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "radio", name: "workspace-setup-source", value: "local", checked: workspaceSetupSource === 'local', onChange: () => setWorkspaceSetupSource('local'), disabled: setupBusy }), _jsxs("span", { children: ["Create new local ", workspaceLabel.toLowerCase()] })] }), _jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "radio", name: "workspace-setup-source", value: "cloud", checked: workspaceSetupSource === 'cloud', onChange: () => setWorkspaceSetupSource('cloud'), disabled: setupBusy }), _jsxs("span", { children: ["Sync existing cloud ", workspaceLabel.toLowerCase()] })] })] })), !isCloudRuntime && workspaceSetupSource === 'cloud' && canUseCloudWorkspaceSetup ? (_jsxs("div", { className: authStyles.optionGroup, children: [!isAuthenticated && (_jsxs(_Fragment, { children: [_jsx("p", { className: authStyles.inlineHint, children: "Sign in to choose one of your cloud projects." }), _jsx("button", { className: styles.cancelBtn, disabled: setupBusy, onClick: () => {
|
|
570
851
|
navigate(`/login?mode=login&next=${encodeURIComponent('/setup?step=workspace&source=cloud')}`, { replace: true });
|
|
571
|
-
}, children: "Sign In" })] })), isAuthenticated && (_jsxs(_Fragment, { children: [_jsxs("select", { className: styles.input, value: cloudWorkspaceSelection, onChange: (event) => setCloudWorkspaceSelection(event.target.value), disabled: setupBusy || cloudWorkspaceLoading || cloudWorkspaceOptions.length === 0, children: [cloudWorkspaceOptions.length === 0 && (_jsx("option", { value: "", children: cloudWorkspaceLoading ? 'Loading cloud projects...' : 'No cloud projects found' })), cloudWorkspaceOptions.map((workspace) => (_jsxs("option", { value: workspace.id, children: [workspace.name, " (", workspace.id, ")"] }, workspace.id)))] }), _jsx("div", {
|
|
852
|
+
}, children: "Sign In" })] })), isAuthenticated && (_jsxs(_Fragment, { children: [_jsxs("select", { className: styles.input, value: cloudWorkspaceSelection, onChange: (event) => setCloudWorkspaceSelection(event.target.value), disabled: setupBusy || cloudWorkspaceLoading || cloudWorkspaceOptions.length === 0, children: [cloudWorkspaceOptions.length === 0 && (_jsx("option", { value: "", children: cloudWorkspaceLoading ? 'Loading cloud projects...' : 'No cloud projects found' })), cloudWorkspaceOptions.map((workspace) => (_jsxs("option", { value: workspace.id, children: [workspace.name, " (", workspace.id, ")"] }, workspace.id)))] }), _jsx("div", { className: authStyles.actionRowEnd, children: _jsx("button", { className: styles.cancelBtn, disabled: setupBusy || cloudWorkspaceLoading, onClick: () => void fetchCloudWorkspaceOptions(), children: "Refresh Cloud Projects" }) }), cloudWorkspaceError && _jsx("p", { className: authStyles.loginError, children: cloudWorkspaceError })] }))] })) : (_jsxs(_Fragment, { children: [_jsx("input", { className: styles.input, type: "text", value: workspaceNameInput, placeholder: t('setup.workspaceNamePlaceholder', { workspaceLabel }), onChange: (event) => setWorkspaceNameInput(event.target.value), disabled: setupBusy }), _jsx("textarea", { className: styles.textarea, value: workspaceDescriptionInput, placeholder: t('setup.workspaceDescriptionPlaceholder', { workspaceLabel }), onChange: (event) => setWorkspaceDescriptionInput(event.target.value), disabled: setupBusy, rows: 4 }), _jsxs("div", { className: authStyles.optionGroup, children: [_jsx("p", { className: authStyles.loginSubtitle, children: "What are you working on?" }), _jsx("p", { className: authStyles.inlineHint, children: "Choose a starter taxonomy library for this workspace. You can still edit categories, task types, and priorities later." }), setupLibraryPacks.map((pack) => {
|
|
853
|
+
const isSelected = selectedSetupPack?.id === pack.id;
|
|
854
|
+
return (_jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "radio", name: "workspace-taxonomy-library", checked: isSelected, onChange: () => setSelectedSetupPackId(pack.id), disabled: setupBusy || setupLibraryLoading }), _jsx("span", { children: pack.label })] }, pack.id));
|
|
855
|
+
}), selectedSetupPack ? (_jsxs(_Fragment, { children: [_jsx("p", { className: authStyles.inlineHint, children: selectedSetupPack.description }), _jsxs("p", { className: authStyles.inlineHint, children: ["Includes ", selectedSetupPack.categories.length, " categories, ", selectedSetupPack.types.length, " task types, and ", selectedSetupPack.priorities.length, " priority levels."] })] })) : null, _jsxs("div", { className: authStyles.optionGroup, children: [_jsx("p", { className: authStyles.loginSubtitle, children: "Apply Starter Sections" }), _jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "checkbox", checked: setupTaxonomySections.categories, onChange: () => setSetupTaxonomySections((current) => ({ ...current, categories: !current.categories })), disabled: setupBusy || !selectedSetupPack?.categories.length }), _jsx("span", { children: "Categories" })] }), _jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "checkbox", checked: setupTaxonomySections.types, onChange: () => setSetupTaxonomySections((current) => ({ ...current, types: !current.types })), disabled: setupBusy || !selectedSetupPack?.types.length }), _jsx("span", { children: "Task Types" })] }), _jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "checkbox", checked: setupTaxonomySections.priorities, onChange: () => setSetupTaxonomySections((current) => ({ ...current, priorities: !current.priorities })), disabled: setupBusy || !selectedSetupPack?.priorities.length }), _jsx("span", { children: "Priorities" })] })] }), setupLibraryLoading ? (_jsx("p", { className: authStyles.inlineHint, children: "Loading starter libraries\u2026" })) : null, setupLibraryError ? (_jsx("p", { className: authStyles.loginError, children: setupLibraryError })) : null] }), !isCloudRuntime && canUseCloudWorkspaceSetup && isAuthenticated && (_jsxs("div", { className: authStyles.optionGroup, children: [_jsxs("label", { className: `${authStyles.authModeLink} ${authStyles.optionRow}`, children: [_jsx("input", { type: "checkbox", checked: syncNewLocalWorkspaceToCloud, onChange: (event) => setSyncNewLocalWorkspaceToCloud(event.target.checked), disabled: setupBusy }), _jsx("span", { children: "Sync to cloud after setup" })] }), _jsx("p", { className: authStyles.inlineHint, children: "When enabled, this project will connect to cloud sync as soon as setup finishes." })] }))] }))] })), _jsxs("div", { className: authStyles.authModeLinks, children: [isGlobal ? (_jsx("button", { className: styles.submitBtn, disabled: setupBusy, onClick: async () => {
|
|
572
856
|
setSetupBusy(true);
|
|
573
857
|
setSetupNotice(null);
|
|
574
858
|
setSetupError(null);
|
|
@@ -634,12 +918,13 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
634
918
|
workspaceId: workspaceIdForSync,
|
|
635
919
|
stateKey: 'workspace-sync',
|
|
636
920
|
patch: {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
onboardingCompleted: false,
|
|
921
|
+
version: 2,
|
|
922
|
+
enabled: true,
|
|
923
|
+
phase: 'attach-cloud',
|
|
641
924
|
pullCursor: null,
|
|
642
|
-
|
|
925
|
+
lastPullAt: null,
|
|
926
|
+
lastPushAt: null,
|
|
927
|
+
lastSyncedAt: null
|
|
643
928
|
}
|
|
644
929
|
})
|
|
645
930
|
});
|
|
@@ -650,33 +935,57 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
650
935
|
return;
|
|
651
936
|
}
|
|
652
937
|
applyWorkspaceSyncStateSnapshot({
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
// I6: start false; the orchestrator marks it true after first successful pull.
|
|
656
|
-
onboardingCompleted: false,
|
|
938
|
+
enabled: true,
|
|
939
|
+
phase: 'attach-cloud',
|
|
657
940
|
pullCursor: null
|
|
658
941
|
});
|
|
659
942
|
await refreshSetupContext();
|
|
660
943
|
setSetupNotice(`Cloud project synced setup ready: ${selectedWorkspace.name}`);
|
|
661
944
|
}
|
|
662
945
|
else {
|
|
663
|
-
const
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
946
|
+
const creatingNewWorkspace = isCreateWorkspaceIntent || setupState?.workspaceSetupState === 'missing';
|
|
947
|
+
const createResult = isCreateWorkspaceIntent
|
|
948
|
+
? await createWorkspace(workspaceNameInput, workspaceDescriptionInput || undefined)
|
|
949
|
+
: null;
|
|
950
|
+
const saveResult = isCreateWorkspaceIntent
|
|
951
|
+
? null
|
|
952
|
+
: await saveWorkspaceProfile({
|
|
953
|
+
workspaceId: creatingNewWorkspace ? undefined : setupState?.workspaceId,
|
|
954
|
+
name: workspaceNameInput,
|
|
955
|
+
description: workspaceDescriptionInput
|
|
956
|
+
});
|
|
957
|
+
const result = createResult || saveResult;
|
|
958
|
+
if (!result?.success) {
|
|
959
|
+
setSetupError(result?.error || t('setup.saveWorkspaceFailed'));
|
|
671
960
|
}
|
|
672
961
|
else {
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
962
|
+
const workspaceIdForSetup = String(createResult?.workspace?.id
|
|
963
|
+
|| saveResult?.workspaceId
|
|
964
|
+
|| setupState?.workspaceId
|
|
965
|
+
|| '').trim();
|
|
966
|
+
if (!workspaceIdForSetup) {
|
|
967
|
+
setSetupError('Failed to resolve workspace id for setup.');
|
|
677
968
|
setSetupBusy(false);
|
|
678
969
|
return;
|
|
679
970
|
}
|
|
971
|
+
const shouldApplyStarterPack = workspaceSetupSource === 'local'
|
|
972
|
+
&& Boolean(selectedSetupPack)
|
|
973
|
+
&& (setupTaxonomySections.categories || setupTaxonomySections.types || setupTaxonomySections.priorities);
|
|
974
|
+
if (shouldApplyStarterPack && selectedSetupPack) {
|
|
975
|
+
const applyResult = await settingsModel.onApplySystemTaxonomyPack({
|
|
976
|
+
pack: selectedSetupPack,
|
|
977
|
+
sections: setupTaxonomySections,
|
|
978
|
+
remapExistingValuesToDefault: true,
|
|
979
|
+
workspaceIdOverride: workspaceIdForSetup
|
|
980
|
+
});
|
|
981
|
+
if (!applyResult?.success) {
|
|
982
|
+
setSetupError(applyResult?.error || 'Failed to apply starter taxonomy library.');
|
|
983
|
+
setSetupBusy(false);
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
const shouldEnableCloudSync = Boolean(!isCloudRuntime && syncNewLocalWorkspaceToCloud && canUseCloudWorkspaceSetup && isAuthenticated);
|
|
988
|
+
const workspaceIdForSync = workspaceIdForSetup;
|
|
680
989
|
const stateRes = await fetch('/api/taskforce/ui-state', {
|
|
681
990
|
method: 'POST',
|
|
682
991
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -685,12 +994,13 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
685
994
|
workspaceId: workspaceIdForSync,
|
|
686
995
|
stateKey: 'workspace-sync',
|
|
687
996
|
patch: {
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
onboardingCompleted: false,
|
|
997
|
+
version: 2,
|
|
998
|
+
enabled: shouldEnableCloudSync,
|
|
999
|
+
phase: shouldEnableCloudSync ? 'provision-local' : 'idle',
|
|
692
1000
|
pullCursor: null,
|
|
693
|
-
|
|
1001
|
+
lastPullAt: null,
|
|
1002
|
+
lastPushAt: null,
|
|
1003
|
+
lastSyncedAt: null
|
|
694
1004
|
}
|
|
695
1005
|
})
|
|
696
1006
|
});
|
|
@@ -701,10 +1011,8 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
701
1011
|
return;
|
|
702
1012
|
}
|
|
703
1013
|
applyWorkspaceSyncStateSnapshot({
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
// I6: start false; the orchestrator marks it true after first successful pull.
|
|
707
|
-
onboardingCompleted: false,
|
|
1014
|
+
enabled: shouldEnableCloudSync,
|
|
1015
|
+
phase: shouldEnableCloudSync ? 'provision-local' : 'idle',
|
|
708
1016
|
pullCursor: null
|
|
709
1017
|
});
|
|
710
1018
|
if (shouldEnableCloudSync) {
|
|
@@ -713,10 +1021,19 @@ function TaskforceCoreWithRouter({ config = {}, initialTaskId, onTaskCountChange
|
|
|
713
1021
|
else {
|
|
714
1022
|
setSetupNotice(t('setup.workspaceSetupSaved', { workspaceLabel }));
|
|
715
1023
|
}
|
|
1024
|
+
if (isCreateWorkspaceIntent) {
|
|
1025
|
+
await refreshSetupContext();
|
|
1026
|
+
await fetchTasks(true);
|
|
1027
|
+
navigate('/', { replace: true });
|
|
1028
|
+
}
|
|
716
1029
|
}
|
|
717
1030
|
}
|
|
718
1031
|
setSetupBusy(false);
|
|
719
|
-
}, children: setupBusy ? t('setup.saving') : t('setup.saveWorkspaceSetup', { workspaceLabel }) })) : (_jsx("button", { className: styles.submitBtn, disabled: setupBusy, onClick: refreshSetupContext, children: t('setup.retrySetupCheck') })),
|
|
1032
|
+
}, children: setupBusy ? t('setup.saving') : t('setup.saveWorkspaceSetup', { workspaceLabel }) })) : (_jsx("button", { className: styles.submitBtn, disabled: setupBusy, onClick: refreshSetupContext, children: t('setup.retrySetupCheck') })), isCreateWorkspaceIntent ? (_jsx("button", { className: styles.cancelBtn, onClick: () => {
|
|
1033
|
+
setSetupError(null);
|
|
1034
|
+
setSetupNotice(null);
|
|
1035
|
+
navigate('/', { replace: true });
|
|
1036
|
+
}, children: "Cancel" })) : runtimeMode === 'cloud' ? (_jsx("button", { className: styles.cancelBtn, onClick: async () => { await taskforceState.logout(); navigate('/login', { replace: true }); }, children: t('setup.signOut') })) : null] })] }) }) }));
|
|
720
1037
|
}
|
|
721
1038
|
return (_jsx(StandaloneLayout, { ...taskforceState, onHeaderMouseDown: onHeaderMouseDown, isDragging: isDragging, onClose: onClose }));
|
|
722
1039
|
}
|