@taskforcehq/taskforce 0.3.329 → 0.3.332
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/Taskforce.module.css +290 -45
- package/dist/components/features/AiProfilesModule.js +3 -5
- package/dist/components/features/TaskSettings.js +70 -14
- 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 +2 -2
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.js +2 -2
- 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 +15 -3
- package/dist/components/features/planning/planningMetadata.d.ts +10 -0
- package/dist/components/features/planning/planningMetadata.js +8 -0
- package/dist/components/features/taskforceAgentAssignments/AgentBehaviorAssignments.js +15 -24
- package/dist/components/features/taskforceAgentEditorModel.d.ts +2 -1
- package/dist/components/features/taskforceAgentEditorModel.js +3 -1
- package/dist/components/features/workflowManager/workflowManagerApi.d.ts +1 -1
- package/dist/components/features/workflowManager/workflowManagerApi.js +3 -0
- package/dist/components/task/TaskWorkflowAssignmentField.js +68 -10
- package/dist/components/views/StandaloneLayout.js +62 -27
- package/dist/components/views/panels/PlanningDrawer.d.ts +2 -1
- package/dist/components/views/panels/PlanningDrawer.js +12 -8
- 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 +55 -1
- package/dist/core/McpTokenService.d.ts +25 -1
- package/dist/core/McpTokenService.js +106 -15
- 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 +43 -3
- package/dist/core/Taskforce.js +158 -7
- package/dist/core/types.d.ts +9 -0
- package/dist/documentReviews/DocumentReviewCommentStore.d.ts +2 -0
- package/dist/documentReviews/DocumentReviewCommentStore.js +28 -9
- 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/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/useSyncOrchestrator.d.ts +3 -0
- package/dist/hooks/useSyncOrchestrator.js +111 -2
- package/dist/hooks/useTaskData.d.ts +31 -1
- package/dist/hooks/useTaskData.js +29 -7
- package/dist/hooks/useTaskMutations.d.ts +3 -1
- package/dist/hooks/useTaskMutations.js +46 -12
- package/dist/hooks/useTaskforce.d.ts +2 -0
- package/dist/hooks/useTaskforce.js +11 -2
- package/dist/mcp/clientRegistry.d.ts +2 -2
- package/dist/mcp/clientRegistry.js +1 -1
- package/dist/mcp/documentAssetRegistrar.js +9 -6
- 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 +11 -0
- package/dist/mcp/httpProtocolRouting.js +22 -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 +408 -102
- package/dist/mcp/taskPlanningRegistrar.js +25 -6
- package/dist/mcp/toolProfiles.d.ts +2 -0
- package/dist/mcp/toolProfiles.js +11 -0
- package/dist/mcp/toolRegistry.d.ts +1 -0
- package/dist/mcp/toolRegistry.js +9 -8
- package/dist/mcp/workflowExecutionRegistrar.js +4 -4
- package/dist/migrations/taskSchemaMigrations.d.ts +5 -0
- package/dist/migrations/taskSchemaMigrations.js +415 -0
- package/dist/runtime/appGates.d.ts +2 -1
- package/dist/runtime/appGates.js +7 -0
- package/dist/server/buildInfo.d.ts +1 -0
- package/dist/server/buildInfo.js +5 -1
- package/dist/server/cloudMcpCapacityTelemetry.d.ts +68 -0
- package/dist/server/cloudMcpCapacityTelemetry.js +221 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +108 -11
- package/dist/server/localDatabaseIdentity.js +4 -1
- package/dist/server/localServiceLease.js +2 -1
- package/dist/server/localServiceSessions.d.ts +14 -17
- package/dist/server/localServiceSessions.js +308 -94
- package/dist/server/localWorkspaceSyncServerRuntime.js +25 -19
- package/dist/server/routes/admin.d.ts +4 -0
- package/dist/server/routes/admin.js +126 -5
- package/dist/server/routes/agents.d.ts +7 -0
- package/dist/server/routes/agents.js +277 -24
- package/dist/server/routes/billing.js +5 -1
- package/dist/server/routes/durableTaskHttpRouters.d.ts +2 -0
- 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 +136 -40
- package/dist/server/routes/modelConnections.d.ts +24 -0
- package/dist/server/routes/modelConnections.js +205 -0
- package/dist/server/routes/shared.d.ts +22 -0
- package/dist/server/routes/shared.js +298 -182
- package/dist/server/routes/sync.js +1 -0
- package/dist/server/routes/syncAuxRoutes.js +5 -1
- package/dist/server/routes/syncPushRoutes.d.ts +1 -0
- package/dist/server/routes/syncPushRoutes.js +1 -0
- package/dist/server/routes/syncV3FeedRoutes.js +10 -1
- package/dist/server/routes/syncV3OperationRoutes.js +35 -9
- package/dist/server/routes/tasks.js +21 -2
- package/dist/server/routes/workflows.js +9 -1
- package/dist/server/routes.js +59 -0
- package/dist/service/localServiceCli.d.ts +2 -2
- package/dist/service/localServiceCli.js +4 -3
- package/dist/services/codexAppServerModelGateway.d.ts +54 -5
- package/dist/services/codexAppServerModelGateway.js +246 -21
- 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 +139 -0
- package/dist/services/executorPhaseAIssuerCore.js +402 -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 +2 -2
- package/dist/services/taskforceAgentMcpBridge.js +42 -29
- 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 -9
- package/dist/shared/taskforceAgentModels.js +7 -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 +4 -0
- package/dist/storage/postgresAdapter.js +14 -1
- package/dist/storage/postgresRequestDiagnostics.d.ts +9 -1
- package/dist/storage/postgresRequestDiagnostics.js +15 -2
- package/dist/storage/postgresWorker.js +20 -2
- package/dist/storage/postgresWorkerProtocol.d.ts +7 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.d.ts +31 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.js +84 -0
- package/dist/storage/workflowStore.d.ts +2 -0
- package/dist/storage/workflowStore.js +39 -2
- package/dist/sync/cloudSyncApi.js +4 -2
- package/dist/sync/collaborationSyncState.js +5 -0
- package/dist/sync/coordinator/localSyncExecutionPermitStore.js +60 -29
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.d.ts +10 -0
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.js +29 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.d.ts +3 -1
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +18 -0
- 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/workspaceSyncEngineLifecyclePolicy.js +6 -6
- 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/workspaceSyncEngineRuntime.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncEngineRuntime.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +112 -38
- package/dist/sync/engine/workspaceSyncEngineServerSnapshotReader.js +6 -0
- package/dist/sync/engine/workspaceSyncEngineTransfers.js +3 -1
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +31 -0
- package/dist/sync/syncApplyHandlers.d.ts +3 -0
- package/dist/sync/syncApplyHandlers.js +81 -15
- package/dist/sync/syncService.d.ts +15 -0
- package/dist/sync/syncService.js +83 -18
- package/dist/sync/taskforceAgentSyncAuthorization.d.ts +16 -0
- package/dist/sync/taskforceAgentSyncAuthorization.js +20 -0
- package/dist/sync/v3/combinedFeedCapability.js +4 -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.js +3 -0
- package/dist/sync/v3/durableTaskChecklistMutationRouter.d.ts +2 -1
- package/dist/sync/v3/durableTaskChecklistMutationRouter.js +58 -15
- package/dist/sync/v3/durableTaskCommentMutationRouter.js +3 -0
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.d.ts +1 -1
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.js +10 -0
- package/dist/sync/v3/durableTaxonomyMutationRouter.js +5 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.d.ts +18 -7
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.js +89 -23
- 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/localOutboxRecoveryPreparationService.js +8 -2
- 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.d.ts +3 -1
- package/dist/sync/v3/localTaskCreateOutboxService.js +6 -1
- package/dist/sync/v3/localTaskDeleteOutboxService.js +1 -0
- package/dist/sync/v3/localTaskLifecycleOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskLifecycleOutboxService.js +5 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +2 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.js +6 -2
- package/dist/sync/v3/localTaskStatusOutboxService.d.ts +10 -1
- package/dist/sync/v3/localTaskStatusOutboxService.js +238 -16
- package/dist/sync/v3/syncDurabilityStore.d.ts +36 -1
- package/dist/sync/v3/syncDurabilityStore.js +202 -8
- package/dist/sync/v3/taskChecklistMutationService.d.ts +11 -0
- package/dist/sync/v3/taskChecklistMutationService.js +44 -1
- package/dist/sync/v3/taskStatusMutationService.d.ts +29 -1
- package/dist/sync/v3/taskStatusMutationService.js +119 -3
- package/dist/sync/v3/workflowAssignmentSync.d.ts +5 -0
- package/dist/sync/v3/workflowAssignmentSync.js +27 -0
- package/dist/sync/v3/workflowRuntimeMutationService.d.ts +5 -0
- package/dist/sync/v3/workflowRuntimeMutationService.js +124 -71
- 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/workspaceSyncV3CloudOperationHandler.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +9 -2
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +25 -3
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +44 -32
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +9 -5
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +54 -38
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.d.ts +10 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +70 -31
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.d.ts +2 -1
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.js +16 -0
- package/dist/sync/v3/workspaceSyncV3CoverageRegistry.js +6 -0
- package/dist/sync/v3/workspaceSyncV3Feed.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3Feed.js +6 -1
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +2 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +49 -18
- package/dist/sync/v3/workspaceSyncV3OperationProtocol.d.ts +3 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.d.ts +5 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.js +36 -2
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.d.ts +17 -0
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.js +64 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.js +50 -5
- 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/workspaceRepair.d.ts +5 -2
- package/dist/sync/workspaceRepair.js +161 -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/ui/assets/AiIdentityRosterCard-CDMPtnbC.js +1 -0
- package/dist/ui/assets/AiProfilesModule-Cww85C4E.js +1 -0
- package/dist/ui/assets/{AnnotatedAttachmentWorkspace-B68Wg-RV.js → AnnotatedAttachmentWorkspace-Dt9TKYSH.js} +1 -1
- package/dist/ui/assets/{AssetTraySortControl-C8Rztyal.js → AssetTraySortControl-CKgapnxu.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-Cj3c7X9y.js → ContextAttachmentManager-T-cEVcOZ.js} +2 -2
- package/dist/ui/assets/{DocumentWorkspace-B5uvzems.js → DocumentWorkspace-HD4MUjAZ.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-BVFvCB5R.js → EntityActivityTimeline-_V0zfMuh.js} +1 -1
- package/dist/ui/assets/PlanningModule-mTkBygsB.js +1 -0
- package/dist/ui/assets/{PlansPage-AY4cGWco.js → PlansPage-Btiq06VO.js} +1 -1
- package/dist/ui/assets/{TaskContextUpload-DZxTVesW.js → TaskContextUpload-C00NVUpn.js} +1 -1
- package/dist/ui/assets/TaskSettings-Cp-L-4xh.js +12 -0
- package/dist/ui/assets/TaskforceAgentsModule-Coq9-PUp.js +24 -0
- package/dist/ui/assets/TaskforceAgentsModule-b-8R25cJ.css +1 -0
- package/dist/ui/assets/{WorkflowManagerModule-DEr5di_r.js → WorkflowManagerModule-CuqRzMmM.js} +1 -1
- package/dist/ui/assets/index-BZ-hdZSk.css +1 -0
- package/dist/ui/assets/index-DSQINwt9.js +7 -0
- package/dist/ui/assets/{vendor-icons-D9Lpw-j4.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/taskEvents.d.ts +2 -0
- package/dist/utils/workspaceSyncPresentation.d.ts +1 -1
- package/dist/utils/workspaceSyncPresentation.js +23 -17
- package/package.json +24 -4
- package/dist/ui/assets/AiIdentityRosterCard-BZM4aQnM.js +0 -1
- package/dist/ui/assets/AiProfilesModule-BbAEWtHH.js +0 -1
- package/dist/ui/assets/PlanningModule-B5DWQOGz.js +0 -1
- package/dist/ui/assets/TaskSettings-BeWAuyZj.js +0 -12
- package/dist/ui/assets/TaskforceAgentsModule-BifCYtjR.js +0 -21
- package/dist/ui/assets/TaskforceAgentsModule-D6IC0S7Q.css +0 -1
- package/dist/ui/assets/index-I5zhdtgt.js +0 -7
- package/dist/ui/assets/index-VRFsx3wz.css +0 -1
|
@@ -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
|
|
@@ -17,6 +20,9 @@ import { BedrockAnthropicMessagesModelGateway } from '../../services/bedrockAnth
|
|
|
17
20
|
import { BedrockMantleModelGateway } from '../../services/bedrockMantleModelGateway.js';
|
|
18
21
|
import { BedrockModelGateway } from '../../services/bedrockModelGateway.js';
|
|
19
22
|
import { CodexAppServerModelGateway } from '../../services/codexAppServerModelGateway.js';
|
|
23
|
+
import { OwnerScopedModelConnectionGateway } from '../../services/ownerScopedModelConnectionGateway.js';
|
|
24
|
+
import { ModelProviderConnectionService } from '../../services/modelProviderConnectionService.js';
|
|
25
|
+
import { ModelProviderCredentialHomeManager } from '../../services/modelProviderCredentialHome.js';
|
|
20
26
|
import { saveAiProfileAvatarAssets } from '../aiProfileAvatarAssets.js';
|
|
21
27
|
import { ModelGatewayConfigurationError, normalizePersistedModelGatewayMessages } from '../../services/modelGateway.js';
|
|
22
28
|
import { BedrockAvatarImageProvider, buildTaskforceAgentAvatarPrompt, } from '../../services/taskforceAgentAvatarImageProvider.js';
|
|
@@ -24,12 +30,16 @@ import { hashTaskforceAgentMcpToolContract, isTaskforceAgentMutationToolName, pr
|
|
|
24
30
|
import { TaskforceAgentConversationStore } from '../../storage/taskforceAgentConversationStore.js';
|
|
25
31
|
import { TaskforceAgentDefinitionConflictError, TaskforceAgentStore, } from '../../storage/taskforceAgentStore.js';
|
|
26
32
|
import { TaskforceAgentSkillStore } from '../../storage/taskforceAgentSkillStore.js';
|
|
33
|
+
import { ModelProviderConnectionError, ModelProviderConnectionStore, } from '../../storage/modelProviderConnectionStore.js';
|
|
34
|
+
import { TaskforceAgentConnectionBindingStore } from '../../storage/taskforceAgentConnectionBindingStore.js';
|
|
35
|
+
import { TaskforceAgentConnectionBindingError, TaskforceAgentConnectionBindingService, } from '../../services/taskforceAgentConnectionBindingService.js';
|
|
27
36
|
import { WorkflowStore } from '../../storage/workflowStore.js';
|
|
28
37
|
import { WorkspaceSyncDurabilityStore } from '../../sync/v3/syncDurabilityStore.js';
|
|
29
38
|
import { projectLegacyTaskforceAgentResponse } from '../../compat/taskforceAgentDefinitionCompat.js';
|
|
30
39
|
import { TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY, } from '../../runtime/appGates.js';
|
|
31
40
|
import { resolveNodeAppGateAccess } from '../../runtime/nodeAppGates.js';
|
|
32
|
-
import { DEFAULT_TASKFORCE_AGENT_MODEL_KEY, DEFAULT_TASKFORCE_AGENT_PROVIDER_KEY, getTaskforceAgentModel, isTaskforceAgentModelVisible, labelForTaskforceAgentModel, labelForTaskforceAgentProvider, normalizeTaskforceAgentModelKey, normalizeTaskforceAgentModelSelection, normalizeTaskforceAgentProviderKey, } from '../../shared/taskforceAgentModels.js';
|
|
41
|
+
import { DEFAULT_TASKFORCE_AGENT_MODEL_KEY, DEFAULT_TASKFORCE_AGENT_PROVIDER_KEY, TASKFORCE_AGENT_MODEL_OPTIONS, getTaskforceAgentModel, isTaskforceAgentModelVisible, labelForTaskforceAgentModel, labelForTaskforceAgentProvider, normalizeTaskforceAgentModelKey, normalizeTaskforceAgentModelSelection, normalizeTaskforceAgentProviderKey, } from '../../shared/taskforceAgentModels.js';
|
|
42
|
+
import { INTERNAL_SUBSCRIPTION_MODEL_FEATURE_KEY } from '../../shared/userFeatureGrants.js';
|
|
33
43
|
import { buildTaskforceAgentRunContext } from '../../shared/taskforceAgentRunContext.js';
|
|
34
44
|
import { inspectAgentDefinition, serializeCanonicalJson } from '../../shared/taskforceAgentDefinition.js';
|
|
35
45
|
import { buildResolvedTaskforceAgentSystemPrompt, resolveTaskforceAgentRuntimeConfiguration, TaskforceAgentRuntimeResolutionError, } from '../../shared/taskforceAgentRuntimeResolution.js';
|
|
@@ -222,6 +232,7 @@ function serializeModelGatewayResult(result) {
|
|
|
222
232
|
stopReason: result.stopReason || null,
|
|
223
233
|
latencyMs: result.latencyMs ?? null,
|
|
224
234
|
usage: result.usage || null,
|
|
235
|
+
...(result.sourceMetadata ? { sourceMetadata: result.sourceMetadata } : {}),
|
|
225
236
|
};
|
|
226
237
|
}
|
|
227
238
|
export function serializeWorkflowCompletionProjection(core, workspaceId, _taskId, toolResults) {
|
|
@@ -263,7 +274,7 @@ export function serializeWorkflowCompletionProjection(core, workspaceId, _taskId
|
|
|
263
274
|
taskAuthoritative,
|
|
264
275
|
};
|
|
265
276
|
}
|
|
266
|
-
function createDefaultModelGateway(selection) {
|
|
277
|
+
function createDefaultModelGateway(selection, connectionService) {
|
|
267
278
|
const model = getTaskforceAgentModel(selection?.modelKey);
|
|
268
279
|
if (model && selection?.providerKey && model.providerKey !== selection.providerKey) {
|
|
269
280
|
throw new ModelGatewayConfigurationError('The selected model does not belong to this provider.', 'MODEL_UNAVAILABLE');
|
|
@@ -271,8 +282,22 @@ function createDefaultModelGateway(selection) {
|
|
|
271
282
|
const source = selection?.modelSource || model?.source || 'bedrock';
|
|
272
283
|
const runtime = selection?.runtime || model?.runtime || 'bedrock-runtime';
|
|
273
284
|
if (source === 'subscription_dev' && runtime === 'subscription-dev') {
|
|
285
|
+
if (selection?.connectionScope === 'personal'
|
|
286
|
+
|| (selection?.connectionScope === 'local_dev' && selection.connectionId)) {
|
|
287
|
+
const connectionId = String(selection.connectionId || '').trim();
|
|
288
|
+
const ownerUserId = String(selection.connectionOwnerUserId || '').trim();
|
|
289
|
+
if (!connectionService || !connectionId || !ownerUserId) {
|
|
290
|
+
throw new ModelGatewayConfigurationError('A verified personal model connection is required.', 'MODEL_PROVIDER_CONNECTION_REQUIRED');
|
|
291
|
+
}
|
|
292
|
+
return new OwnerScopedModelConnectionGateway(connectionService, ownerUserId, connectionId, (context) => new CodexAppServerModelGateway({
|
|
293
|
+
env: context.environment,
|
|
294
|
+
credentialPaths: context.environment.CODEX_HOME
|
|
295
|
+
? [context.environment.CODEX_HOME]
|
|
296
|
+
: [],
|
|
297
|
+
}));
|
|
298
|
+
}
|
|
274
299
|
if (selection?.connectionScope !== 'local_dev') {
|
|
275
|
-
throw new ModelGatewayConfigurationError('
|
|
300
|
+
throw new ModelGatewayConfigurationError('A personal model connection is required.', 'MODEL_PROVIDER_CONNECTION_REQUIRED');
|
|
276
301
|
}
|
|
277
302
|
return new CodexAppServerModelGateway();
|
|
278
303
|
}
|
|
@@ -608,7 +633,7 @@ function resolveWorkspaceId(req, body, requestWorkspaceId) {
|
|
|
608
633
|
}
|
|
609
634
|
return authoritativeWorkspaceId || requestedWorkspaceId || 'default';
|
|
610
635
|
}
|
|
611
|
-
function validateAgentInput(body, workspaceId, actorUserId) {
|
|
636
|
+
function validateAgentInput(body, workspaceId, actorUserId, isModelVisible = isTaskforceAgentModelVisible) {
|
|
612
637
|
const name = String(body?.name || '').trim();
|
|
613
638
|
if (!name)
|
|
614
639
|
return { error: 'Agent name is required.' };
|
|
@@ -619,10 +644,14 @@ function validateAgentInput(body, workspaceId, actorUserId) {
|
|
|
619
644
|
return { error: 'Agent instructions must be 4,000 characters or less.' };
|
|
620
645
|
const providerKey = normalizeTaskforceAgentProviderKey(body?.providerKey || DEFAULT_TASKFORCE_AGENT_PROVIDER_KEY);
|
|
621
646
|
const requestedModel = body?.modelKey !== undefined ? getTaskforceAgentModel(body.modelKey) : null;
|
|
622
|
-
if (requestedModel && !
|
|
647
|
+
if (requestedModel && !isModelVisible(requestedModel)) {
|
|
623
648
|
return { error: 'Selected model is not available for this account.' };
|
|
624
649
|
}
|
|
625
|
-
const modelKey =
|
|
650
|
+
const modelKey = requestedModel
|
|
651
|
+
&& requestedModel.providerKey === providerKey
|
|
652
|
+
&& isModelVisible(requestedModel)
|
|
653
|
+
? requestedModel.key
|
|
654
|
+
: normalizeTaskforceAgentModelKey(body?.modelKey || DEFAULT_TASKFORCE_AGENT_MODEL_KEY, providerKey);
|
|
626
655
|
if (!modelKey)
|
|
627
656
|
return { error: 'Select a configured model for this provider.' };
|
|
628
657
|
return {
|
|
@@ -664,10 +693,13 @@ function canonicalMutationError(error) {
|
|
|
664
693
|
};
|
|
665
694
|
}
|
|
666
695
|
export function registerAgentsRoutes(deps) {
|
|
667
|
-
const { addRoute, ensureAppAccess, core, requestWorkspaceId, resolveAuthenticatedUserId, resolveRuntimeMode = () => 'local', ensureWorkspaceAdminRole, agentStore, skillStore, conversationStore, createModelGateway
|
|
696
|
+
const { addRoute, ensureAppAccess, core, requestWorkspaceId, resolveAuthenticatedUserId, resolveRuntimeMode = () => 'local', ensureWorkspaceAdminRole, agentStore, skillStore, conversationStore, connectionBindingService, createModelGateway, prepareMcpBridge = prepareTaskforceAgentMcpBridge, aiProfileAvatarAssetDeps, avatarImageProvider, saveAiProfileAvatarAssets: saveAvatarAssets = saveAiProfileAvatarAssets, agentRuntimeReferenceResolvers, agentRuntimeReferenceResolversForWorkspace, } = deps;
|
|
668
697
|
let resolvedAgentStore = agentStore || null;
|
|
669
698
|
let resolvedSkillStore = skillStore || null;
|
|
670
699
|
let resolvedConversationStore = conversationStore || null;
|
|
700
|
+
let resolvedConnectionBindingService = connectionBindingService || null;
|
|
701
|
+
let resolvedModelConnectionService = deps.modelConnectionService || null;
|
|
702
|
+
let resolvedCredentialHomeManager = null;
|
|
671
703
|
let resolvedAvatarImageProvider = avatarImageProvider || null;
|
|
672
704
|
const getAgentStore = () => {
|
|
673
705
|
if (resolvedAgentStore)
|
|
@@ -693,6 +725,66 @@ export function registerAgentsRoutes(deps) {
|
|
|
693
725
|
resolvedSkillStore = new TaskforceAgentSkillStore(core.getDatabaseAdapter(), core.getTenantId());
|
|
694
726
|
return resolvedSkillStore;
|
|
695
727
|
};
|
|
728
|
+
const getModelConnectionService = () => {
|
|
729
|
+
if (resolvedModelConnectionService)
|
|
730
|
+
return resolvedModelConnectionService;
|
|
731
|
+
if (!core)
|
|
732
|
+
throw new Error('Model connection service is unavailable.');
|
|
733
|
+
resolvedCredentialHomeManager ||= new ModelProviderCredentialHomeManager();
|
|
734
|
+
resolvedModelConnectionService = new ModelProviderConnectionService(new ModelProviderConnectionStore(core.getDatabaseAdapter(), core.getTenantId()), resolvedCredentialHomeManager, (userId) => core.hasUserFeatureGrant(userId, INTERNAL_SUBSCRIPTION_MODEL_FEATURE_KEY));
|
|
735
|
+
return resolvedModelConnectionService;
|
|
736
|
+
};
|
|
737
|
+
const getConnectionBindingService = () => {
|
|
738
|
+
if (resolvedConnectionBindingService)
|
|
739
|
+
return resolvedConnectionBindingService;
|
|
740
|
+
if (!core)
|
|
741
|
+
throw new Error('Agent connection binding service is unavailable.');
|
|
742
|
+
resolvedConnectionBindingService = new TaskforceAgentConnectionBindingService(new TaskforceAgentConnectionBindingStore(core.getDatabaseAdapter(), core.getTenantId()), getAgentStore(), new ModelProviderConnectionStore(core.getDatabaseAdapter(), core.getTenantId()), getModelConnectionService(), (userId) => core.hasUserFeatureGrant(userId, INTERNAL_SUBSCRIPTION_MODEL_FEATURE_KEY));
|
|
743
|
+
return resolvedConnectionBindingService;
|
|
744
|
+
};
|
|
745
|
+
const buildModelGateway = (selection) => {
|
|
746
|
+
if (createModelGateway)
|
|
747
|
+
return createModelGateway(selection);
|
|
748
|
+
const needsPersonalConnection = selection?.modelSource === 'subscription_dev'
|
|
749
|
+
&& Boolean(selection.connectionId);
|
|
750
|
+
return createDefaultModelGateway(selection, needsPersonalConnection ? getModelConnectionService() : undefined);
|
|
751
|
+
};
|
|
752
|
+
const authorizeConnectionBindingRequest = (req, res) => {
|
|
753
|
+
if (resolveRuntimeMode(req) !== 'cloud') {
|
|
754
|
+
writeJson(res, 404, {
|
|
755
|
+
success: false,
|
|
756
|
+
error: 'Agent connection bindings are unavailable in this runtime.',
|
|
757
|
+
code: 'AGENT_CONNECTION_BINDINGS_CLOUD_ONLY',
|
|
758
|
+
});
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
const actorUserId = String(resolveAuthenticatedUserId?.(req) || '').trim();
|
|
762
|
+
if (!actorUserId) {
|
|
763
|
+
writeJson(res, 401, {
|
|
764
|
+
success: false,
|
|
765
|
+
error: 'Authentication is required.',
|
|
766
|
+
code: 'AUTH_REQUIRED',
|
|
767
|
+
});
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
770
|
+
return actorUserId;
|
|
771
|
+
};
|
|
772
|
+
const writeConnectionBindingError = (res, error) => {
|
|
773
|
+
if (error instanceof TaskforceAgentConnectionBindingError
|
|
774
|
+
|| error instanceof ModelProviderConnectionError) {
|
|
775
|
+
writeJson(res, error.statusCode, {
|
|
776
|
+
success: false,
|
|
777
|
+
error: error.message,
|
|
778
|
+
code: error.code,
|
|
779
|
+
});
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
writeJson(res, 500, {
|
|
783
|
+
success: false,
|
|
784
|
+
error: 'Agent connection request failed.',
|
|
785
|
+
code: 'AGENT_CONNECTION_REQUEST_FAILED',
|
|
786
|
+
});
|
|
787
|
+
};
|
|
696
788
|
const resolveRuntimeReferenceResolversForWorkspace = (workspaceId) => {
|
|
697
789
|
const baseResolvers = agentRuntimeReferenceResolversForWorkspace?.(workspaceId)
|
|
698
790
|
|| agentRuntimeReferenceResolvers
|
|
@@ -735,6 +827,34 @@ export function registerAgentsRoutes(deps) {
|
|
|
735
827
|
});
|
|
736
828
|
return false;
|
|
737
829
|
};
|
|
830
|
+
const isModelVisibleForRequest = (req, model) => {
|
|
831
|
+
if (resolveRuntimeMode(req) !== 'cloud' || model.source !== 'subscription_dev') {
|
|
832
|
+
return isTaskforceAgentModelVisible(model);
|
|
833
|
+
}
|
|
834
|
+
const actorUserId = resolveAuthenticatedUserId?.(req) || null;
|
|
835
|
+
return Boolean(model.visible
|
|
836
|
+
&& model.availability !== 'account_unavailable'
|
|
837
|
+
&& actorUserId
|
|
838
|
+
&& core?.hasUserFeatureGrant(actorUserId, INTERNAL_SUBSCRIPTION_MODEL_FEATURE_KEY));
|
|
839
|
+
};
|
|
840
|
+
const isModelPersistableForRequest = (req, model) => {
|
|
841
|
+
if (resolveRuntimeMode(req) === 'local' && model.source === 'subscription_dev') {
|
|
842
|
+
return model.visible && model.availability !== 'account_unavailable';
|
|
843
|
+
}
|
|
844
|
+
return isModelVisibleForRequest(req, model);
|
|
845
|
+
};
|
|
846
|
+
const ensureDefinitionModelAccess = (req, res, definition) => {
|
|
847
|
+
const modelKey = String(definition?.model?.modelKey || '').trim();
|
|
848
|
+
const model = getTaskforceAgentModel(modelKey);
|
|
849
|
+
if (!model || isModelPersistableForRequest(req, model))
|
|
850
|
+
return true;
|
|
851
|
+
writeJson(res, model.source === 'subscription_dev' ? 403 : 400, {
|
|
852
|
+
success: false,
|
|
853
|
+
error: 'Selected model is not available for this account.',
|
|
854
|
+
code: model.source === 'subscription_dev' ? 'SUBSCRIPTION_MODEL_ACCESS_REQUIRED' : 'MODEL_UNAVAILABLE',
|
|
855
|
+
});
|
|
856
|
+
return false;
|
|
857
|
+
};
|
|
738
858
|
addRoute('GET', '/api/taskforce/agents', async (req, res) => {
|
|
739
859
|
if (!ensureTaskforceAgentsAccess(req, res))
|
|
740
860
|
return;
|
|
@@ -748,7 +868,8 @@ export function registerAgentsRoutes(deps) {
|
|
|
748
868
|
const profile = profileMap.get(agent.id) || null;
|
|
749
869
|
return serializeAgent(persistManagedProfileLink(agent, profile, actorUserId), profile);
|
|
750
870
|
});
|
|
751
|
-
|
|
871
|
+
const modelCatalog = TASKFORCE_AGENT_MODEL_OPTIONS.filter((model) => isModelVisibleForRequest(req, model));
|
|
872
|
+
writeJson(res, 200, { success: true, agents, modelCatalog });
|
|
752
873
|
}
|
|
753
874
|
catch (error) {
|
|
754
875
|
writeJson(res, resolveErrorStatusCode(error, 500), {
|
|
@@ -757,6 +878,80 @@ export function registerAgentsRoutes(deps) {
|
|
|
757
878
|
});
|
|
758
879
|
}
|
|
759
880
|
});
|
|
881
|
+
addRoute('GET', '/api/taskforce/agents/model-catalog', async (req, res) => {
|
|
882
|
+
if (!ensureTaskforceAgentsAccess(req, res))
|
|
883
|
+
return;
|
|
884
|
+
const modelCatalog = TASKFORCE_AGENT_MODEL_OPTIONS.filter((model) => isModelVisibleForRequest(req, model));
|
|
885
|
+
writeJson(res, 200, { success: true, modelCatalog });
|
|
886
|
+
});
|
|
887
|
+
addRoute('GET', '/api/taskforce/agents/:agentId/connection-binding', async (req, res, params) => {
|
|
888
|
+
if (!ensureTaskforceAgentsAccess(req, res))
|
|
889
|
+
return;
|
|
890
|
+
const actorUserId = authorizeConnectionBindingRequest(req, res);
|
|
891
|
+
if (!actorUserId)
|
|
892
|
+
return;
|
|
893
|
+
try {
|
|
894
|
+
const workspaceId = resolveWorkspaceId(req, undefined, requestWorkspaceId);
|
|
895
|
+
const binding = getConnectionBindingService().inspect({
|
|
896
|
+
workspaceId,
|
|
897
|
+
agentId: params.agentId,
|
|
898
|
+
callerUserId: actorUserId,
|
|
899
|
+
});
|
|
900
|
+
writeJson(res, 200, { success: true, binding });
|
|
901
|
+
}
|
|
902
|
+
catch (error) {
|
|
903
|
+
writeConnectionBindingError(res, error);
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
addRoute('PUT', '/api/taskforce/agents/:agentId/connection-binding', async (req, res, params) => {
|
|
907
|
+
if (!ensureTaskforceAgentsAccess(req, res))
|
|
908
|
+
return;
|
|
909
|
+
const actorUserId = authorizeConnectionBindingRequest(req, res);
|
|
910
|
+
if (!actorUserId)
|
|
911
|
+
return;
|
|
912
|
+
try {
|
|
913
|
+
const body = await parseJsonBody(req, 16 * 1024);
|
|
914
|
+
const workspaceId = resolveWorkspaceId(req, body, requestWorkspaceId);
|
|
915
|
+
await getConnectionBindingService().bind({
|
|
916
|
+
workspaceId,
|
|
917
|
+
agentId: params.agentId,
|
|
918
|
+
connectionId: String(body?.connectionId || ''),
|
|
919
|
+
actorUserId,
|
|
920
|
+
});
|
|
921
|
+
const binding = getConnectionBindingService().inspect({
|
|
922
|
+
workspaceId,
|
|
923
|
+
agentId: params.agentId,
|
|
924
|
+
callerUserId: actorUserId,
|
|
925
|
+
});
|
|
926
|
+
writeJson(res, 200, { success: true, binding });
|
|
927
|
+
}
|
|
928
|
+
catch (error) {
|
|
929
|
+
writeConnectionBindingError(res, error);
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
addRoute('DELETE', '/api/taskforce/agents/:agentId/connection-binding', async (req, res, params) => {
|
|
933
|
+
if (!ensureTaskforceAgentsAccess(req, res))
|
|
934
|
+
return;
|
|
935
|
+
const actorUserId = authorizeConnectionBindingRequest(req, res);
|
|
936
|
+
if (!actorUserId)
|
|
937
|
+
return;
|
|
938
|
+
try {
|
|
939
|
+
const body = await parseJsonBody(req, 16 * 1024);
|
|
940
|
+
const workspaceId = resolveWorkspaceId(req, body, requestWorkspaceId);
|
|
941
|
+
getConnectionBindingService().clear({
|
|
942
|
+
workspaceId,
|
|
943
|
+
agentId: params.agentId,
|
|
944
|
+
actorUserId,
|
|
945
|
+
});
|
|
946
|
+
writeJson(res, 200, {
|
|
947
|
+
success: true,
|
|
948
|
+
binding: { bound: false, available: false },
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
catch (error) {
|
|
952
|
+
writeConnectionBindingError(res, error);
|
|
953
|
+
}
|
|
954
|
+
});
|
|
760
955
|
addRoute('POST', '/api/taskforce/agents', async (req, res) => {
|
|
761
956
|
if (!ensureTaskforceAgentsAccess(req, res))
|
|
762
957
|
return;
|
|
@@ -771,6 +966,8 @@ export function registerAgentsRoutes(deps) {
|
|
|
771
966
|
}
|
|
772
967
|
let agent;
|
|
773
968
|
if (Object.prototype.hasOwnProperty.call(body, 'definition')) {
|
|
969
|
+
if (!ensureDefinitionModelAccess(req, res, body.definition))
|
|
970
|
+
return;
|
|
774
971
|
if (body.lifecycleStatus !== undefined
|
|
775
972
|
&& body.lifecycleStatus !== 'active'
|
|
776
973
|
&& body.lifecycleStatus !== 'disabled') {
|
|
@@ -789,7 +986,7 @@ export function registerAgentsRoutes(deps) {
|
|
|
789
986
|
});
|
|
790
987
|
}
|
|
791
988
|
else {
|
|
792
|
-
const input = validateAgentInput(body, workspaceId, actorUserId);
|
|
989
|
+
const input = validateAgentInput(body, workspaceId, actorUserId, (model) => isModelPersistableForRequest(req, model));
|
|
793
990
|
if ('error' in input) {
|
|
794
991
|
writeJson(res, 400, { success: false, error: input.error });
|
|
795
992
|
return;
|
|
@@ -826,6 +1023,8 @@ export function registerAgentsRoutes(deps) {
|
|
|
826
1023
|
}
|
|
827
1024
|
let agent;
|
|
828
1025
|
if (Object.prototype.hasOwnProperty.call(body, 'definition')) {
|
|
1026
|
+
if (!ensureDefinitionModelAccess(req, res, body.definition))
|
|
1027
|
+
return;
|
|
829
1028
|
if (body.lifecycleStatus !== undefined
|
|
830
1029
|
&& body.lifecycleStatus !== 'active'
|
|
831
1030
|
&& body.lifecycleStatus !== 'disabled') {
|
|
@@ -855,7 +1054,7 @@ export function registerAgentsRoutes(deps) {
|
|
|
855
1054
|
}
|
|
856
1055
|
}
|
|
857
1056
|
else {
|
|
858
|
-
const input = validateAgentInput(body, workspaceId, actorUserId);
|
|
1057
|
+
const input = validateAgentInput(body, workspaceId, actorUserId, (model) => isModelPersistableForRequest(req, model));
|
|
859
1058
|
if ('error' in input) {
|
|
860
1059
|
writeJson(res, 400, { success: false, error: input.error });
|
|
861
1060
|
return;
|
|
@@ -1156,7 +1355,11 @@ export function registerAgentsRoutes(deps) {
|
|
|
1156
1355
|
if (agentId) {
|
|
1157
1356
|
savedAgent = getAgentStore().get(workspaceId, agentId);
|
|
1158
1357
|
if (!savedAgent) {
|
|
1159
|
-
writeJson(res,
|
|
1358
|
+
writeJson(res, 409, {
|
|
1359
|
+
success: false,
|
|
1360
|
+
error: 'This Agent is not available in Taskforce Cloud yet. Wait for synchronization and try again.',
|
|
1361
|
+
code: 'AGENT_NOT_AVAILABLE_IN_CLOUD',
|
|
1362
|
+
});
|
|
1160
1363
|
return;
|
|
1161
1364
|
}
|
|
1162
1365
|
if (typeof savedAgent.definitionRevision === 'number') {
|
|
@@ -1236,22 +1439,38 @@ export function registerAgentsRoutes(deps) {
|
|
|
1236
1439
|
return;
|
|
1237
1440
|
}
|
|
1238
1441
|
const requestedModel = body?.modelKey !== undefined ? getTaskforceAgentModel(body.modelKey) : null;
|
|
1239
|
-
if (requestedModel && !
|
|
1240
|
-
writeJson(res,
|
|
1442
|
+
if (requestedModel && !isModelVisibleForRequest(req, requestedModel)) {
|
|
1443
|
+
writeJson(res, requestedModel.source === 'subscription_dev' ? 403 : 400, {
|
|
1444
|
+
success: false,
|
|
1445
|
+
error: 'Selected model is not available for this account.',
|
|
1446
|
+
code: requestedModel.source === 'subscription_dev' ? 'SUBSCRIPTION_MODEL_ACCESS_REQUIRED' : 'MODEL_UNAVAILABLE',
|
|
1447
|
+
});
|
|
1241
1448
|
return;
|
|
1242
1449
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1450
|
+
let modelKey;
|
|
1451
|
+
if (resolvedRuntimeConfiguration) {
|
|
1452
|
+
modelKey = resolvedRuntimeConfiguration.definition.model.modelKey;
|
|
1453
|
+
}
|
|
1454
|
+
else if (requestedModel && requestedModel.providerKey === providerKey) {
|
|
1455
|
+
modelKey = requestedModel.key;
|
|
1456
|
+
}
|
|
1457
|
+
else if (body?.modelKey !== undefined || body?.providerKey !== undefined) {
|
|
1458
|
+
modelKey = normalizeTaskforceAgentModelKey(body?.modelKey, providerKey);
|
|
1459
|
+
}
|
|
1460
|
+
else {
|
|
1461
|
+
modelKey = savedAgent?.modelKey || normalizeTaskforceAgentModelKey(undefined, providerKey);
|
|
1462
|
+
}
|
|
1248
1463
|
if (!modelKey) {
|
|
1249
1464
|
writeJson(res, 400, { success: false, error: 'Select a configured model for this provider.' });
|
|
1250
1465
|
return;
|
|
1251
1466
|
}
|
|
1252
1467
|
const model = getTaskforceAgentModel(modelKey);
|
|
1253
|
-
if (!model || !
|
|
1254
|
-
writeJson(res,
|
|
1468
|
+
if (!model || !isModelVisibleForRequest(req, model)) {
|
|
1469
|
+
writeJson(res, model?.source === 'subscription_dev' ? 403 : 400, {
|
|
1470
|
+
success: false,
|
|
1471
|
+
error: 'Selected model is not available for this account.',
|
|
1472
|
+
code: model?.source === 'subscription_dev' ? 'SUBSCRIPTION_MODEL_ACCESS_REQUIRED' : 'MODEL_UNAVAILABLE',
|
|
1473
|
+
});
|
|
1255
1474
|
return;
|
|
1256
1475
|
}
|
|
1257
1476
|
const modelSelection = normalizeTaskforceAgentModelSelection({
|
|
@@ -1259,21 +1478,55 @@ export function registerAgentsRoutes(deps) {
|
|
|
1259
1478
|
modelKey,
|
|
1260
1479
|
modelSource: resolvedRuntimeConfiguration?.definition.model.modelSource ?? body?.modelSource ?? model.source,
|
|
1261
1480
|
connectionScope: resolvedRuntimeConfiguration?.definition.model.connectionScope ?? body?.connectionScope,
|
|
1262
|
-
connectionId:
|
|
1481
|
+
connectionId: body?.connectionId,
|
|
1263
1482
|
});
|
|
1264
1483
|
if (!modelSelection) {
|
|
1265
1484
|
writeJson(res, 400, { success: false, error: 'Selected model source is not available for this model.' });
|
|
1266
1485
|
return;
|
|
1267
1486
|
}
|
|
1268
|
-
|
|
1487
|
+
let runtimeConnectionId = null;
|
|
1488
|
+
let runtimeConnectionOwnerUserId = null;
|
|
1489
|
+
if (modelSelection.modelSource === 'subscription_dev'
|
|
1490
|
+
&& (modelSelection.connectionScope === 'personal'
|
|
1491
|
+
|| (modelSelection.connectionScope === 'local_dev' && resolveRuntimeMode(req) === 'cloud'))) {
|
|
1492
|
+
if (!actorUserId) {
|
|
1493
|
+
writeJson(res, 401, {
|
|
1494
|
+
success: false,
|
|
1495
|
+
error: 'Authentication is required.',
|
|
1496
|
+
code: 'AUTH_REQUIRED',
|
|
1497
|
+
});
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
const resolvedBinding = savedAgent
|
|
1501
|
+
? getConnectionBindingService().resolveSaved({
|
|
1502
|
+
workspaceId,
|
|
1503
|
+
agentId: savedAgent.id,
|
|
1504
|
+
callerUserId: actorUserId,
|
|
1505
|
+
})
|
|
1506
|
+
: null;
|
|
1507
|
+
const resolvedConnection = resolvedBinding?.connection
|
|
1508
|
+
|| getConnectionBindingService().resolveDraft({
|
|
1509
|
+
callerUserId: actorUserId,
|
|
1510
|
+
connectionId: modelSelection.connectionId || '',
|
|
1511
|
+
providerKey: modelSelection.providerKey,
|
|
1512
|
+
});
|
|
1513
|
+
runtimeConnectionId = resolvedConnection.id;
|
|
1514
|
+
runtimeConnectionOwnerUserId = resolvedBinding?.binding.ownerUserId || actorUserId;
|
|
1515
|
+
}
|
|
1516
|
+
const gateway = buildModelGateway({
|
|
1269
1517
|
providerKey: modelSelection.providerKey,
|
|
1270
1518
|
modelKey: modelSelection.modelKey,
|
|
1271
1519
|
modelSource: modelSelection.modelSource,
|
|
1272
1520
|
runtime: model.runtime,
|
|
1273
1521
|
workspaceId,
|
|
1274
1522
|
actorUserId,
|
|
1275
|
-
|
|
1276
|
-
|
|
1523
|
+
...(modelSelection.connectionScope
|
|
1524
|
+
? { connectionScope: modelSelection.connectionScope }
|
|
1525
|
+
: {}),
|
|
1526
|
+
...(runtimeConnectionId ? { connectionId: runtimeConnectionId } : {}),
|
|
1527
|
+
...(runtimeConnectionOwnerUserId
|
|
1528
|
+
? { connectionOwnerUserId: runtimeConnectionOwnerUserId }
|
|
1529
|
+
: {}),
|
|
1277
1530
|
});
|
|
1278
1531
|
const runContext = buildTaskforceAgentRunContext({
|
|
1279
1532
|
source: 'agent-manager-test',
|
|
@@ -1857,7 +1857,11 @@ export function registerBillingRoutes(deps) {
|
|
|
1857
1857
|
const userIdentity = core.resolveUserIdentity(userId);
|
|
1858
1858
|
const normalizedUserEmail = normalizeEmail(userIdentity?.email);
|
|
1859
1859
|
if (pricing.pricingType === 'free') {
|
|
1860
|
-
|
|
1860
|
+
const currentEntitlementPlanVersionId = String(currentEntitlement?.plan_version_id || '').trim();
|
|
1861
|
+
const currentEntitlementState = String(currentEntitlement?.entitlement_state || '').trim();
|
|
1862
|
+
if (currentEntitlementPlanVersionId
|
|
1863
|
+
&& currentEntitlementPlanVersionId === planVersionId
|
|
1864
|
+
&& isCommercialStateAppAccessible(currentEntitlementState)) {
|
|
1861
1865
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
1862
1866
|
res.end(JSON.stringify({
|
|
1863
1867
|
checkoutState: 'already_current_plan',
|
|
@@ -43,6 +43,7 @@ export declare function createTaskHttpDurableRouters(input: {
|
|
|
43
43
|
taskId: string;
|
|
44
44
|
items: readonly Partial<import("../../core/Taskforce.js").ChecklistItem>[];
|
|
45
45
|
expectedDetailRevision?: string;
|
|
46
|
+
itemUpdateIntent?: import("../../sync/v3/taskChecklistMutationService.js").TaskChecklistItemUpdateIntent;
|
|
46
47
|
}): {
|
|
47
48
|
state: "pending" | "committed";
|
|
48
49
|
route: "local-outbox" | "cloud-acceptance";
|
|
@@ -70,6 +71,7 @@ export declare function createTaskHttpDurableRouters(input: {
|
|
|
70
71
|
taskId: string;
|
|
71
72
|
items: readonly Partial<import("../../core/Taskforce.js").ChecklistItem>[];
|
|
72
73
|
expectedDetailRevision?: string;
|
|
74
|
+
itemUpdateIntent?: import("../../sync/v3/taskChecklistMutationService.js").TaskChecklistItemUpdateIntent;
|
|
73
75
|
}): {
|
|
74
76
|
state: "pending" | "committed";
|
|
75
77
|
route: "local-outbox" | "cloud-acceptance";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'http';
|
|
2
|
+
import type { ExecutorPhaseAApprovalService } from '../../services/executorPhaseAApprovalService.js';
|
|
3
|
+
import { type RouteHandler } from './primitives.js';
|
|
4
|
+
export declare const EXECUTOR_PHASE_A_APPROVAL_PAGE_PATH = "/taskforce/admin/executor/phase-a-approval";
|
|
5
|
+
export declare const EXECUTOR_PHASE_A_APPROVAL_PAGE_SCRIPT_PATH = "/taskforce/admin/executor/phase-a-approval.js";
|
|
6
|
+
export declare const EXECUTOR_PHASE_A_APPROVAL_ISSUE_PATH = "/api/taskforce/admin/executor/phase-a-approval-receipts";
|
|
7
|
+
export interface ExecutorPhaseAApprovalRouteDependencies {
|
|
8
|
+
addRoute: (method: string, path: string, handler: RouteHandler) => void;
|
|
9
|
+
service: ExecutorPhaseAApprovalService | null;
|
|
10
|
+
requireCloudRuntime: (res: ServerResponse, feature: string) => boolean;
|
|
11
|
+
ensureAppAccess: (req: IncomingMessage, res: ServerResponse) => boolean;
|
|
12
|
+
resolveHumanSystemAdminActor: (req: IncomingMessage) => string | null;
|
|
13
|
+
hasActiveWorkspaceMembership: (workspaceId: string, userId: string) => boolean;
|
|
14
|
+
auditAuthAction: (req: IncomingMessage, action: string, details: Record<string, unknown>, workspaceIdOverride?: string | null) => void;
|
|
15
|
+
workspaceId: string;
|
|
16
|
+
allowedOrigin: string;
|
|
17
|
+
performanceEnvironment: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function registerExecutorPhaseAApprovalRoutes(deps: ExecutorPhaseAApprovalRouteDependencies): void;
|