@taskforcehq/taskforce 0.3.311 → 0.3.313
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -2
- package/dist/TaskforceCore.js +1 -1
- package/dist/components/features/InitiativesModule.js +1 -1
- package/dist/components/features/TaskSettings.js +1 -1
- package/dist/components/views/StandaloneLayout.js +3 -6
- package/dist/components/views/standalone/modals/AccountHubModal.d.ts +1 -2
- package/dist/components/views/standalone/modals/AccountHubModal.js +2 -3
- package/dist/components/views/standalone/modals/HelpModal.js +15 -2
- package/dist/hooks/useFilterSort.js +1 -1
- package/dist/hooks/useTaskforce.js +2 -2
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +5 -2
- package/dist/ui/assets/{AgentsModule-D8u9P5dZ.js → AgentsModule-BULqIo8e.js} +1 -1
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-CsUauFA2.js → AnnotatedAttachmentWorkspace-DHr4rHK9.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-DbQvDHFz.js → ContextAttachmentManager-DoMe2OpY.js} +1 -1
- package/dist/ui/assets/{DocumentWorkspace-BmTkN1A8.js → DocumentWorkspace-DumBWhvb.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-BXHTM-Nh.js → EntityActivityTimeline-sHk8Nzbq.js} +1 -1
- package/dist/ui/assets/{InitiativesModule-D33RyXx0.js → InitiativesModule-3X9UNzHh.js} +1 -1
- package/dist/ui/assets/{PlansPage-D0RXlT9_.js → PlansPage-C3A3EYaV.js} +1 -1
- package/dist/ui/assets/{TaskContextUpload-Vsg67lpR.js → TaskContextUpload-C8G7pWkX.js} +1 -1
- package/dist/ui/assets/{TaskSettings-DshLw7_d.js → TaskSettings-DM1o9Wla.js} +2 -2
- package/dist/ui/assets/{WorkflowsModule-CLM-1BnF.js → WorkflowsModule-CW0crzvD.js} +1 -1
- package/dist/ui/assets/documentReferences-BZB3nMRb.js +1 -0
- package/dist/ui/assets/index-BWFQ9mGn.js +5 -0
- package/dist/ui/assets/{index-DOR9PRqt.css → index-DcK_8tuE.css} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +12 -4
- package/scripts/postinstall.js +4 -3
- package/dist/TaskforceCore.CategoryFallback.test.d.ts +0 -1
- package/dist/TaskforceCore.CategoryFallback.test.js +0 -101
- package/dist/TaskforceCore.filter-persistence.test.d.ts +0 -1
- package/dist/TaskforceCore.filter-persistence.test.js +0 -402
- package/dist/TaskforceCore.routing.test.d.ts +0 -1
- package/dist/TaskforceCore.routing.test.js +0 -311
- package/dist/TaskforceCore.test.d.ts +0 -1
- package/dist/TaskforceCore.test.js +0 -7910
- package/dist/TaskforceWidget.test.d.ts +0 -1
- package/dist/TaskforceWidget.test.js +0 -92
- package/dist/UnsavedChangesRelaxed.test.d.ts +0 -1
- package/dist/UnsavedChangesRelaxed.test.js +0 -16
- package/dist/__tests__/localizationCatalogs.test.d.ts +0 -1
- package/dist/__tests__/localizationCatalogs.test.js +0 -54
- package/dist/__tests__/workflowSimulation.test.d.ts +0 -1
- package/dist/__tests__/workflowSimulation.test.js +0 -113
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.d.ts +0 -1
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.test.js +0 -278
- package/dist/annotatedAttachments/payload.test.d.ts +0 -1
- package/dist/annotatedAttachments/payload.test.js +0 -67
- package/dist/compat/workspaceSyncCompat.test.d.ts +0 -1
- package/dist/compat/workspaceSyncCompat.test.js +0 -124
- package/dist/components/features/AgentsModule.test.d.ts +0 -1
- package/dist/components/features/AgentsModule.test.js +0 -601
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.d.ts +0 -1
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +0 -2883
- package/dist/components/features/DocumentWorkspace.test.d.ts +0 -1
- package/dist/components/features/DocumentWorkspace.test.js +0 -1439
- package/dist/components/features/TaskSettings.test.d.ts +0 -1
- package/dist/components/features/TaskSettings.test.js +0 -1674
- package/dist/components/features/settings/TaxonomyLibraryManager.test.d.ts +0 -1
- package/dist/components/features/settings/TaxonomyLibraryManager.test.js +0 -141
- package/dist/components/task/TaskActionHeader.test.d.ts +0 -1
- package/dist/components/task/TaskActionHeader.test.js +0 -91
- package/dist/components/task/TaskCard.test.d.ts +0 -1
- package/dist/components/task/TaskCard.test.js +0 -513
- package/dist/components/task/TaskContextUpload.test.d.ts +0 -1
- package/dist/components/task/TaskContextUpload.test.js +0 -506
- package/dist/components/task/TaskForm.test.d.ts +0 -1
- package/dist/components/task/TaskForm.test.js +0 -946
- package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.empty-column-drop.test.js +0 -66
- package/dist/components/task/TaskKanban.planning-drop.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.planning-drop.test.js +0 -93
- package/dist/components/task/TaskKanban.test.d.ts +0 -1
- package/dist/components/task/TaskKanban.test.js +0 -99
- package/dist/components/task/TaskList.test.d.ts +0 -1
- package/dist/components/task/TaskList.test.js +0 -473
- package/dist/components/task/TaskStatusActions.test.d.ts +0 -1
- package/dist/components/task/TaskStatusActions.test.js +0 -54
- package/dist/components/task/taskKanbanDropRules.test.d.ts +0 -1
- package/dist/components/task/taskKanbanDropRules.test.js +0 -114
- package/dist/components/ui/LevelSelector.test.d.ts +0 -1
- package/dist/components/ui/LevelSelector.test.js +0 -55
- package/dist/components/ui/Markdown.test.d.ts +0 -1
- package/dist/components/ui/Markdown.test.js +0 -38
- package/dist/components/ui/MultiSelectFilter.test.d.ts +0 -1
- package/dist/components/ui/MultiSelectFilter.test.js +0 -74
- package/dist/components/ui/TaxonomyDropdown.test.d.ts +0 -1
- package/dist/components/ui/TaxonomyDropdown.test.js +0 -130
- package/dist/components/ui/TopNoticeLayer.test.d.ts +0 -1
- package/dist/components/ui/TopNoticeLayer.test.js +0 -25
- package/dist/components/views/AppShellHeader.test.d.ts +0 -1
- package/dist/components/views/AppShellHeader.test.js +0 -42
- package/dist/components/views/PlanComparisonPage.test.d.ts +0 -1
- package/dist/components/views/PlanComparisonPage.test.js +0 -758
- package/dist/components/views/PlansPage.test.d.ts +0 -1
- package/dist/components/views/PlansPage.test.js +0 -710
- package/dist/components/views/chrome/WorkspaceChromeSections.test.d.ts +0 -1
- package/dist/components/views/chrome/WorkspaceChromeSections.test.js +0 -54
- package/dist/components/views/chrome/workspaceChrome.test.d.ts +0 -1
- package/dist/components/views/chrome/workspaceChrome.test.js +0 -52
- package/dist/components/views/panels/DocumentFilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/DocumentFilterToolbar.test.js +0 -19
- package/dist/components/views/panels/FilterToolbar.test.d.ts +0 -1
- package/dist/components/views/panels/FilterToolbar.test.js +0 -47
- package/dist/components/views/panels/PlanningDrawer.test.d.ts +0 -1
- package/dist/components/views/panels/PlanningDrawer.test.js +0 -529
- package/dist/components/views/planningScope.test.d.ts +0 -1
- package/dist/components/views/planningScope.test.js +0 -60
- package/dist/components/views/standalone/modals/AccountHubModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +0 -72
- package/dist/components/views/standalone/modals/HelpModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/HelpModal.test.js +0 -23
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +0 -1
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +0 -24
- package/dist/components/views/teamManagementAccess.test.d.ts +0 -1
- package/dist/components/views/teamManagementAccess.test.js +0 -44
- package/dist/config/deployment.test.d.ts +0 -1
- package/dist/config/deployment.test.js +0 -90
- package/dist/config/envSchema.test.d.ts +0 -1
- package/dist/config/envSchema.test.js +0 -125
- package/dist/core/AiProfileService.test.d.ts +0 -1
- package/dist/core/AiProfileService.test.js +0 -184
- package/dist/core/AiProfiles.test.d.ts +0 -1
- package/dist/core/AiProfiles.test.js +0 -1873
- package/dist/core/AuthTokenService.test.d.ts +0 -1
- package/dist/core/AuthTokenService.test.js +0 -78
- package/dist/core/BulkUpdateFieldsPreview.test.d.ts +0 -1
- package/dist/core/BulkUpdateFieldsPreview.test.js +0 -62
- package/dist/core/CompletedAt.test.d.ts +0 -1
- package/dist/core/CompletedAt.test.js +0 -44
- package/dist/core/CreatedBy.test.d.ts +0 -1
- package/dist/core/CreatedBy.test.js +0 -188
- package/dist/core/DeletedTaskTrash.test.d.ts +0 -1
- package/dist/core/DeletedTaskTrash.test.js +0 -104
- package/dist/core/EntitlementsPolicy.test.d.ts +0 -1
- package/dist/core/EntitlementsPolicy.test.js +0 -280
- package/dist/core/GlobalSettingsService.test.d.ts +0 -1
- package/dist/core/GlobalSettingsService.test.js +0 -45
- package/dist/core/JsonBackupRuntime.test.d.ts +0 -1
- package/dist/core/JsonBackupRuntime.test.js +0 -155
- package/dist/core/PlanFeatureCatalog.test.d.ts +0 -1
- package/dist/core/PlanFeatureCatalog.test.js +0 -139
- package/dist/core/PlanVersionPolicy.test.d.ts +0 -1
- package/dist/core/PlanVersionPolicy.test.js +0 -236
- package/dist/core/PlanningEntities.test.d.ts +0 -1
- package/dist/core/PlanningEntities.test.js +0 -509
- package/dist/core/ScheduleFields.test.d.ts +0 -1
- package/dist/core/ScheduleFields.test.js +0 -193
- package/dist/core/SetupState.test.d.ts +0 -1
- package/dist/core/SetupState.test.js +0 -113
- package/dist/core/SignupMonetizationSettings.test.d.ts +0 -1
- package/dist/core/SignupMonetizationSettings.test.js +0 -515
- package/dist/core/Stats.test.d.ts +0 -1
- package/dist/core/Stats.test.js +0 -36
- package/dist/core/SystemAdmin.test.d.ts +0 -1
- package/dist/core/SystemAdmin.test.js +0 -1106
- package/dist/core/TaskActivitySync.test.d.ts +0 -1
- package/dist/core/TaskActivitySync.test.js +0 -90
- package/dist/core/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/TaskAttachmentsCanonical.test.js +0 -356
- package/dist/core/TaskAuditTimeline.test.d.ts +0 -1
- package/dist/core/TaskAuditTimeline.test.js +0 -319
- package/dist/core/TaskTaxonomyValidation.test.d.ts +0 -1
- package/dist/core/TaskTaxonomyValidation.test.js +0 -440
- package/dist/core/Taskforce.ids.test.d.ts +0 -1
- package/dist/core/Taskforce.ids.test.js +0 -611
- package/dist/core/Taskforce.listTasksSlim.test.d.ts +0 -1
- package/dist/core/Taskforce.listTasksSlim.test.js +0 -91
- package/dist/core/Taskforce.mcpAuth.test.d.ts +0 -1
- package/dist/core/Taskforce.mcpAuth.test.js +0 -450
- package/dist/core/Taskforce.realtimeMutation.test.d.ts +0 -1
- package/dist/core/Taskforce.realtimeMutation.test.js +0 -131
- package/dist/core/UserProfileAvatarDrafts.test.d.ts +0 -1
- package/dist/core/UserProfileAvatarDrafts.test.js +0 -138
- package/dist/core/WorkspaceDelete.test.d.ts +0 -1
- package/dist/core/WorkspaceDelete.test.js +0 -159
- package/dist/core/WorkspacePermissions.test.d.ts +0 -1
- package/dist/core/WorkspacePermissions.test.js +0 -270
- package/dist/core/WorkspacePlanMode.test.d.ts +0 -1
- package/dist/core/WorkspacePlanMode.test.js +0 -383
- package/dist/core/WorkspaceSyncSettings.test.d.ts +0 -1
- package/dist/core/WorkspaceSyncSettings.test.js +0 -65
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.d.ts +0 -1
- package/dist/core/__tests__/TaskAttachmentsCanonical.test.js +0 -212
- package/dist/documentReviews/DocumentReviewSessionStore.test.d.ts +0 -1
- package/dist/documentReviews/DocumentReviewSessionStore.test.js +0 -127
- package/dist/hooks/authGuardPolicy.test.d.ts +0 -1
- package/dist/hooks/authGuardPolicy.test.js +0 -76
- package/dist/hooks/bootstrapTimeouts.test.d.ts +0 -1
- package/dist/hooks/bootstrapTimeouts.test.js +0 -12
- package/dist/hooks/sync/controlPlane.test.d.ts +0 -1
- package/dist/hooks/sync/controlPlane.test.js +0 -121
- package/dist/hooks/sync/lifecyclePolicy.test.d.ts +0 -1
- package/dist/hooks/sync/lifecyclePolicy.test.js +0 -124
- package/dist/hooks/sync/orchestratorShared.test.d.ts +0 -1
- package/dist/hooks/sync/orchestratorShared.test.js +0 -98
- package/dist/hooks/sync/pullLifecycle.test.d.ts +0 -1
- package/dist/hooks/sync/pullLifecycle.test.js +0 -80
- package/dist/hooks/sync/recovery.test.d.ts +0 -1
- package/dist/hooks/sync/recovery.test.js +0 -292
- package/dist/hooks/sync/transfers.test.d.ts +0 -1
- package/dist/hooks/sync/transfers.test.js +0 -928
- package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +0 -1
- package/dist/hooks/sync/useRecentSyncEvents.test.js +0 -124
- package/dist/hooks/sync/useSyncStatusActions.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusActions.test.js +0 -133
- package/dist/hooks/sync/useSyncStatusControls.test.d.ts +0 -1
- package/dist/hooks/sync/useSyncStatusControls.test.js +0 -88
- package/dist/hooks/useFilterSort.test.d.ts +0 -1
- package/dist/hooks/useFilterSort.test.js +0 -419
- package/dist/hooks/useRealtimeSync.test.d.ts +0 -1
- package/dist/hooks/useRealtimeSync.test.js +0 -311
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +0 -54
- package/dist/hooks/useSyncOrchestrator.context-assets.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.context-assets.test.js +0 -228
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +0 -1
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +0 -2027
- package/dist/hooks/useTaskData.test.d.ts +0 -1
- package/dist/hooks/useTaskData.test.js +0 -291
- package/dist/hooks/useTaskMutations.test.d.ts +0 -1
- package/dist/hooks/useTaskMutations.test.js +0 -256
- package/dist/hooks/useTaskforce.contract.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.contract.test.js +0 -7
- package/dist/hooks/useTaskforce.priority-filters.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.priority-filters.test.js +0 -28
- package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.runtime-routing.test.js +0 -246
- package/dist/hooks/useTaskforce.sync-behavior.test.d.ts +0 -1
- package/dist/hooks/useTaskforce.sync-behavior.test.js +0 -3644
- package/dist/hooks/useWorkspaceSyncController.test.d.ts +0 -1
- package/dist/hooks/useWorkspaceSyncController.test.js +0 -192
- package/dist/hooks/workspace/useTaskforceApiRouting.test.d.ts +0 -1
- package/dist/hooks/workspace/useTaskforceApiRouting.test.js +0 -77
- package/dist/hooks/workspace/workspaceLocalState.test.d.ts +0 -1
- package/dist/hooks/workspace/workspaceLocalState.test.js +0 -59
- package/dist/localization/localizationCatalogs.test.d.ts +0 -1
- package/dist/localization/localizationCatalogs.test.js +0 -37
- package/dist/mcp/aiProfileBootstrap.test.d.ts +0 -1
- package/dist/mcp/aiProfileBootstrap.test.js +0 -68
- package/dist/mcp/canonicalAssetHelpers.test.d.ts +0 -1
- package/dist/mcp/canonicalAssetHelpers.test.js +0 -67
- package/dist/mcp/clientIntegrations.test.d.ts +0 -1
- package/dist/mcp/clientIntegrations.test.js +0 -219
- package/dist/mcp/optionResolution.test.d.ts +0 -1
- package/dist/mcp/optionResolution.test.js +0 -43
- package/dist/mcp/runtime.test.d.ts +0 -1
- package/dist/mcp/runtime.test.js +0 -5211
- package/dist/mcp/structuredCommentValidation.test.d.ts +0 -1
- package/dist/mcp/structuredCommentValidation.test.js +0 -31
- package/dist/mcp/structuredDocValidation.test.d.ts +0 -1
- package/dist/mcp/structuredDocValidation.test.js +0 -35
- package/dist/mcp/toolRegistry.test.d.ts +0 -1
- package/dist/mcp/toolRegistry.test.js +0 -34
- package/dist/migrations/billingSchemaParity.test.d.ts +0 -1
- package/dist/migrations/billingSchemaParity.test.js +0 -160
- package/dist/migrations/taskSchemaMigrations.test.d.ts +0 -1
- package/dist/migrations/taskSchemaMigrations.test.js +0 -225
- package/dist/qaOpen.test.d.ts +0 -1
- package/dist/qaOpen.test.js +0 -56
- package/dist/releaseVersion.test.d.ts +0 -1
- package/dist/releaseVersion.test.js +0 -32
- package/dist/runtime/appGates.test.d.ts +0 -1
- package/dist/runtime/appGates.test.js +0 -42
- package/dist/server/aiProfileAvatarAssets.test.d.ts +0 -1
- package/dist/server/aiProfileAvatarAssets.test.js +0 -213
- package/dist/server/annotatedAttachmentsRoutes.test.d.ts +0 -1
- package/dist/server/annotatedAttachmentsRoutes.test.js +0 -532
- package/dist/server/auth.test.d.ts +0 -1
- package/dist/server/auth.test.js +0 -131
- package/dist/server/buildInfo.test.d.ts +0 -1
- package/dist/server/buildInfo.test.js +0 -29
- package/dist/server/cors.test.d.ts +0 -1
- package/dist/server/cors.test.js +0 -77
- package/dist/server/documentReviewRoutes.test.d.ts +0 -1
- package/dist/server/documentReviewRoutes.test.js +0 -190
- package/dist/server/email.test.d.ts +0 -1
- package/dist/server/email.test.js +0 -113
- package/dist/server/index.cookieProxy.test.d.ts +0 -1
- package/dist/server/index.cookieProxy.test.js +0 -67
- package/dist/server/index.rateLimit.test.d.ts +0 -1
- package/dist/server/index.rateLimit.test.js +0 -22
- package/dist/server/index.test.d.ts +0 -1
- package/dist/server/index.test.js +0 -283
- package/dist/server/rateLimit.test.d.ts +0 -1
- package/dist/server/rateLimit.test.js +0 -107
- package/dist/server/realtimeSync.auth.test.d.ts +0 -1
- package/dist/server/realtimeSync.auth.test.js +0 -62
- package/dist/server/realtimeSync.replay.test.d.ts +0 -1
- package/dist/server/realtimeSync.replay.test.js +0 -192
- package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +0 -1
- package/dist/server/realtimeSync.workspaceIsolation.test.js +0 -101
- package/dist/server/routes/billing.test.d.ts +0 -1
- package/dist/server/routes/billing.test.js +0 -3515
- package/dist/server/routes/shared.test.d.ts +0 -1
- package/dist/server/routes/shared.test.js +0 -32
- package/dist/server/routes/sync.integration.test.d.ts +0 -1
- package/dist/server/routes/sync.integration.test.js +0 -2932
- package/dist/server/routes/syncAuxRoutes.test.d.ts +0 -1
- package/dist/server/routes/syncAuxRoutes.test.js +0 -158
- package/dist/server/routes/syncRouteGuards.test.d.ts +0 -1
- package/dist/server/routes/syncRouteGuards.test.js +0 -94
- package/dist/server/routes.test.d.ts +0 -1
- package/dist/server/routes.test.js +0 -15612
- package/dist/server/runtimeMode.test.d.ts +0 -1
- package/dist/server/runtimeMode.test.js +0 -26
- package/dist/server/securityHeaders.test.d.ts +0 -1
- package/dist/server/securityHeaders.test.js +0 -70
- package/dist/services/templateEngine.test.d.ts +0 -1
- package/dist/services/templateEngine.test.js +0 -150
- package/dist/services/templates.test.d.ts +0 -1
- package/dist/services/templates.test.js +0 -45
- package/dist/services/workflowDocumentFixtures.test.d.ts +0 -1
- package/dist/services/workflowDocumentFixtures.test.js +0 -78
- package/dist/services/workflowExportMatrix.test.d.ts +0 -1
- package/dist/services/workflowExportMatrix.test.js +0 -113
- package/dist/services/workflowExportSnapshots.test.d.ts +0 -1
- package/dist/services/workflowExportSnapshots.test.js +0 -30
- package/dist/services/workflowGeneration.test.d.ts +0 -1
- package/dist/services/workflowGeneration.test.js +0 -12
- package/dist/services/workflowSimulation.test.d.ts +0 -1
- package/dist/services/workflowSimulation.test.js +0 -113
- package/dist/services/workflowV2Policy.test.d.ts +0 -1
- package/dist/services/workflowV2Policy.test.js +0 -80
- package/dist/shared/customTaxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/customTaxonomyLibrary.test.js +0 -20
- package/dist/shared/passwordPolicy.test.d.ts +0 -1
- package/dist/shared/passwordPolicy.test.js +0 -34
- package/dist/shared/runtimeContract.test.d.ts +0 -1
- package/dist/shared/runtimeContract.test.js +0 -23
- package/dist/shared/taxonomyLibrary.test.d.ts +0 -1
- package/dist/shared/taxonomyLibrary.test.js +0 -26
- package/dist/shared/taxonomyState.test.d.ts +0 -1
- package/dist/shared/taxonomyState.test.js +0 -71
- package/dist/soak/preflight.cli.d.ts +0 -1
- package/dist/soak/preflight.cli.js +0 -28
- package/dist/soak/preflight.d.ts +0 -26
- package/dist/soak/preflight.js +0 -113
- package/dist/soak/preflight.test.d.ts +0 -1
- package/dist/soak/preflight.test.js +0 -39
- package/dist/storage/objectStorageClient.test.d.ts +0 -1
- package/dist/storage/objectStorageClient.test.js +0 -82
- package/dist/storage/objectStorageConfig.test.d.ts +0 -1
- package/dist/storage/objectStorageConfig.test.js +0 -50
- package/dist/storage/postgresAdapter.test.d.ts +0 -1
- package/dist/storage/postgresAdapter.test.js +0 -29
- package/dist/storage/workspaceAssetStore.test.d.ts +0 -1
- package/dist/storage/workspaceAssetStore.test.js +0 -588
- package/dist/sync/cloudSyncApi.test.d.ts +0 -1
- package/dist/sync/cloudSyncApi.test.js +0 -111
- package/dist/sync/collaborationSyncPayload.test.d.ts +0 -1
- package/dist/sync/collaborationSyncPayload.test.js +0 -125
- package/dist/sync/contentSyncPayload.test.d.ts +0 -1
- package/dist/sync/contentSyncPayload.test.js +0 -143
- package/dist/sync/encryptionService.test.d.ts +0 -1
- package/dist/sync/encryptionService.test.js +0 -52
- package/dist/sync/planningSyncPayload.test.d.ts +0 -1
- package/dist/sync/planningSyncPayload.test.js +0 -92
- package/dist/sync/realtimeFeature.test.d.ts +0 -1
- package/dist/sync/realtimeFeature.test.js +0 -30
- package/dist/sync/realtimeReconcile.test.d.ts +0 -1
- package/dist/sync/realtimeReconcile.test.js +0 -43
- package/dist/sync/syncApplyHandlers.test.d.ts +0 -1
- package/dist/sync/syncApplyHandlers.test.js +0 -626
- package/dist/sync/syncService.test.d.ts +0 -1
- package/dist/sync/syncService.test.js +0 -903
- package/dist/sync/taskSyncPayload.test.d.ts +0 -1
- package/dist/sync/taskSyncPayload.test.js +0 -54
- package/dist/sync/workspacePullFeed.test.d.ts +0 -1
- package/dist/sync/workspacePullFeed.test.js +0 -438
- package/dist/sync/workspaceSyncModel.test.d.ts +0 -1
- package/dist/sync/workspaceSyncModel.test.js +0 -1442
- package/dist/test/setup.d.ts +0 -1
- package/dist/test/setup.js +0 -15
- package/dist/ui/assets/documentReferences-BPWp6ce0.js +0 -1
- package/dist/ui/assets/index-zvbo2Jse.js +0 -5
- package/dist/utils/accountProfileSummaryCache.test.d.ts +0 -1
- package/dist/utils/accountProfileSummaryCache.test.js +0 -63
- package/dist/utils/annotatedAttachments.test.d.ts +0 -1
- package/dist/utils/annotatedAttachments.test.js +0 -108
- package/dist/utils/assignees.test.d.ts +0 -1
- package/dist/utils/assignees.test.js +0 -25
- package/dist/utils/avatarUpload.test.d.ts +0 -1
- package/dist/utils/avatarUpload.test.js +0 -40
- package/dist/utils/canonicalAssetKind.test.d.ts +0 -1
- package/dist/utils/canonicalAssetKind.test.js +0 -24
- package/dist/utils/coalescedRefresh.test.d.ts +0 -1
- package/dist/utils/coalescedRefresh.test.js +0 -30
- package/dist/utils/constants.icons.test.d.ts +0 -1
- package/dist/utils/constants.icons.test.js +0 -41
- package/dist/utils/planParser.test.d.ts +0 -1
- package/dist/utils/planParser.test.js +0 -183
- package/dist/utils/planningReferences.test.d.ts +0 -1
- package/dist/utils/planningReferences.test.js +0 -17
- package/dist/utils/supportContact.test.d.ts +0 -1
- package/dist/utils/supportContact.test.js +0 -19
- package/dist/utils/syncEventDetails.test.d.ts +0 -1
- package/dist/utils/syncEventDetails.test.js +0 -23
- package/dist/utils/syncEventPresentation.test.d.ts +0 -1
- package/dist/utils/syncEventPresentation.test.js +0 -64
- package/dist/utils/syncStatusPresentation.test.d.ts +0 -1
- package/dist/utils/syncStatusPresentation.test.js +0 -164
- package/dist/utils/taskActivity.test.d.ts +0 -1
- package/dist/utils/taskActivity.test.js +0 -218
- package/dist/utils/taskDraftDefaults.test.d.ts +0 -1
- package/dist/utils/taskDraftDefaults.test.js +0 -34
- package/dist/utils/taskDragZones.test.d.ts +0 -1
- package/dist/utils/taskDragZones.test.js +0 -14
- package/dist/utils/taskNormalization.test.d.ts +0 -1
- package/dist/utils/taskNormalization.test.js +0 -158
- package/dist/utils/taskSearch.test.d.ts +0 -1
- package/dist/utils/taskSearch.test.js +0 -69
- package/dist/utils/taskUtils.test.d.ts +0 -1
- package/dist/utils/taskUtils.test.js +0 -19
- package/dist/utils/taskforceApiClient.test.d.ts +0 -1
- package/dist/utils/taskforceApiClient.test.js +0 -44
- package/dist/utils/taxonomyFormDefaults.test.d.ts +0 -1
- package/dist/utils/taxonomyFormDefaults.test.js +0 -63
- package/dist/utils/uiNotice.test.d.ts +0 -1
- package/dist/utils/uiNotice.test.js +0 -18
- package/dist/utils/workspaceIdentity.test.d.ts +0 -1
- package/dist/utils/workspaceIdentity.test.js +0 -61
- package/dist/utils/workspaceLifecycle.test.d.ts +0 -1
- package/dist/utils/workspaceLifecycle.test.js +0 -64
- package/dist/utils/workspaceSyncPresentation.test.d.ts +0 -1
- package/dist/utils/workspaceSyncPresentation.test.js +0 -71
- package/scripts/bootstrap-playwright-auth.mjs +0 -155
- package/scripts/check-cloud-mcp.mjs +0 -83
- package/scripts/check-compat-boundaries.mjs +0 -41
- package/scripts/check-env.ts +0 -31
- package/scripts/check-localization-strings.mjs +0 -49
- package/scripts/check-runtime-boundaries.mjs +0 -44
- package/scripts/debug-global.mjs +0 -34
- package/scripts/debug-login.mjs +0 -32
- package/scripts/debug-server.mjs +0 -36
- package/scripts/deploy-prod.sh +0 -41
- package/scripts/deploy-staging.sh +0 -23
- package/scripts/export-sqlite-to-postgres.mjs +0 -123
- package/scripts/generate-env-example.ts +0 -8
- package/scripts/mcp-stdio-adapter.mjs +0 -160
- package/scripts/migrate-task-data-assets.mjs +0 -408
- package/scripts/playwright-auth.sh +0 -19
- package/scripts/qa-open-lib.mjs +0 -175
- package/scripts/qa-open-lib.mjs.d.ts +0 -49
- package/scripts/qa-open.mjs +0 -352
- package/scripts/release-version-lib.mjs +0 -88
- package/scripts/release-version.mjs +0 -72
- package/scripts/run-billing-performance-smoke.sh +0 -24
- package/scripts/run-dev-proxy.sh +0 -51
- package/scripts/run-e2e-realtime.sh +0 -30
- package/scripts/run-smoke.sh +0 -35
- package/scripts/run-soak.sh +0 -41
- package/scripts/test-global.js +0 -143
- package/scripts/update-homebrew-formula.sh +0 -108
- package/scripts/with-esbuild.sh +0 -11
|
@@ -1,383 +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-plan-mode-'));
|
|
8
|
-
}
|
|
9
|
-
function openCore(projectRoot) {
|
|
10
|
-
const core = new TaskforceCore({
|
|
11
|
-
projectRoot,
|
|
12
|
-
storagePath: path.join(projectRoot, '.taskforce')
|
|
13
|
-
});
|
|
14
|
-
const db = core.db;
|
|
15
|
-
const now = new Date().toISOString();
|
|
16
|
-
const addFreeMapping = (planVersionId) => {
|
|
17
|
-
db.prepare(`
|
|
18
|
-
INSERT OR IGNORE INTO billing_price_mappings (
|
|
19
|
-
tenant_id, plan_version_id, billing_interval, stripe_price_id, pricing_type, active, unit_amount, currency, created_at, updated_at
|
|
20
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
21
|
-
`).run('default', planVersionId, 'month', `free:${planVersionId}:month`, 'free', 1, 0, null, now, now);
|
|
22
|
-
};
|
|
23
|
-
core.upsertPlanCatalog({ planId: 'free', displayName: 'Free' });
|
|
24
|
-
addFreeMapping('free-v1');
|
|
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
|
-
core.upsertPlanCatalog({ planId: 'team-5', displayName: 'Team 5' });
|
|
38
|
-
addFreeMapping('team-5-v1');
|
|
39
|
-
core.upsertPlanCatalog({ planId: 'team-5', displayName: 'Team 5', status: 'active' });
|
|
40
|
-
core.updatePlanVersion({
|
|
41
|
-
planId: 'team-5',
|
|
42
|
-
versionNumber: 1,
|
|
43
|
-
seatLimit: 5
|
|
44
|
-
});
|
|
45
|
-
core.updatePlanVersionFeatures({
|
|
46
|
-
planVersionId: 'team-5-v1',
|
|
47
|
-
features: [
|
|
48
|
-
{ featureKey: 'collaboration.invites', access: 'enabled' },
|
|
49
|
-
{ featureKey: 'collaboration.team_management', access: 'enabled' }
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
return core;
|
|
53
|
-
}
|
|
54
|
-
describe('TaskforceCore account-level plan mode and invite revoke', () => {
|
|
55
|
-
it('derives workspace plan mode from owner account plan across all owned workspaces', () => {
|
|
56
|
-
const projectRoot = makeProjectRoot();
|
|
57
|
-
const initial = openCore(projectRoot);
|
|
58
|
-
try {
|
|
59
|
-
const now = new Date().toISOString();
|
|
60
|
-
const db = initial.db;
|
|
61
|
-
db.prepare(`
|
|
62
|
-
INSERT INTO workspaces (id, tenant_id, slug, name, created_at, updated_at)
|
|
63
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
64
|
-
`).run('workspace-single', 'default', 'workspace-single', 'Single', now, now);
|
|
65
|
-
db.prepare(`
|
|
66
|
-
INSERT INTO workspaces (id, tenant_id, slug, name, created_at, updated_at)
|
|
67
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
68
|
-
`).run('workspace-team', 'default', 'workspace-team', 'Team', now, now);
|
|
69
|
-
db.prepare(`
|
|
70
|
-
INSERT INTO workspaces (id, tenant_id, slug, name, created_at, updated_at)
|
|
71
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
72
|
-
`).run('workspace-u1-second', 'default', 'workspace-u1-second', 'Second U1 Workspace', now, now);
|
|
73
|
-
db.prepare(`
|
|
74
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
75
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
76
|
-
`).run('u1', 'default', 'u1@example.com', 'U1', now, now);
|
|
77
|
-
db.prepare(`
|
|
78
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
79
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
80
|
-
`).run('u2', 'default', 'u2@example.com', 'U2', now, now);
|
|
81
|
-
db.prepare(`
|
|
82
|
-
INSERT INTO users (id, tenant_id, email, display_name, is_disabled, created_at, updated_at)
|
|
83
|
-
VALUES (?, ?, ?, ?, 0, ?, ?)
|
|
84
|
-
`).run('u3', 'default', 'u3@example.com', 'U3', now, now);
|
|
85
|
-
db.prepare(`
|
|
86
|
-
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
87
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
88
|
-
`).run('m1', 'default', 'workspace-single', 'u1', 'owner', 'active', now, now);
|
|
89
|
-
db.prepare(`
|
|
90
|
-
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
91
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
92
|
-
`).run('m2', 'default', 'workspace-team', 'u2', 'owner', 'active', now, now);
|
|
93
|
-
db.prepare(`
|
|
94
|
-
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
95
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
96
|
-
`).run('m3', 'default', 'workspace-team', 'u3', 'member', 'active', now, now);
|
|
97
|
-
db.prepare(`
|
|
98
|
-
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
99
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
100
|
-
`).run('m4', 'default', 'workspace-u1-second', 'u1', 'owner', 'active', now, now);
|
|
101
|
-
initial.setUserAccountPlanMode('u2', 'team');
|
|
102
|
-
}
|
|
103
|
-
finally {
|
|
104
|
-
initial.close();
|
|
105
|
-
}
|
|
106
|
-
const reopened = openCore(projectRoot);
|
|
107
|
-
try {
|
|
108
|
-
expect(reopened.getWorkspacePlanMode('workspace-single')).toBe('personal');
|
|
109
|
-
expect(reopened.getWorkspacePlanMode('workspace-team')).toBe('team');
|
|
110
|
-
expect(reopened.getWorkspacePlanMode('workspace-u1-second')).toBe('personal');
|
|
111
|
-
reopened.setWorkspacePlanMode('workspace-single', 'team');
|
|
112
|
-
expect(reopened.getWorkspacePlanMode('workspace-single')).toBe('team');
|
|
113
|
-
expect(reopened.getWorkspacePlanMode('workspace-u1-second')).toBe('team');
|
|
114
|
-
}
|
|
115
|
-
finally {
|
|
116
|
-
reopened.close();
|
|
117
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
it('marks invite token as revoked and inspect reflects revoked state', () => {
|
|
121
|
-
const projectRoot = makeProjectRoot();
|
|
122
|
-
const core = openCore(projectRoot);
|
|
123
|
-
try {
|
|
124
|
-
core.createWorkspace({ workspaceId: 'workspace-invite', name: 'Invite Workspace' });
|
|
125
|
-
core.ensureBootstrapUserAccess({
|
|
126
|
-
userId: 'user-invite',
|
|
127
|
-
workspaceId: 'workspace-invite',
|
|
128
|
-
role: 'member',
|
|
129
|
-
email: 'invite@example.com'
|
|
130
|
-
});
|
|
131
|
-
const invite = core.requestInviteAcceptance({ userId: 'user-invite', workspaceId: 'workspace-invite' });
|
|
132
|
-
expect(typeof invite.token).toBe('string');
|
|
133
|
-
const revoke = core.revokeInviteAcceptanceForUser('user-invite');
|
|
134
|
-
expect(revoke.revoked).toBeGreaterThan(0);
|
|
135
|
-
const inspected = core.inspectInviteAcceptance(String(invite.token));
|
|
136
|
-
expect(inspected.state).toBe('revoked');
|
|
137
|
-
}
|
|
138
|
-
finally {
|
|
139
|
-
core.close();
|
|
140
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
it('classifies invited placeholder users as new users and registered users as existing users', () => {
|
|
144
|
-
const projectRoot = makeProjectRoot();
|
|
145
|
-
const core = openCore(projectRoot);
|
|
146
|
-
try {
|
|
147
|
-
core.createWorkspace({ workspaceId: 'workspace-invite', name: 'Invite Workspace' });
|
|
148
|
-
core.ensureBootstrapUserAccess({
|
|
149
|
-
userId: 'user-new',
|
|
150
|
-
workspaceId: 'workspace-invite',
|
|
151
|
-
role: 'member',
|
|
152
|
-
email: 'new@example.com'
|
|
153
|
-
});
|
|
154
|
-
core.ensurePasswordUser({
|
|
155
|
-
email: 'existing@example.com',
|
|
156
|
-
password: 'HarborLanternOrbit!2026',
|
|
157
|
-
workspaceId: 'workspace-invite',
|
|
158
|
-
role: 'member'
|
|
159
|
-
});
|
|
160
|
-
const inviteNew = core.requestInviteAcceptance({ userId: 'user-new', workspaceId: 'workspace-invite' });
|
|
161
|
-
const inspectNew = core.inspectInviteAcceptance(String(inviteNew.token));
|
|
162
|
-
expect(inspectNew.inviteeKind).toBe('new_user');
|
|
163
|
-
expect(inspectNew.passwordRequired).toBe(true);
|
|
164
|
-
const existingUserId = core.resolveUserIdentity('user-new')?.userId;
|
|
165
|
-
expect(existingUserId).toBe('user-new');
|
|
166
|
-
const existingLookup = core.db.prepare(`
|
|
167
|
-
SELECT id FROM users WHERE tenant_id = ? AND email = ? LIMIT 1
|
|
168
|
-
`).get('default', 'existing@example.com');
|
|
169
|
-
const inviteExisting = core.requestInviteAcceptance({ userId: String(existingLookup?.id || ''), workspaceId: 'workspace-invite' });
|
|
170
|
-
const inspectExisting = core.inspectInviteAcceptance(String(inviteExisting.token));
|
|
171
|
-
expect(inspectExisting.inviteeKind).toBe('existing_user');
|
|
172
|
-
expect(inspectExisting.passwordRequired).toBe(false);
|
|
173
|
-
}
|
|
174
|
-
finally {
|
|
175
|
-
core.close();
|
|
176
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
it('joins invite for existing authenticated users without changing their password hash', () => {
|
|
180
|
-
const projectRoot = makeProjectRoot();
|
|
181
|
-
const core = openCore(projectRoot);
|
|
182
|
-
try {
|
|
183
|
-
core.createWorkspace({ workspaceId: 'workspace-invite', name: 'Invite Workspace' });
|
|
184
|
-
core.ensureBootstrapUserAccess({
|
|
185
|
-
userId: 'owner-user',
|
|
186
|
-
workspaceId: 'workspace-invite',
|
|
187
|
-
role: 'owner',
|
|
188
|
-
email: 'owner@example.com'
|
|
189
|
-
});
|
|
190
|
-
core.setUserAccountPlanMode('owner-user', 'team');
|
|
191
|
-
const existing = core.ensurePasswordUser({
|
|
192
|
-
email: 'existing@example.com',
|
|
193
|
-
password: 'HarborLanternOrbit!2026',
|
|
194
|
-
workspaceId: 'workspace-invite',
|
|
195
|
-
role: 'member'
|
|
196
|
-
});
|
|
197
|
-
core.setWorkspaceUserDisabled(existing.userId, 'workspace-invite', true);
|
|
198
|
-
const db = core.db;
|
|
199
|
-
db.prepare(`
|
|
200
|
-
UPDATE workspace_memberships
|
|
201
|
-
SET status = 'invited'
|
|
202
|
-
WHERE tenant_id = ? AND user_id = ? AND workspace_id = ?
|
|
203
|
-
`).run('default', existing.userId, 'workspace-invite');
|
|
204
|
-
const before = db.prepare(`
|
|
205
|
-
SELECT password_hash FROM user_auth_identities
|
|
206
|
-
WHERE tenant_id = ? AND user_id = ? AND provider = 'password' LIMIT 1
|
|
207
|
-
`).get('default', existing.userId);
|
|
208
|
-
const invite = core.requestInviteAcceptance({ userId: existing.userId, workspaceId: 'workspace-invite' });
|
|
209
|
-
const accepted = core.joinInviteWithAuthenticatedUser({
|
|
210
|
-
token: String(invite.token),
|
|
211
|
-
userId: existing.userId
|
|
212
|
-
});
|
|
213
|
-
const after = db.prepare(`
|
|
214
|
-
SELECT password_hash FROM user_auth_identities
|
|
215
|
-
WHERE tenant_id = ? AND user_id = ? AND provider = 'password' LIMIT 1
|
|
216
|
-
`).get('default', existing.userId);
|
|
217
|
-
const membership = db.prepare(`
|
|
218
|
-
SELECT status FROM workspace_memberships WHERE tenant_id = ? AND user_id = ? AND workspace_id = ? LIMIT 1
|
|
219
|
-
`).get('default', existing.userId, 'workspace-invite');
|
|
220
|
-
expect(accepted.workspaceId).toBe('workspace-invite');
|
|
221
|
-
expect(before?.password_hash).toBeTruthy();
|
|
222
|
-
expect(after?.password_hash).toBe(before?.password_hash);
|
|
223
|
-
expect(membership?.status).toBe('active');
|
|
224
|
-
}
|
|
225
|
-
finally {
|
|
226
|
-
core.close();
|
|
227
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
it('grants the default onboarding entitlement to newly accepted invited accounts', () => {
|
|
231
|
-
const projectRoot = makeProjectRoot();
|
|
232
|
-
const core = openCore(projectRoot);
|
|
233
|
-
try {
|
|
234
|
-
core.updateGlobalSettings({
|
|
235
|
-
billing: {
|
|
236
|
-
onboardingPolicy: {
|
|
237
|
-
mode: 'auto_grant_free',
|
|
238
|
-
planId: 'free'
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
core.createWorkspace({ workspaceId: 'workspace-invite', name: 'Invite Workspace' });
|
|
243
|
-
core.ensureBootstrapUserAccess({
|
|
244
|
-
userId: 'owner-user',
|
|
245
|
-
workspaceId: 'workspace-invite',
|
|
246
|
-
role: 'owner',
|
|
247
|
-
email: 'owner@example.com'
|
|
248
|
-
});
|
|
249
|
-
core.setUserAccountPlanMode('owner-user', 'team');
|
|
250
|
-
core.ensureBootstrapUserAccess({
|
|
251
|
-
userId: 'invited-user',
|
|
252
|
-
workspaceId: 'workspace-invite',
|
|
253
|
-
role: 'member',
|
|
254
|
-
email: 'invited@example.com'
|
|
255
|
-
});
|
|
256
|
-
core.setWorkspaceUserDisabled('invited-user', 'workspace-invite', true);
|
|
257
|
-
const db = core.db;
|
|
258
|
-
db.prepare(`
|
|
259
|
-
UPDATE workspace_memberships
|
|
260
|
-
SET status = 'invited'
|
|
261
|
-
WHERE tenant_id = ? AND user_id = ? AND workspace_id = ?
|
|
262
|
-
`).run('default', 'invited-user', 'workspace-invite');
|
|
263
|
-
const invite = core.requestInviteAcceptance({ userId: 'invited-user', workspaceId: 'workspace-invite' });
|
|
264
|
-
const accepted = core.acceptInviteWithToken({
|
|
265
|
-
token: String(invite.token),
|
|
266
|
-
password: 'LanternHarborOrbit!2026'
|
|
267
|
-
});
|
|
268
|
-
expect(accepted.workspaceId).toBe('workspace-invite');
|
|
269
|
-
expect(core.hasAccountEntitlement('invited-user')).toBe(true);
|
|
270
|
-
expect(core.getAccountEntitlement('invited-user')).toEqual(expect.objectContaining({
|
|
271
|
-
planVersionId: 'free-v1',
|
|
272
|
-
state: 'active'
|
|
273
|
-
}));
|
|
274
|
-
expect(core.getAccountAccessStatus('invited-user')).toEqual(expect.objectContaining({
|
|
275
|
-
gate: 'ok',
|
|
276
|
-
canAccessApp: true
|
|
277
|
-
}));
|
|
278
|
-
}
|
|
279
|
-
finally {
|
|
280
|
-
core.close();
|
|
281
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
it('grants the free personal entitlement to newly accepted invited accounts even without explicit self-serve onboarding policy', () => {
|
|
285
|
-
const projectRoot = makeProjectRoot();
|
|
286
|
-
const core = openCore(projectRoot);
|
|
287
|
-
try {
|
|
288
|
-
core.createWorkspace({ workspaceId: 'workspace-invite', name: 'Invite Workspace' });
|
|
289
|
-
core.ensureBootstrapUserAccess({
|
|
290
|
-
userId: 'owner-user',
|
|
291
|
-
workspaceId: 'workspace-invite',
|
|
292
|
-
role: 'owner',
|
|
293
|
-
email: 'owner@example.com'
|
|
294
|
-
});
|
|
295
|
-
core.setUserAccountPlanMode('owner-user', 'team');
|
|
296
|
-
core.ensureBootstrapUserAccess({
|
|
297
|
-
userId: 'invited-user',
|
|
298
|
-
workspaceId: 'workspace-invite',
|
|
299
|
-
role: 'member',
|
|
300
|
-
email: 'invited-no-policy@example.com'
|
|
301
|
-
});
|
|
302
|
-
core.setWorkspaceUserDisabled('invited-user', 'workspace-invite', true);
|
|
303
|
-
const db = core.db;
|
|
304
|
-
db.prepare(`
|
|
305
|
-
UPDATE workspace_memberships
|
|
306
|
-
SET status = 'invited'
|
|
307
|
-
WHERE tenant_id = ? AND user_id = ? AND workspace_id = ?
|
|
308
|
-
`).run('default', 'invited-user', 'workspace-invite');
|
|
309
|
-
const invite = core.requestInviteAcceptance({ userId: 'invited-user', workspaceId: 'workspace-invite' });
|
|
310
|
-
const accepted = core.acceptInviteWithToken({
|
|
311
|
-
token: String(invite.token),
|
|
312
|
-
password: 'LanternHarborOrbit!2026'
|
|
313
|
-
});
|
|
314
|
-
expect(accepted.workspaceId).toBe('workspace-invite');
|
|
315
|
-
expect(core.hasAccountEntitlement('invited-user')).toBe(true);
|
|
316
|
-
expect(core.getAccountEntitlement('invited-user')).toEqual(expect.objectContaining({
|
|
317
|
-
planVersionId: 'free-v1',
|
|
318
|
-
state: 'active'
|
|
319
|
-
}));
|
|
320
|
-
expect(core.getAccountAccessStatus('invited-user')).toEqual(expect.objectContaining({
|
|
321
|
-
gate: 'ok',
|
|
322
|
-
canAccessApp: true
|
|
323
|
-
}));
|
|
324
|
-
}
|
|
325
|
-
finally {
|
|
326
|
-
core.close();
|
|
327
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
it('reactivates blocked placeholder entitlements when a new invited user accepts a reused seat', () => {
|
|
331
|
-
const projectRoot = makeProjectRoot();
|
|
332
|
-
const core = openCore(projectRoot);
|
|
333
|
-
try {
|
|
334
|
-
core.createWorkspace({ workspaceId: 'workspace-invite', name: 'Invite Workspace' });
|
|
335
|
-
core.ensureBootstrapUserAccess({
|
|
336
|
-
userId: 'owner-user',
|
|
337
|
-
workspaceId: 'workspace-invite',
|
|
338
|
-
role: 'owner',
|
|
339
|
-
email: 'owner@example.com'
|
|
340
|
-
});
|
|
341
|
-
core.setUserAccountPlanMode('owner-user', 'team');
|
|
342
|
-
core.ensureBootstrapUserAccess({
|
|
343
|
-
userId: 'invited-user',
|
|
344
|
-
workspaceId: 'workspace-invite',
|
|
345
|
-
role: 'member',
|
|
346
|
-
email: 'invited@example.com'
|
|
347
|
-
});
|
|
348
|
-
core.setWorkspaceUserDisabled('invited-user', 'workspace-invite', true);
|
|
349
|
-
const db = core.db;
|
|
350
|
-
db.prepare(`
|
|
351
|
-
UPDATE workspace_memberships
|
|
352
|
-
SET status = 'invited'
|
|
353
|
-
WHERE tenant_id = ? AND user_id = ? AND workspace_id = ?
|
|
354
|
-
`).run('default', 'invited-user', 'workspace-invite');
|
|
355
|
-
core.updateAccountEntitlement({
|
|
356
|
-
accountId: 'invited-user',
|
|
357
|
-
planVersionId: 'free-v1',
|
|
358
|
-
entitlementState: 'canceled',
|
|
359
|
-
actorUserId: 'system-admin',
|
|
360
|
-
actorRole: 'system_admin',
|
|
361
|
-
reason: 'invite-reaccept-regression'
|
|
362
|
-
});
|
|
363
|
-
const invite = core.requestInviteAcceptance({ userId: 'invited-user', workspaceId: 'workspace-invite' });
|
|
364
|
-
const accepted = core.acceptInviteWithToken({
|
|
365
|
-
token: String(invite.token),
|
|
366
|
-
password: 'LanternHarborOrbit!2026'
|
|
367
|
-
});
|
|
368
|
-
expect(accepted.workspaceId).toBe('workspace-invite');
|
|
369
|
-
expect(core.getAccountEntitlement('invited-user')).toEqual(expect.objectContaining({
|
|
370
|
-
planVersionId: 'free-v1',
|
|
371
|
-
state: 'active'
|
|
372
|
-
}));
|
|
373
|
-
expect(core.getAccountAccessStatus('invited-user')).toEqual(expect.objectContaining({
|
|
374
|
-
gate: 'ok',
|
|
375
|
-
canAccessApp: true
|
|
376
|
-
}));
|
|
377
|
-
}
|
|
378
|
-
finally {
|
|
379
|
-
core.close();
|
|
380
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
381
|
-
}
|
|
382
|
-
});
|
|
383
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,65 +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 createdRoots = [];
|
|
7
|
-
const originalHome = process.env.HOME;
|
|
8
|
-
function createProjectRoot(prefix = 'taskforce-workspace-sync-settings-') {
|
|
9
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
|
|
10
|
-
process.env.HOME = root;
|
|
11
|
-
createdRoots.push(root);
|
|
12
|
-
return root;
|
|
13
|
-
}
|
|
14
|
-
afterEach(() => {
|
|
15
|
-
process.env.HOME = originalHome;
|
|
16
|
-
while (createdRoots.length > 0) {
|
|
17
|
-
const root = createdRoots.pop();
|
|
18
|
-
if (root && fs.existsSync(root)) {
|
|
19
|
-
fs.rmSync(root, { recursive: true, force: true });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
describe('TaskforceCore workspace shareable sync settings', () => {
|
|
24
|
-
it('returns an empty snapshot when no workspace-shareable settings are allowlisted', () => {
|
|
25
|
-
const projectRoot = createProjectRoot();
|
|
26
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
27
|
-
expect(core.getWorkspaceShareableSyncSettings('workspace-1')).toEqual({
|
|
28
|
-
settings: {},
|
|
29
|
-
updatedAt: null
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
it('drops disallowed workspace_settings rows from the sync snapshot', () => {
|
|
33
|
-
const projectRoot = createProjectRoot();
|
|
34
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
35
|
-
const db = core.getDatabaseAdapter();
|
|
36
|
-
const now = new Date().toISOString();
|
|
37
|
-
db.prepare(`
|
|
38
|
-
INSERT INTO workspace_settings (tenant_id, workspace_id, settings_key, payload, updated_at)
|
|
39
|
-
VALUES (?, ?, ?, ?, ?)
|
|
40
|
-
`).run('default', 'workspace-1', 'dangerous-admin-setting', JSON.stringify({ enabled: true }), now);
|
|
41
|
-
expect(core.getWorkspaceShareableSyncSettings('workspace-1')).toEqual({
|
|
42
|
-
settings: {},
|
|
43
|
-
updatedAt: null
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
it('ignores attempted writes for disallowed workspace-shareable sync settings', () => {
|
|
47
|
-
const projectRoot = createProjectRoot();
|
|
48
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
49
|
-
const result = core.upsertWorkspaceShareableSyncSettings('workspace-1', {
|
|
50
|
-
dangerousAdminSetting: { enabled: true }
|
|
51
|
-
}, '2026-03-17T12:00:00.000Z');
|
|
52
|
-
expect(result).toEqual({
|
|
53
|
-
settings: {},
|
|
54
|
-
updatedAt: null,
|
|
55
|
-
applied: false
|
|
56
|
-
});
|
|
57
|
-
const db = core.getDatabaseAdapter();
|
|
58
|
-
const rows = db.prepare(`
|
|
59
|
-
SELECT settings_key
|
|
60
|
-
FROM workspace_settings
|
|
61
|
-
WHERE tenant_id = ? AND workspace_id = ?
|
|
62
|
-
`).all('default', 'workspace-1');
|
|
63
|
-
expect(rows).toEqual([]);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,212 +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 createdRoots = [];
|
|
7
|
-
const originalHome = process.env.HOME;
|
|
8
|
-
function createProjectRoot(prefix = 'taskforce-canonical-attachments-') {
|
|
9
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
|
|
10
|
-
process.env.HOME = root;
|
|
11
|
-
createdRoots.push(root);
|
|
12
|
-
return root;
|
|
13
|
-
}
|
|
14
|
-
afterEach(() => {
|
|
15
|
-
process.env.HOME = originalHome;
|
|
16
|
-
while (createdRoots.length > 0) {
|
|
17
|
-
const root = createdRoots.pop();
|
|
18
|
-
if (root && fs.existsSync(root)) {
|
|
19
|
-
fs.rmSync(root, { recursive: true, force: true });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
describe('TaskforceCore canonical task attachments', () => {
|
|
24
|
-
it('renders canonical asset links as task attachments', () => {
|
|
25
|
-
const projectRoot = createProjectRoot();
|
|
26
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
27
|
-
const created = core.createTask({
|
|
28
|
-
title: 'Attachment task'
|
|
29
|
-
}, { workspaceId: 'default' });
|
|
30
|
-
const db = core.getDatabaseAdapter();
|
|
31
|
-
const now = new Date().toISOString();
|
|
32
|
-
const storageKey = 'workspaces/default/assets/documents/asset-doc-1-implementation-plan.md';
|
|
33
|
-
db.prepare(`
|
|
34
|
-
INSERT INTO workspace_assets (
|
|
35
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename, mime_type,
|
|
36
|
-
storage_provider, storage_key, content_sha256, size_bytes, document_id, version,
|
|
37
|
-
is_latest, scan_status, created_at, updated_at
|
|
38
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
39
|
-
`).run('asset-doc-1', 'default', 'default', 'document', 'Implementation Plan', 'implementation-plan.md', 'text/markdown', 'r2', storageKey, 'sha-doc-1', 120, 'doc-1', 1, 1, 'clean', now, now);
|
|
40
|
-
db.prepare(`
|
|
41
|
-
INSERT INTO workspace_asset_links (
|
|
42
|
-
tenant_id, workspace_id, asset_id, task_id, role, created_at, updated_at
|
|
43
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
44
|
-
`).run('default', 'default', 'asset-doc-1', created.id, 'attachment', now, now);
|
|
45
|
-
const tasks = core.listTasks('default').tasks;
|
|
46
|
-
const task = tasks.find((entry) => entry.id === created.id);
|
|
47
|
-
expect(task?.attachments).toEqual([
|
|
48
|
-
expect.objectContaining({
|
|
49
|
-
path: `/api/taskforce/context/${encodeURIComponent(storageKey)}`,
|
|
50
|
-
fsPath: storageKey,
|
|
51
|
-
caption: 'Implementation Plan'
|
|
52
|
-
})
|
|
53
|
-
]);
|
|
54
|
-
});
|
|
55
|
-
it('writes canonical task attachment links when attachments are updated from payload data', () => {
|
|
56
|
-
const projectRoot = createProjectRoot();
|
|
57
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
58
|
-
const created = core.createTask({
|
|
59
|
-
title: 'Attachment write task'
|
|
60
|
-
}, { workspaceId: 'default' });
|
|
61
|
-
const db = core.getDatabaseAdapter();
|
|
62
|
-
const now = new Date().toISOString();
|
|
63
|
-
const storageKey = 'workspaces/default/assets/files/asset-file-1-brief.pdf';
|
|
64
|
-
db.prepare(`
|
|
65
|
-
INSERT INTO workspace_assets (
|
|
66
|
-
asset_id, tenant_id, workspace_id, kind, original_filename, mime_type,
|
|
67
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest,
|
|
68
|
-
scan_status, created_at, updated_at
|
|
69
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
70
|
-
`).run('asset-file-1', 'default', 'default', 'file', 'brief.pdf', 'application/pdf', 'r2', storageKey, 'sha-file-1', 88, 1, 'clean', now, now);
|
|
71
|
-
core.updateTask(created.id, {
|
|
72
|
-
attachments: [{
|
|
73
|
-
path: `/api/taskforce/context/${encodeURIComponent(storageKey)}`,
|
|
74
|
-
fsPath: storageKey,
|
|
75
|
-
caption: 'Brief',
|
|
76
|
-
timestamp: now
|
|
77
|
-
}]
|
|
78
|
-
}, 'default');
|
|
79
|
-
const rows = db.prepare(`
|
|
80
|
-
SELECT asset_id, task_id, role, deleted_at
|
|
81
|
-
FROM workspace_asset_links
|
|
82
|
-
WHERE tenant_id = ? AND workspace_id = ? AND task_id = ?
|
|
83
|
-
`).all('default', 'default', created.id);
|
|
84
|
-
expect(rows).toEqual([
|
|
85
|
-
expect.objectContaining({
|
|
86
|
-
asset_id: 'asset-file-1',
|
|
87
|
-
task_id: created.id,
|
|
88
|
-
role: 'attachment',
|
|
89
|
-
deleted_at: null
|
|
90
|
-
})
|
|
91
|
-
]);
|
|
92
|
-
});
|
|
93
|
-
it('renders canonical image attachments through the unified context route', () => {
|
|
94
|
-
const projectRoot = createProjectRoot();
|
|
95
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
96
|
-
const created = core.createTask({
|
|
97
|
-
title: 'Image attachment task'
|
|
98
|
-
}, { workspaceId: 'default' });
|
|
99
|
-
const db = core.getDatabaseAdapter();
|
|
100
|
-
const now = new Date().toISOString();
|
|
101
|
-
const storageKey = 'workspaces/default/assets/images/asset-image-1-proof.png';
|
|
102
|
-
db.prepare(`
|
|
103
|
-
INSERT INTO workspace_assets (
|
|
104
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename, mime_type,
|
|
105
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest, scan_status, created_at, updated_at
|
|
106
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
107
|
-
`).run('asset-image-1', 'default', 'default', 'image', 'Proof', 'proof.png', 'image/png', 'local', storageKey, 'sha-image-1', 42, 1, 'clean', now, now);
|
|
108
|
-
db.prepare(`
|
|
109
|
-
INSERT INTO workspace_asset_links (
|
|
110
|
-
tenant_id, workspace_id, asset_id, task_id, role, created_at, updated_at
|
|
111
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
112
|
-
`).run('default', 'default', 'asset-image-1', created.id, 'image', now, now);
|
|
113
|
-
const imagePath = path.join(projectRoot, '.taskforce', storageKey);
|
|
114
|
-
fs.mkdirSync(path.dirname(imagePath), { recursive: true });
|
|
115
|
-
fs.writeFileSync(imagePath, 'png');
|
|
116
|
-
const task = core.getTask(created.id, 'default');
|
|
117
|
-
expect(task?.attachments).toEqual([
|
|
118
|
-
expect.objectContaining({
|
|
119
|
-
path: `/api/taskforce/context/${encodeURIComponent(storageKey)}`,
|
|
120
|
-
fsPath: storageKey,
|
|
121
|
-
caption: 'Proof'
|
|
122
|
-
})
|
|
123
|
-
]);
|
|
124
|
-
});
|
|
125
|
-
it('does not render broken local canonical attachments when the file is missing', () => {
|
|
126
|
-
const projectRoot = createProjectRoot();
|
|
127
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
128
|
-
const created = core.createTask({
|
|
129
|
-
title: 'Broken attachment task'
|
|
130
|
-
}, { workspaceId: 'default' });
|
|
131
|
-
const db = core.getDatabaseAdapter();
|
|
132
|
-
const now = new Date().toISOString();
|
|
133
|
-
const storageKey = 'workspaces/default/assets/images/asset-image-2-broken.png';
|
|
134
|
-
db.prepare(`
|
|
135
|
-
INSERT INTO workspace_assets (
|
|
136
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename, mime_type,
|
|
137
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest, scan_status, created_at, updated_at
|
|
138
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
139
|
-
`).run('asset-image-2', 'default', 'default', 'image', 'Broken Proof', 'broken.png', 'image/png', 'local', storageKey, 'sha-image-2', 42, 1, 'clean', now, now);
|
|
140
|
-
db.prepare(`
|
|
141
|
-
INSERT INTO workspace_asset_links (
|
|
142
|
-
tenant_id, workspace_id, asset_id, task_id, role, created_at, updated_at
|
|
143
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
144
|
-
`).run('default', 'default', 'asset-image-2', created.id, 'image', now, now);
|
|
145
|
-
const task = core.getTask(created.id, 'default');
|
|
146
|
-
expect(task?.attachments).toEqual([]);
|
|
147
|
-
});
|
|
148
|
-
it('persists linked local files with a stable display name and context-link path', () => {
|
|
149
|
-
const projectRoot = createProjectRoot();
|
|
150
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
151
|
-
const created = core.createTask({
|
|
152
|
-
title: 'Linked file task'
|
|
153
|
-
}, { workspaceId: 'default' });
|
|
154
|
-
const linkedPath = 'docs/architecture/decision-record.md';
|
|
155
|
-
const now = new Date().toISOString();
|
|
156
|
-
core.updateTask(created.id, {
|
|
157
|
-
attachments: [{
|
|
158
|
-
path: `/api/taskforce/context-link?path=${encodeURIComponent(linkedPath)}`,
|
|
159
|
-
fsPath: linkedPath,
|
|
160
|
-
caption: 'Architecture Decision Record',
|
|
161
|
-
timestamp: now
|
|
162
|
-
}]
|
|
163
|
-
}, 'default');
|
|
164
|
-
const db = core.getDatabaseAdapter();
|
|
165
|
-
const assetRow = db.prepare(`
|
|
166
|
-
SELECT asset_id, storage_provider, storage_key, logical_name, original_filename
|
|
167
|
-
FROM workspace_assets
|
|
168
|
-
WHERE tenant_id = ? AND workspace_id = ? AND storage_key = ?
|
|
169
|
-
LIMIT 1
|
|
170
|
-
`).get('default', 'default', linkedPath);
|
|
171
|
-
expect(assetRow).toEqual(expect.objectContaining({
|
|
172
|
-
storage_provider: 'external',
|
|
173
|
-
storage_key: linkedPath,
|
|
174
|
-
logical_name: 'Architecture Decision Record',
|
|
175
|
-
original_filename: 'Architecture Decision Record'
|
|
176
|
-
}));
|
|
177
|
-
const linkRow = db.prepare(`
|
|
178
|
-
SELECT display_name, role, deleted_at
|
|
179
|
-
FROM workspace_asset_links
|
|
180
|
-
WHERE tenant_id = ? AND workspace_id = ? AND task_id = ?
|
|
181
|
-
LIMIT 1
|
|
182
|
-
`).get('default', 'default', created.id);
|
|
183
|
-
expect(linkRow).toEqual(expect.objectContaining({
|
|
184
|
-
display_name: 'Architecture Decision Record',
|
|
185
|
-
role: 'attachment',
|
|
186
|
-
deleted_at: null
|
|
187
|
-
}));
|
|
188
|
-
const task = core.getTask(created.id, 'default');
|
|
189
|
-
expect(task?.attachments).toEqual([
|
|
190
|
-
expect.objectContaining({
|
|
191
|
-
path: `/api/taskforce/context-link?path=${encodeURIComponent(linkedPath)}`,
|
|
192
|
-
fsPath: linkedPath,
|
|
193
|
-
caption: 'Architecture Decision Record',
|
|
194
|
-
displayName: 'Architecture Decision Record',
|
|
195
|
-
originalFilename: 'Architecture Decision Record'
|
|
196
|
-
})
|
|
197
|
-
]);
|
|
198
|
-
});
|
|
199
|
-
it('does not read legacy task-folder attachments when canonical metadata is absent', () => {
|
|
200
|
-
const projectRoot = createProjectRoot();
|
|
201
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
202
|
-
const created = core.createTask({
|
|
203
|
-
title: 'Filesystem attachment fallback'
|
|
204
|
-
}, { workspaceId: 'default' });
|
|
205
|
-
const taskDir = path.join(projectRoot, '.taskforce', 'task-data', created.id, 'attachments');
|
|
206
|
-
fs.mkdirSync(taskDir, { recursive: true });
|
|
207
|
-
const filePath = path.join(taskDir, 'notes.txt');
|
|
208
|
-
fs.writeFileSync(filePath, 'hello');
|
|
209
|
-
const task = core.getTask(created.id, 'default');
|
|
210
|
-
expect(task?.attachments).toEqual([]);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|