@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { buildWorkspaceSyncPayloadModel, buildWorkspaceSyncSignatureModel } from './workspaceSyncModel';
|
|
3
|
+
import { aiProfileSyncResourceAdapter, taskSyncResourceAdapter } from './syncResourceAdapters';
|
|
3
4
|
describe('workspaceSyncModel', () => {
|
|
4
5
|
describe('buildWorkspaceSyncPayloadModel', () => {
|
|
5
6
|
it('emits document-delete when a previously pushed document path is now missing', () => {
|
|
@@ -20,6 +21,28 @@ describe('workspaceSyncModel', () => {
|
|
|
20
21
|
expect.objectContaining({ op: 'document-delete', path: 'docs/remove.md' })
|
|
21
22
|
]));
|
|
22
23
|
});
|
|
24
|
+
it('does not emit document-delete when a canonical path is still known but missing from the readable snapshot', () => {
|
|
25
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
26
|
+
tasks: [],
|
|
27
|
+
archivedTasks: [],
|
|
28
|
+
lastPushedTaskIds: new Set(),
|
|
29
|
+
pendingDeletedTaskIds: new Set(),
|
|
30
|
+
documents: [
|
|
31
|
+
{ path: 'docs/keep.md', updatedAt: '2026-02-01T00:00:00.000Z', content: 'keep' }
|
|
32
|
+
],
|
|
33
|
+
currentDocumentPaths: new Set(['docs/keep.md', 'docs/missing-content.md']),
|
|
34
|
+
lastPushedDocumentPaths: new Set(['docs/keep.md', 'docs/missing-content.md', 'docs/remove.md'])
|
|
35
|
+
});
|
|
36
|
+
expect(Array.from(payload.currentDocumentPaths).sort()).toEqual(['docs/keep.md', 'docs/missing-content.md']);
|
|
37
|
+
expect(Array.from(payload.deleteDocumentPaths).sort()).toEqual(['docs/remove.md']);
|
|
38
|
+
expect(payload.changes).toEqual(expect.arrayContaining([
|
|
39
|
+
expect.objectContaining({ op: 'document-upsert', path: 'docs/keep.md' }),
|
|
40
|
+
expect.objectContaining({ op: 'document-delete', path: 'docs/remove.md' })
|
|
41
|
+
]));
|
|
42
|
+
expect(payload.changes).not.toEqual(expect.arrayContaining([
|
|
43
|
+
expect.objectContaining({ op: 'document-delete', path: 'docs/missing-content.md' })
|
|
44
|
+
]));
|
|
45
|
+
});
|
|
23
46
|
it('emits task-event-upsert changes for new activity events and tracks event watermarks', () => {
|
|
24
47
|
const payload = buildWorkspaceSyncPayloadModel({
|
|
25
48
|
tasks: [],
|
|
@@ -27,6 +50,8 @@ describe('workspaceSyncModel', () => {
|
|
|
27
50
|
taskEvents: [
|
|
28
51
|
{
|
|
29
52
|
id: 'task-event-1',
|
|
53
|
+
entityType: 'task',
|
|
54
|
+
entityId: 'task-1',
|
|
30
55
|
taskId: 'task-1',
|
|
31
56
|
workspaceId: 'workspace-a',
|
|
32
57
|
action: 'task-status-changed',
|
|
@@ -68,6 +93,8 @@ describe('workspaceSyncModel', () => {
|
|
|
68
93
|
taskEvents: [
|
|
69
94
|
{
|
|
70
95
|
id: 'task-event-keep',
|
|
96
|
+
entityType: 'task',
|
|
97
|
+
entityId: 'task-1',
|
|
71
98
|
taskId: 'task-1',
|
|
72
99
|
workspaceId: 'workspace-a',
|
|
73
100
|
action: 'task-status-changed',
|
|
@@ -77,6 +104,8 @@ describe('workspaceSyncModel', () => {
|
|
|
77
104
|
},
|
|
78
105
|
{
|
|
79
106
|
id: 'task-event-new',
|
|
107
|
+
entityType: 'task',
|
|
108
|
+
entityId: 'task-2',
|
|
80
109
|
taskId: 'task-2',
|
|
81
110
|
workspaceId: 'workspace-a',
|
|
82
111
|
action: 'task-archived',
|
|
@@ -124,6 +153,67 @@ describe('workspaceSyncModel', () => {
|
|
|
124
153
|
['docs/new.md', '2026-02-03T00:00:00.000Z']
|
|
125
154
|
]);
|
|
126
155
|
});
|
|
156
|
+
it('emits a document upsert when a synced document receives a newer task link', () => {
|
|
157
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
158
|
+
tasks: [],
|
|
159
|
+
archivedTasks: [],
|
|
160
|
+
lastPushedTaskIds: new Set(),
|
|
161
|
+
pendingDeletedTaskIds: new Set(),
|
|
162
|
+
documents: [
|
|
163
|
+
{
|
|
164
|
+
path: 'workspaces/default/assets/documents/asset-doc-1-notes.md',
|
|
165
|
+
updatedAt: '2026-03-18T14:45:00.000Z',
|
|
166
|
+
content: '# Notes',
|
|
167
|
+
assetId: 'asset-doc-1',
|
|
168
|
+
documentId: 'doc-1',
|
|
169
|
+
referenceNumber: 8,
|
|
170
|
+
version: 1,
|
|
171
|
+
taskId: 'task-attach-1',
|
|
172
|
+
originalFilename: 'notes.md',
|
|
173
|
+
linkRole: 'attachment'
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
lastPushedDocumentPaths: new Set(['workspaces/default/assets/documents/asset-doc-1-notes.md']),
|
|
177
|
+
lastPushedDocumentWatermarks: new Map([
|
|
178
|
+
['workspaces/default/assets/documents/asset-doc-1-notes.md', '2026-03-18T13:30:00.000Z']
|
|
179
|
+
])
|
|
180
|
+
});
|
|
181
|
+
expect(payload.changes).toEqual(expect.arrayContaining([
|
|
182
|
+
expect.objectContaining({
|
|
183
|
+
op: 'document-upsert',
|
|
184
|
+
path: 'workspaces/default/assets/documents/asset-doc-1-notes.md',
|
|
185
|
+
updatedAt: '2026-03-18T14:45:00.000Z',
|
|
186
|
+
taskId: 'task-attach-1',
|
|
187
|
+
linkRole: 'attachment'
|
|
188
|
+
})
|
|
189
|
+
]));
|
|
190
|
+
});
|
|
191
|
+
it('reports send-all diagnostics when a domain has no baseline', () => {
|
|
192
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
193
|
+
tasks: [],
|
|
194
|
+
archivedTasks: [],
|
|
195
|
+
lastPushedTaskIds: new Set(),
|
|
196
|
+
pendingDeletedTaskIds: new Set(),
|
|
197
|
+
documents: [
|
|
198
|
+
{ path: 'docs/a.md', updatedAt: '2026-02-01T00:00:00.000Z', content: 'a' },
|
|
199
|
+
{ path: 'docs/b.md', updatedAt: '2026-02-02T00:00:00.000Z', content: 'b' }
|
|
200
|
+
],
|
|
201
|
+
baselineResetReason: 'repair-reset'
|
|
202
|
+
});
|
|
203
|
+
expect(payload.deltaDiagnostics).toEqual(expect.objectContaining({
|
|
204
|
+
totalChanges: 2,
|
|
205
|
+
domains: expect.objectContaining({
|
|
206
|
+
documents: expect.objectContaining({
|
|
207
|
+
mode: 'send-all',
|
|
208
|
+
reason: 'repair-reset',
|
|
209
|
+
currentCount: 2,
|
|
210
|
+
baselineCount: 0,
|
|
211
|
+
changeCount: 2
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
}));
|
|
215
|
+
expect(payload.deltaDiagnostics?.byOp['document-upsert']).toBe(2);
|
|
216
|
+
});
|
|
127
217
|
it('preserves canonical document metadata on document-upsert changes', () => {
|
|
128
218
|
const payload = buildWorkspaceSyncPayloadModel({
|
|
129
219
|
tasks: [],
|
|
@@ -196,6 +286,47 @@ describe('workspaceSyncModel', () => {
|
|
|
196
286
|
})
|
|
197
287
|
]));
|
|
198
288
|
});
|
|
289
|
+
it('does not emit asset-delete when a canonical asset path is still known but missing from the readable snapshot', () => {
|
|
290
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
291
|
+
tasks: [],
|
|
292
|
+
archivedTasks: [],
|
|
293
|
+
lastPushedTaskIds: new Set(),
|
|
294
|
+
pendingDeletedTaskIds: new Set(),
|
|
295
|
+
assets: [
|
|
296
|
+
{
|
|
297
|
+
path: 'workspaces/default/assets/images/asset-image-1-diagram.png',
|
|
298
|
+
updatedAt: '2026-03-17T12:00:00.000Z',
|
|
299
|
+
contentBase64: 'aW1hZ2UtYnl0ZXM=',
|
|
300
|
+
assetId: 'asset-image-1',
|
|
301
|
+
kind: 'image',
|
|
302
|
+
mimeType: 'image/png',
|
|
303
|
+
taskId: 'task-1',
|
|
304
|
+
originalFilename: 'diagram.png',
|
|
305
|
+
linkRole: 'image'
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
currentAssetPaths: new Set([
|
|
309
|
+
'workspaces/default/assets/images/asset-image-1-diagram.png',
|
|
310
|
+
'workspaces/default/assets/files/asset-file-missing.pdf'
|
|
311
|
+
]),
|
|
312
|
+
lastPushedAssetPaths: new Set([
|
|
313
|
+
'workspaces/default/assets/images/asset-image-1-diagram.png',
|
|
314
|
+
'workspaces/default/assets/files/asset-file-missing.pdf',
|
|
315
|
+
'workspaces/default/assets/files/asset-file-old-document.pdf'
|
|
316
|
+
])
|
|
317
|
+
});
|
|
318
|
+
expect(Array.from(payload.currentAssetPaths).sort()).toEqual([
|
|
319
|
+
'workspaces/default/assets/files/asset-file-missing.pdf',
|
|
320
|
+
'workspaces/default/assets/images/asset-image-1-diagram.png'
|
|
321
|
+
]);
|
|
322
|
+
expect(Array.from(payload.deleteAssetPaths)).toEqual(['workspaces/default/assets/files/asset-file-old-document.pdf']);
|
|
323
|
+
expect(payload.changes).not.toEqual(expect.arrayContaining([
|
|
324
|
+
expect.objectContaining({
|
|
325
|
+
op: 'asset-delete',
|
|
326
|
+
path: 'workspaces/default/assets/files/asset-file-missing.pdf'
|
|
327
|
+
})
|
|
328
|
+
]));
|
|
329
|
+
});
|
|
199
330
|
it('emits timestamped task deletes for previously pushed tasks that are now missing', () => {
|
|
200
331
|
const payload = buildWorkspaceSyncPayloadModel({
|
|
201
332
|
tasks: [],
|
|
@@ -277,6 +408,7 @@ describe('workspaceSyncModel', () => {
|
|
|
277
408
|
provider: 'OpenAI',
|
|
278
409
|
model: 'gpt-5.4',
|
|
279
410
|
surfaceType: 'coding_tool',
|
|
411
|
+
rosterStateUpdatedAt: '2026-03-22T10:00:00.000Z',
|
|
280
412
|
createdAt: '2026-03-22T10:00:00.000Z',
|
|
281
413
|
updatedAt: '2026-03-22T10:05:00.000Z',
|
|
282
414
|
lastActiveAt: '2026-03-22T10:05:00.000Z'
|
|
@@ -293,14 +425,51 @@ describe('workspaceSyncModel', () => {
|
|
|
293
425
|
role: 'Implementer',
|
|
294
426
|
provider: 'OpenAI',
|
|
295
427
|
model: 'gpt-5.4',
|
|
296
|
-
surfaceType: 'coding_tool'
|
|
428
|
+
surfaceType: 'coding_tool',
|
|
429
|
+
avatarRevision: 0,
|
|
430
|
+
avatarUpdatedAt: null,
|
|
431
|
+
rosterStateUpdatedAt: '2026-03-22T10:00:00.000Z'
|
|
297
432
|
})
|
|
298
433
|
})
|
|
299
434
|
]));
|
|
300
435
|
expect(Array.from(payload.currentAiProfileIds)).toEqual(['ai-profile-1']);
|
|
301
436
|
expect(payload.currentAiProfileWatermarks.get('ai-profile-1')).toBe('2026-03-22T10:05:00.000Z');
|
|
302
437
|
});
|
|
303
|
-
it('filters unchanged ai profiles when ai
|
|
438
|
+
it('filters unchanged ai profiles when ai change-key state already matches', () => {
|
|
439
|
+
const profile = {
|
|
440
|
+
id: 'ai-profile-1',
|
|
441
|
+
workspaceId: 'ws-1',
|
|
442
|
+
profileToken: 'tfp_test',
|
|
443
|
+
name: 'Codex',
|
|
444
|
+
username: 'codex',
|
|
445
|
+
icon: 'Bot',
|
|
446
|
+
color: '#0ea5e9',
|
|
447
|
+
description: 'Terminal-first coding agent',
|
|
448
|
+
role: 'Implementer',
|
|
449
|
+
provider: 'OpenAI',
|
|
450
|
+
model: 'gpt-5.4',
|
|
451
|
+
surfaceType: 'coding_tool',
|
|
452
|
+
rosterStateUpdatedAt: '2026-03-22T10:00:00.000Z',
|
|
453
|
+
createdAt: '2026-03-22T10:00:00.000Z',
|
|
454
|
+
updatedAt: '2026-03-22T10:05:00.000Z',
|
|
455
|
+
lastActiveAt: '2026-03-22T10:05:00.000Z'
|
|
456
|
+
};
|
|
457
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
458
|
+
tasks: [],
|
|
459
|
+
archivedTasks: [],
|
|
460
|
+
lastPushedTaskIds: new Set(),
|
|
461
|
+
pendingDeletedTaskIds: new Set(),
|
|
462
|
+
aiProfiles: [profile],
|
|
463
|
+
lastPushedAiProfileIds: new Set(['ai-profile-1']),
|
|
464
|
+
lastPushedAiProfileWatermarks: new Map([['ai-profile-1', '2026-03-22T10:05:00.000Z']]),
|
|
465
|
+
lastPushedAiProfileChangeKeys: new Map([
|
|
466
|
+
['ai-profile-1', aiProfileSyncResourceAdapter.getChangeKey(profile)]
|
|
467
|
+
])
|
|
468
|
+
});
|
|
469
|
+
expect(payload.changes.some((change) => change.op === 'ai-profile-upsert')).toBe(false);
|
|
470
|
+
expect(Array.from(payload.currentAiProfileIds)).toEqual(['ai-profile-1']);
|
|
471
|
+
});
|
|
472
|
+
it('resends ai profiles when a legacy watermark did not include avatar fields', () => {
|
|
304
473
|
const payload = buildWorkspaceSyncPayloadModel({
|
|
305
474
|
tasks: [],
|
|
306
475
|
archivedTasks: [],
|
|
@@ -315,11 +484,16 @@ describe('workspaceSyncModel', () => {
|
|
|
315
484
|
username: 'codex',
|
|
316
485
|
icon: 'Bot',
|
|
317
486
|
color: '#0ea5e9',
|
|
487
|
+
avatarUrl: '/api/taskforce/context/workspaces%2Fws-1%2Fassets%2Fimages%2Fai-profiles%2Fai-profile-1%2Favatar%2Favatar.webp',
|
|
488
|
+
avatarSourceUrl: '/api/taskforce/context/workspaces%2Fws-1%2Fassets%2Fimages%2Fai-profiles%2Fai-profile-1%2Favatar%2Fsource.webp',
|
|
489
|
+
avatarRevision: 1,
|
|
490
|
+
avatarUpdatedAt: '2026-03-22T10:04:00.000Z',
|
|
318
491
|
description: 'Terminal-first coding agent',
|
|
319
492
|
role: 'Implementer',
|
|
320
493
|
provider: 'OpenAI',
|
|
321
494
|
model: 'gpt-5.4',
|
|
322
495
|
surfaceType: 'coding_tool',
|
|
496
|
+
rosterStateUpdatedAt: '2026-03-22T10:00:00.000Z',
|
|
323
497
|
createdAt: '2026-03-22T10:00:00.000Z',
|
|
324
498
|
updatedAt: '2026-03-22T10:05:00.000Z',
|
|
325
499
|
lastActiveAt: '2026-03-22T10:05:00.000Z'
|
|
@@ -328,8 +502,86 @@ describe('workspaceSyncModel', () => {
|
|
|
328
502
|
lastPushedAiProfileIds: new Set(['ai-profile-1']),
|
|
329
503
|
lastPushedAiProfileWatermarks: new Map([['ai-profile-1', '2026-03-22T10:05:00.000Z']])
|
|
330
504
|
});
|
|
331
|
-
expect(payload.changes.
|
|
332
|
-
|
|
505
|
+
expect(payload.changes).toEqual(expect.arrayContaining([
|
|
506
|
+
expect.objectContaining({
|
|
507
|
+
op: 'ai-profile-upsert',
|
|
508
|
+
profile: expect.objectContaining({
|
|
509
|
+
id: 'ai-profile-1',
|
|
510
|
+
avatarUrl: expect.stringContaining('/api/taskforce/context/'),
|
|
511
|
+
avatarSourceUrl: expect.stringContaining('/api/taskforce/context/'),
|
|
512
|
+
avatarRevision: 1,
|
|
513
|
+
avatarUpdatedAt: '2026-03-22T10:04:00.000Z'
|
|
514
|
+
})
|
|
515
|
+
})
|
|
516
|
+
]));
|
|
517
|
+
expect(payload.currentAiProfileWatermarks.get('ai-profile-1')).toBe('2026-03-22T10:05:00.000Z');
|
|
518
|
+
expect(payload.currentAiProfileChangeKeys?.get('ai-profile-1')).toBe(aiProfileSyncResourceAdapter.getChangeKey({
|
|
519
|
+
id: 'ai-profile-1',
|
|
520
|
+
workspaceId: 'ws-1',
|
|
521
|
+
profileToken: 'tfp_test',
|
|
522
|
+
name: 'Codex',
|
|
523
|
+
username: 'codex',
|
|
524
|
+
icon: 'Bot',
|
|
525
|
+
color: '#0ea5e9',
|
|
526
|
+
avatarUrl: '/api/taskforce/context/workspaces%2Fws-1%2Fassets%2Fimages%2Fai-profiles%2Fai-profile-1%2Favatar%2Favatar.webp',
|
|
527
|
+
avatarSourceUrl: '/api/taskforce/context/workspaces%2Fws-1%2Fassets%2Fimages%2Fai-profiles%2Fai-profile-1%2Favatar%2Fsource.webp',
|
|
528
|
+
avatarRevision: 1,
|
|
529
|
+
avatarUpdatedAt: '2026-03-22T10:04:00.000Z',
|
|
530
|
+
description: 'Terminal-first coding agent',
|
|
531
|
+
role: 'Implementer',
|
|
532
|
+
provider: 'OpenAI',
|
|
533
|
+
model: 'gpt-5.4',
|
|
534
|
+
surfaceType: 'coding_tool',
|
|
535
|
+
rosterStateUpdatedAt: '2026-03-22T10:00:00.000Z',
|
|
536
|
+
createdAt: '2026-03-22T10:00:00.000Z',
|
|
537
|
+
updatedAt: '2026-03-22T10:05:00.000Z',
|
|
538
|
+
lastActiveAt: '2026-03-22T10:05:00.000Z'
|
|
539
|
+
}));
|
|
540
|
+
});
|
|
541
|
+
it('resends ai profiles when lifecycle state advances beyond metadata updatedAt', () => {
|
|
542
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
543
|
+
tasks: [],
|
|
544
|
+
archivedTasks: [],
|
|
545
|
+
lastPushedTaskIds: new Set(),
|
|
546
|
+
pendingDeletedTaskIds: new Set(),
|
|
547
|
+
aiProfiles: [
|
|
548
|
+
{
|
|
549
|
+
id: 'ai-profile-1',
|
|
550
|
+
workspaceId: 'ws-1',
|
|
551
|
+
profileToken: 'tfp_test',
|
|
552
|
+
name: 'Codex',
|
|
553
|
+
username: 'codex',
|
|
554
|
+
icon: 'Bot',
|
|
555
|
+
color: '#0ea5e9',
|
|
556
|
+
description: 'Terminal-first coding agent',
|
|
557
|
+
role: 'Implementer',
|
|
558
|
+
provider: 'OpenAI',
|
|
559
|
+
model: 'gpt-5.4',
|
|
560
|
+
surfaceType: 'coding_tool',
|
|
561
|
+
archivedAt: '2026-03-22T10:10:00.000Z',
|
|
562
|
+
archivedBy: 'owner-1',
|
|
563
|
+
archivedReason: 'manual_archive',
|
|
564
|
+
rosterStateUpdatedAt: '2026-03-22T10:10:00.000Z',
|
|
565
|
+
createdAt: '2026-03-22T10:00:00.000Z',
|
|
566
|
+
updatedAt: '2026-03-22T10:05:00.000Z',
|
|
567
|
+
lastActiveAt: '2026-03-22T10:05:00.000Z'
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
lastPushedAiProfileIds: new Set(['ai-profile-1']),
|
|
571
|
+
lastPushedAiProfileWatermarks: new Map([['ai-profile-1', '2026-03-22T10:05:00.000Z']])
|
|
572
|
+
});
|
|
573
|
+
expect(payload.changes).toEqual(expect.arrayContaining([
|
|
574
|
+
expect.objectContaining({
|
|
575
|
+
op: 'ai-profile-upsert',
|
|
576
|
+
profile: expect.objectContaining({
|
|
577
|
+
id: 'ai-profile-1',
|
|
578
|
+
archivedAt: '2026-03-22T10:10:00.000Z',
|
|
579
|
+
rosterStateUpdatedAt: '2026-03-22T10:10:00.000Z',
|
|
580
|
+
updatedAt: '2026-03-22T10:05:00.000Z'
|
|
581
|
+
})
|
|
582
|
+
})
|
|
583
|
+
]));
|
|
584
|
+
expect(payload.currentAiProfileWatermarks.get('ai-profile-1')).toBe('2026-03-22T10:10:00.000Z');
|
|
333
585
|
});
|
|
334
586
|
it('emits initiative and workstream upserts and tracks their watermarks', () => {
|
|
335
587
|
const payload = buildWorkspaceSyncPayloadModel({
|
|
@@ -347,6 +599,12 @@ describe('workspaceSyncModel', () => {
|
|
|
347
599
|
createdAt: '2026-03-29T10:00:00.000Z',
|
|
348
600
|
updatedAt: '2026-03-29T11:00:00.000Z',
|
|
349
601
|
order: 1,
|
|
602
|
+
attachments: [{
|
|
603
|
+
path: 'workspaces/ws-1/assets/documents/asset-in.md',
|
|
604
|
+
assetId: 'asset-in',
|
|
605
|
+
referenceLabel: 'D-31',
|
|
606
|
+
caption: 'Revenue context'
|
|
607
|
+
}],
|
|
350
608
|
isArchived: false
|
|
351
609
|
}],
|
|
352
610
|
workstreams: [{
|
|
@@ -360,6 +618,12 @@ describe('workspaceSyncModel', () => {
|
|
|
360
618
|
createdAt: '2026-03-29T10:30:00.000Z',
|
|
361
619
|
updatedAt: '2026-03-29T11:30:00.000Z',
|
|
362
620
|
order: 2,
|
|
621
|
+
attachments: [{
|
|
622
|
+
path: 'workspaces/ws-1/assets/documents/asset-ws.md',
|
|
623
|
+
assetId: 'asset-ws',
|
|
624
|
+
referenceLabel: 'D-32',
|
|
625
|
+
caption: 'Checkout context'
|
|
626
|
+
}],
|
|
363
627
|
isArchived: false
|
|
364
628
|
}]
|
|
365
629
|
});
|
|
@@ -368,7 +632,13 @@ describe('workspaceSyncModel', () => {
|
|
|
368
632
|
op: 'initiative-upsert',
|
|
369
633
|
initiative: expect.objectContaining({
|
|
370
634
|
id: 'initiative-1',
|
|
371
|
-
title: 'Revenue Expansion'
|
|
635
|
+
title: 'Revenue Expansion',
|
|
636
|
+
attachments: expect.arrayContaining([
|
|
637
|
+
expect.objectContaining({
|
|
638
|
+
path: 'workspaces/ws-1/assets/documents/asset-in.md',
|
|
639
|
+
referenceLabel: 'D-31'
|
|
640
|
+
})
|
|
641
|
+
])
|
|
372
642
|
})
|
|
373
643
|
}),
|
|
374
644
|
expect.objectContaining({
|
|
@@ -376,7 +646,13 @@ describe('workspaceSyncModel', () => {
|
|
|
376
646
|
workstream: expect.objectContaining({
|
|
377
647
|
id: 'workstream-1',
|
|
378
648
|
initiativeId: 'initiative-1',
|
|
379
|
-
title: 'Checkout UX'
|
|
649
|
+
title: 'Checkout UX',
|
|
650
|
+
attachments: expect.arrayContaining([
|
|
651
|
+
expect.objectContaining({
|
|
652
|
+
path: 'workspaces/ws-1/assets/documents/asset-ws.md',
|
|
653
|
+
referenceLabel: 'D-32'
|
|
654
|
+
})
|
|
655
|
+
])
|
|
380
656
|
})
|
|
381
657
|
})
|
|
382
658
|
]));
|
|
@@ -561,6 +837,138 @@ describe('workspaceSyncModel', () => {
|
|
|
561
837
|
})
|
|
562
838
|
]));
|
|
563
839
|
});
|
|
840
|
+
it('does not resend already-acknowledged deleted collaboration records', () => {
|
|
841
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
842
|
+
tasks: [],
|
|
843
|
+
archivedTasks: [],
|
|
844
|
+
lastPushedTaskIds: new Set(),
|
|
845
|
+
pendingDeletedTaskIds: new Set(),
|
|
846
|
+
documentReviewSessions: [
|
|
847
|
+
{
|
|
848
|
+
id: 'review-deleted',
|
|
849
|
+
assetId: 'asset-doc-1',
|
|
850
|
+
documentId: 'doc-1',
|
|
851
|
+
documentVersion: 2,
|
|
852
|
+
title: 'Review',
|
|
853
|
+
status: 'open',
|
|
854
|
+
comments: [],
|
|
855
|
+
createdByActorId: null,
|
|
856
|
+
updatedByActorId: null,
|
|
857
|
+
createdAt: '2026-03-24T10:00:00.000Z',
|
|
858
|
+
updatedAt: '2026-03-24T10:05:00.000Z',
|
|
859
|
+
deletedAt: '2026-03-24T10:06:00.000Z'
|
|
860
|
+
}
|
|
861
|
+
],
|
|
862
|
+
documentReviewComments: [
|
|
863
|
+
{
|
|
864
|
+
id: 'comment-deleted',
|
|
865
|
+
sessionId: 'review-deleted',
|
|
866
|
+
body: 'Delete me.',
|
|
867
|
+
anchor: { kind: 'document' },
|
|
868
|
+
order: 0,
|
|
869
|
+
authorActorId: null,
|
|
870
|
+
createdAt: '2026-03-24T10:00:00.000Z',
|
|
871
|
+
updatedAt: '2026-03-24T10:05:00.000Z',
|
|
872
|
+
deletedAt: '2026-03-24T10:06:30.000Z'
|
|
873
|
+
}
|
|
874
|
+
],
|
|
875
|
+
annotatedAttachmentSessions: [
|
|
876
|
+
{
|
|
877
|
+
id: 'annotation-deleted',
|
|
878
|
+
workspaceId: 'ws-1',
|
|
879
|
+
taskId: 'task-1',
|
|
880
|
+
baseImageAssetId: 'asset-image-1',
|
|
881
|
+
title: 'Annotations',
|
|
882
|
+
globalInstruction: null,
|
|
883
|
+
annotations: [],
|
|
884
|
+
createdByActorId: null,
|
|
885
|
+
updatedByActorId: null,
|
|
886
|
+
createdAt: '2026-03-24T10:00:00.000Z',
|
|
887
|
+
updatedAt: '2026-03-24T10:05:00.000Z',
|
|
888
|
+
deletedAt: '2026-03-24T10:07:00.000Z'
|
|
889
|
+
}
|
|
890
|
+
],
|
|
891
|
+
lastPushedDocumentReviewSessionIds: new Set(),
|
|
892
|
+
lastPushedDocumentReviewSessionWatermarks: new Map([
|
|
893
|
+
['review-deleted', '2026-03-24T10:06:00.000Z']
|
|
894
|
+
]),
|
|
895
|
+
lastPushedDocumentReviewCommentIds: new Set(),
|
|
896
|
+
lastPushedDocumentReviewCommentWatermarks: new Map([
|
|
897
|
+
['comment-deleted', '2026-03-24T10:06:30.000Z']
|
|
898
|
+
]),
|
|
899
|
+
lastPushedAnnotatedAttachmentSessionIds: new Set(),
|
|
900
|
+
lastPushedAnnotatedAttachmentSessionWatermarks: new Map([
|
|
901
|
+
['annotation-deleted', '2026-03-24T10:07:00.000Z']
|
|
902
|
+
])
|
|
903
|
+
});
|
|
904
|
+
expect(payload.currentDocumentReviewSessionWatermarks.get('review-deleted')).toBe('2026-03-24T10:06:00.000Z');
|
|
905
|
+
expect(payload.currentDocumentReviewCommentWatermarks.get('comment-deleted')).toBe('2026-03-24T10:06:30.000Z');
|
|
906
|
+
expect(payload.currentAnnotatedAttachmentSessionWatermarks.get('annotation-deleted')).toBe('2026-03-24T10:07:00.000Z');
|
|
907
|
+
expect(payload.changes).not.toEqual(expect.arrayContaining([
|
|
908
|
+
expect.objectContaining({ op: 'document-review-session-delete', sessionId: 'review-deleted' }),
|
|
909
|
+
expect.objectContaining({ op: 'document-review-comment-delete', commentId: 'comment-deleted' }),
|
|
910
|
+
expect.objectContaining({ op: 'annotated-attachment-session-delete', sessionId: 'annotation-deleted' })
|
|
911
|
+
]));
|
|
912
|
+
expect(payload.deltaDiagnostics?.domains.documentReviewSessions.changeCount).toBe(0);
|
|
913
|
+
expect(payload.deltaDiagnostics?.domains.documentReviewComments.changeCount).toBe(0);
|
|
914
|
+
expect(payload.deltaDiagnostics?.domains.annotatedAttachmentSessions.changeCount).toBe(0);
|
|
915
|
+
});
|
|
916
|
+
it('emits a single delete op when a previously pushed collaboration record is now soft-deleted', () => {
|
|
917
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
918
|
+
tasks: [],
|
|
919
|
+
archivedTasks: [],
|
|
920
|
+
lastPushedTaskIds: new Set(),
|
|
921
|
+
pendingDeletedTaskIds: new Set(),
|
|
922
|
+
documentReviewSessions: [{
|
|
923
|
+
id: 'review-deleted',
|
|
924
|
+
assetId: 'asset-doc-1',
|
|
925
|
+
documentId: 'doc-1',
|
|
926
|
+
documentVersion: 2,
|
|
927
|
+
title: 'Review',
|
|
928
|
+
status: 'open',
|
|
929
|
+
comments: [],
|
|
930
|
+
createdByActorId: null,
|
|
931
|
+
updatedByActorId: null,
|
|
932
|
+
createdAt: '2026-03-24T10:00:00.000Z',
|
|
933
|
+
updatedAt: '2026-03-24T10:05:00.000Z',
|
|
934
|
+
deletedAt: '2026-03-24T10:06:00.000Z'
|
|
935
|
+
}],
|
|
936
|
+
documentReviewComments: [{
|
|
937
|
+
id: 'comment-deleted',
|
|
938
|
+
sessionId: 'review-deleted',
|
|
939
|
+
body: 'Delete me.',
|
|
940
|
+
anchor: { kind: 'document' },
|
|
941
|
+
order: 0,
|
|
942
|
+
authorActorId: null,
|
|
943
|
+
createdAt: '2026-03-24T10:00:00.000Z',
|
|
944
|
+
updatedAt: '2026-03-24T10:05:00.000Z',
|
|
945
|
+
deletedAt: '2026-03-24T10:06:30.000Z'
|
|
946
|
+
}],
|
|
947
|
+
annotatedAttachmentSessions: [{
|
|
948
|
+
id: 'annotation-deleted',
|
|
949
|
+
workspaceId: 'ws-1',
|
|
950
|
+
taskId: 'task-1',
|
|
951
|
+
baseImageAssetId: 'asset-image-1',
|
|
952
|
+
title: 'Annotations',
|
|
953
|
+
globalInstruction: null,
|
|
954
|
+
annotations: [],
|
|
955
|
+
createdByActorId: null,
|
|
956
|
+
updatedByActorId: null,
|
|
957
|
+
createdAt: '2026-03-24T10:00:00.000Z',
|
|
958
|
+
updatedAt: '2026-03-24T10:05:00.000Z',
|
|
959
|
+
deletedAt: '2026-03-24T10:07:00.000Z'
|
|
960
|
+
}],
|
|
961
|
+
lastPushedDocumentReviewSessionIds: new Set(['review-deleted']),
|
|
962
|
+
lastPushedDocumentReviewSessionWatermarks: new Map(),
|
|
963
|
+
lastPushedDocumentReviewCommentIds: new Set(['comment-deleted']),
|
|
964
|
+
lastPushedDocumentReviewCommentWatermarks: new Map(),
|
|
965
|
+
lastPushedAnnotatedAttachmentSessionIds: new Set(['annotation-deleted']),
|
|
966
|
+
lastPushedAnnotatedAttachmentSessionWatermarks: new Map()
|
|
967
|
+
});
|
|
968
|
+
expect(payload.changes.filter((change) => change.op === 'document-review-session-delete')).toHaveLength(1);
|
|
969
|
+
expect(payload.changes.filter((change) => change.op === 'document-review-comment-delete')).toHaveLength(1);
|
|
970
|
+
expect(payload.changes.filter((change) => change.op === 'annotated-attachment-session-delete')).toHaveLength(1);
|
|
971
|
+
});
|
|
564
972
|
});
|
|
565
973
|
describe('buildWorkspaceSyncSignatureModel', () => {
|
|
566
974
|
it('includes pending delete operations in the signature hash', () => {
|
|
@@ -718,6 +1126,63 @@ describe('workspaceSyncModel', () => {
|
|
|
718
1126
|
});
|
|
719
1127
|
expect(changedSignature).not.toEqual(baseSignature);
|
|
720
1128
|
});
|
|
1129
|
+
it('changes when initiative or workstream attachments change', () => {
|
|
1130
|
+
const baseSignature = buildWorkspaceSyncSignatureModel({
|
|
1131
|
+
workspaceId: 'ws-1',
|
|
1132
|
+
tasks: [],
|
|
1133
|
+
archivedTasks: [],
|
|
1134
|
+
initiatives: [{
|
|
1135
|
+
id: 'initiative-1',
|
|
1136
|
+
title: 'Revenue Expansion',
|
|
1137
|
+
description: null,
|
|
1138
|
+
createdAt: '2026-03-29T10:00:00.000Z',
|
|
1139
|
+
updatedAt: '2026-03-29T11:00:00.000Z',
|
|
1140
|
+
attachments: []
|
|
1141
|
+
}],
|
|
1142
|
+
workstreams: [{
|
|
1143
|
+
id: 'workstream-1',
|
|
1144
|
+
initiativeId: 'initiative-1',
|
|
1145
|
+
title: 'Checkout UX',
|
|
1146
|
+
description: null,
|
|
1147
|
+
createdAt: '2026-03-29T10:30:00.000Z',
|
|
1148
|
+
updatedAt: '2026-03-29T11:30:00.000Z',
|
|
1149
|
+
attachments: []
|
|
1150
|
+
}]
|
|
1151
|
+
});
|
|
1152
|
+
const changedSignature = buildWorkspaceSyncSignatureModel({
|
|
1153
|
+
workspaceId: 'ws-1',
|
|
1154
|
+
tasks: [],
|
|
1155
|
+
archivedTasks: [],
|
|
1156
|
+
initiatives: [{
|
|
1157
|
+
id: 'initiative-1',
|
|
1158
|
+
title: 'Revenue Expansion',
|
|
1159
|
+
description: null,
|
|
1160
|
+
createdAt: '2026-03-29T10:00:00.000Z',
|
|
1161
|
+
updatedAt: '2026-03-29T11:00:00.000Z',
|
|
1162
|
+
attachments: [{
|
|
1163
|
+
path: 'workspaces/ws-1/assets/documents/asset-in.md',
|
|
1164
|
+
assetId: 'asset-in',
|
|
1165
|
+
referenceLabel: 'D-31',
|
|
1166
|
+
caption: 'Revenue context'
|
|
1167
|
+
}]
|
|
1168
|
+
}],
|
|
1169
|
+
workstreams: [{
|
|
1170
|
+
id: 'workstream-1',
|
|
1171
|
+
initiativeId: 'initiative-1',
|
|
1172
|
+
title: 'Checkout UX',
|
|
1173
|
+
description: null,
|
|
1174
|
+
createdAt: '2026-03-29T10:30:00.000Z',
|
|
1175
|
+
updatedAt: '2026-03-29T11:30:00.000Z',
|
|
1176
|
+
attachments: [{
|
|
1177
|
+
path: 'workspaces/ws-1/assets/documents/asset-ws.md',
|
|
1178
|
+
assetId: 'asset-ws',
|
|
1179
|
+
referenceLabel: 'D-32',
|
|
1180
|
+
caption: 'Checkout context'
|
|
1181
|
+
}]
|
|
1182
|
+
}]
|
|
1183
|
+
});
|
|
1184
|
+
expect(changedSignature).not.toEqual(baseSignature);
|
|
1185
|
+
});
|
|
721
1186
|
it('changes when document review sessions change', () => {
|
|
722
1187
|
const baseSignature = buildWorkspaceSyncSignatureModel({
|
|
723
1188
|
workspaceId: 'ws-1',
|
|
@@ -810,6 +1275,8 @@ describe('workspaceSyncModel', () => {
|
|
|
810
1275
|
archivedTasks: [],
|
|
811
1276
|
taskEvents: [{
|
|
812
1277
|
id: 'task-event-1',
|
|
1278
|
+
entityType: 'task',
|
|
1279
|
+
entityId: 'task-1',
|
|
813
1280
|
taskId: 'task-1',
|
|
814
1281
|
workspaceId: 'ws-1',
|
|
815
1282
|
action: 'task-status-changed',
|
|
@@ -824,6 +1291,8 @@ describe('workspaceSyncModel', () => {
|
|
|
824
1291
|
archivedTasks: [],
|
|
825
1292
|
taskEvents: [{
|
|
826
1293
|
id: 'task-event-1',
|
|
1294
|
+
entityType: 'task',
|
|
1295
|
+
entityId: 'task-1',
|
|
827
1296
|
taskId: 'task-1',
|
|
828
1297
|
workspaceId: 'ws-1',
|
|
829
1298
|
action: 'task-status-changed',
|
|
@@ -836,15 +1305,16 @@ describe('workspaceSyncModel', () => {
|
|
|
836
1305
|
});
|
|
837
1306
|
});
|
|
838
1307
|
describe('dirty task watermarks', () => {
|
|
839
|
-
it('
|
|
1308
|
+
it('resends once when a legacy watermark-only task baseline exists', () => {
|
|
1309
|
+
const task = {
|
|
1310
|
+
id: 'task-1',
|
|
1311
|
+
title: 'Task 1',
|
|
1312
|
+
status: 'in-progress',
|
|
1313
|
+
createdAt: '2026-03-16T10:00:00.000Z',
|
|
1314
|
+
updatedAt: '2026-03-16T10:05:00.000Z'
|
|
1315
|
+
};
|
|
840
1316
|
const payload = buildWorkspaceSyncPayloadModel({
|
|
841
|
-
tasks: [
|
|
842
|
-
id: 'task-1',
|
|
843
|
-
title: 'Task 1',
|
|
844
|
-
status: 'in-progress',
|
|
845
|
-
createdAt: '2026-03-16T10:00:00.000Z',
|
|
846
|
-
updatedAt: '2026-03-16T10:05:00.000Z'
|
|
847
|
-
}],
|
|
1317
|
+
tasks: [task],
|
|
848
1318
|
archivedTasks: [],
|
|
849
1319
|
lastPushedTaskIds: new Set(['task-1']),
|
|
850
1320
|
pendingDeletedTaskIds: new Set(),
|
|
@@ -863,6 +1333,81 @@ describe('workspaceSyncModel', () => {
|
|
|
863
1333
|
})
|
|
864
1334
|
]));
|
|
865
1335
|
expect(payload.pushedWatermarks.get('task-1')).toBe('2026-03-16T10:05:00.000Z');
|
|
1336
|
+
expect(payload.pushedTaskChangeKeys.get('task-1')).toBe(taskSyncResourceAdapter.getChangeKey({ ...task, isArchived: false }));
|
|
1337
|
+
});
|
|
1338
|
+
it('does not resend a task when only updatedAt changes but the replicated change key matches', () => {
|
|
1339
|
+
const task = {
|
|
1340
|
+
id: 'task-1',
|
|
1341
|
+
title: 'Task 1',
|
|
1342
|
+
status: 'in-progress',
|
|
1343
|
+
createdAt: '2026-03-16T10:00:00.000Z',
|
|
1344
|
+
updatedAt: '2026-03-16T10:05:00.000Z'
|
|
1345
|
+
};
|
|
1346
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
1347
|
+
tasks: [task],
|
|
1348
|
+
archivedTasks: [],
|
|
1349
|
+
lastPushedTaskIds: new Set(['task-1']),
|
|
1350
|
+
pendingDeletedTaskIds: new Set(),
|
|
1351
|
+
lastPushedWatermarks: new Map([
|
|
1352
|
+
['task-1', '2026-03-16T10:00:00.000Z']
|
|
1353
|
+
]),
|
|
1354
|
+
lastPushedTaskChangeKeys: new Map([
|
|
1355
|
+
['task-1', taskSyncResourceAdapter.getChangeKey({ ...task, isArchived: false })]
|
|
1356
|
+
])
|
|
1357
|
+
});
|
|
1358
|
+
expect(payload.changes.some((change) => change.op === 'upsert' && change.task.id === 'task-1')).toBe(false);
|
|
1359
|
+
expect(payload.currentTaskWatermarks.get('task-1')).toBe('2026-03-16T10:05:00.000Z');
|
|
1360
|
+
});
|
|
1361
|
+
it('treats comment and attachment changes as replicated task-state changes', () => {
|
|
1362
|
+
const task = {
|
|
1363
|
+
id: 'task-1',
|
|
1364
|
+
title: 'Task 1',
|
|
1365
|
+
status: 'task',
|
|
1366
|
+
createdAt: '2026-03-16T10:00:00.000Z',
|
|
1367
|
+
updatedAt: '2026-03-16T10:05:00.000Z',
|
|
1368
|
+
comments: [{
|
|
1369
|
+
id: 'comment-1',
|
|
1370
|
+
author: 'ai-profile-1',
|
|
1371
|
+
text: 'Shipped',
|
|
1372
|
+
timestamp: '2026-03-16T10:05:00.000Z'
|
|
1373
|
+
}],
|
|
1374
|
+
attachments: [{
|
|
1375
|
+
path: 'workspaces/ws-1/assets/files/asset-1.txt',
|
|
1376
|
+
caption: 'Spec',
|
|
1377
|
+
timestamp: '2026-03-16T10:05:00.000Z'
|
|
1378
|
+
}]
|
|
1379
|
+
};
|
|
1380
|
+
const previousTask = {
|
|
1381
|
+
...task,
|
|
1382
|
+
comments: [],
|
|
1383
|
+
attachments: []
|
|
1384
|
+
};
|
|
1385
|
+
const payload = buildWorkspaceSyncPayloadModel({
|
|
1386
|
+
tasks: [task],
|
|
1387
|
+
archivedTasks: [],
|
|
1388
|
+
lastPushedTaskIds: new Set(['task-1']),
|
|
1389
|
+
pendingDeletedTaskIds: new Set(),
|
|
1390
|
+
lastPushedWatermarks: new Map([
|
|
1391
|
+
['task-1', '2026-03-16T10:05:00.000Z']
|
|
1392
|
+
]),
|
|
1393
|
+
lastPushedTaskChangeKeys: new Map([
|
|
1394
|
+
['task-1', taskSyncResourceAdapter.getChangeKey({ ...previousTask, isArchived: false })]
|
|
1395
|
+
])
|
|
1396
|
+
});
|
|
1397
|
+
expect(payload.changes).toEqual(expect.arrayContaining([
|
|
1398
|
+
expect.objectContaining({
|
|
1399
|
+
op: 'upsert',
|
|
1400
|
+
task: expect.objectContaining({
|
|
1401
|
+
id: 'task-1',
|
|
1402
|
+
comments: expect.arrayContaining([
|
|
1403
|
+
expect.objectContaining({ id: 'comment-1' })
|
|
1404
|
+
]),
|
|
1405
|
+
attachments: expect.arrayContaining([
|
|
1406
|
+
expect.objectContaining({ path: 'workspaces/ws-1/assets/files/asset-1.txt' })
|
|
1407
|
+
])
|
|
1408
|
+
})
|
|
1409
|
+
})
|
|
1410
|
+
]));
|
|
866
1411
|
});
|
|
867
1412
|
it('keeps provisional local-reference tasks dirty until a canonical reference is assigned', () => {
|
|
868
1413
|
const payload = buildWorkspaceSyncPayloadModel({
|