@taskforcehq/taskforce 0.3.309 → 0.3.313
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -127
- package/dist/TaskforceCore.js +1 -1
- package/dist/components/context/ContextAttachmentManager.js +4 -3
- package/dist/components/features/InitiativesModule.js +1 -1
- package/dist/components/features/TaskSettings.js +1 -1
- package/dist/components/ui/DisclosureSectionHeader.d.ts +12 -0
- package/dist/components/ui/DisclosureSectionHeader.js +8 -0
- package/dist/components/views/PlanComparisonPage.js +1 -1
- package/dist/components/views/StandaloneLayout.js +18 -4
- package/dist/components/views/panels/PlanningDrawer.js +2 -1
- package/dist/components/views/standalone/modals/AccountHubModal.js +1 -1
- package/dist/components/views/standalone/modals/HelpModal.d.ts +3 -1
- package/dist/components/views/standalone/modals/HelpModal.js +17 -2
- package/dist/core/PlanEntitlementService.d.ts +2 -0
- package/dist/core/PlanEntitlementService.js +57 -4
- package/dist/hooks/useFilterSort.js +1 -1
- package/dist/hooks/useTaskforce.js +2 -2
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +5 -2
- package/dist/localization/locales/en-US.js +1 -1
- package/dist/localization/locales/es-419.js +1 -1
- package/dist/localization/locales/pt-BR.js +1 -1
- package/dist/mcp/runtime.js +49 -14
- package/dist/server/routes/billing.js +0 -1
- package/dist/ui/assets/AgentsModule-BULqIo8e.js +1 -0
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-CCckzWYZ.js → AnnotatedAttachmentWorkspace-DHr4rHK9.js} +1 -1
- package/dist/ui/assets/ContextAttachmentManager-DoMe2OpY.js +3 -0
- package/dist/ui/assets/{DocumentWorkspace-BVaWPA25.js → DocumentWorkspace-DumBWhvb.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-DSj0ThaK.js → EntityActivityTimeline-sHk8Nzbq.js} +1 -1
- package/dist/ui/assets/{InitiativesModule-AxMkWtxH.js → InitiativesModule-3X9UNzHh.js} +1 -1
- package/dist/ui/assets/PlansPage-C3A3EYaV.js +1 -0
- package/dist/ui/assets/PlansPage-DeAzWYTb.css +1 -0
- package/dist/ui/assets/{TaskContextUpload-Dw4rTF4i.js → TaskContextUpload-C8G7pWkX.js} +1 -1
- package/dist/ui/assets/{TaskSettings-f2ga42_V.js → TaskSettings-DM1o9Wla.js} +2 -2
- package/dist/ui/assets/{WorkflowsModule-E4UL3mov.js → WorkflowsModule-CW0crzvD.js} +1 -1
- package/dist/ui/assets/documentReferences-BZB3nMRb.js +1 -0
- package/dist/ui/assets/index-BWFQ9mGn.js +5 -0
- package/dist/ui/assets/{index-BvAbqx5Q.css → index-DcK_8tuE.css} +1 -1
- package/dist/ui/assets/{vendor-icons-B32hGuF2.js → vendor-icons-CLnehDTw.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/supportContact.d.ts +9 -0
- package/dist/utils/supportContact.js +32 -0
- package/package.json +12 -4
- package/scripts/postinstall.js +4 -3
- package/dist/TaskforceCore.CategoryFallback.test.d.ts +0 -1
- package/dist/TaskforceCore.CategoryFallback.test.js +0 -101
- package/dist/TaskforceCore.filter-persistence.test.d.ts +0 -1
- package/dist/TaskforceCore.filter-persistence.test.js +0 -402
- package/dist/TaskforceCore.routing.test.d.ts +0 -1
- package/dist/TaskforceCore.routing.test.js +0 -311
- package/dist/TaskforceCore.test.d.ts +0 -1
- package/dist/TaskforceCore.test.js +0 -7910
- package/dist/TaskforceWidget.test.d.ts +0 -1
- package/dist/TaskforceWidget.test.js +0 -92
- package/dist/UnsavedChangesRelaxed.test.d.ts +0 -1
- package/dist/UnsavedChangesRelaxed.test.js +0 -16
- package/dist/__tests__/localizationCatalogs.test.d.ts +0 -1
- package/dist/__tests__/localizationCatalogs.test.js +0 -54
- package/dist/__tests__/workflowSimulation.test.d.ts +0 -1
- package/dist/__tests__/workflowSimulation.test.js +0 -113
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.d.ts +0 -1
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.js +0 -278
- package/dist/annotatedAttachments/payload.test.d.ts +0 -1
- package/dist/annotatedAttachments/payload.test.js +0 -67
- package/dist/compat/workspaceSyncCompat.test.d.ts +0 -1
- package/dist/compat/workspaceSyncCompat.test.js +0 -124
- package/dist/components/features/AgentsModule.test.d.ts +0 -1
- package/dist/components/features/AgentsModule.test.js +0 -601
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.d.ts +0 -1
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +0 -2883
- package/dist/components/features/DocumentWorkspace.test.d.ts +0 -1
- package/dist/components/features/DocumentWorkspace.test.js +0 -1439
- package/dist/components/features/TaskSettings.test.d.ts +0 -1
- package/dist/components/features/TaskSettings.test.js +0 -1674
- package/dist/components/features/settings/TaxonomyLibraryManager.test.d.ts +0 -1
- package/dist/components/features/settings/TaxonomyLibraryManager.test.js +0 -141
- package/dist/components/task/TaskActionHeader.test.d.ts +0 -1
- package/dist/components/task/TaskActionHeader.test.js +0 -91
- package/dist/components/task/TaskCard.test.d.ts +0 -1
- package/dist/components/task/TaskCard.test.js +0 -513
- package/dist/components/task/TaskContextUpload.test.d.ts +0 -1
- package/dist/components/task/TaskContextUpload.test.js +0 -506
- package/dist/components/task/TaskForm.test.d.ts +0 -1
- package/dist/components/task/TaskForm.test.js +0 -946
- package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.empty-column-drop.test.js +0 -66
- package/dist/components/task/TaskKanban.planning-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.planning-drop.test.js +0 -93
- package/dist/components/task/TaskKanban.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.test.js +0 -99
- package/dist/components/task/TaskList.test.d.ts +0 -1
- package/dist/components/task/TaskList.test.js +0 -473
- package/dist/components/task/TaskStatusActions.test.d.ts +0 -1
- package/dist/components/task/TaskStatusActions.test.js +0 -54
- package/dist/components/task/taskKanbanDropRules.test.d.ts +0 -1
- package/dist/components/task/taskKanbanDropRules.test.js +0 -114
- package/dist/components/ui/LevelSelector.test.d.ts +0 -1
- package/dist/components/ui/LevelSelector.test.js +0 -55
- package/dist/components/ui/Markdown.test.d.ts +0 -1
- package/dist/components/ui/Markdown.test.js +0 -38
- package/dist/components/ui/MultiSelectFilter.test.d.ts +0 -1
- package/dist/components/ui/MultiSelectFilter.test.js +0 -74
- package/dist/components/ui/TaxonomyDropdown.test.d.ts +0 -1
- package/dist/components/ui/TaxonomyDropdown.test.js +0 -130
- package/dist/components/ui/TopNoticeLayer.test.d.ts +0 -1
- package/dist/components/ui/TopNoticeLayer.test.js +0 -25
- package/dist/components/views/AppShellHeader.test.d.ts +0 -1
- package/dist/components/views/AppShellHeader.test.js +0 -42
- package/dist/components/views/PlanComparisonPage.test.d.ts +0 -1
- package/dist/components/views/PlanComparisonPage.test.js +0 -757
- package/dist/components/views/PlansPage.test.d.ts +0 -1
- package/dist/components/views/PlansPage.test.js +0 -710
- package/dist/components/views/chrome/WorkspaceChromeSections.test.d.ts +0 -1
- package/dist/components/views/chrome/WorkspaceChromeSections.test.js +0 -54
- package/dist/components/views/chrome/workspaceChrome.test.d.ts +0 -1
- package/dist/components/views/chrome/workspaceChrome.test.js +0 -52
- package/dist/components/views/panels/DocumentFilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/DocumentFilterToolbar.test.js +0 -19
- package/dist/components/views/panels/FilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/FilterToolbar.test.js +0 -47
- package/dist/components/views/panels/PlanningDrawer.test.d.ts +0 -1
- package/dist/components/views/panels/PlanningDrawer.test.js +0 -529
- package/dist/components/views/planningScope.test.d.ts +0 -1
- package/dist/components/views/planningScope.test.js +0 -60
- package/dist/components/views/standalone/modals/AccountHubModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +0 -66
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +0 -24
- package/dist/components/views/teamManagementAccess.test.d.ts +0 -1
- package/dist/components/views/teamManagementAccess.test.js +0 -44
- package/dist/config/deployment.test.d.ts +0 -1
- package/dist/config/deployment.test.js +0 -90
- package/dist/config/envSchema.test.d.ts +0 -1
- package/dist/config/envSchema.test.js +0 -125
- package/dist/core/AiProfileService.test.d.ts +0 -1
- package/dist/core/AiProfileService.test.js +0 -184
- package/dist/core/AiProfiles.test.d.ts +0 -1
- package/dist/core/AiProfiles.test.js +0 -1873
- package/dist/core/AuthTokenService.test.d.ts +0 -1
- package/dist/core/AuthTokenService.test.js +0 -78
- package/dist/core/BulkUpdateFieldsPreview.test.d.ts +0 -1
- package/dist/core/BulkUpdateFieldsPreview.test.js +0 -62
- package/dist/core/CompletedAt.test.d.ts +0 -1
- package/dist/core/CompletedAt.test.js +0 -44
- package/dist/core/CreatedBy.test.d.ts +0 -1
- package/dist/core/CreatedBy.test.js +0 -188
- package/dist/core/DeletedTaskTrash.test.d.ts +0 -1
- package/dist/core/DeletedTaskTrash.test.js +0 -104
- package/dist/core/EntitlementsPolicy.test.d.ts +0 -1
- package/dist/core/EntitlementsPolicy.test.js +0 -280
- package/dist/core/GlobalSettingsService.test.d.ts +0 -1
- package/dist/core/GlobalSettingsService.test.js +0 -45
- package/dist/core/JsonBackupRuntime.test.d.ts +0 -1
- package/dist/core/JsonBackupRuntime.test.js +0 -155
- package/dist/core/PlanFeatureCatalog.test.d.ts +0 -1
- package/dist/core/PlanFeatureCatalog.test.js +0 -139
- package/dist/core/PlanVersionPolicy.test.d.ts +0 -1
- package/dist/core/PlanVersionPolicy.test.js +0 -204
- package/dist/core/PlanningEntities.test.d.ts +0 -1
- package/dist/core/PlanningEntities.test.js +0 -509
- package/dist/core/ScheduleFields.test.d.ts +0 -1
- package/dist/core/ScheduleFields.test.js +0 -193
- package/dist/core/SetupState.test.d.ts +0 -1
- package/dist/core/SetupState.test.js +0 -113
- package/dist/core/SignupMonetizationSettings.test.d.ts +0 -1
- package/dist/core/SignupMonetizationSettings.test.js +0 -515
- package/dist/core/Stats.test.d.ts +0 -1
- package/dist/core/Stats.test.js +0 -36
- package/dist/core/SystemAdmin.test.d.ts +0 -1
- package/dist/core/SystemAdmin.test.js +0 -1106
- package/dist/core/TaskActivitySync.test.d.ts +0 -1
- package/dist/core/TaskActivitySync.test.js +0 -90
- package/dist/core/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/TaskAttachmentsCanonical.test.js +0 -356
- package/dist/core/TaskAuditTimeline.test.d.ts +0 -1
- package/dist/core/TaskAuditTimeline.test.js +0 -319
- package/dist/core/TaskTaxonomyValidation.test.d.ts +0 -1
- package/dist/core/TaskTaxonomyValidation.test.js +0 -440
- package/dist/core/Taskforce.ids.test.d.ts +0 -1
- package/dist/core/Taskforce.ids.test.js +0 -611
- package/dist/core/Taskforce.listTasksSlim.test.d.ts +0 -1
- package/dist/core/Taskforce.listTasksSlim.test.js +0 -91
- package/dist/core/Taskforce.mcpAuth.test.d.ts +0 -1
- package/dist/core/Taskforce.mcpAuth.test.js +0 -450
- package/dist/core/Taskforce.realtimeMutation.test.d.ts +0 -1
- package/dist/core/Taskforce.realtimeMutation.test.js +0 -131
- package/dist/core/UserProfileAvatarDrafts.test.d.ts +0 -1
- package/dist/core/UserProfileAvatarDrafts.test.js +0 -138
- package/dist/core/WorkspaceDelete.test.d.ts +0 -1
- package/dist/core/WorkspaceDelete.test.js +0 -159
- package/dist/core/WorkspacePermissions.test.d.ts +0 -1
- package/dist/core/WorkspacePermissions.test.js +0 -270
- package/dist/core/WorkspacePlanMode.test.d.ts +0 -1
- package/dist/core/WorkspacePlanMode.test.js +0 -383
- package/dist/core/WorkspaceSyncSettings.test.d.ts +0 -1
- package/dist/core/WorkspaceSyncSettings.test.js +0 -65
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.js +0 -212
- package/dist/documentReviews/DocumentReviewSessionStore.test.d.ts +0 -1
- package/dist/documentReviews/DocumentReviewSessionStore.test.js +0 -127
- package/dist/hooks/authGuardPolicy.test.d.ts +0 -1
- package/dist/hooks/authGuardPolicy.test.js +0 -76
- package/dist/hooks/bootstrapTimeouts.test.d.ts +0 -1
- package/dist/hooks/bootstrapTimeouts.test.js +0 -12
- package/dist/hooks/sync/controlPlane.test.d.ts +0 -1
- package/dist/hooks/sync/controlPlane.test.js +0 -121
- package/dist/hooks/sync/lifecyclePolicy.test.d.ts +0 -1
- package/dist/hooks/sync/lifecyclePolicy.test.js +0 -124
- package/dist/hooks/sync/orchestratorShared.test.d.ts +0 -1
- package/dist/hooks/sync/orchestratorShared.test.js +0 -98
- package/dist/hooks/sync/pullLifecycle.test.d.ts +0 -1
- package/dist/hooks/sync/pullLifecycle.test.js +0 -80
- package/dist/hooks/sync/recovery.test.d.ts +0 -1
- package/dist/hooks/sync/recovery.test.js +0 -292
- package/dist/hooks/sync/transfers.test.d.ts +0 -1
- package/dist/hooks/sync/transfers.test.js +0 -928
- package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +0 -1
- package/dist/hooks/sync/useRecentSyncEvents.test.js +0 -124
- package/dist/hooks/sync/useSyncStatusActions.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusActions.test.js +0 -133
- package/dist/hooks/sync/useSyncStatusControls.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusControls.test.js +0 -88
- package/dist/hooks/useFilterSort.test.d.ts +0 -1
- package/dist/hooks/useFilterSort.test.js +0 -419
- package/dist/hooks/useRealtimeSync.test.d.ts +0 -1
- package/dist/hooks/useRealtimeSync.test.js +0 -311
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +0 -54
- package/dist/hooks/useSyncOrchestrator.context-assets.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.context-assets.test.js +0 -228
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +0 -2027
- package/dist/hooks/useTaskData.test.d.ts +0 -1
- package/dist/hooks/useTaskData.test.js +0 -291
- package/dist/hooks/useTaskMutations.test.d.ts +0 -1
- package/dist/hooks/useTaskMutations.test.js +0 -256
- package/dist/hooks/useTaskforce.contract.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.contract.test.js +0 -7
- package/dist/hooks/useTaskforce.priority-filters.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.priority-filters.test.js +0 -28
- package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.runtime-routing.test.js +0 -246
- package/dist/hooks/useTaskforce.sync-behavior.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.sync-behavior.test.js +0 -3644
- package/dist/hooks/useWorkspaceSyncController.test.d.ts +0 -1
- package/dist/hooks/useWorkspaceSyncController.test.js +0 -192
- package/dist/hooks/workspace/useTaskforceApiRouting.test.d.ts +0 -1
- package/dist/hooks/workspace/useTaskforceApiRouting.test.js +0 -77
- package/dist/hooks/workspace/workspaceLocalState.test.d.ts +0 -1
- package/dist/hooks/workspace/workspaceLocalState.test.js +0 -59
- package/dist/localization/localizationCatalogs.test.d.ts +0 -1
- package/dist/localization/localizationCatalogs.test.js +0 -37
- package/dist/mcp/aiProfileBootstrap.test.d.ts +0 -1
- package/dist/mcp/aiProfileBootstrap.test.js +0 -68
- package/dist/mcp/canonicalAssetHelpers.test.d.ts +0 -1
- package/dist/mcp/canonicalAssetHelpers.test.js +0 -67
- package/dist/mcp/clientIntegrations.test.d.ts +0 -1
- package/dist/mcp/clientIntegrations.test.js +0 -219
- package/dist/mcp/optionResolution.test.d.ts +0 -1
- package/dist/mcp/optionResolution.test.js +0 -43
- package/dist/mcp/runtime.test.d.ts +0 -1
- package/dist/mcp/runtime.test.js +0 -5120
- package/dist/mcp/structuredCommentValidation.test.d.ts +0 -1
- package/dist/mcp/structuredCommentValidation.test.js +0 -31
- package/dist/mcp/structuredDocValidation.test.d.ts +0 -1
- package/dist/mcp/structuredDocValidation.test.js +0 -35
- package/dist/mcp/toolRegistry.test.d.ts +0 -1
- package/dist/mcp/toolRegistry.test.js +0 -34
- package/dist/migrations/billingSchemaParity.test.d.ts +0 -1
- package/dist/migrations/billingSchemaParity.test.js +0 -160
- package/dist/migrations/taskSchemaMigrations.test.d.ts +0 -1
- package/dist/migrations/taskSchemaMigrations.test.js +0 -225
- package/dist/qaOpen.test.d.ts +0 -1
- package/dist/qaOpen.test.js +0 -56
- package/dist/releaseVersion.test.d.ts +0 -1
- package/dist/releaseVersion.test.js +0 -32
- package/dist/runtime/appGates.test.d.ts +0 -1
- package/dist/runtime/appGates.test.js +0 -42
- package/dist/server/aiProfileAvatarAssets.test.d.ts +0 -1
- package/dist/server/aiProfileAvatarAssets.test.js +0 -213
- package/dist/server/annotatedAttachmentsRoutes.test.d.ts +0 -1
- package/dist/server/annotatedAttachmentsRoutes.test.js +0 -532
- package/dist/server/auth.test.d.ts +0 -1
- package/dist/server/auth.test.js +0 -131
- package/dist/server/buildInfo.test.d.ts +0 -1
- package/dist/server/buildInfo.test.js +0 -29
- package/dist/server/cors.test.d.ts +0 -1
- package/dist/server/cors.test.js +0 -77
- package/dist/server/documentReviewRoutes.test.d.ts +0 -1
- package/dist/server/documentReviewRoutes.test.js +0 -190
- package/dist/server/email.test.d.ts +0 -1
- package/dist/server/email.test.js +0 -113
- package/dist/server/index.cookieProxy.test.d.ts +0 -1
- package/dist/server/index.cookieProxy.test.js +0 -67
- package/dist/server/index.rateLimit.test.d.ts +0 -1
- package/dist/server/index.rateLimit.test.js +0 -22
- package/dist/server/index.test.d.ts +0 -1
- package/dist/server/index.test.js +0 -283
- package/dist/server/rateLimit.test.d.ts +0 -1
- package/dist/server/rateLimit.test.js +0 -107
- package/dist/server/realtimeSync.auth.test.d.ts +0 -1
- package/dist/server/realtimeSync.auth.test.js +0 -62
- package/dist/server/realtimeSync.replay.test.d.ts +0 -1
- package/dist/server/realtimeSync.replay.test.js +0 -192
- package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +0 -1
- package/dist/server/realtimeSync.workspaceIsolation.test.js +0 -101
- package/dist/server/routes/billing.test.d.ts +0 -1
- package/dist/server/routes/billing.test.js +0 -3455
- package/dist/server/routes/shared.test.d.ts +0 -1
- package/dist/server/routes/shared.test.js +0 -32
- package/dist/server/routes/sync.integration.test.d.ts +0 -1
- package/dist/server/routes/sync.integration.test.js +0 -2932
- package/dist/server/routes/syncAuxRoutes.test.d.ts +0 -1
- package/dist/server/routes/syncAuxRoutes.test.js +0 -158
- package/dist/server/routes/syncRouteGuards.test.d.ts +0 -1
- package/dist/server/routes/syncRouteGuards.test.js +0 -94
- package/dist/server/routes.test.d.ts +0 -1
- package/dist/server/routes.test.js +0 -15612
- package/dist/server/runtimeMode.test.d.ts +0 -1
- package/dist/server/runtimeMode.test.js +0 -26
- package/dist/server/securityHeaders.test.d.ts +0 -1
- package/dist/server/securityHeaders.test.js +0 -70
- package/dist/services/templateEngine.test.d.ts +0 -1
- package/dist/services/templateEngine.test.js +0 -150
- package/dist/services/templates.test.d.ts +0 -1
- package/dist/services/templates.test.js +0 -45
- package/dist/services/workflowDocumentFixtures.test.d.ts +0 -1
- package/dist/services/workflowDocumentFixtures.test.js +0 -78
- package/dist/services/workflowExportMatrix.test.d.ts +0 -1
- package/dist/services/workflowExportMatrix.test.js +0 -113
- package/dist/services/workflowExportSnapshots.test.d.ts +0 -1
- package/dist/services/workflowExportSnapshots.test.js +0 -30
- package/dist/services/workflowGeneration.test.d.ts +0 -1
- package/dist/services/workflowGeneration.test.js +0 -12
- package/dist/services/workflowSimulation.test.d.ts +0 -1
- package/dist/services/workflowSimulation.test.js +0 -113
- package/dist/services/workflowV2Policy.test.d.ts +0 -1
- package/dist/services/workflowV2Policy.test.js +0 -80
- package/dist/shared/customTaxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/customTaxonomyLibrary.test.js +0 -20
- package/dist/shared/passwordPolicy.test.d.ts +0 -1
- package/dist/shared/passwordPolicy.test.js +0 -34
- package/dist/shared/runtimeContract.test.d.ts +0 -1
- package/dist/shared/runtimeContract.test.js +0 -23
- package/dist/shared/taxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/taxonomyLibrary.test.js +0 -26
- package/dist/shared/taxonomyState.test.d.ts +0 -1
- package/dist/shared/taxonomyState.test.js +0 -71
- package/dist/soak/preflight.cli.d.ts +0 -1
- package/dist/soak/preflight.cli.js +0 -28
- package/dist/soak/preflight.d.ts +0 -26
- package/dist/soak/preflight.js +0 -113
- package/dist/soak/preflight.test.d.ts +0 -1
- package/dist/soak/preflight.test.js +0 -39
- package/dist/storage/objectStorageClient.test.d.ts +0 -1
- package/dist/storage/objectStorageClient.test.js +0 -82
- package/dist/storage/objectStorageConfig.test.d.ts +0 -1
- package/dist/storage/objectStorageConfig.test.js +0 -50
- package/dist/storage/postgresAdapter.test.d.ts +0 -1
- package/dist/storage/postgresAdapter.test.js +0 -29
- package/dist/storage/workspaceAssetStore.test.d.ts +0 -1
- package/dist/storage/workspaceAssetStore.test.js +0 -588
- package/dist/sync/cloudSyncApi.test.d.ts +0 -1
- package/dist/sync/cloudSyncApi.test.js +0 -111
- package/dist/sync/collaborationSyncPayload.test.d.ts +0 -1
- package/dist/sync/collaborationSyncPayload.test.js +0 -125
- package/dist/sync/contentSyncPayload.test.d.ts +0 -1
- package/dist/sync/contentSyncPayload.test.js +0 -143
- package/dist/sync/encryptionService.test.d.ts +0 -1
- package/dist/sync/encryptionService.test.js +0 -52
- package/dist/sync/planningSyncPayload.test.d.ts +0 -1
- package/dist/sync/planningSyncPayload.test.js +0 -92
- package/dist/sync/realtimeFeature.test.d.ts +0 -1
- package/dist/sync/realtimeFeature.test.js +0 -30
- package/dist/sync/realtimeReconcile.test.d.ts +0 -1
- package/dist/sync/realtimeReconcile.test.js +0 -43
- package/dist/sync/syncApplyHandlers.test.d.ts +0 -1
- package/dist/sync/syncApplyHandlers.test.js +0 -626
- package/dist/sync/syncService.test.d.ts +0 -1
- package/dist/sync/syncService.test.js +0 -903
- package/dist/sync/taskSyncPayload.test.d.ts +0 -1
- package/dist/sync/taskSyncPayload.test.js +0 -54
- package/dist/sync/workspacePullFeed.test.d.ts +0 -1
- package/dist/sync/workspacePullFeed.test.js +0 -438
- package/dist/sync/workspaceSyncModel.test.d.ts +0 -1
- package/dist/sync/workspaceSyncModel.test.js +0 -1442
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -15
- package/dist/ui/assets/AgentsModule-BS4Pi_nC.js +0 -1
- package/dist/ui/assets/ContextAttachmentManager-CfG_ER7C.js +0 -3
- package/dist/ui/assets/PlansPage-B_z-D6Nh.css +0 -1
- package/dist/ui/assets/PlansPage-Ndt7mYfo.js +0 -1
- package/dist/ui/assets/documentReferences-BOUcJm6-.js +0 -1
- package/dist/ui/assets/index-MAHKvFqp.js +0 -4
- package/dist/utils/accountProfileSummaryCache.test.d.ts +0 -1
- package/dist/utils/accountProfileSummaryCache.test.js +0 -63
- package/dist/utils/annotatedAttachments.test.d.ts +0 -1
- package/dist/utils/annotatedAttachments.test.js +0 -108
- package/dist/utils/assignees.test.d.ts +0 -1
- package/dist/utils/assignees.test.js +0 -25
- package/dist/utils/avatarUpload.test.d.ts +0 -1
- package/dist/utils/avatarUpload.test.js +0 -40
- package/dist/utils/canonicalAssetKind.test.d.ts +0 -1
- package/dist/utils/canonicalAssetKind.test.js +0 -24
- package/dist/utils/coalescedRefresh.test.d.ts +0 -1
- package/dist/utils/coalescedRefresh.test.js +0 -30
- package/dist/utils/constants.icons.test.d.ts +0 -1
- package/dist/utils/constants.icons.test.js +0 -41
- package/dist/utils/planParser.test.d.ts +0 -1
- package/dist/utils/planParser.test.js +0 -183
- package/dist/utils/planningReferences.test.d.ts +0 -1
- package/dist/utils/planningReferences.test.js +0 -17
- package/dist/utils/syncEventDetails.test.d.ts +0 -1
- package/dist/utils/syncEventDetails.test.js +0 -23
- package/dist/utils/syncEventPresentation.test.d.ts +0 -1
- package/dist/utils/syncEventPresentation.test.js +0 -64
- package/dist/utils/syncStatusPresentation.test.d.ts +0 -1
- package/dist/utils/syncStatusPresentation.test.js +0 -164
- package/dist/utils/taskActivity.test.d.ts +0 -1
- package/dist/utils/taskActivity.test.js +0 -218
- package/dist/utils/taskDraftDefaults.test.d.ts +0 -1
- package/dist/utils/taskDraftDefaults.test.js +0 -34
- package/dist/utils/taskDragZones.test.d.ts +0 -1
- package/dist/utils/taskDragZones.test.js +0 -14
- package/dist/utils/taskNormalization.test.d.ts +0 -1
- package/dist/utils/taskNormalization.test.js +0 -158
- package/dist/utils/taskSearch.test.d.ts +0 -1
- package/dist/utils/taskSearch.test.js +0 -69
- package/dist/utils/taskUtils.test.d.ts +0 -1
- package/dist/utils/taskUtils.test.js +0 -19
- package/dist/utils/taskforceApiClient.test.d.ts +0 -1
- package/dist/utils/taskforceApiClient.test.js +0 -44
- package/dist/utils/taxonomyFormDefaults.test.d.ts +0 -1
- package/dist/utils/taxonomyFormDefaults.test.js +0 -63
- package/dist/utils/uiNotice.test.d.ts +0 -1
- package/dist/utils/uiNotice.test.js +0 -18
- package/dist/utils/workspaceIdentity.test.d.ts +0 -1
- package/dist/utils/workspaceIdentity.test.js +0 -61
- package/dist/utils/workspaceLifecycle.test.d.ts +0 -1
- package/dist/utils/workspaceLifecycle.test.js +0 -64
- package/dist/utils/workspaceSyncPresentation.test.d.ts +0 -1
- package/dist/utils/workspaceSyncPresentation.test.js +0 -71
- package/scripts/bootstrap-playwright-auth.mjs +0 -155
- package/scripts/check-cloud-mcp.mjs +0 -83
- package/scripts/check-compat-boundaries.mjs +0 -41
- package/scripts/check-env.ts +0 -31
- package/scripts/check-localization-strings.mjs +0 -49
- package/scripts/check-runtime-boundaries.mjs +0 -44
- package/scripts/debug-global.mjs +0 -34
- package/scripts/debug-login.mjs +0 -32
- package/scripts/debug-server.mjs +0 -36
- package/scripts/deploy-prod.sh +0 -41
- package/scripts/deploy-staging.sh +0 -23
- package/scripts/export-sqlite-to-postgres.mjs +0 -123
- package/scripts/generate-env-example.ts +0 -8
- package/scripts/mcp-stdio-adapter.mjs +0 -160
- package/scripts/migrate-task-data-assets.mjs +0 -408
- package/scripts/playwright-auth.sh +0 -19
- package/scripts/qa-open-lib.mjs +0 -175
- package/scripts/qa-open-lib.mjs.d.ts +0 -49
- package/scripts/qa-open.mjs +0 -352
- package/scripts/release-version-lib.mjs +0 -88
- package/scripts/release-version.mjs +0 -72
- package/scripts/run-billing-performance-smoke.sh +0 -24
- package/scripts/run-dev-proxy.sh +0 -51
- package/scripts/run-e2e-realtime.sh +0 -30
- package/scripts/run-smoke.sh +0 -35
- package/scripts/run-soak.sh +0 -41
- package/scripts/test-global.js +0 -143
- package/scripts/update-homebrew-formula.sh +0 -108
- package/scripts/with-esbuild.sh +0 -11
|
@@ -1,515 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { TaskforceCore } from './Taskforce';
|
|
6
|
-
function makeProjectRoot() {
|
|
7
|
-
return fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-onboarding-policy-'));
|
|
8
|
-
}
|
|
9
|
-
function insertFreePriceMapping(core, planVersionId) {
|
|
10
|
-
const db = core.db;
|
|
11
|
-
const tenantId = core.getTenantId();
|
|
12
|
-
const now = new Date().toISOString();
|
|
13
|
-
db.prepare(`
|
|
14
|
-
INSERT OR IGNORE INTO billing_price_mappings (
|
|
15
|
-
tenant_id, plan_version_id, billing_interval, stripe_price_id, pricing_type, active, unit_amount, currency, created_at, updated_at
|
|
16
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
17
|
-
`).run(tenantId, planVersionId, 'month', `free:${planVersionId}:month`, 'free', 1, 0, null, now, now);
|
|
18
|
-
}
|
|
19
|
-
function openCore(projectRoot) {
|
|
20
|
-
const core = new TaskforceCore({
|
|
21
|
-
projectRoot,
|
|
22
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
23
|
-
tenantId: path.basename(projectRoot)
|
|
24
|
-
});
|
|
25
|
-
core.upsertPlanCatalog({ planId: 'free', displayName: 'Free', status: 'active' });
|
|
26
|
-
core.updatePlanVersion({
|
|
27
|
-
planId: 'free',
|
|
28
|
-
versionNumber: 1,
|
|
29
|
-
seatLimit: 1
|
|
30
|
-
});
|
|
31
|
-
core.updatePlanVersionFeatures({
|
|
32
|
-
planVersionId: 'free-v1',
|
|
33
|
-
features: [
|
|
34
|
-
{ featureKey: 'workspace.workspaces', access: 'enabled' }
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
insertFreePriceMapping(core, 'free-v1');
|
|
38
|
-
return core;
|
|
39
|
-
}
|
|
40
|
-
describe('TaskforceCore onboarding policy', () => {
|
|
41
|
-
it('fails closed to require_plan_selection when no explicit onboarding policy is configured', () => {
|
|
42
|
-
const projectRoot = makeProjectRoot();
|
|
43
|
-
const core = openCore(projectRoot);
|
|
44
|
-
try {
|
|
45
|
-
expect(core.getOnboardingPolicy()).toEqual({
|
|
46
|
-
mode: 'require_plan_selection',
|
|
47
|
-
planId: null
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
core.close();
|
|
52
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
it('falls back to require_plan_selection when no free onboarding plan is available', () => {
|
|
56
|
-
const projectRoot = makeProjectRoot();
|
|
57
|
-
const core = new TaskforceCore({
|
|
58
|
-
projectRoot,
|
|
59
|
-
storagePath: path.join(projectRoot, '.taskforce'),
|
|
60
|
-
tenantId: path.basename(projectRoot)
|
|
61
|
-
});
|
|
62
|
-
core.upsertPlanCatalog({ planId: 'free', displayName: 'Free', status: 'active' });
|
|
63
|
-
core.updatePlanVersion({
|
|
64
|
-
planId: 'free',
|
|
65
|
-
versionNumber: 1,
|
|
66
|
-
seatLimit: 1
|
|
67
|
-
});
|
|
68
|
-
core.updatePlanVersionFeatures({
|
|
69
|
-
planVersionId: 'free-v1',
|
|
70
|
-
features: [
|
|
71
|
-
{ featureKey: 'workspace.workspaces', access: 'enabled' }
|
|
72
|
-
]
|
|
73
|
-
});
|
|
74
|
-
try {
|
|
75
|
-
expect(core.getOnboardingPolicy()).toEqual({
|
|
76
|
-
mode: 'require_plan_selection',
|
|
77
|
-
planId: null
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
finally {
|
|
81
|
-
core.close();
|
|
82
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
it('fails validation for auto_grant_free without a plan id', () => {
|
|
86
|
-
const projectRoot = makeProjectRoot();
|
|
87
|
-
const core = openCore(projectRoot);
|
|
88
|
-
try {
|
|
89
|
-
expect(core.validateOnboardingPolicy({
|
|
90
|
-
mode: 'auto_grant_free',
|
|
91
|
-
planId: null
|
|
92
|
-
})).toEqual(expect.objectContaining({
|
|
93
|
-
valid: false,
|
|
94
|
-
code: 'ONBOARDING_PLAN_REQUIRED'
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
finally {
|
|
98
|
-
core.close();
|
|
99
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
it('fails validation when the configured plan does not exist', () => {
|
|
103
|
-
const projectRoot = makeProjectRoot();
|
|
104
|
-
const core = openCore(projectRoot);
|
|
105
|
-
try {
|
|
106
|
-
expect(core.validateOnboardingPolicy({
|
|
107
|
-
mode: 'auto_grant_free',
|
|
108
|
-
planId: 'missing'
|
|
109
|
-
})).toEqual(expect.objectContaining({
|
|
110
|
-
valid: false,
|
|
111
|
-
code: 'ONBOARDING_PLAN_NOT_FOUND'
|
|
112
|
-
}));
|
|
113
|
-
}
|
|
114
|
-
finally {
|
|
115
|
-
core.close();
|
|
116
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
it('fails validation when the configured plan is disabled', () => {
|
|
120
|
-
const projectRoot = makeProjectRoot();
|
|
121
|
-
const core = openCore(projectRoot);
|
|
122
|
-
try {
|
|
123
|
-
core.upsertPlanCatalog({ planId: 'free', displayName: 'Free', status: 'archived' });
|
|
124
|
-
expect(core.validateOnboardingPolicy({
|
|
125
|
-
mode: 'auto_grant_free',
|
|
126
|
-
planId: 'free'
|
|
127
|
-
})).toEqual(expect.objectContaining({
|
|
128
|
-
valid: false,
|
|
129
|
-
code: 'ONBOARDING_PLAN_NOT_ENABLED'
|
|
130
|
-
}));
|
|
131
|
-
}
|
|
132
|
-
finally {
|
|
133
|
-
core.close();
|
|
134
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
it('fails validation when auto_grant_free points at a plan whose default version lacks free pricing', () => {
|
|
138
|
-
const projectRoot = makeProjectRoot();
|
|
139
|
-
const core = openCore(projectRoot);
|
|
140
|
-
try {
|
|
141
|
-
core.upsertPlanCatalog({ planId: 'team-5', displayName: 'Team 5', status: 'active' });
|
|
142
|
-
expect(core.validateOnboardingPolicy({
|
|
143
|
-
mode: 'auto_grant_free',
|
|
144
|
-
planId: 'team-5'
|
|
145
|
-
})).toEqual(expect.objectContaining({
|
|
146
|
-
valid: false,
|
|
147
|
-
code: 'ONBOARDING_PLAN_MUST_BE_FREE'
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
150
|
-
finally {
|
|
151
|
-
core.close();
|
|
152
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
it('passes validation for require_plan_selection without a plan id', () => {
|
|
156
|
-
const projectRoot = makeProjectRoot();
|
|
157
|
-
const core = openCore(projectRoot);
|
|
158
|
-
try {
|
|
159
|
-
expect(core.validateOnboardingPolicy({
|
|
160
|
-
mode: 'require_plan_selection',
|
|
161
|
-
planId: null
|
|
162
|
-
})).toEqual({ valid: true });
|
|
163
|
-
}
|
|
164
|
-
finally {
|
|
165
|
-
core.close();
|
|
166
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
it('requires plan selection during registration when no explicit onboarding policy is configured', () => {
|
|
170
|
-
const projectRoot = makeProjectRoot();
|
|
171
|
-
const core = openCore(projectRoot);
|
|
172
|
-
try {
|
|
173
|
-
const created = core.registerPasswordUser({
|
|
174
|
-
email: 'implicit-onboarding@example.com',
|
|
175
|
-
password: 'ValidPassphrase123!'
|
|
176
|
-
});
|
|
177
|
-
expect(created.planSelectionRequired).toBe(true);
|
|
178
|
-
expect(created.checkoutPending).toBe(false);
|
|
179
|
-
expect(core.getAccountEntitlement(created.userId)).toEqual(expect.objectContaining({
|
|
180
|
-
state: 'pending_plan_selection'
|
|
181
|
-
}));
|
|
182
|
-
expect(core.getAccountAccessStatus(created.userId)).toEqual(expect.objectContaining({
|
|
183
|
-
gate: 'plan_selection_required',
|
|
184
|
-
canAccessApp: false,
|
|
185
|
-
canAccessPlans: true,
|
|
186
|
-
planSelectionRequired: true
|
|
187
|
-
}));
|
|
188
|
-
}
|
|
189
|
-
finally {
|
|
190
|
-
core.close();
|
|
191
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
it('allows backfill transitions to create pending plan selection entitlements', () => {
|
|
195
|
-
const projectRoot = makeProjectRoot();
|
|
196
|
-
const tenantId = path.basename(projectRoot);
|
|
197
|
-
const core = openCore(projectRoot);
|
|
198
|
-
try {
|
|
199
|
-
const now = new Date().toISOString();
|
|
200
|
-
core.updateGlobalSettings({
|
|
201
|
-
billing: {
|
|
202
|
-
onboardingPolicy: {
|
|
203
|
-
mode: 'require_plan_selection',
|
|
204
|
-
planId: null
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
const db = core.getDatabaseAdapter();
|
|
209
|
-
db.prepare(`
|
|
210
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
211
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
212
|
-
`).run('pending-u1', tenantId, 'pending@example.com', 'Pending', now, now);
|
|
213
|
-
db.prepare(`
|
|
214
|
-
INSERT INTO user_billing (user_id, tenant_id, entitlement_state, created_at, updated_at)
|
|
215
|
-
VALUES (?, ?, ?, ?, ?)
|
|
216
|
-
`).run('pending-u1', tenantId, 'pending_plan_selection', now, now);
|
|
217
|
-
core.transitionCanonicalCommercialState({
|
|
218
|
-
accountId: 'pending-u1',
|
|
219
|
-
planVersionId: 'free-v1',
|
|
220
|
-
state: 'pending_plan_selection',
|
|
221
|
-
source: 'backfill',
|
|
222
|
-
updatedBy: 'backfill',
|
|
223
|
-
billingMirrorPlanId: null,
|
|
224
|
-
effectiveAt: now,
|
|
225
|
-
createdAt: now,
|
|
226
|
-
updatedAt: now
|
|
227
|
-
});
|
|
228
|
-
expect(core.hasAccountEntitlement('pending-u1')).toBe(true);
|
|
229
|
-
expect(core.getAccountAccessStatus('pending-u1')).toEqual(expect.objectContaining({
|
|
230
|
-
gate: 'plan_selection_required',
|
|
231
|
-
canAccessApp: false,
|
|
232
|
-
canAccessPlans: true,
|
|
233
|
-
planSelectionRequired: true
|
|
234
|
-
}));
|
|
235
|
-
}
|
|
236
|
-
finally {
|
|
237
|
-
core.close();
|
|
238
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
it('treats a live checkout_pending entitlement as checkout recovery state', () => {
|
|
242
|
-
const projectRoot = makeProjectRoot();
|
|
243
|
-
const tenantId = path.basename(projectRoot);
|
|
244
|
-
const core = openCore(projectRoot);
|
|
245
|
-
try {
|
|
246
|
-
const now = new Date().toISOString();
|
|
247
|
-
const checkoutExpiresAt = new Date(Date.now() + (60 * 60 * 1000)).toISOString();
|
|
248
|
-
core.upsertPlanCatalog({ planId: 'basic', displayName: 'Basic', status: 'active' });
|
|
249
|
-
const db = core.getDatabaseAdapter();
|
|
250
|
-
db.prepare(`
|
|
251
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
252
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
253
|
-
`).run('checkout-u1', tenantId, 'checkout@example.com', 'Checkout', now, now);
|
|
254
|
-
core.transitionCanonicalCommercialState({
|
|
255
|
-
accountId: 'checkout-u1',
|
|
256
|
-
planVersionId: 'basic-v1',
|
|
257
|
-
state: 'checkout_pending',
|
|
258
|
-
source: 'checkout-start',
|
|
259
|
-
updatedBy: 'checkout-start',
|
|
260
|
-
billingMirrorPlanId: 'basic',
|
|
261
|
-
effectiveAt: now,
|
|
262
|
-
effectiveUntil: checkoutExpiresAt,
|
|
263
|
-
createdAt: now,
|
|
264
|
-
updatedAt: now
|
|
265
|
-
});
|
|
266
|
-
expect(core.getAccountAccessStatus('checkout-u1')).toEqual(expect.objectContaining({
|
|
267
|
-
gate: 'checkout_pending',
|
|
268
|
-
canAccessApp: false,
|
|
269
|
-
canAccessPlans: true,
|
|
270
|
-
planSelectionRequired: false,
|
|
271
|
-
message: 'Complete checkout to continue.'
|
|
272
|
-
}));
|
|
273
|
-
}
|
|
274
|
-
finally {
|
|
275
|
-
core.close();
|
|
276
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
it('treats an expired checkout_pending entitlement as requiring plan reselection', () => {
|
|
280
|
-
const projectRoot = makeProjectRoot();
|
|
281
|
-
const tenantId = path.basename(projectRoot);
|
|
282
|
-
const core = openCore(projectRoot);
|
|
283
|
-
try {
|
|
284
|
-
const now = new Date().toISOString();
|
|
285
|
-
const expiredAt = new Date(Date.now() - (60 * 1000)).toISOString();
|
|
286
|
-
core.upsertPlanCatalog({ planId: 'basic', displayName: 'Basic', status: 'active' });
|
|
287
|
-
const db = core.getDatabaseAdapter();
|
|
288
|
-
db.prepare(`
|
|
289
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
290
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
291
|
-
`).run('expired-checkout-u1', tenantId, 'expired@example.com', 'Expired Checkout', now, now);
|
|
292
|
-
core.transitionCanonicalCommercialState({
|
|
293
|
-
accountId: 'expired-checkout-u1',
|
|
294
|
-
planVersionId: 'basic-v1',
|
|
295
|
-
state: 'checkout_pending',
|
|
296
|
-
source: 'checkout-start',
|
|
297
|
-
updatedBy: 'checkout-start',
|
|
298
|
-
billingMirrorPlanId: 'basic',
|
|
299
|
-
effectiveAt: now,
|
|
300
|
-
effectiveUntil: expiredAt,
|
|
301
|
-
createdAt: now,
|
|
302
|
-
updatedAt: now
|
|
303
|
-
});
|
|
304
|
-
expect(core.getAccountAccessStatus('expired-checkout-u1')).toEqual(expect.objectContaining({
|
|
305
|
-
gate: 'plan_selection_required',
|
|
306
|
-
canAccessApp: false,
|
|
307
|
-
canAccessPlans: true,
|
|
308
|
-
planSelectionRequired: true,
|
|
309
|
-
message: 'Choose a plan to continue.'
|
|
310
|
-
}));
|
|
311
|
-
expect(core.getAccountEntitlement('expired-checkout-u1')).toEqual(expect.objectContaining({
|
|
312
|
-
state: 'pending_plan_selection',
|
|
313
|
-
effectiveUntil: null
|
|
314
|
-
}));
|
|
315
|
-
const entitlementRow = db.prepare(`
|
|
316
|
-
SELECT entitlement_state, effective_until, updated_by
|
|
317
|
-
FROM account_entitlements
|
|
318
|
-
WHERE tenant_id = ? AND account_id = ?
|
|
319
|
-
LIMIT 1
|
|
320
|
-
`).get(tenantId, 'expired-checkout-u1');
|
|
321
|
-
expect(entitlementRow).toEqual(expect.objectContaining({
|
|
322
|
-
entitlement_state: 'pending_plan_selection',
|
|
323
|
-
effective_until: null,
|
|
324
|
-
updated_by: 'checkout-expired'
|
|
325
|
-
}));
|
|
326
|
-
const billingRow = db.prepare(`
|
|
327
|
-
SELECT entitlement_state, tier, effective_until
|
|
328
|
-
FROM user_billing
|
|
329
|
-
WHERE tenant_id = ? AND user_id = ?
|
|
330
|
-
LIMIT 1
|
|
331
|
-
`).get(tenantId, 'expired-checkout-u1');
|
|
332
|
-
expect(billingRow).toEqual(expect.objectContaining({
|
|
333
|
-
entitlement_state: 'pending_plan_selection',
|
|
334
|
-
tier: '',
|
|
335
|
-
effective_until: null
|
|
336
|
-
}));
|
|
337
|
-
}
|
|
338
|
-
finally {
|
|
339
|
-
core.close();
|
|
340
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
it('treats an expired trialing entitlement as requiring plan reselection', () => {
|
|
344
|
-
const projectRoot = makeProjectRoot();
|
|
345
|
-
const tenantId = path.basename(projectRoot);
|
|
346
|
-
const core = openCore(projectRoot);
|
|
347
|
-
try {
|
|
348
|
-
const now = new Date().toISOString();
|
|
349
|
-
const expiredAt = new Date(Date.now() - (60 * 1000)).toISOString();
|
|
350
|
-
core.upsertPlanCatalog({ planId: 'basic', displayName: 'Basic', status: 'active' });
|
|
351
|
-
const db = core.getDatabaseAdapter();
|
|
352
|
-
db.prepare(`
|
|
353
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
354
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
355
|
-
`).run('expired-trial-u1', tenantId, 'expired-trial@example.com', 'Expired Trial', now, now);
|
|
356
|
-
core.transitionCanonicalCommercialState({
|
|
357
|
-
accountId: 'expired-trial-u1',
|
|
358
|
-
planVersionId: 'basic-v1',
|
|
359
|
-
state: 'trialing',
|
|
360
|
-
source: 'system',
|
|
361
|
-
updatedBy: 'trial-start',
|
|
362
|
-
billingMirrorPlanId: 'basic',
|
|
363
|
-
effectiveAt: now,
|
|
364
|
-
effectiveUntil: expiredAt,
|
|
365
|
-
createdAt: now,
|
|
366
|
-
updatedAt: now
|
|
367
|
-
});
|
|
368
|
-
expect(core.getAccountAccessStatus('expired-trial-u1')).toEqual(expect.objectContaining({
|
|
369
|
-
gate: 'plan_selection_required',
|
|
370
|
-
canAccessApp: false,
|
|
371
|
-
canAccessPlans: true,
|
|
372
|
-
planSelectionRequired: true,
|
|
373
|
-
message: 'Choose a plan to continue.'
|
|
374
|
-
}));
|
|
375
|
-
expect(core.getAccountEntitlement('expired-trial-u1')).toEqual(expect.objectContaining({
|
|
376
|
-
state: 'pending_plan_selection',
|
|
377
|
-
effectiveUntil: null
|
|
378
|
-
}));
|
|
379
|
-
const entitlementRow = db.prepare(`
|
|
380
|
-
SELECT entitlement_state, effective_until, updated_by
|
|
381
|
-
FROM account_entitlements
|
|
382
|
-
WHERE tenant_id = ? AND account_id = ?
|
|
383
|
-
LIMIT 1
|
|
384
|
-
`).get(tenantId, 'expired-trial-u1');
|
|
385
|
-
expect(entitlementRow).toEqual(expect.objectContaining({
|
|
386
|
-
entitlement_state: 'pending_plan_selection',
|
|
387
|
-
effective_until: null,
|
|
388
|
-
updated_by: 'trial-expired'
|
|
389
|
-
}));
|
|
390
|
-
const billingRow = db.prepare(`
|
|
391
|
-
SELECT entitlement_state, tier, effective_until
|
|
392
|
-
FROM user_billing
|
|
393
|
-
WHERE tenant_id = ? AND user_id = ?
|
|
394
|
-
LIMIT 1
|
|
395
|
-
`).get(tenantId, 'expired-trial-u1');
|
|
396
|
-
expect(billingRow).toEqual(expect.objectContaining({
|
|
397
|
-
entitlement_state: 'pending_plan_selection',
|
|
398
|
-
tier: '',
|
|
399
|
-
effective_until: null
|
|
400
|
-
}));
|
|
401
|
-
}
|
|
402
|
-
finally {
|
|
403
|
-
core.close();
|
|
404
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
it('auto-heals a pending-plan-selection entitlement from an active Stripe billing mirror', () => {
|
|
408
|
-
const projectRoot = makeProjectRoot();
|
|
409
|
-
const tenantId = path.basename(projectRoot);
|
|
410
|
-
const core = openCore(projectRoot);
|
|
411
|
-
try {
|
|
412
|
-
const now = new Date().toISOString();
|
|
413
|
-
const nextRenewal = new Date(Date.now() + (24 * 60 * 60 * 1000)).toISOString();
|
|
414
|
-
core.upsertPlanCatalog({ planId: 'team-5', displayName: 'Team 5', status: 'active' });
|
|
415
|
-
const db = core.getDatabaseAdapter();
|
|
416
|
-
db.prepare(`
|
|
417
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
418
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
419
|
-
`).run('mirror-heal-u1', tenantId, 'mirror-heal@example.com', 'Mirror Heal', now, now);
|
|
420
|
-
core.transitionCanonicalCommercialState({
|
|
421
|
-
accountId: 'mirror-heal-u1',
|
|
422
|
-
planVersionId: 'free-v1',
|
|
423
|
-
state: 'pending_plan_selection',
|
|
424
|
-
source: 'backfill',
|
|
425
|
-
updatedBy: 'backfill',
|
|
426
|
-
billingMirrorPlanId: null,
|
|
427
|
-
effectiveAt: now,
|
|
428
|
-
createdAt: now,
|
|
429
|
-
updatedAt: now
|
|
430
|
-
});
|
|
431
|
-
db.prepare(`
|
|
432
|
-
UPDATE user_billing
|
|
433
|
-
SET stripe_customer_id = ?, stripe_subscription_id = ?, entitlement_state = ?, tier = ?, effective_until = ?, updated_at = ?
|
|
434
|
-
WHERE tenant_id = ? AND user_id = ?
|
|
435
|
-
`).run('cus_heal', 'sub_heal', 'active', 'team-5', nextRenewal, now, tenantId, 'mirror-heal-u1');
|
|
436
|
-
expect(core.getAccountAccessStatus('mirror-heal-u1')).toEqual(expect.objectContaining({
|
|
437
|
-
gate: 'ok',
|
|
438
|
-
canAccessApp: true,
|
|
439
|
-
planSelectionRequired: false
|
|
440
|
-
}));
|
|
441
|
-
expect(core.getAccountEntitlement('mirror-heal-u1')).toEqual(expect.objectContaining({
|
|
442
|
-
state: 'active',
|
|
443
|
-
planId: 'team-5',
|
|
444
|
-
planVersionId: 'team-5-v1',
|
|
445
|
-
effectiveUntil: nextRenewal
|
|
446
|
-
}));
|
|
447
|
-
const entitlementRow = db.prepare(`
|
|
448
|
-
SELECT entitlement_state, plan_version_id, effective_until, updated_by
|
|
449
|
-
FROM account_entitlements
|
|
450
|
-
WHERE tenant_id = ? AND account_id = ?
|
|
451
|
-
LIMIT 1
|
|
452
|
-
`).get(tenantId, 'mirror-heal-u1');
|
|
453
|
-
expect(entitlementRow).toEqual(expect.objectContaining({
|
|
454
|
-
entitlement_state: 'active',
|
|
455
|
-
plan_version_id: 'team-5-v1',
|
|
456
|
-
effective_until: nextRenewal,
|
|
457
|
-
updated_by: 'billing-mirror-auto-heal'
|
|
458
|
-
}));
|
|
459
|
-
}
|
|
460
|
-
finally {
|
|
461
|
-
core.close();
|
|
462
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
463
|
-
}
|
|
464
|
-
});
|
|
465
|
-
it('auto-heals a pending-plan-selection entitlement from Stripe status and price mapping when mirror state is stale', () => {
|
|
466
|
-
const projectRoot = makeProjectRoot();
|
|
467
|
-
const tenantId = path.basename(projectRoot);
|
|
468
|
-
const core = openCore(projectRoot);
|
|
469
|
-
try {
|
|
470
|
-
const now = new Date().toISOString();
|
|
471
|
-
const nextRenewal = new Date(Date.now() + (24 * 60 * 60 * 1000)).toISOString();
|
|
472
|
-
core.upsertPlanCatalog({ planId: 'team-5', displayName: 'Team 5', status: 'active' });
|
|
473
|
-
const db = core.getDatabaseAdapter();
|
|
474
|
-
db.prepare(`
|
|
475
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
476
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
477
|
-
`).run('mirror-price-heal-u1', tenantId, 'mirror-price-heal@example.com', 'Mirror Price Heal', now, now);
|
|
478
|
-
core.transitionCanonicalCommercialState({
|
|
479
|
-
accountId: 'mirror-price-heal-u1',
|
|
480
|
-
planVersionId: 'free-v1',
|
|
481
|
-
state: 'pending_plan_selection',
|
|
482
|
-
source: 'backfill',
|
|
483
|
-
updatedBy: 'checkout-expired',
|
|
484
|
-
billingMirrorPlanId: null,
|
|
485
|
-
effectiveAt: now,
|
|
486
|
-
createdAt: now,
|
|
487
|
-
updatedAt: now
|
|
488
|
-
});
|
|
489
|
-
db.prepare(`
|
|
490
|
-
UPDATE user_billing
|
|
491
|
-
SET stripe_customer_id = ?, stripe_subscription_id = ?, stripe_price_id = ?, stripe_status = ?, entitlement_state = ?, tier = ?, effective_until = ?, updated_at = ?
|
|
492
|
-
WHERE tenant_id = ? AND user_id = ?
|
|
493
|
-
`).run('cus_heal_2', 'sub_heal_2', 'price_team_5_month', 'active', 'pending_plan_selection', 'team-5', nextRenewal, now, tenantId, 'mirror-price-heal-u1');
|
|
494
|
-
db.prepare(`
|
|
495
|
-
INSERT INTO billing_price_mappings (tenant_id, plan_version_id, billing_interval, stripe_price_id, active, created_at, updated_at)
|
|
496
|
-
VALUES (?, ?, ?, ?, 1, ?, ?)
|
|
497
|
-
`).run(tenantId, 'team-5-v1', 'month', 'price_team_5_month', now, now);
|
|
498
|
-
expect(core.getAccountAccessStatus('mirror-price-heal-u1')).toEqual(expect.objectContaining({
|
|
499
|
-
gate: 'ok',
|
|
500
|
-
canAccessApp: true,
|
|
501
|
-
planSelectionRequired: false
|
|
502
|
-
}));
|
|
503
|
-
expect(core.getAccountEntitlement('mirror-price-heal-u1')).toEqual(expect.objectContaining({
|
|
504
|
-
state: 'active',
|
|
505
|
-
planId: 'team-5',
|
|
506
|
-
planVersionId: 'team-5-v1',
|
|
507
|
-
effectiveUntil: nextRenewal
|
|
508
|
-
}));
|
|
509
|
-
}
|
|
510
|
-
finally {
|
|
511
|
-
core.close();
|
|
512
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
513
|
-
}
|
|
514
|
-
});
|
|
515
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/core/Stats.test.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import os from 'os';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { afterEach, describe, expect, it } from 'vitest';
|
|
5
|
-
import { TaskforceCore } from './Taskforce';
|
|
6
|
-
const roots = [];
|
|
7
|
-
function createCore() {
|
|
8
|
-
const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-stats-'));
|
|
9
|
-
roots.push(projectRoot);
|
|
10
|
-
fs.writeFileSync(path.join(projectRoot, 'package.json'), JSON.stringify({ name: 'stats-test' }), 'utf-8');
|
|
11
|
-
return new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
12
|
-
}
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
while (roots.length > 0) {
|
|
15
|
-
const root = roots.pop();
|
|
16
|
-
if (root)
|
|
17
|
-
fs.rmSync(root, { recursive: true, force: true });
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
describe('TaskforceCore stats typing', () => {
|
|
21
|
-
it('returns archived aggregate counts as numbers', () => {
|
|
22
|
-
const core = createCore();
|
|
23
|
-
const doneTask = core.createTask({ title: 'Done task', status: 'task' });
|
|
24
|
-
const cancelledTask = core.createTask({ title: 'Cancelled task', status: 'task' });
|
|
25
|
-
core.archiveTask(doneTask.id, false);
|
|
26
|
-
core.archiveTask(cancelledTask.id, true, 'No longer needed');
|
|
27
|
-
const stats = core.getStats();
|
|
28
|
-
expect(stats.archived.total).toBe(2);
|
|
29
|
-
expect(stats.archived.doneCount).toBe(1);
|
|
30
|
-
expect(stats.archived.cancelledCount).toBe(1);
|
|
31
|
-
expect(typeof stats.archived.total).toBe('number');
|
|
32
|
-
expect(typeof stats.archived.doneCount).toBe('number');
|
|
33
|
-
expect(typeof stats.archived.cancelledCount).toBe('number');
|
|
34
|
-
core.close();
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|