@hexabot-ai/api 3.2.2-alpha.8 → 3.2.2-beta.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/dist/actions/actions.service.d.ts +1 -0
- package/dist/actions/actions.service.js +19 -1
- package/dist/actions/actions.service.js.map +1 -1
- package/dist/actions/types.d.ts +3 -1
- package/dist/app.controller.d.ts +1 -0
- package/dist/app.controller.js +1 -0
- package/dist/app.controller.js.map +1 -1
- package/dist/app.module.js +13 -1
- package/dist/app.module.js.map +1 -1
- package/dist/channel/lib/__test__/label.mock.js +0 -24
- package/dist/channel/lib/__test__/label.mock.js.map +1 -1
- package/dist/chat/dto/label.dto.d.ts +0 -1
- package/dist/chat/dto/label.dto.js +0 -6
- package/dist/chat/dto/label.dto.js.map +1 -1
- package/dist/chat/entities/label-group.entity.d.ts +0 -2
- package/dist/chat/entities/label.entity.d.ts +0 -4
- package/dist/chat/entities/label.entity.js +0 -5
- package/dist/chat/entities/label.entity.js.map +1 -1
- package/dist/chat/services/subscriber.service.d.ts +0 -1
- package/dist/config/index.js +14 -2
- package/dist/config/index.js.map +1 -1
- package/dist/config/types.d.ts +9 -0
- package/dist/extensions/actions/ai/agent.action.d.ts +1 -1
- package/dist/extensions/actions/ai/agent.action.js +6 -3
- package/dist/extensions/actions/ai/agent.action.js.map +1 -1
- package/dist/extensions/actions/ai/ai-base.action.d.ts +1 -1
- package/dist/extensions/actions/ai/ai-base.action.js +18 -5
- package/dist/extensions/actions/ai/ai-base.action.js.map +1 -1
- package/dist/extensions/actions/ai/generate-object.base.action.d.ts +1 -1
- package/dist/extensions/actions/ai/generate-object.base.action.js +3 -2
- package/dist/extensions/actions/ai/generate-object.base.action.js.map +1 -1
- package/dist/extensions/actions/ai/generate-text.base.action.d.ts +1 -1
- package/dist/extensions/actions/ai/generate-text.base.action.js +3 -2
- package/dist/extensions/actions/ai/generate-text.base.action.js.map +1 -1
- package/dist/extensions/actions/ai/mcp.binding.js +2 -0
- package/dist/extensions/actions/ai/mcp.binding.js.map +1 -1
- package/dist/extensions/actions/ai/memory.binding.js +2 -0
- package/dist/extensions/actions/ai/memory.binding.js.map +1 -1
- package/dist/extensions/actions/ai/retrieve-content-rag.action.js +2 -0
- package/dist/extensions/actions/ai/retrieve-content-rag.action.js.map +1 -1
- package/dist/extensions/actions/messaging/list.action.d.ts +2 -2
- package/dist/extensions/actions/messaging/list.action.js +7 -0
- package/dist/extensions/actions/messaging/list.action.js.map +1 -1
- package/dist/extensions/actions/subscriber/update-labels.action.js +3 -0
- package/dist/extensions/actions/subscriber/update-labels.action.js.map +1 -1
- package/dist/extensions/actions/web/http-request.action.js +12 -1
- package/dist/extensions/actions/web/http-request.action.js.map +1 -1
- package/dist/extensions/actions/workflow/call-workflow.action.d.ts +19 -0
- package/dist/extensions/actions/workflow/call-workflow.action.js +83 -0
- package/dist/extensions/actions/workflow/call-workflow.action.js.map +1 -0
- package/dist/extensions/actions/workflow/i18n/en.translations.json +9 -0
- package/dist/extensions/actions/workflow/i18n/fr.translations.json +9 -0
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/index.js +1 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/controllers/mcp-token.controller.d.ts +47 -0
- package/dist/mcp/controllers/mcp-token.controller.js +70 -0
- package/dist/mcp/controllers/mcp-token.controller.js.map +1 -0
- package/dist/mcp/decorators/mcp-permission.decorator.d.ts +8 -0
- package/dist/mcp/decorators/mcp-permission.decorator.js +11 -0
- package/dist/mcp/decorators/mcp-permission.decorator.js.map +1 -0
- package/dist/mcp/dto/mcp-token.dto.d.ts +17 -0
- package/dist/mcp/dto/mcp-token.dto.js +40 -0
- package/dist/mcp/dto/mcp-token.dto.js.map +1 -0
- package/dist/mcp/entities/mcp-token.entity.d.ts +111 -0
- package/dist/mcp/entities/mcp-token.entity.js +69 -0
- package/dist/mcp/entities/mcp-token.entity.js.map +1 -0
- package/dist/mcp/guards/hexabot-mcp-token.guard.d.ts +9 -0
- package/dist/mcp/guards/hexabot-mcp-token.guard.js +49 -0
- package/dist/mcp/guards/hexabot-mcp-token.guard.js.map +1 -0
- package/dist/mcp/guards/mcp-permission.guard.d.ts +9 -0
- package/dist/mcp/guards/mcp-permission.guard.js +47 -0
- package/dist/mcp/guards/mcp-permission.guard.js.map +1 -0
- package/dist/mcp/mcp-api.module.d.ts +2 -0
- package/dist/mcp/mcp-api.module.js +65 -0
- package/dist/mcp/mcp-api.module.js.map +1 -0
- package/dist/mcp/repositories/mcp-token.repository.d.ts +8 -0
- package/dist/mcp/repositories/mcp-token.repository.js +41 -0
- package/dist/mcp/repositories/mcp-token.repository.js.map +1 -0
- package/dist/mcp/services/mcp-token.service.d.ts +24 -0
- package/dist/mcp/services/mcp-token.service.js +106 -0
- package/dist/mcp/services/mcp-token.service.js.map +1 -0
- package/dist/mcp/tools/catalog-mcp.tools.d.ts +63 -0
- package/dist/mcp/tools/catalog-mcp.tools.js +135 -0
- package/dist/mcp/tools/catalog-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/cms-mcp.tools.d.ts +128 -0
- package/dist/mcp/tools/cms-mcp.tools.js +242 -0
- package/dist/mcp/tools/cms-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/credential-mcp.tools.d.ts +19 -0
- package/dist/mcp/tools/credential-mcp.tools.js +82 -0
- package/dist/mcp/tools/credential-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/hexabot-mcp-tool.base.d.ts +22 -0
- package/dist/mcp/tools/hexabot-mcp-tool.base.js +48 -0
- package/dist/mcp/tools/hexabot-mcp-tool.base.js.map +1 -0
- package/dist/mcp/tools/hexabot-mcp.schemas.d.ts +41 -0
- package/dist/mcp/tools/hexabot-mcp.schemas.js +36 -0
- package/dist/mcp/tools/hexabot-mcp.schemas.js.map +1 -0
- package/dist/mcp/tools/hexabot-mcp.tools.d.ts +1 -0
- package/dist/mcp/tools/hexabot-mcp.tools.js +18 -0
- package/dist/mcp/tools/hexabot-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/hexabot-mcp.utils.d.ts +2 -0
- package/dist/mcp/tools/hexabot-mcp.utils.js +21 -0
- package/dist/mcp/tools/hexabot-mcp.utils.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +22 -0
- package/dist/mcp/tools/index.js +50 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/mcp-server-mcp.tools.d.ts +77 -0
- package/dist/mcp/tools/mcp-server-mcp.tools.js +130 -0
- package/dist/mcp/tools/mcp-server-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/memory-definition-mcp.tools.d.ts +57 -0
- package/dist/mcp/tools/memory-definition-mcp.tools.js +128 -0
- package/dist/mcp/tools/memory-definition-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/workflow-mcp.helper.d.ts +156 -0
- package/dist/mcp/tools/workflow-mcp.helper.js +128 -0
- package/dist/mcp/tools/workflow-mcp.helper.js.map +1 -0
- package/dist/mcp/tools/workflow-mcp.tools.d.ts +790 -0
- package/dist/mcp/tools/workflow-mcp.tools.js +227 -0
- package/dist/mcp/tools/workflow-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/workflow-run-mcp.tools.d.ts +349 -0
- package/dist/mcp/tools/workflow-run-mcp.tools.js +242 -0
- package/dist/mcp/tools/workflow-run-mcp.tools.js.map +1 -0
- package/dist/mcp/tools/workflow-version-mcp.tools.d.ts +238 -0
- package/dist/mcp/tools/workflow-version-mcp.tools.js +368 -0
- package/dist/mcp/tools/workflow-version-mcp.tools.js.map +1 -0
- package/dist/mcp/types.d.ts +7 -0
- package/dist/mcp/types.js +3 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/static/assets/{browser-ponyfill-IkrOfrbH.js → browser-ponyfill-AQYxeOz6.js} +1 -1
- package/dist/static/assets/{cssMode-BVh8Ojbf.js → cssMode-CU7XHFDD.js} +1 -1
- package/dist/static/assets/{freemarker2-Cnk90W15.js → freemarker2-DA_oH4Qs.js} +1 -1
- package/dist/static/assets/{handlebars-DDmCOyIG.js → handlebars-DXFzBSlw.js} +1 -1
- package/dist/static/assets/{html-cDkAkcNZ.js → html-CnQNXujK.js} +1 -1
- package/dist/static/assets/{htmlMode-BKekdtGx.js → htmlMode-BpX8KTMR.js} +1 -1
- package/dist/static/assets/{index-CnXiX03v.js → index-BIqNbcu4.js} +2379 -2330
- package/dist/static/assets/{index-BI1BtkYv.css → index-D-b9KTZd.css} +1 -1
- package/dist/static/assets/{javascript-bO_Y-MtP.js → javascript-DeoOxUBN.js} +1 -1
- package/dist/static/assets/{jsonMode-p7oe1x6a.js → jsonMode-YGmaNoOG.js} +1 -1
- package/dist/static/assets/{liquid-DehK5Toi.js → liquid-K6wF5n3k.js} +1 -1
- package/dist/static/assets/{lspLanguageFeatures-C8ni2Y8s.js → lspLanguageFeatures-DFIoRPyQ.js} +1 -1
- package/dist/static/assets/{mdx-BqE3GcoU.js → mdx-CWEgpRjI.js} +1 -1
- package/dist/static/assets/{python-DYGyqTrT.js → python-22vBz2Ov.js} +1 -1
- package/dist/static/assets/{razor-CTOqYwI_.js → razor-CEUwDwv_.js} +1 -1
- package/dist/static/assets/{tsMode-n7ps72jb.js → tsMode-kpHfzhoP.js} +1 -1
- package/dist/static/assets/{typescript-B0sRB56_.js → typescript-PCkEoDOe.js} +1 -1
- package/dist/static/assets/{xml-C4I4RxHC.js → xml-OzOqd-hy.js} +1 -1
- package/dist/static/assets/{yaml-V_o23lNz.js → yaml-B3P_vvCy.js} +1 -1
- package/dist/static/index.html +2 -2
- package/dist/static/locales/en/translation.json +89 -5
- package/dist/static/locales/fr/translation.json +90 -6
- package/dist/transfer/adapters/content-type-transfer.adapter.d.ts +14 -0
- package/dist/transfer/adapters/content-type-transfer.adapter.js +102 -0
- package/dist/transfer/adapters/content-type-transfer.adapter.js.map +1 -0
- package/dist/transfer/adapters/credential-transfer.adapter.d.ts +13 -0
- package/dist/transfer/adapters/credential-transfer.adapter.js +110 -0
- package/dist/transfer/adapters/credential-transfer.adapter.js.map +1 -0
- package/dist/transfer/adapters/label-transfer.adapter.d.ts +15 -0
- package/dist/transfer/adapters/label-transfer.adapter.js +189 -0
- package/dist/transfer/adapters/label-transfer.adapter.js.map +1 -0
- package/dist/transfer/adapters/mcp-server-transfer.adapter.d.ts +16 -0
- package/dist/transfer/adapters/mcp-server-transfer.adapter.js +169 -0
- package/dist/transfer/adapters/mcp-server-transfer.adapter.js.map +1 -0
- package/dist/transfer/adapters/memory-definition-transfer.adapter.d.ts +14 -0
- package/dist/transfer/adapters/memory-definition-transfer.adapter.js +111 -0
- package/dist/transfer/adapters/memory-definition-transfer.adapter.js.map +1 -0
- package/dist/transfer/index.d.ts +7 -0
- package/dist/transfer/index.js +24 -0
- package/dist/transfer/index.js.map +1 -0
- package/dist/transfer/workflow-transfer-adapter.registry.d.ts +27 -0
- package/dist/transfer/workflow-transfer-adapter.registry.js +164 -0
- package/dist/transfer/workflow-transfer-adapter.registry.js.map +1 -0
- package/dist/transfer/workflow-transfer-definition.service.d.ts +40 -0
- package/dist/transfer/workflow-transfer-definition.service.js +353 -0
- package/dist/transfer/workflow-transfer-definition.service.js.map +1 -0
- package/dist/transfer/workflow-transfer-resource-adapter.d.ts +33 -0
- package/dist/transfer/workflow-transfer-resource-adapter.js +81 -0
- package/dist/transfer/workflow-transfer-resource-adapter.js.map +1 -0
- package/dist/transfer/workflow-transfer.controller.d.ts +9 -0
- package/dist/transfer/workflow-transfer.controller.js +63 -0
- package/dist/transfer/workflow-transfer.controller.js.map +1 -0
- package/dist/transfer/workflow-transfer.module.d.ts +2 -0
- package/dist/transfer/workflow-transfer.module.js +47 -0
- package/dist/transfer/workflow-transfer.module.js.map +1 -0
- package/dist/transfer/workflow-transfer.service.d.ts +51 -0
- package/dist/transfer/workflow-transfer.service.js +509 -0
- package/dist/transfer/workflow-transfer.service.js.map +1 -0
- package/dist/transfer/workflow-transfer.types.d.ts +31 -0
- package/dist/transfer/workflow-transfer.types.js +35 -0
- package/dist/transfer/workflow-transfer.types.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/event-emitter.d.ts +12 -5
- package/dist/user/controllers/user.controller.d.ts +0 -2
- package/dist/user/dto/user.dto.d.ts +1 -1
- package/dist/user/entities/user.entity.d.ts +0 -2
- package/dist/user/guards/ability.guard.js +12 -2
- package/dist/user/guards/ability.guard.js.map +1 -1
- package/dist/utils/test/fixtures/label-group.d.ts +1 -2
- package/dist/utils/test/fixtures/label.d.ts +1 -2
- package/dist/utils/test/fixtures/label.js +0 -19
- package/dist/utils/test/fixtures/label.js.map +1 -1
- package/dist/utils/test/fixtures/subscriber.d.ts +1 -1
- package/dist/utils/test/fixtures/workflow-run.js +4 -1
- package/dist/utils/test/fixtures/workflow-run.js.map +1 -1
- package/dist/utils/test/port.d.ts +8 -0
- package/dist/utils/test/port.js +34 -0
- package/dist/utils/test/port.js.map +1 -0
- package/dist/websocket/websocket.gateway.d.ts +2 -1
- package/dist/websocket/websocket.gateway.js.map +1 -1
- package/dist/workflow/contexts/workflow-runtime.context.d.ts +3 -1
- package/dist/workflow/contexts/workflow-runtime.context.js +5 -0
- package/dist/workflow/contexts/workflow-runtime.context.js.map +1 -1
- package/dist/workflow/controllers/workflow-run.controller.js +2 -0
- package/dist/workflow/controllers/workflow-run.controller.js.map +1 -1
- package/dist/workflow/dto/workflow-run.dto.d.ts +1 -0
- package/dist/workflow/dto/workflow-run.dto.js +11 -0
- package/dist/workflow/dto/workflow-run.dto.js.map +1 -1
- package/dist/workflow/entities/memory-record.entity.d.ts +2 -0
- package/dist/workflow/entities/workflow-run.entity.d.ts +62 -0
- package/dist/workflow/entities/workflow-run.entity.js +15 -1
- package/dist/workflow/entities/workflow-run.entity.js.map +1 -1
- package/dist/workflow/index.d.ts +7 -0
- package/dist/workflow/index.js +7 -0
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/repositories/workflow-run.repository.js +7 -1
- package/dist/workflow/repositories/workflow-run.repository.js.map +1 -1
- package/dist/workflow/resource-refs.d.ts +17 -0
- package/dist/workflow/resource-refs.js +15 -0
- package/dist/workflow/resource-refs.js.map +1 -0
- package/dist/workflow/services/agentic.service.d.ts +9 -2
- package/dist/workflow/services/agentic.service.js +142 -19
- package/dist/workflow/services/agentic.service.js.map +1 -1
- package/dist/workflow/services/workflow-run.service.d.ts +3 -0
- package/dist/workflow/services/workflow-run.service.js +75 -3
- package/dist/workflow/services/workflow-run.service.js.map +1 -1
- package/dist/workflow/services/workflow-version.service.d.ts +2 -0
- package/dist/workflow/services/workflow-version.service.js +19 -0
- package/dist/workflow/services/workflow-version.service.js.map +1 -1
- package/dist/workflow/services/workflow.service.d.ts +13 -9
- package/dist/workflow/services/workflow.service.js +64 -35
- package/dist/workflow/services/workflow.service.js.map +1 -1
- package/dist/workflow/types.d.ts +31 -0
- package/dist/workflow/types.js +2 -1
- package/dist/workflow/types.js.map +1 -1
- package/dist/workflow/workflow.module.js +3 -0
- package/dist/workflow/workflow.module.js.map +1 -1
- package/package.json +7 -5
- package/src/actions/actions.service.ts +34 -4
- package/src/actions/types.ts +6 -5
- package/src/app.controller.ts +1 -0
- package/src/app.module.ts +17 -1
- package/src/channel/lib/__test__/label.mock.ts +0 -24
- package/src/chat/dto/label.dto.ts +1 -12
- package/src/chat/entities/label.entity.ts +0 -4
- package/src/config/index.ts +17 -2
- package/src/config/types.ts +9 -0
- package/src/extensions/actions/ai/agent.action.ts +6 -1
- package/src/extensions/actions/ai/ai-base.action.ts +39 -5
- package/src/extensions/actions/ai/generate-object.base.action.ts +3 -0
- package/src/extensions/actions/ai/generate-text.base.action.ts +3 -0
- package/src/extensions/actions/ai/mcp.binding.ts +2 -0
- package/src/extensions/actions/ai/memory.binding.ts +2 -0
- package/src/extensions/actions/ai/retrieve-content-rag.action.ts +2 -0
- package/src/extensions/actions/messaging/list.action.ts +7 -0
- package/src/extensions/actions/subscriber/update-labels.action.ts +3 -0
- package/src/extensions/actions/web/http-request.action.ts +17 -1
- package/src/extensions/actions/workflow/call-workflow.action.ts +112 -0
- package/src/extensions/actions/workflow/i18n/en.translations.json +9 -0
- package/src/extensions/actions/workflow/i18n/fr.translations.json +9 -0
- package/src/extensions/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/mcp/README.md +277 -0
- package/src/mcp/controllers/mcp-token.controller.ts +64 -0
- package/src/mcp/decorators/mcp-permission.decorator.ts +23 -0
- package/src/mcp/dto/mcp-token.dto.ts +48 -0
- package/src/mcp/entities/mcp-token.entity.ts +60 -0
- package/src/mcp/guards/hexabot-mcp-token.guard.ts +55 -0
- package/src/mcp/guards/mcp-permission.guard.ts +61 -0
- package/src/mcp/mcp-api.module.ts +61 -0
- package/src/mcp/repositories/mcp-token.repository.ts +34 -0
- package/src/mcp/services/mcp-token.service.ts +138 -0
- package/src/mcp/tools/catalog-mcp.tools.ts +122 -0
- package/src/mcp/tools/cms-mcp.tools.ts +239 -0
- package/src/mcp/tools/credential-mcp.tools.ts +81 -0
- package/src/mcp/tools/hexabot-mcp-tool.base.ts +74 -0
- package/src/mcp/tools/hexabot-mcp.schemas.ts +55 -0
- package/src/mcp/tools/hexabot-mcp.tools.ts +7 -0
- package/src/mcp/tools/hexabot-mcp.utils.ts +29 -0
- package/src/mcp/tools/index.ts +51 -0
- package/src/mcp/tools/mcp-server-mcp.tools.ts +135 -0
- package/src/mcp/tools/memory-definition-mcp.tools.ts +125 -0
- package/src/mcp/tools/workflow-mcp.helper.ts +219 -0
- package/src/mcp/tools/workflow-mcp.tools.ts +271 -0
- package/src/mcp/tools/workflow-run-mcp.tools.ts +292 -0
- package/src/mcp/tools/workflow-version-mcp.tools.ts +459 -0
- package/src/mcp/types.ts +14 -0
- package/src/transfer/adapters/content-type-transfer.adapter.ts +154 -0
- package/src/transfer/adapters/credential-transfer.adapter.ts +158 -0
- package/src/transfer/adapters/label-transfer.adapter.ts +291 -0
- package/src/transfer/adapters/mcp-server-transfer.adapter.ts +255 -0
- package/src/transfer/adapters/memory-definition-transfer.adapter.ts +167 -0
- package/src/transfer/index.ts +19 -0
- package/src/transfer/workflow-transfer-adapter.registry.ts +250 -0
- package/src/transfer/workflow-transfer-definition.service.ts +587 -0
- package/src/transfer/workflow-transfer-resource-adapter.ts +132 -0
- package/src/transfer/workflow-transfer.controller.ts +86 -0
- package/src/transfer/workflow-transfer.module.ts +46 -0
- package/src/transfer/workflow-transfer.service.ts +858 -0
- package/src/transfer/workflow-transfer.types.ts +98 -0
- package/src/user/guards/ability.guard.ts +15 -3
- package/src/utils/test/fixtures/label.ts +0 -19
- package/src/utils/test/fixtures/workflow-run.ts +4 -1
- package/src/utils/test/port.ts +48 -0
- package/src/websocket/websocket.gateway.ts +2 -1
- package/src/workflow/contexts/workflow-runtime.context.ts +12 -1
- package/src/workflow/controllers/workflow-run.controller.ts +2 -0
- package/src/workflow/dto/workflow-run.dto.ts +10 -0
- package/src/workflow/entities/workflow-run.entity.ts +22 -1
- package/src/workflow/index.ts +14 -0
- package/src/workflow/repositories/workflow-run.repository.ts +7 -1
- package/src/workflow/resource-refs.ts +44 -0
- package/src/workflow/services/agentic.service.ts +271 -30
- package/src/workflow/services/workflow-run.service.ts +120 -7
- package/src/workflow/services/workflow-version.service.ts +33 -0
- package/src/workflow/services/workflow.service.ts +86 -31
- package/src/workflow/types.ts +52 -0
- package/src/workflow/workflow.module.ts +3 -0
- package/types/event-emitter.d.ts +12 -5
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HexabotCmsMcpTools = void 0;
|
|
13
|
+
const types_1 = require("@hexabot-ai/types");
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const mcp_nest_1 = require("@rekog/mcp-nest");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const content_type_service_1 = require("../../cms/services/content-type.service");
|
|
18
|
+
const content_service_1 = require("../../cms/services/content.service");
|
|
19
|
+
const mcp_permission_decorator_1 = require("../decorators/mcp-permission.decorator");
|
|
20
|
+
const mcp_permission_guard_1 = require("../guards/mcp-permission.guard");
|
|
21
|
+
const hexabot_mcp_tool_base_1 = require("./hexabot-mcp-tool.base");
|
|
22
|
+
const hexabot_mcp_schemas_1 = require("./hexabot-mcp.schemas");
|
|
23
|
+
let HexabotCmsMcpTools = class HexabotCmsMcpTools extends hexabot_mcp_tool_base_1.HexabotMcpToolBase {
|
|
24
|
+
constructor(contentTypeService, contentService) {
|
|
25
|
+
super();
|
|
26
|
+
this.contentTypeService = contentTypeService;
|
|
27
|
+
this.contentService = contentService;
|
|
28
|
+
}
|
|
29
|
+
async searchContentTypes(args) {
|
|
30
|
+
const where = args.query ? { name: this.contains(args.query) } : {};
|
|
31
|
+
return await this.listWithCount(this.contentTypeService, this.findOptions(args, where));
|
|
32
|
+
}
|
|
33
|
+
async getContentType(args) {
|
|
34
|
+
const contentType = await this.contentTypeService.findOne(args.id);
|
|
35
|
+
if (!contentType) {
|
|
36
|
+
throw new common_1.NotFoundException(`Content type ${args.id} not found`);
|
|
37
|
+
}
|
|
38
|
+
return contentType;
|
|
39
|
+
}
|
|
40
|
+
async createContentType(args) {
|
|
41
|
+
return await this.contentTypeService.create(args);
|
|
42
|
+
}
|
|
43
|
+
async updateContentType(args) {
|
|
44
|
+
const { id, ...updates } = args;
|
|
45
|
+
return await this.contentTypeService.updateOne(id, updates);
|
|
46
|
+
}
|
|
47
|
+
async searchContent(args) {
|
|
48
|
+
if (args.query) {
|
|
49
|
+
return {
|
|
50
|
+
items: await this.contentService.textSearch(args.query, {
|
|
51
|
+
status: args.status,
|
|
52
|
+
contentTypeId: args.contentTypeId,
|
|
53
|
+
limit: args.limit,
|
|
54
|
+
}),
|
|
55
|
+
limit: args.limit,
|
|
56
|
+
skip: 0,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const where = {
|
|
60
|
+
...(args.contentTypeId
|
|
61
|
+
? { contentType: { id: args.contentTypeId } }
|
|
62
|
+
: {}),
|
|
63
|
+
...(args.status !== undefined ? { status: args.status } : {}),
|
|
64
|
+
};
|
|
65
|
+
return await this.listWithCount(this.contentService, this.findOptions(args, where));
|
|
66
|
+
}
|
|
67
|
+
async getContent(args) {
|
|
68
|
+
const content = await this.contentService.findOneAndPopulate(args.id);
|
|
69
|
+
if (!content) {
|
|
70
|
+
throw new common_1.NotFoundException(`Content ${args.id} not found`);
|
|
71
|
+
}
|
|
72
|
+
return content;
|
|
73
|
+
}
|
|
74
|
+
async createContent(args) {
|
|
75
|
+
return await this.contentService.create(args);
|
|
76
|
+
}
|
|
77
|
+
async updateContent(args) {
|
|
78
|
+
const { id, ...updates } = args;
|
|
79
|
+
return await this.contentService.updateOne(id, updates);
|
|
80
|
+
}
|
|
81
|
+
async searchRagContent(args) {
|
|
82
|
+
return {
|
|
83
|
+
items: await this.contentService.retrieve(args.query, {
|
|
84
|
+
mode: args.mode,
|
|
85
|
+
limit: args.limit,
|
|
86
|
+
contentTypeId: args.contentTypeId,
|
|
87
|
+
includeInactive: args.includeInactive,
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.HexabotCmsMcpTools = HexabotCmsMcpTools;
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, mcp_permission_decorator_1.McpPermission)('contenttype', types_1.Action.READ),
|
|
95
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
96
|
+
(0, mcp_nest_1.Tool)({
|
|
97
|
+
name: 'hexabot_content_type_search',
|
|
98
|
+
description: 'Search CMS content types.',
|
|
99
|
+
parameters: zod_1.z.object({
|
|
100
|
+
query: zod_1.z.string().optional(),
|
|
101
|
+
...hexabot_mcp_schemas_1.paginationSchema,
|
|
102
|
+
}),
|
|
103
|
+
}),
|
|
104
|
+
__metadata("design:type", Function),
|
|
105
|
+
__metadata("design:paramtypes", [Object]),
|
|
106
|
+
__metadata("design:returntype", Promise)
|
|
107
|
+
], HexabotCmsMcpTools.prototype, "searchContentTypes", null);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, mcp_permission_decorator_1.McpPermission)('contenttype', types_1.Action.READ),
|
|
110
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
111
|
+
(0, mcp_nest_1.Tool)({
|
|
112
|
+
name: 'hexabot_content_type_get',
|
|
113
|
+
description: 'Read one CMS content type.',
|
|
114
|
+
parameters: zod_1.z.object({
|
|
115
|
+
id: hexabot_mcp_schemas_1.uuidSchema,
|
|
116
|
+
}),
|
|
117
|
+
}),
|
|
118
|
+
__metadata("design:type", Function),
|
|
119
|
+
__metadata("design:paramtypes", [Object]),
|
|
120
|
+
__metadata("design:returntype", Promise)
|
|
121
|
+
], HexabotCmsMcpTools.prototype, "getContentType", null);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, mcp_permission_decorator_1.McpPermission)('contenttype', types_1.Action.CREATE),
|
|
124
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
125
|
+
(0, mcp_nest_1.Tool)({
|
|
126
|
+
name: 'hexabot_content_type_create',
|
|
127
|
+
description: 'Create a CMS content type.',
|
|
128
|
+
parameters: zod_1.z.object({
|
|
129
|
+
name: zod_1.z.string().min(1),
|
|
130
|
+
schema: hexabot_mcp_schemas_1.jsonObjectSchema,
|
|
131
|
+
}),
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Function),
|
|
134
|
+
__metadata("design:paramtypes", [Object]),
|
|
135
|
+
__metadata("design:returntype", Promise)
|
|
136
|
+
], HexabotCmsMcpTools.prototype, "createContentType", null);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, mcp_permission_decorator_1.McpPermission)('contenttype', types_1.Action.UPDATE),
|
|
139
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
140
|
+
(0, mcp_nest_1.Tool)({
|
|
141
|
+
name: 'hexabot_content_type_update',
|
|
142
|
+
description: 'Update a CMS content type.',
|
|
143
|
+
parameters: zod_1.z.object({
|
|
144
|
+
id: hexabot_mcp_schemas_1.uuidSchema,
|
|
145
|
+
name: zod_1.z.string().min(1).optional(),
|
|
146
|
+
schema: hexabot_mcp_schemas_1.jsonObjectSchema.optional(),
|
|
147
|
+
}),
|
|
148
|
+
}),
|
|
149
|
+
__metadata("design:type", Function),
|
|
150
|
+
__metadata("design:paramtypes", [Object]),
|
|
151
|
+
__metadata("design:returntype", Promise)
|
|
152
|
+
], HexabotCmsMcpTools.prototype, "updateContentType", null);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, mcp_permission_decorator_1.McpPermission)('content', types_1.Action.READ),
|
|
155
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
156
|
+
(0, mcp_nest_1.Tool)({
|
|
157
|
+
name: 'hexabot_content_search',
|
|
158
|
+
description: 'Search CMS content records.',
|
|
159
|
+
parameters: zod_1.z.object({
|
|
160
|
+
query: zod_1.z.string().optional(),
|
|
161
|
+
contentTypeId: hexabot_mcp_schemas_1.uuidSchema.optional(),
|
|
162
|
+
status: zod_1.z.boolean().optional(),
|
|
163
|
+
...hexabot_mcp_schemas_1.paginationSchema,
|
|
164
|
+
}),
|
|
165
|
+
}),
|
|
166
|
+
__metadata("design:type", Function),
|
|
167
|
+
__metadata("design:paramtypes", [Object]),
|
|
168
|
+
__metadata("design:returntype", Promise)
|
|
169
|
+
], HexabotCmsMcpTools.prototype, "searchContent", null);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, mcp_permission_decorator_1.McpPermission)('content', types_1.Action.READ),
|
|
172
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
173
|
+
(0, mcp_nest_1.Tool)({
|
|
174
|
+
name: 'hexabot_content_get',
|
|
175
|
+
description: 'Read one CMS content record.',
|
|
176
|
+
parameters: zod_1.z.object({
|
|
177
|
+
id: hexabot_mcp_schemas_1.uuidSchema,
|
|
178
|
+
}),
|
|
179
|
+
}),
|
|
180
|
+
__metadata("design:type", Function),
|
|
181
|
+
__metadata("design:paramtypes", [Object]),
|
|
182
|
+
__metadata("design:returntype", Promise)
|
|
183
|
+
], HexabotCmsMcpTools.prototype, "getContent", null);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, mcp_permission_decorator_1.McpPermission)('content', types_1.Action.CREATE),
|
|
186
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
187
|
+
(0, mcp_nest_1.Tool)({
|
|
188
|
+
name: 'hexabot_content_create',
|
|
189
|
+
description: 'Create a CMS content record.',
|
|
190
|
+
parameters: zod_1.z.object({
|
|
191
|
+
contentType: hexabot_mcp_schemas_1.uuidSchema,
|
|
192
|
+
title: zod_1.z.string().min(1),
|
|
193
|
+
status: zod_1.z.boolean().optional(),
|
|
194
|
+
properties: hexabot_mcp_schemas_1.jsonObjectSchema.optional(),
|
|
195
|
+
}),
|
|
196
|
+
}),
|
|
197
|
+
__metadata("design:type", Function),
|
|
198
|
+
__metadata("design:paramtypes", [Object]),
|
|
199
|
+
__metadata("design:returntype", Promise)
|
|
200
|
+
], HexabotCmsMcpTools.prototype, "createContent", null);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, mcp_permission_decorator_1.McpPermission)('content', types_1.Action.UPDATE),
|
|
203
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
204
|
+
(0, mcp_nest_1.Tool)({
|
|
205
|
+
name: 'hexabot_content_update',
|
|
206
|
+
description: 'Update a CMS content record.',
|
|
207
|
+
parameters: zod_1.z.object({
|
|
208
|
+
id: hexabot_mcp_schemas_1.uuidSchema,
|
|
209
|
+
contentType: hexabot_mcp_schemas_1.uuidSchema.optional(),
|
|
210
|
+
title: zod_1.z.string().min(1).optional(),
|
|
211
|
+
status: zod_1.z.boolean().optional(),
|
|
212
|
+
properties: hexabot_mcp_schemas_1.jsonObjectSchema.optional(),
|
|
213
|
+
}),
|
|
214
|
+
}),
|
|
215
|
+
__metadata("design:type", Function),
|
|
216
|
+
__metadata("design:paramtypes", [Object]),
|
|
217
|
+
__metadata("design:returntype", Promise)
|
|
218
|
+
], HexabotCmsMcpTools.prototype, "updateContent", null);
|
|
219
|
+
__decorate([
|
|
220
|
+
(0, mcp_permission_decorator_1.McpPermission)('content', types_1.Action.READ),
|
|
221
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
222
|
+
(0, mcp_nest_1.Tool)({
|
|
223
|
+
name: 'hexabot_rag_content_search',
|
|
224
|
+
description: 'Search indexed CMS content through Hexabot RAG retrieval.',
|
|
225
|
+
parameters: zod_1.z.object({
|
|
226
|
+
query: zod_1.z.string().min(1),
|
|
227
|
+
mode: zod_1.z.enum(['embedding', 'lexical']).optional(),
|
|
228
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
229
|
+
contentTypeId: hexabot_mcp_schemas_1.uuidSchema.optional(),
|
|
230
|
+
includeInactive: zod_1.z.boolean().optional(),
|
|
231
|
+
}),
|
|
232
|
+
}),
|
|
233
|
+
__metadata("design:type", Function),
|
|
234
|
+
__metadata("design:paramtypes", [Object]),
|
|
235
|
+
__metadata("design:returntype", Promise)
|
|
236
|
+
], HexabotCmsMcpTools.prototype, "searchRagContent", null);
|
|
237
|
+
exports.HexabotCmsMcpTools = HexabotCmsMcpTools = __decorate([
|
|
238
|
+
(0, common_1.Injectable)(),
|
|
239
|
+
__metadata("design:paramtypes", [content_type_service_1.ContentTypeService,
|
|
240
|
+
content_service_1.ContentService])
|
|
241
|
+
], HexabotCmsMcpTools);
|
|
242
|
+
//# sourceMappingURL=cms-mcp.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cms-mcp.tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/cms-mcp.tools.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,6CAA2C;AAC3C,2CAA+D;AAC/D,8CAAmD;AACnD,6BAAwB;AAIxB,kFAAyE;AACzE,wEAAgE;AAEhE,qFAAuE;AACvE,yEAAoE;AAEpE,mEAA6D;AAC7D,+DAK+B;AAGxB,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,0CAAkB;IACxD,YACmB,kBAAsC,EACtC,cAA8B;QAE/C,KAAK,EAAE,CAAC;QAHS,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,mBAAc,GAAd,cAAc,CAAgB;IAGjD,CAAC;IAYK,AAAN,KAAK,CAAC,kBAAkB,CAAC,IAAyC;QAChE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEpE,OAAO,MAAM,IAAI,CAAC,aAAa,CAC7B,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,WAAW,CAAuB,IAAI,EAAE,KAAK,CAAC,CACpD,CAAC;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EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;YAClD,aAAa,EAAE,gCAAU,CAAC,QAAQ,EAAE;YACpC,eAAe,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SACxC,CAAC;KACH,CAAC;;;;0DAgBD;6BAjNU,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAG4B,yCAAkB;QACtB,gCAAc;GAHtC,kBAAkB,CAkN9B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CredentialService } from "../../user/services/credential.service";
|
|
2
|
+
import { HexabotMcpToolBase } from './hexabot-mcp-tool.base';
|
|
3
|
+
import { PaginationArgs } from './hexabot-mcp.schemas';
|
|
4
|
+
export declare class HexabotCredentialMcpTools extends HexabotMcpToolBase {
|
|
5
|
+
private readonly credentialService;
|
|
6
|
+
constructor(credentialService: CredentialService);
|
|
7
|
+
searchCredentials(args: {
|
|
8
|
+
query?: string;
|
|
9
|
+
ownerId?: string;
|
|
10
|
+
} & PaginationArgs): Promise<{
|
|
11
|
+
items: Omit<Record<string, unknown>, "value">[];
|
|
12
|
+
total: number;
|
|
13
|
+
limit: number | undefined;
|
|
14
|
+
skip: number | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
getCredential(args: {
|
|
17
|
+
id: string;
|
|
18
|
+
}): Promise<Omit<Record<string, unknown>, "value">>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HexabotCredentialMcpTools = void 0;
|
|
13
|
+
const types_1 = require("@hexabot-ai/types");
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const mcp_nest_1 = require("@rekog/mcp-nest");
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const credential_service_1 = require("../../user/services/credential.service");
|
|
18
|
+
const mcp_permission_decorator_1 = require("../decorators/mcp-permission.decorator");
|
|
19
|
+
const mcp_permission_guard_1 = require("../guards/mcp-permission.guard");
|
|
20
|
+
const hexabot_mcp_tool_base_1 = require("./hexabot-mcp-tool.base");
|
|
21
|
+
const hexabot_mcp_schemas_1 = require("./hexabot-mcp.schemas");
|
|
22
|
+
const hexabot_mcp_utils_1 = require("./hexabot-mcp.utils");
|
|
23
|
+
let HexabotCredentialMcpTools = class HexabotCredentialMcpTools extends hexabot_mcp_tool_base_1.HexabotMcpToolBase {
|
|
24
|
+
constructor(credentialService) {
|
|
25
|
+
super();
|
|
26
|
+
this.credentialService = credentialService;
|
|
27
|
+
}
|
|
28
|
+
async searchCredentials(args) {
|
|
29
|
+
const where = {
|
|
30
|
+
...(args.ownerId ? { owner: { id: args.ownerId } } : {}),
|
|
31
|
+
...(args.query ? { name: this.contains(args.query) } : {}),
|
|
32
|
+
};
|
|
33
|
+
const result = await this.listWithCount(this.credentialService, this.findOptions(args, where));
|
|
34
|
+
return {
|
|
35
|
+
...result,
|
|
36
|
+
items: result.items.map((credential) => (0, hexabot_mcp_utils_1.sanitizeCredential)(credential)),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async getCredential(args) {
|
|
40
|
+
const credential = await this.credentialService.findOneAndPopulate(args.id);
|
|
41
|
+
if (!credential) {
|
|
42
|
+
throw new common_1.NotFoundException(`Credential ${args.id} not found`);
|
|
43
|
+
}
|
|
44
|
+
return (0, hexabot_mcp_utils_1.sanitizeCredential)(credential);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.HexabotCredentialMcpTools = HexabotCredentialMcpTools;
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mcp_permission_decorator_1.McpPermission)('credential', types_1.Action.READ),
|
|
50
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
51
|
+
(0, mcp_nest_1.Tool)({
|
|
52
|
+
name: 'hexabot_credential_search',
|
|
53
|
+
description: 'Search credentials by metadata only. Secret credential values are never returned.',
|
|
54
|
+
parameters: zod_1.z.object({
|
|
55
|
+
query: zod_1.z.string().optional(),
|
|
56
|
+
ownerId: hexabot_mcp_schemas_1.uuidSchema.optional(),
|
|
57
|
+
...hexabot_mcp_schemas_1.paginationSchema,
|
|
58
|
+
}),
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Function),
|
|
61
|
+
__metadata("design:paramtypes", [Object]),
|
|
62
|
+
__metadata("design:returntype", Promise)
|
|
63
|
+
], HexabotCredentialMcpTools.prototype, "searchCredentials", null);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, mcp_permission_decorator_1.McpPermission)('credential', types_1.Action.READ),
|
|
66
|
+
(0, mcp_nest_1.ToolGuards)([mcp_permission_guard_1.McpPermissionGuard]),
|
|
67
|
+
(0, mcp_nest_1.Tool)({
|
|
68
|
+
name: 'hexabot_credential_get',
|
|
69
|
+
description: 'Read credential metadata. Secret credential values are never returned.',
|
|
70
|
+
parameters: zod_1.z.object({
|
|
71
|
+
id: hexabot_mcp_schemas_1.uuidSchema,
|
|
72
|
+
}),
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [Object]),
|
|
76
|
+
__metadata("design:returntype", Promise)
|
|
77
|
+
], HexabotCredentialMcpTools.prototype, "getCredential", null);
|
|
78
|
+
exports.HexabotCredentialMcpTools = HexabotCredentialMcpTools = __decorate([
|
|
79
|
+
(0, common_1.Injectable)(),
|
|
80
|
+
__metadata("design:paramtypes", [credential_service_1.CredentialService])
|
|
81
|
+
], HexabotCredentialMcpTools);
|
|
82
|
+
//# sourceMappingURL=credential-mcp.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-mcp.tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/credential-mcp.tools.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,6CAA2C;AAC3C,2CAA+D;AAC/D,8CAAmD;AACnD,6BAAwB;AAExB,+EAAuE;AAEvE,qFAAuE;AACvE,yEAAoE;AAEpE,mEAA6D;AAC7D,+DAI+B;AAC/B,2DAAyD;AAGlD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,0CAAkB;IAC/D,YAA6B,iBAAoC;QAC/D,KAAK,EAAE,CAAC;QADmB,sBAAiB,GAAjB,iBAAiB,CAAmB;IAEjE,CAAC;IAcK,AAAN,KAAK,CAAC,iBAAiB,CACrB,IAA2D;QAE3D,MAAM,KAAK,GAAG;YACZ,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD,CAAC;QACT,MAAM,MAAM,GAAG,MAAM,IA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,wEAAwE;QAC1E,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,EAAE,EAAE,gCAAU;SACf,CAAC;KACH,CAAC;;;;8DAQD;oCAtDU,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEqC,sCAAiB;GADtD,yBAAyB,CAuDrC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { User } from '@hexabot-ai/types';
|
|
2
|
+
import { FindManyOptions } from 'typeorm';
|
|
3
|
+
import { HexabotMcpRequest } from '../types';
|
|
4
|
+
import { PaginationArgs } from './hexabot-mcp.schemas';
|
|
5
|
+
export declare abstract class HexabotMcpToolBase {
|
|
6
|
+
protected findOptions<Entity>(args: PaginationArgs, where: FindManyOptions<Entity>['where']): FindManyOptions<Entity>;
|
|
7
|
+
protected listWithCount<Entity>(service: {
|
|
8
|
+
findAndPopulate(options?: FindManyOptions<Entity>): Promise<unknown[]>;
|
|
9
|
+
count(options?: FindManyOptions<Entity>): Promise<number>;
|
|
10
|
+
}, options: FindManyOptions<Entity>): Promise<{
|
|
11
|
+
items: unknown[];
|
|
12
|
+
total: number;
|
|
13
|
+
limit: number | undefined;
|
|
14
|
+
skip: number | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
protected contains(value: string): import("typeorm").FindOperator<string>;
|
|
17
|
+
protected resolveRelationId(relation: string | {
|
|
18
|
+
id?: string | null;
|
|
19
|
+
} | null | undefined): string | null;
|
|
20
|
+
protected getActor(request?: HexabotMcpRequest): User;
|
|
21
|
+
protected getActorId(request?: HexabotMcpRequest): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HexabotMcpToolBase = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
class HexabotMcpToolBase {
|
|
7
|
+
findOptions(args, where) {
|
|
8
|
+
return {
|
|
9
|
+
where,
|
|
10
|
+
take: args.limit,
|
|
11
|
+
skip: args.skip,
|
|
12
|
+
order: { [args.sortBy]: args.sortDirection },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
async listWithCount(service, options) {
|
|
16
|
+
const [items, total] = await Promise.all([
|
|
17
|
+
service.findAndPopulate(options),
|
|
18
|
+
service.count({ where: options.where }),
|
|
19
|
+
]);
|
|
20
|
+
return {
|
|
21
|
+
items,
|
|
22
|
+
total,
|
|
23
|
+
limit: options.take,
|
|
24
|
+
skip: options.skip,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
contains(value) {
|
|
28
|
+
return (0, typeorm_1.Like)(`%${value}%`);
|
|
29
|
+
}
|
|
30
|
+
resolveRelationId(relation) {
|
|
31
|
+
if (typeof relation === 'string') {
|
|
32
|
+
return relation;
|
|
33
|
+
}
|
|
34
|
+
return relation?.id ?? null;
|
|
35
|
+
}
|
|
36
|
+
getActor(request) {
|
|
37
|
+
const actor = request?.hexabotUser ?? request?.user;
|
|
38
|
+
if (!actor?.id) {
|
|
39
|
+
throw new common_1.UnauthorizedException('MCP Hexabot user is required');
|
|
40
|
+
}
|
|
41
|
+
return actor;
|
|
42
|
+
}
|
|
43
|
+
getActorId(request) {
|
|
44
|
+
return this.getActor(request).id;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.HexabotMcpToolBase = HexabotMcpToolBase;
|
|
48
|
+
//# sourceMappingURL=hexabot-mcp-tool.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hexabot-mcp-tool.base.js","sourceRoot":"","sources":["../../../src/mcp/tools/hexabot-mcp-tool.base.ts"],"names":[],"mappings":";;;AAOA,2CAAuD;AACvD,qCAAgD;AAMhD,MAAsB,kBAAkB;IAC5B,WAAW,CACnB,IAAoB,EACpB,KAAuC;QAEvC,OAAO;YACL,KAAK;YACL,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,IAAI,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
|
+
import { DirectionType, McpServerTransport, WorkflowType } from "../../workflow/types";
|
|
3
|
+
export declare const uuidSchema: z.ZodString;
|
|
4
|
+
export declare const jsonObjectSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
5
|
+
export declare const paginationSchema: {
|
|
6
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
skip: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
sortBy: z.ZodDefault<z.ZodString>;
|
|
9
|
+
sortDirection: z.ZodDefault<z.ZodEnum<{
|
|
10
|
+
ASC: "ASC";
|
|
11
|
+
DESC: "DESC";
|
|
12
|
+
}>>;
|
|
13
|
+
};
|
|
14
|
+
export declare const workflowPayloadSchema: {
|
|
15
|
+
name: z.ZodOptional<z.ZodString>;
|
|
16
|
+
description: z.ZodOptional<z.ZodString>;
|
|
17
|
+
type: z.ZodOptional<z.ZodEnum<typeof WorkflowType>>;
|
|
18
|
+
schedule: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
|
+
builtin: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
zoom: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
direction: z.ZodOptional<z.ZodEnum<typeof DirectionType>>;
|
|
25
|
+
};
|
|
26
|
+
export declare const mcpServerPayloadSchema: {
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
transport: z.ZodOptional<z.ZodEnum<typeof McpServerTransport>>;
|
|
30
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
args: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
33
|
+
cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
credential: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
};
|
|
36
|
+
export type PaginationArgs = {
|
|
37
|
+
limit: number;
|
|
38
|
+
skip: number;
|
|
39
|
+
sortBy: string;
|
|
40
|
+
sortDirection: 'ASC' | 'DESC';
|
|
41
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mcpServerPayloadSchema = exports.workflowPayloadSchema = exports.paginationSchema = exports.jsonObjectSchema = exports.uuidSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_1 = require("../../workflow/types");
|
|
6
|
+
exports.uuidSchema = zod_1.z.string().uuid();
|
|
7
|
+
exports.jsonObjectSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
|
|
8
|
+
exports.paginationSchema = {
|
|
9
|
+
limit: zod_1.z.number().int().min(1).max(100).default(20),
|
|
10
|
+
skip: zod_1.z.number().int().min(0).default(0),
|
|
11
|
+
sortBy: zod_1.z.string().default('createdAt'),
|
|
12
|
+
sortDirection: zod_1.z.enum(['ASC', 'DESC']).default('DESC'),
|
|
13
|
+
};
|
|
14
|
+
exports.workflowPayloadSchema = {
|
|
15
|
+
name: zod_1.z.string().min(1).optional(),
|
|
16
|
+
description: zod_1.z.string().optional(),
|
|
17
|
+
type: zod_1.z.enum(types_1.WorkflowType).optional(),
|
|
18
|
+
schedule: zod_1.z.string().nullable().optional(),
|
|
19
|
+
inputSchema: exports.jsonObjectSchema.optional(),
|
|
20
|
+
builtin: zod_1.z.boolean().optional(),
|
|
21
|
+
x: zod_1.z.number().optional(),
|
|
22
|
+
y: zod_1.z.number().optional(),
|
|
23
|
+
zoom: zod_1.z.number().optional(),
|
|
24
|
+
direction: zod_1.z.enum(types_1.DirectionType).optional(),
|
|
25
|
+
};
|
|
26
|
+
exports.mcpServerPayloadSchema = {
|
|
27
|
+
name: zod_1.z.string().min(1).optional(),
|
|
28
|
+
enabled: zod_1.z.boolean().optional(),
|
|
29
|
+
transport: zod_1.z.enum(types_1.McpServerTransport).optional(),
|
|
30
|
+
url: zod_1.z.string().nullable().optional(),
|
|
31
|
+
command: zod_1.z.string().nullable().optional(),
|
|
32
|
+
args: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
33
|
+
cwd: zod_1.z.string().nullable().optional(),
|
|
34
|
+
credential: exports.uuidSchema.nullable().optional(),
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=hexabot-mcp.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hexabot-mcp.schemas.js","sourceRoot":"","sources":["../../../src/mcp/tools/hexabot-mcp.schemas.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AAExB,gDAI0B;AAEb,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;AAE/B,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAErD,QAAA,gBAAgB,GAAG;IAC9B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACnD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC;IACvC,aAAa,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CA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AC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,kBAAU,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./index"), exports);
|
|
18
|
+
//# sourceMappingURL=hexabot-mcp.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hexabot-mcp.tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/hexabot-mcp.tools.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,0CAAwB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.omitKeysDeep = exports.sanitizeCredential = void 0;
|
|
4
|
+
const sanitizeCredential = (credential) => {
|
|
5
|
+
const { value: _value, ...safeCredential } = credential;
|
|
6
|
+
return safeCredential;
|
|
7
|
+
};
|
|
8
|
+
exports.sanitizeCredential = sanitizeCredential;
|
|
9
|
+
const omitKeysDeep = (value, keys) => {
|
|
10
|
+
if (Array.isArray(value)) {
|
|
11
|
+
return value.map((item) => (0, exports.omitKeysDeep)(item, keys));
|
|
12
|
+
}
|
|
13
|
+
if (value === null || typeof value !== 'object' || value instanceof Date) {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
return Object.fromEntries(Object.entries(value)
|
|
17
|
+
.filter(([key]) => !keys.includes(key))
|
|
18
|
+
.map(([key, nestedValue]) => [key, (0, exports.omitKeysDeep)(nestedValue, keys)]));
|
|
19
|
+
};
|
|
20
|
+
exports.omitKeysDeep = omitKeysDeep;
|
|
21
|
+
//# sourceMappingURL=hexabot-mcp.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hexabot-mcp.utils.js","sourceRoot":"","sources":["../../../src/mcp/tools/hexabot-mcp.utils.ts"],"names":[],"mappings":";;;AAMO,MAAM,kBAAkB,GAAG,CAChC,UAAa,EACK,EAAE;IACpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,UAAU,CAAC;IAExD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B;AAEK,MAAM,YAAY,GAAG,CAAI,KAAQ,EAAE,IAAuB,EAAK,EAAE;IACtE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,oBAAY,EAAC,IAAI,EAAE,IAAI,CAAC,CAAM,CAAC;IAC5D,CAAC;IAED,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QACzE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC;SAC7C,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAA,oBAAY,EAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAClE,CAAC;AACT,CAAC,CAAC;AAdW,QAAA,YAAY,gBAcvB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HexabotCatalogMcpTools } from './catalog-mcp.tools';
|
|
2
|
+
import { HexabotCmsMcpTools } from './cms-mcp.tools';
|
|
3
|
+
import { HexabotCredentialMcpTools } from './credential-mcp.tools';
|
|
4
|
+
import { HexabotMcpServerTools } from './mcp-server-mcp.tools';
|
|
5
|
+
import { HexabotMemoryDefinitionMcpTools } from './memory-definition-mcp.tools';
|
|
6
|
+
import { HexabotWorkflowMcpHelper } from './workflow-mcp.helper';
|
|
7
|
+
import { HexabotWorkflowMcpTools } from './workflow-mcp.tools';
|
|
8
|
+
import { HexabotWorkflowRunMcpTools } from './workflow-run-mcp.tools';
|
|
9
|
+
import { HexabotWorkflowVersionMcpTools } from './workflow-version-mcp.tools';
|
|
10
|
+
export * from './catalog-mcp.tools';
|
|
11
|
+
export * from './cms-mcp.tools';
|
|
12
|
+
export * from './credential-mcp.tools';
|
|
13
|
+
export * from './hexabot-mcp-tool.base';
|
|
14
|
+
export * from './hexabot-mcp.schemas';
|
|
15
|
+
export * from './hexabot-mcp.utils';
|
|
16
|
+
export * from './memory-definition-mcp.tools';
|
|
17
|
+
export * from './mcp-server-mcp.tools';
|
|
18
|
+
export * from './workflow-mcp.helper';
|
|
19
|
+
export * from './workflow-mcp.tools';
|
|
20
|
+
export * from './workflow-run-mcp.tools';
|
|
21
|
+
export * from './workflow-version-mcp.tools';
|
|
22
|
+
export declare const HEXABOT_MCP_TOOL_PROVIDERS: (typeof HexabotCatalogMcpTools | typeof HexabotCmsMcpTools | typeof HexabotCredentialMcpTools | typeof HexabotMcpServerTools | typeof HexabotMemoryDefinitionMcpTools | typeof HexabotWorkflowMcpHelper | typeof HexabotWorkflowMcpTools | typeof HexabotWorkflowRunMcpTools | typeof HexabotWorkflowVersionMcpTools)[];
|