@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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import os from 'os';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { TaskforceCore } from './Taskforce';
|
|
6
|
-
function makeCore() {
|
|
7
|
-
const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-activity-sync-'));
|
|
8
|
-
const core = new TaskforceCore({
|
|
9
|
-
projectRoot,
|
|
10
|
-
storagePath: path.join(projectRoot, '.taskforce')
|
|
11
|
-
});
|
|
12
|
-
return {
|
|
13
|
-
core,
|
|
14
|
-
cleanup: () => {
|
|
15
|
-
core.close();
|
|
16
|
-
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
describe('TaskforceCore sync activity reads', () => {
|
|
21
|
-
it('lists workspace entity events for sync without hydrating actor profiles', () => {
|
|
22
|
-
const { core, cleanup } = makeCore();
|
|
23
|
-
try {
|
|
24
|
-
const task = core.createTask({ title: 'Sync task event seed', createdBy: 'user-1' }, {
|
|
25
|
-
workspaceId: 'workspace-a',
|
|
26
|
-
actorRef: 'user-1'
|
|
27
|
-
});
|
|
28
|
-
const initiative = core.createInitiative({ title: 'Initiative seed' }, 'workspace-a', {
|
|
29
|
-
actorRef: 'user-1'
|
|
30
|
-
});
|
|
31
|
-
core.recordTaskEvent({
|
|
32
|
-
taskId: task.id,
|
|
33
|
-
workspaceId: 'workspace-a',
|
|
34
|
-
action: 'task-updated',
|
|
35
|
-
actor: 'user-1',
|
|
36
|
-
createdAt: '2026-04-28T10:00:00.000Z',
|
|
37
|
-
details: { changes: { assignee: { from: 'user-1', to: 'ai-1' } } }
|
|
38
|
-
});
|
|
39
|
-
core.updateInitiative(initiative.id, { description: 'Updated initiative body' }, 'workspace-a', {
|
|
40
|
-
actorRef: 'user-1'
|
|
41
|
-
});
|
|
42
|
-
vi.spyOn(core, 'resolveWorkspaceActor').mockImplementation(() => {
|
|
43
|
-
throw new Error('sync snapshot should not hydrate actor profiles');
|
|
44
|
-
});
|
|
45
|
-
const events = core.listEntityEventsForSync({ workspaceId: 'workspace-a' });
|
|
46
|
-
expect(events.map((event) => event.action)).toEqual(expect.arrayContaining([
|
|
47
|
-
'task-created',
|
|
48
|
-
'task-updated',
|
|
49
|
-
'initiative-created',
|
|
50
|
-
'initiative-updated',
|
|
51
|
-
]));
|
|
52
|
-
expect(events.every((event) => event.actorProfile === null)).toBe(true);
|
|
53
|
-
}
|
|
54
|
-
finally {
|
|
55
|
-
cleanup();
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
it('looks up one entity event for sync without hydrating actor profiles', () => {
|
|
59
|
-
const { core, cleanup } = makeCore();
|
|
60
|
-
try {
|
|
61
|
-
const workstream = core.createWorkstream({ title: 'Single sync event seed' }, 'workspace-a', {
|
|
62
|
-
actorRef: 'user-1'
|
|
63
|
-
});
|
|
64
|
-
core.updateWorkstream(workstream.id, {
|
|
65
|
-
description: 'Workstream moved forward'
|
|
66
|
-
}, 'workspace-a', {
|
|
67
|
-
actorRef: 'user-1'
|
|
68
|
-
});
|
|
69
|
-
const target = core.getWorkstream(workstream.id, 'workspace-a')?.entityEvents?.find((event) => event.action === 'workstream-updated');
|
|
70
|
-
expect(target).toBeTruthy();
|
|
71
|
-
vi.spyOn(core, 'resolveWorkspaceActor').mockImplementation(() => {
|
|
72
|
-
throw new Error('single sync lookup should not hydrate actor profiles');
|
|
73
|
-
});
|
|
74
|
-
const syncEvent = core.getEntityEventForSync({
|
|
75
|
-
workspaceId: 'workspace-a',
|
|
76
|
-
eventId: target.id,
|
|
77
|
-
});
|
|
78
|
-
expect(syncEvent).toEqual(expect.objectContaining({
|
|
79
|
-
id: target.id,
|
|
80
|
-
entityType: 'workstream',
|
|
81
|
-
entityId: workstream.id,
|
|
82
|
-
action: 'workstream-updated',
|
|
83
|
-
actorProfile: null,
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
|
-
finally {
|
|
87
|
-
cleanup();
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,356 +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/documents/asset-doc-1/content',
|
|
50
|
-
fsPath: storageKey,
|
|
51
|
-
caption: 'Implementation Plan',
|
|
52
|
-
assetId: 'asset-doc-1'
|
|
53
|
-
})
|
|
54
|
-
]);
|
|
55
|
-
});
|
|
56
|
-
it('writes canonical task attachment links when attachments are updated from payload data', () => {
|
|
57
|
-
const projectRoot = createProjectRoot();
|
|
58
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
59
|
-
const created = core.createTask({
|
|
60
|
-
title: 'Attachment write task'
|
|
61
|
-
}, { workspaceId: 'default' });
|
|
62
|
-
const db = core.getDatabaseAdapter();
|
|
63
|
-
const now = new Date().toISOString();
|
|
64
|
-
const storageKey = 'workspaces/default/assets/files/asset-file-1-brief.pdf';
|
|
65
|
-
db.prepare(`
|
|
66
|
-
INSERT INTO workspace_assets (
|
|
67
|
-
asset_id, tenant_id, workspace_id, kind, original_filename, mime_type,
|
|
68
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest,
|
|
69
|
-
scan_status, created_at, updated_at
|
|
70
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
71
|
-
`).run('asset-file-1', 'default', 'default', 'file', 'brief.pdf', 'application/pdf', 'r2', storageKey, 'sha-file-1', 88, 1, 'clean', now, now);
|
|
72
|
-
core.updateTask(created.id, {
|
|
73
|
-
attachments: [{
|
|
74
|
-
path: `/api/taskforce/context/${encodeURIComponent(storageKey)}`,
|
|
75
|
-
fsPath: storageKey,
|
|
76
|
-
caption: 'Brief',
|
|
77
|
-
timestamp: now
|
|
78
|
-
}]
|
|
79
|
-
}, 'default');
|
|
80
|
-
const rows = db.prepare(`
|
|
81
|
-
SELECT asset_id, task_id, role, deleted_at
|
|
82
|
-
FROM workspace_asset_links
|
|
83
|
-
WHERE tenant_id = ? AND workspace_id = ? AND task_id = ?
|
|
84
|
-
`).all('default', 'default', created.id);
|
|
85
|
-
expect(rows).toEqual([
|
|
86
|
-
expect.objectContaining({
|
|
87
|
-
asset_id: 'asset-file-1',
|
|
88
|
-
task_id: created.id,
|
|
89
|
-
role: 'attachment',
|
|
90
|
-
deleted_at: null
|
|
91
|
-
})
|
|
92
|
-
]);
|
|
93
|
-
});
|
|
94
|
-
it('starts cleanly with legacy workspace asset links that predate target_type', () => {
|
|
95
|
-
const projectRoot = createProjectRoot();
|
|
96
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
97
|
-
const created = core.createTask({
|
|
98
|
-
title: 'Legacy attachment startup task'
|
|
99
|
-
}, { workspaceId: 'default' });
|
|
100
|
-
const db = core.getDatabaseAdapter();
|
|
101
|
-
const now = new Date().toISOString();
|
|
102
|
-
const storageKey = 'workspaces/default/assets/documents/asset-legacy-doc-1-spec.md';
|
|
103
|
-
db.exec(`
|
|
104
|
-
DROP TABLE IF EXISTS workspace_asset_links;
|
|
105
|
-
CREATE TABLE workspace_asset_links (
|
|
106
|
-
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
107
|
-
workspace_id TEXT NOT NULL,
|
|
108
|
-
asset_id TEXT NOT NULL,
|
|
109
|
-
task_id TEXT NOT NULL,
|
|
110
|
-
role TEXT NOT NULL,
|
|
111
|
-
display_name TEXT,
|
|
112
|
-
sort_order INTEGER,
|
|
113
|
-
created_at TEXT NOT NULL,
|
|
114
|
-
updated_at TEXT NOT NULL,
|
|
115
|
-
deleted_at TEXT,
|
|
116
|
-
PRIMARY KEY (tenant_id, workspace_id, asset_id, task_id, role)
|
|
117
|
-
);
|
|
118
|
-
`);
|
|
119
|
-
db.prepare(`
|
|
120
|
-
INSERT INTO workspace_assets (
|
|
121
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename, mime_type,
|
|
122
|
-
storage_provider, storage_key, content_sha256, size_bytes, document_id, reference_number, version,
|
|
123
|
-
is_latest, scan_status, created_at, updated_at
|
|
124
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
125
|
-
`).run('asset-legacy-doc-1', 'default', 'default', 'document', 'Legacy Spec', 'spec.md', 'text/markdown', 'r2', storageKey, 'sha-legacy-doc-1', 120, 'doc-legacy-1', 1, 1, 1, 'clean', now, now);
|
|
126
|
-
db.prepare(`
|
|
127
|
-
INSERT INTO workspace_asset_links (
|
|
128
|
-
tenant_id, workspace_id, asset_id, task_id, role, display_name, created_at, updated_at
|
|
129
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
130
|
-
`).run('default', 'default', 'asset-legacy-doc-1', created.id, 'attachment', 'Legacy Spec', now, now);
|
|
131
|
-
core.close();
|
|
132
|
-
const repairedCore = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
133
|
-
const tasks = repairedCore.listTasks('default').tasks;
|
|
134
|
-
const task = tasks.find((entry) => entry.id === created.id);
|
|
135
|
-
expect(task?.attachments).toEqual([
|
|
136
|
-
expect.objectContaining({
|
|
137
|
-
path: '/api/taskforce/documents/asset-legacy-doc-1/content',
|
|
138
|
-
fsPath: storageKey,
|
|
139
|
-
caption: 'Legacy Spec',
|
|
140
|
-
assetId: 'asset-legacy-doc-1'
|
|
141
|
-
})
|
|
142
|
-
]);
|
|
143
|
-
});
|
|
144
|
-
it('renders canonical image attachments through the unified context route', () => {
|
|
145
|
-
const projectRoot = createProjectRoot();
|
|
146
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
147
|
-
const created = core.createTask({
|
|
148
|
-
title: 'Image attachment task'
|
|
149
|
-
}, { workspaceId: 'default' });
|
|
150
|
-
const db = core.getDatabaseAdapter();
|
|
151
|
-
const now = new Date().toISOString();
|
|
152
|
-
const storageKey = 'workspaces/default/assets/images/asset-image-1-proof.png';
|
|
153
|
-
db.prepare(`
|
|
154
|
-
INSERT INTO workspace_assets (
|
|
155
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename, mime_type,
|
|
156
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest, scan_status, created_at, updated_at
|
|
157
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
158
|
-
`).run('asset-image-1', 'default', 'default', 'image', 'Proof', 'proof.png', 'image/png', 'local', storageKey, 'sha-image-1', 42, 1, 'clean', now, now);
|
|
159
|
-
db.prepare(`
|
|
160
|
-
INSERT INTO workspace_asset_links (
|
|
161
|
-
tenant_id, workspace_id, asset_id, task_id, role, created_at, updated_at
|
|
162
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
163
|
-
`).run('default', 'default', 'asset-image-1', created.id, 'image', now, now);
|
|
164
|
-
const assetPath = path.join(projectRoot, '.taskforce', storageKey);
|
|
165
|
-
fs.mkdirSync(path.dirname(assetPath), { recursive: true });
|
|
166
|
-
fs.writeFileSync(assetPath, 'png');
|
|
167
|
-
const task = core.getTask(created.id, 'default');
|
|
168
|
-
expect(task?.attachments).toEqual([
|
|
169
|
-
expect.objectContaining({
|
|
170
|
-
path: `/api/taskforce/context/${encodeURIComponent(storageKey)}`,
|
|
171
|
-
fsPath: storageKey,
|
|
172
|
-
caption: 'Proof',
|
|
173
|
-
referenceNumber: 1,
|
|
174
|
-
referenceLabel: 'I-1',
|
|
175
|
-
})
|
|
176
|
-
]);
|
|
177
|
-
});
|
|
178
|
-
it('retires image notes sessions when an image attachment is removed from a task', () => {
|
|
179
|
-
const projectRoot = createProjectRoot();
|
|
180
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
181
|
-
const created = core.createTask({
|
|
182
|
-
title: 'Detached image cleanup task'
|
|
183
|
-
}, { workspaceId: 'default', actorRef: 'user' });
|
|
184
|
-
const db = core.getDatabaseAdapter();
|
|
185
|
-
const now = new Date().toISOString();
|
|
186
|
-
const imageStorageKey = 'workspaces/default/assets/images/asset-image-detach-proof.png';
|
|
187
|
-
const fileStorageKey = 'workspaces/default/assets/files/asset-file-keep-brief.pdf';
|
|
188
|
-
db.prepare(`
|
|
189
|
-
INSERT INTO workspace_assets (
|
|
190
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename, mime_type,
|
|
191
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest, scan_status, created_at, updated_at
|
|
192
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
193
|
-
`).run('asset-image-detach', 'default', 'default', 'image', 'Proof', 'proof.png', 'image/png', 'local', imageStorageKey, 'sha-image-detach', 42, 1, 'clean', now, now);
|
|
194
|
-
db.prepare(`
|
|
195
|
-
INSERT INTO workspace_assets (
|
|
196
|
-
asset_id, tenant_id, workspace_id, kind, original_filename, mime_type,
|
|
197
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest, scan_status, created_at, updated_at
|
|
198
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
199
|
-
`).run('asset-file-keep', 'default', 'default', 'file', 'brief.pdf', 'application/pdf', 'local', fileStorageKey, 'sha-file-keep', 88, 1, 'clean', now, now);
|
|
200
|
-
db.prepare(`
|
|
201
|
-
INSERT INTO workspace_asset_links (
|
|
202
|
-
tenant_id, workspace_id, asset_id, task_id, role, created_at, updated_at
|
|
203
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
204
|
-
`).run('default', 'default', 'asset-image-detach', created.id, 'image', now, now);
|
|
205
|
-
core.createAnnotatedAttachmentSession({
|
|
206
|
-
workspaceId: 'default',
|
|
207
|
-
taskId: created.id,
|
|
208
|
-
baseImageAssetId: 'asset-image-detach',
|
|
209
|
-
title: 'Session to retire',
|
|
210
|
-
annotations: [
|
|
211
|
-
{ id: 'annotation-1', kind: 'pin', order: 0, instruction: 'Look here', x: 0.3, y: 0.4 },
|
|
212
|
-
],
|
|
213
|
-
actorId: 'user',
|
|
214
|
-
});
|
|
215
|
-
core.updateTask(created.id, {
|
|
216
|
-
attachments: [{
|
|
217
|
-
path: `/api/taskforce/context/${encodeURIComponent(fileStorageKey)}`,
|
|
218
|
-
fsPath: fileStorageKey,
|
|
219
|
-
caption: 'Brief',
|
|
220
|
-
timestamp: now
|
|
221
|
-
}]
|
|
222
|
-
}, 'default', { actorRef: 'user' });
|
|
223
|
-
const activeSessions = core.listAnnotatedAttachmentSessions({
|
|
224
|
-
workspaceId: 'default',
|
|
225
|
-
taskId: created.id,
|
|
226
|
-
imageAssetId: 'asset-image-detach',
|
|
227
|
-
});
|
|
228
|
-
const allSessions = core.listAnnotatedAttachmentSessions({
|
|
229
|
-
workspaceId: 'default',
|
|
230
|
-
taskId: created.id,
|
|
231
|
-
imageAssetId: 'asset-image-detach',
|
|
232
|
-
includeDeleted: true,
|
|
233
|
-
});
|
|
234
|
-
const activeLinks = db.prepare(`
|
|
235
|
-
SELECT asset_id, deleted_at
|
|
236
|
-
FROM workspace_asset_links
|
|
237
|
-
WHERE tenant_id = ? AND workspace_id = ? AND task_id = ? AND asset_id = ?
|
|
238
|
-
`).all('default', 'default', created.id, 'asset-image-detach');
|
|
239
|
-
expect(activeSessions).toEqual([]);
|
|
240
|
-
expect(allSessions).toHaveLength(1);
|
|
241
|
-
expect(allSessions[0]?.deletedAt).toBeTruthy();
|
|
242
|
-
expect(activeLinks).toEqual([
|
|
243
|
-
expect.objectContaining({
|
|
244
|
-
asset_id: 'asset-image-detach',
|
|
245
|
-
deleted_at: expect.any(String),
|
|
246
|
-
})
|
|
247
|
-
]);
|
|
248
|
-
});
|
|
249
|
-
it('repairs pre-existing detached image-note sessions on startup without touching unattached sessions', () => {
|
|
250
|
-
const projectRoot = createProjectRoot();
|
|
251
|
-
const seedCore = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
252
|
-
const created = seedCore.createTask({
|
|
253
|
-
title: 'Detached image repair task'
|
|
254
|
-
}, { workspaceId: 'default', actorRef: 'user' });
|
|
255
|
-
const db = seedCore.getDatabaseAdapter();
|
|
256
|
-
const now = new Date().toISOString();
|
|
257
|
-
const imageStorageKey = 'workspaces/default/assets/images/asset-image-repair-proof.png';
|
|
258
|
-
db.prepare(`
|
|
259
|
-
INSERT INTO workspace_assets (
|
|
260
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename, mime_type,
|
|
261
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest, scan_status, created_at, updated_at
|
|
262
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
263
|
-
`).run('asset-image-repair', 'default', 'default', 'image', 'Repair Proof', 'repair-proof.png', 'image/png', 'local', imageStorageKey, 'sha-image-repair', 42, 1, 'clean', now, now);
|
|
264
|
-
db.prepare(`
|
|
265
|
-
INSERT INTO workspace_asset_links (
|
|
266
|
-
tenant_id, workspace_id, asset_id, task_id, role, created_at, updated_at
|
|
267
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
268
|
-
`).run('default', 'default', 'asset-image-repair', created.id, 'image', now, now);
|
|
269
|
-
seedCore.createAnnotatedAttachmentSession({
|
|
270
|
-
workspaceId: 'default',
|
|
271
|
-
taskId: created.id,
|
|
272
|
-
baseImageAssetId: 'asset-image-repair',
|
|
273
|
-
title: 'Legacy detached session',
|
|
274
|
-
annotations: [
|
|
275
|
-
{ id: 'annotation-1', kind: 'pin', order: 0, instruction: 'Legacy note', x: 0.3, y: 0.4 },
|
|
276
|
-
],
|
|
277
|
-
actorId: 'user',
|
|
278
|
-
});
|
|
279
|
-
seedCore.createAnnotatedAttachmentSession({
|
|
280
|
-
workspaceId: 'default',
|
|
281
|
-
taskId: '',
|
|
282
|
-
baseImageAssetId: 'asset-image-repair',
|
|
283
|
-
title: 'Intentional unattached session',
|
|
284
|
-
annotations: [],
|
|
285
|
-
actorId: 'user',
|
|
286
|
-
});
|
|
287
|
-
db.prepare(`
|
|
288
|
-
UPDATE workspace_asset_links
|
|
289
|
-
SET deleted_at = ?, updated_at = ?
|
|
290
|
-
WHERE tenant_id = ? AND workspace_id = ? AND task_id = ? AND asset_id = ? AND role = 'image'
|
|
291
|
-
`).run(now, now, 'default', 'default', created.id, 'asset-image-repair');
|
|
292
|
-
seedCore.close();
|
|
293
|
-
const repairedCore = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
294
|
-
const detachedSessions = repairedCore.listAnnotatedAttachmentSessions({
|
|
295
|
-
workspaceId: 'default',
|
|
296
|
-
taskId: created.id,
|
|
297
|
-
imageAssetId: 'asset-image-repair',
|
|
298
|
-
includeDeleted: true,
|
|
299
|
-
}).filter((session) => session.taskId === created.id);
|
|
300
|
-
const unattachedSessions = repairedCore.listAnnotatedAttachmentSessions({
|
|
301
|
-
workspaceId: 'default',
|
|
302
|
-
imageAssetId: 'asset-image-repair',
|
|
303
|
-
includeDeleted: true,
|
|
304
|
-
}).filter((session) => session.taskId === '');
|
|
305
|
-
expect(detachedSessions).toHaveLength(1);
|
|
306
|
-
expect(detachedSessions[0]?.deletedAt).toEqual(expect.any(String));
|
|
307
|
-
expect(unattachedSessions).toEqual([
|
|
308
|
-
expect.objectContaining({
|
|
309
|
-
title: 'Intentional unattached session',
|
|
310
|
-
deletedAt: null,
|
|
311
|
-
})
|
|
312
|
-
]);
|
|
313
|
-
});
|
|
314
|
-
it('preserves attachment links when a synced task snapshot is applied', () => {
|
|
315
|
-
const projectRoot = createProjectRoot();
|
|
316
|
-
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
317
|
-
const workspaceId = 'default';
|
|
318
|
-
const db = core.getDatabaseAdapter();
|
|
319
|
-
const createdAt = '2026-03-21T13:51:30.000Z';
|
|
320
|
-
const updatedAt = '2026-03-21T13:51:42.794Z';
|
|
321
|
-
const storageKey = 'workspaces/default/assets/files/asset-sync-hello.txt';
|
|
322
|
-
db.prepare(`
|
|
323
|
-
INSERT INTO workspace_assets (
|
|
324
|
-
asset_id, tenant_id, workspace_id, kind, original_filename, mime_type,
|
|
325
|
-
storage_provider, storage_key, content_sha256, size_bytes, is_latest,
|
|
326
|
-
scan_status, created_at, updated_at
|
|
327
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
328
|
-
`).run('asset-sync-1', 'default', workspaceId, 'file', 'hello.txt', 'text/plain', 'local', storageKey, 'sha-sync-1', 5, 1, 'clean', createdAt, updatedAt);
|
|
329
|
-
const assetPath = path.join(projectRoot, '.taskforce', storageKey);
|
|
330
|
-
fs.mkdirSync(path.dirname(assetPath), { recursive: true });
|
|
331
|
-
fs.writeFileSync(assetPath, 'hello');
|
|
332
|
-
core.applyWorkspaceSyncSnapshot({
|
|
333
|
-
tasks: [{
|
|
334
|
-
id: 'task-sync-attachment-1',
|
|
335
|
-
title: 'Synced attachment task',
|
|
336
|
-
status: 'task',
|
|
337
|
-
createdAt,
|
|
338
|
-
updatedAt,
|
|
339
|
-
attachments: [{
|
|
340
|
-
path: `/api/taskforce/context/${encodeURIComponent(storageKey)}`,
|
|
341
|
-
fsPath: storageKey,
|
|
342
|
-
caption: 'hello.txt',
|
|
343
|
-
timestamp: updatedAt
|
|
344
|
-
}]
|
|
345
|
-
}]
|
|
346
|
-
}, workspaceId);
|
|
347
|
-
const task = core.getTask('task-sync-attachment-1', workspaceId);
|
|
348
|
-
expect(task?.attachments).toEqual([
|
|
349
|
-
expect.objectContaining({
|
|
350
|
-
path: `/api/taskforce/context/${encodeURIComponent(storageKey)}`,
|
|
351
|
-
fsPath: storageKey,
|
|
352
|
-
caption: 'hello.txt'
|
|
353
|
-
})
|
|
354
|
-
]);
|
|
355
|
-
});
|
|
356
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|