@inkeep/agents-manage-mcp 0.39.4 → 0.40.0
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/.vscode/settings.json +5 -0
- package/README.md +38 -139
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +27 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7775 -6996
- package/dist/index.js.map +1 -1
- package/manifest.json +61 -6
- package/package.json +12 -12
- package/scripts/fetch-openapi.mjs +22 -40
- package/scripts/generate.mjs +33 -66
- package/src/core.ts +3 -1
- package/src/funcs/agentArtifactComponentRelationsAssociateArtifactComponentWithAgent.ts +94 -78
- package/src/funcs/agentArtifactComponentRelationsCheckArtifactComponentAgentAssociation.ts +98 -81
- package/src/funcs/agentArtifactComponentRelationsGetAgentsUsingArtifactComponent.ts +94 -78
- package/src/funcs/agentArtifactComponentRelationsGetArtifactComponentsForAgent.ts +91 -76
- package/src/funcs/agentArtifactComponentRelationsRemoveArtifactComponentFromAgent.ts +96 -80
- package/src/funcs/agentDataComponentRelationsAssociateDataComponentWithAgent.ts +92 -77
- package/src/funcs/agentDataComponentRelationsCheckDataComponentAgentAssociation.ts +95 -79
- package/src/funcs/agentDataComponentRelationsGetAgentsUsingDataComponent.ts +91 -76
- package/src/funcs/agentDataComponentRelationsGetDataComponentsForAgent.ts +91 -76
- package/src/funcs/agentDataComponentRelationsRemoveDataComponentFromAgent.ts +93 -78
- package/src/funcs/agentGetFullAgentDefinition.ts +89 -74
- package/src/funcs/agentGetRelatedAgentInfos.ts +91 -76
- package/src/funcs/agentsCreateAgent.ts +88 -73
- package/src/funcs/agentsDeleteAgent.ts +74 -58
- package/src/funcs/agentsGetAgent.ts +90 -73
- package/src/funcs/agentsListAgents.ts +89 -74
- package/src/funcs/agentsUpdateAgent.ts +92 -75
- package/src/funcs/apiKeysCreateAPIKey.ts +88 -73
- package/src/funcs/apiKeysDeleteAPIKey.ts +74 -58
- package/src/funcs/apiKeysGetAPIKeyById.ts +90 -73
- package/src/funcs/apiKeysListAPIKeys.ts +90 -75
- package/src/funcs/apiKeysUpdateAPIKey.ts +92 -75
- package/src/funcs/artifactComponentCreateArtifactComponent.ts +89 -74
- package/src/funcs/artifactComponentDeleteArtifactComponent.ts +74 -60
- package/src/funcs/artifactComponentGetArtifactComponentById.ts +89 -74
- package/src/funcs/artifactComponentListArtifactComponents.ts +90 -75
- package/src/funcs/artifactComponentUpdateArtifactComponent.ts +91 -76
- package/src/funcs/cliGetApiCliMe.ts +144 -0
- package/src/funcs/contextConfigCreateContextConfig.ts +91 -76
- package/src/funcs/contextConfigDeleteContextConfig.ts +87 -73
- package/src/funcs/contextConfigGetContextConfigById.ts +91 -76
- package/src/funcs/contextConfigListContextConfigs.ts +92 -77
- package/src/funcs/contextConfigUpdateContextConfig.ts +93 -78
- package/src/funcs/conversationsGetConversation.ts +92 -77
- package/src/funcs/credentialCreateCredential.ts +90 -73
- package/src/funcs/credentialDeleteCredential.ts +73 -59
- package/src/funcs/credentialGetCredentialById.ts +89 -74
- package/src/funcs/credentialListCredentials.ts +91 -74
- package/src/funcs/credentialStoreCreateCredentialInStore.ts +91 -76
- package/src/funcs/credentialStoreListCredentialStores.ts +87 -72
- package/src/funcs/credentialUpdateCredential.ts +91 -76
- package/src/funcs/dataComponentCreateDataComponent.ts +90 -73
- package/src/funcs/dataComponentDeleteDataComponent.ts +74 -60
- package/src/funcs/dataComponentGetDataComponentById.ts +89 -74
- package/src/funcs/dataComponentListDataComponents.ts +91 -74
- package/src/funcs/dataComponentUpdateDataComponent.ts +91 -76
- package/src/funcs/externalAgentsCreateExternalAgent.ts +90 -73
- package/src/funcs/externalAgentsDeleteExternalAgent.ts +74 -60
- package/src/funcs/externalAgentsGetExternalAgentById.ts +89 -74
- package/src/funcs/externalAgentsListExternalAgents.ts +91 -74
- package/src/funcs/externalAgentsUpdateExternalAgent.ts +91 -76
- package/src/funcs/fullAgentCreateFullAgent.ts +89 -74
- package/src/funcs/fullAgentDeleteFullAgent.ts +86 -70
- package/src/funcs/fullAgentGetFullAgent.ts +90 -73
- package/src/funcs/fullAgentUpdateFullAgent.ts +92 -75
- package/src/funcs/fullProjectCreateFullProject.ts +87 -72
- package/src/funcs/fullProjectDeleteFullProject.ts +82 -68
- package/src/funcs/fullProjectGetFullProject.ts +86 -71
- package/src/funcs/fullProjectUpdateFullProject.ts +88 -73
- package/src/funcs/functionToolsCreateFunctionTool.ts +91 -76
- package/src/funcs/functionToolsDeleteFunctionTool.ts +87 -73
- package/src/funcs/functionToolsGetFunctionTool.ts +91 -76
- package/src/funcs/functionToolsListFunctionTools.ts +92 -77
- package/src/funcs/functionToolsUpdateFunctionTool.ts +93 -78
- package/src/funcs/functionsCreateFunction.ts +90 -73
- package/src/funcs/functionsDeleteFunction.ts +86 -70
- package/src/funcs/functionsGetFunction.ts +90 -73
- package/src/funcs/functionsListFunctions.ts +91 -74
- package/src/funcs/functionsUpdateFunction.ts +92 -75
- package/src/funcs/health.ts +61 -45
- package/src/funcs/invitationsGetApiInvitationsPending.ts +60 -52
- package/src/funcs/mcpCatalogListMCPCatalog.ts +88 -71
- package/src/funcs/oAuthInitiateOauthLoginPublic.ts +74 -62
- package/src/funcs/oAuthOauthCallback.ts +73 -61
- package/src/funcs/playgroundCreatePlaygroundToken.ts +75 -62
- package/src/funcs/projectsCreateProject.ts +87 -72
- package/src/funcs/projectsDeleteProject.ts +86 -71
- package/src/funcs/projectsGetProjectById.ts +86 -71
- package/src/funcs/projectsListProjects.ts +87 -72
- package/src/funcs/projectsUpdateProject.ts +88 -73
- package/src/funcs/subAgentCreateSubagent.ts +91 -76
- package/src/funcs/subAgentDeleteSubagent.ts +77 -61
- package/src/funcs/subAgentExternalAgentRelationsCreateSubAgentExternalAgentRelation.ts +95 -79
- package/src/funcs/subAgentExternalAgentRelationsDeleteSubAgentExternalAgentRelation.ts +80 -65
- package/src/funcs/subAgentExternalAgentRelationsGetSubAgentExternalAgentRelationById.ts +95 -79
- package/src/funcs/subAgentExternalAgentRelationsListSubAgentExternalAgentRelations.ts +96 -80
- package/src/funcs/subAgentExternalAgentRelationsUpdateSubAgentExternalAgentRelation.ts +97 -81
- package/src/funcs/subAgentGetSubagentById.ts +91 -76
- package/src/funcs/subAgentListSubagents.ts +92 -77
- package/src/funcs/subAgentRelationsCreateSubAgentRelation.ts +91 -76
- package/src/funcs/subAgentRelationsDeleteSubAgentRelation.ts +76 -62
- package/src/funcs/subAgentRelationsGetSubAgentRelationById.ts +91 -76
- package/src/funcs/subAgentRelationsListSubAgentRelations.ts +96 -81
- package/src/funcs/subAgentRelationsUpdateSubAgentRelation.ts +93 -78
- package/src/funcs/subAgentTeamAgentRelationsCreateSubAgentTeamAgentRelation.ts +93 -78
- package/src/funcs/subAgentTeamAgentRelationsDeleteSubAgentTeamAgentRelation.ts +78 -64
- package/src/funcs/subAgentTeamAgentRelationsGetSubAgentTeamAgentRelationById.ts +93 -78
- package/src/funcs/subAgentTeamAgentRelationsListSubAgentTeamAgentRelations.ts +94 -79
- package/src/funcs/subAgentTeamAgentRelationsUpdateSubAgentTeamAgentRelation.ts +95 -80
- package/src/funcs/subAgentToolRelationsCreateSubagentToolRelation.ts +91 -76
- package/src/funcs/subAgentToolRelationsDeleteSubagentToolRelation.ts +76 -62
- package/src/funcs/subAgentToolRelationsGetSubagentToolRelation.ts +91 -76
- package/src/funcs/subAgentToolRelationsGetSubagentsForTool.ts +94 -79
- package/src/funcs/subAgentToolRelationsListSubagentToolRelations.ts +94 -79
- package/src/funcs/subAgentToolRelationsUpdateSubagentToolRelation.ts +93 -78
- package/src/funcs/subAgentUpdateSubagent.ts +93 -78
- package/src/funcs/thirdPartyMCPServersGetOauthRedirectUrl.ts +209 -0
- package/src/funcs/thirdPartyMCPServersGetThirdPartyMCPServer.ts +89 -74
- package/src/funcs/toolsCreateTool.ts +88 -73
- package/src/funcs/toolsDeleteTool.ts +97 -58
- package/src/funcs/toolsGetTool.ts +90 -73
- package/src/funcs/toolsGetUserCredentialForTool.ts +211 -0
- package/src/funcs/toolsListTools.ts +90 -75
- package/src/funcs/toolsUpdateTool.ts +92 -75
- package/src/funcs/userOrganizationsGetApiUsersUserIdOrganizations.ts +62 -52
- package/src/funcs/userOrganizationsPostApiUsersUserIdOrganizations.ts +64 -54
- package/src/hooks/hooks.ts +25 -14
- package/src/hooks/registration.ts +5 -4
- package/src/hooks/types.ts +18 -8
- package/src/index.ts +2 -1
- package/src/lib/base64.ts +8 -3
- package/src/lib/config.ts +19 -11
- package/src/lib/dlv.ts +3 -2
- package/src/lib/encodings.ts +118 -87
- package/src/lib/env.ts +17 -7
- package/src/lib/files.ts +29 -28
- package/src/lib/http.ts +66 -46
- package/src/lib/is-plain-object.ts +2 -1
- package/src/lib/logger.ts +1 -0
- package/src/lib/matchers.ts +111 -94
- package/src/lib/primitives.ts +14 -8
- package/src/lib/result.ts +4 -1
- package/src/lib/retries.ts +26 -18
- package/src/lib/schemas.ts +20 -26
- package/src/lib/sdks.ts +115 -85
- package/src/lib/security.ts +90 -46
- package/src/lib/url.ts +10 -5
- package/src/mcp-server/cli/start/command.ts +54 -41
- package/src/mcp-server/cli/start/impl.ts +52 -38
- package/src/mcp-server/cli.ts +2 -1
- package/src/mcp-server/console-logger.ts +27 -12
- package/src/mcp-server/extensions.ts +11 -6
- package/src/mcp-server/mcp-server.ts +8 -7
- package/src/mcp-server/prompts.ts +64 -51
- package/src/mcp-server/resources.ts +54 -35
- package/src/mcp-server/scopes.ts +1 -0
- package/src/mcp-server/server.ts +25 -6
- package/src/mcp-server/shared.ts +35 -24
- package/src/mcp-server/tools/agentArtifactComponentRelationsAssociateArtifactComponentWithAgent.ts +34 -33
- package/src/mcp-server/tools/agentArtifactComponentRelationsCheckArtifactComponentAgentAssociation.ts +34 -33
- package/src/mcp-server/tools/agentArtifactComponentRelationsGetAgentsUsingArtifactComponent.ts +34 -32
- package/src/mcp-server/tools/agentArtifactComponentRelationsGetArtifactComponentsForAgent.ts +34 -32
- package/src/mcp-server/tools/agentArtifactComponentRelationsRemoveArtifactComponentFromAgent.ts +34 -32
- package/src/mcp-server/tools/agentDataComponentRelationsAssociateDataComponentWithAgent.ts +33 -32
- package/src/mcp-server/tools/agentDataComponentRelationsCheckDataComponentAgentAssociation.ts +34 -32
- package/src/mcp-server/tools/agentDataComponentRelationsGetAgentsUsingDataComponent.ts +33 -32
- package/src/mcp-server/tools/agentDataComponentRelationsGetDataComponentsForAgent.ts +33 -32
- package/src/mcp-server/tools/agentDataComponentRelationsRemoveDataComponentFromAgent.ts +33 -32
- package/src/mcp-server/tools/agentGetFullAgentDefinition.ts +16 -13
- package/src/mcp-server/tools/agentGetRelatedAgentInfos.ts +16 -13
- package/src/mcp-server/tools/agentsCreateAgent.ts +16 -13
- package/src/mcp-server/tools/agentsDeleteAgent.ts +16 -13
- package/src/mcp-server/tools/agentsGetAgent.ts +16 -13
- package/src/mcp-server/tools/agentsListAgents.ts +16 -13
- package/src/mcp-server/tools/agentsUpdateAgent.ts +16 -13
- package/src/mcp-server/tools/apiKeysCreateAPIKey.ts +16 -13
- package/src/mcp-server/tools/apiKeysDeleteAPIKey.ts +16 -13
- package/src/mcp-server/tools/apiKeysGetAPIKeyById.ts +16 -13
- package/src/mcp-server/tools/apiKeysListAPIKeys.ts +16 -13
- package/src/mcp-server/tools/apiKeysUpdateAPIKey.ts +16 -13
- package/src/mcp-server/tools/artifactComponentCreateArtifactComponent.ts +19 -14
- package/src/mcp-server/tools/artifactComponentDeleteArtifactComponent.ts +19 -14
- package/src/mcp-server/tools/artifactComponentGetArtifactComponentById.ts +15 -12
- package/src/mcp-server/tools/artifactComponentListArtifactComponents.ts +19 -14
- package/src/mcp-server/tools/artifactComponentUpdateArtifactComponent.ts +19 -14
- package/src/mcp-server/tools/cliGetApiCliMe.ts +38 -0
- package/src/mcp-server/tools/contextConfigCreateContextConfig.ts +19 -14
- package/src/mcp-server/tools/contextConfigDeleteContextConfig.ts +19 -14
- package/src/mcp-server/tools/contextConfigGetContextConfigById.ts +19 -14
- package/src/mcp-server/tools/contextConfigListContextConfigs.ts +32 -28
- package/src/mcp-server/tools/contextConfigUpdateContextConfig.ts +19 -14
- package/src/mcp-server/tools/conversationsGetConversation.ts +16 -13
- package/src/mcp-server/tools/credentialCreateCredential.ts +16 -13
- package/src/mcp-server/tools/credentialDeleteCredential.ts +16 -13
- package/src/mcp-server/tools/credentialGetCredentialById.ts +16 -13
- package/src/mcp-server/tools/credentialListCredentials.ts +16 -13
- package/src/mcp-server/tools/credentialStoreCreateCredentialInStore.ts +19 -14
- package/src/mcp-server/tools/credentialStoreListCredentialStores.ts +19 -14
- package/src/mcp-server/tools/credentialUpdateCredential.ts +16 -13
- package/src/mcp-server/tools/dataComponentCreateDataComponent.ts +19 -14
- package/src/mcp-server/tools/dataComponentDeleteDataComponent.ts +19 -14
- package/src/mcp-server/tools/dataComponentGetDataComponentById.ts +19 -14
- package/src/mcp-server/tools/dataComponentListDataComponents.ts +32 -28
- package/src/mcp-server/tools/dataComponentUpdateDataComponent.ts +19 -14
- package/src/mcp-server/tools/externalAgentsCreateExternalAgent.ts +19 -14
- package/src/mcp-server/tools/externalAgentsDeleteExternalAgent.ts +19 -14
- package/src/mcp-server/tools/externalAgentsGetExternalAgentById.ts +19 -14
- package/src/mcp-server/tools/externalAgentsListExternalAgents.ts +19 -14
- package/src/mcp-server/tools/externalAgentsUpdateExternalAgent.ts +19 -14
- package/src/mcp-server/tools/fullAgentCreateFullAgent.ts +16 -13
- package/src/mcp-server/tools/fullAgentDeleteFullAgent.ts +16 -13
- package/src/mcp-server/tools/fullAgentGetFullAgent.ts +16 -13
- package/src/mcp-server/tools/fullAgentUpdateFullAgent.ts +16 -13
- package/src/mcp-server/tools/fullProjectCreateFullProject.ts +16 -13
- package/src/mcp-server/tools/fullProjectDeleteFullProject.ts +16 -13
- package/src/mcp-server/tools/fullProjectGetFullProject.ts +16 -13
- package/src/mcp-server/tools/fullProjectUpdateFullProject.ts +16 -13
- package/src/mcp-server/tools/functionToolsCreateFunctionTool.ts +32 -28
- package/src/mcp-server/tools/functionToolsDeleteFunctionTool.ts +32 -28
- package/src/mcp-server/tools/functionToolsGetFunctionTool.ts +16 -13
- package/src/mcp-server/tools/functionToolsListFunctionTools.ts +32 -28
- package/src/mcp-server/tools/functionToolsUpdateFunctionTool.ts +32 -28
- package/src/mcp-server/tools/functionsCreateFunction.ts +16 -13
- package/src/mcp-server/tools/functionsDeleteFunction.ts +16 -13
- package/src/mcp-server/tools/functionsGetFunction.ts +16 -13
- package/src/mcp-server/tools/functionsListFunctions.ts +16 -13
- package/src/mcp-server/tools/functionsUpdateFunction.ts +16 -13
- package/src/mcp-server/tools/health.ts +14 -12
- package/src/mcp-server/tools/invitationsGetApiInvitationsPending.ts +19 -14
- package/src/mcp-server/tools/mcpCatalogListMCPCatalog.ts +16 -13
- package/src/mcp-server/tools/oAuthInitiateOauthLoginPublic.ts +16 -13
- package/src/mcp-server/tools/oAuthOauthCallback.ts +16 -13
- package/src/mcp-server/tools/projectsCreateProject.ts +16 -13
- package/src/mcp-server/tools/projectsDeleteProject.ts +16 -13
- package/src/mcp-server/tools/projectsGetProjectById.ts +16 -13
- package/src/mcp-server/tools/projectsListProjects.ts +16 -13
- package/src/mcp-server/tools/projectsUpdateProject.ts +16 -13
- package/src/mcp-server/tools/subAgentCreateSubagent.ts +16 -13
- package/src/mcp-server/tools/subAgentDeleteSubagent.ts +16 -13
- package/src/mcp-server/tools/subAgentExternalAgentRelationsCreateSubAgentExternalAgentRelation.ts +34 -33
- package/src/mcp-server/tools/subAgentExternalAgentRelationsDeleteSubAgentExternalAgentRelation.ts +34 -33
- package/src/mcp-server/tools/subAgentExternalAgentRelationsGetSubAgentExternalAgentRelationById.ts +34 -33
- package/src/mcp-server/tools/subAgentExternalAgentRelationsListSubAgentExternalAgentRelations.ts +34 -31
- package/src/mcp-server/tools/subAgentExternalAgentRelationsUpdateSubAgentExternalAgentRelation.ts +34 -33
- package/src/mcp-server/tools/subAgentGetSubagentById.ts +16 -13
- package/src/mcp-server/tools/subAgentListSubagents.ts +16 -13
- package/src/mcp-server/tools/subAgentRelationsCreateSubAgentRelation.ts +19 -14
- package/src/mcp-server/tools/subAgentRelationsDeleteSubAgentRelation.ts +19 -14
- package/src/mcp-server/tools/subAgentRelationsGetSubAgentRelationById.ts +19 -14
- package/src/mcp-server/tools/subAgentRelationsListSubAgentRelations.ts +19 -14
- package/src/mcp-server/tools/subAgentRelationsUpdateSubAgentRelation.ts +19 -14
- package/src/mcp-server/tools/subAgentTeamAgentRelationsCreateSubAgentTeamAgentRelation.ts +33 -32
- package/src/mcp-server/tools/subAgentTeamAgentRelationsDeleteSubAgentTeamAgentRelation.ts +33 -32
- package/src/mcp-server/tools/subAgentTeamAgentRelationsGetSubAgentTeamAgentRelationById.ts +34 -32
- package/src/mcp-server/tools/subAgentTeamAgentRelationsListSubAgentTeamAgentRelations.ts +33 -32
- package/src/mcp-server/tools/subAgentTeamAgentRelationsUpdateSubAgentTeamAgentRelation.ts +33 -32
- package/src/mcp-server/tools/subAgentToolRelationsCreateSubagentToolRelation.ts +33 -30
- package/src/mcp-server/tools/subAgentToolRelationsDeleteSubagentToolRelation.ts +33 -30
- package/src/mcp-server/tools/subAgentToolRelationsGetSubagentToolRelation.ts +20 -16
- package/src/mcp-server/tools/subAgentToolRelationsGetSubagentsForTool.ts +19 -14
- package/src/mcp-server/tools/subAgentToolRelationsListSubagentToolRelations.ts +33 -30
- package/src/mcp-server/tools/subAgentToolRelationsUpdateSubagentToolRelation.ts +33 -30
- package/src/mcp-server/tools/subAgentUpdateSubagent.ts +16 -13
- package/src/mcp-server/tools/thirdPartyMCPServersGetOauthRedirectUrl.ts +47 -0
- package/src/mcp-server/tools/thirdPartyMCPServersGetThirdPartyMCPServer.ts +15 -12
- package/src/mcp-server/tools/toolsCreateTool.ts +16 -13
- package/src/mcp-server/tools/toolsDeleteTool.ts +16 -13
- package/src/mcp-server/tools/toolsGetTool.ts +16 -13
- package/src/mcp-server/tools/toolsGetUserCredentialForTool.ts +43 -0
- package/src/mcp-server/tools/toolsListTools.ts +16 -13
- package/src/mcp-server/tools/toolsUpdateTool.ts +16 -13
- package/src/mcp-server/tools/userOrganizationsGetApiUsersUserIdOrganizations.ts +33 -30
- package/src/mcp-server/tools/userOrganizationsPostApiUsersUserIdOrganizations.ts +33 -30
- package/src/mcp-server/tools.ts +111 -79
- package/src/models/agent.ts +3 -2
- package/src/models/agentcreate.ts +3 -2
- package/src/models/agentlistresponse.ts +6 -5
- package/src/models/agentresponse.ts +4 -3
- package/src/models/agentstopwhen.ts +3 -2
- package/src/models/agentupdate.ts +3 -2
- package/src/models/agentwithincontextofproject.ts +30 -21
- package/src/models/agentwithincontextofprojectresponse.ts +5 -6
- package/src/models/apikey.ts +3 -2
- package/src/models/apikeycreate.ts +3 -2
- package/src/models/apikeylistresponse.ts +6 -5
- package/src/models/apikeyresponse.ts +4 -3
- package/src/models/apikeyupdate.ts +3 -2
- package/src/models/artifactcomponent.ts +6 -5
- package/src/models/artifactcomponentarrayresponse.ts +7 -5
- package/src/models/artifactcomponentcreate.ts +5 -6
- package/src/models/artifactcomponentlistresponse.ts +8 -6
- package/src/models/artifactcomponentresponse.ts +7 -5
- package/src/models/artifactcomponentupdate.ts +5 -6
- package/src/models/associateartifactcomponentwithagentop.ts +36 -32
- package/src/models/associatedatacomponentwithagentop.ts +28 -25
- package/src/models/badrequest.ts +28 -16
- package/src/models/candelegatetoexternalagent.ts +4 -5
- package/src/models/candelegatetoteamagent.ts +4 -5
- package/src/models/canuseitem.ts +9 -10
- package/src/models/checkartifactcomponentagentassociationop.ts +33 -31
- package/src/models/checkdatacomponentagentassociationop.ts +22 -19
- package/src/models/componentassociation.ts +7 -9
- package/src/models/componentassociationlistresponse.ts +5 -6
- package/src/models/contextconfig.ts +5 -6
- package/src/models/contextconfigcreate.ts +15 -13
- package/src/models/contextconfiglistresponse.ts +5 -6
- package/src/models/contextconfigresponse.ts +7 -9
- package/src/models/contextconfigupdate.ts +15 -13
- package/src/models/conversationwithformattedmessagesresponse.ts +5 -8
- package/src/models/createagentop.ts +23 -16
- package/src/models/createapikeyop.ts +41 -40
- package/src/models/createartifactcomponentop.ts +23 -20
- package/src/models/createcontextconfigop.ts +26 -20
- package/src/models/createcredentialinstoreop.ts +26 -22
- package/src/models/createcredentialinstorerequest.ts +4 -5
- package/src/models/createcredentialinstoreresponse.ts +4 -7
- package/src/models/createcredentialop.ts +23 -20
- package/src/models/createdatacomponentop.ts +25 -19
- package/src/models/createexternalagentop.ts +25 -19
- package/src/models/createfullagentop.ts +29 -23
- package/src/models/createfullprojectop.ts +25 -21
- package/src/models/createfunctionop.ts +27 -22
- package/src/models/createfunctiontoolop.ts +26 -20
- package/src/models/createplaygroundtokenop.ts +17 -30
- package/src/models/createprojectop.ts +39 -35
- package/src/models/createsubagentexternalagentrelationop.ts +30 -24
- package/src/models/createsubagentop.ts +28 -23
- package/src/models/createsubagentrelationop.ts +24 -21
- package/src/models/createsubagentteamagentrelationop.ts +30 -24
- package/src/models/createsubagenttoolrelationop.ts +26 -22
- package/src/models/createtoolop.ts +26 -16
- package/src/models/credentialreference.ts +35 -14
- package/src/models/credentialreferencecreate.ts +25 -7
- package/src/models/credentialreferencelistresponse.ts +8 -6
- package/src/models/credentialreferenceresponse.ts +7 -5
- package/src/models/credentialreferenceupdate.ts +25 -7
- package/src/models/credentialstore.ts +20 -10
- package/src/models/credentialstorelistresponse.ts +7 -5
- package/src/models/datacomponent.ts +5 -4
- package/src/models/datacomponentarrayresponse.ts +4 -5
- package/src/models/datacomponentcreate.ts +6 -5
- package/src/models/datacomponentlistresponse.ts +5 -6
- package/src/models/datacomponentresponse.ts +7 -9
- package/src/models/datacomponentupdate.ts +6 -5
- package/src/models/deleteagentop.ts +11 -10
- package/src/models/deleteapikeyop.ts +15 -17
- package/src/models/deleteartifactcomponentop.ts +9 -12
- package/src/models/deletecontextconfigop.ts +21 -18
- package/src/models/deletecredentialop.ts +9 -12
- package/src/models/deletedatacomponentop.ts +9 -12
- package/src/models/deleteexternalagentop.ts +9 -12
- package/src/models/deletefullagentop.ts +20 -17
- package/src/models/deletefullprojectop.ts +19 -16
- package/src/models/deletefunctionop.ts +22 -20
- package/src/models/deletefunctiontoolop.ts +21 -18
- package/src/models/deleteprojectop.ts +33 -32
- package/src/models/deletesubagentexternalagentrelationop.ts +11 -14
- package/src/models/deletesubagentop.ts +12 -16
- package/src/models/deletesubagentrelationop.ts +10 -13
- package/src/models/deletesubagentteamagentrelationop.ts +11 -14
- package/src/models/deletesubagenttoolrelationop.ts +10 -13
- package/src/models/deletetoolop.ts +34 -12
- package/src/models/errorresponse.ts +3 -2
- package/src/models/errors/apierror.ts +5 -4
- package/src/models/errors/httpclienterrors.ts +8 -7
- package/src/models/errors/sdkvalidationerror.ts +7 -58
- package/src/models/existsresponse.ts +3 -2
- package/src/models/externalagent.ts +5 -4
- package/src/models/externalagentcreate.ts +6 -5
- package/src/models/externalagentlistresponse.ts +5 -6
- package/src/models/externalagentresponse.ts +7 -9
- package/src/models/externalagentupdate.ts +6 -5
- package/src/models/forbidden.ts +28 -16
- package/src/models/fullagentagentinsert.ts +50 -39
- package/src/models/fullprojectdefinition.ts +52 -38
- package/src/models/fullprojectdefinitionresponse.ts +5 -6
- package/src/models/function.ts +3 -2
- package/src/models/functioncreate.ts +3 -2
- package/src/models/functionlistresponse.ts +9 -11
- package/src/models/functionresponse.ts +7 -5
- package/src/models/functiontool.ts +3 -2
- package/src/models/functiontoolcreate.ts +4 -3
- package/src/models/functiontoollistresponse.ts +5 -6
- package/src/models/functiontoolresponse.ts +7 -9
- package/src/models/functiontoolupdate.ts +4 -3
- package/src/models/functionupdate.ts +3 -2
- package/src/models/getagentop.ts +25 -18
- package/src/models/getagentsusingartifactcomponentop.ts +27 -21
- package/src/models/getagentsusingdatacomponentop.ts +27 -21
- package/src/models/getapiclimeop.ts +58 -0
- package/src/models/getapiinvitationspendingop.ts +10 -16
- package/src/models/getapikeybyidop.ts +34 -33
- package/src/models/getapiusersuseridorganizationsop.ts +13 -17
- package/src/models/getartifactcomponentbyidop.ts +22 -19
- package/src/models/getartifactcomponentsforagentop.ts +25 -21
- package/src/models/getcontextconfigbyidop.ts +23 -20
- package/src/models/getconversationop.ts +25 -20
- package/src/models/getcredentialbyidop.ts +22 -19
- package/src/models/getdatacomponentbyidop.ts +22 -19
- package/src/models/getdatacomponentsforagentop.ts +23 -20
- package/src/models/getexternalagentbyidop.ts +22 -19
- package/src/models/getfullagentdefinitionop.ts +27 -21
- package/src/models/getfullagentop.ts +38 -31
- package/src/models/getfullprojectop.ts +25 -22
- package/src/models/getfunctionop.ts +26 -16
- package/src/models/getfunctiontoolop.ts +23 -20
- package/src/models/getoauthredirecturlop.ts +111 -0
- package/src/models/getprojectbyidop.ts +25 -20
- package/src/models/getrelatedagentinfosop.ts +25 -21
- package/src/models/getsubagentbyidop.ts +25 -19
- package/src/models/getsubagentexternalagentrelationbyidop.ts +29 -23
- package/src/models/getsubagentrelationbyidop.ts +23 -20
- package/src/models/getsubagentsfortoolop.ts +27 -21
- package/src/models/getsubagentteamagentrelationbyidop.ts +29 -23
- package/src/models/getsubagenttoolrelationop.ts +25 -21
- package/src/models/getthirdpartymcpserverop.ts +43 -22
- package/src/models/gettoolop.ts +34 -25
- package/src/models/getusercredentialfortoolop.ts +64 -0
- package/src/models/healthop.ts +4 -3
- package/src/models/initiateoauthloginpublicop.ts +11 -13
- package/src/models/internalservererror.ts +34 -20
- package/src/models/listagentsop.ts +25 -15
- package/src/models/listapikeysop.ts +26 -16
- package/src/models/listartifactcomponentsop.ts +23 -19
- package/src/models/listcontextconfigsop.ts +22 -19
- package/src/models/listcredentialsop.ts +23 -19
- package/src/models/listcredentialstoresop.ts +21 -18
- package/src/models/listdatacomponentsop.ts +21 -18
- package/src/models/listexternalagentsop.ts +21 -18
- package/src/models/listfunctionsop.ts +36 -35
- package/src/models/listfunctiontoolsop.ts +22 -19
- package/src/models/listmcpcatalogop.ts +23 -21
- package/src/models/listprojectsop.ts +34 -27
- package/src/models/listsubagentexternalagentrelationsop.ts +26 -21
- package/src/models/listsubagentrelationsop.ts +24 -20
- package/src/models/listsubagentsop.ts +37 -36
- package/src/models/listsubagentteamagentrelationsop.ts +28 -22
- package/src/models/listsubagenttoolrelationsop.ts +27 -21
- package/src/models/listtoolsop.ts +41 -18
- package/src/models/mcpcataloglistresponse.ts +19 -13
- package/src/models/mcptool.ts +54 -25
- package/src/models/mcptoollistresponse.ts +6 -5
- package/src/models/mcptoolresponse.ts +6 -6
- package/src/models/model.ts +4 -3
- package/src/models/modelsettings.ts +4 -3
- package/src/models/notfound.ts +28 -16
- package/src/models/oauthcallbackop.ts +20 -22
- package/src/models/pagination.ts +3 -2
- package/src/models/postapiusersuseridorganizationsop.ts +18 -25
- package/src/models/project.ts +7 -6
- package/src/models/projectcreate.ts +7 -6
- package/src/models/projectlistresponse.ts +6 -5
- package/src/models/projectmodel.ts +4 -3
- package/src/models/projectresponse.ts +6 -6
- package/src/models/projectupdate.ts +7 -6
- package/src/models/relatedagentinfo.ts +8 -6
- package/src/models/relatedagentinfolistresponse.ts +8 -6
- package/src/models/removeartifactcomponentfromagentop.ts +25 -19
- package/src/models/removedatacomponentfromagentop.ts +25 -19
- package/src/models/removedresponse.ts +6 -6
- package/src/models/security.ts +9 -12
- package/src/models/statuscomponent.ts +17 -11
- package/src/models/statusupdate.ts +7 -3
- package/src/models/stopwhen.ts +3 -2
- package/src/models/subagent.ts +7 -6
- package/src/models/subagentartifactcomponentresponse.ts +4 -7
- package/src/models/subagentcreate.ts +8 -7
- package/src/models/subagentdatacomponentresponse.ts +4 -7
- package/src/models/subagentexternalagentrelation.ts +3 -4
- package/src/models/subagentexternalagentrelationcreate.ts +4 -5
- package/src/models/subagentexternalagentrelationlistresponse.ts +6 -7
- package/src/models/subagentexternalagentrelationresponse.ts +5 -6
- package/src/models/subagentexternalagentrelationupdate.ts +4 -5
- package/src/models/subagentlistresponse.ts +9 -11
- package/src/models/subagentrelation.ts +6 -4
- package/src/models/subagentrelationcreate.ts +15 -8
- package/src/models/subagentrelationlistresponse.ts +8 -6
- package/src/models/subagentrelationresponse.ts +7 -5
- package/src/models/subagentrelationupdate.ts +15 -8
- package/src/models/subagentresponse.ts +7 -5
- package/src/models/subagentteamagentrelation.ts +3 -4
- package/src/models/subagentteamagentrelationcreate.ts +4 -5
- package/src/models/subagentteamagentrelationlistresponse.ts +6 -7
- package/src/models/subagentteamagentrelationresponse.ts +5 -6
- package/src/models/subagentteamagentrelationupdate.ts +4 -5
- package/src/models/subagenttoolrelation.ts +13 -15
- package/src/models/subagenttoolrelationcreate.ts +13 -13
- package/src/models/subagenttoolrelationlistresponse.ts +6 -7
- package/src/models/subagenttoolrelationresponse.ts +5 -6
- package/src/models/subagenttoolrelationupdate.ts +13 -13
- package/src/models/subagentupdate.ts +8 -7
- package/src/models/teamagent.ts +3 -2
- package/src/models/thirdpartymcpserverresponse.ts +19 -13
- package/src/models/toolcreate.ts +43 -24
- package/src/models/toolupdate.ts +43 -24
- package/src/models/unauthorized.ts +26 -13
- package/src/models/unprocessableentity.ts +34 -20
- package/src/models/updateagentop.ts +24 -17
- package/src/models/updateapikeyop.ts +34 -30
- package/src/models/updateartifactcomponentop.ts +24 -21
- package/src/models/updatecontextconfigop.ts +27 -21
- package/src/models/updatecredentialop.ts +24 -21
- package/src/models/updatedatacomponentop.ts +26 -20
- package/src/models/updateexternalagentop.ts +26 -20
- package/src/models/updatefullagentop.ts +29 -23
- package/src/models/updatefullprojectop.ts +25 -21
- package/src/models/updatefunctionop.ts +28 -23
- package/src/models/updatefunctiontoolop.ts +27 -21
- package/src/models/updateprojectop.ts +38 -34
- package/src/models/updatesubagentexternalagentrelationop.ts +31 -25
- package/src/models/updatesubagentop.ts +29 -24
- package/src/models/updatesubagentrelationop.ts +25 -22
- package/src/models/updatesubagentteamagentrelationop.ts +31 -25
- package/src/models/updatesubagenttoolrelationop.ts +27 -23
- package/src/models/updatetoolop.ts +27 -17
- package/src/types/async.ts +24 -9
- package/src/types/bigint.ts +88 -0
- package/src/types/blobs.ts +5 -4
- package/src/types/enums.ts +2 -1
- package/src/types/fp.ts +4 -1
- package/src/types/rfcdate.ts +8 -5
- package/src/types/streams.ts +8 -5
- package/src/zod-int.ts +9 -0
- package/tsconfig.json +3 -2
- package/openapi.json +0 -17114
- package/scripts/watch-and-fetch.mjs +0 -72
- package/src/hooks/auth-hook.ts +0 -32
- package/src/http-server.ts +0 -34
|
@@ -1,44 +1,47 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 99da2bc86c62
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import { userOrganizationsPostApiUsersUserIdOrganizations } from
|
|
6
|
-
import { PostApiUsersUserIdOrganizationsRequest$zodSchema } from
|
|
7
|
-
import { formatResult, ToolDefinition } from
|
|
6
|
+
import { userOrganizationsPostApiUsersUserIdOrganizations } from "../../funcs/userOrganizationsPostApiUsersUserIdOrganizations.js";
|
|
7
|
+
import { PostApiUsersUserIdOrganizationsRequest$zodSchema } from "../../models/postapiusersuseridorganizationsop.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
9
|
|
|
9
10
|
const args = {
|
|
10
11
|
request: PostApiUsersUserIdOrganizationsRequest$zodSchema,
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
export const tool$userOrganizationsPostApiUsersUserIdOrganizations:
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
export const tool$userOrganizationsPostApiUsersUserIdOrganizations:
|
|
15
|
+
ToolDefinition<typeof args> = {
|
|
16
|
+
name: "user-organizations-post-api-users-user-id-organizations",
|
|
17
|
+
description: `Add user to organization
|
|
16
18
|
|
|
17
19
|
Associate a user with an organization`,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
annotations: {
|
|
21
|
+
"title": "",
|
|
22
|
+
"destructiveHint": false,
|
|
23
|
+
"idempotentHint": false,
|
|
24
|
+
"openWorldHint": false,
|
|
25
|
+
"readOnlyHint": false,
|
|
26
|
+
},
|
|
27
|
+
args,
|
|
28
|
+
tool: async (client, args, ctx) => {
|
|
29
|
+
const [result, apiCall] =
|
|
30
|
+
await userOrganizationsPostApiUsersUserIdOrganizations(
|
|
31
|
+
client,
|
|
32
|
+
args.request,
|
|
33
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
34
|
+
).$inspect();
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
if (!result.ok) {
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: "text", text: result.error.message }],
|
|
39
|
+
isError: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
const value = result.value;
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
+
return formatResult(value, apiCall);
|
|
46
|
+
},
|
|
47
|
+
};
|
package/src/mcp-server/tools.ts
CHANGED
|
@@ -1,88 +1,95 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 9a9a052be058
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
import {
|
|
8
|
+
ShapeOutput,
|
|
9
|
+
ZodRawShapeCompat,
|
|
10
|
+
} from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
11
|
+
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
12
|
+
import {
|
|
8
13
|
CallToolResult,
|
|
9
14
|
ServerNotification,
|
|
10
15
|
ServerRequest,
|
|
11
|
-
} from
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { isAsyncIterable, isBinaryData, valueToBase64 } from './shared.js';
|
|
16
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
17
|
+
import { InkeepAgentsManageCore } from "../core.js";
|
|
18
|
+
import { ConsoleLogger } from "./console-logger.js";
|
|
19
|
+
import { MCPScope } from "./scopes.js";
|
|
20
|
+
import { isAsyncIterable, isBinaryData, valueToBase64 } from "./shared.js";
|
|
17
21
|
|
|
18
|
-
export type ToolDefinition<
|
|
19
|
-
Args extends
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
22
|
+
export type ToolDefinition<
|
|
23
|
+
Args extends undefined | ZodRawShapeCompat = undefined,
|
|
24
|
+
> = Args extends ZodRawShapeCompat ? {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
scopes?: MCPScope[];
|
|
28
|
+
args: Args;
|
|
29
|
+
annotations: {
|
|
30
|
+
title: string;
|
|
31
|
+
destructiveHint: boolean;
|
|
32
|
+
idempotentHint: boolean;
|
|
33
|
+
openWorldHint: boolean;
|
|
34
|
+
readOnlyHint: boolean;
|
|
35
|
+
};
|
|
36
|
+
tool: (
|
|
37
|
+
client: InkeepAgentsManageCore,
|
|
38
|
+
args: ShapeOutput<Args>,
|
|
39
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
40
|
+
) => CallToolResult | Promise<CallToolResult>;
|
|
41
|
+
}
|
|
42
|
+
: {
|
|
43
|
+
name: string;
|
|
44
|
+
description: string;
|
|
45
|
+
scopes?: MCPScope[];
|
|
46
|
+
args?: undefined;
|
|
47
|
+
annotations: {
|
|
48
|
+
title: string;
|
|
49
|
+
destructiveHint: boolean;
|
|
50
|
+
idempotentHint: boolean;
|
|
51
|
+
openWorldHint: boolean;
|
|
52
|
+
readOnlyHint: boolean;
|
|
53
|
+
};
|
|
54
|
+
tool: (
|
|
55
|
+
client: InkeepAgentsManageCore,
|
|
56
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
57
|
+
) => CallToolResult | Promise<CallToolResult>;
|
|
58
|
+
};
|
|
55
59
|
|
|
56
60
|
// Optional function to assist with formatting tool results
|
|
57
61
|
export async function formatResult(
|
|
58
62
|
value: unknown,
|
|
59
|
-
init: { response?: Response | undefined }
|
|
63
|
+
init: { response?: Response | undefined },
|
|
60
64
|
): Promise<CallToolResult> {
|
|
61
|
-
if (typeof value ===
|
|
65
|
+
if (typeof value === "undefined") {
|
|
62
66
|
return { content: [] };
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
const { response } = init;
|
|
66
|
-
const contentType = response?.headers.get(
|
|
67
|
-
let content: CallToolResult[
|
|
70
|
+
const contentType = response?.headers.get("content-type") ?? "";
|
|
71
|
+
let content: CallToolResult["content"] = [];
|
|
68
72
|
|
|
69
73
|
if (contentType.search(/\bjson\b/g)) {
|
|
70
|
-
content = [{ type:
|
|
71
|
-
} else if (
|
|
74
|
+
content = [{ type: "text", text: JSON.stringify(value) }];
|
|
75
|
+
} else if (
|
|
76
|
+
contentType.startsWith("text/event-stream")
|
|
77
|
+
&& isAsyncIterable(value)
|
|
78
|
+
) {
|
|
72
79
|
content = await consumeSSE(value);
|
|
73
|
-
} else if (contentType.startsWith(
|
|
74
|
-
content = [{ type:
|
|
75
|
-
} else if (isBinaryData(value) && contentType.startsWith(
|
|
80
|
+
} else if (contentType.startsWith("text/") && typeof value === "string") {
|
|
81
|
+
content = [{ type: "text", text: value }];
|
|
82
|
+
} else if (isBinaryData(value) && contentType.startsWith("image/")) {
|
|
76
83
|
const data = await valueToBase64(value);
|
|
77
|
-
content = data == null
|
|
84
|
+
content = data == null
|
|
85
|
+
? []
|
|
86
|
+
: [{ type: "image", data, mimeType: contentType }];
|
|
78
87
|
} else {
|
|
79
88
|
return {
|
|
80
|
-
content: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
],
|
|
89
|
+
content: [{
|
|
90
|
+
type: "text",
|
|
91
|
+
text: `Unsupported content type: "${contentType}"`,
|
|
92
|
+
}],
|
|
86
93
|
isError: true,
|
|
87
94
|
};
|
|
88
95
|
}
|
|
@@ -90,14 +97,16 @@ export async function formatResult(
|
|
|
90
97
|
return { content };
|
|
91
98
|
}
|
|
92
99
|
|
|
93
|
-
async function consumeSSE(
|
|
94
|
-
|
|
100
|
+
async function consumeSSE(
|
|
101
|
+
value: AsyncIterable<unknown>,
|
|
102
|
+
): Promise<CallToolResult["content"]> {
|
|
103
|
+
const content: CallToolResult["content"] = [];
|
|
95
104
|
|
|
96
105
|
for await (const chunk of value) {
|
|
97
|
-
if (typeof chunk ===
|
|
98
|
-
content.push({ type:
|
|
106
|
+
if (typeof chunk === "string") {
|
|
107
|
+
content.push({ type: "text", text: chunk });
|
|
99
108
|
} else {
|
|
100
|
-
content.push({ type:
|
|
109
|
+
content.push({ type: "text", text: JSON.stringify(chunk) });
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
112
|
|
|
@@ -107,11 +116,17 @@ async function consumeSSE(value: AsyncIterable<unknown>): Promise<CallToolResult
|
|
|
107
116
|
export function createRegisterTool(
|
|
108
117
|
logger: ConsoleLogger,
|
|
109
118
|
server: McpServer,
|
|
110
|
-
getSDK: () =>
|
|
119
|
+
getSDK: () => InkeepAgentsManageCore,
|
|
111
120
|
allowedScopes: Set<MCPScope>,
|
|
112
|
-
allowedTools?: Set<string
|
|
113
|
-
):
|
|
114
|
-
|
|
121
|
+
allowedTools?: Set<string>,
|
|
122
|
+
): [
|
|
123
|
+
<A extends ZodRawShapeCompat | undefined>(tool: ToolDefinition<A>) => void,
|
|
124
|
+
Array<{ name: string; description: string }>,
|
|
125
|
+
] {
|
|
126
|
+
const tools: Array<{ name: string; description: string }> = [];
|
|
127
|
+
const registerTool = <A extends ZodRawShapeCompat | undefined>(
|
|
128
|
+
tool: ToolDefinition<A>,
|
|
129
|
+
): void => {
|
|
115
130
|
if (allowedTools && !allowedTools.has(tool.name)) {
|
|
116
131
|
return;
|
|
117
132
|
}
|
|
@@ -121,20 +136,37 @@ export function createRegisterTool(
|
|
|
121
136
|
return;
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
if (
|
|
139
|
+
if (
|
|
140
|
+
allowedScopes.size > 0
|
|
141
|
+
&& !scopes.every((s: MCPScope) => allowedScopes.has(s))
|
|
142
|
+
) {
|
|
125
143
|
return;
|
|
126
144
|
}
|
|
127
145
|
|
|
128
146
|
if (tool.args) {
|
|
129
|
-
server.tool(
|
|
130
|
-
|
|
131
|
-
|
|
147
|
+
server.tool(
|
|
148
|
+
tool.name,
|
|
149
|
+
tool.description,
|
|
150
|
+
tool.args,
|
|
151
|
+
tool.annotations,
|
|
152
|
+
async (args, ctx) => {
|
|
153
|
+
return tool.tool(getSDK(), args, ctx);
|
|
154
|
+
},
|
|
155
|
+
);
|
|
132
156
|
} else {
|
|
133
|
-
server.tool(
|
|
134
|
-
|
|
135
|
-
|
|
157
|
+
server.tool(
|
|
158
|
+
tool.name,
|
|
159
|
+
tool.description,
|
|
160
|
+
tool.annotations,
|
|
161
|
+
async (ctx) => {
|
|
162
|
+
return tool.tool(getSDK(), ctx);
|
|
163
|
+
},
|
|
164
|
+
);
|
|
136
165
|
}
|
|
137
166
|
|
|
138
|
-
logger.debug(
|
|
167
|
+
logger.debug("Registered tool", { name: tool.name });
|
|
168
|
+
tools.push({ name: tool.name, description: tool.description });
|
|
139
169
|
};
|
|
170
|
+
|
|
171
|
+
return [registerTool, tools];
|
|
140
172
|
}
|
package/src/models/agent.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2685fb0ad4f2
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
|
|
7
8
|
export type Agent = {
|
|
8
9
|
id: string;
|
|
@@ -18,7 +19,7 @@ export type Agent = {
|
|
|
18
19
|
updatedAt: string;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
export const Agent$zodSchema: z.ZodType<Agent
|
|
22
|
+
export const Agent$zodSchema: z.ZodType<Agent> = z.object({
|
|
22
23
|
contextConfigId: z.string().nullable(),
|
|
23
24
|
createdAt: z.string(),
|
|
24
25
|
defaultSubAgentId: z.string().nullable(),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 91b16e4248c7
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
|
|
7
8
|
export type AgentCreate = {
|
|
8
9
|
id: string;
|
|
@@ -18,7 +19,7 @@ export type AgentCreate = {
|
|
|
18
19
|
updatedAt?: string | undefined;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
export const AgentCreate$zodSchema: z.ZodType<AgentCreate
|
|
22
|
+
export const AgentCreate$zodSchema: z.ZodType<AgentCreate> = z.object({
|
|
22
23
|
contextConfigId: z.string().nullable().optional(),
|
|
23
24
|
createdAt: z.string().optional(),
|
|
24
25
|
defaultSubAgentId: z.string().nullable().optional(),
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 15dd3124a32c
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { Agent, Agent$zodSchema } from "./agent.js";
|
|
8
|
+
import { Pagination, Pagination$zodSchema } from "./pagination.js";
|
|
8
9
|
|
|
9
10
|
export type AgentListResponse = { data: Array<Agent>; pagination: Pagination };
|
|
10
11
|
|
|
11
|
-
export const AgentListResponse$zodSchema: z.ZodType<AgentListResponse
|
|
12
|
-
|
|
12
|
+
export const AgentListResponse$zodSchema: z.ZodType<AgentListResponse> = z
|
|
13
|
+
.object({
|
|
13
14
|
data: z.array(Agent$zodSchema),
|
|
14
15
|
pagination: Pagination$zodSchema,
|
|
15
16
|
});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 52f57fbfbb52
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
-
import {
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { Agent, Agent$zodSchema } from "./agent.js";
|
|
7
8
|
|
|
8
9
|
export type AgentResponse = { data: Agent };
|
|
9
10
|
|
|
10
|
-
export const AgentResponse$zodSchema: z.ZodType<AgentResponse
|
|
11
|
+
export const AgentResponse$zodSchema: z.ZodType<AgentResponse> = z.object({
|
|
11
12
|
data: Agent$zodSchema,
|
|
12
13
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 259aeb8c0020
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
|
|
7
8
|
export type AgentStopWhen = { transferCountIs?: number | undefined };
|
|
8
9
|
|
|
9
|
-
export const AgentStopWhen$zodSchema: z.ZodType<AgentStopWhen
|
|
10
|
+
export const AgentStopWhen$zodSchema: z.ZodType<AgentStopWhen> = z.object({
|
|
10
11
|
transferCountIs: z.number().optional(),
|
|
11
12
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: da192ed7840c
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
|
|
7
8
|
export type AgentUpdate = {
|
|
8
9
|
id?: string | undefined;
|
|
@@ -18,7 +19,7 @@ export type AgentUpdate = {
|
|
|
18
19
|
updatedAt?: string | undefined;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
export const AgentUpdate$zodSchema: z.ZodType<AgentUpdate
|
|
22
|
+
export const AgentUpdate$zodSchema: z.ZodType<AgentUpdate> = z.object({
|
|
22
23
|
contextConfigId: z.string().nullable().optional(),
|
|
23
24
|
createdAt: z.string().optional(),
|
|
24
25
|
defaultSubAgentId: z.string().nullable().optional(),
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a1ca5ecc852e
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
-
import {
|
|
7
|
-
import { type ContextConfigCreate, ContextConfigCreate$zodSchema } from './contextconfigcreate.js';
|
|
8
|
-
import { type ExternalAgentCreate, ExternalAgentCreate$zodSchema } from './externalagentcreate.js';
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { AgentStopWhen, AgentStopWhen$zodSchema } from "./agentstopwhen.js";
|
|
9
8
|
import {
|
|
10
|
-
|
|
9
|
+
ContextConfigCreate,
|
|
10
|
+
ContextConfigCreate$zodSchema,
|
|
11
|
+
} from "./contextconfigcreate.js";
|
|
12
|
+
import {
|
|
13
|
+
ExternalAgentCreate,
|
|
14
|
+
ExternalAgentCreate$zodSchema,
|
|
15
|
+
} from "./externalagentcreate.js";
|
|
16
|
+
import {
|
|
17
|
+
FullAgentAgentInsert,
|
|
11
18
|
FullAgentAgentInsert$zodSchema,
|
|
12
|
-
} from
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
+
} from "./fullagentagentinsert.js";
|
|
20
|
+
import { FunctionCreate, FunctionCreate$zodSchema } from "./functioncreate.js";
|
|
21
|
+
import {
|
|
22
|
+
FunctionToolCreate,
|
|
23
|
+
FunctionToolCreate$zodSchema,
|
|
24
|
+
} from "./functiontoolcreate.js";
|
|
25
|
+
import { Model, Model$zodSchema } from "./model.js";
|
|
26
|
+
import { StatusUpdate, StatusUpdate$zodSchema } from "./statusupdate.js";
|
|
27
|
+
import { TeamAgent, TeamAgent$zodSchema } from "./teamagent.js";
|
|
28
|
+
import { ToolCreate, ToolCreate$zodSchema } from "./toolcreate.js";
|
|
19
29
|
|
|
20
30
|
export type AgentWithinContextOfProject = {
|
|
21
31
|
id: string;
|
|
@@ -39,26 +49,25 @@ export type AgentWithinContextOfProject = {
|
|
|
39
49
|
};
|
|
40
50
|
|
|
41
51
|
export const AgentWithinContextOfProject$zodSchema: z.ZodType<
|
|
42
|
-
AgentWithinContextOfProject
|
|
43
|
-
z.ZodTypeDef,
|
|
44
|
-
unknown
|
|
52
|
+
AgentWithinContextOfProject
|
|
45
53
|
> = z.object({
|
|
46
54
|
contextConfig: ContextConfigCreate$zodSchema.optional(),
|
|
47
55
|
contextConfigId: z.string().nullable().optional(),
|
|
48
56
|
createdAt: z.string().optional(),
|
|
49
57
|
defaultSubAgentId: z.string().nullable().optional(),
|
|
50
58
|
description: z.string().nullable().optional(),
|
|
51
|
-
externalAgents: z.record(ExternalAgentCreate$zodSchema)
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
externalAgents: z.record(z.string(), ExternalAgentCreate$zodSchema)
|
|
60
|
+
.optional(),
|
|
61
|
+
functionTools: z.record(z.string(), FunctionToolCreate$zodSchema).optional(),
|
|
62
|
+
functions: z.record(z.string(), FunctionCreate$zodSchema).optional(),
|
|
54
63
|
id: z.string(),
|
|
55
64
|
models: Model$zodSchema.optional(),
|
|
56
65
|
name: z.string(),
|
|
57
66
|
prompt: z.string().optional(),
|
|
58
67
|
statusUpdates: StatusUpdate$zodSchema.optional(),
|
|
59
68
|
stopWhen: AgentStopWhen$zodSchema.optional(),
|
|
60
|
-
subAgents: z.record(FullAgentAgentInsert$zodSchema),
|
|
61
|
-
teamAgents: z.record(TeamAgent$zodSchema).optional(),
|
|
62
|
-
tools: z.record(ToolCreate$zodSchema).optional(),
|
|
69
|
+
subAgents: z.record(z.string(), FullAgentAgentInsert$zodSchema),
|
|
70
|
+
teamAgents: z.record(z.string(), TeamAgent$zodSchema).optional(),
|
|
71
|
+
tools: z.record(z.string(), ToolCreate$zodSchema).optional(),
|
|
63
72
|
updatedAt: z.string().optional(),
|
|
64
73
|
});
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 832f26622f2d
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
import {
|
|
7
|
-
|
|
8
|
+
AgentWithinContextOfProject,
|
|
8
9
|
AgentWithinContextOfProject$zodSchema,
|
|
9
|
-
} from
|
|
10
|
+
} from "./agentwithincontextofproject.js";
|
|
10
11
|
|
|
11
12
|
export type AgentWithinContextOfProjectResponse = {
|
|
12
13
|
data: AgentWithinContextOfProject;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export const AgentWithinContextOfProjectResponse$zodSchema: z.ZodType<
|
|
16
|
-
AgentWithinContextOfProjectResponse
|
|
17
|
-
z.ZodTypeDef,
|
|
18
|
-
unknown
|
|
17
|
+
AgentWithinContextOfProjectResponse
|
|
19
18
|
> = z.object({
|
|
20
19
|
data: AgentWithinContextOfProject$zodSchema,
|
|
21
20
|
});
|
package/src/models/apikey.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1b799b55fe4f
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
|
|
7
8
|
export type ApiKey = {
|
|
8
9
|
id: string;
|
|
@@ -16,7 +17,7 @@ export type ApiKey = {
|
|
|
16
17
|
updatedAt: string;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
export const ApiKey$zodSchema: z.ZodType<ApiKey
|
|
20
|
+
export const ApiKey$zodSchema: z.ZodType<ApiKey> = z.object({
|
|
20
21
|
agentId: z.string(),
|
|
21
22
|
createdAt: z.string(),
|
|
22
23
|
expiresAt: z.string().nullable(),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 34c38c8a8e50
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
|
|
7
8
|
export type ApiKeyCreate = {
|
|
8
9
|
agentId: string;
|
|
@@ -12,7 +13,7 @@ export type ApiKeyCreate = {
|
|
|
12
13
|
updatedAt?: string | undefined;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
export const ApiKeyCreate$zodSchema: z.ZodType<ApiKeyCreate
|
|
16
|
+
export const ApiKeyCreate$zodSchema: z.ZodType<ApiKeyCreate> = z.object({
|
|
16
17
|
agentId: z.string(),
|
|
17
18
|
createdAt: z.string().optional(),
|
|
18
19
|
expiresAt: z.string().nullable().optional(),
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f83f203b04b9
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { ApiKey, ApiKey$zodSchema } from "./apikey.js";
|
|
8
|
+
import { Pagination, Pagination$zodSchema } from "./pagination.js";
|
|
8
9
|
|
|
9
10
|
export type ApiKeyListResponse = {
|
|
10
11
|
data: Array<ApiKey>;
|
|
11
12
|
pagination: Pagination;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
export const ApiKeyListResponse$zodSchema: z.ZodType<ApiKeyListResponse
|
|
15
|
-
|
|
15
|
+
export const ApiKeyListResponse$zodSchema: z.ZodType<ApiKeyListResponse> = z
|
|
16
|
+
.object({
|
|
16
17
|
data: z.array(ApiKey$zodSchema),
|
|
17
18
|
pagination: Pagination$zodSchema,
|
|
18
19
|
});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 228a9bad6938
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
-
import {
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { ApiKey, ApiKey$zodSchema } from "./apikey.js";
|
|
7
8
|
|
|
8
9
|
export type ApiKeyResponse = { data: ApiKey };
|
|
9
10
|
|
|
10
|
-
export const ApiKeyResponse$zodSchema: z.ZodType<ApiKeyResponse
|
|
11
|
+
export const ApiKeyResponse$zodSchema: z.ZodType<ApiKeyResponse> = z.object({
|
|
11
12
|
data: ApiKey$zodSchema,
|
|
12
13
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 3d1d69149475
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
|
-
import * as z from
|
|
6
|
+
import * as z from "zod";
|
|
6
7
|
|
|
7
8
|
export type ApiKeyUpdate = {
|
|
8
9
|
agentId?: string | undefined;
|
|
@@ -12,7 +13,7 @@ export type ApiKeyUpdate = {
|
|
|
12
13
|
updatedAt?: string | undefined;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
export const ApiKeyUpdate$zodSchema: z.ZodType<ApiKeyUpdate
|
|
16
|
+
export const ApiKeyUpdate$zodSchema: z.ZodType<ApiKeyUpdate> = z.object({
|
|
16
17
|
agentId: z.string().optional(),
|
|
17
18
|
expiresAt: z.string().nullable().optional(),
|
|
18
19
|
lastUsedAt: z.string().nullable().optional(),
|