@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
package/src/actions/types.ts
CHANGED
|
@@ -56,8 +56,9 @@ export type ActionRegistry<
|
|
|
56
56
|
A extends Action<unknown, unknown, BaseWorkflowContext, unknown> = AnyAction,
|
|
57
57
|
> = Map<ActionName, A>;
|
|
58
58
|
|
|
59
|
-
export type ExecArgs<
|
|
60
|
-
I,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
export type ExecArgs<I, C extends BaseWorkflowContext, S = unknown> = Omit<
|
|
60
|
+
ActionExecutionArgs<I, C, S, RuntimeBindings>,
|
|
61
|
+
'signal'
|
|
62
|
+
> & {
|
|
63
|
+
signal?: AbortSignal;
|
|
64
|
+
};
|
package/src/app.controller.ts
CHANGED
package/src/app.module.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { existsSync } from 'fs';
|
|
8
|
+
import { createRequire } from 'node:module';
|
|
8
9
|
import path, { join } from 'path';
|
|
9
10
|
|
|
10
11
|
import KeyvRedis from '@keyv/redis';
|
|
@@ -45,6 +46,7 @@ import { LoggerModule } from './logger/logger.module';
|
|
|
45
46
|
import { MailerModule } from './mailer/mailer.module';
|
|
46
47
|
import { MigrationModule } from './migration/migration.module';
|
|
47
48
|
import { SettingModule } from './setting/setting.module';
|
|
49
|
+
import { WorkflowTransferModule } from './transfer/workflow-transfer.module';
|
|
48
50
|
import { Ability } from './user/guards/ability.guard';
|
|
49
51
|
import { UserModule } from './user/user.module';
|
|
50
52
|
import { WebsocketModule } from './websocket/websocket.module';
|
|
@@ -57,6 +59,18 @@ const workspaceFrontendPath = join(__dirname, '..', '..', 'frontend', 'dist');
|
|
|
57
59
|
const frontendStaticPath = existsSync(compiledFrontendPath)
|
|
58
60
|
? compiledFrontendPath
|
|
59
61
|
: workspaceFrontendPath;
|
|
62
|
+
const requireModule = createRequire(__filename);
|
|
63
|
+
const getMcpModuleImports = (): ModuleImports => {
|
|
64
|
+
if (!config.mcp.enabled) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const { McpApiModule } = requireModule(
|
|
69
|
+
'./mcp/mcp-api.module',
|
|
70
|
+
) as typeof import('./mcp/mcp-api.module');
|
|
71
|
+
|
|
72
|
+
return [McpApiModule];
|
|
73
|
+
};
|
|
60
74
|
// I18N options
|
|
61
75
|
const i18nOptions: I18nOptions = {
|
|
62
76
|
fallbackLanguage: 'en',
|
|
@@ -68,7 +82,7 @@ const i18nOptions: I18nOptions = {
|
|
|
68
82
|
path.join(__dirname, '/extensions/helpers/'),
|
|
69
83
|
path.join(__dirname, '/extensions/channels/'),
|
|
70
84
|
],
|
|
71
|
-
watch:
|
|
85
|
+
watch: config.env.toLowerCase() !== 'test',
|
|
72
86
|
},
|
|
73
87
|
resolvers: [
|
|
74
88
|
{ use: QueryResolver, options: ['lang'] },
|
|
@@ -102,6 +116,7 @@ export const HEXABOT_MODULE_IMPORTS: ModuleImports = [
|
|
|
102
116
|
ActionsModule,
|
|
103
117
|
BindingsModule,
|
|
104
118
|
WorkflowModule,
|
|
119
|
+
WorkflowTransferModule,
|
|
105
120
|
HelperModule,
|
|
106
121
|
LoggerModule,
|
|
107
122
|
WebsocketModule,
|
|
@@ -123,6 +138,7 @@ export const HEXABOT_MODULE_IMPORTS: ModuleImports = [
|
|
|
123
138
|
ignoreErrors: false,
|
|
124
139
|
}),
|
|
125
140
|
I18nModule.forRoot(i18nOptions),
|
|
141
|
+
...getMcpModuleImports(),
|
|
126
142
|
CacheModule.registerAsync({
|
|
127
143
|
isGlobal: true,
|
|
128
144
|
useFactory: async () => ({
|
|
@@ -12,12 +12,6 @@ const baseLabel: Label = {
|
|
|
12
12
|
...modelInstance,
|
|
13
13
|
title: '',
|
|
14
14
|
name: '',
|
|
15
|
-
label_id: {
|
|
16
|
-
messenger: '',
|
|
17
|
-
web: '',
|
|
18
|
-
dimelo: '',
|
|
19
|
-
twitter: '',
|
|
20
|
-
},
|
|
21
15
|
description: '',
|
|
22
16
|
builtin: false,
|
|
23
17
|
group: null,
|
|
@@ -27,12 +21,6 @@ export const labelMock: Label = {
|
|
|
27
21
|
...baseLabel,
|
|
28
22
|
title: 'Label',
|
|
29
23
|
name: 'label',
|
|
30
|
-
label_id: {
|
|
31
|
-
messenger: 'none',
|
|
32
|
-
web: 'none',
|
|
33
|
-
dimelo: 'none',
|
|
34
|
-
twitter: 'none',
|
|
35
|
-
},
|
|
36
24
|
};
|
|
37
25
|
|
|
38
26
|
export const customerLabelsMock: Label[] = [
|
|
@@ -40,22 +28,10 @@ export const customerLabelsMock: Label[] = [
|
|
|
40
28
|
...baseLabel,
|
|
41
29
|
title: 'Client',
|
|
42
30
|
name: 'client',
|
|
43
|
-
label_id: {
|
|
44
|
-
messenger: 'none',
|
|
45
|
-
web: 'none',
|
|
46
|
-
dimelo: 'none',
|
|
47
|
-
twitter: 'none',
|
|
48
|
-
},
|
|
49
31
|
},
|
|
50
32
|
{
|
|
51
33
|
...baseLabel,
|
|
52
34
|
title: 'Professional',
|
|
53
35
|
name: 'profressional',
|
|
54
|
-
label_id: {
|
|
55
|
-
messenger: 'none',
|
|
56
|
-
web: 'none',
|
|
57
|
-
dimelo: 'none',
|
|
58
|
-
twitter: 'none',
|
|
59
|
-
},
|
|
60
36
|
},
|
|
61
37
|
];
|
|
@@ -6,13 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { labelFullSchema, labelSchema } from '@hexabot-ai/types';
|
|
8
8
|
import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger';
|
|
9
|
-
import {
|
|
10
|
-
IsNotEmpty,
|
|
11
|
-
IsObject,
|
|
12
|
-
IsOptional,
|
|
13
|
-
IsString,
|
|
14
|
-
Matches,
|
|
15
|
-
} from 'class-validator';
|
|
9
|
+
import { IsNotEmpty, IsOptional, IsString, Matches } from 'class-validator';
|
|
16
10
|
|
|
17
11
|
import { IsUUIDv4 } from '@/utils/decorators/is-uuid.decorator';
|
|
18
12
|
import { TDto } from '@/utils/types/dto.types';
|
|
@@ -43,11 +37,6 @@ export class LabelCreateDto {
|
|
|
43
37
|
@IsOptional()
|
|
44
38
|
@IsString()
|
|
45
39
|
description?: string;
|
|
46
|
-
|
|
47
|
-
@ApiPropertyOptional({ description: 'Label id', type: Object })
|
|
48
|
-
@IsOptional()
|
|
49
|
-
@IsObject()
|
|
50
|
-
label_id?: Record<string, any>;
|
|
51
40
|
}
|
|
52
41
|
|
|
53
42
|
export class LabelUpdateDto extends PartialType(LabelCreateDto) {}
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
} from 'typeorm';
|
|
17
17
|
|
|
18
18
|
import { AuditLabel } from '@/audit/decorators/audit-label.decorator';
|
|
19
|
-
import { JsonColumn } from '@/database/decorators/json-column.decorator';
|
|
20
19
|
import { BaseOrmEntity } from '@/database/entities/base.entity';
|
|
21
20
|
import { AsRelation } from '@/utils/decorators/relation-ref.decorator';
|
|
22
21
|
|
|
@@ -51,9 +50,6 @@ export class LabelOrmEntity extends BaseOrmEntity<LabelDto> {
|
|
|
51
50
|
@RelationId((label: LabelOrmEntity) => label.group)
|
|
52
51
|
private readonly groupId?: string | null;
|
|
53
52
|
|
|
54
|
-
@JsonColumn({ nullable: true })
|
|
55
|
-
label_id?: Record<string, any> | null;
|
|
56
|
-
|
|
57
53
|
@Column({ type: 'text', nullable: true })
|
|
58
54
|
description?: string | null;
|
|
59
55
|
|
package/src/config/index.ts
CHANGED
|
@@ -82,23 +82,37 @@ const sessionLimitSubquery =
|
|
|
82
82
|
? true
|
|
83
83
|
: process.env.SESSION_LIMIT_SUBQUERY === 'true';
|
|
84
84
|
const sessionTtlSeconds = parseOptionalInt(process.env.SESSION_TTL_SECONDS);
|
|
85
|
+
const apiBaseUrl = process.env.API_ORIGIN || 'http://localhost:3000/api';
|
|
85
86
|
|
|
86
87
|
export const config: Config = {
|
|
87
88
|
i18n: {
|
|
88
89
|
translationFilename: process.env.I18N_TRANSLATION_FILENAME || 'messages',
|
|
89
90
|
},
|
|
90
91
|
appPath: process.cwd(),
|
|
91
|
-
apiBaseUrl
|
|
92
|
+
apiBaseUrl,
|
|
92
93
|
uiBaseUrl: process.env.FRONTEND_BASE_URL
|
|
93
94
|
? process.env.FRONTEND_BASE_URL
|
|
94
95
|
: 'http://localhost:3000', // default to local dev
|
|
95
96
|
ssoEnabled: process.env.SSO_ENABLED === 'true',
|
|
97
|
+
mcp: {
|
|
98
|
+
enabled: process.env.MCP_ENABLED === 'true',
|
|
99
|
+
serverName: process.env.MCP_SERVER_NAME || 'hexabot-api',
|
|
100
|
+
serverTitle: process.env.MCP_SERVER_TITLE || 'Hexabot API MCP Server',
|
|
101
|
+
serverVersion: process.env.MCP_SERVER_VERSION || '1.0.0',
|
|
102
|
+
serverDescription:
|
|
103
|
+
process.env.MCP_SERVER_DESCRIPTION ||
|
|
104
|
+
'Manage Hexabot workflows, runs, memory, credentials, actions, and CMS content.',
|
|
105
|
+
serverInstructions:
|
|
106
|
+
process.env.MCP_SERVER_INSTRUCTIONS ||
|
|
107
|
+
'Use these tools to inspect and manage Hexabot API resources. Credential values are never exposed.',
|
|
108
|
+
},
|
|
96
109
|
security: {
|
|
97
110
|
httpsEnabled: process.env.HTTPS_ENABLED === 'true',
|
|
98
111
|
trustProxy: process.env.HTTPS_ENABLED === 'true', // Nginx in use ?
|
|
99
112
|
cors: {
|
|
100
113
|
allRoutes: true,
|
|
101
|
-
headers:
|
|
114
|
+
headers:
|
|
115
|
+
'content-type,x-xsrf-token,x-csrf-token,authorization,mcp-session-id,last-event-id',
|
|
102
116
|
methods: ['GET', 'PATCH', 'POST', 'DELETE', 'OPTIONS', 'HEAD'],
|
|
103
117
|
allowOrigins: process.env.FRONTEND_ORIGIN
|
|
104
118
|
? process.env.FRONTEND_ORIGIN.split(',').map((origin) => origin.trim())
|
|
@@ -109,6 +123,7 @@ export const config: Config = {
|
|
|
109
123
|
csrfExclude: [
|
|
110
124
|
/^\/auth\/local$/, // login
|
|
111
125
|
/^\/auth\/logout$/, // logout
|
|
126
|
+
/^\/mcp$/, // MCP Streamable HTTP endpoint
|
|
112
127
|
/^\/webhook\//, // Any webhook channel
|
|
113
128
|
/^\/reset(\/[^\/]+)?$/, // Reset request / Change password
|
|
114
129
|
],
|
package/src/config/types.ts
CHANGED
|
@@ -43,6 +43,14 @@ type TDatabaseConfig = {
|
|
|
43
43
|
schema?: string;
|
|
44
44
|
autoMigrate: boolean;
|
|
45
45
|
};
|
|
46
|
+
type TMcpConfig = {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
serverName: string;
|
|
49
|
+
serverTitle: string;
|
|
50
|
+
serverVersion: string;
|
|
51
|
+
serverDescription: string;
|
|
52
|
+
serverInstructions: string;
|
|
53
|
+
};
|
|
46
54
|
type SocketCookie =
|
|
47
55
|
| {
|
|
48
56
|
maxAge?: number | undefined;
|
|
@@ -59,6 +67,7 @@ export type Config = {
|
|
|
59
67
|
apiBaseUrl: string;
|
|
60
68
|
uiBaseUrl: string;
|
|
61
69
|
ssoEnabled: boolean;
|
|
70
|
+
mcp: TMcpConfig;
|
|
62
71
|
security: {
|
|
63
72
|
httpsEnabled: boolean;
|
|
64
73
|
trustProxy: boolean;
|
|
@@ -47,6 +47,7 @@ export class AiAgentAction extends AiBaseAction<
|
|
|
47
47
|
settings,
|
|
48
48
|
context,
|
|
49
49
|
bindings,
|
|
50
|
+
signal,
|
|
50
51
|
}: ExecArgs<AiAgentInput, WorkflowRuntimeContext, AiAgentSettings>) {
|
|
51
52
|
const logger = context.services.logger;
|
|
52
53
|
const modelBinding = bindings.model;
|
|
@@ -77,6 +78,7 @@ export class AiAgentAction extends AiBaseAction<
|
|
|
77
78
|
bindings.tools,
|
|
78
79
|
bindings.mcp,
|
|
79
80
|
selectedMemorySlugs,
|
|
81
|
+
signal,
|
|
80
82
|
)) as ToolSet | undefined;
|
|
81
83
|
const toolNames = [
|
|
82
84
|
...Object.keys(bindings.tools ?? {}),
|
|
@@ -115,7 +117,10 @@ export class AiAgentAction extends AiBaseAction<
|
|
|
115
117
|
throw new Error('Prompt is required to call the agent.');
|
|
116
118
|
}
|
|
117
119
|
|
|
118
|
-
const result = await agent.generate({
|
|
120
|
+
const result = await agent.generate({
|
|
121
|
+
prompt: agentPrompt,
|
|
122
|
+
abortSignal: signal,
|
|
123
|
+
});
|
|
119
124
|
|
|
120
125
|
return {
|
|
121
126
|
text: result.text,
|
|
@@ -656,6 +656,7 @@ export abstract class AiBaseAction<
|
|
|
656
656
|
toolBindings?: RuntimeBindings['tools'],
|
|
657
657
|
mcpToolBindings?: RuntimeBindings['mcp'],
|
|
658
658
|
selectedMemorySlugs: string[] = [],
|
|
659
|
+
signal?: AbortSignal,
|
|
659
660
|
): Promise<ToolSet | undefined> {
|
|
660
661
|
const actionService = context.services.actions;
|
|
661
662
|
const logger = context.services.logger;
|
|
@@ -691,15 +692,36 @@ export abstract class AiBaseAction<
|
|
|
691
692
|
description: action.description,
|
|
692
693
|
inputSchema: action.inputSchema,
|
|
693
694
|
outputSchema: action.outputSchema,
|
|
694
|
-
execute: async (input) =>
|
|
695
|
-
|
|
695
|
+
execute: async (input, options) => {
|
|
696
|
+
const toolSignal = options?.abortSignal ?? signal;
|
|
697
|
+
|
|
698
|
+
if (nestedBindings) {
|
|
699
|
+
return toolSignal
|
|
700
|
+
? action.run(
|
|
701
|
+
input,
|
|
702
|
+
context,
|
|
703
|
+
toolDefinition.settings as any,
|
|
704
|
+
nestedBindings as RuntimeBindings,
|
|
705
|
+
toolSignal,
|
|
706
|
+
)
|
|
707
|
+
: action.run(
|
|
708
|
+
input,
|
|
709
|
+
context,
|
|
710
|
+
toolDefinition.settings as any,
|
|
711
|
+
nestedBindings as RuntimeBindings,
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return toolSignal
|
|
696
716
|
? action.run(
|
|
697
717
|
input,
|
|
698
718
|
context,
|
|
699
719
|
toolDefinition.settings as any,
|
|
700
|
-
|
|
720
|
+
undefined,
|
|
721
|
+
toolSignal,
|
|
701
722
|
)
|
|
702
|
-
: action.run(input, context, toolDefinition.settings as any)
|
|
723
|
+
: action.run(input, context, toolDefinition.settings as any);
|
|
724
|
+
},
|
|
703
725
|
} as ToolSet[string];
|
|
704
726
|
}
|
|
705
727
|
}
|
|
@@ -746,7 +768,19 @@ export abstract class AiBaseAction<
|
|
|
746
768
|
description: updateMemoryAction.description,
|
|
747
769
|
inputSchema: memorySchema,
|
|
748
770
|
outputSchema: memorySchema,
|
|
749
|
-
execute: async (input) =>
|
|
771
|
+
execute: async (input, options) => {
|
|
772
|
+
const toolSignal = options?.abortSignal ?? signal;
|
|
773
|
+
|
|
774
|
+
return toolSignal
|
|
775
|
+
? updateMemoryAction.run(
|
|
776
|
+
input,
|
|
777
|
+
context,
|
|
778
|
+
undefined,
|
|
779
|
+
undefined,
|
|
780
|
+
toolSignal,
|
|
781
|
+
)
|
|
782
|
+
: updateMemoryAction.run(input, context);
|
|
783
|
+
},
|
|
750
784
|
} as ToolSet[string];
|
|
751
785
|
}
|
|
752
786
|
}
|
|
@@ -35,6 +35,7 @@ export abstract class AiGenerateObjectBaseAction<
|
|
|
35
35
|
settings,
|
|
36
36
|
context,
|
|
37
37
|
bindings,
|
|
38
|
+
signal,
|
|
38
39
|
}: ExecArgs<I, C, AiGenerateObjectSettings>) {
|
|
39
40
|
const logger = context.services.logger;
|
|
40
41
|
const modelBinding = bindings.model;
|
|
@@ -68,6 +69,7 @@ export abstract class AiGenerateObjectBaseAction<
|
|
|
68
69
|
bindings.tools,
|
|
69
70
|
bindings.mcp,
|
|
70
71
|
selectedMemorySlugs,
|
|
72
|
+
signal,
|
|
71
73
|
)) as ToolSet | undefined;
|
|
72
74
|
const toolNames = [
|
|
73
75
|
...Object.keys(bindings.tools ?? {}),
|
|
@@ -101,6 +103,7 @@ export abstract class AiGenerateObjectBaseAction<
|
|
|
101
103
|
...callSettingsWithoutStops,
|
|
102
104
|
model,
|
|
103
105
|
output,
|
|
106
|
+
abortSignal: signal,
|
|
104
107
|
...(tools ? { tools } : {}),
|
|
105
108
|
...(stopWhen ? { stopWhen } : {}),
|
|
106
109
|
});
|
|
@@ -31,6 +31,7 @@ export abstract class AiGenerateTextBaseAction<
|
|
|
31
31
|
settings,
|
|
32
32
|
context,
|
|
33
33
|
bindings,
|
|
34
|
+
signal,
|
|
34
35
|
}: ExecArgs<I, C, AiGenerateTextSettings>) {
|
|
35
36
|
const logger = context.services.logger;
|
|
36
37
|
const modelBinding = bindings.model;
|
|
@@ -61,6 +62,7 @@ export abstract class AiGenerateTextBaseAction<
|
|
|
61
62
|
bindings.tools,
|
|
62
63
|
bindings.mcp,
|
|
63
64
|
selectedMemorySlugs,
|
|
65
|
+
signal,
|
|
64
66
|
)) as ToolSet | undefined;
|
|
65
67
|
const toolNames = [
|
|
66
68
|
...Object.keys(bindings.tools ?? {}),
|
|
@@ -86,6 +88,7 @@ export abstract class AiGenerateTextBaseAction<
|
|
|
86
88
|
...promptPayload,
|
|
87
89
|
...callSettings,
|
|
88
90
|
model,
|
|
91
|
+
abortSignal: signal,
|
|
89
92
|
...(tools ? { tools } : {}),
|
|
90
93
|
...(stopWhen ? { stopWhen } : {}),
|
|
91
94
|
});
|
|
@@ -8,6 +8,7 @@ import { BindingKindDescriptor } from '@hexabot-ai/agentic';
|
|
|
8
8
|
import z from 'zod';
|
|
9
9
|
|
|
10
10
|
import { createBindingKind } from '@/bindings/create-binding-kind';
|
|
11
|
+
import { workflowResourceRef } from '@/workflow/resource-refs';
|
|
11
12
|
|
|
12
13
|
export const aiMcpToolBindingSchema = z.strictObject({
|
|
13
14
|
server_id: z.uuid().meta({
|
|
@@ -20,6 +21,7 @@ export const aiMcpToolBindingSchema = z.strictObject({
|
|
|
20
21
|
labelKey: 'name',
|
|
21
22
|
enableEntityAddButton: true,
|
|
22
23
|
},
|
|
24
|
+
...workflowResourceRef('mcpServer'),
|
|
23
25
|
}),
|
|
24
26
|
tool_names: z
|
|
25
27
|
.array(z.string().trim().min(1))
|
|
@@ -8,6 +8,7 @@ import { BindingKindDescriptor } from '@hexabot-ai/agentic';
|
|
|
8
8
|
import z from 'zod';
|
|
9
9
|
|
|
10
10
|
import { createBindingKind } from '@/bindings/create-binding-kind';
|
|
11
|
+
import { workflowResourceRef } from '@/workflow/resource-refs';
|
|
11
12
|
|
|
12
13
|
export const aiMemoryBindingSchema = z.strictObject({
|
|
13
14
|
definition_id: z.uuid().meta({
|
|
@@ -21,6 +22,7 @@ export const aiMemoryBindingSchema = z.strictObject({
|
|
|
21
22
|
labelKey: 'name',
|
|
22
23
|
enableEntityAddButton: true,
|
|
23
24
|
},
|
|
25
|
+
...workflowResourceRef('memoryDefinition'),
|
|
24
26
|
}),
|
|
25
27
|
});
|
|
26
28
|
|
|
@@ -9,6 +9,7 @@ import { z } from 'zod';
|
|
|
9
9
|
import { createAction } from '@/actions/create-action';
|
|
10
10
|
import { RagMode, RagQueryOptions } from '@/cms';
|
|
11
11
|
import { WorkflowRuntimeContext } from '@/workflow/contexts/workflow-runtime.context';
|
|
12
|
+
import { workflowResourceRef } from '@/workflow/resource-refs';
|
|
12
13
|
|
|
13
14
|
const contentRagModeSchema = z.enum(['embedding', 'lexical']);
|
|
14
15
|
const retrieveRagContentInputSchema = z.strictObject({
|
|
@@ -38,6 +39,7 @@ const retrieveRagContentSettingsSchema = z.strictObject({
|
|
|
38
39
|
valueKey: 'id',
|
|
39
40
|
labelKey: 'name',
|
|
40
41
|
},
|
|
42
|
+
...workflowResourceRef('contentType'),
|
|
41
43
|
}),
|
|
42
44
|
include_inactive: z.boolean().default(false).meta({
|
|
43
45
|
title: 'Include inactive',
|
|
@@ -17,6 +17,7 @@ import { ExecArgs } from '@/actions';
|
|
|
17
17
|
import { ActionService } from '@/actions/actions.service';
|
|
18
18
|
import { ContentTypeService } from '@/cms/services/content-type.service';
|
|
19
19
|
import { ConversationalWorkflowContext } from '@/workflow/contexts/conversational-workflow.context';
|
|
20
|
+
import { workflowResourceRef } from '@/workflow/resource-refs';
|
|
20
21
|
|
|
21
22
|
import {
|
|
22
23
|
MessageAction,
|
|
@@ -31,6 +32,12 @@ const listActionInputSchema = z
|
|
|
31
32
|
.extend({
|
|
32
33
|
content: contentOptionsSchema
|
|
33
34
|
.omit({ limit: true })
|
|
35
|
+
.extend({
|
|
36
|
+
contentType: contentOptionsSchema.shape.contentType.meta({
|
|
37
|
+
...contentOptionsSchema.shape.contentType.meta(),
|
|
38
|
+
...workflowResourceRef('contentType'),
|
|
39
|
+
}),
|
|
40
|
+
})
|
|
34
41
|
.default({
|
|
35
42
|
display: 'list',
|
|
36
43
|
buttons: [
|
|
@@ -8,6 +8,7 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
import { createAction } from '@/actions/create-action';
|
|
10
10
|
import { ConversationalWorkflowContext } from '@/workflow/contexts/conversational-workflow.context';
|
|
11
|
+
import { workflowResourceRef } from '@/workflow/resource-refs';
|
|
11
12
|
import { WorkflowType } from '@/workflow/types';
|
|
12
13
|
|
|
13
14
|
const subscriberUpdateLabelsInputSchema = z
|
|
@@ -24,6 +25,7 @@ const subscriberUpdateLabelsInputSchema = z
|
|
|
24
25
|
valueKey: 'id',
|
|
25
26
|
labelKey: 'title',
|
|
26
27
|
},
|
|
28
|
+
...workflowResourceRef('label'),
|
|
27
29
|
}),
|
|
28
30
|
labels_to_remove: z
|
|
29
31
|
.array(z.uuid())
|
|
@@ -37,6 +39,7 @@ const subscriberUpdateLabelsInputSchema = z
|
|
|
37
39
|
valueKey: 'id',
|
|
38
40
|
labelKey: 'title',
|
|
39
41
|
},
|
|
42
|
+
...workflowResourceRef('label'),
|
|
40
43
|
}),
|
|
41
44
|
})
|
|
42
45
|
.superRefine((input, ctx) => {
|
|
@@ -136,6 +136,17 @@ function resolveFinalUrl(response: {
|
|
|
136
136
|
return response.request?.res?.responseUrl ?? response.request?.responseUrl;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
function isAxiosCancellation(error: unknown) {
|
|
140
|
+
if (typeof axios.isCancel === 'function' && axios.isCancel(error)) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
error instanceof Error &&
|
|
146
|
+
(error as Error & { code?: string }).code === 'ERR_CANCELED'
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
139
150
|
function parseRequestBody(
|
|
140
151
|
body: string,
|
|
141
152
|
): string | Record<string, unknown> | unknown[] {
|
|
@@ -171,7 +182,7 @@ export const HttpRequestAction = createAction<
|
|
|
171
182
|
inputSchema: httpRequestInputSchema,
|
|
172
183
|
outputSchema: httpRequestOutputSchema,
|
|
173
184
|
settingsSchema: httpRequestSettingsSchema,
|
|
174
|
-
async execute({ input, context, settings }) {
|
|
185
|
+
async execute({ input, context, settings, signal }) {
|
|
175
186
|
const logger = context.services.logger;
|
|
176
187
|
const timeoutMs = settings.timeout_ms ?? 10000;
|
|
177
188
|
const method = settings.method ?? 'GET';
|
|
@@ -192,6 +203,7 @@ export const HttpRequestAction = createAction<
|
|
|
192
203
|
method,
|
|
193
204
|
headers,
|
|
194
205
|
timeout: timeoutMs,
|
|
206
|
+
signal,
|
|
195
207
|
validateStatus: () => true,
|
|
196
208
|
...(requestData !== undefined ? { data: requestData } : {}),
|
|
197
209
|
});
|
|
@@ -240,6 +252,10 @@ export const HttpRequestAction = createAction<
|
|
|
240
252
|
truncated: false,
|
|
241
253
|
};
|
|
242
254
|
} catch (error) {
|
|
255
|
+
if (signal?.aborted || isAxiosCancellation(error)) {
|
|
256
|
+
throw error;
|
|
257
|
+
}
|
|
258
|
+
|
|
243
259
|
const message =
|
|
244
260
|
error instanceof Error ? error.message : 'Unknown network error';
|
|
245
261
|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2025 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { JsonValueSchema } from '@hexabot-ai/agentic';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
|
|
10
|
+
import { createAction } from '@/actions/create-action';
|
|
11
|
+
import { WorkflowRuntimeContext } from '@/workflow/contexts/workflow-runtime.context';
|
|
12
|
+
import { workflowResourceRef } from '@/workflow/resource-refs';
|
|
13
|
+
import { CallWorkflowResult } from '@/workflow/types';
|
|
14
|
+
|
|
15
|
+
const callWorkflowInputSchema = z.object({
|
|
16
|
+
workflow_id: z.uuid().meta({
|
|
17
|
+
title: 'Workflow',
|
|
18
|
+
description: 'Workflow to call and wait for before continuing.',
|
|
19
|
+
'ui:widget': 'AutoCompleteWidget',
|
|
20
|
+
'ui:options': {
|
|
21
|
+
entity: 'Workflow',
|
|
22
|
+
valueKey: 'id',
|
|
23
|
+
labelKey: 'name',
|
|
24
|
+
},
|
|
25
|
+
...workflowResourceRef('workflow'),
|
|
26
|
+
}),
|
|
27
|
+
input: z.record(z.string(), JsonValueSchema).optional().meta({
|
|
28
|
+
title: 'Input',
|
|
29
|
+
description:
|
|
30
|
+
'Optional input payload for the called workflow. When omitted, the current trigger input is reused.',
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
const callWorkflowFinishedSchema = z.object({
|
|
34
|
+
status: z.literal('finished'),
|
|
35
|
+
workflow_id: z.uuid(),
|
|
36
|
+
workflow_run_id: z.uuid(),
|
|
37
|
+
output: z.record(z.string(), z.any()),
|
|
38
|
+
});
|
|
39
|
+
const callWorkflowResumeSchema = z.union([
|
|
40
|
+
callWorkflowFinishedSchema,
|
|
41
|
+
z.object({
|
|
42
|
+
status: z.literal('suspended'),
|
|
43
|
+
workflow_id: z.uuid(),
|
|
44
|
+
workflow_run_id: z.uuid(),
|
|
45
|
+
}),
|
|
46
|
+
z.object({
|
|
47
|
+
status: z.literal('failed'),
|
|
48
|
+
workflow_id: z.uuid(),
|
|
49
|
+
workflow_run_id: z.uuid(),
|
|
50
|
+
error: z.string(),
|
|
51
|
+
}),
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
type CallWorkflowInput = z.infer<typeof callWorkflowInputSchema>;
|
|
55
|
+
type CallWorkflowOutput = z.infer<typeof callWorkflowFinishedSchema>;
|
|
56
|
+
|
|
57
|
+
const assertFinishedResult = (result: CallWorkflowResult) => {
|
|
58
|
+
if (result.status === 'finished') {
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (result.status === 'failed') {
|
|
63
|
+
throw new Error(result.error);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
throw new Error(
|
|
67
|
+
`Workflow ${result.workflow_id} suspended but did not return a final result`,
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const CallWorkflowAction = createAction<
|
|
72
|
+
CallWorkflowInput,
|
|
73
|
+
CallWorkflowOutput,
|
|
74
|
+
WorkflowRuntimeContext
|
|
75
|
+
>({
|
|
76
|
+
name: 'call_workflow',
|
|
77
|
+
description: 'Calls another workflow and waits for its output.',
|
|
78
|
+
group: 'workflow',
|
|
79
|
+
icon: 'Workflow',
|
|
80
|
+
color: '#64748B',
|
|
81
|
+
inputSchema: callWorkflowInputSchema,
|
|
82
|
+
outputSchema: callWorkflowFinishedSchema,
|
|
83
|
+
async execute({ input, context }) {
|
|
84
|
+
// AgenticService owns workflow resolution and run creation because the
|
|
85
|
+
// target workflow is an API-persisted entity, not an agentic DSL primitive.
|
|
86
|
+
const result = await context.services.agentic.callWorkflow({
|
|
87
|
+
workflowId: input.workflow_id,
|
|
88
|
+
input: input.input,
|
|
89
|
+
parentContext: context,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (result.status !== 'suspended') {
|
|
93
|
+
return assertFinishedResult(result);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// If the child suspends, this action suspends the parent at the call site.
|
|
97
|
+
// A future event resumes the child leaf first; AgenticService then resumes
|
|
98
|
+
// this parent action with the final child payload.
|
|
99
|
+
const resumeData = await context.workflow.suspend<unknown>({
|
|
100
|
+
reason: 'awaiting_child_workflow',
|
|
101
|
+
data: {
|
|
102
|
+
workflow_id: result.workflow_id,
|
|
103
|
+
workflow_run_id: result.workflow_run_id,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
const parsed = callWorkflowResumeSchema.parse(resumeData);
|
|
107
|
+
|
|
108
|
+
return assertFinishedResult(parsed);
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
export default CallWorkflowAction;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"call_workflow": {
|
|
3
|
+
"Calls another workflow and waits for its output.": "Calls another workflow and waits for its output.",
|
|
4
|
+
"Workflow": "Workflow",
|
|
5
|
+
"Workflow to call and wait for before continuing.": "Workflow to call and wait for before continuing.",
|
|
6
|
+
"Input": "Input",
|
|
7
|
+
"Optional input payload for the called workflow. When omitted, the current trigger input is reused.": "Optional input payload for the called workflow. When omitted, the current trigger input is reused."
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"call_workflow": {
|
|
3
|
+
"Calls another workflow and waits for its output.": "Appelle un autre workflow et attend sa sortie.",
|
|
4
|
+
"Workflow": "Workflow",
|
|
5
|
+
"Workflow to call and wait for before continuing.": "Workflow à appeler et à attendre avant de continuer.",
|
|
6
|
+
"Input": "Entrée",
|
|
7
|
+
"Optional input payload for the called workflow. When omitted, the current trigger input is reused.": "Payload d'entrée facultatif pour le workflow appelé. S'il est omis, l'entrée du déclencheur courant est réutilisée."
|
|
8
|
+
}
|
|
9
|
+
}
|