@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
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* GET /api/taskforce/admin/collaboration-telemetry
|
|
22
22
|
* PATCH /api/taskforce/admin/system-users/:id/disable
|
|
23
23
|
* PATCH /api/taskforce/admin/system-users/:id/beta-access
|
|
24
|
+
* PATCH /api/taskforce/admin/system-users/:id/feature-grants/:featureKey
|
|
24
25
|
* PATCH /api/taskforce/admin/system-users/:id/verify-email
|
|
25
26
|
* GET/POST /api/taskforce/admin/email-settings
|
|
26
27
|
* GET /api/taskforce/admin/email-settings/health
|
|
@@ -48,8 +49,10 @@
|
|
|
48
49
|
* GET/POST /oauth/mcp/authorize
|
|
49
50
|
* POST /oauth/mcp/token
|
|
50
51
|
* GET/POST /api/taskforce/settings/mcp/tokens (+ revoke, regenerate)
|
|
52
|
+
* PATCH /api/taskforce/settings/mcp/tokens/:id/tool-profile
|
|
51
53
|
* GET /api/taskforce/settings/mcp/connectors
|
|
52
54
|
* POST /api/taskforce/settings/mcp/connectors/:id/disconnect
|
|
55
|
+
* PATCH /api/taskforce/settings/mcp/connectors/:id/tool-profile
|
|
53
56
|
* POST /api/taskforce/settings/mcp/test-connection
|
|
54
57
|
*/
|
|
55
58
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
@@ -68,6 +71,7 @@ export interface AdminRouteDependencies {
|
|
|
68
71
|
requestRole: (req: IncomingMessage) => string;
|
|
69
72
|
ensureAppAccess: (req: IncomingMessage, res: ServerResponse) => boolean;
|
|
70
73
|
ensureAdminRole: (req: IncomingMessage) => boolean;
|
|
74
|
+
ensureWorkspaceAdminRole: (req: IncomingMessage, workspaceIdOverride?: string | null) => boolean;
|
|
71
75
|
ensureCloudPlanData: (req: IncomingMessage, res: ServerResponse) => boolean;
|
|
72
76
|
requireCloudRuntime: (res: ServerResponse, feature: string) => boolean;
|
|
73
77
|
resolveAuthenticatedUserId: (req: IncomingMessage) => string;
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* GET /api/taskforce/admin/collaboration-telemetry
|
|
22
22
|
* PATCH /api/taskforce/admin/system-users/:id/disable
|
|
23
23
|
* PATCH /api/taskforce/admin/system-users/:id/beta-access
|
|
24
|
+
* PATCH /api/taskforce/admin/system-users/:id/feature-grants/:featureKey
|
|
24
25
|
* PATCH /api/taskforce/admin/system-users/:id/verify-email
|
|
25
26
|
* GET/POST /api/taskforce/admin/email-settings
|
|
26
27
|
* GET /api/taskforce/admin/email-settings/health
|
|
@@ -48,14 +49,17 @@
|
|
|
48
49
|
* GET/POST /oauth/mcp/authorize
|
|
49
50
|
* POST /oauth/mcp/token
|
|
50
51
|
* GET/POST /api/taskforce/settings/mcp/tokens (+ revoke, regenerate)
|
|
52
|
+
* PATCH /api/taskforce/settings/mcp/tokens/:id/tool-profile
|
|
51
53
|
* GET /api/taskforce/settings/mcp/connectors
|
|
52
54
|
* POST /api/taskforce/settings/mcp/connectors/:id/disconnect
|
|
55
|
+
* PATCH /api/taskforce/settings/mcp/connectors/:id/tool-profile
|
|
53
56
|
* POST /api/taskforce/settings/mcp/test-connection
|
|
54
57
|
*/
|
|
55
58
|
import * as fs from 'fs';
|
|
56
59
|
import * as path from 'path';
|
|
57
60
|
import { TaskforceRuleError } from '../../core/Taskforce.js';
|
|
58
61
|
import { classifyMcpOAuthClientProduct } from '../../mcp/clientRegistry.js';
|
|
62
|
+
import { getCloudMcpToolProfileMembership } from '../../mcp/toolProfiles.js';
|
|
59
63
|
import { escapeHtml, formatApiErrorResponse, parseFormBody, parseJsonBody } from './primitives.js';
|
|
60
64
|
import { resolveRequestAccess } from '../auth.js';
|
|
61
65
|
import { sendEmail } from '../email.js';
|
|
@@ -70,19 +74,27 @@ import { randomUUID } from 'crypto';
|
|
|
70
74
|
import { resolveDeploymentConfig } from '../../config/deployment.js';
|
|
71
75
|
import { getTaskforceCloudEnvironmentConfig, resolveTaskforceCloudEnvironmentFromBaseUrl, resolveTaskforceMcpBaseUrlFromBaseUrl } from '../../config/cloudEnvironment.js';
|
|
72
76
|
import { makeHandleCloudMcpRequest, resolveErrorStatusCode } from './shared.js';
|
|
77
|
+
import * as mcpRuntime from '../../mcp/runtime.js';
|
|
73
78
|
import { buildAuthBehavior, buildSiteBehavior, getRouteEmailConfig, resolvePublicAuthBaseUrl, resolveRuntimeConfigBaseUrl, } from './authSupport.js';
|
|
74
79
|
import { applyWorkspaceRepair, scanWorkspaceRepair } from '../../sync/workspaceRepair.js';
|
|
75
80
|
import { testMintAppleClientSecret } from '../auth/providers/appleClientSecret.js';
|
|
76
81
|
import { isAiProfileAvatarStorageKey } from '../../utils/aiProfileAvatarPaths.js';
|
|
82
|
+
import { WorkspaceSyncContentPullObligationStore } from '../../sync/engine/workspaceSyncContentPullObligationStore.js';
|
|
83
|
+
import { isSupportedInternalUserFeatureKey } from '../../shared/userFeatureGrants.js';
|
|
77
84
|
const PRICING_PAGE_DESCRIPTION_MAX_LENGTH = 2000;
|
|
78
85
|
const OPENAI_APPS_CHALLENGE_TOKEN = 'o9iBeJDuKPMtnKm5-B8OROga3bWDkJS6PBIg6JT9Izs';
|
|
79
86
|
// === SECTION: Registration ===
|
|
80
87
|
export function registerAdminRoutes(deps) {
|
|
81
|
-
const { addRoute, core, context, requestWorkspaceId, requestUserId, requestRole, ensureAppAccess, ensureAdminRole, ensureCloudPlanData, requireCloudRuntime, resolveAuthenticatedUserId, resolveAdminRequestActor, auditAdminAction, resolveEffectiveObjectStorageConfig, getObjectStorageClient, taskAssetStore, publishedContentResolver, normalizeDocumentPathInput, ensureWithinDir, getAssetMetadata, markAssetDeleted, clearAssetDeleted, removeAssetMetadata, getStorageTelemetry, appendStorageTelemetry, getStorageIntegrityHistory, appendStorageIntegrityHistory, getDocumentPurgeHistory, appendDocumentPurgeHistory, getCollaborationTelemetry, isCollaborationPolicyEnabled, normalizeMcpOauthScopeString, MCP_TOKEN_SCOPE_VALUES, MCP_WRITE_RATE_LIMIT_ENABLED, MCP_WRITE_RATE_LIMIT_ACTOR_MAX_REQUESTS, MCP_WRITE_RATE_LIMIT_WORKSPACE_MAX_REQUESTS, MCP_WRITE_RATE_LIMIT_WINDOW_MS, } = deps;
|
|
88
|
+
const { addRoute, core, context, requestWorkspaceId, requestUserId, requestRole, ensureAppAccess, ensureAdminRole, ensureWorkspaceAdminRole, ensureCloudPlanData, requireCloudRuntime, resolveAuthenticatedUserId, resolveAdminRequestActor, auditAdminAction, resolveEffectiveObjectStorageConfig, getObjectStorageClient, taskAssetStore, publishedContentResolver, normalizeDocumentPathInput, ensureWithinDir, getAssetMetadata, markAssetDeleted, clearAssetDeleted, removeAssetMetadata, getStorageTelemetry, appendStorageTelemetry, getStorageIntegrityHistory, appendStorageIntegrityHistory, getDocumentPurgeHistory, appendDocumentPurgeHistory, getCollaborationTelemetry, isCollaborationPolicyEnabled, normalizeMcpOauthScopeString, MCP_TOKEN_SCOPE_VALUES, MCP_WRITE_RATE_LIMIT_ENABLED, MCP_WRITE_RATE_LIMIT_ACTOR_MAX_REQUESTS, MCP_WRITE_RATE_LIMIT_WORKSPACE_MAX_REQUESTS, MCP_WRITE_RATE_LIMIT_WINDOW_MS, } = deps;
|
|
82
89
|
const baseVirusScanConfig = resolveVirusScanConfigFromEnv(process.env);
|
|
83
90
|
const workspaceAssetStore = typeof core.getDatabaseAdapter === 'function' && typeof core.getTenantId === 'function'
|
|
84
91
|
? new WorkspaceAssetStore(core.getDatabaseAdapter(), core.getTenantId())
|
|
85
92
|
: null;
|
|
93
|
+
const mcpToolProfileOptions = ['default', 'extended'].map((id) => ({
|
|
94
|
+
id,
|
|
95
|
+
label: id === 'extended' ? 'All cloud tools' : 'Standard',
|
|
96
|
+
toolCount: getCloudMcpToolProfileMembership(id).length,
|
|
97
|
+
}));
|
|
86
98
|
const listReferencedAiProfileAvatarStorageKeys = (workspaceId) => {
|
|
87
99
|
const referenced = new Set();
|
|
88
100
|
const profiles = typeof core.listAiProfiles === 'function'
|
|
@@ -334,6 +346,8 @@ export function registerAdminRoutes(deps) {
|
|
|
334
346
|
const handleCloudMcpRequest = makeHandleCloudMcpRequest(core, {
|
|
335
347
|
ensureAppAccess,
|
|
336
348
|
resolveAuthenticatedUserId,
|
|
349
|
+
// Keep the production factory unchanged while preserving the route-test injection seam.
|
|
350
|
+
createMcpServer: (options) => mcpRuntime.createTaskforceMcpServer(options),
|
|
337
351
|
writeRateLimit: {
|
|
338
352
|
enabled: MCP_WRITE_RATE_LIMIT_ENABLED,
|
|
339
353
|
actorMaxRequests: MCP_WRITE_RATE_LIMIT_ACTOR_MAX_REQUESTS,
|
|
@@ -1039,6 +1053,42 @@ export function registerAdminRoutes(deps) {
|
|
|
1039
1053
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
1040
1054
|
res.end(JSON.stringify({ success: true }));
|
|
1041
1055
|
});
|
|
1056
|
+
// PATCH /api/taskforce/admin/system-users/:id/feature-grants/:featureKey - Grant/revoke an internal user feature
|
|
1057
|
+
addRoute('PATCH', '/api/taskforce/admin/system-users/:id/feature-grants/:featureKey', async (req, res, params) => {
|
|
1058
|
+
if (!ensureAdminRole(req)) {
|
|
1059
|
+
res.writeHead(403, { 'Content-Type': 'application/json' });
|
|
1060
|
+
res.end(JSON.stringify({ error: 'Forbidden: system admin role required.' }));
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
if (!requireCloudRuntime(res, 'Internal user feature grants'))
|
|
1064
|
+
return;
|
|
1065
|
+
const featureKey = String(params.featureKey || '').trim();
|
|
1066
|
+
if (!isSupportedInternalUserFeatureKey(featureKey)) {
|
|
1067
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
1068
|
+
res.end(JSON.stringify({ error: 'Unsupported internal feature key.' }));
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
const body = await parseJsonBody(req);
|
|
1072
|
+
if (typeof body?.enabled !== 'boolean') {
|
|
1073
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
1074
|
+
res.end(JSON.stringify({ error: 'enabled must be a boolean.' }));
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
const actor = resolveAdminRequestActor(req);
|
|
1078
|
+
const success = core.setUserFeatureGrant(params.id, featureKey, body.enabled, actor.userId);
|
|
1079
|
+
if (!success) {
|
|
1080
|
+
res.writeHead(404, { 'Content-Type': 'application/json' });
|
|
1081
|
+
res.end(JSON.stringify({ error: 'User not found' }));
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
auditAdminAction(req, 'set-user-feature-grant', {
|
|
1085
|
+
targetUserId: params.id,
|
|
1086
|
+
featureKey,
|
|
1087
|
+
enabled: body.enabled,
|
|
1088
|
+
});
|
|
1089
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
1090
|
+
res.end(JSON.stringify({ success: true, featureKey, enabled: body.enabled }));
|
|
1091
|
+
});
|
|
1042
1092
|
// PATCH /api/taskforce/admin/system-users/:id/verify-email - Mark a user's email as verified
|
|
1043
1093
|
addRoute('PATCH', '/api/taskforce/admin/system-users/:id/verify-email', async (req, res, params) => {
|
|
1044
1094
|
if (!ensureAdminRole(req)) {
|
|
@@ -1953,6 +2003,8 @@ export function registerAdminRoutes(deps) {
|
|
|
1953
2003
|
workspaceAssetStore,
|
|
1954
2004
|
publishedContentResolver,
|
|
1955
2005
|
repairMissingAssetLinks: true,
|
|
2006
|
+
repairMissingContentFiles: body?.repairMissingContentFiles === true,
|
|
2007
|
+
contentPullObligationStore: new WorkspaceSyncContentPullObligationStore(core.getDatabaseAdapter()),
|
|
1956
2008
|
aiProfiles: typeof core.listAiProfiles === 'function'
|
|
1957
2009
|
? core.listAiProfiles(workspaceId, { includeArchived: true }) || []
|
|
1958
2010
|
: [],
|
|
@@ -2750,7 +2802,7 @@ export function registerAdminRoutes(deps) {
|
|
|
2750
2802
|
try {
|
|
2751
2803
|
const result = core.listMcpAccessTokens({ userId, workspaceId: requestWorkspaceId(req), page, pageSize });
|
|
2752
2804
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
2753
|
-
res.end(JSON.stringify({ success: true, ...result }));
|
|
2805
|
+
res.end(JSON.stringify({ success: true, ...result, profileOptions: mcpToolProfileOptions }));
|
|
2754
2806
|
}
|
|
2755
2807
|
catch (error) {
|
|
2756
2808
|
const statusCode = resolveErrorStatusCode(error);
|
|
@@ -2772,7 +2824,7 @@ export function registerAdminRoutes(deps) {
|
|
|
2772
2824
|
try {
|
|
2773
2825
|
const items = core.listMcpOAuthConnectorGrants({ userId, workspaceId: requestWorkspaceId(req), provider: provider || null });
|
|
2774
2826
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
2775
|
-
res.end(JSON.stringify({ success: true, items }));
|
|
2827
|
+
res.end(JSON.stringify({ success: true, items, profileOptions: mcpToolProfileOptions }));
|
|
2776
2828
|
}
|
|
2777
2829
|
catch (error) {
|
|
2778
2830
|
const statusCode = resolveErrorStatusCode(error);
|
|
@@ -2802,6 +2854,34 @@ export function registerAdminRoutes(deps) {
|
|
|
2802
2854
|
res.end(JSON.stringify({ success: false, error: error.message, code: error?.code || 'MCP_CONNECTOR_DISCONNECT_FAILED' }));
|
|
2803
2855
|
}
|
|
2804
2856
|
});
|
|
2857
|
+
addRoute('PATCH', '/api/taskforce/settings/mcp/connectors/:id/tool-profile', async (req, res, params) => {
|
|
2858
|
+
if (!ensureAppAccess(req, res))
|
|
2859
|
+
return;
|
|
2860
|
+
const userId = resolveAuthenticatedUserId(req);
|
|
2861
|
+
if (!userId || userId === 'anonymous') {
|
|
2862
|
+
res.writeHead(401, { 'Content-Type': 'application/json' });
|
|
2863
|
+
res.end(JSON.stringify({ success: false, error: 'Authentication required.' }));
|
|
2864
|
+
return;
|
|
2865
|
+
}
|
|
2866
|
+
const wid = requestWorkspaceId(req);
|
|
2867
|
+
if (!ensureWorkspaceAdminRole(req, wid)) {
|
|
2868
|
+
res.writeHead(403, { 'Content-Type': 'application/json' });
|
|
2869
|
+
res.end(JSON.stringify({ success: false, error: 'Workspace owner or admin access is required.', code: 'MCP_TOOL_PROFILE_ADMIN_REQUIRED' }));
|
|
2870
|
+
return;
|
|
2871
|
+
}
|
|
2872
|
+
const body = await parseJsonBody(req);
|
|
2873
|
+
try {
|
|
2874
|
+
const updated = core.updateMcpOAuthConnectorGrantToolProfile({ actorUserId: userId, workspaceId: wid, grantId: params.id, toolProfile: body?.toolProfile });
|
|
2875
|
+
core.addAdminAuditLog({ action: 'mcp.connector.tool_profile.update', actorUserId: userId, actorRole: requestRole(req), workspaceId: wid, details: { grantId: updated.record.id, provider: updated.record.provider, clientId: updated.record.clientId, previousToolProfile: updated.previousToolProfile, toolProfile: updated.record.toolProfile } });
|
|
2876
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
2877
|
+
res.end(JSON.stringify({ success: true, record: updated.record }));
|
|
2878
|
+
}
|
|
2879
|
+
catch (error) {
|
|
2880
|
+
const statusCode = resolveErrorStatusCode(error);
|
|
2881
|
+
res.writeHead(statusCode, { 'Content-Type': 'application/json' });
|
|
2882
|
+
res.end(JSON.stringify({ success: false, error: error.message, code: error?.code || 'MCP_CONNECTOR_TOOL_PROFILE_UPDATE_FAILED' }));
|
|
2883
|
+
}
|
|
2884
|
+
});
|
|
2805
2885
|
addRoute('POST', '/api/taskforce/settings/mcp/tokens', async (req, res) => {
|
|
2806
2886
|
if (!ensureAppAccess(req, res))
|
|
2807
2887
|
return;
|
|
@@ -2883,6 +2963,34 @@ export function registerAdminRoutes(deps) {
|
|
|
2883
2963
|
res.end(JSON.stringify({ success: false, error: error.message, code: error?.code || 'MCP_TOKEN_REGENERATE_FAILED' }));
|
|
2884
2964
|
}
|
|
2885
2965
|
});
|
|
2966
|
+
addRoute('PATCH', '/api/taskforce/settings/mcp/tokens/:id/tool-profile', async (req, res, params) => {
|
|
2967
|
+
if (!ensureAppAccess(req, res))
|
|
2968
|
+
return;
|
|
2969
|
+
const userId = resolveAuthenticatedUserId(req);
|
|
2970
|
+
if (!userId || userId === 'anonymous') {
|
|
2971
|
+
res.writeHead(401, { 'Content-Type': 'application/json' });
|
|
2972
|
+
res.end(JSON.stringify({ success: false, error: 'Authentication required.' }));
|
|
2973
|
+
return;
|
|
2974
|
+
}
|
|
2975
|
+
const wid = requestWorkspaceId(req);
|
|
2976
|
+
if (!ensureWorkspaceAdminRole(req, wid)) {
|
|
2977
|
+
res.writeHead(403, { 'Content-Type': 'application/json' });
|
|
2978
|
+
res.end(JSON.stringify({ success: false, error: 'Workspace owner or admin access is required.', code: 'MCP_TOOL_PROFILE_ADMIN_REQUIRED' }));
|
|
2979
|
+
return;
|
|
2980
|
+
}
|
|
2981
|
+
const body = await parseJsonBody(req);
|
|
2982
|
+
try {
|
|
2983
|
+
const updated = core.updateMcpAccessTokenToolProfile({ actorUserId: userId, workspaceId: wid, tokenId: params.id, toolProfile: body?.toolProfile });
|
|
2984
|
+
core.addAdminAuditLog({ action: 'mcp.token.tool_profile.update', actorUserId: userId, actorRole: requestRole(req), workspaceId: wid, details: { tokenId: updated.record.id, previousToolProfile: updated.previousToolProfile, toolProfile: updated.record.toolProfile } });
|
|
2985
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
2986
|
+
res.end(JSON.stringify({ success: true, record: updated.record }));
|
|
2987
|
+
}
|
|
2988
|
+
catch (error) {
|
|
2989
|
+
const statusCode = resolveErrorStatusCode(error);
|
|
2990
|
+
res.writeHead(statusCode, { 'Content-Type': 'application/json' });
|
|
2991
|
+
res.end(JSON.stringify({ success: false, error: error.message, code: error?.code || 'MCP_TOKEN_TOOL_PROFILE_UPDATE_FAILED' }));
|
|
2992
|
+
}
|
|
2993
|
+
});
|
|
2886
2994
|
addRoute('POST', '/api/taskforce/settings/mcp/test-connection', async (req, res) => {
|
|
2887
2995
|
if (!ensureAppAccess(req, res))
|
|
2888
2996
|
return;
|
|
@@ -2948,6 +3056,8 @@ export function registerAdminRoutes(deps) {
|
|
|
2948
3056
|
workspaceId: wid,
|
|
2949
3057
|
workspaceName: String(workspace?.name || wid),
|
|
2950
3058
|
scopes: inspection.scopes,
|
|
3059
|
+
toolProfile: inspection.toolProfile,
|
|
3060
|
+
toolCount: getCloudMcpToolProfileMembership(inspection.toolProfile, inspection.scopes).length,
|
|
2951
3061
|
requiredScopes,
|
|
2952
3062
|
endpoint: probe.endpoint,
|
|
2953
3063
|
serverName: probe.serverName,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY,
|
|
1
|
+
import { TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY, } from '../../runtime/appGates.js';
|
|
2
|
+
import { resolveNodeAppGateAccess } from '../../runtime/nodeAppGates.js';
|
|
2
3
|
import { AgentRoleDefinitionValidationError } from '../../shared/agentRoleDefinition.js';
|
|
3
4
|
import { AgentRoleConflictError, AgentRoleNotFoundError, AgentRoleRetiredError, AgentRoleStore, } from '../../storage/agentRoleStore.js';
|
|
4
5
|
import { parseJsonBody } from './primitives.js';
|
|
@@ -128,7 +129,7 @@ export function registerAgentRolesRoutes(deps) {
|
|
|
128
129
|
const guard = (req, res) => {
|
|
129
130
|
if (!ensureAppAccess(req, res))
|
|
130
131
|
return false;
|
|
131
|
-
const gate =
|
|
132
|
+
const gate = resolveNodeAppGateAccess(TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY);
|
|
132
133
|
if (gate.allowed)
|
|
133
134
|
return true;
|
|
134
135
|
writeJson(res, 403, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY,
|
|
1
|
+
import { TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY, } from '../../runtime/appGates.js';
|
|
2
|
+
import { resolveNodeAppGateAccess } from '../../runtime/nodeAppGates.js';
|
|
2
3
|
import { compileTaskforceAgentSkillPrompt } from '../../shared/taskforceAgentSkill.js';
|
|
3
4
|
import { TaskforceAgentStore } from '../../storage/taskforceAgentStore.js';
|
|
4
5
|
import { TaskforceAgentSkillConflictError, TaskforceAgentSkillStore, } from '../../storage/taskforceAgentSkillStore.js';
|
|
@@ -73,7 +74,7 @@ export function registerAgentSkillsRoutes(deps) {
|
|
|
73
74
|
const ensureFeatureAccess = (req, res) => {
|
|
74
75
|
if (!ensureAppAccess(req, res))
|
|
75
76
|
return false;
|
|
76
|
-
const gate =
|
|
77
|
+
const gate = resolveNodeAppGateAccess(TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY);
|
|
77
78
|
if (gate.allowed)
|
|
78
79
|
return true;
|
|
79
80
|
writeJson(res, 403, {
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* POST /api/taskforce/agents
|
|
7
7
|
* PATCH /api/taskforce/agents/:agentId
|
|
8
8
|
* DELETE /api/taskforce/agents/:agentId
|
|
9
|
+
* GET /api/taskforce/agents/:agentId/connection-binding
|
|
10
|
+
* PUT /api/taskforce/agents/:agentId/connection-binding
|
|
11
|
+
* DELETE /api/taskforce/agents/:agentId/connection-binding
|
|
9
12
|
* GET /api/taskforce/agents/:agentId/conversations
|
|
10
13
|
* POST /api/taskforce/agents/:agentId/conversation/new
|
|
11
14
|
* POST /api/taskforce/agents/model-gateway/test
|
|
@@ -13,6 +16,7 @@
|
|
|
13
16
|
*/
|
|
14
17
|
import type { IncomingMessage, ServerResponse } from 'http';
|
|
15
18
|
import type { TaskforceCore } from '../../core/Taskforce.js';
|
|
19
|
+
import { ModelProviderConnectionService } from '../../services/modelProviderConnectionService.js';
|
|
16
20
|
import { saveAiProfileAvatarAssets, type AiProfileAvatarAssetDeps } from '../aiProfileAvatarAssets.js';
|
|
17
21
|
import type { ModelGateway, ModelGatewaySelection } from '../../services/modelGateway.js';
|
|
18
22
|
import { type TaskforceAgentAvatarImageProvider } from '../../services/taskforceAgentAvatarImageProvider.js';
|
|
@@ -20,6 +24,7 @@ import { type PreparedTaskforceAgentMcpBridge, type PrepareTaskforceAgentMcpBrid
|
|
|
20
24
|
import { TaskforceAgentConversationStore } from '../../storage/taskforceAgentConversationStore.js';
|
|
21
25
|
import { TaskforceAgentStore } from '../../storage/taskforceAgentStore.js';
|
|
22
26
|
import { TaskforceAgentSkillStore } from '../../storage/taskforceAgentSkillStore.js';
|
|
27
|
+
import { TaskforceAgentConnectionBindingService } from '../../services/taskforceAgentConnectionBindingService.js';
|
|
23
28
|
import { type TaskforceAgentRuntimeReferenceResolvers } from '../../shared/taskforceAgentRuntimeResolution.js';
|
|
24
29
|
import { type RouteHandler } from './primitives.js';
|
|
25
30
|
type SaveAiProfileAvatarAssets = typeof saveAiProfileAvatarAssets;
|
|
@@ -35,6 +40,8 @@ export interface AgentsRouteDependencies {
|
|
|
35
40
|
agentStore?: TaskforceAgentStore;
|
|
36
41
|
skillStore?: TaskforceAgentSkillStore;
|
|
37
42
|
conversationStore?: TaskforceAgentConversationStore;
|
|
43
|
+
connectionBindingService?: Pick<TaskforceAgentConnectionBindingService, 'inspect' | 'bind' | 'clear' | 'resolveSaved' | 'resolveDraft'>;
|
|
44
|
+
modelConnectionService?: Pick<ModelProviderConnectionService, 'assertReady' | 'withConnectionLease'>;
|
|
38
45
|
createModelGateway?: (selection?: ModelGatewaySelection) => ModelGateway;
|
|
39
46
|
prepareMcpBridge?: (input: PrepareTaskforceAgentMcpBridgeInput) => Promise<PreparedTaskforceAgentMcpBridge | null>;
|
|
40
47
|
agentRuntimeReferenceResolvers?: TaskforceAgentRuntimeReferenceResolvers;
|