@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,160 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
|
|
5
|
-
const projectRoot = process.argv[2] ? path.resolve(process.argv[2]) : process.cwd();
|
|
6
|
-
const distServerPath = path.join(projectRoot, "dist/mcp/server.js");
|
|
7
|
-
const childUsesContentLength = (() => {
|
|
8
|
-
try {
|
|
9
|
-
const source = fs.readFileSync(distServerPath, "utf8");
|
|
10
|
-
return source.includes("ContentLengthStdioServerTransport");
|
|
11
|
-
} catch {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
})();
|
|
15
|
-
|
|
16
|
-
const child = spawn("node", ["dist/mcp/server.js", projectRoot], {
|
|
17
|
-
cwd: projectRoot,
|
|
18
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
child.stderr.on("data", (chunk) => {
|
|
22
|
-
process.stderr.write(chunk);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
child.on("exit", (code, signal) => {
|
|
26
|
-
if (signal) {
|
|
27
|
-
process.stderr.write(`[mcp-adapter] child exited via signal ${signal}\n`);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
process.exit(code ?? 0);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
child.on("error", (error) => {
|
|
35
|
-
process.stderr.write(`[mcp-adapter] child process error: ${error.message}\n`);
|
|
36
|
-
process.exit(1);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
let inboundBuffer = Buffer.alloc(0);
|
|
40
|
-
let clientFraming = null;
|
|
41
|
-
|
|
42
|
-
const writeContentLengthFrame = (stream, line) => {
|
|
43
|
-
const header = `Content-Length: ${Buffer.byteLength(line, "utf8")}\r\n\r\n`;
|
|
44
|
-
stream.write(header + line);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const forwardToChild = (json) => {
|
|
48
|
-
if (childUsesContentLength) {
|
|
49
|
-
writeContentLengthFrame(child.stdin, json);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
child.stdin.write(json + "\n");
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const tryParseInbound = () => {
|
|
56
|
-
while (inboundBuffer.length > 0) {
|
|
57
|
-
const contentLengthPrefix = "Content-Length:";
|
|
58
|
-
const head = inboundBuffer.toString("utf8", 0, Math.min(inboundBuffer.length, contentLengthPrefix.length));
|
|
59
|
-
const maybeContentLength = contentLengthPrefix.startsWith(head);
|
|
60
|
-
const startsWithContentLength = inboundBuffer.length >= contentLengthPrefix.length && inboundBuffer.toString("utf8", 0, contentLengthPrefix.length) === contentLengthPrefix;
|
|
61
|
-
|
|
62
|
-
if (maybeContentLength && !startsWithContentLength) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (startsWithContentLength) {
|
|
67
|
-
clientFraming = clientFraming ?? "content-length";
|
|
68
|
-
const headerEnd = inboundBuffer.indexOf("\r\n\r\n");
|
|
69
|
-
if (headerEnd === -1) return;
|
|
70
|
-
|
|
71
|
-
const headerText = inboundBuffer.toString("utf8", 0, headerEnd);
|
|
72
|
-
const match = headerText.match(/(?:^|\r\n)Content-Length:\s*(\d+)\s*(?:\r\n|$)/i);
|
|
73
|
-
if (!match) {
|
|
74
|
-
inboundBuffer = Buffer.alloc(0);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const bodyLength = Number(match[1]);
|
|
79
|
-
const bodyStart = headerEnd + 4;
|
|
80
|
-
const bodyEnd = bodyStart + bodyLength;
|
|
81
|
-
if (inboundBuffer.length < bodyEnd) return;
|
|
82
|
-
|
|
83
|
-
const body = inboundBuffer.toString("utf8", bodyStart, bodyEnd);
|
|
84
|
-
inboundBuffer = inboundBuffer.subarray(bodyEnd);
|
|
85
|
-
forwardToChild(body);
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const newlineIndex = inboundBuffer.indexOf("\n");
|
|
90
|
-
if (newlineIndex === -1) return;
|
|
91
|
-
|
|
92
|
-
const line = inboundBuffer.toString("utf8", 0, newlineIndex).replace(/\r$/, "").trim();
|
|
93
|
-
inboundBuffer = inboundBuffer.subarray(newlineIndex + 1);
|
|
94
|
-
if (line) {
|
|
95
|
-
clientFraming = clientFraming ?? "newline";
|
|
96
|
-
forwardToChild(line);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
process.stdin.on("data", (chunk) => {
|
|
102
|
-
inboundBuffer = inboundBuffer.length ? Buffer.concat([inboundBuffer, chunk]) : chunk;
|
|
103
|
-
tryParseInbound();
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
process.stdin.on("end", () => {
|
|
107
|
-
child.stdin.end();
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
let childOutBuffer = "";
|
|
111
|
-
let childOutBinaryBuffer = Buffer.alloc(0);
|
|
112
|
-
|
|
113
|
-
child.stdout.on("data", (chunk) => {
|
|
114
|
-
if (childUsesContentLength) {
|
|
115
|
-
childOutBinaryBuffer = childOutBinaryBuffer.length ? Buffer.concat([childOutBinaryBuffer, chunk]) : chunk;
|
|
116
|
-
|
|
117
|
-
while (true) {
|
|
118
|
-
const headerEnd = childOutBinaryBuffer.indexOf("\r\n\r\n");
|
|
119
|
-
if (headerEnd === -1) break;
|
|
120
|
-
|
|
121
|
-
const headerText = childOutBinaryBuffer.toString("utf8", 0, headerEnd);
|
|
122
|
-
const match = headerText.match(/(?:^|\r\n)Content-Length:\s*(\d+)\s*(?:\r\n|$)/i);
|
|
123
|
-
if (!match) {
|
|
124
|
-
childOutBinaryBuffer = Buffer.alloc(0);
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const bodyLength = Number(match[1]);
|
|
129
|
-
const bodyStart = headerEnd + 4;
|
|
130
|
-
const bodyEnd = bodyStart + bodyLength;
|
|
131
|
-
if (childOutBinaryBuffer.length < bodyEnd) break;
|
|
132
|
-
|
|
133
|
-
const body = childOutBinaryBuffer.toString("utf8", bodyStart, bodyEnd);
|
|
134
|
-
childOutBinaryBuffer = childOutBinaryBuffer.subarray(bodyEnd);
|
|
135
|
-
|
|
136
|
-
if (clientFraming === "newline") {
|
|
137
|
-
process.stdout.write(body + "\n");
|
|
138
|
-
} else {
|
|
139
|
-
writeContentLengthFrame(process.stdout, body);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
childOutBuffer += chunk.toString("utf8");
|
|
146
|
-
while (true) {
|
|
147
|
-
const newlineIndex = childOutBuffer.indexOf("\n");
|
|
148
|
-
if (newlineIndex === -1) break;
|
|
149
|
-
|
|
150
|
-
const line = childOutBuffer.slice(0, newlineIndex).replace(/\r$/, "").trim();
|
|
151
|
-
childOutBuffer = childOutBuffer.slice(newlineIndex + 1);
|
|
152
|
-
if (!line) continue;
|
|
153
|
-
|
|
154
|
-
if (clientFraming === "newline") {
|
|
155
|
-
process.stdout.write(line + "\n");
|
|
156
|
-
} else {
|
|
157
|
-
writeContentLengthFrame(process.stdout, line);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
});
|
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
-
import Database from 'better-sqlite3';
|
|
5
|
-
|
|
6
|
-
function inferMimeType(filename) {
|
|
7
|
-
const ext = path.extname(filename).toLowerCase();
|
|
8
|
-
const map = {
|
|
9
|
-
'.md': 'text/markdown',
|
|
10
|
-
'.markdown': 'text/markdown',
|
|
11
|
-
'.txt': 'text/plain',
|
|
12
|
-
'.json': 'application/json',
|
|
13
|
-
'.pdf': 'application/pdf',
|
|
14
|
-
'.png': 'image/png',
|
|
15
|
-
'.jpg': 'image/jpeg',
|
|
16
|
-
'.jpeg': 'image/jpeg',
|
|
17
|
-
'.webp': 'image/webp',
|
|
18
|
-
'.gif': 'image/gif',
|
|
19
|
-
'.svg': 'image/svg+xml',
|
|
20
|
-
'.csv': 'text/csv',
|
|
21
|
-
'.doc': 'application/msword',
|
|
22
|
-
'.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
23
|
-
};
|
|
24
|
-
return map[ext] || 'application/octet-stream';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function inferKind(filename, mimeType) {
|
|
28
|
-
if (String(mimeType || '').startsWith('image/')) return 'image';
|
|
29
|
-
const ext = path.extname(filename).toLowerCase();
|
|
30
|
-
if (ext === '.md' || ext === '.markdown') return 'document';
|
|
31
|
-
return 'file';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function sanitizeStorageSegment(value, fallback = 'default') {
|
|
35
|
-
const sanitized = String(value || '')
|
|
36
|
-
.trim()
|
|
37
|
-
.replace(/[^a-zA-Z0-9._-]/g, '-')
|
|
38
|
-
.replace(/-+/g, '-')
|
|
39
|
-
.replace(/^-+|-+$/g, '');
|
|
40
|
-
return sanitized || fallback;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function buildCanonicalRelativePath(workspaceId, kind, filename, assetId) {
|
|
44
|
-
const workspaceIdSafe = sanitizeStorageSegment(workspaceId, 'default');
|
|
45
|
-
const kindSegment = kind === 'document'
|
|
46
|
-
? 'documents'
|
|
47
|
-
: kind === 'image'
|
|
48
|
-
? 'images'
|
|
49
|
-
: 'files';
|
|
50
|
-
const filenameSafe = path.basename(filename).replace(/[^a-zA-Z0-9._-]/g, '-');
|
|
51
|
-
const ext = path.extname(filenameSafe).toLowerCase();
|
|
52
|
-
const stem = (ext ? filenameSafe.slice(0, -ext.length) : filenameSafe)
|
|
53
|
-
.replace(/[^a-zA-Z0-9._-]/g, '-')
|
|
54
|
-
.replace(/-+/g, '-')
|
|
55
|
-
.replace(/^-+|-+$/g, '')
|
|
56
|
-
.slice(0, 64) || 'file';
|
|
57
|
-
return `workspaces/${workspaceIdSafe}/assets/${kindSegment}/${assetId}-${stem}${ext}`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function sha256(buffer) {
|
|
61
|
-
return createHash('sha256').update(buffer).digest('hex');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function documentIdFor(storageKey) {
|
|
65
|
-
return `document-${createHash('sha1').update(storageKey).digest('hex').slice(0, 24)}`;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const projectRoot = process.cwd();
|
|
69
|
-
const basePath = path.join(projectRoot, '.taskforce');
|
|
70
|
-
const taskDataDir = path.join(basePath, 'task-data');
|
|
71
|
-
const dbPath = path.join(basePath, 'taskforce.db');
|
|
72
|
-
const registryPath = path.join(basePath, 'document-registry.json');
|
|
73
|
-
|
|
74
|
-
if (!fs.existsSync(dbPath)) {
|
|
75
|
-
throw new Error(`Taskforce DB not found at ${dbPath}`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const db = new Database(dbPath);
|
|
79
|
-
const tenantId = 'default';
|
|
80
|
-
|
|
81
|
-
const selectWorkspaceForTask = db.prepare(`SELECT workspace_id FROM tasks WHERE id = ? LIMIT 1`);
|
|
82
|
-
const selectAssetByStorageKey = db.prepare(`
|
|
83
|
-
SELECT *
|
|
84
|
-
FROM workspace_assets
|
|
85
|
-
WHERE tenant_id = ? AND workspace_id = ? AND storage_key = ?
|
|
86
|
-
LIMIT 1
|
|
87
|
-
`);
|
|
88
|
-
const selectTaskAsset = db.prepare(`
|
|
89
|
-
SELECT *
|
|
90
|
-
FROM task_assets
|
|
91
|
-
WHERE tenant_id = ? AND workspace_id = ? AND path = ?
|
|
92
|
-
LIMIT 1
|
|
93
|
-
`);
|
|
94
|
-
const upsertAsset = db.prepare(`
|
|
95
|
-
INSERT INTO workspace_assets (
|
|
96
|
-
asset_id, tenant_id, workspace_id, kind, logical_name, original_filename,
|
|
97
|
-
mime_type, storage_provider, storage_key, content_sha256, size_bytes,
|
|
98
|
-
document_id, version, is_latest, scan_status, scan_engine, scan_details,
|
|
99
|
-
created_by_user_id, created_at, updated_at, deleted_at, purge_after
|
|
100
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
101
|
-
ON CONFLICT(asset_id) DO UPDATE SET
|
|
102
|
-
workspace_id = excluded.workspace_id,
|
|
103
|
-
kind = excluded.kind,
|
|
104
|
-
logical_name = excluded.logical_name,
|
|
105
|
-
original_filename = excluded.original_filename,
|
|
106
|
-
mime_type = excluded.mime_type,
|
|
107
|
-
storage_provider = excluded.storage_provider,
|
|
108
|
-
storage_key = excluded.storage_key,
|
|
109
|
-
content_sha256 = excluded.content_sha256,
|
|
110
|
-
size_bytes = excluded.size_bytes,
|
|
111
|
-
document_id = excluded.document_id,
|
|
112
|
-
version = excluded.version,
|
|
113
|
-
is_latest = excluded.is_latest,
|
|
114
|
-
scan_status = excluded.scan_status,
|
|
115
|
-
scan_engine = excluded.scan_engine,
|
|
116
|
-
scan_details = excluded.scan_details,
|
|
117
|
-
updated_at = excluded.updated_at,
|
|
118
|
-
deleted_at = excluded.deleted_at,
|
|
119
|
-
purge_after = excluded.purge_after
|
|
120
|
-
`);
|
|
121
|
-
const upsertLink = db.prepare(`
|
|
122
|
-
INSERT INTO workspace_asset_links (
|
|
123
|
-
tenant_id, workspace_id, asset_id, task_id, role, sort_order, created_at, updated_at, deleted_at
|
|
124
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, NULL)
|
|
125
|
-
ON CONFLICT(tenant_id, workspace_id, asset_id, task_id, role) DO UPDATE SET
|
|
126
|
-
sort_order = excluded.sort_order,
|
|
127
|
-
updated_at = excluded.updated_at,
|
|
128
|
-
deleted_at = NULL
|
|
129
|
-
`);
|
|
130
|
-
const deleteLegacyTaskAsset = db.prepare(`
|
|
131
|
-
DELETE FROM task_assets
|
|
132
|
-
WHERE tenant_id = ? AND workspace_id = ? AND path = ?
|
|
133
|
-
`);
|
|
134
|
-
const listLegacyCanonicalAssets = db.prepare(`
|
|
135
|
-
SELECT *
|
|
136
|
-
FROM workspace_assets
|
|
137
|
-
WHERE tenant_id = ?
|
|
138
|
-
AND (
|
|
139
|
-
storage_key LIKE 'task-data/%'
|
|
140
|
-
OR storage_key LIKE 'workspaces/%/assets/document/%'
|
|
141
|
-
OR storage_key LIKE 'workspaces/%/assets/image/%'
|
|
142
|
-
OR storage_key LIKE 'workspaces/%/assets/file/%'
|
|
143
|
-
)
|
|
144
|
-
`);
|
|
145
|
-
const deleteLinksForAsset = db.prepare(`
|
|
146
|
-
DELETE FROM workspace_asset_links
|
|
147
|
-
WHERE tenant_id = ? AND workspace_id = ? AND asset_id = ?
|
|
148
|
-
`);
|
|
149
|
-
const deleteAsset = db.prepare(`
|
|
150
|
-
DELETE FROM workspace_assets
|
|
151
|
-
WHERE tenant_id = ? AND workspace_id = ? AND asset_id = ?
|
|
152
|
-
`);
|
|
153
|
-
|
|
154
|
-
let registry = { documents: {} };
|
|
155
|
-
if (fs.existsSync(registryPath)) {
|
|
156
|
-
try {
|
|
157
|
-
registry = JSON.parse(fs.readFileSync(registryPath, 'utf8'));
|
|
158
|
-
if (!registry || typeof registry !== 'object' || typeof registry.documents !== 'object') {
|
|
159
|
-
registry = { documents: {} };
|
|
160
|
-
}
|
|
161
|
-
} catch {
|
|
162
|
-
registry = { documents: {} };
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const summary = {
|
|
167
|
-
migrated: 0,
|
|
168
|
-
skipped: 0,
|
|
169
|
-
cleanedCanonical: 0,
|
|
170
|
-
removedStaleCanonical: 0,
|
|
171
|
-
removedDirs: 0,
|
|
172
|
-
removedFiles: 0,
|
|
173
|
-
touchedTasks: new Set(),
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const transaction = db.transaction(() => {
|
|
177
|
-
if (!fs.existsSync(taskDataDir)) return;
|
|
178
|
-
const taskDirs = fs.readdirSync(taskDataDir).filter((name) => name.startsWith('task-'));
|
|
179
|
-
for (const taskId of taskDirs) {
|
|
180
|
-
const attachmentsDir = path.join(taskDataDir, taskId, 'attachments');
|
|
181
|
-
if (!fs.existsSync(attachmentsDir)) continue;
|
|
182
|
-
const names = fs.readdirSync(attachmentsDir).filter((name) => {
|
|
183
|
-
const fullPath = path.join(attachmentsDir, name);
|
|
184
|
-
return fs.existsSync(fullPath) && fs.statSync(fullPath).isFile();
|
|
185
|
-
});
|
|
186
|
-
if (names.length === 0) {
|
|
187
|
-
fs.rmSync(attachmentsDir, { recursive: true, force: true });
|
|
188
|
-
summary.removedDirs += 1;
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const workspaceId = String(selectWorkspaceForTask.get(taskId)?.workspace_id || 'default').trim() || 'default';
|
|
193
|
-
let sortOrder = 0;
|
|
194
|
-
for (const name of names) {
|
|
195
|
-
if (name === '.DS_Store') {
|
|
196
|
-
fs.rmSync(path.join(attachmentsDir, name), { force: true });
|
|
197
|
-
summary.removedFiles += 1;
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
const oldRelative = `task-data/${taskId}/attachments/${name}`;
|
|
201
|
-
const oldAbsolute = path.join(attachmentsDir, name);
|
|
202
|
-
const stats = fs.statSync(oldAbsolute);
|
|
203
|
-
const buffer = fs.readFileSync(oldAbsolute);
|
|
204
|
-
const mimeType = inferMimeType(name);
|
|
205
|
-
const kind = inferKind(name, mimeType);
|
|
206
|
-
const role = kind === 'image' ? 'image' : 'attachment';
|
|
207
|
-
|
|
208
|
-
const existingCanonical = selectAssetByStorageKey.get(tenantId, workspaceId, oldRelative);
|
|
209
|
-
const existingLegacy = selectTaskAsset.get(tenantId, workspaceId, oldRelative);
|
|
210
|
-
const assetId = String(existingCanonical?.asset_id || `asset-${randomUUID().replace(/-/g, '')}`);
|
|
211
|
-
const newRelative = buildCanonicalRelativePath(workspaceId, kind, name, assetId);
|
|
212
|
-
const newAbsolute = path.join(basePath, newRelative);
|
|
213
|
-
const alreadyCanonical = fs.existsSync(newAbsolute);
|
|
214
|
-
fs.mkdirSync(path.dirname(newAbsolute), { recursive: true });
|
|
215
|
-
if (!alreadyCanonical) {
|
|
216
|
-
fs.renameSync(oldAbsolute, newAbsolute);
|
|
217
|
-
} else {
|
|
218
|
-
fs.rmSync(oldAbsolute, { force: true });
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const createdAt = String(existingCanonical?.created_at || existingLegacy?.uploaded_at || stats.birthtime.toISOString() || stats.mtime.toISOString());
|
|
222
|
-
const updatedAt = stats.mtime.toISOString();
|
|
223
|
-
const version = kind === 'document'
|
|
224
|
-
? Number(existingCanonical?.version || existingLegacy?.version || 1)
|
|
225
|
-
: null;
|
|
226
|
-
const documentId = kind === 'document'
|
|
227
|
-
? String(existingCanonical?.document_id || documentIdFor(newRelative))
|
|
228
|
-
: null;
|
|
229
|
-
const scanStatus = String(existingCanonical?.scan_status || (existingLegacy?.scan_verdict === 'infected' ? 'infected' : 'clean'));
|
|
230
|
-
const scanEngine = existingCanonical?.scan_engine || existingLegacy?.scan_engine || 'none';
|
|
231
|
-
const scanDetails = existingCanonical?.scan_details || existingLegacy?.scan_details || null;
|
|
232
|
-
const deletedAt = existingCanonical?.deleted_at || existingLegacy?.deleted_at || null;
|
|
233
|
-
const purgeAfter = existingCanonical?.purge_after || existingLegacy?.purge_after || null;
|
|
234
|
-
|
|
235
|
-
upsertAsset.run(
|
|
236
|
-
assetId,
|
|
237
|
-
tenantId,
|
|
238
|
-
workspaceId,
|
|
239
|
-
kind,
|
|
240
|
-
name,
|
|
241
|
-
name,
|
|
242
|
-
mimeType,
|
|
243
|
-
'local',
|
|
244
|
-
newRelative,
|
|
245
|
-
sha256(buffer),
|
|
246
|
-
buffer.length,
|
|
247
|
-
documentId,
|
|
248
|
-
version,
|
|
249
|
-
1,
|
|
250
|
-
scanStatus === 'pending' || scanStatus === 'infected' || scanStatus === 'failed' ? scanStatus : 'clean',
|
|
251
|
-
scanEngine,
|
|
252
|
-
scanDetails,
|
|
253
|
-
null,
|
|
254
|
-
createdAt,
|
|
255
|
-
updatedAt,
|
|
256
|
-
deletedAt,
|
|
257
|
-
purgeAfter
|
|
258
|
-
);
|
|
259
|
-
upsertLink.run(
|
|
260
|
-
tenantId,
|
|
261
|
-
workspaceId,
|
|
262
|
-
assetId,
|
|
263
|
-
taskId,
|
|
264
|
-
role,
|
|
265
|
-
sortOrder,
|
|
266
|
-
updatedAt,
|
|
267
|
-
updatedAt
|
|
268
|
-
);
|
|
269
|
-
deleteLegacyTaskAsset.run(tenantId, workspaceId, oldRelative);
|
|
270
|
-
|
|
271
|
-
if (registry.documents[oldRelative]) {
|
|
272
|
-
const entry = registry.documents[oldRelative];
|
|
273
|
-
delete registry.documents[oldRelative];
|
|
274
|
-
registry.documents[newRelative] = {
|
|
275
|
-
...entry,
|
|
276
|
-
path: newRelative,
|
|
277
|
-
provider: 'local',
|
|
278
|
-
sha256: sha256(buffer),
|
|
279
|
-
sizeBytes: buffer.length,
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
summary.migrated += 1;
|
|
284
|
-
summary.touchedTasks.add(taskId);
|
|
285
|
-
sortOrder += 1;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const remaining = fs.existsSync(attachmentsDir) ? fs.readdirSync(attachmentsDir) : [];
|
|
289
|
-
if (remaining.length === 0) {
|
|
290
|
-
fs.rmSync(attachmentsDir, { recursive: true, force: true });
|
|
291
|
-
summary.removedDirs += 1;
|
|
292
|
-
const taskDir = path.join(taskDataDir, taskId);
|
|
293
|
-
if (fs.existsSync(taskDir) && fs.readdirSync(taskDir).length === 0) {
|
|
294
|
-
fs.rmSync(taskDir, { recursive: true, force: true });
|
|
295
|
-
summary.removedDirs += 1;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
transaction();
|
|
302
|
-
|
|
303
|
-
const canonicalCleanup = db.transaction(() => {
|
|
304
|
-
const rows = listLegacyCanonicalAssets.all(tenantId);
|
|
305
|
-
for (const row of rows) {
|
|
306
|
-
const workspaceId = String(row.workspace_id || 'default').trim() || 'default';
|
|
307
|
-
const assetId = String(row.asset_id || '').trim();
|
|
308
|
-
const storageKey = String(row.storage_key || '').trim();
|
|
309
|
-
if (!assetId || !storageKey) continue;
|
|
310
|
-
const absolutePath = path.join(basePath, storageKey);
|
|
311
|
-
|
|
312
|
-
if (storageKey.startsWith('task-data/')) {
|
|
313
|
-
if (!fs.existsSync(absolutePath)) {
|
|
314
|
-
deleteLinksForAsset.run(tenantId, workspaceId, assetId);
|
|
315
|
-
deleteAsset.run(tenantId, workspaceId, assetId);
|
|
316
|
-
summary.removedStaleCanonical += 1;
|
|
317
|
-
continue;
|
|
318
|
-
}
|
|
319
|
-
const filename = String(row.original_filename || path.basename(storageKey));
|
|
320
|
-
const mimeType = inferMimeType(filename);
|
|
321
|
-
const kind = inferKind(filename, mimeType);
|
|
322
|
-
const newRelative = buildCanonicalRelativePath(workspaceId, kind, filename, assetId);
|
|
323
|
-
const newAbsolute = path.join(basePath, newRelative);
|
|
324
|
-
fs.mkdirSync(path.dirname(newAbsolute), { recursive: true });
|
|
325
|
-
fs.renameSync(absolutePath, newAbsolute);
|
|
326
|
-
upsertAsset.run(
|
|
327
|
-
assetId,
|
|
328
|
-
tenantId,
|
|
329
|
-
workspaceId,
|
|
330
|
-
kind,
|
|
331
|
-
row.logical_name || filename,
|
|
332
|
-
filename,
|
|
333
|
-
row.mime_type || mimeType,
|
|
334
|
-
row.storage_provider || 'local',
|
|
335
|
-
newRelative,
|
|
336
|
-
row.content_sha256 || sha256(fs.readFileSync(newAbsolute)),
|
|
337
|
-
Number(row.size_bytes || fs.statSync(newAbsolute).size),
|
|
338
|
-
kind === 'document' ? (row.document_id || documentIdFor(newRelative)) : null,
|
|
339
|
-
row.version == null ? (kind === 'document' ? 1 : null) : row.version,
|
|
340
|
-
Number(row.is_latest || 1) === 1 ? 1 : 0,
|
|
341
|
-
row.scan_status || 'clean',
|
|
342
|
-
row.scan_engine || 'none',
|
|
343
|
-
row.scan_details || null,
|
|
344
|
-
row.created_by_user_id || null,
|
|
345
|
-
row.created_at || new Date().toISOString(),
|
|
346
|
-
row.updated_at || new Date().toISOString(),
|
|
347
|
-
row.deleted_at || null,
|
|
348
|
-
row.purge_after || null
|
|
349
|
-
);
|
|
350
|
-
summary.cleanedCanonical += 1;
|
|
351
|
-
continue;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
if (storageKey.includes('/assets/document/') || storageKey.includes('/assets/image/') || storageKey.includes('/assets/file/')) {
|
|
355
|
-
const kind = String(row.kind || inferKind(String(row.original_filename || storageKey), String(row.mime_type || ''))).trim() || 'file';
|
|
356
|
-
const currentFilename = String(row.original_filename || path.basename(storageKey));
|
|
357
|
-
const newRelative = buildCanonicalRelativePath(workspaceId, kind, currentFilename, assetId);
|
|
358
|
-
const newAbsolute = path.join(basePath, newRelative);
|
|
359
|
-
if (fs.existsSync(absolutePath)) {
|
|
360
|
-
fs.mkdirSync(path.dirname(newAbsolute), { recursive: true });
|
|
361
|
-
fs.renameSync(absolutePath, newAbsolute);
|
|
362
|
-
}
|
|
363
|
-
upsertAsset.run(
|
|
364
|
-
assetId,
|
|
365
|
-
tenantId,
|
|
366
|
-
workspaceId,
|
|
367
|
-
kind,
|
|
368
|
-
row.logical_name || currentFilename,
|
|
369
|
-
currentFilename,
|
|
370
|
-
row.mime_type || inferMimeType(newRelative),
|
|
371
|
-
row.storage_provider || 'local',
|
|
372
|
-
newRelative,
|
|
373
|
-
row.content_sha256 || (fs.existsSync(newAbsolute) ? sha256(fs.readFileSync(newAbsolute)) : ''),
|
|
374
|
-
Number(row.size_bytes || (fs.existsSync(newAbsolute) ? fs.statSync(newAbsolute).size : 0)),
|
|
375
|
-
kind === 'document' ? (row.document_id || documentIdFor(newRelative)) : null,
|
|
376
|
-
row.version == null ? (kind === 'document' ? 1 : null) : row.version,
|
|
377
|
-
Number(row.is_latest || 1) === 1 ? 1 : 0,
|
|
378
|
-
row.scan_status || 'clean',
|
|
379
|
-
row.scan_engine || 'none',
|
|
380
|
-
row.scan_details || null,
|
|
381
|
-
row.created_by_user_id || null,
|
|
382
|
-
row.created_at || new Date().toISOString(),
|
|
383
|
-
row.updated_at || new Date().toISOString(),
|
|
384
|
-
row.deleted_at || null,
|
|
385
|
-
row.purge_after || null
|
|
386
|
-
);
|
|
387
|
-
summary.cleanedCanonical += 1;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
canonicalCleanup();
|
|
393
|
-
|
|
394
|
-
fs.writeFileSync(registryPath, `${JSON.stringify(registry, null, 2)}\n`, 'utf8');
|
|
395
|
-
const dsStorePath = path.join(taskDataDir, '.DS_Store');
|
|
396
|
-
if (fs.existsSync(dsStorePath)) {
|
|
397
|
-
fs.rmSync(dsStorePath, { force: true });
|
|
398
|
-
summary.removedFiles += 1;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
console.log(JSON.stringify({
|
|
402
|
-
migrated: summary.migrated,
|
|
403
|
-
cleanedCanonical: summary.cleanedCanonical,
|
|
404
|
-
removedStaleCanonical: summary.removedStaleCanonical,
|
|
405
|
-
removedDirs: summary.removedDirs,
|
|
406
|
-
removedFiles: summary.removedFiles,
|
|
407
|
-
touchedTasks: Array.from(summary.touchedTasks).sort()
|
|
408
|
-
}, null, 2));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
set -eu
|
|
3
|
-
|
|
4
|
-
LOCAL_ENV_FILE="${TASKFORCE_PLAYWRIGHT_ENV_FILE:-$HOME/.codex/taskforce-playwright.env}"
|
|
5
|
-
REPO_E2E_ENV_FILE="${TASKFORCE_PLAYWRIGHT_REPO_E2E_ENV_FILE:-.env.e2e}"
|
|
6
|
-
|
|
7
|
-
if [ -f "$LOCAL_ENV_FILE" ]; then
|
|
8
|
-
set -a
|
|
9
|
-
# shellcheck disable=SC1090
|
|
10
|
-
. "$LOCAL_ENV_FILE"
|
|
11
|
-
set +a
|
|
12
|
-
elif [ -f "$REPO_E2E_ENV_FILE" ]; then
|
|
13
|
-
set -a
|
|
14
|
-
# shellcheck disable=SC1090
|
|
15
|
-
. "$REPO_E2E_ENV_FILE"
|
|
16
|
-
set +a
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
exec node scripts/bootstrap-playwright-auth.mjs "$@"
|