@decaf-ts/as-graph 0.6.0 → 0.7.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/README.md +776 -26
- package/assets/i18n/en.json +2527 -32
- package/dist/as-graph.cjs +1 -1
- package/dist/as-graph.cjs.map +1 -1
- package/dist/as-graph.js +1 -1
- package/dist/as-graph.js.map +1 -1
- package/lib/cjs/engine/auth/GraphAuthValidator.cjs +19 -0
- package/lib/cjs/engine/auth/GraphAuthValidator.cjs.map +1 -1
- package/lib/cjs/engine/constants.cjs +61 -1
- package/lib/cjs/engine/constants.cjs.map +1 -1
- package/lib/cjs/engine/credentials/GraphNodeCredentials.cjs +158 -0
- package/lib/cjs/engine/credentials/GraphNodeCredentials.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphExecutionEngine.cjs +228 -67
- package/lib/cjs/engine/execution/GraphExecutionEngine.cjs.map +1 -1
- package/lib/cjs/engine/execution/GraphNodeEngineRequirements.cjs +33 -0
- package/lib/cjs/engine/execution/GraphNodeEngineRequirements.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphWebhookResponseRegistry.cjs +108 -0
- package/lib/cjs/engine/execution/GraphWebhookResponseRegistry.cjs.map +1 -0
- package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs +53 -1
- package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs.map +1 -1
- package/lib/cjs/engine/execution/index.cjs +1 -0
- package/lib/cjs/engine/execution/index.cjs.map +1 -1
- package/lib/cjs/engine/index.cjs +4 -0
- package/lib/cjs/engine/index.cjs.map +1 -1
- package/lib/cjs/engine/store/GraphDataTableModel.cjs +76 -0
- package/lib/cjs/engine/store/GraphDataTableModel.cjs.map +1 -0
- package/lib/cjs/engine/store/GraphDataTableRepository.cjs +324 -0
- package/lib/cjs/engine/store/GraphDataTableRepository.cjs.map +1 -0
- package/lib/cjs/engine/store/index.cjs +2 -0
- package/lib/cjs/engine/store/index.cjs.map +1 -1
- package/lib/cjs/engine/validation/GraphConnectionPolicyValidator.cjs +28 -0
- package/lib/cjs/engine/validation/GraphConnectionPolicyValidator.cjs.map +1 -1
- package/lib/cjs/engine/validation/GraphCredentialReferenceValidator.cjs +4 -2
- package/lib/cjs/engine/validation/GraphCredentialReferenceValidator.cjs.map +1 -1
- package/lib/cjs/engine/validation/GraphParameterValidator.cjs +6 -0
- package/lib/cjs/engine/validation/GraphParameterValidator.cjs.map +1 -1
- package/lib/cjs/mastra/MastraAgeVectorDriver.cjs +298 -0
- package/lib/cjs/mastra/MastraAgeVectorDriver.cjs.map +1 -0
- package/lib/cjs/mastra/MastraAgentBuilder.cjs +249 -0
- package/lib/cjs/mastra/MastraAgentBuilder.cjs.map +1 -0
- package/lib/cjs/mastra/MastraAgentModelAdapter.cjs +65 -0
- package/lib/cjs/mastra/MastraAgentModelAdapter.cjs.map +1 -0
- package/lib/cjs/mastra/MastraAgentProcessors.cjs +397 -0
- package/lib/cjs/mastra/MastraAgentProcessors.cjs.map +1 -0
- package/lib/cjs/mastra/MastraAgentStepHandler.cjs +332 -0
- package/lib/cjs/mastra/MastraAgentStepHandler.cjs.map +1 -0
- package/lib/cjs/mastra/MastraCapabilities.cjs +115 -0
- package/lib/cjs/mastra/MastraCapabilities.cjs.map +1 -1
- package/lib/cjs/mastra/MastraChannelResponse.cjs +162 -0
- package/lib/cjs/mastra/MastraChannelResponse.cjs.map +1 -0
- package/lib/cjs/mastra/MastraChannelTrigger.cjs +124 -0
- package/lib/cjs/mastra/MastraChannelTrigger.cjs.map +1 -0
- package/lib/cjs/mastra/MastraDefaultStepHandlers.cjs +240 -22
- package/lib/cjs/mastra/MastraDefaultStepHandlers.cjs.map +1 -1
- package/lib/cjs/mastra/MastraEnvironment.cjs +297 -0
- package/lib/cjs/mastra/MastraEnvironment.cjs.map +1 -0
- package/lib/cjs/mastra/MastraEvalModels.cjs +546 -0
- package/lib/cjs/mastra/MastraEvalModels.cjs.map +1 -0
- package/lib/cjs/mastra/MastraEventBridge.cjs +21 -1
- package/lib/cjs/mastra/MastraEventBridge.cjs.map +1 -1
- package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs +414 -19
- package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs.map +1 -1
- package/lib/cjs/mastra/MastraGraphExecutionModule.cjs +148 -0
- package/lib/cjs/mastra/MastraGraphExecutionModule.cjs.map +1 -0
- package/lib/cjs/mastra/MastraHitlStepHandler.cjs +67 -0
- package/lib/cjs/mastra/MastraHitlStepHandler.cjs.map +1 -0
- package/lib/cjs/mastra/MastraMcpTrigger.cjs +254 -0
- package/lib/cjs/mastra/MastraMcpTrigger.cjs.map +1 -0
- package/lib/cjs/mastra/MastraMemory.cjs +467 -0
- package/lib/cjs/mastra/MastraMemory.cjs.map +1 -0
- package/lib/cjs/mastra/MastraMetricsAdapter.cjs +279 -0
- package/lib/cjs/mastra/MastraMetricsAdapter.cjs.map +1 -0
- package/lib/cjs/mastra/MastraMetricsGateway.cjs +404 -0
- package/lib/cjs/mastra/MastraMetricsGateway.cjs.map +1 -0
- package/lib/cjs/mastra/MastraMetricsModels.cjs +498 -0
- package/lib/cjs/mastra/MastraMetricsModels.cjs.map +1 -0
- package/lib/cjs/mastra/MastraMetricsStatement.cjs +220 -0
- package/lib/cjs/mastra/MastraMetricsStatement.cjs.map +1 -0
- package/lib/cjs/mastra/MastraModelSchemaConverter.cjs +84 -0
- package/lib/cjs/mastra/MastraModelSchemaConverter.cjs.map +1 -0
- package/lib/cjs/mastra/MastraObservability.cjs +335 -0
- package/lib/cjs/mastra/MastraObservability.cjs.map +1 -0
- package/lib/cjs/mastra/MastraPersistence.cjs +545 -0
- package/lib/cjs/mastra/MastraPersistence.cjs.map +1 -0
- package/lib/cjs/mastra/MastraRagStepHandlers.cjs +927 -0
- package/lib/cjs/mastra/MastraRagStepHandlers.cjs.map +1 -0
- package/lib/cjs/mastra/MastraRunMetricsEndpoint.cjs +153 -0
- package/lib/cjs/mastra/MastraRunMetricsEndpoint.cjs.map +1 -0
- package/lib/cjs/mastra/MastraRunRecovery.cjs +94 -0
- package/lib/cjs/mastra/MastraRunRecovery.cjs.map +1 -0
- package/lib/cjs/mastra/MastraScheduleTrigger.cjs +115 -0
- package/lib/cjs/mastra/MastraScheduleTrigger.cjs.map +1 -0
- package/lib/cjs/mastra/MastraStorageWiring.cjs +125 -0
- package/lib/cjs/mastra/MastraStorageWiring.cjs.map +1 -0
- package/lib/cjs/mastra/MastraStructuredOutput.cjs +152 -0
- package/lib/cjs/mastra/MastraStructuredOutput.cjs.map +1 -0
- package/lib/cjs/mastra/MastraToolBuilder.cjs +73 -0
- package/lib/cjs/mastra/MastraToolBuilder.cjs.map +1 -0
- package/lib/cjs/mastra/MastraToolConfig.cjs +42 -0
- package/lib/cjs/mastra/MastraToolConfig.cjs.map +1 -0
- package/lib/cjs/mastra/MastraToolDecorator.cjs +99 -0
- package/lib/cjs/mastra/MastraToolDecorator.cjs.map +1 -0
- package/lib/cjs/mastra/MastraVectorStore.cjs +618 -0
- package/lib/cjs/mastra/MastraVectorStore.cjs.map +1 -0
- package/lib/cjs/mastra/MastraVoiceStepHandler.cjs +90 -0
- package/lib/cjs/mastra/MastraVoiceStepHandler.cjs.map +1 -0
- package/lib/cjs/mastra/MastraWorkflowCompiler.cjs +38 -6
- package/lib/cjs/mastra/MastraWorkflowCompiler.cjs.map +1 -1
- package/lib/cjs/mastra/MastraWorkflowManager.cjs +100 -50
- package/lib/cjs/mastra/MastraWorkflowManager.cjs.map +1 -1
- package/lib/cjs/mastra/index.cjs +40 -1
- package/lib/cjs/mastra/index.cjs.map +1 -1
- package/lib/cjs/mastra/nodes/MastraNodeRegistry.cjs +232 -0
- package/lib/cjs/mastra/nodes/MastraNodeRegistry.cjs.map +1 -0
- package/lib/cjs/mastra/nodes/index.cjs +29 -0
- package/lib/cjs/mastra/nodes/index.cjs.map +1 -0
- package/lib/cjs/mastra/nodes/types.cjs +4 -0
- package/lib/cjs/mastra/nodes/types.cjs.map +1 -0
- package/lib/cjs/mastra/types.cjs +126 -1
- package/lib/cjs/mastra/types.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphBackendHost.cjs +12 -4
- package/lib/cjs/nest/graph/GraphBackendHost.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs +35 -1
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphRunController.cjs +47 -6
- package/lib/cjs/nest/graph/GraphRunController.cjs.map +1 -1
- package/lib/cjs/nest/graph/main.cjs +83 -1
- package/lib/cjs/nest/graph/main.cjs.map +1 -1
- package/lib/cjs/node/agents/agent/node.cjs +189 -31
- package/lib/cjs/node/agents/agent/node.cjs.map +1 -1
- package/lib/cjs/node/agents/hitl/node.cjs +115 -0
- package/lib/cjs/node/agents/hitl/node.cjs.map +1 -0
- package/lib/cjs/node/agents/hooks/delegation/node.cjs +122 -0
- package/lib/cjs/node/agents/hooks/delegation/node.cjs.map +1 -0
- package/lib/cjs/node/agents/hooks/hook/node.cjs +120 -0
- package/lib/cjs/node/agents/hooks/hook/node.cjs.map +1 -0
- package/lib/cjs/node/agents/hooks/tool-deny/node.cjs +104 -0
- package/lib/cjs/node/agents/hooks/tool-deny/node.cjs.map +1 -0
- package/lib/cjs/node/agents/memory/memory/node.cjs +231 -0
- package/lib/cjs/node/agents/memory/memory/node.cjs.map +1 -0
- package/lib/cjs/node/agents/memory/memory-selector/node.cjs +101 -0
- package/lib/cjs/node/agents/memory/memory-selector/node.cjs.map +1 -0
- package/lib/cjs/node/agents/processors/guardrail/node.cjs +126 -0
- package/lib/cjs/node/agents/processors/guardrail/node.cjs.map +1 -0
- package/lib/cjs/node/agents/processors/input-processor/node.cjs +118 -0
- package/lib/cjs/node/agents/processors/input-processor/node.cjs.map +1 -0
- package/lib/cjs/node/agents/processors/output-processor/node.cjs +108 -0
- package/lib/cjs/node/agents/processors/output-processor/node.cjs.map +1 -0
- package/lib/cjs/node/agents/processors/types.cjs +68 -0
- package/lib/cjs/node/agents/processors/types.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/chains/basic/node.cjs +103 -0
- package/lib/cjs/node/agents/rag/chains/basic/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/chains/qa/node.cjs +124 -0
- package/lib/cjs/node/agents/rag/chains/qa/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/chains/summarization/node.cjs +116 -0
- package/lib/cjs/node/agents/rag/chains/summarization/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/chunking/node.cjs +222 -0
- package/lib/cjs/node/agents/rag/chunking/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/embedding/node.cjs +110 -0
- package/lib/cjs/node/agents/rag/embedding/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/information-extractor/node.cjs +115 -0
- package/lib/cjs/node/agents/rag/information-extractor/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/langchain-code/node.cjs +113 -0
- package/lib/cjs/node/agents/rag/langchain-code/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/rerank/node.cjs +112 -0
- package/lib/cjs/node/agents/rag/rerank/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/retriever/node.cjs +120 -0
- package/lib/cjs/node/agents/rag/retriever/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/structured-output-parser/node.cjs +121 -0
- package/lib/cjs/node/agents/rag/structured-output-parser/node.cjs.map +1 -0
- package/lib/cjs/node/agents/rag/vector-store/node.cjs +187 -0
- package/lib/cjs/node/agents/rag/vector-store/node.cjs.map +1 -0
- package/lib/cjs/node/agents/responses/discord/node.cjs +101 -0
- package/lib/cjs/node/agents/responses/discord/node.cjs.map +1 -0
- package/lib/cjs/node/agents/responses/slack/node.cjs +101 -0
- package/lib/cjs/node/agents/responses/slack/node.cjs.map +1 -0
- package/lib/cjs/node/agents/responses/teams/node.cjs +101 -0
- package/lib/cjs/node/agents/responses/teams/node.cjs.map +1 -0
- package/lib/cjs/node/agents/responses/telegram/node.cjs +101 -0
- package/lib/cjs/node/agents/responses/telegram/node.cjs.map +1 -0
- package/lib/cjs/node/agents/sandbox/node.cjs +135 -0
- package/lib/cjs/node/agents/sandbox/node.cjs.map +1 -0
- package/lib/cjs/node/agents/scorers/scorer/node.cjs +107 -0
- package/lib/cjs/node/agents/scorers/scorer/node.cjs.map +1 -0
- package/lib/cjs/node/agents/scorers/scorer-selector/node.cjs +100 -0
- package/lib/cjs/node/agents/scorers/scorer-selector/node.cjs.map +1 -0
- package/lib/cjs/node/agents/skills/skill/node.cjs +105 -0
- package/lib/cjs/node/agents/skills/skill/node.cjs.map +1 -0
- package/lib/cjs/node/agents/skills/skill-selector/node.cjs +98 -0
- package/lib/cjs/node/agents/skills/skill-selector/node.cjs.map +1 -0
- package/lib/cjs/node/agents/tools/tool/node.cjs +100 -0
- package/lib/cjs/node/agents/tools/tool/node.cjs.map +1 -0
- package/lib/cjs/node/agents/tools/tool-selector/node.cjs +99 -0
- package/lib/cjs/node/agents/tools/tool-selector/node.cjs.map +1 -0
- package/lib/cjs/node/agents/triggers/discord/node.cjs +101 -0
- package/lib/cjs/node/agents/triggers/discord/node.cjs.map +1 -0
- package/lib/cjs/node/agents/triggers/mcp-server/node.cjs +147 -0
- package/lib/cjs/node/agents/triggers/mcp-server/node.cjs.map +1 -0
- package/lib/cjs/node/agents/triggers/slack/node.cjs +101 -0
- package/lib/cjs/node/agents/triggers/slack/node.cjs.map +1 -0
- package/lib/cjs/node/agents/triggers/teams/node.cjs +101 -0
- package/lib/cjs/node/agents/triggers/teams/node.cjs.map +1 -0
- package/lib/cjs/node/agents/triggers/telegram/node.cjs +101 -0
- package/lib/cjs/node/agents/triggers/telegram/node.cjs.map +1 -0
- package/lib/cjs/node/agents/voice/node.cjs +107 -0
- package/lib/cjs/node/agents/voice/node.cjs.map +1 -0
- package/lib/cjs/node/agents/zones.cjs +43 -0
- package/lib/cjs/node/agents/zones.cjs.map +1 -0
- package/lib/cjs/node/comms/email-send/node.cjs +340 -0
- package/lib/cjs/node/comms/email-send/node.cjs.map +1 -0
- package/lib/cjs/node/comms/gmail/node.cjs +287 -0
- package/lib/cjs/node/comms/gmail/node.cjs.map +1 -0
- package/lib/cjs/node/comms/slack/node.cjs +276 -0
- package/lib/cjs/node/comms/slack/node.cjs.map +1 -0
- package/lib/cjs/node/comms/teams/node.cjs +231 -0
- package/lib/cjs/node/comms/teams/node.cjs.map +1 -0
- package/lib/cjs/node/comms/telegram/node.cjs +260 -0
- package/lib/cjs/node/comms/telegram/node.cjs.map +1 -0
- package/lib/cjs/node/credentials.cjs +103 -0
- package/lib/cjs/node/credentials.cjs.map +1 -0
- package/lib/cjs/node/data/data-table/node.cjs +265 -0
- package/lib/cjs/node/data/data-table/node.cjs.map +1 -0
- package/lib/cjs/node/data/date-time/node.cjs +180 -0
- package/lib/cjs/node/data/date-time/node.cjs.map +1 -0
- package/lib/cjs/node/data/filter/node.cjs +134 -0
- package/lib/cjs/node/data/filter/node.cjs.map +1 -0
- package/lib/cjs/node/data/limit/node.cjs +104 -0
- package/lib/cjs/node/data/limit/node.cjs.map +1 -0
- package/lib/cjs/node/data/merge/node.cjs +251 -0
- package/lib/cjs/node/data/merge/node.cjs.map +1 -0
- package/lib/cjs/node/data/rename-keys/node.cjs +139 -0
- package/lib/cjs/node/data/rename-keys/node.cjs.map +1 -0
- package/lib/cjs/node/data/set/node.cjs +148 -0
- package/lib/cjs/node/data/set/node.cjs.map +1 -0
- package/lib/cjs/node/data/sort/node.cjs +125 -0
- package/lib/cjs/node/data/sort/node.cjs.map +1 -0
- package/lib/cjs/node/data/split-out/node.cjs +140 -0
- package/lib/cjs/node/data/split-out/node.cjs.map +1 -0
- package/lib/cjs/node/data/support.cjs +398 -0
- package/lib/cjs/node/data/support.cjs.map +1 -0
- package/lib/cjs/node/devops/crypto/node.cjs +364 -0
- package/lib/cjs/node/devops/crypto/node.cjs.map +1 -0
- package/lib/cjs/node/devops/execute-command/node.cjs +201 -0
- package/lib/cjs/node/devops/execute-command/node.cjs.map +1 -0
- package/lib/cjs/node/devops/ftp/node.cjs +241 -0
- package/lib/cjs/node/devops/ftp/node.cjs.map +1 -0
- package/lib/cjs/node/devops/github/node.cjs +282 -0
- package/lib/cjs/node/devops/github/node.cjs.map +1 -0
- package/lib/cjs/node/devops/gitlab/node.cjs +273 -0
- package/lib/cjs/node/devops/gitlab/node.cjs.map +1 -0
- package/lib/cjs/node/devops/jwt/node.cjs +204 -0
- package/lib/cjs/node/devops/jwt/node.cjs.map +1 -0
- package/lib/cjs/node/flow/execute-sub-workflow/node.cjs +223 -0
- package/lib/cjs/node/flow/execute-sub-workflow/node.cjs.map +1 -0
- package/lib/cjs/node/index.cjs +402 -66
- package/lib/cjs/node/index.cjs.map +1 -1
- package/lib/cjs/node/io/airtable/node.cjs +318 -0
- package/lib/cjs/node/io/airtable/node.cjs.map +1 -0
- package/lib/cjs/node/io/extract-from-file/node.cjs +269 -0
- package/lib/cjs/node/io/extract-from-file/node.cjs.map +1 -0
- package/lib/cjs/node/io/google-sheets/node.cjs +267 -0
- package/lib/cjs/node/io/google-sheets/node.cjs.map +1 -0
- package/lib/cjs/node/io/graphql/node.cjs +169 -0
- package/lib/cjs/node/io/graphql/node.cjs.map +1 -0
- package/lib/cjs/node/io/http-request/node.cjs +415 -0
- package/lib/cjs/node/io/http-request/node.cjs.map +1 -0
- package/lib/cjs/node/io/read-pdf/node.cjs +206 -0
- package/lib/cjs/node/io/read-pdf/node.cjs.map +1 -0
- package/lib/cjs/node/io/read-write-file/node.cjs +314 -0
- package/lib/cjs/node/io/read-write-file/node.cjs.map +1 -0
- package/lib/cjs/node/io/respond-to-webhook/node.cjs +183 -0
- package/lib/cjs/node/io/respond-to-webhook/node.cjs.map +1 -0
- package/lib/cjs/node/io/spreadsheet-file/node.cjs +192 -0
- package/lib/cjs/node/io/spreadsheet-file/node.cjs.map +1 -0
- package/lib/cjs/node/manifests.cjs +264 -36
- package/lib/cjs/node/manifests.cjs.map +1 -1
- package/lib/cjs/node/storage/blob/azure/node.cjs +138 -0
- package/lib/cjs/node/storage/blob/azure/node.cjs.map +1 -0
- package/lib/cjs/node/storage/blob/base.cjs +321 -0
- package/lib/cjs/node/storage/blob/base.cjs.map +1 -0
- package/lib/cjs/node/storage/blob/gcs/node.cjs +126 -0
- package/lib/cjs/node/storage/blob/gcs/node.cjs.map +1 -0
- package/lib/cjs/node/storage/blob/s3/node.cjs +186 -0
- package/lib/cjs/node/storage/blob/s3/node.cjs.map +1 -0
- package/lib/cjs/node/storage/database/base.cjs +301 -0
- package/lib/cjs/node/storage/database/base.cjs.map +1 -0
- package/lib/cjs/node/storage/database/mssql/node.cjs +50 -0
- package/lib/cjs/node/storage/database/mssql/node.cjs.map +1 -0
- package/lib/cjs/node/storage/database/mysql/node.cjs +50 -0
- package/lib/cjs/node/storage/database/mysql/node.cjs.map +1 -0
- package/lib/cjs/node/storage/database/postgres/node.cjs +50 -0
- package/lib/cjs/node/storage/database/postgres/node.cjs.map +1 -0
- package/lib/cjs/node/storage/redis/node.cjs +340 -0
- package/lib/cjs/node/storage/redis/node.cjs.map +1 -0
- package/lib/cjs/node/storage/support.cjs +81 -0
- package/lib/cjs/node/storage/support.cjs.map +1 -0
- package/lib/cjs/node/triggers/execute-workflow/node.cjs +94 -0
- package/lib/cjs/node/triggers/execute-workflow/node.cjs.map +1 -0
- package/lib/cjs/ram/GraphRunEventModel.cjs +4 -0
- package/lib/cjs/ram/GraphRunEventModel.cjs.map +1 -1
- package/lib/cjs/shared/graph/GraphNodeModel.cjs +4 -0
- package/lib/cjs/shared/graph/GraphNodeModel.cjs.map +1 -1
- package/lib/cjs/shared/graph/GraphWorkflowModel.cjs +4 -0
- package/lib/cjs/shared/graph/GraphWorkflowModel.cjs.map +1 -1
- package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs +40 -0
- package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
- package/lib/cjs/shared/graph/category-styles.cjs +12 -0
- package/lib/cjs/shared/graph/category-styles.cjs.map +1 -1
- package/lib/cjs/typeorm/TypeormGraphAdapter.cjs +250 -0
- package/lib/cjs/typeorm/TypeormGraphAdapter.cjs.map +1 -0
- package/lib/cjs/typeorm/index.cjs +29 -0
- package/lib/cjs/typeorm/index.cjs.map +1 -0
- package/lib/esm/engine/auth/GraphAuthValidator.js +19 -0
- package/lib/esm/engine/auth/GraphAuthValidator.js.map +1 -1
- package/lib/esm/engine/constants.js +60 -0
- package/lib/esm/engine/constants.js.map +1 -1
- package/lib/esm/engine/credentials/GraphNodeCredentials.js +152 -0
- package/lib/esm/engine/credentials/GraphNodeCredentials.js.map +1 -0
- package/lib/esm/engine/execution/GraphExecutionEngine.js +229 -68
- package/lib/esm/engine/execution/GraphExecutionEngine.js.map +1 -1
- package/lib/esm/engine/execution/GraphNodeEngineRequirements.js +28 -0
- package/lib/esm/engine/execution/GraphNodeEngineRequirements.js.map +1 -0
- package/lib/esm/engine/execution/GraphWebhookResponseRegistry.js +103 -0
- package/lib/esm/engine/execution/GraphWebhookResponseRegistry.js.map +1 -0
- package/lib/esm/engine/execution/LocalGraphExecutionBackend.js +54 -2
- package/lib/esm/engine/execution/LocalGraphExecutionBackend.js.map +1 -1
- package/lib/esm/engine/execution/index.js +1 -0
- package/lib/esm/engine/execution/index.js.map +1 -1
- package/lib/esm/engine/index.js +4 -0
- package/lib/esm/engine/index.js.map +1 -1
- package/lib/esm/engine/store/GraphDataTableModel.js +67 -0
- package/lib/esm/engine/store/GraphDataTableModel.js.map +1 -0
- package/lib/esm/engine/store/GraphDataTableRepository.js +314 -0
- package/lib/esm/engine/store/GraphDataTableRepository.js.map +1 -0
- package/lib/esm/engine/store/index.js +2 -0
- package/lib/esm/engine/store/index.js.map +1 -1
- package/lib/esm/engine/validation/GraphConnectionPolicyValidator.js +28 -0
- package/lib/esm/engine/validation/GraphConnectionPolicyValidator.js.map +1 -1
- package/lib/esm/engine/validation/GraphCredentialReferenceValidator.js +4 -2
- package/lib/esm/engine/validation/GraphCredentialReferenceValidator.js.map +1 -1
- package/lib/esm/engine/validation/GraphParameterValidator.js +6 -0
- package/lib/esm/engine/validation/GraphParameterValidator.js.map +1 -1
- package/lib/esm/mastra/MastraAgeVectorDriver.js +294 -0
- package/lib/esm/mastra/MastraAgeVectorDriver.js.map +1 -0
- package/lib/esm/mastra/MastraAgentBuilder.js +244 -0
- package/lib/esm/mastra/MastraAgentBuilder.js.map +1 -0
- package/lib/esm/mastra/MastraAgentModelAdapter.js +59 -0
- package/lib/esm/mastra/MastraAgentModelAdapter.js.map +1 -0
- package/lib/esm/mastra/MastraAgentProcessors.js +391 -0
- package/lib/esm/mastra/MastraAgentProcessors.js.map +1 -0
- package/lib/esm/mastra/MastraAgentStepHandler.js +327 -0
- package/lib/esm/mastra/MastraAgentStepHandler.js.map +1 -0
- package/lib/esm/mastra/MastraCapabilities.js +115 -0
- package/lib/esm/mastra/MastraCapabilities.js.map +1 -1
- package/lib/esm/mastra/MastraChannelResponse.js +154 -0
- package/lib/esm/mastra/MastraChannelResponse.js.map +1 -0
- package/lib/esm/mastra/MastraChannelTrigger.js +116 -0
- package/lib/esm/mastra/MastraChannelTrigger.js.map +1 -0
- package/lib/esm/mastra/MastraDefaultStepHandlers.js +240 -22
- package/lib/esm/mastra/MastraDefaultStepHandlers.js.map +1 -1
- package/lib/esm/mastra/MastraEnvironment.js +287 -0
- package/lib/esm/mastra/MastraEnvironment.js.map +1 -0
- package/lib/esm/mastra/MastraEvalModels.js +535 -0
- package/lib/esm/mastra/MastraEvalModels.js.map +1 -0
- package/lib/esm/mastra/MastraEventBridge.js +21 -1
- package/lib/esm/mastra/MastraEventBridge.js.map +1 -1
- package/lib/esm/mastra/MastraGraphExecutionBackend.js +414 -19
- package/lib/esm/mastra/MastraGraphExecutionBackend.js.map +1 -1
- package/lib/esm/mastra/MastraGraphExecutionModule.js +139 -0
- package/lib/esm/mastra/MastraGraphExecutionModule.js.map +1 -0
- package/lib/esm/mastra/MastraHitlStepHandler.js +62 -0
- package/lib/esm/mastra/MastraHitlStepHandler.js.map +1 -0
- package/lib/esm/mastra/MastraMcpTrigger.js +246 -0
- package/lib/esm/mastra/MastraMcpTrigger.js.map +1 -0
- package/lib/esm/mastra/MastraMemory.js +455 -0
- package/lib/esm/mastra/MastraMemory.js.map +1 -0
- package/lib/esm/mastra/MastraMetricsAdapter.js +273 -0
- package/lib/esm/mastra/MastraMetricsAdapter.js.map +1 -0
- package/lib/esm/mastra/MastraMetricsGateway.js +394 -0
- package/lib/esm/mastra/MastraMetricsGateway.js.map +1 -0
- package/lib/esm/mastra/MastraMetricsModels.js +486 -0
- package/lib/esm/mastra/MastraMetricsModels.js.map +1 -0
- package/lib/esm/mastra/MastraMetricsStatement.js +213 -0
- package/lib/esm/mastra/MastraMetricsStatement.js.map +1 -0
- package/lib/esm/mastra/MastraModelSchemaConverter.js +78 -0
- package/lib/esm/mastra/MastraModelSchemaConverter.js.map +1 -0
- package/lib/esm/mastra/MastraObservability.js +327 -0
- package/lib/esm/mastra/MastraObservability.js.map +1 -0
- package/lib/esm/mastra/MastraPersistence.js +530 -0
- package/lib/esm/mastra/MastraPersistence.js.map +1 -0
- package/lib/esm/mastra/MastraRagStepHandlers.js +920 -0
- package/lib/esm/mastra/MastraRagStepHandlers.js.map +1 -0
- package/lib/esm/mastra/MastraRunMetricsEndpoint.js +147 -0
- package/lib/esm/mastra/MastraRunMetricsEndpoint.js.map +1 -0
- package/lib/esm/mastra/MastraRunRecovery.js +89 -0
- package/lib/esm/mastra/MastraRunRecovery.js.map +1 -0
- package/lib/esm/mastra/MastraScheduleTrigger.js +110 -0
- package/lib/esm/mastra/MastraScheduleTrigger.js.map +1 -0
- package/lib/esm/mastra/MastraStorageWiring.js +119 -0
- package/lib/esm/mastra/MastraStorageWiring.js.map +1 -0
- package/lib/esm/mastra/MastraStructuredOutput.js +144 -0
- package/lib/esm/mastra/MastraStructuredOutput.js.map +1 -0
- package/lib/esm/mastra/MastraToolBuilder.js +68 -0
- package/lib/esm/mastra/MastraToolBuilder.js.map +1 -0
- package/lib/esm/mastra/MastraToolConfig.js +37 -0
- package/lib/esm/mastra/MastraToolConfig.js.map +1 -0
- package/lib/esm/mastra/MastraToolDecorator.js +92 -0
- package/lib/esm/mastra/MastraToolDecorator.js.map +1 -0
- package/lib/esm/mastra/MastraVectorStore.js +605 -0
- package/lib/esm/mastra/MastraVectorStore.js.map +1 -0
- package/lib/esm/mastra/MastraVoiceStepHandler.js +84 -0
- package/lib/esm/mastra/MastraVoiceStepHandler.js.map +1 -0
- package/lib/esm/mastra/MastraWorkflowCompiler.js +38 -6
- package/lib/esm/mastra/MastraWorkflowCompiler.js.map +1 -1
- package/lib/esm/mastra/MastraWorkflowManager.js +101 -51
- package/lib/esm/mastra/MastraWorkflowManager.js.map +1 -1
- package/lib/esm/mastra/index.js +40 -1
- package/lib/esm/mastra/index.js.map +1 -1
- package/lib/esm/mastra/nodes/MastraNodeRegistry.js +225 -0
- package/lib/esm/mastra/nodes/MastraNodeRegistry.js.map +1 -0
- package/lib/esm/mastra/nodes/index.js +12 -0
- package/lib/esm/mastra/nodes/index.js.map +1 -0
- package/lib/esm/mastra/nodes/types.js +2 -0
- package/lib/esm/mastra/nodes/types.js.map +1 -0
- package/lib/esm/mastra/types.js +125 -0
- package/lib/esm/mastra/types.js.map +1 -1
- package/lib/esm/nest/graph/GraphBackendHost.js +10 -2
- package/lib/esm/nest/graph/GraphBackendHost.js.map +1 -1
- package/lib/esm/nest/graph/GraphExecutionModule.js +35 -1
- package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
- package/lib/esm/nest/graph/GraphRunController.js +47 -6
- package/lib/esm/nest/graph/GraphRunController.js.map +1 -1
- package/lib/esm/nest/graph/main.js +83 -1
- package/lib/esm/nest/graph/main.js.map +1 -1
- package/lib/esm/node/agents/agent/node.js +189 -31
- package/lib/esm/node/agents/agent/node.js.map +1 -1
- package/lib/esm/node/agents/hitl/node.js +106 -0
- package/lib/esm/node/agents/hitl/node.js.map +1 -0
- package/lib/esm/node/agents/hooks/delegation/node.js +113 -0
- package/lib/esm/node/agents/hooks/delegation/node.js.map +1 -0
- package/lib/esm/node/agents/hooks/hook/node.js +111 -0
- package/lib/esm/node/agents/hooks/hook/node.js.map +1 -0
- package/lib/esm/node/agents/hooks/tool-deny/node.js +95 -0
- package/lib/esm/node/agents/hooks/tool-deny/node.js.map +1 -0
- package/lib/esm/node/agents/memory/memory/node.js +222 -0
- package/lib/esm/node/agents/memory/memory/node.js.map +1 -0
- package/lib/esm/node/agents/memory/memory-selector/node.js +92 -0
- package/lib/esm/node/agents/memory/memory-selector/node.js.map +1 -0
- package/lib/esm/node/agents/processors/guardrail/node.js +117 -0
- package/lib/esm/node/agents/processors/guardrail/node.js.map +1 -0
- package/lib/esm/node/agents/processors/input-processor/node.js +109 -0
- package/lib/esm/node/agents/processors/input-processor/node.js.map +1 -0
- package/lib/esm/node/agents/processors/output-processor/node.js +99 -0
- package/lib/esm/node/agents/processors/output-processor/node.js.map +1 -0
- package/lib/esm/node/agents/processors/types.js +64 -0
- package/lib/esm/node/agents/processors/types.js.map +1 -0
- package/lib/esm/node/agents/rag/chains/basic/node.js +94 -0
- package/lib/esm/node/agents/rag/chains/basic/node.js.map +1 -0
- package/lib/esm/node/agents/rag/chains/qa/node.js +115 -0
- package/lib/esm/node/agents/rag/chains/qa/node.js.map +1 -0
- package/lib/esm/node/agents/rag/chains/summarization/node.js +107 -0
- package/lib/esm/node/agents/rag/chains/summarization/node.js.map +1 -0
- package/lib/esm/node/agents/rag/chunking/node.js +211 -0
- package/lib/esm/node/agents/rag/chunking/node.js.map +1 -0
- package/lib/esm/node/agents/rag/embedding/node.js +101 -0
- package/lib/esm/node/agents/rag/embedding/node.js.map +1 -0
- package/lib/esm/node/agents/rag/information-extractor/node.js +106 -0
- package/lib/esm/node/agents/rag/information-extractor/node.js.map +1 -0
- package/lib/esm/node/agents/rag/langchain-code/node.js +104 -0
- package/lib/esm/node/agents/rag/langchain-code/node.js.map +1 -0
- package/lib/esm/node/agents/rag/rerank/node.js +103 -0
- package/lib/esm/node/agents/rag/rerank/node.js.map +1 -0
- package/lib/esm/node/agents/rag/retriever/node.js +111 -0
- package/lib/esm/node/agents/rag/retriever/node.js.map +1 -0
- package/lib/esm/node/agents/rag/structured-output-parser/node.js +112 -0
- package/lib/esm/node/agents/rag/structured-output-parser/node.js.map +1 -0
- package/lib/esm/node/agents/rag/vector-store/node.js +178 -0
- package/lib/esm/node/agents/rag/vector-store/node.js.map +1 -0
- package/lib/esm/node/agents/responses/discord/node.js +92 -0
- package/lib/esm/node/agents/responses/discord/node.js.map +1 -0
- package/lib/esm/node/agents/responses/slack/node.js +92 -0
- package/lib/esm/node/agents/responses/slack/node.js.map +1 -0
- package/lib/esm/node/agents/responses/teams/node.js +92 -0
- package/lib/esm/node/agents/responses/teams/node.js.map +1 -0
- package/lib/esm/node/agents/responses/telegram/node.js +92 -0
- package/lib/esm/node/agents/responses/telegram/node.js.map +1 -0
- package/lib/esm/node/agents/sandbox/node.js +125 -0
- package/lib/esm/node/agents/sandbox/node.js.map +1 -0
- package/lib/esm/node/agents/scorers/scorer/node.js +98 -0
- package/lib/esm/node/agents/scorers/scorer/node.js.map +1 -0
- package/lib/esm/node/agents/scorers/scorer-selector/node.js +91 -0
- package/lib/esm/node/agents/scorers/scorer-selector/node.js.map +1 -0
- package/lib/esm/node/agents/skills/skill/node.js +96 -0
- package/lib/esm/node/agents/skills/skill/node.js.map +1 -0
- package/lib/esm/node/agents/skills/skill-selector/node.js +89 -0
- package/lib/esm/node/agents/skills/skill-selector/node.js.map +1 -0
- package/lib/esm/node/agents/tools/tool/node.js +91 -0
- package/lib/esm/node/agents/tools/tool/node.js.map +1 -0
- package/lib/esm/node/agents/tools/tool-selector/node.js +90 -0
- package/lib/esm/node/agents/tools/tool-selector/node.js.map +1 -0
- package/lib/esm/node/agents/triggers/discord/node.js +92 -0
- package/lib/esm/node/agents/triggers/discord/node.js.map +1 -0
- package/lib/esm/node/agents/triggers/mcp-server/node.js +138 -0
- package/lib/esm/node/agents/triggers/mcp-server/node.js.map +1 -0
- package/lib/esm/node/agents/triggers/slack/node.js +92 -0
- package/lib/esm/node/agents/triggers/slack/node.js.map +1 -0
- package/lib/esm/node/agents/triggers/teams/node.js +92 -0
- package/lib/esm/node/agents/triggers/teams/node.js.map +1 -0
- package/lib/esm/node/agents/triggers/telegram/node.js +92 -0
- package/lib/esm/node/agents/triggers/telegram/node.js.map +1 -0
- package/lib/esm/node/agents/voice/node.js +98 -0
- package/lib/esm/node/agents/voice/node.js.map +1 -0
- package/lib/esm/node/agents/zones.js +39 -0
- package/lib/esm/node/agents/zones.js.map +1 -0
- package/lib/esm/node/comms/email-send/node.js +331 -0
- package/lib/esm/node/comms/email-send/node.js.map +1 -0
- package/lib/esm/node/comms/gmail/node.js +278 -0
- package/lib/esm/node/comms/gmail/node.js.map +1 -0
- package/lib/esm/node/comms/slack/node.js +267 -0
- package/lib/esm/node/comms/slack/node.js.map +1 -0
- package/lib/esm/node/comms/teams/node.js +222 -0
- package/lib/esm/node/comms/teams/node.js.map +1 -0
- package/lib/esm/node/comms/telegram/node.js +251 -0
- package/lib/esm/node/comms/telegram/node.js.map +1 -0
- package/lib/esm/node/credentials.js +96 -0
- package/lib/esm/node/credentials.js.map +1 -0
- package/lib/esm/node/data/data-table/node.js +256 -0
- package/lib/esm/node/data/data-table/node.js.map +1 -0
- package/lib/esm/node/data/date-time/node.js +171 -0
- package/lib/esm/node/data/date-time/node.js.map +1 -0
- package/lib/esm/node/data/filter/node.js +125 -0
- package/lib/esm/node/data/filter/node.js.map +1 -0
- package/lib/esm/node/data/limit/node.js +95 -0
- package/lib/esm/node/data/limit/node.js.map +1 -0
- package/lib/esm/node/data/merge/node.js +242 -0
- package/lib/esm/node/data/merge/node.js.map +1 -0
- package/lib/esm/node/data/rename-keys/node.js +130 -0
- package/lib/esm/node/data/rename-keys/node.js.map +1 -0
- package/lib/esm/node/data/set/node.js +139 -0
- package/lib/esm/node/data/set/node.js.map +1 -0
- package/lib/esm/node/data/sort/node.js +116 -0
- package/lib/esm/node/data/sort/node.js.map +1 -0
- package/lib/esm/node/data/split-out/node.js +131 -0
- package/lib/esm/node/data/split-out/node.js.map +1 -0
- package/lib/esm/node/data/support.js +382 -0
- package/lib/esm/node/data/support.js.map +1 -0
- package/lib/esm/node/devops/crypto/node.js +355 -0
- package/lib/esm/node/devops/crypto/node.js.map +1 -0
- package/lib/esm/node/devops/execute-command/node.js +192 -0
- package/lib/esm/node/devops/execute-command/node.js.map +1 -0
- package/lib/esm/node/devops/ftp/node.js +232 -0
- package/lib/esm/node/devops/ftp/node.js.map +1 -0
- package/lib/esm/node/devops/github/node.js +273 -0
- package/lib/esm/node/devops/github/node.js.map +1 -0
- package/lib/esm/node/devops/gitlab/node.js +264 -0
- package/lib/esm/node/devops/gitlab/node.js.map +1 -0
- package/lib/esm/node/devops/jwt/node.js +195 -0
- package/lib/esm/node/devops/jwt/node.js.map +1 -0
- package/lib/esm/node/flow/execute-sub-workflow/node.js +214 -0
- package/lib/esm/node/flow/execute-sub-workflow/node.js.map +1 -0
- package/lib/esm/node/index.js +338 -2
- package/lib/esm/node/index.js.map +1 -1
- package/lib/esm/node/io/airtable/node.js +309 -0
- package/lib/esm/node/io/airtable/node.js.map +1 -0
- package/lib/esm/node/io/extract-from-file/node.js +260 -0
- package/lib/esm/node/io/extract-from-file/node.js.map +1 -0
- package/lib/esm/node/io/google-sheets/node.js +258 -0
- package/lib/esm/node/io/google-sheets/node.js.map +1 -0
- package/lib/esm/node/io/graphql/node.js +160 -0
- package/lib/esm/node/io/graphql/node.js.map +1 -0
- package/lib/esm/node/io/http-request/node.js +406 -0
- package/lib/esm/node/io/http-request/node.js.map +1 -0
- package/lib/esm/node/io/read-pdf/node.js +164 -0
- package/lib/esm/node/io/read-pdf/node.js.map +1 -0
- package/lib/esm/node/io/read-write-file/node.js +305 -0
- package/lib/esm/node/io/read-write-file/node.js.map +1 -0
- package/lib/esm/node/io/respond-to-webhook/node.js +174 -0
- package/lib/esm/node/io/respond-to-webhook/node.js.map +1 -0
- package/lib/esm/node/io/spreadsheet-file/node.js +183 -0
- package/lib/esm/node/io/spreadsheet-file/node.js.map +1 -0
- package/lib/esm/node/manifests.js +228 -0
- package/lib/esm/node/manifests.js.map +1 -1
- package/lib/esm/node/storage/blob/azure/node.js +129 -0
- package/lib/esm/node/storage/blob/azure/node.js.map +1 -0
- package/lib/esm/node/storage/blob/base.js +311 -0
- package/lib/esm/node/storage/blob/base.js.map +1 -0
- package/lib/esm/node/storage/blob/gcs/node.js +117 -0
- package/lib/esm/node/storage/blob/gcs/node.js.map +1 -0
- package/lib/esm/node/storage/blob/s3/node.js +176 -0
- package/lib/esm/node/storage/blob/s3/node.js.map +1 -0
- package/lib/esm/node/storage/database/base.js +291 -0
- package/lib/esm/node/storage/database/base.js.map +1 -0
- package/lib/esm/node/storage/database/mssql/node.js +42 -0
- package/lib/esm/node/storage/database/mssql/node.js.map +1 -0
- package/lib/esm/node/storage/database/mysql/node.js +42 -0
- package/lib/esm/node/storage/database/mysql/node.js.map +1 -0
- package/lib/esm/node/storage/database/postgres/node.js +42 -0
- package/lib/esm/node/storage/database/postgres/node.js.map +1 -0
- package/lib/esm/node/storage/redis/node.js +331 -0
- package/lib/esm/node/storage/redis/node.js.map +1 -0
- package/lib/esm/node/storage/support.js +69 -0
- package/lib/esm/node/storage/support.js.map +1 -0
- package/lib/esm/node/triggers/execute-workflow/node.js +85 -0
- package/lib/esm/node/triggers/execute-workflow/node.js.map +1 -0
- package/lib/esm/ram/GraphRunEventModel.js +5 -1
- package/lib/esm/ram/GraphRunEventModel.js.map +1 -1
- package/lib/esm/shared/graph/GraphNodeModel.js +5 -1
- package/lib/esm/shared/graph/GraphNodeModel.js.map +1 -1
- package/lib/esm/shared/graph/GraphWorkflowModel.js +5 -1
- package/lib/esm/shared/graph/GraphWorkflowModel.js.map +1 -1
- package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js +40 -0
- package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js.map +1 -1
- package/lib/esm/shared/graph/catalog/GraphPortManifest.js.map +1 -1
- package/lib/esm/shared/graph/category-styles.js +12 -0
- package/lib/esm/shared/graph/category-styles.js.map +1 -1
- package/lib/esm/shared/graph/constants.js.map +1 -1
- package/lib/esm/typeorm/TypeormGraphAdapter.js +213 -0
- package/lib/esm/typeorm/TypeormGraphAdapter.js.map +1 -0
- package/lib/esm/typeorm/index.js +12 -0
- package/lib/esm/typeorm/index.js.map +1 -0
- package/lib/types/engine/auth/GraphAuthValidator.d.cts +13 -0
- package/lib/types/engine/auth/GraphAuthValidator.d.mts +13 -0
- package/lib/types/engine/constants.d.cts +60 -0
- package/lib/types/engine/constants.d.mts +60 -0
- package/lib/types/engine/credentials/GraphNodeCredentials.d.cts +145 -0
- package/lib/types/engine/credentials/GraphNodeCredentials.d.mts +145 -0
- package/lib/types/engine/execution/GraphExecutionEngine.d.cts +88 -1
- package/lib/types/engine/execution/GraphExecutionEngine.d.mts +88 -1
- package/lib/types/engine/execution/GraphNodeEngineRequirements.d.cts +24 -0
- package/lib/types/engine/execution/GraphNodeEngineRequirements.d.mts +24 -0
- package/lib/types/engine/execution/GraphWebhookResponseRegistry.d.cts +67 -0
- package/lib/types/engine/execution/GraphWebhookResponseRegistry.d.mts +67 -0
- package/lib/types/engine/execution/LocalGraphExecutionBackend.d.cts +12 -3
- package/lib/types/engine/execution/LocalGraphExecutionBackend.d.mts +12 -3
- package/lib/types/engine/execution/index.d.cts +1 -0
- package/lib/types/engine/execution/index.d.mts +1 -0
- package/lib/types/engine/index.d.cts +4 -0
- package/lib/types/engine/index.d.mts +4 -0
- package/lib/types/engine/store/GraphDataTableModel.d.cts +24 -0
- package/lib/types/engine/store/GraphDataTableModel.d.mts +24 -0
- package/lib/types/engine/store/GraphDataTableRepository.d.cts +136 -0
- package/lib/types/engine/store/GraphDataTableRepository.d.mts +136 -0
- package/lib/types/engine/store/index.d.cts +2 -0
- package/lib/types/engine/store/index.d.mts +2 -0
- package/lib/types/engine/types.d.cts +12 -0
- package/lib/types/engine/types.d.mts +12 -0
- package/lib/types/engine/validation/GraphConnectionPolicyValidator.d.cts +10 -0
- package/lib/types/engine/validation/GraphConnectionPolicyValidator.d.mts +10 -0
- package/lib/types/engine/validation/GraphParameterValidator.d.cts +1 -1
- package/lib/types/engine/validation/GraphParameterValidator.d.mts +1 -1
- package/lib/types/mastra/MastraAgeVectorDriver.d.cts +55 -0
- package/lib/types/mastra/MastraAgeVectorDriver.d.mts +55 -0
- package/lib/types/mastra/MastraAgentBuilder.d.cts +188 -0
- package/lib/types/mastra/MastraAgentBuilder.d.mts +188 -0
- package/lib/types/mastra/MastraAgentModelAdapter.d.cts +76 -0
- package/lib/types/mastra/MastraAgentModelAdapter.d.mts +76 -0
- package/lib/types/mastra/MastraAgentProcessors.d.cts +50 -0
- package/lib/types/mastra/MastraAgentProcessors.d.mts +50 -0
- package/lib/types/mastra/MastraAgentStepHandler.d.cts +128 -0
- package/lib/types/mastra/MastraAgentStepHandler.d.mts +128 -0
- package/lib/types/mastra/MastraCapabilities.d.cts +20 -0
- package/lib/types/mastra/MastraCapabilities.d.mts +20 -0
- package/lib/types/mastra/MastraChannelResponse.d.cts +64 -0
- package/lib/types/mastra/MastraChannelResponse.d.mts +64 -0
- package/lib/types/mastra/MastraChannelTrigger.d.cts +57 -0
- package/lib/types/mastra/MastraChannelTrigger.d.mts +57 -0
- package/lib/types/mastra/MastraDefaultStepHandlers.d.cts +53 -6
- package/lib/types/mastra/MastraDefaultStepHandlers.d.mts +53 -6
- package/lib/types/mastra/MastraEnvironment.d.cts +270 -0
- package/lib/types/mastra/MastraEnvironment.d.mts +270 -0
- package/lib/types/mastra/MastraEvalModels.d.cts +191 -0
- package/lib/types/mastra/MastraEvalModels.d.mts +191 -0
- package/lib/types/mastra/MastraEventBridge.d.cts +17 -0
- package/lib/types/mastra/MastraEventBridge.d.mts +17 -0
- package/lib/types/mastra/MastraGraphExecutionBackend.d.cts +108 -1
- package/lib/types/mastra/MastraGraphExecutionBackend.d.mts +108 -1
- package/lib/types/mastra/MastraGraphExecutionModule.d.cts +114 -0
- package/lib/types/mastra/MastraGraphExecutionModule.d.mts +114 -0
- package/lib/types/mastra/MastraHitlStepHandler.d.cts +18 -0
- package/lib/types/mastra/MastraHitlStepHandler.d.mts +18 -0
- package/lib/types/mastra/MastraMcpTrigger.d.cts +133 -0
- package/lib/types/mastra/MastraMcpTrigger.d.mts +133 -0
- package/lib/types/mastra/MastraMemory.d.cts +362 -0
- package/lib/types/mastra/MastraMemory.d.mts +362 -0
- package/lib/types/mastra/MastraMetricsAdapter.d.cts +216 -0
- package/lib/types/mastra/MastraMetricsAdapter.d.mts +216 -0
- package/lib/types/mastra/MastraMetricsGateway.d.cts +265 -0
- package/lib/types/mastra/MastraMetricsGateway.d.mts +265 -0
- package/lib/types/mastra/MastraMetricsModels.d.cts +175 -0
- package/lib/types/mastra/MastraMetricsModels.d.mts +175 -0
- package/lib/types/mastra/MastraMetricsStatement.d.cts +116 -0
- package/lib/types/mastra/MastraMetricsStatement.d.mts +116 -0
- package/lib/types/mastra/MastraModelSchemaConverter.d.cts +45 -0
- package/lib/types/mastra/MastraModelSchemaConverter.d.mts +45 -0
- package/lib/types/mastra/MastraObservability.d.cts +197 -0
- package/lib/types/mastra/MastraObservability.d.mts +197 -0
- package/lib/types/mastra/MastraPersistence.d.cts +241 -0
- package/lib/types/mastra/MastraPersistence.d.mts +241 -0
- package/lib/types/mastra/MastraRagStepHandlers.d.cts +137 -0
- package/lib/types/mastra/MastraRagStepHandlers.d.mts +137 -0
- package/lib/types/mastra/MastraRunMetricsEndpoint.d.cts +53 -0
- package/lib/types/mastra/MastraRunMetricsEndpoint.d.mts +53 -0
- package/lib/types/mastra/MastraRunRecovery.d.cts +26 -0
- package/lib/types/mastra/MastraRunRecovery.d.mts +26 -0
- package/lib/types/mastra/MastraScheduleTrigger.d.cts +20 -0
- package/lib/types/mastra/MastraScheduleTrigger.d.mts +20 -0
- package/lib/types/mastra/MastraStorageWiring.d.cts +71 -0
- package/lib/types/mastra/MastraStorageWiring.d.mts +71 -0
- package/lib/types/mastra/MastraStructuredOutput.d.cts +165 -0
- package/lib/types/mastra/MastraStructuredOutput.d.mts +165 -0
- package/lib/types/mastra/MastraToolBuilder.d.cts +70 -0
- package/lib/types/mastra/MastraToolBuilder.d.mts +70 -0
- package/lib/types/mastra/MastraToolConfig.d.cts +136 -0
- package/lib/types/mastra/MastraToolConfig.d.mts +136 -0
- package/lib/types/mastra/MastraToolDecorator.d.cts +47 -0
- package/lib/types/mastra/MastraToolDecorator.d.mts +47 -0
- package/lib/types/mastra/MastraVectorStore.d.cts +383 -0
- package/lib/types/mastra/MastraVectorStore.d.mts +383 -0
- package/lib/types/mastra/MastraVoiceStepHandler.d.cts +40 -0
- package/lib/types/mastra/MastraVoiceStepHandler.d.mts +40 -0
- package/lib/types/mastra/MastraWorkflowManager.d.cts +36 -28
- package/lib/types/mastra/MastraWorkflowManager.d.mts +36 -28
- package/lib/types/mastra/index.d.cts +40 -1
- package/lib/types/mastra/index.d.mts +40 -1
- package/lib/types/mastra/nodes/MastraNodeRegistry.d.cts +41 -0
- package/lib/types/mastra/nodes/MastraNodeRegistry.d.mts +41 -0
- package/lib/types/mastra/nodes/index.d.cts +11 -0
- package/lib/types/mastra/nodes/index.d.mts +11 -0
- package/lib/types/mastra/nodes/types.d.cts +57 -0
- package/lib/types/mastra/nodes/types.d.mts +57 -0
- package/lib/types/mastra/types.d.cts +365 -6
- package/lib/types/mastra/types.d.mts +365 -6
- package/lib/types/nest/graph/GraphExecutionModule.d.cts +17 -0
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +17 -0
- package/lib/types/nest/graph/GraphRunController.d.cts +24 -4
- package/lib/types/nest/graph/GraphRunController.d.mts +24 -4
- package/lib/types/node/agents/agent/node.d.cts +72 -16
- package/lib/types/node/agents/agent/node.d.mts +72 -16
- package/lib/types/node/agents/hitl/node.d.cts +45 -0
- package/lib/types/node/agents/hitl/node.d.mts +45 -0
- package/lib/types/node/agents/hooks/delegation/node.d.cts +48 -0
- package/lib/types/node/agents/hooks/delegation/node.d.mts +48 -0
- package/lib/types/node/agents/hooks/hook/node.d.cts +45 -0
- package/lib/types/node/agents/hooks/hook/node.d.mts +45 -0
- package/lib/types/node/agents/hooks/tool-deny/node.d.cts +39 -0
- package/lib/types/node/agents/hooks/tool-deny/node.d.mts +39 -0
- package/lib/types/node/agents/memory/memory/node.d.cts +73 -0
- package/lib/types/node/agents/memory/memory/node.d.mts +73 -0
- package/lib/types/node/agents/memory/memory-selector/node.d.cts +34 -0
- package/lib/types/node/agents/memory/memory-selector/node.d.mts +34 -0
- package/lib/types/node/agents/processors/guardrail/node.d.cts +47 -0
- package/lib/types/node/agents/processors/guardrail/node.d.mts +47 -0
- package/lib/types/node/agents/processors/input-processor/node.d.cts +40 -0
- package/lib/types/node/agents/processors/input-processor/node.d.mts +40 -0
- package/lib/types/node/agents/processors/output-processor/node.d.cts +34 -0
- package/lib/types/node/agents/processors/output-processor/node.d.mts +34 -0
- package/lib/types/node/agents/processors/types.d.cts +45 -0
- package/lib/types/node/agents/processors/types.d.mts +45 -0
- package/lib/types/node/agents/rag/chains/basic/node.d.cts +36 -0
- package/lib/types/node/agents/rag/chains/basic/node.d.mts +36 -0
- package/lib/types/node/agents/rag/chains/qa/node.d.cts +44 -0
- package/lib/types/node/agents/rag/chains/qa/node.d.mts +44 -0
- package/lib/types/node/agents/rag/chains/summarization/node.d.cts +39 -0
- package/lib/types/node/agents/rag/chains/summarization/node.d.mts +39 -0
- package/lib/types/node/agents/rag/chunking/node.d.cts +73 -0
- package/lib/types/node/agents/rag/chunking/node.d.mts +73 -0
- package/lib/types/node/agents/rag/embedding/node.d.cts +37 -0
- package/lib/types/node/agents/rag/embedding/node.d.mts +37 -0
- package/lib/types/node/agents/rag/information-extractor/node.d.cts +39 -0
- package/lib/types/node/agents/rag/information-extractor/node.d.mts +39 -0
- package/lib/types/node/agents/rag/langchain-code/node.d.cts +36 -0
- package/lib/types/node/agents/rag/langchain-code/node.d.mts +36 -0
- package/lib/types/node/agents/rag/rerank/node.d.cts +39 -0
- package/lib/types/node/agents/rag/rerank/node.d.mts +39 -0
- package/lib/types/node/agents/rag/retriever/node.d.cts +42 -0
- package/lib/types/node/agents/rag/retriever/node.d.mts +42 -0
- package/lib/types/node/agents/rag/structured-output-parser/node.d.cts +35 -0
- package/lib/types/node/agents/rag/structured-output-parser/node.d.mts +35 -0
- package/lib/types/node/agents/rag/vector-store/node.d.cts +59 -0
- package/lib/types/node/agents/rag/vector-store/node.d.mts +59 -0
- package/lib/types/node/agents/responses/discord/node.d.cts +34 -0
- package/lib/types/node/agents/responses/discord/node.d.mts +34 -0
- package/lib/types/node/agents/responses/slack/node.d.cts +34 -0
- package/lib/types/node/agents/responses/slack/node.d.mts +34 -0
- package/lib/types/node/agents/responses/teams/node.d.cts +34 -0
- package/lib/types/node/agents/responses/teams/node.d.mts +34 -0
- package/lib/types/node/agents/responses/telegram/node.d.cts +34 -0
- package/lib/types/node/agents/responses/telegram/node.d.mts +34 -0
- package/lib/types/node/agents/sandbox/node.d.cts +47 -0
- package/lib/types/node/agents/sandbox/node.d.mts +47 -0
- package/lib/types/node/agents/scorers/scorer/node.d.cts +33 -0
- package/lib/types/node/agents/scorers/scorer/node.d.mts +33 -0
- package/lib/types/node/agents/scorers/scorer-selector/node.d.cts +33 -0
- package/lib/types/node/agents/scorers/scorer-selector/node.d.mts +33 -0
- package/lib/types/node/agents/skills/skill/node.d.cts +32 -0
- package/lib/types/node/agents/skills/skill/node.d.mts +32 -0
- package/lib/types/node/agents/skills/skill-selector/node.d.cts +33 -0
- package/lib/types/node/agents/skills/skill-selector/node.d.mts +33 -0
- package/lib/types/node/agents/tools/tool/node.d.cts +33 -0
- package/lib/types/node/agents/tools/tool/node.d.mts +33 -0
- package/lib/types/node/agents/tools/tool-selector/node.d.cts +33 -0
- package/lib/types/node/agents/tools/tool-selector/node.d.mts +33 -0
- package/lib/types/node/agents/triggers/discord/node.d.cts +40 -0
- package/lib/types/node/agents/triggers/discord/node.d.mts +40 -0
- package/lib/types/node/agents/triggers/mcp-server/node.d.cts +51 -0
- package/lib/types/node/agents/triggers/mcp-server/node.d.mts +51 -0
- package/lib/types/node/agents/triggers/slack/node.d.cts +40 -0
- package/lib/types/node/agents/triggers/slack/node.d.mts +40 -0
- package/lib/types/node/agents/triggers/teams/node.d.cts +40 -0
- package/lib/types/node/agents/triggers/teams/node.d.mts +40 -0
- package/lib/types/node/agents/triggers/telegram/node.d.cts +40 -0
- package/lib/types/node/agents/triggers/telegram/node.d.mts +40 -0
- package/lib/types/node/agents/voice/node.d.cts +34 -0
- package/lib/types/node/agents/voice/node.d.mts +34 -0
- package/lib/types/node/agents/zones.d.cts +30 -0
- package/lib/types/node/agents/zones.d.mts +30 -0
- package/lib/types/node/comms/email-send/node.d.cts +85 -0
- package/lib/types/node/comms/email-send/node.d.mts +85 -0
- package/lib/types/node/comms/gmail/node.d.cts +67 -0
- package/lib/types/node/comms/gmail/node.d.mts +67 -0
- package/lib/types/node/comms/slack/node.d.cts +65 -0
- package/lib/types/node/comms/slack/node.d.mts +65 -0
- package/lib/types/node/comms/teams/node.d.cts +49 -0
- package/lib/types/node/comms/teams/node.d.mts +49 -0
- package/lib/types/node/comms/telegram/node.d.cts +61 -0
- package/lib/types/node/comms/telegram/node.d.mts +61 -0
- package/lib/types/node/credentials.d.cts +43 -0
- package/lib/types/node/credentials.d.mts +43 -0
- package/lib/types/node/data/data-table/node.d.cts +86 -0
- package/lib/types/node/data/data-table/node.d.mts +86 -0
- package/lib/types/node/data/date-time/node.d.cts +49 -0
- package/lib/types/node/data/date-time/node.d.mts +49 -0
- package/lib/types/node/data/filter/node.d.cts +31 -0
- package/lib/types/node/data/filter/node.d.mts +31 -0
- package/lib/types/node/data/limit/node.d.cts +28 -0
- package/lib/types/node/data/limit/node.d.mts +28 -0
- package/lib/types/node/data/merge/node.d.cts +63 -0
- package/lib/types/node/data/merge/node.d.mts +63 -0
- package/lib/types/node/data/rename-keys/node.d.cts +35 -0
- package/lib/types/node/data/rename-keys/node.d.mts +35 -0
- package/lib/types/node/data/set/node.d.cts +52 -0
- package/lib/types/node/data/set/node.d.mts +52 -0
- package/lib/types/node/data/sort/node.d.cts +40 -0
- package/lib/types/node/data/sort/node.d.mts +40 -0
- package/lib/types/node/data/split-out/node.d.cts +30 -0
- package/lib/types/node/data/split-out/node.d.mts +30 -0
- package/lib/types/node/data/support.d.cts +164 -0
- package/lib/types/node/data/support.d.mts +164 -0
- package/lib/types/node/devops/crypto/node.d.cts +65 -0
- package/lib/types/node/devops/crypto/node.d.mts +65 -0
- package/lib/types/node/devops/execute-command/node.d.cts +55 -0
- package/lib/types/node/devops/execute-command/node.d.mts +55 -0
- package/lib/types/node/devops/ftp/node.d.cts +55 -0
- package/lib/types/node/devops/ftp/node.d.mts +55 -0
- package/lib/types/node/devops/github/node.d.cts +61 -0
- package/lib/types/node/devops/github/node.d.mts +61 -0
- package/lib/types/node/devops/gitlab/node.d.cts +61 -0
- package/lib/types/node/devops/gitlab/node.d.mts +61 -0
- package/lib/types/node/devops/jwt/node.d.cts +53 -0
- package/lib/types/node/devops/jwt/node.d.mts +53 -0
- package/lib/types/node/flow/execute-sub-workflow/node.d.cts +63 -0
- package/lib/types/node/flow/execute-sub-workflow/node.d.mts +63 -0
- package/lib/types/node/index.d.cts +182 -2
- package/lib/types/node/index.d.mts +182 -2
- package/lib/types/node/io/airtable/node.d.cts +73 -0
- package/lib/types/node/io/airtable/node.d.mts +73 -0
- package/lib/types/node/io/extract-from-file/node.d.cts +38 -0
- package/lib/types/node/io/extract-from-file/node.d.mts +38 -0
- package/lib/types/node/io/google-sheets/node.d.cts +77 -0
- package/lib/types/node/io/google-sheets/node.d.mts +77 -0
- package/lib/types/node/io/graphql/node.d.cts +46 -0
- package/lib/types/node/io/graphql/node.d.mts +46 -0
- package/lib/types/node/io/http-request/node.d.cts +107 -0
- package/lib/types/node/io/http-request/node.d.mts +107 -0
- package/lib/types/node/io/read-pdf/node.d.cts +40 -0
- package/lib/types/node/io/read-pdf/node.d.mts +40 -0
- package/lib/types/node/io/read-write-file/node.d.cts +41 -0
- package/lib/types/node/io/read-write-file/node.d.mts +41 -0
- package/lib/types/node/io/respond-to-webhook/node.d.cts +45 -0
- package/lib/types/node/io/respond-to-webhook/node.d.mts +45 -0
- package/lib/types/node/io/spreadsheet-file/node.d.cts +51 -0
- package/lib/types/node/io/spreadsheet-file/node.d.mts +51 -0
- package/lib/types/node/storage/blob/azure/node.d.cts +27 -0
- package/lib/types/node/storage/blob/azure/node.d.mts +27 -0
- package/lib/types/node/storage/blob/base.d.cts +83 -0
- package/lib/types/node/storage/blob/base.d.mts +83 -0
- package/lib/types/node/storage/blob/gcs/node.d.cts +27 -0
- package/lib/types/node/storage/blob/gcs/node.d.mts +27 -0
- package/lib/types/node/storage/blob/s3/node.d.cts +39 -0
- package/lib/types/node/storage/blob/s3/node.d.mts +39 -0
- package/lib/types/node/storage/database/base.d.cts +97 -0
- package/lib/types/node/storage/database/base.d.mts +97 -0
- package/lib/types/node/storage/database/mssql/node.d.cts +8 -0
- package/lib/types/node/storage/database/mssql/node.d.mts +8 -0
- package/lib/types/node/storage/database/mysql/node.d.cts +8 -0
- package/lib/types/node/storage/database/mysql/node.d.mts +8 -0
- package/lib/types/node/storage/database/postgres/node.d.cts +8 -0
- package/lib/types/node/storage/database/postgres/node.d.mts +8 -0
- package/lib/types/node/storage/redis/node.d.cts +68 -0
- package/lib/types/node/storage/redis/node.d.mts +68 -0
- package/lib/types/node/storage/support.d.cts +36 -0
- package/lib/types/node/storage/support.d.mts +36 -0
- package/lib/types/node/triggers/execute-workflow/node.d.cts +25 -0
- package/lib/types/node/triggers/execute-workflow/node.d.mts +25 -0
- package/lib/types/ram/GraphRunEventModel.d.cts +6 -0
- package/lib/types/ram/GraphRunEventModel.d.mts +6 -0
- package/lib/types/shared/graph/GraphNodeModel.d.cts +6 -0
- package/lib/types/shared/graph/GraphNodeModel.d.mts +6 -0
- package/lib/types/shared/graph/GraphWorkflowModel.d.cts +6 -0
- package/lib/types/shared/graph/GraphWorkflowModel.d.mts +6 -0
- package/lib/types/shared/graph/catalog/GraphPortManifest.d.cts +7 -0
- package/lib/types/shared/graph/catalog/GraphPortManifest.d.mts +7 -0
- package/lib/types/shared/graph/constants.d.cts +39 -0
- package/lib/types/shared/graph/constants.d.mts +39 -0
- package/lib/types/typeorm/TypeormGraphAdapter.d.cts +32 -0
- package/lib/types/typeorm/TypeormGraphAdapter.d.mts +32 -0
- package/lib/types/typeorm/index.d.cts +11 -0
- package/lib/types/typeorm/index.d.mts +11 -0
- package/package.json +51 -11
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/mastra/MastraStructuredOutput
|
|
3
|
+
* @summary Backend contract for structured output/input definitions (SAA-836 S1).
|
|
4
|
+
* @description A graph document authors a structured-output definition on an
|
|
5
|
+
* agent (or a structured-output consuming node) as a plain, JSON-safe
|
|
6
|
+
* parameter. This module is the backend contract for that definition: its
|
|
7
|
+
* shape, its resolution into the `@mastra/core` `structuredOutput` generate
|
|
8
|
+
* option, and its fail-closed semantics. The schema itself always comes from
|
|
9
|
+
* the single decaf↔mastra conversion path ({@link MastraModelSchemaConverter}
|
|
10
|
+
* over `@decaf-ts/as-zod`): either a decaf model name resolved through the
|
|
11
|
+
* host-supplied model registry, or an already-converted Zod schema carried by
|
|
12
|
+
* the host. The definition never carries a secret and never carries raw JSON
|
|
13
|
+
* Schema — mastra consumes Zod. The model-builder UI (SAA-836 U1) consumes
|
|
14
|
+
* this same contract; no UI is authored here.
|
|
15
|
+
*
|
|
16
|
+
* @mermaid
|
|
17
|
+
* sequenceDiagram
|
|
18
|
+
* autonumber
|
|
19
|
+
* participant N as Canonical node structuredOutput parameter
|
|
20
|
+
* participant SH as MastraAgentStepHandler step
|
|
21
|
+
* participant R as mastraStructuredOutputOf / resolveMastraStructuredOutput
|
|
22
|
+
* participant C as MastraModelSchemaConverter (as-zod)
|
|
23
|
+
* participant RT as config-backed MastraAgentRuntime
|
|
24
|
+
* participant A as mastra agent generate
|
|
25
|
+
* N->>SH: structuredOutput definition (parameters)
|
|
26
|
+
* SH->>R: mastraStructuredOutputOf(node, resolveModel) (memoized per step)
|
|
27
|
+
* alt no structuredOutput parameter declared on the node
|
|
28
|
+
* R-->>SH: undefined (agent runs unstructured)
|
|
29
|
+
* else declared parameter is not a valid definition
|
|
30
|
+
* R--xSH: GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED
|
|
31
|
+
* else definition present
|
|
32
|
+
* alt host-carried Zod schema
|
|
33
|
+
* R-->>R: schema = definition.schema
|
|
34
|
+
* else decaf model name
|
|
35
|
+
* R->>R: resolveModel(name)
|
|
36
|
+
* alt registry misses
|
|
37
|
+
* R--xSH: GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED
|
|
38
|
+
* else registry resolves
|
|
39
|
+
* R->>C: mastraSchemaFromModel(model)
|
|
40
|
+
* alt conversion fails / non-object schema
|
|
41
|
+
* C--xSH: GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE
|
|
42
|
+
* else converted
|
|
43
|
+
* C-->>R: Zod object schema
|
|
44
|
+
* end
|
|
45
|
+
* end
|
|
46
|
+
* end
|
|
47
|
+
* R-->>SH: MastraResolvedStructuredOutput
|
|
48
|
+
* SH->>RT: execute(node, inputs, …, structuredOutput)
|
|
49
|
+
* RT->>A: generate(prompt, { structuredOutput: { schema, … } })
|
|
50
|
+
* A-->>RT: response validated against the Zod schema
|
|
51
|
+
* end
|
|
52
|
+
*/
|
|
53
|
+
import type { Constructor } from "@decaf-ts/decoration";
|
|
54
|
+
import type { Model } from "@decaf-ts/decorator-validation";
|
|
55
|
+
import type { GraphNodeInstance } from "../shared/graph/document/GraphNodeInstance.d.cts";
|
|
56
|
+
import type { z } from "zod";
|
|
57
|
+
/** The structured-output definition on a node could not be resolved. */
|
|
58
|
+
export declare const GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED = "GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED";
|
|
59
|
+
/**
|
|
60
|
+
* A node declares a `structuredOutput` parameter that is not a valid
|
|
61
|
+
* structured-output definition. Fails the run instead of silently stripping
|
|
62
|
+
* the declared output-validation control.
|
|
63
|
+
*/
|
|
64
|
+
export declare const GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED = "GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED";
|
|
65
|
+
/**
|
|
66
|
+
* Host-supplied registry resolving a decaf model name to its constructor.
|
|
67
|
+
* The host owns the model catalogue; the mastra backend never invents one.
|
|
68
|
+
*/
|
|
69
|
+
export type MastraDecafModelResolver = (name: string) => Constructor<Model> | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The JSON-safe structured-output definition a document authors on a node
|
|
72
|
+
* (backend contract, consumed by the U1 model-builder UI). The schema is
|
|
73
|
+
* either referenced by decaf model name (`model`) or supplied by the host as
|
|
74
|
+
* an already-converted Zod schema (`schema`); exactly one must resolve.
|
|
75
|
+
*/
|
|
76
|
+
export interface MastraStructuredOutputDefinition {
|
|
77
|
+
/** The decaf model name the schema is derived from (as-zod conversion). */
|
|
78
|
+
model?: string;
|
|
79
|
+
/**
|
|
80
|
+
* An already-converted Zod schema supplied by the host (never user JSON).
|
|
81
|
+
* Takes precedence over {@link model} when both are present.
|
|
82
|
+
*/
|
|
83
|
+
schema?: z.ZodTypeAny;
|
|
84
|
+
/**
|
|
85
|
+
* Optional structuring instructions forwarded to mastra verbatim (mastra's
|
|
86
|
+
* `structuredOutput.instructions`).
|
|
87
|
+
*/
|
|
88
|
+
instructions?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Optional prompt-injection mode forwarded to mastra verbatim (mastra's
|
|
91
|
+
* `structuredOutput.jsonPromptInjection`).
|
|
92
|
+
*/
|
|
93
|
+
jsonPromptInjection?: boolean | "system" | "inline" | "auto";
|
|
94
|
+
/** Optional provider-specific options forwarded to mastra verbatim. */
|
|
95
|
+
providerOptions?: Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
/** The resolved, mastra-ready structured-output option for one node. */
|
|
98
|
+
export interface MastraResolvedStructuredOutput {
|
|
99
|
+
/** The Zod schema the agent's structured output validates against. */
|
|
100
|
+
schema: z.ZodTypeAny;
|
|
101
|
+
/** Optional structuring instructions forwarded to mastra. */
|
|
102
|
+
instructions?: string;
|
|
103
|
+
/** Optional prompt-injection mode forwarded to mastra. */
|
|
104
|
+
jsonPromptInjection?: boolean | "system" | "inline" | "auto";
|
|
105
|
+
/** Optional provider-specific options forwarded to mastra. */
|
|
106
|
+
providerOptions?: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Structural guard for {@link MastraStructuredOutputDefinition}: accepts the
|
|
110
|
+
* plain, JSON-safe definition shape authored on a node. A live Zod schema
|
|
111
|
+
* passes only through the host-carried `schema` field.
|
|
112
|
+
*
|
|
113
|
+
* @param value - The candidate definition.
|
|
114
|
+
* @returns `true` when the value is a valid structured-output definition.
|
|
115
|
+
*/
|
|
116
|
+
export declare function isMastraStructuredOutputDefinition(value: unknown): value is MastraStructuredOutputDefinition;
|
|
117
|
+
/**
|
|
118
|
+
* Reads the structured-output definition authored on a canonical node's
|
|
119
|
+
* `structuredOutput` parameter. An absent parameter returns `undefined` so
|
|
120
|
+
* the caller runs unstructured (the default mastra behaviour); a DECLARED
|
|
121
|
+
* parameter that fails the guard throws — a declared output-validation
|
|
122
|
+
* control that is malformed must never silently degrade the agent to
|
|
123
|
+
* unstructured output (fail closed, not fail silent).
|
|
124
|
+
*
|
|
125
|
+
* @param node - The canonical node instance.
|
|
126
|
+
* @returns The validated definition, or `undefined` when no parameter is
|
|
127
|
+
* declared.
|
|
128
|
+
* @throws {GraphExecutionError}
|
|
129
|
+
* {@link GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED} when the node declares
|
|
130
|
+
* a `structuredOutput` parameter that is not a valid definition.
|
|
131
|
+
*/
|
|
132
|
+
export declare function mastraStructuredOutputDefinitionOf(node: GraphNodeInstance): MastraStructuredOutputDefinition | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Resolves a {@link MastraStructuredOutputDefinition} into the mastra
|
|
135
|
+
* `structuredOutput` generate option (SAA-836 S1). The schema comes from the
|
|
136
|
+
* single conversion path: a host-carried Zod schema when supplied, otherwise
|
|
137
|
+
* the decaf model named by the definition resolved through
|
|
138
|
+
* {@link resolveModel} and converted via `@decaf-ts/as-zod`. Fails closed
|
|
139
|
+
* when neither source resolves — a structured-output definition that cannot
|
|
140
|
+
* resolve must never silently degrade to unstructured output.
|
|
141
|
+
*
|
|
142
|
+
* @param definition - The validated definition.
|
|
143
|
+
* @param resolveModel - The host decaf-model registry; required when the
|
|
144
|
+
* definition references a model by name.
|
|
145
|
+
* @returns The resolved, mastra-ready structured-output option.
|
|
146
|
+
* @throws {GraphExecutionError}
|
|
147
|
+
* {@link GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED} when no schema source
|
|
148
|
+
* resolves, or {@link GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE} when the
|
|
149
|
+
* referenced decaf model cannot be converted.
|
|
150
|
+
*/
|
|
151
|
+
export declare function resolveMastraStructuredOutput(definition: MastraStructuredOutputDefinition, resolveModel?: MastraDecafModelResolver): MastraResolvedStructuredOutput;
|
|
152
|
+
/**
|
|
153
|
+
* Reads the structured-output definition authored on a canonical node's
|
|
154
|
+
* `structuredOutput` parameter and resolves it against the host model
|
|
155
|
+
* registry. When the node declares no parameter, the resolution is absent —
|
|
156
|
+
* the agent runs unstructured, which is the default mastra behaviour. A
|
|
157
|
+
* declared parameter that is not a valid definition fails the run.
|
|
158
|
+
*
|
|
159
|
+
* @param node - The canonical node instance.
|
|
160
|
+
* @param resolveModel - The host decaf-model registry.
|
|
161
|
+
* @returns The resolved structured-output option, or `undefined` when the
|
|
162
|
+
* node declares none.
|
|
163
|
+
* @throws {GraphExecutionError} when a declared definition cannot resolve.
|
|
164
|
+
*/
|
|
165
|
+
export declare function mastraStructuredOutputOf(node: GraphNodeInstance, resolveModel?: MastraDecafModelResolver): MastraResolvedStructuredOutput | undefined;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/mastra/MastraStructuredOutput
|
|
3
|
+
* @summary Backend contract for structured output/input definitions (SAA-836 S1).
|
|
4
|
+
* @description A graph document authors a structured-output definition on an
|
|
5
|
+
* agent (or a structured-output consuming node) as a plain, JSON-safe
|
|
6
|
+
* parameter. This module is the backend contract for that definition: its
|
|
7
|
+
* shape, its resolution into the `@mastra/core` `structuredOutput` generate
|
|
8
|
+
* option, and its fail-closed semantics. The schema itself always comes from
|
|
9
|
+
* the single decaf↔mastra conversion path ({@link MastraModelSchemaConverter}
|
|
10
|
+
* over `@decaf-ts/as-zod`): either a decaf model name resolved through the
|
|
11
|
+
* host-supplied model registry, or an already-converted Zod schema carried by
|
|
12
|
+
* the host. The definition never carries a secret and never carries raw JSON
|
|
13
|
+
* Schema — mastra consumes Zod. The model-builder UI (SAA-836 U1) consumes
|
|
14
|
+
* this same contract; no UI is authored here.
|
|
15
|
+
*
|
|
16
|
+
* @mermaid
|
|
17
|
+
* sequenceDiagram
|
|
18
|
+
* autonumber
|
|
19
|
+
* participant N as Canonical node structuredOutput parameter
|
|
20
|
+
* participant SH as MastraAgentStepHandler step
|
|
21
|
+
* participant R as mastraStructuredOutputOf / resolveMastraStructuredOutput
|
|
22
|
+
* participant C as MastraModelSchemaConverter (as-zod)
|
|
23
|
+
* participant RT as config-backed MastraAgentRuntime
|
|
24
|
+
* participant A as mastra agent generate
|
|
25
|
+
* N->>SH: structuredOutput definition (parameters)
|
|
26
|
+
* SH->>R: mastraStructuredOutputOf(node, resolveModel) (memoized per step)
|
|
27
|
+
* alt no structuredOutput parameter declared on the node
|
|
28
|
+
* R-->>SH: undefined (agent runs unstructured)
|
|
29
|
+
* else declared parameter is not a valid definition
|
|
30
|
+
* R--xSH: GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED
|
|
31
|
+
* else definition present
|
|
32
|
+
* alt host-carried Zod schema
|
|
33
|
+
* R-->>R: schema = definition.schema
|
|
34
|
+
* else decaf model name
|
|
35
|
+
* R->>R: resolveModel(name)
|
|
36
|
+
* alt registry misses
|
|
37
|
+
* R--xSH: GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED
|
|
38
|
+
* else registry resolves
|
|
39
|
+
* R->>C: mastraSchemaFromModel(model)
|
|
40
|
+
* alt conversion fails / non-object schema
|
|
41
|
+
* C--xSH: GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE
|
|
42
|
+
* else converted
|
|
43
|
+
* C-->>R: Zod object schema
|
|
44
|
+
* end
|
|
45
|
+
* end
|
|
46
|
+
* end
|
|
47
|
+
* R-->>SH: MastraResolvedStructuredOutput
|
|
48
|
+
* SH->>RT: execute(node, inputs, …, structuredOutput)
|
|
49
|
+
* RT->>A: generate(prompt, { structuredOutput: { schema, … } })
|
|
50
|
+
* A-->>RT: response validated against the Zod schema
|
|
51
|
+
* end
|
|
52
|
+
*/
|
|
53
|
+
import type { Constructor } from "@decaf-ts/decoration";
|
|
54
|
+
import type { Model } from "@decaf-ts/decorator-validation";
|
|
55
|
+
import type { GraphNodeInstance } from "../shared/graph/document/GraphNodeInstance.d.mts";
|
|
56
|
+
import type { z } from "zod";
|
|
57
|
+
/** The structured-output definition on a node could not be resolved. */
|
|
58
|
+
export declare const GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED = "GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED";
|
|
59
|
+
/**
|
|
60
|
+
* A node declares a `structuredOutput` parameter that is not a valid
|
|
61
|
+
* structured-output definition. Fails the run instead of silently stripping
|
|
62
|
+
* the declared output-validation control.
|
|
63
|
+
*/
|
|
64
|
+
export declare const GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED = "GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED";
|
|
65
|
+
/**
|
|
66
|
+
* Host-supplied registry resolving a decaf model name to its constructor.
|
|
67
|
+
* The host owns the model catalogue; the mastra backend never invents one.
|
|
68
|
+
*/
|
|
69
|
+
export type MastraDecafModelResolver = (name: string) => Constructor<Model> | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The JSON-safe structured-output definition a document authors on a node
|
|
72
|
+
* (backend contract, consumed by the U1 model-builder UI). The schema is
|
|
73
|
+
* either referenced by decaf model name (`model`) or supplied by the host as
|
|
74
|
+
* an already-converted Zod schema (`schema`); exactly one must resolve.
|
|
75
|
+
*/
|
|
76
|
+
export interface MastraStructuredOutputDefinition {
|
|
77
|
+
/** The decaf model name the schema is derived from (as-zod conversion). */
|
|
78
|
+
model?: string;
|
|
79
|
+
/**
|
|
80
|
+
* An already-converted Zod schema supplied by the host (never user JSON).
|
|
81
|
+
* Takes precedence over {@link model} when both are present.
|
|
82
|
+
*/
|
|
83
|
+
schema?: z.ZodTypeAny;
|
|
84
|
+
/**
|
|
85
|
+
* Optional structuring instructions forwarded to mastra verbatim (mastra's
|
|
86
|
+
* `structuredOutput.instructions`).
|
|
87
|
+
*/
|
|
88
|
+
instructions?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Optional prompt-injection mode forwarded to mastra verbatim (mastra's
|
|
91
|
+
* `structuredOutput.jsonPromptInjection`).
|
|
92
|
+
*/
|
|
93
|
+
jsonPromptInjection?: boolean | "system" | "inline" | "auto";
|
|
94
|
+
/** Optional provider-specific options forwarded to mastra verbatim. */
|
|
95
|
+
providerOptions?: Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
/** The resolved, mastra-ready structured-output option for one node. */
|
|
98
|
+
export interface MastraResolvedStructuredOutput {
|
|
99
|
+
/** The Zod schema the agent's structured output validates against. */
|
|
100
|
+
schema: z.ZodTypeAny;
|
|
101
|
+
/** Optional structuring instructions forwarded to mastra. */
|
|
102
|
+
instructions?: string;
|
|
103
|
+
/** Optional prompt-injection mode forwarded to mastra. */
|
|
104
|
+
jsonPromptInjection?: boolean | "system" | "inline" | "auto";
|
|
105
|
+
/** Optional provider-specific options forwarded to mastra. */
|
|
106
|
+
providerOptions?: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Structural guard for {@link MastraStructuredOutputDefinition}: accepts the
|
|
110
|
+
* plain, JSON-safe definition shape authored on a node. A live Zod schema
|
|
111
|
+
* passes only through the host-carried `schema` field.
|
|
112
|
+
*
|
|
113
|
+
* @param value - The candidate definition.
|
|
114
|
+
* @returns `true` when the value is a valid structured-output definition.
|
|
115
|
+
*/
|
|
116
|
+
export declare function isMastraStructuredOutputDefinition(value: unknown): value is MastraStructuredOutputDefinition;
|
|
117
|
+
/**
|
|
118
|
+
* Reads the structured-output definition authored on a canonical node's
|
|
119
|
+
* `structuredOutput` parameter. An absent parameter returns `undefined` so
|
|
120
|
+
* the caller runs unstructured (the default mastra behaviour); a DECLARED
|
|
121
|
+
* parameter that fails the guard throws — a declared output-validation
|
|
122
|
+
* control that is malformed must never silently degrade the agent to
|
|
123
|
+
* unstructured output (fail closed, not fail silent).
|
|
124
|
+
*
|
|
125
|
+
* @param node - The canonical node instance.
|
|
126
|
+
* @returns The validated definition, or `undefined` when no parameter is
|
|
127
|
+
* declared.
|
|
128
|
+
* @throws {GraphExecutionError}
|
|
129
|
+
* {@link GRAPH_MASTRA_STRUCTURED_OUTPUT_MALFORMED} when the node declares
|
|
130
|
+
* a `structuredOutput` parameter that is not a valid definition.
|
|
131
|
+
*/
|
|
132
|
+
export declare function mastraStructuredOutputDefinitionOf(node: GraphNodeInstance): MastraStructuredOutputDefinition | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Resolves a {@link MastraStructuredOutputDefinition} into the mastra
|
|
135
|
+
* `structuredOutput` generate option (SAA-836 S1). The schema comes from the
|
|
136
|
+
* single conversion path: a host-carried Zod schema when supplied, otherwise
|
|
137
|
+
* the decaf model named by the definition resolved through
|
|
138
|
+
* {@link resolveModel} and converted via `@decaf-ts/as-zod`. Fails closed
|
|
139
|
+
* when neither source resolves — a structured-output definition that cannot
|
|
140
|
+
* resolve must never silently degrade to unstructured output.
|
|
141
|
+
*
|
|
142
|
+
* @param definition - The validated definition.
|
|
143
|
+
* @param resolveModel - The host decaf-model registry; required when the
|
|
144
|
+
* definition references a model by name.
|
|
145
|
+
* @returns The resolved, mastra-ready structured-output option.
|
|
146
|
+
* @throws {GraphExecutionError}
|
|
147
|
+
* {@link GRAPH_MASTRA_STRUCTURED_OUTPUT_UNRESOLVED} when no schema source
|
|
148
|
+
* resolves, or {@link GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE} when the
|
|
149
|
+
* referenced decaf model cannot be converted.
|
|
150
|
+
*/
|
|
151
|
+
export declare function resolveMastraStructuredOutput(definition: MastraStructuredOutputDefinition, resolveModel?: MastraDecafModelResolver): MastraResolvedStructuredOutput;
|
|
152
|
+
/**
|
|
153
|
+
* Reads the structured-output definition authored on a canonical node's
|
|
154
|
+
* `structuredOutput` parameter and resolves it against the host model
|
|
155
|
+
* registry. When the node declares no parameter, the resolution is absent —
|
|
156
|
+
* the agent runs unstructured, which is the default mastra behaviour. A
|
|
157
|
+
* declared parameter that is not a valid definition fails the run.
|
|
158
|
+
*
|
|
159
|
+
* @param node - The canonical node instance.
|
|
160
|
+
* @param resolveModel - The host decaf-model registry.
|
|
161
|
+
* @returns The resolved structured-output option, or `undefined` when the
|
|
162
|
+
* node declares none.
|
|
163
|
+
* @throws {GraphExecutionError} when a declared definition cannot resolve.
|
|
164
|
+
*/
|
|
165
|
+
export declare function mastraStructuredOutputOf(node: GraphNodeInstance, resolveModel?: MastraDecafModelResolver): MastraResolvedStructuredOutput | undefined;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/mastra/MastraToolBuilder
|
|
3
|
+
* @summary Fluent builder producing valid mastra tool documents (SAA-836
|
|
4
|
+
* M6).
|
|
5
|
+
* @description The tool analogue of the workflow builders ("as already
|
|
6
|
+
* existing for workflows/nodes"): a chainable facade over the canonical
|
|
7
|
+
* {@link GraphWorkflowDocumentBuilder} that starts from the `core.agent.tool`
|
|
8
|
+
* node class and tunes the tool's parameters. `build()` validates and
|
|
9
|
+
* freezes the document with the same structural gate the engine and frontend
|
|
10
|
+
* share, so a builder always produces a valid tool document or throws.
|
|
11
|
+
*/
|
|
12
|
+
import type { GraphJsonValue } from "../shared/graph/index.d.cts";
|
|
13
|
+
import type { GraphWorkflowDocument } from "../shared/graph/document/index.d.cts";
|
|
14
|
+
/** Options accepted by the {@link MastraToolBuilder} constructor. */
|
|
15
|
+
export interface MastraToolBuilderOptions {
|
|
16
|
+
/** The canonical document id; defaults to `tool-document` when omitted. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/** The canonical document name; defaults to the id when omitted. */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** The tool node id inside the document; defaults to `tool`. */
|
|
21
|
+
toolId?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fluent builder for valid mastra tool documents. {@link
|
|
25
|
+
* MastraToolBuilder.build} validates the assembled document.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const doc = new MastraToolBuilder({ id: "weather-tool" })
|
|
30
|
+
* .identifiesAs("getWeather")
|
|
31
|
+
* .describes("Returns the current weather for a city")
|
|
32
|
+
* .withParameters({ city: "{{ $input.city }}" })
|
|
33
|
+
* .build();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class MastraToolBuilder {
|
|
37
|
+
private readonly inner;
|
|
38
|
+
private readonly toolNodeId;
|
|
39
|
+
/**
|
|
40
|
+
* @param options - Builder options (document id/name and tool node id).
|
|
41
|
+
*/
|
|
42
|
+
constructor(options?: MastraToolBuilderOptions);
|
|
43
|
+
/**
|
|
44
|
+
* Sets the tool's identifier.
|
|
45
|
+
*
|
|
46
|
+
* @param toolId - The tool identifier.
|
|
47
|
+
* @returns this builder, for chaining.
|
|
48
|
+
*/
|
|
49
|
+
identifiesAs(toolId: string): this;
|
|
50
|
+
/**
|
|
51
|
+
* Sets the tool's human-readable description.
|
|
52
|
+
*
|
|
53
|
+
* @param description - The description text.
|
|
54
|
+
* @returns this builder, for chaining.
|
|
55
|
+
*/
|
|
56
|
+
describes(description: string): this;
|
|
57
|
+
/**
|
|
58
|
+
* Merges raw parameter overrides onto the tool node.
|
|
59
|
+
*
|
|
60
|
+
* @param parameters - The parameter overrides.
|
|
61
|
+
* @returns this builder, for chaining.
|
|
62
|
+
*/
|
|
63
|
+
withParameters(parameters: Record<string, GraphJsonValue>): this;
|
|
64
|
+
/**
|
|
65
|
+
* Validates and freezes the assembled tool document.
|
|
66
|
+
*
|
|
67
|
+
* @returns The validated canonical {@link GraphWorkflowDocument}.
|
|
68
|
+
*/
|
|
69
|
+
build(): GraphWorkflowDocument;
|
|
70
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/mastra/MastraToolBuilder
|
|
3
|
+
* @summary Fluent builder producing valid mastra tool documents (SAA-836
|
|
4
|
+
* M6).
|
|
5
|
+
* @description The tool analogue of the workflow builders ("as already
|
|
6
|
+
* existing for workflows/nodes"): a chainable facade over the canonical
|
|
7
|
+
* {@link GraphWorkflowDocumentBuilder} that starts from the `core.agent.tool`
|
|
8
|
+
* node class and tunes the tool's parameters. `build()` validates and
|
|
9
|
+
* freezes the document with the same structural gate the engine and frontend
|
|
10
|
+
* share, so a builder always produces a valid tool document or throws.
|
|
11
|
+
*/
|
|
12
|
+
import type { GraphJsonValue } from "../shared/graph/index.d.mts";
|
|
13
|
+
import type { GraphWorkflowDocument } from "../shared/graph/document/index.d.mts";
|
|
14
|
+
/** Options accepted by the {@link MastraToolBuilder} constructor. */
|
|
15
|
+
export interface MastraToolBuilderOptions {
|
|
16
|
+
/** The canonical document id; defaults to `tool-document` when omitted. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/** The canonical document name; defaults to the id when omitted. */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** The tool node id inside the document; defaults to `tool`. */
|
|
21
|
+
toolId?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fluent builder for valid mastra tool documents. {@link
|
|
25
|
+
* MastraToolBuilder.build} validates the assembled document.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const doc = new MastraToolBuilder({ id: "weather-tool" })
|
|
30
|
+
* .identifiesAs("getWeather")
|
|
31
|
+
* .describes("Returns the current weather for a city")
|
|
32
|
+
* .withParameters({ city: "{{ $input.city }}" })
|
|
33
|
+
* .build();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class MastraToolBuilder {
|
|
37
|
+
private readonly inner;
|
|
38
|
+
private readonly toolNodeId;
|
|
39
|
+
/**
|
|
40
|
+
* @param options - Builder options (document id/name and tool node id).
|
|
41
|
+
*/
|
|
42
|
+
constructor(options?: MastraToolBuilderOptions);
|
|
43
|
+
/**
|
|
44
|
+
* Sets the tool's identifier.
|
|
45
|
+
*
|
|
46
|
+
* @param toolId - The tool identifier.
|
|
47
|
+
* @returns this builder, for chaining.
|
|
48
|
+
*/
|
|
49
|
+
identifiesAs(toolId: string): this;
|
|
50
|
+
/**
|
|
51
|
+
* Sets the tool's human-readable description.
|
|
52
|
+
*
|
|
53
|
+
* @param description - The description text.
|
|
54
|
+
* @returns this builder, for chaining.
|
|
55
|
+
*/
|
|
56
|
+
describes(description: string): this;
|
|
57
|
+
/**
|
|
58
|
+
* Merges raw parameter overrides onto the tool node.
|
|
59
|
+
*
|
|
60
|
+
* @param parameters - The parameter overrides.
|
|
61
|
+
* @returns this builder, for chaining.
|
|
62
|
+
*/
|
|
63
|
+
withParameters(parameters: Record<string, GraphJsonValue>): this;
|
|
64
|
+
/**
|
|
65
|
+
* Validates and freezes the assembled tool document.
|
|
66
|
+
*
|
|
67
|
+
* @returns The validated canonical {@link GraphWorkflowDocument}.
|
|
68
|
+
*/
|
|
69
|
+
build(): GraphWorkflowDocument;
|
|
70
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/** A tool definition mirroring the subset of `@mastra/core` `createTool` opts the tool node mirrors. */
|
|
2
|
+
export interface MastraToolDefinition {
|
|
3
|
+
/** The mastra tool id. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The human/model-facing tool description. */
|
|
6
|
+
description: string;
|
|
7
|
+
/** Optional zod input schema. */
|
|
8
|
+
inputSchema?: unknown;
|
|
9
|
+
/** Optional zod output schema. */
|
|
10
|
+
outputSchema?: unknown;
|
|
11
|
+
/** Optional suspend schema. */
|
|
12
|
+
suspendSchema?: unknown;
|
|
13
|
+
/** Optional resume schema. */
|
|
14
|
+
resumeSchema?: unknown;
|
|
15
|
+
/** Whether the tool call requires human approval before executing. */
|
|
16
|
+
requireApproval?: boolean;
|
|
17
|
+
/** The tool executor. */
|
|
18
|
+
execute?: (input: unknown, context?: unknown) => unknown | Promise<unknown>;
|
|
19
|
+
}
|
|
20
|
+
/** The result a `beforeToolCall` hook returns to (possibly) deny a call. */
|
|
21
|
+
export interface MastraBeforeToolCallResult {
|
|
22
|
+
/** `false` denies the tool call. */
|
|
23
|
+
proceed: boolean;
|
|
24
|
+
/** The value returned to the model in place of the tool output when denied. */
|
|
25
|
+
output?: unknown;
|
|
26
|
+
}
|
|
27
|
+
/** Context handed to a `beforeToolCall` / `afterToolCall` hook. */
|
|
28
|
+
export interface MastraToolHookContext {
|
|
29
|
+
/** The mastra tool name being invoked. */
|
|
30
|
+
toolName: string;
|
|
31
|
+
/** The input the model supplied for the call. */
|
|
32
|
+
input: unknown;
|
|
33
|
+
/** The tool call id, when the runtime supplies one. */
|
|
34
|
+
toolCallId?: string;
|
|
35
|
+
/** The agent id that initiated the call, when known. */
|
|
36
|
+
agentId?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Context handed to an `afterToolCall` hook (adds the output or the error). */
|
|
39
|
+
export interface MastraToolAfterHookContext extends MastraToolHookContext {
|
|
40
|
+
/** The tool output, when the call succeeded. */
|
|
41
|
+
output?: unknown;
|
|
42
|
+
/** The tool error, when the call failed. */
|
|
43
|
+
error?: unknown;
|
|
44
|
+
}
|
|
45
|
+
/** Tool hook configuration mirroring mastra's `ToolHooks`. */
|
|
46
|
+
export interface MastraToolHooksConfig {
|
|
47
|
+
/** Runs before a tool call; may deny it via `{ proceed: false, output }`. */
|
|
48
|
+
beforeToolCall?: (context: MastraToolHookContext) => void | MastraBeforeToolCallResult | Promise<void | MastraBeforeToolCallResult>;
|
|
49
|
+
/** Runs after a tool call with the output or error. */
|
|
50
|
+
afterToolCall?: (context: MastraToolAfterHookContext) => void | Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
/** Context handed to an `onDelegationStart` hook. */
|
|
53
|
+
export interface MastraDelegationStartContext {
|
|
54
|
+
/** The delegating (parent) agent id. */
|
|
55
|
+
fromAgentId: string;
|
|
56
|
+
/** The target (sub) agent id. */
|
|
57
|
+
toAgentId: string;
|
|
58
|
+
/** The input forwarded to the sub-agent. */
|
|
59
|
+
input?: unknown;
|
|
60
|
+
}
|
|
61
|
+
/** Result an `onDelegationStart` hook returns to stop or modify a delegation. */
|
|
62
|
+
export interface MastraDelegationStartResult {
|
|
63
|
+
/** `false` denies the delegation. */
|
|
64
|
+
proceed?: boolean;
|
|
65
|
+
/** A replacement input for the sub-agent. */
|
|
66
|
+
modifiedInput?: unknown;
|
|
67
|
+
}
|
|
68
|
+
/** Context handed to an `onDelegationComplete` hook. */
|
|
69
|
+
export interface MastraDelegationCompleteContext extends MastraDelegationStartContext {
|
|
70
|
+
/** The sub-agent output, when the delegation succeeded. */
|
|
71
|
+
output?: unknown;
|
|
72
|
+
/** The delegation error, when it failed. */
|
|
73
|
+
error?: unknown;
|
|
74
|
+
}
|
|
75
|
+
/** Delegation hook configuration mirroring mastra's `DelegationConfig` hook subset. */
|
|
76
|
+
export interface MastraDelegationHooksConfig {
|
|
77
|
+
/** Runs before a sub-agent delegation; may deny or rewrite it. */
|
|
78
|
+
onDelegationStart?: (context: MastraDelegationStartContext) => void | MastraDelegationStartResult | Promise<void | MastraDelegationStartResult>;
|
|
79
|
+
/** Runs after a sub-agent delegation completes. */
|
|
80
|
+
onDelegationComplete?: (context: MastraDelegationCompleteContext) => void | Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
/** A scorer definition mirroring the subset of mastra `createScorer` config the scorer node mirrors. */
|
|
83
|
+
export interface MastraScorerDefinition {
|
|
84
|
+
/** The scorer id. */
|
|
85
|
+
id: string;
|
|
86
|
+
/** The scorer description. */
|
|
87
|
+
description: string;
|
|
88
|
+
/** Optional scorer name. */
|
|
89
|
+
name?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The scorer type shortcut (`'agent'`, `'traces'`, `'response'`, …) or an
|
|
92
|
+
* explicit `{ input, output }` zod pair. Passed to `createScorer` verbatim.
|
|
93
|
+
*/
|
|
94
|
+
type?: unknown;
|
|
95
|
+
}
|
|
96
|
+
/** A skill definition mirroring the subset of mastra `createSkill` input the skill node mirrors. */
|
|
97
|
+
export interface MastraSkillDefinition {
|
|
98
|
+
/** The skill name. */
|
|
99
|
+
name: string;
|
|
100
|
+
/** The skill description. */
|
|
101
|
+
description?: string;
|
|
102
|
+
/** The skill instructions/body. */
|
|
103
|
+
instructions?: string;
|
|
104
|
+
}
|
|
105
|
+
/** Sandbox isolation mode mirroring mastra `LocalSandboxOptions['isolation']`. */
|
|
106
|
+
export type MastraSandboxIsolation = "none" | "seatbelt" | "bwrap";
|
|
107
|
+
/** A sandbox definition mirroring the subset of mastra `LocalSandboxOptions` the sandbox node mirrors. */
|
|
108
|
+
export interface MastraSandboxDefinition {
|
|
109
|
+
/** The sandbox working directory. */
|
|
110
|
+
workingDirectory?: string;
|
|
111
|
+
/** The isolation mode. */
|
|
112
|
+
isolation?: MastraSandboxIsolation;
|
|
113
|
+
/** The sandbox command timeout, in milliseconds (ceiling-clamped by the node). */
|
|
114
|
+
timeoutMs?: number;
|
|
115
|
+
/** Extra environment variables for the sandbox process. */
|
|
116
|
+
env?: Record<string, string>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Builds the real mastra tool from a resolved definition.
|
|
120
|
+
*
|
|
121
|
+
* Uses the real `@mastra/core` `createTool` factory; when the definition carries
|
|
122
|
+
* no executor the tool still resolves (mastra tools may omit `execute`), matching
|
|
123
|
+
* the library contract rather than inventing a fallback.
|
|
124
|
+
*
|
|
125
|
+
* @param definition - The resolved tool definition.
|
|
126
|
+
* @returns The mastra `Tool` instance.
|
|
127
|
+
*/
|
|
128
|
+
export declare function createMastraTool(definition: MastraToolDefinition): unknown;
|
|
129
|
+
/**
|
|
130
|
+
* Converts a `beforeToolCall` hook result into the boolean deny decision the
|
|
131
|
+
* hook node sub-flow produces: a result whose `proceed` is `false` denies.
|
|
132
|
+
*
|
|
133
|
+
* @param result - The hook result (or `undefined` for "no verdict").
|
|
134
|
+
* @returns `true` when the call is denied.
|
|
135
|
+
*/
|
|
136
|
+
export declare function isToolCallDenied(result: MastraBeforeToolCallResult | undefined): boolean;
|