@taskforcehq/taskforce 0.3.305 → 0.3.307
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 +0 -2
- package/dist/Taskforce.module.css +603 -107
- package/dist/TaskforceCore.js +216 -43
- package/dist/TaskforceCore.test.js +611 -28
- package/dist/assets/fonts/CourierPrime-Bold.woff2 +0 -0
- package/dist/assets/fonts/CourierPrime-BoldItalic.woff2 +0 -0
- package/dist/assets/fonts/CourierPrime-Italic.woff2 +0 -0
- package/dist/assets/fonts/CourierPrime-Regular.woff2 +0 -0
- package/dist/assets/fonts/Noir_medium.woff2 +0 -0
- package/dist/assets/fonts/Noir_regular.woff2 +0 -0
- package/dist/assets/fonts/RussoOne-Regular.woff2 +0 -0
- package/dist/assets/fonts/SpecialElite-Regular.woff2 +0 -0
- package/dist/compat/workspaceSyncCompat.js +46 -2
- package/dist/compat/workspaceSyncCompat.test.js +38 -1
- package/dist/components/activity/EntityActivityTimeline.d.ts +34 -0
- package/dist/components/activity/EntityActivityTimeline.js +81 -0
- package/dist/components/context/ContextAttachmentManager.d.ts +14 -0
- package/dist/components/context/ContextAttachmentManager.js +561 -0
- package/dist/components/features/AgentsModule.d.ts +14 -1
- package/dist/components/features/AgentsModule.js +366 -18
- package/dist/components/features/AgentsModule.test.js +507 -8
- package/dist/components/features/AnnotatedAttachmentWorkspace.d.ts +3 -1
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +118 -4
- package/dist/components/features/AnnotatedAttachmentWorkspace.test.js +52 -0
- package/dist/components/features/DocumentIndex.d.ts +2 -2
- package/dist/components/features/DocumentIndex.js +3 -4
- package/dist/components/features/DocumentViewer.d.ts +7 -1
- package/dist/components/features/DocumentViewer.js +62 -4
- package/dist/components/features/DocumentWorkspace.d.ts +10 -2
- package/dist/components/features/DocumentWorkspace.js +15 -4
- package/dist/components/features/DocumentWorkspace.test.js +51 -1
- package/dist/components/features/TaskSettings.d.ts +2 -0
- package/dist/components/features/TaskSettings.js +83 -78
- package/dist/components/features/TaskSettings.test.js +171 -82
- package/dist/components/features/documentWorkspaceModel.d.ts +1 -1
- package/dist/components/task/TaskActionHeader.js +11 -5
- package/dist/components/task/TaskActionHeader.test.js +10 -0
- package/dist/components/task/TaskCard.js +24 -29
- package/dist/components/task/TaskCard.test.js +38 -3
- package/dist/components/task/TaskContextUpload.js +4 -526
- package/dist/components/task/TaskContextUpload.test.js +3 -3
- package/dist/components/task/TaskForm.js +61 -116
- package/dist/components/task/TaskForm.test.js +110 -8
- package/dist/components/task/TaskKanban.d.ts +2 -1
- package/dist/components/task/TaskKanban.js +94 -21
- package/dist/components/task/TaskKanban.test.js +36 -0
- package/dist/components/task/TaskList.js +5 -1
- package/dist/components/task/TaskList.test.js +4 -0
- package/dist/components/ui/EditableAvatarButton.d.ts +18 -0
- package/dist/components/ui/EditableAvatarButton.js +18 -0
- package/dist/components/ui/HierarchyActionBadge.d.ts +10 -0
- package/dist/components/ui/HierarchyActionBadge.js +5 -0
- package/dist/components/views/AppShellHeader.d.ts +3 -1
- package/dist/components/views/AppShellHeader.js +27 -11
- package/dist/components/views/AppShellHeader.test.js +18 -1
- package/dist/components/views/PlanComparisonPage.d.ts +9 -1
- package/dist/components/views/PlanComparisonPage.js +78 -14
- package/dist/components/views/PlanComparisonPage.test.js +257 -0
- package/dist/components/views/PlansPage.js +127 -36
- package/dist/components/views/PlansPage.test.js +294 -12
- package/dist/components/views/StandaloneLayout.js +529 -592
- package/dist/components/views/WidgetView.js +10 -8
- package/dist/components/views/panels/PlanningDrawer.d.ts +25 -5
- package/dist/components/views/panels/PlanningDrawer.js +270 -55
- package/dist/components/views/panels/PlanningDrawer.test.d.ts +1 -0
- package/dist/components/views/panels/PlanningDrawer.test.js +529 -0
- package/dist/components/views/planningScope.d.ts +20 -0
- package/dist/components/views/planningScope.js +25 -0
- package/dist/components/views/planningScope.test.d.ts +1 -0
- package/dist/components/views/planningScope.test.js +60 -0
- package/dist/components/views/standalone/modals/AccountHubModal.d.ts +26 -1
- package/dist/components/views/standalone/modals/AccountHubModal.js +76 -2
- package/dist/components/views/standalone/modals/AccountHubModal.test.js +20 -3
- package/dist/components/views/standalone/modals/AvatarImageManagerModal.d.ts +20 -0
- package/dist/components/views/standalone/modals/AvatarImageManagerModal.js +127 -0
- package/dist/components/views/standalone/modals/EditProfileModal.d.ts +2 -9
- package/dist/components/views/standalone/modals/EditProfileModal.js +3 -2
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.d.ts +9 -0
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.js +6 -0
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.d.ts +1 -0
- package/dist/components/views/standalone/modals/SyncEnableWarningModal.test.js +24 -0
- package/dist/components/views/standalone/modals/SyncStatusModal.d.ts +2 -1
- package/dist/components/views/standalone/modals/SyncStatusModal.js +2 -2
- package/dist/config/envSchema.js +1 -0
- package/dist/core/AiProfileService.d.ts +46 -2
- package/dist/core/AiProfileService.js +1073 -82
- package/dist/core/AiProfileService.test.js +19 -1
- package/dist/core/AiProfiles.test.js +1249 -44
- package/dist/core/AttachmentLinkService.d.ts +3 -0
- package/dist/core/AttachmentLinkService.js +110 -23
- package/dist/core/AuthIdentityService.d.ts +107 -0
- package/dist/core/AuthIdentityService.js +284 -0
- package/dist/core/AuthTokenService.d.ts +4 -0
- package/dist/core/AuthTokenService.js +34 -6
- package/dist/core/AuthTokenService.test.js +3 -3
- package/dist/core/EntitlementsPolicy.test.js +2 -2
- package/dist/core/GlobalSettingsService.js +127 -6
- package/dist/core/McpTokenService.d.ts +12 -0
- package/dist/core/McpTokenService.js +44 -1
- package/dist/core/PlanEntitlementService.d.ts +23 -2
- package/dist/core/PlanEntitlementService.js +343 -57
- package/dist/core/PlanFeatureCatalog.test.d.ts +1 -0
- package/dist/core/PlanFeatureCatalog.test.js +84 -0
- package/dist/core/PlanVersionPolicy.test.js +35 -2
- package/dist/core/PlanningEntities.test.js +418 -4
- package/dist/core/SignupMonetizationSettings.test.js +199 -27
- package/dist/core/SyncReconciliationService.js +2 -65
- package/dist/core/SystemAdmin.test.js +42 -42
- package/dist/core/TaskActivityService.d.ts +28 -1
- package/dist/core/TaskActivityService.js +227 -46
- package/dist/core/TaskActivitySync.test.d.ts +1 -0
- package/dist/core/TaskActivitySync.test.js +90 -0
- package/dist/core/TaskAttachmentsCanonical.test.js +51 -1
- package/dist/core/TaskAuditTimeline.test.js +96 -0
- package/dist/core/Taskforce.d.ts +415 -40
- package/dist/core/Taskforce.ids.test.js +58 -0
- package/dist/core/Taskforce.js +1543 -266
- package/dist/core/Taskforce.listTasksSlim.test.d.ts +1 -0
- package/dist/core/Taskforce.listTasksSlim.test.js +91 -0
- package/dist/core/Taskforce.mcpAuth.test.js +109 -0
- package/dist/core/UserProfileAvatarDrafts.test.js +30 -3
- package/dist/core/WorkspaceLifecycleService.js +0 -5
- package/dist/core/WorkspacePermissions.test.js +25 -1
- package/dist/core/WorkspacePlanMode.test.js +117 -16
- package/dist/core/shared.d.ts +1 -1
- package/dist/core/shared.js +5 -1
- package/dist/core/types.d.ts +75 -2
- package/dist/hooks/auth/useTaskforceAuthBootstrap.js +28 -2
- package/dist/hooks/bootstrapTimeouts.d.ts +4 -0
- package/dist/hooks/bootstrapTimeouts.js +8 -0
- package/dist/hooks/bootstrapTimeouts.test.d.ts +1 -0
- package/dist/hooks/bootstrapTimeouts.test.js +12 -0
- package/dist/hooks/sync/bootstrap.js +2 -0
- package/dist/hooks/sync/controlPlane.d.ts +37 -0
- package/dist/hooks/sync/controlPlane.js +78 -0
- package/dist/hooks/sync/controlPlane.test.d.ts +1 -0
- package/dist/hooks/sync/controlPlane.test.js +121 -0
- package/dist/hooks/sync/lifecyclePolicy.d.ts +45 -0
- package/dist/hooks/sync/lifecyclePolicy.js +93 -0
- package/dist/hooks/sync/lifecyclePolicy.test.d.ts +1 -0
- package/dist/hooks/sync/lifecyclePolicy.test.js +124 -0
- package/dist/hooks/sync/orchestratorShared.d.ts +13 -4
- package/dist/hooks/sync/orchestratorShared.js +129 -48
- package/dist/hooks/sync/orchestratorShared.test.js +50 -1
- package/dist/hooks/sync/pullLifecycle.d.ts +31 -0
- package/dist/hooks/sync/pullLifecycle.js +24 -0
- package/dist/hooks/sync/pullLifecycle.test.d.ts +1 -0
- package/dist/hooks/sync/pullLifecycle.test.js +80 -0
- package/dist/hooks/sync/recovery.d.ts +16 -2
- package/dist/hooks/sync/recovery.js +179 -53
- package/dist/hooks/sync/recovery.test.d.ts +1 -0
- package/dist/hooks/sync/recovery.test.js +292 -0
- package/dist/hooks/sync/transfers.d.ts +16 -3
- package/dist/hooks/sync/transfers.js +210 -66
- package/dist/hooks/sync/transfers.test.d.ts +1 -0
- package/dist/hooks/sync/transfers.test.js +928 -0
- package/dist/hooks/sync/useRecentSyncEvents.d.ts +21 -0
- package/dist/hooks/sync/useRecentSyncEvents.js +92 -0
- package/dist/hooks/sync/useRecentSyncEvents.test.d.ts +1 -0
- package/dist/hooks/sync/useRecentSyncEvents.test.js +124 -0
- package/dist/hooks/sync/useSyncStatusActions.d.ts +30 -0
- package/dist/hooks/sync/useSyncStatusActions.js +88 -0
- package/dist/hooks/sync/useSyncStatusActions.test.d.ts +1 -0
- package/dist/hooks/sync/useSyncStatusActions.test.js +133 -0
- package/dist/hooks/sync/useSyncStatusControls.d.ts +25 -0
- package/dist/hooks/sync/useSyncStatusControls.js +60 -0
- package/dist/hooks/sync/useSyncStatusControls.test.d.ts +1 -0
- package/dist/hooks/sync/useSyncStatusControls.test.js +88 -0
- package/dist/hooks/useFilterSort.js +13 -13
- package/dist/hooks/useFilterSort.test.js +87 -1
- package/dist/hooks/useSyncOrchestrator.aiProfiles.test.js +12 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +9 -2
- package/dist/hooks/useSyncOrchestrator.js +409 -183
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +407 -0
- package/dist/hooks/useTaskData.js +8 -3
- package/dist/hooks/useTaskData.test.js +45 -0
- package/dist/hooks/useTaskforce.d.ts +145 -52
- package/dist/hooks/useTaskforce.js +592 -253
- package/dist/hooks/useTaskforce.runtime-routing.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.runtime-routing.test.js +246 -0
- package/dist/hooks/useTaskforce.sync-behavior.test.js +2468 -201
- package/dist/hooks/useWorkspaceSyncController.d.ts +1 -0
- package/dist/hooks/useWorkspaceSyncController.js +13 -2
- package/dist/hooks/useWorkspaceSyncController.test.js +48 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.d.ts +16 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +328 -40
- package/dist/localization/locales/en-US.d.ts +0 -1
- package/dist/localization/locales/en-US.js +0 -1
- package/dist/localization/locales/es-419.js +0 -1
- package/dist/localization/locales/pt-BR.js +0 -1
- package/dist/mcp/canonicalAssetHelpers.d.ts +16 -4
- package/dist/mcp/canonicalAssetHelpers.js +18 -10
- package/dist/mcp/canonicalAssetHelpers.test.d.ts +1 -0
- package/dist/mcp/canonicalAssetHelpers.test.js +67 -0
- package/dist/mcp/clientIntegrations.d.ts +1 -0
- package/dist/mcp/clientIntegrations.js +25 -0
- package/dist/mcp/clientIntegrations.test.js +14 -3
- package/dist/mcp/clientProfileDefaults.js +3 -3
- package/dist/mcp/collaborationRegistrar.js +7 -7
- package/dist/mcp/documentAssetRegistrar.js +116 -10
- package/dist/mcp/runtime.d.ts +3 -0
- package/dist/mcp/runtime.js +1099 -185
- package/dist/mcp/runtime.test.js +1491 -140
- package/dist/mcp/taskAttachmentTypes.d.ts +1 -1
- package/dist/mcp/taskPlanningRegistrar.js +48 -0
- package/dist/mcp/toolRegistry.d.ts +56 -0
- package/dist/mcp/toolRegistry.js +8 -0
- package/dist/mcp/toolRegistry.test.js +4 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +1 -1
- package/dist/migrations/taskSchemaMigrations.js +192 -61
- package/dist/migrations/taskSchemaMigrations.test.js +15 -0
- package/dist/resources/templates/workflow-sources/workflowDocs.mjs +6 -6
- package/dist/resources/templates/workflows/collaborate.yaml +1 -1
- package/dist/resources/templates/workflows/evaluate.yaml +2 -2
- package/dist/resources/templates/workflows/plan.yaml +1 -1
- package/dist/resources/templates/workflows/review.yaml +2 -2
- package/dist/server/aiProfileAvatarAssets.d.ts +49 -0
- package/dist/server/aiProfileAvatarAssets.js +319 -0
- package/dist/server/aiProfileAvatarAssets.test.d.ts +1 -0
- package/dist/server/aiProfileAvatarAssets.test.js +213 -0
- package/dist/server/annotatedAttachmentsRoutes.test.js +69 -10
- package/dist/server/auth/providers/apple.d.ts +33 -0
- package/dist/server/auth/providers/apple.js +82 -0
- package/dist/server/auth/providers/appleClientSecret.d.ts +37 -0
- package/dist/server/auth/providers/appleClientSecret.js +65 -0
- package/dist/server/auth/providers/github.d.ts +26 -0
- package/dist/server/auth/providers/github.js +86 -0
- package/dist/server/auth/providers/google.d.ts +21 -0
- package/dist/server/auth/providers/google.js +56 -0
- package/dist/server/auth/providers/types.d.ts +21 -0
- package/dist/server/auth/providers/types.js +1 -0
- package/dist/server/auth.d.ts +2 -0
- package/dist/server/auth.js +6 -3
- package/dist/server/documentReviewRoutes.test.js +36 -3
- package/dist/server/index.cookieProxy.test.js +1 -0
- package/dist/server/index.d.ts +12 -0
- package/dist/server/index.js +124 -9
- package/dist/server/index.rateLimit.test.js +3 -0
- package/dist/server/index.test.js +111 -3
- package/dist/server/routes/admin.d.ts +3 -0
- package/dist/server/routes/admin.js +459 -28
- package/dist/server/routes/annotatedAttachments.js +51 -0
- package/dist/server/routes/auth.d.ts +26 -2
- package/dist/server/routes/auth.js +1170 -71
- package/dist/server/routes/authSupport.d.ts +5 -1
- package/dist/server/routes/authSupport.js +13 -2
- package/dist/server/routes/billing.js +372 -35
- package/dist/server/routes/billing.test.js +595 -12
- package/dist/server/routes/documents.d.ts +1 -0
- package/dist/server/routes/documents.js +182 -70
- package/dist/server/routes/shared.d.ts +28 -2
- package/dist/server/routes/shared.js +69 -14
- package/dist/server/routes/sync.integration.test.js +658 -39
- package/dist/server/routes/sync.js +74 -608
- package/dist/server/routes/syncAuxRoutes.d.ts +15 -0
- package/dist/server/routes/syncAuxRoutes.js +91 -0
- package/dist/server/routes/syncAuxRoutes.test.d.ts +1 -0
- package/dist/server/routes/syncAuxRoutes.test.js +158 -0
- package/dist/server/routes/syncPullApplyRoutes.d.ts +36 -0
- package/dist/server/routes/syncPullApplyRoutes.js +204 -0
- package/dist/server/routes/syncPushRoutes.d.ts +24 -0
- package/dist/server/routes/syncPushRoutes.js +212 -0
- package/dist/server/routes/syncRouteGuards.d.ts +36 -0
- package/dist/server/routes/syncRouteGuards.js +67 -0
- package/dist/server/routes/syncRouteGuards.test.d.ts +1 -0
- package/dist/server/routes/syncRouteGuards.test.js +94 -0
- package/dist/server/routes/syncRouteTypes.d.ts +13 -0
- package/dist/server/routes/syncRouteTypes.js +1 -0
- package/dist/server/routes/syncSnapshotRoutes.d.ts +66 -0
- package/dist/server/routes/syncSnapshotRoutes.js +182 -0
- package/dist/server/routes/tasks.js +55 -10
- package/dist/server/routes/workspaces.js +36 -5
- package/dist/server/routes.js +147 -11
- package/dist/server/routes.test.js +2704 -183
- package/dist/services/workflowExportSnapshots.test.js +2 -0
- package/dist/shared/aiProfileSeatScope.d.ts +5 -0
- package/dist/shared/aiProfileSeatScope.js +21 -0
- package/dist/shared/aiProfileSurfaceType.d.ts +1 -1
- package/dist/shared/aiProfileSurfaceType.js +10 -8
- package/dist/shared/passwordPolicy.d.ts +13 -0
- package/dist/shared/passwordPolicy.js +84 -0
- package/dist/shared/passwordPolicy.test.d.ts +1 -0
- package/dist/shared/passwordPolicy.test.js +34 -0
- package/dist/storage/objectStorage.d.ts +1 -0
- package/dist/storage/objectStorage.js +2 -1
- package/dist/storage/objectStorageClient.d.ts +1 -0
- package/dist/storage/objectStorageClient.js +41 -8
- package/dist/storage/objectStorageClient.test.js +26 -1
- package/dist/storage/objectStorageConfig.js +3 -1
- package/dist/storage/objectStorageConfig.test.js +13 -1
- package/dist/storage/workspaceAssetStore.d.ts +15 -3
- package/dist/storage/workspaceAssetStore.js +132 -44
- package/dist/storage/workspaceAssetStore.test.js +93 -6
- package/dist/styles/fonts.css +70 -0
- package/dist/sync/collaborationSyncPayload.d.ts +6 -1
- package/dist/sync/collaborationSyncPayload.js +19 -11
- package/dist/sync/collaborationSyncPayload.test.js +14 -1
- package/dist/sync/collaborationSyncState.d.ts +3 -3
- package/dist/sync/collaborationSyncState.js +19 -12
- package/dist/sync/contentSyncPayload.d.ts +5 -1
- package/dist/sync/contentSyncPayload.js +9 -0
- package/dist/sync/contentSyncPayload.test.js +39 -0
- package/dist/sync/contentSyncState.d.ts +9 -9
- package/dist/sync/contentSyncState.js +248 -107
- package/dist/sync/planningSyncPayload.js +5 -0
- package/dist/sync/planningSyncPayload.test.js +24 -0
- package/dist/sync/syncApplyHandlers.d.ts +11 -4
- package/dist/sync/syncApplyHandlers.js +115 -42
- package/dist/sync/syncApplyHandlers.test.js +251 -4
- package/dist/sync/syncFieldSemantics.d.ts +12 -0
- package/dist/sync/syncFieldSemantics.js +55 -0
- package/dist/sync/syncResourceAdapters.d.ts +46 -0
- package/dist/sync/syncResourceAdapters.js +79 -0
- package/dist/sync/syncService.d.ts +6 -0
- package/dist/sync/syncService.js +65 -1
- package/dist/sync/syncService.test.js +96 -3
- package/dist/sync/taskSyncChangeKey.d.ts +2 -0
- package/dist/sync/taskSyncChangeKey.js +143 -0
- package/dist/sync/taskSyncPayload.js +3 -8
- package/dist/sync/workspacePullFeed.d.ts +4 -0
- package/dist/sync/workspacePullFeed.js +132 -72
- package/dist/sync/workspacePullFeed.test.js +92 -0
- package/dist/sync/workspaceRepair.js +5 -2
- package/dist/sync/workspaceSyncModel.d.ts +73 -6
- package/dist/sync/workspaceSyncModel.js +342 -73
- package/dist/sync/workspaceSyncModel.test.js +559 -14
- package/dist/sync/workspaceSyncState.d.ts +17 -0
- package/dist/sync/workspaceSyncState.js +2 -1
- package/dist/sync/workspaceSyncSurface.js +3 -8
- package/dist/types.d.ts +50 -2
- package/dist/ui/assets/AgentsModule-2y82_3DO.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BTLZZCiQ.js +3 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BVKew-mH.css +1 -0
- package/dist/ui/assets/ContextAttachmentManager-D2epuNnG.js +3 -0
- package/dist/ui/assets/CourierPrime-Bold-BuLj_dpw.woff2 +0 -0
- package/dist/ui/assets/CourierPrime-BoldItalic-BrK2pUkZ.woff2 +0 -0
- package/dist/ui/assets/CourierPrime-Italic-DFUZK5Ey.woff2 +0 -0
- package/dist/ui/assets/CourierPrime-Regular-BsKphzVf.woff2 +0 -0
- package/dist/ui/assets/DocumentWorkspace-D4rJKXzd.css +1 -0
- package/dist/ui/assets/DocumentWorkspace-sVa-3Do6.js +252 -0
- package/dist/ui/assets/EntityActivityTimeline-DyqvvhuF.css +1 -0
- package/dist/ui/assets/EntityActivityTimeline-Zods27y_.js +1 -0
- package/dist/ui/assets/{InitiativesModule-Dhm7M8e7.js → InitiativesModule-D4XseTwW.js} +1 -1
- package/dist/ui/assets/Noir_medium-bxQwKGzB.woff2 +0 -0
- package/dist/ui/assets/Noir_regular-ojf2kxlG.woff2 +0 -0
- package/dist/ui/assets/PlansPage-D5AcbO0L.js +1 -0
- package/dist/ui/assets/PlansPage-Dvqsz5zc.css +1 -0
- package/dist/ui/assets/RussoOne-Regular-Cu_qq_qC.woff2 +0 -0
- package/dist/ui/assets/SpecialElite-Regular-Di6gSvAS.woff2 +0 -0
- package/dist/ui/assets/TaskContextUpload-uC5qx4Bv.js +1 -0
- package/dist/ui/assets/TaskSettings-CqvPAsTv.js +9 -0
- package/dist/ui/assets/{WorkflowsModule-BcS4afRn.js → WorkflowsModule-oOA9bcdK.js} +4 -4
- package/dist/ui/assets/documentReferences-DPZuTgHh.js +1 -0
- package/dist/ui/assets/index-607WPo_X.js +4 -0
- package/dist/ui/assets/index-CYyodXsg.css +1 -0
- package/dist/ui/assets/{vendor-icons-BSUaRwF8.js → vendor-icons-B32hGuF2.js} +1 -1
- package/dist/ui/fonts/CourierPrime-Bold.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-Bold.woff2 +0 -0
- package/dist/ui/fonts/CourierPrime-BoldItalic.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-BoldItalic.woff2 +0 -0
- package/dist/ui/fonts/CourierPrime-Italic.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-Italic.woff2 +0 -0
- package/dist/ui/fonts/CourierPrime-Regular.ttf +0 -0
- package/dist/ui/fonts/CourierPrime-Regular.woff2 +0 -0
- package/dist/ui/fonts/Noir_medium.otf +0 -0
- package/dist/ui/fonts/Noir_medium.woff2 +0 -0
- package/dist/ui/fonts/Noir_regular.otf +0 -0
- package/dist/ui/fonts/Noir_regular.woff2 +0 -0
- package/dist/ui/fonts/RussoOne-Regular.woff2 +0 -0
- package/dist/ui/fonts/SpecialElite-Regular.ttf +0 -0
- package/dist/ui/fonts/SpecialElite-Regular.woff2 +0 -0
- package/dist/ui/index.html +3 -3
- package/dist/ui/product/agent manager.png +0 -0
- package/dist/ui/product/agent_manager_02.png +0 -0
- package/dist/utils/accountProfileSummaryCache.d.ts +5 -0
- package/dist/utils/aiProfileEvents.d.ts +7 -0
- package/dist/utils/aiProfileEvents.js +6 -0
- package/dist/utils/assignees.d.ts +8 -0
- package/dist/utils/assignees.js +10 -1
- package/dist/utils/assignees.test.d.ts +1 -0
- package/dist/utils/assignees.test.js +25 -0
- package/dist/utils/avatarDisplay.d.ts +1 -0
- package/dist/utils/avatarDisplay.js +15 -0
- package/dist/utils/avatarUpload.d.ts +27 -0
- package/dist/utils/avatarUpload.js +132 -0
- package/dist/utils/avatarUpload.test.d.ts +1 -0
- package/dist/utils/avatarUpload.test.js +40 -0
- package/dist/utils/bootstrapTrace.d.ts +7 -0
- package/dist/utils/bootstrapTrace.js +29 -0
- package/dist/utils/commercialLifecyclePresentation.js +3 -0
- package/dist/utils/contextAssetEvents.d.ts +2 -0
- package/dist/utils/contextFiles.d.ts +3 -1
- package/dist/utils/contextFiles.js +2 -1
- package/dist/utils/syncEventDetails.d.ts +3 -0
- package/dist/utils/syncEventDetails.js +64 -0
- package/dist/utils/syncEventDetails.test.d.ts +1 -0
- package/dist/utils/syncEventDetails.test.js +23 -0
- package/dist/utils/syncEventPresentation.d.ts +15 -0
- package/dist/utils/syncEventPresentation.js +129 -0
- package/dist/utils/syncEventPresentation.test.d.ts +1 -0
- package/dist/utils/syncEventPresentation.test.js +64 -0
- package/dist/utils/syncStatusPresentation.d.ts +72 -0
- package/dist/utils/syncStatusPresentation.js +217 -0
- package/dist/utils/syncStatusPresentation.test.d.ts +1 -0
- package/dist/utils/syncStatusPresentation.test.js +164 -0
- package/dist/utils/taskActivity.d.ts +9 -1
- package/dist/utils/taskActivity.js +290 -22
- package/dist/utils/taskActivity.test.js +141 -8
- package/dist/utils/taskSearch.d.ts +22 -0
- package/dist/utils/taskSearch.js +87 -0
- package/dist/utils/taskSearch.test.d.ts +1 -0
- package/dist/utils/taskSearch.test.js +69 -0
- package/dist/utils/taskUtils.js +10 -3
- package/dist/utils/taskUtils.test.d.ts +1 -0
- package/dist/utils/taskUtils.test.js +19 -0
- package/dist/utils/workspaceSyncPresentation.d.ts +4 -0
- package/dist/utils/workspaceSyncPresentation.js +68 -2
- package/dist/utils/workspaceSyncPresentation.test.js +36 -1
- package/package.json +3 -2
- package/scripts/export-sqlite-to-postgres.mjs +7 -9
- package/scripts/run-e2e-realtime.sh +17 -3
- package/scripts/run-smoke.sh +17 -5
- package/scripts/run-soak.sh +17 -5
- package/src/resources/templates/workflow-sources/workflowDocs.mjs +6 -6
- package/src/resources/templates/workflows/collaborate.yaml +1 -1
- package/src/resources/templates/workflows/evaluate.yaml +2 -2
- package/src/resources/templates/workflows/plan.yaml +1 -1
- package/src/resources/templates/workflows/review.yaml +2 -2
- package/dist/ui/assets/AgentsModule-N2MnQBZk.js +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BG6P_GVW.js +0 -3
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BaS2VwIr.css +0 -1
- package/dist/ui/assets/DocumentWorkspace-B3nV_Gc5.css +0 -1
- package/dist/ui/assets/DocumentWorkspace-DRbDMwh8.js +0 -252
- package/dist/ui/assets/PlansPage-C2dd2n1X.css +0 -1
- package/dist/ui/assets/PlansPage-Cq0zXj3I.js +0 -1
- package/dist/ui/assets/RussoOne-Regular-C3BxZIj7.ttf +0 -0
- package/dist/ui/assets/TaskSettings-ln0aF7xc.js +0 -9
- package/dist/ui/assets/index-C2-OXZV7.css +0 -1
- package/dist/ui/assets/index-DcSI5F86.js +0 -6
- package/scripts/migrate-planning-model.ts +0 -233
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { TaskforceCore } from './Taskforce';
|
|
6
|
+
function makeProjectRoot() {
|
|
7
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-plan-feature-catalog-'));
|
|
8
|
+
}
|
|
9
|
+
describe('TaskforceCore plan feature catalog marketing copy', () => {
|
|
10
|
+
it('persists public marketing copy overrides and falls back after clearing them', () => {
|
|
11
|
+
const projectRoot = makeProjectRoot();
|
|
12
|
+
const core = new TaskforceCore({
|
|
13
|
+
projectRoot,
|
|
14
|
+
storagePath: path.join(projectRoot, '.taskforce')
|
|
15
|
+
});
|
|
16
|
+
const initialFeature = core.listPlanFeatureCatalog().find((feature) => feature.featureKey === 'collaboration.ai_profiles');
|
|
17
|
+
expect(initialFeature?.label).toBe('AI Profiles');
|
|
18
|
+
expect(initialFeature?.publicLabel ?? null).toBeNull();
|
|
19
|
+
expect(initialFeature?.publicDescription ?? null).toBeNull();
|
|
20
|
+
expect(initialFeature?.publicDisplayOrder).toBe(20);
|
|
21
|
+
const updated = core.updatePlanFeatureCatalogMarketingCopy({
|
|
22
|
+
featureKey: 'collaboration.ai_profiles',
|
|
23
|
+
publicLabel: 'AI teammates',
|
|
24
|
+
publicDescription: 'Add reusable AI teammates to your workspace.',
|
|
25
|
+
publicDisplayOrder: 24
|
|
26
|
+
});
|
|
27
|
+
expect(updated.publicLabel).toBe('AI teammates');
|
|
28
|
+
expect(updated.publicDescription).toBe('Add reusable AI teammates to your workspace.');
|
|
29
|
+
expect(updated.publicDisplayOrder).toBe(24);
|
|
30
|
+
const persisted = core.listPlanFeatureCatalog().find((feature) => feature.featureKey === 'collaboration.ai_profiles');
|
|
31
|
+
expect(persisted?.publicLabel).toBe('AI teammates');
|
|
32
|
+
expect(persisted?.publicDescription).toBe('Add reusable AI teammates to your workspace.');
|
|
33
|
+
expect(persisted?.publicDisplayOrder).toBe(24);
|
|
34
|
+
const cleared = core.updatePlanFeatureCatalogMarketingCopy({
|
|
35
|
+
featureKey: 'collaboration.ai_profiles',
|
|
36
|
+
publicLabel: ' ',
|
|
37
|
+
publicDescription: '',
|
|
38
|
+
publicDisplayOrder: null
|
|
39
|
+
});
|
|
40
|
+
expect(cleared.publicLabel ?? null).toBeNull();
|
|
41
|
+
expect(cleared.publicDescription ?? null).toBeNull();
|
|
42
|
+
expect(cleared.publicDisplayOrder).toBe(20);
|
|
43
|
+
const fallback = core.listPlanFeatureCatalog().find((feature) => feature.featureKey === 'collaboration.ai_profiles');
|
|
44
|
+
expect(fallback?.label).toBe('AI Profiles');
|
|
45
|
+
expect(fallback?.publicLabel ?? null).toBeNull();
|
|
46
|
+
expect(fallback?.publicDescription ?? null).toBeNull();
|
|
47
|
+
expect(fallback?.publicDisplayOrder).toBe(20);
|
|
48
|
+
core.close();
|
|
49
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
50
|
+
});
|
|
51
|
+
it('migrates legacy workspace feature catalog overrides to the canonical key', () => {
|
|
52
|
+
const projectRoot = makeProjectRoot();
|
|
53
|
+
const core = new TaskforceCore({
|
|
54
|
+
projectRoot,
|
|
55
|
+
storagePath: path.join(projectRoot, '.taskforce')
|
|
56
|
+
});
|
|
57
|
+
const db = core.db;
|
|
58
|
+
db.prepare(`
|
|
59
|
+
INSERT INTO plan_feature_catalog_overrides (
|
|
60
|
+
tenant_id,
|
|
61
|
+
feature_key,
|
|
62
|
+
public_label,
|
|
63
|
+
public_description,
|
|
64
|
+
public_display_order,
|
|
65
|
+
created_at,
|
|
66
|
+
updated_at
|
|
67
|
+
) VALUES (?, 'workspace.switching', ?, ?, ?, ?, ?)
|
|
68
|
+
`).run('default', 'Workspace access', 'Let a user create and switch between multiple workspaces.', 14, '2026-01-01T00:00:00.000Z', '2026-01-01T00:00:00.000Z');
|
|
69
|
+
core.planEntitlementService.normalizeLegacyPlanDataIfNeeded();
|
|
70
|
+
const feature = core.listPlanFeatureCatalog().find((item) => item.featureKey === 'workspace.workspaces');
|
|
71
|
+
expect(feature?.publicLabel).toBe('Workspace access');
|
|
72
|
+
expect(feature?.publicDescription).toBe('Let a user create and switch between multiple workspaces.');
|
|
73
|
+
expect(feature?.publicDisplayOrder).toBe(14);
|
|
74
|
+
const rows = db.prepare(`
|
|
75
|
+
SELECT feature_key
|
|
76
|
+
FROM plan_feature_catalog_overrides
|
|
77
|
+
WHERE tenant_id = ?
|
|
78
|
+
`).all('default');
|
|
79
|
+
expect(rows.some((row) => row.feature_key === 'workspace.switching')).toBe(false);
|
|
80
|
+
expect(rows.some((row) => row.feature_key === 'workspace.workspaces')).toBe(true);
|
|
81
|
+
core.close();
|
|
82
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -141,11 +141,11 @@ describe('TaskforceCore plan version policy', () => {
|
|
|
141
141
|
const version = core.updatePlanVersionFeatures({
|
|
142
142
|
planVersionId: 'free-v1',
|
|
143
143
|
features: [
|
|
144
|
-
{ featureKey: 'workspace.
|
|
144
|
+
{ featureKey: 'workspace.workspaces', access: 'limited', config: { maxWorkspaces: 0 } },
|
|
145
145
|
{ featureKey: 'context.uploads', access: 'limited', config: { storageLimitMb: -50 } }
|
|
146
146
|
]
|
|
147
147
|
});
|
|
148
|
-
expect(version.features['workspace.
|
|
148
|
+
expect(version.features['workspace.workspaces']?.config).toEqual({ maxWorkspaces: 1 });
|
|
149
149
|
expect(version.features['context.uploads']?.config).toEqual({ storageLimitMb: 1 });
|
|
150
150
|
}
|
|
151
151
|
finally {
|
|
@@ -153,6 +153,39 @@ describe('TaskforceCore plan version policy', () => {
|
|
|
153
153
|
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
|
+
it('migrates legacy workspace feature keys to the canonical key', () => {
|
|
157
|
+
const projectRoot = makeProjectRoot();
|
|
158
|
+
const core = openCore(projectRoot);
|
|
159
|
+
try {
|
|
160
|
+
core.updatePlanVersionFeatures({
|
|
161
|
+
planVersionId: 'free-v1',
|
|
162
|
+
features: [
|
|
163
|
+
{ featureKey: 'workspace.workspaces', access: 'limited', config: { maxWorkspaces: 1 } }
|
|
164
|
+
]
|
|
165
|
+
});
|
|
166
|
+
const db = core.db;
|
|
167
|
+
db.prepare(`
|
|
168
|
+
UPDATE plan_feature_matrix
|
|
169
|
+
SET feature_key = 'workspace.switching'
|
|
170
|
+
WHERE tenant_id = ? AND plan_version_id = ? AND feature_key = 'workspace.workspaces'
|
|
171
|
+
`).run('default', 'free-v1');
|
|
172
|
+
core.planEntitlementService.normalizeLegacyPlanDataIfNeeded();
|
|
173
|
+
const version = core.getPlanVersionFeatures('free', 'free-v1');
|
|
174
|
+
expect(version.features['workspace.workspaces']).toBeTruthy();
|
|
175
|
+
expect(version.features['workspace.switching']).toBeUndefined();
|
|
176
|
+
const rows = db.prepare(`
|
|
177
|
+
SELECT feature_key
|
|
178
|
+
FROM plan_feature_matrix
|
|
179
|
+
WHERE tenant_id = ? AND plan_version_id = ?
|
|
180
|
+
`).all('default', 'free-v1');
|
|
181
|
+
expect(rows.some((row) => row.feature_key === 'workspace.switching')).toBe(false);
|
|
182
|
+
expect(rows.some((row) => row.feature_key === 'workspace.workspaces')).toBe(true);
|
|
183
|
+
}
|
|
184
|
+
finally {
|
|
185
|
+
core.close();
|
|
186
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
187
|
+
}
|
|
188
|
+
});
|
|
156
189
|
it('starts new plans disabled before pricing is configured', () => {
|
|
157
190
|
const projectRoot = makeProjectRoot();
|
|
158
191
|
const core = openCore(projectRoot);
|
|
@@ -22,13 +22,33 @@ describe('TaskforceCore planning entity persistence', () => {
|
|
|
22
22
|
const initiative = core.createInitiative({
|
|
23
23
|
title: 'Launch initiative',
|
|
24
24
|
comments: [{ id: 'comment-1', author: 'user', text: 'Kickoff note', timestamp: '2026-01-01T00:00:00.000Z' }],
|
|
25
|
-
attachments: [{
|
|
25
|
+
attachments: [{
|
|
26
|
+
path: '/tmp/launch-brief.md',
|
|
27
|
+
fsPath: 'workspaces/workspace-1/assets/documents/asset-launch-brief.md',
|
|
28
|
+
caption: 'Launch brief',
|
|
29
|
+
displayName: 'Launch Brief',
|
|
30
|
+
originalFilename: 'launch-brief.md',
|
|
31
|
+
assetId: 'asset-launch-brief',
|
|
32
|
+
referenceNumber: 12,
|
|
33
|
+
referenceLabel: 'D-12',
|
|
34
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
35
|
+
}],
|
|
26
36
|
});
|
|
27
37
|
const workstream = core.createWorkstream({
|
|
28
38
|
title: 'Billing workstream',
|
|
29
39
|
initiativeId: initiative.id,
|
|
30
40
|
comments: [{ id: 'comment-2', author: 'user', text: 'Billing note', timestamp: '2026-01-01T00:00:00.000Z' }],
|
|
31
|
-
attachments: [{
|
|
41
|
+
attachments: [{
|
|
42
|
+
path: '/tmp/billing-brief.md',
|
|
43
|
+
fsPath: 'workspaces/workspace-1/assets/documents/asset-billing-brief.md',
|
|
44
|
+
caption: 'Billing brief',
|
|
45
|
+
displayName: 'Billing Brief',
|
|
46
|
+
originalFilename: 'billing-brief.md',
|
|
47
|
+
assetId: 'asset-billing-brief',
|
|
48
|
+
referenceNumber: 13,
|
|
49
|
+
referenceLabel: 'D-13',
|
|
50
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
51
|
+
}],
|
|
32
52
|
});
|
|
33
53
|
const task = core.createTask({
|
|
34
54
|
title: 'Adjust billing copy',
|
|
@@ -43,11 +63,29 @@ describe('TaskforceCore planning entity persistence', () => {
|
|
|
43
63
|
const persistedTask = core.getTask(task.id);
|
|
44
64
|
expect(persistedInitiative?.referenceLabel).toBe('IN-1');
|
|
45
65
|
expect(persistedInitiative?.comments?.[0]?.text).toBe('Kickoff note');
|
|
46
|
-
expect(persistedInitiative?.attachments?.[0]).toMatchObject({
|
|
66
|
+
expect(persistedInitiative?.attachments?.[0]).toMatchObject({
|
|
67
|
+
path: '/tmp/launch-brief.md',
|
|
68
|
+
fsPath: 'workspaces/workspace-1/assets/documents/asset-launch-brief.md',
|
|
69
|
+
caption: 'Launch brief',
|
|
70
|
+
displayName: 'Launch Brief',
|
|
71
|
+
originalFilename: 'launch-brief.md',
|
|
72
|
+
assetId: 'asset-launch-brief',
|
|
73
|
+
referenceNumber: 12,
|
|
74
|
+
referenceLabel: 'D-12',
|
|
75
|
+
});
|
|
47
76
|
expect(persistedWorkstream?.referenceLabel).toBe('WS-1');
|
|
48
77
|
expect(persistedWorkstream?.initiativeId).toBe(initiative.id);
|
|
49
78
|
expect(persistedWorkstream?.comments?.[0]?.text).toBe('Billing note');
|
|
50
|
-
expect(persistedWorkstream?.attachments?.[0]).toMatchObject({
|
|
79
|
+
expect(persistedWorkstream?.attachments?.[0]).toMatchObject({
|
|
80
|
+
path: '/tmp/billing-brief.md',
|
|
81
|
+
fsPath: 'workspaces/workspace-1/assets/documents/asset-billing-brief.md',
|
|
82
|
+
caption: 'Billing brief',
|
|
83
|
+
displayName: 'Billing Brief',
|
|
84
|
+
originalFilename: 'billing-brief.md',
|
|
85
|
+
assetId: 'asset-billing-brief',
|
|
86
|
+
referenceNumber: 13,
|
|
87
|
+
referenceLabel: 'D-13',
|
|
88
|
+
});
|
|
51
89
|
expect(persistedTask?.workstreamId).toBe(workstream.id);
|
|
52
90
|
expect(persistedTask?.checklistItems?.map((item) => item.title)).toEqual([
|
|
53
91
|
'Update docs',
|
|
@@ -92,4 +130,380 @@ describe('TaskforceCore planning entity persistence', () => {
|
|
|
92
130
|
expect(clearedTask?.workstreamId).toBeNull();
|
|
93
131
|
core.close();
|
|
94
132
|
});
|
|
133
|
+
it('syncs canonical attachment links for initiatives and workstreams like task attachments do', () => {
|
|
134
|
+
const core = createCore();
|
|
135
|
+
const workspaceId = 'default';
|
|
136
|
+
const assetStore = core.getWorkspaceAssetStore();
|
|
137
|
+
assetStore.upsertAsset({
|
|
138
|
+
assetId: 'asset-initiative-doc',
|
|
139
|
+
workspaceId,
|
|
140
|
+
kind: 'document',
|
|
141
|
+
logicalName: 'Initiative context',
|
|
142
|
+
originalFilename: 'initiative-context.md',
|
|
143
|
+
mimeType: 'text/markdown',
|
|
144
|
+
storageProvider: 'local',
|
|
145
|
+
storageKey: 'workspaces/default/assets/documents/initiative-context.md',
|
|
146
|
+
contentSha256: 'sha-init',
|
|
147
|
+
sizeBytes: 120,
|
|
148
|
+
documentId: 'doc-initiative-context',
|
|
149
|
+
version: 1,
|
|
150
|
+
isLatest: 1,
|
|
151
|
+
});
|
|
152
|
+
assetStore.upsertAsset({
|
|
153
|
+
assetId: 'asset-workstream-doc',
|
|
154
|
+
workspaceId,
|
|
155
|
+
kind: 'document',
|
|
156
|
+
logicalName: 'Workstream context',
|
|
157
|
+
originalFilename: 'workstream-context.md',
|
|
158
|
+
mimeType: 'text/markdown',
|
|
159
|
+
storageProvider: 'local',
|
|
160
|
+
storageKey: 'workspaces/default/assets/documents/workstream-context.md',
|
|
161
|
+
contentSha256: 'sha-workstream',
|
|
162
|
+
sizeBytes: 140,
|
|
163
|
+
documentId: 'doc-workstream-context',
|
|
164
|
+
version: 1,
|
|
165
|
+
isLatest: 1,
|
|
166
|
+
});
|
|
167
|
+
const initiative = core.createInitiative({
|
|
168
|
+
title: 'Platform',
|
|
169
|
+
attachments: [{
|
|
170
|
+
path: '/api/taskforce/documents/asset-initiative-doc/content',
|
|
171
|
+
fsPath: 'workspaces/default/assets/documents/initiative-context.md',
|
|
172
|
+
caption: 'Initiative context',
|
|
173
|
+
assetId: 'asset-initiative-doc',
|
|
174
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
175
|
+
}],
|
|
176
|
+
}, workspaceId);
|
|
177
|
+
const workstream = core.createWorkstream({
|
|
178
|
+
title: 'Sync',
|
|
179
|
+
initiativeId: initiative.id,
|
|
180
|
+
attachments: [{
|
|
181
|
+
path: '/api/taskforce/documents/asset-workstream-doc/content',
|
|
182
|
+
fsPath: 'workspaces/default/assets/documents/workstream-context.md',
|
|
183
|
+
caption: 'Workstream context',
|
|
184
|
+
assetId: 'asset-workstream-doc',
|
|
185
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
186
|
+
}],
|
|
187
|
+
}, workspaceId);
|
|
188
|
+
expect(assetStore.listLinksForTarget('initiative', initiative.id, workspaceId)).toEqual([
|
|
189
|
+
expect.objectContaining({
|
|
190
|
+
assetId: 'asset-initiative-doc',
|
|
191
|
+
targetType: 'initiative',
|
|
192
|
+
targetId: initiative.id,
|
|
193
|
+
role: 'attachment',
|
|
194
|
+
})
|
|
195
|
+
]);
|
|
196
|
+
expect(assetStore.listLinksForTarget('workstream', workstream.id, workspaceId)).toEqual([
|
|
197
|
+
expect.objectContaining({
|
|
198
|
+
assetId: 'asset-workstream-doc',
|
|
199
|
+
targetType: 'workstream',
|
|
200
|
+
targetId: workstream.id,
|
|
201
|
+
role: 'attachment',
|
|
202
|
+
})
|
|
203
|
+
]);
|
|
204
|
+
core.updateInitiative(initiative.id, { attachments: [] }, workspaceId);
|
|
205
|
+
core.updateWorkstream(workstream.id, { attachments: [] }, workspaceId);
|
|
206
|
+
expect(assetStore.listLinksForTarget('initiative', initiative.id, workspaceId)).toEqual([]);
|
|
207
|
+
expect(assetStore.listLinksForTarget('initiative', initiative.id, workspaceId, { includeDeleted: true })).toEqual([
|
|
208
|
+
expect.objectContaining({
|
|
209
|
+
assetId: 'asset-initiative-doc',
|
|
210
|
+
deletedAt: expect.any(String),
|
|
211
|
+
})
|
|
212
|
+
]);
|
|
213
|
+
expect(assetStore.listLinksForTarget('workstream', workstream.id, workspaceId)).toEqual([]);
|
|
214
|
+
expect(assetStore.listLinksForTarget('workstream', workstream.id, workspaceId, { includeDeleted: true })).toEqual([
|
|
215
|
+
expect.objectContaining({
|
|
216
|
+
assetId: 'asset-workstream-doc',
|
|
217
|
+
deletedAt: expect.any(String),
|
|
218
|
+
})
|
|
219
|
+
]);
|
|
220
|
+
core.close();
|
|
221
|
+
});
|
|
222
|
+
it('syncs sparse canonical document attachment links by asset id for planning entities', () => {
|
|
223
|
+
const core = createCore();
|
|
224
|
+
const workspaceId = 'default';
|
|
225
|
+
const assetStore = core.getWorkspaceAssetStore();
|
|
226
|
+
assetStore.upsertAsset({
|
|
227
|
+
assetId: 'asset-sparse-initiative-doc',
|
|
228
|
+
workspaceId,
|
|
229
|
+
kind: 'document',
|
|
230
|
+
logicalName: 'Sparse initiative context',
|
|
231
|
+
originalFilename: 'sparse-initiative.md',
|
|
232
|
+
mimeType: 'text/markdown',
|
|
233
|
+
storageProvider: 'local',
|
|
234
|
+
storageKey: 'workspaces/default/assets/documents/sparse-initiative.md',
|
|
235
|
+
contentSha256: 'sha-sparse-initiative',
|
|
236
|
+
sizeBytes: 120,
|
|
237
|
+
documentId: 'doc-sparse-initiative',
|
|
238
|
+
version: 1,
|
|
239
|
+
isLatest: 1,
|
|
240
|
+
});
|
|
241
|
+
assetStore.upsertAsset({
|
|
242
|
+
assetId: 'asset-sparse-workstream-doc',
|
|
243
|
+
workspaceId,
|
|
244
|
+
kind: 'document',
|
|
245
|
+
logicalName: 'Sparse workstream context',
|
|
246
|
+
originalFilename: 'sparse-workstream.md',
|
|
247
|
+
mimeType: 'text/markdown',
|
|
248
|
+
storageProvider: 'local',
|
|
249
|
+
storageKey: 'workspaces/default/assets/documents/sparse-workstream.md',
|
|
250
|
+
contentSha256: 'sha-sparse-workstream',
|
|
251
|
+
sizeBytes: 140,
|
|
252
|
+
documentId: 'doc-sparse-workstream',
|
|
253
|
+
version: 1,
|
|
254
|
+
isLatest: 1,
|
|
255
|
+
});
|
|
256
|
+
const initiative = core.createInitiative({
|
|
257
|
+
title: 'Platform',
|
|
258
|
+
attachments: [{
|
|
259
|
+
path: '/api/taskforce/documents/asset-sparse-initiative-doc/content',
|
|
260
|
+
assetId: 'asset-sparse-initiative-doc',
|
|
261
|
+
caption: 'Sparse initiative context',
|
|
262
|
+
referenceLabel: 'D-101',
|
|
263
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
264
|
+
}],
|
|
265
|
+
}, workspaceId);
|
|
266
|
+
const workstream = core.createWorkstream({
|
|
267
|
+
title: 'Sync',
|
|
268
|
+
initiativeId: initiative.id,
|
|
269
|
+
attachments: [{
|
|
270
|
+
path: '/api/taskforce/documents/asset-sparse-workstream-doc/content',
|
|
271
|
+
assetId: 'asset-sparse-workstream-doc',
|
|
272
|
+
caption: 'Sparse workstream context',
|
|
273
|
+
referenceLabel: 'D-102',
|
|
274
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
275
|
+
}],
|
|
276
|
+
}, workspaceId);
|
|
277
|
+
expect(assetStore.listLinksForTarget('initiative', initiative.id, workspaceId)).toEqual([
|
|
278
|
+
expect.objectContaining({
|
|
279
|
+
assetId: 'asset-sparse-initiative-doc',
|
|
280
|
+
targetType: 'initiative',
|
|
281
|
+
targetId: initiative.id,
|
|
282
|
+
role: 'attachment',
|
|
283
|
+
})
|
|
284
|
+
]);
|
|
285
|
+
expect(assetStore.listLinksForTarget('workstream', workstream.id, workspaceId)).toEqual([
|
|
286
|
+
expect.objectContaining({
|
|
287
|
+
assetId: 'asset-sparse-workstream-doc',
|
|
288
|
+
targetType: 'workstream',
|
|
289
|
+
targetId: workstream.id,
|
|
290
|
+
role: 'attachment',
|
|
291
|
+
})
|
|
292
|
+
]);
|
|
293
|
+
core.close();
|
|
294
|
+
});
|
|
295
|
+
it('preserves planning attachments when sync upserts omit attachment fields', () => {
|
|
296
|
+
const core = createCore();
|
|
297
|
+
const workspaceId = 'default';
|
|
298
|
+
const assetStore = core.getWorkspaceAssetStore();
|
|
299
|
+
assetStore.upsertAsset({
|
|
300
|
+
assetId: 'asset-preserved-initiative-doc',
|
|
301
|
+
workspaceId,
|
|
302
|
+
kind: 'document',
|
|
303
|
+
logicalName: 'Preserved initiative context',
|
|
304
|
+
originalFilename: 'preserved-initiative.md',
|
|
305
|
+
mimeType: 'text/markdown',
|
|
306
|
+
storageProvider: 'local',
|
|
307
|
+
storageKey: 'workspaces/default/assets/documents/preserved-initiative.md',
|
|
308
|
+
contentSha256: 'sha-preserved-initiative',
|
|
309
|
+
sizeBytes: 120,
|
|
310
|
+
documentId: 'doc-preserved-initiative',
|
|
311
|
+
version: 1,
|
|
312
|
+
isLatest: 1,
|
|
313
|
+
});
|
|
314
|
+
assetStore.upsertAsset({
|
|
315
|
+
assetId: 'asset-preserved-workstream-doc',
|
|
316
|
+
workspaceId,
|
|
317
|
+
kind: 'document',
|
|
318
|
+
logicalName: 'Preserved workstream context',
|
|
319
|
+
originalFilename: 'preserved-workstream.md',
|
|
320
|
+
mimeType: 'text/markdown',
|
|
321
|
+
storageProvider: 'local',
|
|
322
|
+
storageKey: 'workspaces/default/assets/documents/preserved-workstream.md',
|
|
323
|
+
contentSha256: 'sha-preserved-workstream',
|
|
324
|
+
sizeBytes: 140,
|
|
325
|
+
documentId: 'doc-preserved-workstream',
|
|
326
|
+
version: 1,
|
|
327
|
+
isLatest: 1,
|
|
328
|
+
});
|
|
329
|
+
const initiative = core.createInitiative({
|
|
330
|
+
title: 'Platform',
|
|
331
|
+
attachments: [{
|
|
332
|
+
path: '/api/taskforce/documents/asset-preserved-initiative-doc/content',
|
|
333
|
+
assetId: 'asset-preserved-initiative-doc',
|
|
334
|
+
caption: 'Preserved initiative context',
|
|
335
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
336
|
+
}],
|
|
337
|
+
}, workspaceId);
|
|
338
|
+
const workstream = core.createWorkstream({
|
|
339
|
+
title: 'Sync',
|
|
340
|
+
initiativeId: initiative.id,
|
|
341
|
+
attachments: [{
|
|
342
|
+
path: '/api/taskforce/documents/asset-preserved-workstream-doc/content',
|
|
343
|
+
assetId: 'asset-preserved-workstream-doc',
|
|
344
|
+
caption: 'Preserved workstream context',
|
|
345
|
+
timestamp: '2026-01-01T00:00:00.000Z',
|
|
346
|
+
}],
|
|
347
|
+
}, workspaceId);
|
|
348
|
+
core.upsertInitiativeForSync({
|
|
349
|
+
id: initiative.id,
|
|
350
|
+
referenceNumber: initiative.referenceNumber,
|
|
351
|
+
title: 'Platform updated elsewhere',
|
|
352
|
+
description: initiative.description,
|
|
353
|
+
ownerId: initiative.ownerId,
|
|
354
|
+
createdAt: initiative.createdAt,
|
|
355
|
+
updatedAt: '2026-01-01T00:05:00.000Z',
|
|
356
|
+
order: initiative.order,
|
|
357
|
+
isArchived: false,
|
|
358
|
+
}, workspaceId);
|
|
359
|
+
core.upsertWorkstreamForSync({
|
|
360
|
+
id: workstream.id,
|
|
361
|
+
referenceNumber: workstream.referenceNumber,
|
|
362
|
+
initiativeId: initiative.id,
|
|
363
|
+
title: 'Sync updated elsewhere',
|
|
364
|
+
description: workstream.description,
|
|
365
|
+
ownerId: workstream.ownerId,
|
|
366
|
+
createdAt: workstream.createdAt,
|
|
367
|
+
updatedAt: '2026-01-01T00:05:00.000Z',
|
|
368
|
+
order: workstream.order,
|
|
369
|
+
isArchived: false,
|
|
370
|
+
}, workspaceId);
|
|
371
|
+
expect(core.getInitiative(initiative.id, workspaceId)?.attachments).toEqual([
|
|
372
|
+
expect.objectContaining({
|
|
373
|
+
assetId: 'asset-preserved-initiative-doc',
|
|
374
|
+
caption: 'Preserved initiative context',
|
|
375
|
+
})
|
|
376
|
+
]);
|
|
377
|
+
expect(core.getWorkstream(workstream.id, workspaceId)?.attachments).toEqual([
|
|
378
|
+
expect.objectContaining({
|
|
379
|
+
assetId: 'asset-preserved-workstream-doc',
|
|
380
|
+
caption: 'Preserved workstream context',
|
|
381
|
+
})
|
|
382
|
+
]);
|
|
383
|
+
expect(assetStore.listLinksForTarget('initiative', initiative.id, workspaceId)).toEqual([
|
|
384
|
+
expect.objectContaining({
|
|
385
|
+
assetId: 'asset-preserved-initiative-doc',
|
|
386
|
+
deletedAt: null,
|
|
387
|
+
})
|
|
388
|
+
]);
|
|
389
|
+
expect(assetStore.listLinksForTarget('workstream', workstream.id, workspaceId)).toEqual([
|
|
390
|
+
expect.objectContaining({
|
|
391
|
+
assetId: 'asset-preserved-workstream-doc',
|
|
392
|
+
deletedAt: null,
|
|
393
|
+
})
|
|
394
|
+
]);
|
|
395
|
+
core.close();
|
|
396
|
+
});
|
|
397
|
+
it('rejects stale planning sync upserts so older empty snapshots cannot clear newer attachments', () => {
|
|
398
|
+
const core = createCore();
|
|
399
|
+
const workspaceId = 'default';
|
|
400
|
+
const initiative = core.createInitiative({
|
|
401
|
+
title: 'Cloud initiative',
|
|
402
|
+
updatedAt: '2026-01-01T00:10:00.000Z',
|
|
403
|
+
attachments: [{
|
|
404
|
+
path: '/api/taskforce/documents/asset-newer-initiative-doc/content',
|
|
405
|
+
assetId: 'asset-newer-initiative-doc',
|
|
406
|
+
caption: 'Newer initiative doc',
|
|
407
|
+
timestamp: '2026-01-01T00:10:00.000Z',
|
|
408
|
+
}],
|
|
409
|
+
}, workspaceId);
|
|
410
|
+
const workstream = core.createWorkstream({
|
|
411
|
+
title: 'Cloud workstream',
|
|
412
|
+
initiativeId: initiative.id,
|
|
413
|
+
updatedAt: '2026-01-01T00:10:00.000Z',
|
|
414
|
+
attachments: [{
|
|
415
|
+
path: '/api/taskforce/documents/asset-newer-workstream-doc/content',
|
|
416
|
+
assetId: 'asset-newer-workstream-doc',
|
|
417
|
+
caption: 'Newer workstream doc',
|
|
418
|
+
timestamp: '2026-01-01T00:10:00.000Z',
|
|
419
|
+
}],
|
|
420
|
+
}, workspaceId);
|
|
421
|
+
core.upsertInitiativeForSync({
|
|
422
|
+
...initiative,
|
|
423
|
+
title: 'Stale initiative snapshot',
|
|
424
|
+
updatedAt: '2026-01-01T00:05:00.000Z',
|
|
425
|
+
attachments: [],
|
|
426
|
+
}, workspaceId);
|
|
427
|
+
core.upsertWorkstreamForSync({
|
|
428
|
+
...workstream,
|
|
429
|
+
title: 'Stale workstream snapshot',
|
|
430
|
+
updatedAt: '2026-01-01T00:05:00.000Z',
|
|
431
|
+
attachments: [],
|
|
432
|
+
}, workspaceId);
|
|
433
|
+
expect(core.getInitiative(initiative.id, workspaceId)).toEqual(expect.objectContaining({
|
|
434
|
+
title: 'Cloud initiative',
|
|
435
|
+
updatedAt: '2026-01-01T00:10:00.000Z',
|
|
436
|
+
attachments: [
|
|
437
|
+
expect.objectContaining({
|
|
438
|
+
assetId: 'asset-newer-initiative-doc',
|
|
439
|
+
caption: 'Newer initiative doc',
|
|
440
|
+
})
|
|
441
|
+
],
|
|
442
|
+
}));
|
|
443
|
+
expect(core.getWorkstream(workstream.id, workspaceId)).toEqual(expect.objectContaining({
|
|
444
|
+
title: 'Cloud workstream',
|
|
445
|
+
updatedAt: '2026-01-01T00:10:00.000Z',
|
|
446
|
+
attachments: [
|
|
447
|
+
expect.objectContaining({
|
|
448
|
+
assetId: 'asset-newer-workstream-doc',
|
|
449
|
+
caption: 'Newer workstream doc',
|
|
450
|
+
})
|
|
451
|
+
],
|
|
452
|
+
}));
|
|
453
|
+
core.close();
|
|
454
|
+
});
|
|
455
|
+
it('builds lightweight planning bootstrap summaries without hydrating full task details', () => {
|
|
456
|
+
const core = createCore();
|
|
457
|
+
const initiative = core.createInitiative({ title: 'Launch initiative' });
|
|
458
|
+
const deliveryWorkstream = core.createWorkstream({
|
|
459
|
+
title: 'Delivery',
|
|
460
|
+
initiativeId: initiative.id,
|
|
461
|
+
});
|
|
462
|
+
const billingWorkstream = core.createWorkstream({
|
|
463
|
+
title: 'Billing',
|
|
464
|
+
initiativeId: initiative.id,
|
|
465
|
+
});
|
|
466
|
+
core.createTask({
|
|
467
|
+
title: 'Ship onboarding copy',
|
|
468
|
+
workstreamId: deliveryWorkstream.id,
|
|
469
|
+
status: 'task',
|
|
470
|
+
});
|
|
471
|
+
core.createTask({
|
|
472
|
+
title: 'Review launch checklist',
|
|
473
|
+
workstreamId: deliveryWorkstream.id,
|
|
474
|
+
status: 'done',
|
|
475
|
+
});
|
|
476
|
+
core.createTask({
|
|
477
|
+
title: 'Update billing note',
|
|
478
|
+
workstreamId: billingWorkstream.id,
|
|
479
|
+
status: 'cancelled',
|
|
480
|
+
});
|
|
481
|
+
core.createTask({
|
|
482
|
+
title: 'Unlinked task',
|
|
483
|
+
status: 'task',
|
|
484
|
+
});
|
|
485
|
+
const bootstrap = core.listPlanningBootstrap();
|
|
486
|
+
const deliverySummary = bootstrap.workstreamTaskSummaries.find((entry) => entry.workstreamId === deliveryWorkstream.id);
|
|
487
|
+
const billingSummary = bootstrap.workstreamTaskSummaries.find((entry) => entry.workstreamId === billingWorkstream.id);
|
|
488
|
+
expect(bootstrap.initiatives.map((entry) => entry.id)).toEqual([initiative.id]);
|
|
489
|
+
expect(bootstrap.workstreams.map((entry) => entry.id)).toEqual([deliveryWorkstream.id, billingWorkstream.id]);
|
|
490
|
+
expect(bootstrap.initiatives.every((entry) => entry.activity === undefined && entry.entityEvents === undefined)).toBe(true);
|
|
491
|
+
expect(bootstrap.workstreams.every((entry) => entry.activity === undefined && entry.entityEvents === undefined)).toBe(true);
|
|
492
|
+
expect(deliverySummary).toMatchObject({
|
|
493
|
+
workstreamId: deliveryWorkstream.id,
|
|
494
|
+
taskCount: 2,
|
|
495
|
+
completedTaskCount: 1,
|
|
496
|
+
});
|
|
497
|
+
expect(deliverySummary?.tasks).toEqual(expect.arrayContaining([
|
|
498
|
+
expect.objectContaining({ title: 'Ship onboarding copy', status: 'task' }),
|
|
499
|
+
expect.objectContaining({ title: 'Review launch checklist', status: 'done' }),
|
|
500
|
+
]));
|
|
501
|
+
expect(billingSummary).toMatchObject({
|
|
502
|
+
workstreamId: billingWorkstream.id,
|
|
503
|
+
taskCount: 1,
|
|
504
|
+
completedTaskCount: 1,
|
|
505
|
+
});
|
|
506
|
+
expect(bootstrap.workstreamTaskSummaries.some((entry) => entry.tasks.some((task) => task.title === 'Unlinked task'))).toBe(false);
|
|
507
|
+
core.close();
|
|
508
|
+
});
|
|
95
509
|
});
|