@taskforcehq/taskforce 0.3.328 → 0.3.330
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/dist/Taskforce.module.css +523 -79
- package/dist/TaskforceCore.js +237 -230
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.js +1 -1
- package/dist/cli.js +34 -0
- package/dist/cliCloudTargetGuard.d.ts +5 -0
- package/dist/cliCloudTargetGuard.js +11 -0
- package/dist/components/features/AiProfilesModule.js +3 -5
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +24 -8
- package/dist/components/features/TaskSettings.d.ts +12 -1
- package/dist/components/features/TaskSettings.js +217 -54
- package/dist/components/features/TaskforceAgentsModule.d.ts +1 -2
- package/dist/components/features/TaskforceAgentsModule.js +586 -116
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +1 -1
- package/dist/components/features/agentConnections/AgentConnectionControl.d.ts +15 -0
- package/dist/components/features/agentConnections/AgentConnectionControl.js +125 -0
- package/dist/components/features/agentConnections/ModelConnectionsPanel.d.ts +18 -0
- package/dist/components/features/agentConnections/ModelConnectionsPanel.js +393 -0
- package/dist/components/features/agentConnections/modelConnectionsApi.d.ts +65 -0
- package/dist/components/features/agentConnections/modelConnectionsApi.js +129 -0
- package/dist/components/features/planning/PlanningModule.js +2 -5
- package/dist/components/features/planning/PlanningTaskOrderList.d.ts +1 -1
- package/dist/components/features/planning/PlanningTaskOrderList.js +17 -6
- package/dist/components/features/planning/planningTaskArrangement.d.ts +1 -0
- package/dist/components/features/planning/planningTaskArrangement.js +5 -5
- package/dist/components/features/taskforceAgentAssignments/AgentBehaviorAssignments.js +15 -24
- package/dist/components/features/taskforceAgentEditorModel.d.ts +2 -1
- package/dist/components/features/taskforceAgentEditorModel.js +5 -1
- package/dist/components/features/workflowManager/workflowManagerApi.d.ts +1 -1
- package/dist/components/features/workflowManager/workflowManagerApi.js +3 -0
- package/dist/components/task/TaskCard.d.ts +5 -0
- package/dist/components/task/TaskCard.js +65 -10
- package/dist/components/task/TaskImageReviews.js +14 -5
- package/dist/components/task/TaskKanban.d.ts +6 -1
- package/dist/components/task/TaskKanban.js +152 -6
- package/dist/components/task/TaskList.d.ts +5 -0
- package/dist/components/task/TaskList.js +3 -3
- package/dist/components/task/TaskWorkflowAssignmentField.js +68 -10
- package/dist/components/ui/PasswordInput.d.ts +6 -0
- package/dist/components/ui/PasswordInput.js +11 -0
- package/dist/components/ui/TopNoticeLayer.js +1 -1
- package/dist/components/views/AppShellHeader.js +32 -11
- package/dist/components/views/PlanComparisonPage.js +12 -0
- package/dist/components/views/StandaloneLayout.js +32 -55
- package/dist/components/views/WidgetView.js +3 -3
- package/dist/components/views/panels/PlanningDrawer.js +5 -12
- package/dist/components/views/standalone/modals/AccountSettingsModal.js +26 -17
- package/dist/components/views/standalone/modals/SyncStatusModal.d.ts +4 -3
- package/dist/components/views/standalone/modals/SyncStatusModal.js +33 -38
- package/dist/config/envSchema.js +60 -1
- package/dist/config/localServiceRuntimeContract.d.ts +13 -0
- package/dist/config/localServiceRuntimeContract.js +135 -0
- package/dist/core/AiProfileService.js +46 -8
- package/dist/core/DeletedTaskLifecycleService.d.ts +1 -0
- package/dist/core/DeletedTaskLifecycleService.js +37 -6
- package/dist/core/McpTokenService.d.ts +23 -1
- package/dist/core/McpTokenService.js +93 -10
- package/dist/core/TaskAttachmentLinksDurableMutationService.d.ts +3 -2
- package/dist/core/TaskAttachmentLinksDurableMutationService.js +33 -9
- package/dist/core/TaskChecklistCommandService.d.ts +27 -0
- package/dist/core/TaskChecklistCommandService.js +83 -5
- package/dist/core/TaskLifecycleCommandService.d.ts +3 -1
- package/dist/core/TaskLifecycleCommandService.js +6 -2
- package/dist/core/Taskforce.d.ts +94 -2
- package/dist/core/Taskforce.js +760 -36
- package/dist/core/types.d.ts +14 -0
- package/dist/documentReviews/commandService.d.ts +2 -1
- package/dist/documentReviews/commandService.js +6 -3
- package/dist/hooks/sync/orchestratorShared.d.ts +1 -0
- package/dist/hooks/sync/orchestratorShared.js +2 -0
- package/dist/hooks/sync/useDurableLocalOutboxDrain.d.ts +1 -1
- package/dist/hooks/sync/useDurableTaskCreateMutation.js +1 -1
- package/dist/hooks/sync/useDurableTaskMetadataMutation.d.ts +1 -0
- package/dist/hooks/sync/useDurableTaskMetadataMutation.js +1 -0
- package/dist/hooks/sync/useDurableTaskStatusMutation.d.ts +1 -0
- package/dist/hooks/sync/useLocalSyncCoordinatorSnapshot.d.ts +3 -0
- package/dist/hooks/sync/useLocalSyncCoordinatorSnapshot.js +85 -9
- package/dist/hooks/sync/useSyncStatusControls.d.ts +4 -1
- package/dist/hooks/sync/useSyncStatusControls.js +47 -11
- package/dist/hooks/tasks/taskHttpMutation.js +1 -0
- package/dist/hooks/tasks/useCloudTaskSearch.d.ts +12 -0
- package/dist/hooks/tasks/useCloudTaskSearch.js +71 -0
- package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.d.ts +16 -0
- package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.js +197 -0
- package/dist/hooks/tasks/useTaskEditorNavigation.d.ts +16 -3
- package/dist/hooks/tasks/useTaskEditorNavigation.js +72 -13
- package/dist/hooks/tasks/useTaskFormActions.d.ts +6 -0
- package/dist/hooks/tasks/useTaskFormActions.js +65 -12
- package/dist/hooks/ui/useSettingsModel.d.ts +24 -2
- package/dist/hooks/ui/useSettingsModel.js +13 -2
- package/dist/hooks/ui/useSettingsPersistence.d.ts +12 -1
- package/dist/hooks/ui/useSettingsPersistence.js +74 -47
- package/dist/hooks/useFilterSort.d.ts +7 -3
- package/dist/hooks/useFilterSort.js +15 -5
- package/dist/hooks/useSyncOrchestrator.d.ts +3 -0
- package/dist/hooks/useSyncOrchestrator.js +111 -2
- package/dist/hooks/useTaskData.d.ts +40 -1
- package/dist/hooks/useTaskData.js +240 -9
- package/dist/hooks/useTaskMutations.d.ts +12 -2
- package/dist/hooks/useTaskMutations.js +266 -52
- package/dist/hooks/useTaskforce.d.ts +39 -9
- package/dist/hooks/useTaskforce.js +359 -40
- package/dist/hooks/useUiNotice.d.ts +4 -0
- package/dist/hooks/useUiNotice.js +4 -0
- package/dist/mcp/adminWorkspaceRegistrar.js +3 -3
- package/dist/mcp/clientRegistry.d.ts +2 -2
- package/dist/mcp/clientRegistry.js +1 -1
- package/dist/mcp/documentAssetRegistrar.js +53 -41
- package/dist/mcp/documentHelpers.d.ts +1 -0
- package/dist/mcp/documentHelpers.js +7 -3
- package/dist/mcp/durableTaskMutationRouter.d.ts +4 -1
- package/dist/mcp/durableTaskMutationRouter.js +10 -0
- package/dist/mcp/durableTaskRelationshipMutationRouter.js +4 -0
- package/dist/mcp/httpProtocolRouting.d.ts +10 -0
- package/dist/mcp/httpProtocolRouting.js +19 -0
- package/dist/mcp/localCliHealth.d.ts +2 -2
- package/dist/mcp/localCliHealth.js +2 -2
- package/dist/mcp/localServiceProxy.d.ts +1 -0
- package/dist/mcp/localServiceProxy.js +530 -68
- package/dist/mcp/planningAttachmentCommandAdapter.d.ts +3 -1
- package/dist/mcp/planningAttachmentCommandAdapter.js +20 -2
- package/dist/mcp/runtime.d.ts +54 -79
- package/dist/mcp/runtime.js +556 -139
- package/dist/mcp/taskPlanningRegistrar.js +64 -42
- package/dist/mcp/toolCallCompatibility.js +38 -1
- package/dist/mcp/toolCatalog.d.ts +1 -0
- package/dist/mcp/toolProfiles.d.ts +2 -0
- package/dist/mcp/toolProfiles.js +10 -0
- package/dist/mcp/toolRegistry.d.ts +1 -0
- package/dist/mcp/toolRegistry.js +1 -0
- package/dist/mcp/workflowExecutionRegistrar.js +4 -4
- package/dist/migrations/taskSchemaMigrations.d.ts +5 -0
- package/dist/migrations/taskSchemaMigrations.js +427 -0
- package/dist/runtime/appGateDefinitions.d.ts +30 -6
- package/dist/runtime/appGateDefinitions.js +6 -6
- package/dist/runtime/appGates.d.ts +13 -13
- package/dist/runtime/appGates.js +36 -13
- package/dist/runtime/nodeAppGates.d.ts +8 -0
- package/dist/runtime/nodeAppGates.js +27 -0
- package/dist/server/cloudCollectionRead.d.ts +1 -1
- package/dist/server/cloudCollectionRead.js +2 -2
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.js +123 -14
- package/dist/server/localDatabaseIdentity.js +4 -1
- package/dist/server/localServiceLease.d.ts +3 -0
- package/dist/server/localServiceLease.js +11 -2
- package/dist/server/localServiceSessions.d.ts +14 -17
- package/dist/server/localServiceSessions.js +308 -94
- package/dist/server/localWorkspaceSyncServerRuntime.js +12 -7
- package/dist/server/rateLimit.d.ts +1 -0
- package/dist/server/rateLimit.js +4 -0
- package/dist/server/realtimeSyncWs.js +36 -12
- package/dist/server/routes/admin.d.ts +4 -0
- package/dist/server/routes/admin.js +113 -3
- package/dist/server/routes/agentRoles.js +3 -2
- package/dist/server/routes/agentSkills.js +3 -2
- package/dist/server/routes/agents.d.ts +7 -0
- package/dist/server/routes/agents.js +394 -39
- package/dist/server/routes/annotatedAttachments.js +3 -2
- package/dist/server/routes/auth.js +3 -1
- package/dist/server/routes/billing.js +5 -1
- package/dist/server/routes/durableTaskHttpRouters.d.ts +11 -2
- package/dist/server/routes/executorPhaseAApprovals.d.ts +19 -0
- package/dist/server/routes/executorPhaseAApprovals.js +140 -0
- package/dist/server/routes/executorPhaseAIssuerRedemptions.d.ts +11 -0
- package/dist/server/routes/executorPhaseAIssuerRedemptions.js +24 -0
- package/dist/server/routes/githubReviewEvidence.d.ts +19 -0
- package/dist/server/routes/githubReviewEvidence.js +116 -0
- package/dist/server/routes/localService.d.ts +15 -4
- package/dist/server/routes/localService.js +138 -40
- package/dist/server/routes/modelConnections.d.ts +24 -0
- package/dist/server/routes/modelConnections.js +205 -0
- package/dist/server/routes/primitives.d.ts +2 -0
- package/dist/server/routes/shared.d.ts +19 -0
- package/dist/server/routes/shared.js +95 -19
- package/dist/server/routes/sync.js +1 -0
- package/dist/server/routes/syncAuxRoutes.js +9 -2
- package/dist/server/routes/syncPullApplyRoutes.js +23 -4
- package/dist/server/routes/syncPushRoutes.d.ts +1 -0
- package/dist/server/routes/syncPushRoutes.js +1 -0
- package/dist/server/routes/syncV3FeedRoutes.js +27 -16
- package/dist/server/routes/syncV3LocalCaptureRoutes.js +28 -2
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.d.ts +1 -0
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.js +26 -0
- package/dist/server/routes/syncV3OperationRoutes.js +45 -9
- package/dist/server/routes/tasks.js +124 -13
- package/dist/server/routes/workflows.js +9 -1
- package/dist/server/routes/workspaces.js +43 -1
- package/dist/server/routes.js +59 -0
- package/dist/server/workspaceDeletionAdmission.d.ts +23 -0
- package/dist/server/workspaceDeletionAdmission.js +50 -0
- package/dist/service/localServiceCli.js +16 -0
- package/dist/service/localServiceClientLifecycle.js +36 -10
- package/dist/services/codexAppServerModelGateway.d.ts +161 -0
- package/dist/services/codexAppServerModelGateway.js +663 -0
- package/dist/services/codexDeviceCodeLoginManager.d.ts +39 -0
- package/dist/services/codexDeviceCodeLoginManager.js +265 -0
- package/dist/services/codexModelProviderConnectionLifecycle.d.ts +8 -0
- package/dist/services/codexModelProviderConnectionLifecycle.js +73 -0
- package/dist/services/executorPhaseAApprovalRuntime.d.ts +14 -0
- package/dist/services/executorPhaseAApprovalRuntime.js +24 -0
- package/dist/services/executorPhaseAApprovalService.d.ts +40 -0
- package/dist/services/executorPhaseAApprovalService.js +609 -0
- package/dist/services/executorPhaseADriftEvaluator.d.ts +78 -0
- package/dist/services/executorPhaseADriftEvaluator.js +93 -0
- package/dist/services/executorPhaseAIssuerCore.d.ts +126 -0
- package/dist/services/executorPhaseAIssuerCore.js +295 -0
- package/dist/services/executorPhaseAIssuerRedemptionService.d.ts +34 -0
- package/dist/services/executorPhaseAIssuerRedemptionService.js +158 -0
- package/dist/services/githubReviewEvidenceRuntime.d.ts +14 -0
- package/dist/services/githubReviewEvidenceRuntime.js +30 -0
- package/dist/services/githubReviewEvidenceService.d.ts +93 -0
- package/dist/services/githubReviewEvidenceService.js +336 -0
- package/dist/services/modelGateway.d.ts +7 -0
- package/dist/services/modelProviderConnectionService.d.ts +71 -0
- package/dist/services/modelProviderConnectionService.js +279 -0
- package/dist/services/modelProviderCredentialHome.d.ts +32 -0
- package/dist/services/modelProviderCredentialHome.js +271 -0
- package/dist/services/ownerScopedModelConnectionGateway.d.ts +12 -0
- package/dist/services/ownerScopedModelConnectionGateway.js +30 -0
- package/dist/services/taskforceAgentConnectionBindingService.d.ts +66 -0
- package/dist/services/taskforceAgentConnectionBindingService.js +185 -0
- package/dist/services/taskforceAgentMcpBridge.d.ts +8 -2
- package/dist/services/taskforceAgentMcpBridge.js +30 -27
- package/dist/shared/adminEdgeProxy.d.ts +5 -0
- package/dist/shared/adminEdgeProxy.js +94 -0
- package/dist/shared/adminProxySessionCookies.d.ts +16 -0
- package/dist/shared/adminProxySessionCookies.js +86 -0
- package/dist/shared/aiProfileColors.d.ts +31 -1
- package/dist/shared/aiProfileColors.js +14 -6
- package/dist/shared/executorPhaseAApprovalGoldenVector.json +269 -0
- package/dist/shared/executorPhaseAApprovalReceipt.d.ts +112 -0
- package/dist/shared/executorPhaseAApprovalReceipt.js +58 -0
- package/dist/shared/executorPhaseAApprovalTrustPolicy.json +10 -0
- package/dist/shared/executorPhaseADriftContracts.d.ts +37 -0
- package/dist/shared/executorPhaseADriftContracts.js +63 -0
- package/dist/shared/executorPhaseAIssuerContracts.d.ts +75 -0
- package/dist/shared/executorPhaseAIssuerContracts.js +90 -0
- package/dist/shared/executorPhaseARunAuthorization.d.ts +120 -0
- package/dist/shared/executorPhaseARunAuthorization.js +232 -0
- package/dist/shared/executorPhaseASchemaValidation.d.ts +7 -0
- package/dist/shared/executorPhaseASchemaValidation.js +53 -0
- package/dist/shared/executorPhaseASchemas/approval-receipt.schema.json +106 -0
- package/dist/shared/executorPhaseASchemas/drift-attestation.schema.json +54 -0
- package/dist/shared/executorPhaseASchemas/drift-request.schema.json +47 -0
- package/dist/shared/executorPhaseASchemas/foundation-manifest.schema.json +29 -0
- package/dist/shared/executorPhaseASchemas/issuer-audit-record.schema.json +24 -0
- package/dist/shared/executorPhaseASchemas/issuer-proof.schema.json +43 -0
- package/dist/shared/executorPhaseASchemas/issuer-redemption-request.schema.json +18 -0
- package/dist/shared/executorPhaseASchemas/issuer-redemption-response.schema.json +39 -0
- package/dist/shared/executorPhaseASchemas/logical-envelope.schema.json +149 -0
- package/dist/shared/executorPhaseASchemas/preflight-report.schema.json +216 -0
- package/dist/shared/executorPhaseASchemas/run-capability.schema.json +111 -0
- package/dist/shared/executorPhaseASchemas/sender-proof.schema.json +37 -0
- package/dist/shared/executorPhaseASchemas/workload-grant.schema.json +68 -0
- package/dist/shared/executorPhaseASchemas/workload-jwt-claims.schema.json +67 -0
- package/dist/shared/executorPhaseATiming.d.ts +1 -0
- package/dist/shared/executorPhaseATiming.js +1 -0
- package/dist/shared/planningIdentity.js +1 -1
- package/dist/shared/productLogoKeys.d.ts +2 -0
- package/dist/shared/productLogoKeys.js +18 -0
- package/dist/shared/taskforceAgentDefinition.d.ts +0 -1
- package/dist/shared/taskforceAgentDefinition.js +6 -3
- package/dist/shared/taskforceAgentModels.d.ts +1 -0
- package/dist/shared/taskforceAgentModels.js +36 -3
- package/dist/shared/userFeatureGrants.d.ts +4 -0
- package/dist/shared/userFeatureGrants.js +7 -0
- package/dist/storage/executorPhaseAApprovalReceiptStore.d.ts +37 -0
- package/dist/storage/executorPhaseAApprovalReceiptStore.js +81 -0
- package/dist/storage/executorPhaseARunAuthorizationStore.d.ts +103 -0
- package/dist/storage/executorPhaseARunAuthorizationStore.js +492 -0
- package/dist/storage/githubReviewEvidenceInstallationStore.d.ts +26 -0
- package/dist/storage/githubReviewEvidenceInstallationStore.js +89 -0
- package/dist/storage/modelProviderConnectionStore.d.ts +99 -0
- package/dist/storage/modelProviderConnectionStore.js +446 -0
- package/dist/storage/postgresAdapter.d.ts +24 -3
- package/dist/storage/postgresAdapter.js +117 -14
- package/dist/storage/postgresWorker.js +22 -5
- package/dist/storage/postgresWorkerProtocol.d.ts +30 -0
- package/dist/storage/postgresWorkerProtocol.js +30 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.d.ts +31 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.js +84 -0
- package/dist/sync/cloudSyncApi.d.ts +4 -1
- package/dist/sync/cloudSyncApi.js +7 -2
- package/dist/sync/contentSyncState.d.ts +1 -1
- package/dist/sync/coordinator/localSyncExecutionPermitStore.d.ts +1 -0
- package/dist/sync/coordinator/localSyncExecutionPermitStore.js +67 -30
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.d.ts +10 -0
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.js +29 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +6 -2
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.d.ts +15 -1
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.js +99 -2
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.d.ts +1 -0
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.js +33 -4
- package/dist/sync/engine/workspaceSyncContentLifecycleAdapter.d.ts +2 -1
- package/dist/sync/engine/workspaceSyncContentVersionStore.d.ts +38 -0
- package/dist/sync/engine/workspaceSyncContentVersionStore.js +50 -1
- package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.js +20 -2
- package/dist/sync/engine/workspaceSyncEngineLifecyclePolicy.js +6 -6
- package/dist/sync/engine/workspaceSyncEngineLocalServices.d.ts +4 -0
- package/dist/sync/engine/workspaceSyncEngineLocalServices.js +11 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.d.ts +14 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.js +84 -0
- package/dist/sync/engine/workspaceSyncEngineRecovery.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.d.ts +11 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.js +2 -1
- package/dist/sync/engine/workspaceSyncEngineRuntime.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncEngineRuntime.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +31 -4
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.d.ts +3 -1
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +134 -43
- package/dist/sync/engine/workspaceSyncEngineServerSnapshotReader.js +6 -0
- package/dist/sync/engine/workspaceSyncEngineTransfers.d.ts +1 -1
- package/dist/sync/engine/workspaceSyncEngineTransfers.js +11 -4
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +29 -0
- package/dist/sync/syncApplyHandlers.d.ts +2 -0
- package/dist/sync/syncApplyHandlers.js +10 -1
- package/dist/sync/syncService.d.ts +17 -0
- package/dist/sync/syncService.js +87 -19
- package/dist/sync/taskforceAgentSyncAuthorization.d.ts +16 -0
- package/dist/sync/taskforceAgentSyncAuthorization.js +20 -0
- package/dist/sync/v3/combinedFeedCapability.js +8 -0
- package/dist/sync/v3/durableInitiativeMutationRouter.js +18 -10
- package/dist/sync/v3/durableOperationReplay.d.ts +14 -0
- package/dist/sync/v3/durableOperationReplay.js +18 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.d.ts +2 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.js +14 -1
- package/dist/sync/v3/durableTaskChecklistMutationRouter.d.ts +4 -1
- package/dist/sync/v3/durableTaskChecklistMutationRouter.js +62 -15
- package/dist/sync/v3/durableTaskCommentMutationRouter.js +3 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.d.ts +1 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.js +30 -8
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.d.ts +5 -3
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.js +37 -2
- package/dist/sync/v3/durableTaxonomyMutationRouter.js +5 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.d.ts +11 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.js +39 -10
- package/dist/sync/v3/durableWorkstreamMutationRouter.js +18 -10
- package/dist/sync/v3/durableWorkstreamTaskOrderMutationRouter.js +16 -5
- package/dist/sync/v3/localOutboxDispatchRuntime.js +2 -2
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.d.ts +2 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.js +47 -7
- package/dist/sync/v3/localTaskChecklistOutboxHandler.js +16 -2
- package/dist/sync/v3/localTaskChecklistOutboxService.d.ts +4 -0
- package/dist/sync/v3/localTaskChecklistOutboxService.js +14 -1
- package/dist/sync/v3/localTaskCreateOutboxService.js +15 -6
- package/dist/sync/v3/localTaskMetadataClient.d.ts +1 -0
- package/dist/sync/v3/localTaskMetadataClient.js +1 -0
- package/dist/sync/v3/localTaskMetadataOutboxHandler.js +5 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +2 -0
- package/dist/sync/v3/localTaskMetadataOutboxService.js +7 -0
- package/dist/sync/v3/localTaskRestoreOutboxService.js +14 -6
- package/dist/sync/v3/localTaskStatusClient.d.ts +1 -0
- package/dist/sync/v3/localTaskStatusClient.js +6 -1
- package/dist/sync/v3/localTaskStatusOutboxService.d.ts +10 -0
- package/dist/sync/v3/localTaskStatusOutboxService.js +272 -24
- package/dist/sync/v3/syncDurabilityStore.d.ts +41 -0
- package/dist/sync/v3/syncDurabilityStore.js +199 -13
- package/dist/sync/v3/taskAttachmentLinksMutationService.d.ts +6 -4
- package/dist/sync/v3/taskAttachmentLinksMutationService.js +19 -10
- package/dist/sync/v3/taskChecklistMutationService.d.ts +15 -2
- package/dist/sync/v3/taskChecklistMutationService.js +48 -1
- package/dist/sync/v3/taskCreateMutationService.d.ts +2 -2
- package/dist/sync/v3/taskCreateMutationService.js +7 -4
- package/dist/sync/v3/taskMetadataMutationService.d.ts +3 -0
- package/dist/sync/v3/taskMetadataMutationService.js +4 -0
- package/dist/sync/v3/taskRestoreMutationService.d.ts +2 -2
- package/dist/sync/v3/taskRestoreMutationService.js +7 -4
- package/dist/sync/v3/taskStatusMutationService.d.ts +31 -1
- package/dist/sync/v3/taskStatusMutationService.js +123 -3
- package/dist/sync/v3/workflowAssignmentSync.d.ts +6 -0
- package/dist/sync/v3/workflowAssignmentSync.js +30 -0
- package/dist/sync/v3/workspaceSyncJournalReader.js +1 -1
- package/dist/sync/v3/workspaceSyncOperationRetentionService.d.ts +16 -0
- package/dist/sync/v3/workspaceSyncOperationRetentionService.js +83 -0
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.js +13 -3
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.d.ts +11 -0
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.js +27 -10
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.d.ts +2 -1
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.js +52 -10
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +18 -3
- package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.js +8 -3
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +51 -10
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +14 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +49 -25
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +13 -4
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +124 -57
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.d.ts +20 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +106 -30
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.d.ts +4 -1
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.js +34 -0
- package/dist/sync/v3/workspaceSyncV3CoverageRegistry.js +12 -0
- package/dist/sync/v3/workspaceSyncV3FeedProfile.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.js +23 -10
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.d.ts +3 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.js +64 -13
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.d.ts +9 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.js +26 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +15 -5
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +50 -14
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.d.ts +2 -1
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.js +11 -3
- package/dist/sync/v3/workspaceSyncV3OperationProtocol.d.ts +5 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.js +55 -9
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.d.ts +17 -0
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.js +64 -0
- package/dist/sync/v3/workspaceSyncV3TaskCommentAudit.js +9 -2
- package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.js +37 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.d.ts +6 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.js +9 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverCoverage.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverCoverage.js +33 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverWireContract.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverWireContract.js +8 -0
- package/dist/sync/workspacePullFeed.js +2 -1
- package/dist/sync/workspaceRepair.d.ts +8 -2
- package/dist/sync/workspaceRepair.js +222 -6
- package/dist/sync/workspaceSyncModel.d.ts +21 -0
- package/dist/sync/workspaceSyncModel.js +35 -7
- package/dist/sync/workspaceSyncState.d.ts +1 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.d.ts +6 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.js +5 -0
- package/dist/types.d.ts +47 -1
- package/dist/types.js +6 -0
- package/dist/ui/assets/AiIdentityRosterCard-OcSz1PkK.js +1 -0
- package/dist/ui/assets/AiProfilesModule-ByhYW5Xi.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BTM6nIg_.js +3 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-TzYu7pkG.css +1 -0
- package/dist/ui/assets/{AssetTraySortControl-Kf1pelSy.js → AssetTraySortControl-DabEG8L4.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-B8boOs6Q.js → ContextAttachmentManager-Coa8yVGM.js} +2 -2
- package/dist/ui/assets/{DocumentWorkspace-DXH4XUsB.js → DocumentWorkspace-BB0qhdix.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-BtSTq0ON.js → EntityActivityTimeline-CZ8x4UJE.js} +1 -1
- package/dist/ui/assets/PlanningModule-pRPjR7v5.js +1 -0
- package/dist/ui/assets/PlansPage-D86pZSSl.js +1 -0
- package/dist/ui/assets/TaskContextUpload-BVIkU9yT.js +1 -0
- package/dist/ui/assets/TaskSettings-Cv1mNhv_.js +12 -0
- package/dist/ui/assets/TaskforceAgentsModule-b-8R25cJ.css +1 -0
- package/dist/ui/assets/TaskforceAgentsModule-gmH-PD2q.js +24 -0
- package/dist/ui/assets/{WorkflowManagerModule-DWFspC-o.js → WorkflowManagerModule-DbfnHJ-f.js} +1 -1
- package/dist/ui/assets/index-BZ-hdZSk.css +1 -0
- package/dist/ui/assets/index-CTsDBaef.js +7 -0
- package/dist/ui/assets/{vendor-icons-BkFLXavV.js → vendor-icons-Bsq-mcEn.js} +1 -1
- package/dist/ui/branding/logos/letterhead_dark.png +0 -0
- package/dist/ui/branding/logos/letterhead_light.png +0 -0
- package/dist/ui/branding/logos/signature_dark.png +0 -0
- package/dist/ui/branding/logos/signature_light.png +0 -0
- package/dist/ui/index.html +3 -3
- package/dist/utils/aiProfileDefaultLogo.js +16 -48
- package/dist/utils/httpSetCookie.d.ts +1 -0
- package/dist/utils/httpSetCookie.js +4 -1
- package/dist/utils/localRuntimeUrl.d.ts +1 -0
- package/dist/utils/localRuntimeUrl.js +14 -0
- package/dist/utils/productLogoRegistry.d.ts +2 -0
- package/dist/utils/productLogoRegistry.js +36 -0
- package/dist/utils/syncStatusPresentation.d.ts +4 -0
- package/dist/utils/syncStatusPresentation.js +17 -0
- package/dist/utils/taskActivity.d.ts +3 -2
- package/dist/utils/taskActivity.js +19 -2
- package/dist/utils/taskEditorReconciliation.d.ts +40 -0
- package/dist/utils/taskEditorReconciliation.js +217 -0
- package/dist/utils/taskEvents.d.ts +2 -0
- package/dist/utils/taskNormalization.d.ts +1 -0
- package/dist/utils/taskNormalization.js +39 -0
- package/dist/utils/taskSearch.js +2 -2
- package/dist/utils/uiNotice.d.ts +4 -0
- package/dist/utils/workspaceSyncPresentation.d.ts +1 -1
- package/dist/utils/workspaceSyncPresentation.js +23 -17
- package/package.json +36 -6
- package/dist/ui/assets/AiIdentityRosterCard-MZs7lVED.js +0 -1
- package/dist/ui/assets/AiProfilesModule-C3i0LOxe.js +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-CBRZ8rca.css +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-DVZk5Tln.js +0 -3
- package/dist/ui/assets/PlanningModule-BPVyEa-f.js +0 -1
- package/dist/ui/assets/PlansPage-ChqgxALc.js +0 -1
- package/dist/ui/assets/TaskContextUpload-CB3ol0sN.js +0 -1
- package/dist/ui/assets/TaskSettings-g4ECKNOz.js +0 -12
- package/dist/ui/assets/TaskforceAgentsModule-BazdUwxZ.js +0 -21
- package/dist/ui/assets/TaskforceAgentsModule-D6IC0S7Q.css +0 -1
- package/dist/ui/assets/index-BUplSsv_.js +0 -7
- package/dist/ui/assets/index-gz2EXuoK.css +0 -1
package/dist/core/types.d.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import type { DatabaseProvider } from '../storage/databaseAdapter.js';
|
|
16
16
|
export type { TaskforceTheme } from '../utils/theme.js';
|
|
17
17
|
import type { TaskforceTheme } from '../utils/theme.js';
|
|
18
|
+
import type { InternalUserFeatureKey } from '../shared/userFeatureGrants.js';
|
|
18
19
|
export interface Comment {
|
|
19
20
|
id: string;
|
|
20
21
|
author: string;
|
|
@@ -176,6 +177,12 @@ export interface TaskFile {
|
|
|
176
177
|
jsonBackupEnabled?: boolean;
|
|
177
178
|
manualComplexityEnabled?: boolean;
|
|
178
179
|
checklistDropdownEnabled?: boolean;
|
|
180
|
+
showTaskCardStatusLabel?: boolean;
|
|
181
|
+
showTaskCardDescription?: boolean;
|
|
182
|
+
showTaskCardAttachments?: boolean;
|
|
183
|
+
showTaskCardChecklistProgress?: boolean;
|
|
184
|
+
showTaskCardLatestActivity?: boolean;
|
|
185
|
+
tintTaskCardActivityBackground?: boolean;
|
|
179
186
|
taxonomies?: any[];
|
|
180
187
|
};
|
|
181
188
|
}
|
|
@@ -338,6 +345,7 @@ export type SystemRole = 'system_admin' | 'user';
|
|
|
338
345
|
export type PermissionMode = 'read-only' | 'read-write';
|
|
339
346
|
export type AuthTokenPurpose = 'email_verification' | 'password_reset' | 'invite_accept';
|
|
340
347
|
export type McpAccessTokenScope = 'tasks:read' | 'tasks:write' | 'workspace:read';
|
|
348
|
+
export type McpCloudToolProfile = 'default' | 'extended';
|
|
341
349
|
export type UserAuthProvider = 'password' | 'google' | 'github' | 'apple';
|
|
342
350
|
export interface UserAuthIdentity {
|
|
343
351
|
id: string;
|
|
@@ -411,6 +419,7 @@ export interface SystemUserRecord {
|
|
|
411
419
|
systemRole: SystemRole;
|
|
412
420
|
betaAccess: boolean;
|
|
413
421
|
disabled: boolean;
|
|
422
|
+
internalFeatureGrants: InternalUserFeatureKey[];
|
|
414
423
|
planId?: string | null;
|
|
415
424
|
planName?: string | null;
|
|
416
425
|
planVersionId?: string | null;
|
|
@@ -607,6 +616,7 @@ export interface McpAccessTokenRecord {
|
|
|
607
616
|
userEmail?: string | null;
|
|
608
617
|
name: string;
|
|
609
618
|
scopes: McpAccessTokenScope[];
|
|
619
|
+
toolProfile: McpCloudToolProfile;
|
|
610
620
|
tokenPrefix: string;
|
|
611
621
|
status: McpAccessTokenStatus;
|
|
612
622
|
lastUsedAt?: string | null;
|
|
@@ -634,6 +644,7 @@ export interface McpAccessTokenAuthResult {
|
|
|
634
644
|
workspaceId: string;
|
|
635
645
|
userId: string;
|
|
636
646
|
scopes: McpAccessTokenScope[];
|
|
647
|
+
toolProfile?: McpCloudToolProfile;
|
|
637
648
|
status: McpAccessTokenStatus;
|
|
638
649
|
}
|
|
639
650
|
export interface McpAccessTokenInspectionResult {
|
|
@@ -643,6 +654,7 @@ export interface McpAccessTokenInspectionResult {
|
|
|
643
654
|
userId: string;
|
|
644
655
|
name: string;
|
|
645
656
|
scopes: McpAccessTokenScope[];
|
|
657
|
+
toolProfile: McpCloudToolProfile;
|
|
646
658
|
status: McpAccessTokenStatus;
|
|
647
659
|
}
|
|
648
660
|
export interface McpOAuthClientRecord {
|
|
@@ -664,6 +676,7 @@ export interface McpOAuthConnectorGrantRecord {
|
|
|
664
676
|
workspaceId: string;
|
|
665
677
|
userId: string;
|
|
666
678
|
scopes: McpAccessTokenScope[];
|
|
679
|
+
toolProfile: McpCloudToolProfile;
|
|
667
680
|
tokenPrefix: string;
|
|
668
681
|
status: McpOAuthGrantStatus;
|
|
669
682
|
lastUsedAt?: string | null;
|
|
@@ -686,6 +699,7 @@ export interface McpOAuthAccessTokenAuthResult {
|
|
|
686
699
|
provider: McpOAuthProvider;
|
|
687
700
|
productClientId?: string | null;
|
|
688
701
|
scopes: McpAccessTokenScope[];
|
|
702
|
+
toolProfile?: McpCloudToolProfile;
|
|
689
703
|
status: McpOAuthGrantStatus;
|
|
690
704
|
aiProfileId?: string | null;
|
|
691
705
|
aiProfileToken?: string | null;
|
|
@@ -6,6 +6,7 @@ export interface ReviewDocumentCommandComment {
|
|
|
6
6
|
export interface ReviewDocumentCommandInput {
|
|
7
7
|
workspaceId: string;
|
|
8
8
|
assetId: string;
|
|
9
|
+
documentVersion: number | null;
|
|
9
10
|
documentLabel?: string | null;
|
|
10
11
|
sessionId?: string | null;
|
|
11
12
|
title?: string | null;
|
|
@@ -43,7 +44,7 @@ export declare class DocumentReviewCommandError extends Error {
|
|
|
43
44
|
}
|
|
44
45
|
export interface ReviewDocumentCommandResult {
|
|
45
46
|
session: DocumentReviewSession;
|
|
46
|
-
sessionAction: 'reused' | 'created';
|
|
47
|
+
sessionAction: 'reused' | 'created' | 'created-for-current-version';
|
|
47
48
|
postedCommentIds: string[];
|
|
48
49
|
}
|
|
49
50
|
export declare function createDocumentReviewCommandService(deps: DocumentReviewCommandServiceDependencies): {
|
|
@@ -29,8 +29,9 @@ export function createDocumentReviewCommandService(deps) {
|
|
|
29
29
|
workspaceId: input.workspaceId,
|
|
30
30
|
assetId: input.assetId,
|
|
31
31
|
}).filter((candidate) => candidate.status === 'open');
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const currentVersionSessions = openSessions.filter((candidate) => candidate.documentVersion === input.documentVersion);
|
|
33
|
+
if (currentVersionSessions.length === 1) {
|
|
34
|
+
session = currentVersionSessions[0];
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
36
37
|
session = deps.createSession({
|
|
@@ -40,7 +41,9 @@ export function createDocumentReviewCommandService(deps) {
|
|
|
40
41
|
status: 'open',
|
|
41
42
|
actorId: input.actorId,
|
|
42
43
|
});
|
|
43
|
-
sessionAction =
|
|
44
|
+
sessionAction = currentVersionSessions.length === 0 && openSessions.length > 0
|
|
45
|
+
? 'created-for-current-version'
|
|
46
|
+
: 'created';
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
const postedCommentIds = [];
|
|
@@ -28,6 +28,7 @@ export interface PersistedSyncWatermarks {
|
|
|
28
28
|
taskRelationshipChangeKeys?: Map<string, string>;
|
|
29
29
|
initiativeWatermarks: Map<string, string>;
|
|
30
30
|
workstreamWatermarks: Map<string, string>;
|
|
31
|
+
planningIdentityWatermarks?: Map<string, string>;
|
|
31
32
|
aiProfileWatermarks: Map<string, string>;
|
|
32
33
|
aiProfileChangeKeys?: Map<string, string>;
|
|
33
34
|
taskforceAgentWatermarks?: Map<string, string>;
|
|
@@ -180,6 +180,7 @@ export function buildPersistedSyncWatermarksSnapshot(data) {
|
|
|
180
180
|
taskRelationshipChangeKeys: Array.from((data.taskRelationshipChangeKeys || new Map()).entries()),
|
|
181
181
|
initiativeWatermarks: Array.from(data.initiativeWatermarks.entries()),
|
|
182
182
|
workstreamWatermarks: Array.from(data.workstreamWatermarks.entries()),
|
|
183
|
+
planningIdentityWatermarks: Array.from((data.planningIdentityWatermarks || new Map()).entries()),
|
|
183
184
|
aiProfileWatermarks: Array.from(data.aiProfileWatermarks.entries()),
|
|
184
185
|
aiProfileChangeKeys: Array.from((data.aiProfileChangeKeys || new Map()).entries()),
|
|
185
186
|
taskforceAgentWatermarks: Array.from((data.taskforceAgentWatermarks || new Map()).entries()),
|
|
@@ -214,6 +215,7 @@ export function parsePersistedSyncWatermarksSnapshot(snapshot, taxonomyStateFing
|
|
|
214
215
|
taskRelationshipChangeKeys: new Map(Array.isArray(snapshot.taskRelationshipChangeKeys) ? snapshot.taskRelationshipChangeKeys : []),
|
|
215
216
|
initiativeWatermarks: new Map(Array.isArray(snapshot.initiativeWatermarks) ? snapshot.initiativeWatermarks : []),
|
|
216
217
|
workstreamWatermarks: new Map(Array.isArray(snapshot.workstreamWatermarks) ? snapshot.workstreamWatermarks : []),
|
|
218
|
+
planningIdentityWatermarks: new Map(Array.isArray(snapshot.planningIdentityWatermarks) ? snapshot.planningIdentityWatermarks : []),
|
|
217
219
|
aiProfileWatermarks: new Map(Array.isArray(snapshot.aiProfileWatermarks) ? snapshot.aiProfileWatermarks : []),
|
|
218
220
|
aiProfileChangeKeys: new Map(Array.isArray(snapshot.aiProfileChangeKeys) ? snapshot.aiProfileChangeKeys : []),
|
|
219
221
|
taskforceAgentWatermarks: new Map(Array.isArray(snapshot.taskforceAgentWatermarks) ? snapshot.taskforceAgentWatermarks : []),
|
|
@@ -6,7 +6,7 @@ export declare function useDurableLocalOutboxDrain(input: {
|
|
|
6
6
|
workspaceId: string;
|
|
7
7
|
mutationFingerprint: string;
|
|
8
8
|
authorityScope: object;
|
|
9
|
-
remoteServices: Pick<WorkspaceSyncEngineRemoteServices, 'pullWorkspaceContent' | 'abandonTransferReceipts' | '
|
|
9
|
+
remoteServices: Pick<WorkspaceSyncEngineRemoteServices, 'pullWorkspaceContent' | 'abandonTransferReceipts' | 'buildIndependentContentApplyCompletionGroup'> | null;
|
|
10
10
|
localServices: Pick<WorkspaceSyncEngineLocalServices, 'applyV2Batch'>;
|
|
11
11
|
isAuthorityCurrent?: (authorityScope: object) => boolean;
|
|
12
12
|
onHydratedEventIds?: (eventIds: string[]) => void;
|
|
@@ -104,7 +104,7 @@ export function useDurableTaskCreateMutation(input) {
|
|
|
104
104
|
clientRef.current = input.client || createLocalTaskCreateClient();
|
|
105
105
|
const participant = await getParticipant(workspaceId);
|
|
106
106
|
const selected = selectTaskCreateActivationInput(candidate);
|
|
107
|
-
const participantId = selected
|
|
107
|
+
const participantId = input.enabled && selected
|
|
108
108
|
? participant.prepareForDraft(await fingerprintTaskDraft(selected.localTask))
|
|
109
109
|
: participant.participantId;
|
|
110
110
|
let result;
|
|
@@ -2,6 +2,7 @@ import type { TaskItem } from '../../types.js';
|
|
|
2
2
|
import { createLocalTaskMetadataClient, type LocalTaskMetadataMutationResult } from '../../sync/v3/localTaskMetadataClient.js';
|
|
3
3
|
export type DurableTaskMetadataMutationAdapter = (taskId: string, patch: Partial<TaskItem>, options?: {
|
|
4
4
|
saveSource?: 'manual' | 'autosave';
|
|
5
|
+
expectedDetailRevision?: string;
|
|
5
6
|
}) => Promise<LocalTaskMetadataMutationResult | null>;
|
|
6
7
|
type LocalTaskMetadataClient = ReturnType<typeof createLocalTaskMetadataClient>;
|
|
7
8
|
export declare function useDurableTaskMetadataMutation(input: {
|
|
@@ -17,6 +17,7 @@ export function useDurableTaskMetadataMutation(input) {
|
|
|
17
17
|
entityId,
|
|
18
18
|
patch: patch,
|
|
19
19
|
...(options?.saveSource ? { saveSource: options.saveSource } : {}),
|
|
20
|
+
...(options?.expectedDetailRevision ? { expectedDetailRevision: options.expectedDetailRevision } : {}),
|
|
20
21
|
isAuthenticated: input.isAuthenticated,
|
|
21
22
|
dispatchEnabled: input.dispatchEnabled,
|
|
22
23
|
});
|
|
@@ -6,6 +6,7 @@ export type DurableTaskStatusMutationAdapter = (taskId: string, payload: {
|
|
|
6
6
|
assigneeIntent: DurableTaskStatusAssigneeIntent;
|
|
7
7
|
canceledReason: string | null;
|
|
8
8
|
metadataPatch?: Partial<TaskItem>;
|
|
9
|
+
expectedDetailRevision?: string;
|
|
9
10
|
}) => Promise<LocalTaskStatusMutationResult | null>;
|
|
10
11
|
type LocalTaskStatusClient = ReturnType<typeof createLocalTaskStatusClient>;
|
|
11
12
|
export declare function useDurableTaskStatusMutation(input: {
|
|
@@ -12,9 +12,12 @@ export declare function useLocalSyncCoordinatorSnapshot(input: {
|
|
|
12
12
|
pollIntervalMs?: number;
|
|
13
13
|
client?: LocalSyncCoordinatorBrowserClient;
|
|
14
14
|
}): {
|
|
15
|
+
activeCommandType: LocalSyncCoordinatorCommandType | null;
|
|
16
|
+
activePriorityCommandType: LocalSyncCoordinatorCommandType | null;
|
|
15
17
|
refresh: () => Promise<LocalSyncCoordinatorStatusResponse | null>;
|
|
16
18
|
issueCommand: (type: Exclude<LocalSyncCoordinatorCommandType, "SwitchWorkspace" | "TransferOwnership">, args?: unknown) => Promise<LocalSyncCoordinatorCommandRecord>;
|
|
17
19
|
signalWake: (source: "realtime" | "connectivity", eventIds?: string[]) => Promise<boolean>;
|
|
20
|
+
clearCredential: () => Promise<boolean>;
|
|
18
21
|
switchWorkspace: (targetWorkspaceId: string) => Promise<LocalSyncCoordinatorStatusResponse["state"]>;
|
|
19
22
|
transferOwnership: (targetMode: "server" | "browser-gateway") => Promise<LocalSyncCoordinatorStatusResponse["state"]>;
|
|
20
23
|
phase: LocalSyncCoordinatorSnapshotPhase;
|
|
@@ -15,8 +15,14 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
15
15
|
const requestEpochRef = useRef(0);
|
|
16
16
|
const commandLifecycleRef = useRef(null);
|
|
17
17
|
const priorityCommandLifecycleRef = useRef(null);
|
|
18
|
+
const [activeCommandType, setActiveCommandType] = useState(null);
|
|
19
|
+
const [activePriorityCommandType, setActivePriorityCommandType] = useState(null);
|
|
18
20
|
const snapshotRef = useRef(null);
|
|
19
21
|
snapshotRef.current = state.snapshot;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setActiveCommandType(null);
|
|
24
|
+
setActivePriorityCommandType(null);
|
|
25
|
+
}, [input.workspaceId]);
|
|
20
26
|
const resumePendingCommand = useCallback((scope) => {
|
|
21
27
|
const existing = commandLifecycleRef.current;
|
|
22
28
|
if (existing?.workspaceId === input.workspaceId)
|
|
@@ -36,14 +42,17 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
36
42
|
const lifecycle = {
|
|
37
43
|
workspaceId: input.workspaceId,
|
|
38
44
|
scope,
|
|
45
|
+
type: pending.type,
|
|
39
46
|
promise,
|
|
40
47
|
};
|
|
41
48
|
commandLifecycleRef.current = lifecycle;
|
|
49
|
+
setActiveCommandType(pending.type);
|
|
42
50
|
void promise
|
|
43
51
|
.catch(() => { })
|
|
44
52
|
.finally(() => {
|
|
45
53
|
if (commandLifecycleRef.current === lifecycle) {
|
|
46
54
|
commandLifecycleRef.current = null;
|
|
55
|
+
setActiveCommandType(null);
|
|
47
56
|
}
|
|
48
57
|
});
|
|
49
58
|
return promise;
|
|
@@ -68,14 +77,17 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
68
77
|
const lifecycle = {
|
|
69
78
|
workspaceId: input.workspaceId,
|
|
70
79
|
scope,
|
|
80
|
+
type: pending.type,
|
|
71
81
|
promise,
|
|
72
82
|
};
|
|
73
83
|
priorityCommandLifecycleRef.current = lifecycle;
|
|
84
|
+
setActivePriorityCommandType(pending.type);
|
|
74
85
|
void promise
|
|
75
86
|
.catch(() => { })
|
|
76
87
|
.finally(() => {
|
|
77
88
|
if (priorityCommandLifecycleRef.current === lifecycle) {
|
|
78
89
|
priorityCommandLifecycleRef.current = null;
|
|
90
|
+
setActivePriorityCommandType(null);
|
|
79
91
|
}
|
|
80
92
|
});
|
|
81
93
|
return promise;
|
|
@@ -250,7 +262,7 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
250
262
|
refresh,
|
|
251
263
|
]);
|
|
252
264
|
const issueCommand = useCallback(async (type, args = null) => {
|
|
253
|
-
|
|
265
|
+
let snapshot = snapshotRef.current;
|
|
254
266
|
if (!snapshot) {
|
|
255
267
|
throw new LocalSyncCoordinatorBrowserClientError('The local sync coordinator is not attached.', 'SYNC_COORDINATOR_UNAVAILABLE', 409);
|
|
256
268
|
}
|
|
@@ -258,21 +270,54 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
258
270
|
if (priorityCommand) {
|
|
259
271
|
const activePriority = priorityCommandLifecycleRef.current;
|
|
260
272
|
if (activePriority?.workspaceId === input.workspaceId) {
|
|
261
|
-
|
|
273
|
+
if (activePriority.type === type)
|
|
274
|
+
return activePriority.promise;
|
|
275
|
+
await activePriority.promise;
|
|
262
276
|
}
|
|
263
277
|
const resumedPriority = resumePendingPriorityCommand(scopeRef.current);
|
|
264
|
-
if (resumedPriority)
|
|
265
|
-
|
|
278
|
+
if (resumedPriority) {
|
|
279
|
+
const resumedType = priorityCommandLifecycleRef.current?.type;
|
|
280
|
+
if (resumedType === type)
|
|
281
|
+
return resumedPriority;
|
|
282
|
+
await resumedPriority;
|
|
283
|
+
}
|
|
266
284
|
}
|
|
267
285
|
const active = commandLifecycleRef.current;
|
|
268
|
-
if (
|
|
269
|
-
|
|
286
|
+
if (active?.workspaceId === input.workspaceId) {
|
|
287
|
+
if (active.type === type)
|
|
288
|
+
return active.promise;
|
|
289
|
+
const activeIsToggle = active.type === 'EnableSync' || active.type === 'DisableSync';
|
|
290
|
+
if (!priorityCommand || activeIsToggle)
|
|
291
|
+
await active.promise;
|
|
270
292
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
293
|
+
const resumed = resumePendingCommand(scopeRef.current);
|
|
294
|
+
if (resumed) {
|
|
295
|
+
const resumedType = commandLifecycleRef.current?.type;
|
|
296
|
+
if (resumedType === type)
|
|
297
|
+
return resumed;
|
|
298
|
+
const resumedIsToggle = resumedType === 'EnableSync' || resumedType === 'DisableSync';
|
|
299
|
+
if (!priorityCommand || resumedIsToggle)
|
|
274
300
|
await resumed;
|
|
275
301
|
}
|
|
302
|
+
if (!priorityCommand) {
|
|
303
|
+
const activePriority = priorityCommandLifecycleRef.current;
|
|
304
|
+
if (activePriority?.workspaceId === input.workspaceId) {
|
|
305
|
+
if (activePriority.type === type)
|
|
306
|
+
return activePriority.promise;
|
|
307
|
+
await activePriority.promise;
|
|
308
|
+
}
|
|
309
|
+
const resumedPriority = resumePendingPriorityCommand(scopeRef.current);
|
|
310
|
+
if (resumedPriority) {
|
|
311
|
+
const resumedType = priorityCommandLifecycleRef.current?.type;
|
|
312
|
+
if (resumedType === type)
|
|
313
|
+
return resumedPriority;
|
|
314
|
+
await resumedPriority;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
snapshot = snapshotRef.current;
|
|
318
|
+
if (!snapshot) {
|
|
319
|
+
throw new LocalSyncCoordinatorBrowserClientError('The local sync coordinator is not attached.', 'SYNC_COORDINATOR_UNAVAILABLE', 409);
|
|
320
|
+
}
|
|
276
321
|
const envelope = {
|
|
277
322
|
commandId: crypto.randomUUID(),
|
|
278
323
|
workspaceId: input.workspaceId,
|
|
@@ -290,15 +335,28 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
290
335
|
const lifecycle = {
|
|
291
336
|
workspaceId: input.workspaceId,
|
|
292
337
|
scope: scopeRef.current,
|
|
338
|
+
type,
|
|
293
339
|
promise: commandPromise,
|
|
294
340
|
};
|
|
295
341
|
const lifecycleRef = priorityCommand
|
|
296
342
|
? priorityCommandLifecycleRef
|
|
297
343
|
: commandLifecycleRef;
|
|
298
344
|
lifecycleRef.current = lifecycle;
|
|
345
|
+
if (priorityCommand) {
|
|
346
|
+
setActivePriorityCommandType(type);
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
setActiveCommandType(type);
|
|
350
|
+
}
|
|
299
351
|
const finalize = () => {
|
|
300
352
|
if (lifecycleRef.current === lifecycle) {
|
|
301
353
|
lifecycleRef.current = null;
|
|
354
|
+
if (priorityCommand) {
|
|
355
|
+
setActivePriorityCommandType(null);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
setActiveCommandType(null);
|
|
359
|
+
}
|
|
302
360
|
}
|
|
303
361
|
if (scopeRef.current === lifecycle.scope
|
|
304
362
|
&& input.workspaceId === lifecycle.workspaceId) {
|
|
@@ -326,6 +384,18 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
326
384
|
});
|
|
327
385
|
return true;
|
|
328
386
|
}, [client, input.workspaceId]);
|
|
387
|
+
const clearCredential = useCallback(async () => {
|
|
388
|
+
const snapshot = snapshotRef.current;
|
|
389
|
+
if (!snapshot || !input.workspaceId)
|
|
390
|
+
return false;
|
|
391
|
+
await client.clearCredential({
|
|
392
|
+
workspaceId: input.workspaceId,
|
|
393
|
+
coordinatorGeneration: snapshot.state.coordinatorGeneration,
|
|
394
|
+
});
|
|
395
|
+
snapshotRef.current = null;
|
|
396
|
+
setState({ phase: 'idle', snapshot: null, error: null });
|
|
397
|
+
return true;
|
|
398
|
+
}, [client, input.workspaceId]);
|
|
329
399
|
const switchWorkspace = useCallback(async (targetWorkspaceId) => {
|
|
330
400
|
const snapshot = snapshotRef.current;
|
|
331
401
|
const expectedActiveWorkspaceId = String(snapshot?.state.activeWorkspaceId || '').trim();
|
|
@@ -381,12 +451,18 @@ export function useLocalSyncCoordinatorSnapshot(input) {
|
|
|
381
451
|
}, [client, input.workspaceId, refresh]);
|
|
382
452
|
return useMemo(() => ({
|
|
383
453
|
...state,
|
|
454
|
+
activeCommandType,
|
|
455
|
+
activePriorityCommandType,
|
|
384
456
|
refresh,
|
|
385
457
|
issueCommand,
|
|
386
458
|
signalWake,
|
|
459
|
+
clearCredential,
|
|
387
460
|
switchWorkspace,
|
|
388
461
|
transferOwnership,
|
|
389
462
|
}), [
|
|
463
|
+
activeCommandType,
|
|
464
|
+
activePriorityCommandType,
|
|
465
|
+
clearCredential,
|
|
390
466
|
issueCommand,
|
|
391
467
|
refresh,
|
|
392
468
|
signalWake,
|
|
@@ -5,21 +5,24 @@ interface SaveWorkspaceCloudSyncSettingsResult {
|
|
|
5
5
|
interface UseSyncStatusControlsInput {
|
|
6
6
|
canManageWorkspaceSync: boolean;
|
|
7
7
|
workspaceCloudSyncEnabled: boolean;
|
|
8
|
+
persistedToggleIntent?: WorkspaceSyncToggleIntent;
|
|
8
9
|
saveWorkspaceCloudSyncSettings: (input: {
|
|
9
10
|
enabled: boolean;
|
|
10
11
|
}) => Promise<SaveWorkspaceCloudSyncSettingsResult>;
|
|
11
12
|
}
|
|
13
|
+
export type WorkspaceSyncToggleIntent = 'enabling' | 'disabling' | null;
|
|
12
14
|
interface UseSyncStatusControlsResult {
|
|
13
15
|
showSyncStatusModal: boolean;
|
|
14
16
|
showSyncEnableWarning: boolean;
|
|
15
17
|
workspaceSyncToggleBusy: boolean;
|
|
16
18
|
workspaceSyncError: string | null;
|
|
17
19
|
syncControlBusy: boolean;
|
|
20
|
+
syncControlIntent: WorkspaceSyncToggleIntent;
|
|
18
21
|
openSyncStatusModal: () => void;
|
|
19
22
|
closeSyncStatusModal: () => void;
|
|
20
23
|
handleWorkspaceSyncToggle: (enabled: boolean) => Promise<void>;
|
|
21
24
|
cancelSyncEnableWarning: () => void;
|
|
22
25
|
confirmSyncEnableWarning: () => void;
|
|
23
26
|
}
|
|
24
|
-
export declare function useSyncStatusControls({ canManageWorkspaceSync, workspaceCloudSyncEnabled, saveWorkspaceCloudSyncSettings, }: UseSyncStatusControlsInput): UseSyncStatusControlsResult;
|
|
27
|
+
export declare function useSyncStatusControls({ canManageWorkspaceSync, workspaceCloudSyncEnabled, persistedToggleIntent, saveWorkspaceCloudSyncSettings, }: UseSyncStatusControlsInput): UseSyncStatusControlsResult;
|
|
25
28
|
export {};
|
|
@@ -1,23 +1,58 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
export function useSyncStatusControls({ canManageWorkspaceSync, workspaceCloudSyncEnabled, saveWorkspaceCloudSyncSettings, }) {
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
export function useSyncStatusControls({ canManageWorkspaceSync, workspaceCloudSyncEnabled, persistedToggleIntent = null, saveWorkspaceCloudSyncSettings, }) {
|
|
3
3
|
const [showSyncStatusModal, setShowSyncStatusModal] = useState(false);
|
|
4
4
|
const [showSyncEnableWarning, setShowSyncEnableWarning] = useState(false);
|
|
5
5
|
const [workspaceSyncToggleBusy, setWorkspaceSyncToggleBusy] = useState(false);
|
|
6
6
|
const [workspaceSyncError, setWorkspaceSyncError] = useState(null);
|
|
7
|
+
const [requestedSyncEnabled, setRequestedSyncEnabled] = useState(null);
|
|
8
|
+
const inFlightToggleRef = useRef(null);
|
|
9
|
+
const requestedToggleIntent = requestedSyncEnabled === null
|
|
10
|
+
? null
|
|
11
|
+
: requestedSyncEnabled ? 'enabling' : 'disabling';
|
|
12
|
+
const syncControlIntent = requestedToggleIntent || persistedToggleIntent;
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (requestedSyncEnabled !== null && requestedSyncEnabled === workspaceCloudSyncEnabled) {
|
|
15
|
+
setRequestedSyncEnabled(null);
|
|
16
|
+
}
|
|
17
|
+
}, [requestedSyncEnabled, workspaceCloudSyncEnabled]);
|
|
7
18
|
const persistWorkspaceSyncToggle = useCallback(async (enabled) => {
|
|
8
19
|
if (!canManageWorkspaceSync)
|
|
9
20
|
return;
|
|
10
21
|
setWorkspaceSyncError(null);
|
|
22
|
+
setRequestedSyncEnabled(enabled);
|
|
11
23
|
setWorkspaceSyncToggleBusy(true);
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
finally {
|
|
19
|
-
setWorkspaceSyncToggleBusy(false);
|
|
24
|
+
while (inFlightToggleRef.current) {
|
|
25
|
+
const active = inFlightToggleRef.current;
|
|
26
|
+
if (active.enabled === enabled)
|
|
27
|
+
return active.promise;
|
|
28
|
+
await active.promise;
|
|
20
29
|
}
|
|
30
|
+
setRequestedSyncEnabled(enabled);
|
|
31
|
+
setWorkspaceSyncToggleBusy(true);
|
|
32
|
+
let commandPromise;
|
|
33
|
+
commandPromise = (async () => {
|
|
34
|
+
try {
|
|
35
|
+
const result = await saveWorkspaceCloudSyncSettings({ enabled });
|
|
36
|
+
if (!result.success) {
|
|
37
|
+
setRequestedSyncEnabled(null);
|
|
38
|
+
setWorkspaceSyncError(result.error || (enabled ? 'Failed to enable sync.' : 'Failed to disable sync.'));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
setRequestedSyncEnabled(null);
|
|
43
|
+
setWorkspaceSyncError(error instanceof Error && error.message.trim()
|
|
44
|
+
? error.message
|
|
45
|
+
: enabled ? 'Failed to enable sync.' : 'Failed to disable sync.');
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
if (inFlightToggleRef.current?.promise === commandPromise) {
|
|
49
|
+
inFlightToggleRef.current = null;
|
|
50
|
+
setWorkspaceSyncToggleBusy(false);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
})();
|
|
54
|
+
inFlightToggleRef.current = { enabled, promise: commandPromise };
|
|
55
|
+
return commandPromise;
|
|
21
56
|
}, [
|
|
22
57
|
canManageWorkspaceSync,
|
|
23
58
|
saveWorkspaceCloudSyncSettings
|
|
@@ -50,7 +85,8 @@ export function useSyncStatusControls({ canManageWorkspaceSync, workspaceCloudSy
|
|
|
50
85
|
showSyncEnableWarning,
|
|
51
86
|
workspaceSyncToggleBusy,
|
|
52
87
|
workspaceSyncError,
|
|
53
|
-
syncControlBusy: workspaceSyncToggleBusy,
|
|
88
|
+
syncControlBusy: workspaceSyncToggleBusy || syncControlIntent !== null,
|
|
89
|
+
syncControlIntent,
|
|
54
90
|
openSyncStatusModal,
|
|
55
91
|
closeSyncStatusModal,
|
|
56
92
|
handleWorkspaceSyncToggle,
|
|
@@ -44,6 +44,7 @@ export async function isConclusiveTaskHttpResponse(response) {
|
|
|
44
44
|
'TASK_ATTACHMENT_LINKS_INVALID',
|
|
45
45
|
'TASK_COMMENT_INVALID',
|
|
46
46
|
'TASK_COMMENT_IDENTITY_CONFLICT',
|
|
47
|
+
'TASK_DETAIL_REVISION_CONFLICT',
|
|
47
48
|
]).has(code);
|
|
48
49
|
}
|
|
49
50
|
function stableTaskCreateCandidate(candidate) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface UseCloudTaskSearchInput {
|
|
2
|
+
query: string;
|
|
3
|
+
runtimeMode: 'local' | 'cloud';
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
scope: 'active' | 'archive';
|
|
7
|
+
debounceMs?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
maxMatches?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function useCloudTaskSearch({ query, runtimeMode, workspaceId, enabled, scope, debounceMs, pageSize, maxMatches, }: UseCloudTaskSearchInput): ReadonlySet<string>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { normalizeTaskSearchQuery } from '../../utils/taskSearch';
|
|
3
|
+
export function useCloudTaskSearch({ query, runtimeMode, workspaceId, enabled, scope, debounceMs = 250, pageSize = 50, maxMatches = 500, }) {
|
|
4
|
+
const [matchIds, setMatchIds] = useState(() => new Set());
|
|
5
|
+
const requestSequenceRef = useRef(0);
|
|
6
|
+
const normalizedQuery = useMemo(() => normalizeTaskSearchQuery(query).raw, [query]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
requestSequenceRef.current += 1;
|
|
9
|
+
const requestSequence = requestSequenceRef.current;
|
|
10
|
+
if (!enabled || runtimeMode !== 'cloud' || !normalizedQuery || !workspaceId.trim()) {
|
|
11
|
+
setMatchIds((current) => current.size === 0 ? current : new Set());
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
setMatchIds((current) => current.size === 0 ? current : new Set());
|
|
15
|
+
const abortController = new AbortController();
|
|
16
|
+
const timer = window.setTimeout(() => {
|
|
17
|
+
void (async () => {
|
|
18
|
+
const collected = new Set();
|
|
19
|
+
let offset = 0;
|
|
20
|
+
let scanned = 0;
|
|
21
|
+
const boundedPageSize = Math.max(1, Math.min(50, Math.trunc(pageSize)));
|
|
22
|
+
const boundedMaxMatches = Math.max(1, Math.trunc(maxMatches));
|
|
23
|
+
try {
|
|
24
|
+
while (scanned < boundedMaxMatches) {
|
|
25
|
+
const limit = Math.min(boundedPageSize, boundedMaxMatches - scanned);
|
|
26
|
+
const params = new URLSearchParams({
|
|
27
|
+
query: query.trim(),
|
|
28
|
+
scope,
|
|
29
|
+
limit: String(limit),
|
|
30
|
+
offset: String(offset),
|
|
31
|
+
});
|
|
32
|
+
const response = await fetch(`/api/taskforce/tasks/search?${params.toString()}`, {
|
|
33
|
+
signal: abortController.signal,
|
|
34
|
+
});
|
|
35
|
+
if (!response.ok)
|
|
36
|
+
throw new Error(`Task search failed (${response.status}).`);
|
|
37
|
+
const body = await response.json();
|
|
38
|
+
const matches = body.matches || [];
|
|
39
|
+
scanned += matches.length;
|
|
40
|
+
for (const match of matches) {
|
|
41
|
+
const id = String(match?.id || '').trim();
|
|
42
|
+
if (id)
|
|
43
|
+
collected.add(id);
|
|
44
|
+
}
|
|
45
|
+
if (body.pagination?.hasMore !== true)
|
|
46
|
+
break;
|
|
47
|
+
const nextOffset = Number(body.pagination?.nextOffset);
|
|
48
|
+
if (!Number.isInteger(nextOffset) || nextOffset <= offset)
|
|
49
|
+
break;
|
|
50
|
+
offset = nextOffset;
|
|
51
|
+
}
|
|
52
|
+
if (!abortController.signal.aborted && requestSequenceRef.current === requestSequence) {
|
|
53
|
+
setMatchIds(collected);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (abortController.signal.aborted || requestSequenceRef.current !== requestSequence)
|
|
58
|
+
return;
|
|
59
|
+
// Server search augments the existing client matcher. On failure, retain
|
|
60
|
+
// the client-visible metadata results instead of blocking the task board.
|
|
61
|
+
setMatchIds(new Set());
|
|
62
|
+
}
|
|
63
|
+
})();
|
|
64
|
+
}, Math.max(0, debounceMs));
|
|
65
|
+
return () => {
|
|
66
|
+
window.clearTimeout(timer);
|
|
67
|
+
abortController.abort('superseded');
|
|
68
|
+
};
|
|
69
|
+
}, [debounceMs, enabled, maxMatches, normalizedQuery, pageSize, query, runtimeMode, scope, workspaceId]);
|
|
70
|
+
return matchIds;
|
|
71
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TaskDescriptionImageDraftResolution = 'promote' | 'discard';
|
|
2
|
+
type DraftRecoveryFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
3
|
+
interface UseTaskDescriptionImageDraftRecoveryOptions {
|
|
4
|
+
fetchImpl?: DraftRecoveryFetch;
|
|
5
|
+
storage?: Storage | null;
|
|
6
|
+
now?: () => number;
|
|
7
|
+
}
|
|
8
|
+
export declare const TASK_DESCRIPTION_IMAGE_DRAFT_RECOVERY_STORAGE_KEY = "taskforce.task-description-image-draft-recovery.v1";
|
|
9
|
+
export declare function taskDescriptionImageDraftRetryDelay(attempts: number): number;
|
|
10
|
+
export declare function useTaskDescriptionImageDraftRecovery(workspaceId: string, createdByUserId: string, options?: UseTaskDescriptionImageDraftRecoveryOptions): {
|
|
11
|
+
resolveDraft: (input: {
|
|
12
|
+
draftUploadId: string;
|
|
13
|
+
resolution: TaskDescriptionImageDraftResolution;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|