@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,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MastraMetricsPaginator = exports.MastraMetricsStatement = void 0;
|
|
4
|
+
exports.mastraMetricsKindOf = mastraMetricsKindOf;
|
|
5
|
+
/**
|
|
6
|
+
* @module as-graph/mastra/MastraMetricsStatement
|
|
7
|
+
* @summary Dedicated Decaf statement + paginator over the mastra metrics
|
|
8
|
+
* adapter (SAA-836 S2).
|
|
9
|
+
* @description The statement builds the raw {@link MastraMetricsQuery} the
|
|
10
|
+
* read-only adapter executes against the real mastra storage, and the paginator
|
|
11
|
+
* pages its results with mastra-native pagination where the domain supports it.
|
|
12
|
+
* Both fail closed: unsupported attributes, operators, or orderings raise a
|
|
13
|
+
* `QueryError` instead of silently degrading the query.
|
|
14
|
+
*/
|
|
15
|
+
const core_1 = require("@decaf-ts/core");
|
|
16
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
17
|
+
const MastraMetricsModels_js_1 = require("./MastraMetricsModels.cjs");
|
|
18
|
+
/**
|
|
19
|
+
* Maps a metric model class onto the mastra storage kind its query targets.
|
|
20
|
+
*
|
|
21
|
+
* @param clazz - The metric model class to map.
|
|
22
|
+
* @returns The mastra storage kind (`runs`, `scores`, or `traces`).
|
|
23
|
+
* @throws {QueryError} when the class is not one of the three metric models.
|
|
24
|
+
*/
|
|
25
|
+
function mastraMetricsKindOf(clazz) {
|
|
26
|
+
if (clazz === MastraMetricsModels_js_1.MastraRunMetricModel)
|
|
27
|
+
return "runs";
|
|
28
|
+
if (clazz === MastraMetricsModels_js_1.MastraScoreMetricModel)
|
|
29
|
+
return "scores";
|
|
30
|
+
if (clazz === MastraMetricsModels_js_1.MastraTraceMetricModel)
|
|
31
|
+
return "traces";
|
|
32
|
+
throw new core_1.QueryError("Mastra metrics statements support the run, score, and trace metric models only");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The attributes a metrics statement may filter on, per kind. Anything else
|
|
36
|
+
* fails closed: there is no honest mastra storage mapping for it.
|
|
37
|
+
*/
|
|
38
|
+
const MASTRA_METRICS_FILTERABLE = {
|
|
39
|
+
runs: ["status"],
|
|
40
|
+
scores: [],
|
|
41
|
+
traces: [],
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Dedicated read-only statement over the mastra metrics adapter (SAA-836 S2).
|
|
45
|
+
*
|
|
46
|
+
* `from()` selects one of the three metric models, `where()` accepts only the
|
|
47
|
+
* documented filterable attributes of the selected kind, and `execute()`
|
|
48
|
+
* delegates to the adapter's real mastra storage read. `paginate(size)` returns
|
|
49
|
+
* a {@link MastraMetricsPaginator} that serves the query pages.
|
|
50
|
+
*/
|
|
51
|
+
class MastraMetricsStatement extends core_1.Statement {
|
|
52
|
+
/**
|
|
53
|
+
* Builds the statement over the read-only metrics adapter.
|
|
54
|
+
*
|
|
55
|
+
* @param adapter - The mastra metrics adapter the statement executes against.
|
|
56
|
+
* @param overrides - Optional adapter flag overrides.
|
|
57
|
+
*/
|
|
58
|
+
constructor(adapter, overrides) {
|
|
59
|
+
super(adapter, overrides);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Scopes the statement to one canonical workflow (mastra storage
|
|
63
|
+
* workflow_name). The caller (the metrics gateway) has already resolved the
|
|
64
|
+
* workflow's ownership; the statement only carries the scope.
|
|
65
|
+
*
|
|
66
|
+
* @param workflowId - The canonical workflow id to scope the query to.
|
|
67
|
+
* @returns This statement, for chaining.
|
|
68
|
+
*/
|
|
69
|
+
forWorkflow(workflowId) {
|
|
70
|
+
this.metricsWorkflowName = workflowId;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Narrows the statement to one mastra run (required for score and trace
|
|
75
|
+
* reads, which mastra serves per run).
|
|
76
|
+
*
|
|
77
|
+
* @param runId - The mastra run id to narrow to.
|
|
78
|
+
* @returns This statement, for chaining.
|
|
79
|
+
*/
|
|
80
|
+
forRun(runId) {
|
|
81
|
+
this.metricsRunId = runId;
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Parses the statement's single `where` condition into its query fragment.
|
|
86
|
+
* Only equality on a documented filterable attribute of the selected kind is
|
|
87
|
+
* accepted; everything else fails closed.
|
|
88
|
+
*
|
|
89
|
+
* @param condition - The decaf condition built by the statement chain.
|
|
90
|
+
* @returns The query fragment carrying the validated status filter.
|
|
91
|
+
* @throws {QueryError} when the operator is not `eq`, the attribute is not filterable for the kind, or the comparison is not a non-empty string.
|
|
92
|
+
*/
|
|
93
|
+
parseCondition(condition) {
|
|
94
|
+
const { attr1, operator, comparison } = condition;
|
|
95
|
+
// Decaf `Condition.attr(...).eq(...)` emits `Operator.EQUAL` ("EQUAL"),
|
|
96
|
+
// not the lowercase `eq`; normalize the case so the only allowlisted
|
|
97
|
+
// operator (equality) is actually reachable.
|
|
98
|
+
if (String(operator).toUpperCase() !== core_1.Operator.EQUAL) {
|
|
99
|
+
throw new core_1.QueryError(`Mastra metrics statements support equality filters only (received '${operator}')`);
|
|
100
|
+
}
|
|
101
|
+
const kind = mastraMetricsKindOf(this.fromSelector);
|
|
102
|
+
if (!MASTRA_METRICS_FILTERABLE[kind].includes(attr1)) {
|
|
103
|
+
throw new core_1.QueryError(`Mastra metrics statements do not support filtering '${String(attr1)}' for ${kind}`);
|
|
104
|
+
}
|
|
105
|
+
if (typeof comparison !== "string" || !comparison) {
|
|
106
|
+
throw new core_1.QueryError("Mastra metrics status filters require a non-empty string");
|
|
107
|
+
}
|
|
108
|
+
return { kind, workflowName: "", status: comparison };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Builds the raw {@link MastraMetricsQuery} the adapter executes. Rejects
|
|
112
|
+
* aggregations, grouping, distinct, and non-`createdAt` orderings; the
|
|
113
|
+
* workflow scope and optional run narrowing are appended to the parsed
|
|
114
|
+
* condition fragment, and decaf `limit`/`offset` map onto the mastra-native
|
|
115
|
+
* `perPage`/`page`.
|
|
116
|
+
*
|
|
117
|
+
* @returns The raw metrics query.
|
|
118
|
+
* @throws {QueryError} when the statement uses an unsupported shape.
|
|
119
|
+
*/
|
|
120
|
+
build() {
|
|
121
|
+
// Guard on presence, not truthiness: a selector-less `count()` records
|
|
122
|
+
// `countSelector = null` — `null` means "aggregation requested", so only
|
|
123
|
+
// `undefined` counts as absent.
|
|
124
|
+
if (this.countSelector !== undefined ||
|
|
125
|
+
this.countDistinctSelector !== undefined ||
|
|
126
|
+
this.minSelector !== undefined ||
|
|
127
|
+
this.maxSelector !== undefined ||
|
|
128
|
+
this.sumSelector !== undefined ||
|
|
129
|
+
this.avgSelector !== undefined ||
|
|
130
|
+
this.distinctSelector !== undefined ||
|
|
131
|
+
this.groupBySelectors?.length) {
|
|
132
|
+
throw new core_1.QueryError("Mastra metrics statements support plain reads only (no aggregations, grouping, or distinct)");
|
|
133
|
+
}
|
|
134
|
+
if (this.orderBySelectors?.length) {
|
|
135
|
+
for (const [key] of this.orderBySelectors) {
|
|
136
|
+
if (key !== "createdAt") {
|
|
137
|
+
throw new core_1.QueryError(`Mastra metrics statements support createdAt ordering only (received '${String(key)}')`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const kind = mastraMetricsKindOf(this.fromSelector);
|
|
142
|
+
const scoped = this.whereCondition
|
|
143
|
+
? this.parseCondition(this.whereCondition)
|
|
144
|
+
: { kind, workflowName: "" };
|
|
145
|
+
return {
|
|
146
|
+
...scoped,
|
|
147
|
+
workflowName: this.metricsWorkflowName ?? "",
|
|
148
|
+
...(this.metricsRunId ? { runId: this.metricsRunId } : {}),
|
|
149
|
+
...(this.limitSelector !== undefined
|
|
150
|
+
? { perPage: this.limitSelector }
|
|
151
|
+
: {}),
|
|
152
|
+
...(this.offsetSelector !== undefined
|
|
153
|
+
? { page: this.offsetSelector }
|
|
154
|
+
: {}),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.MastraMetricsStatement = MastraMetricsStatement;
|
|
159
|
+
/**
|
|
160
|
+
* Dedicated paginator over the mastra metrics adapter (SAA-836 S2). Pages are
|
|
161
|
+
* mastra-native: the paginator maps the one-indexed decaf page onto the
|
|
162
|
+
* zero-indexed mastra page and derives the record count and page total from
|
|
163
|
+
* the storage response. R7: a page never resolves to nil rows — an empty
|
|
164
|
+
* result is an empty array, never null/undefined.
|
|
165
|
+
*/
|
|
166
|
+
class MastraMetricsPaginator extends core_1.Paginator {
|
|
167
|
+
/**
|
|
168
|
+
* Builds the paginator over the read-only metrics adapter.
|
|
169
|
+
*
|
|
170
|
+
* @param adapter - The mastra metrics adapter the paginator reads through.
|
|
171
|
+
* @param query - The raw metrics query to page over.
|
|
172
|
+
* @param size - Records per page.
|
|
173
|
+
* @param clazz - The metric model class being paged.
|
|
174
|
+
*/
|
|
175
|
+
constructor(adapter, query, size, clazz) {
|
|
176
|
+
super(adapter, query, size, clazz);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Copies the raw query unmodified: the mastra query already carries the
|
|
180
|
+
* mastra-native pagination fields the adapter expects.
|
|
181
|
+
*
|
|
182
|
+
* @param rawStatement - The query the paginator was built with.
|
|
183
|
+
* @returns The prepared query.
|
|
184
|
+
*/
|
|
185
|
+
prepare(rawStatement) {
|
|
186
|
+
return { ...rawStatement };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Reads one page through the adapter's real mastra storage read.
|
|
190
|
+
*
|
|
191
|
+
* @param page - The one-indexed page number to read.
|
|
192
|
+
* @returns The page's model rows, newest first as mastra returns them.
|
|
193
|
+
* @throws {PagingError} when the page is out of the known range.
|
|
194
|
+
*/
|
|
195
|
+
async page(page = 1, ...args) {
|
|
196
|
+
if (page < 1 || !Number.isInteger(page)) {
|
|
197
|
+
throw new core_1.PagingError("Page number cannot be under 1 and must be an integer");
|
|
198
|
+
}
|
|
199
|
+
const { ctxArgs } = this.adapter["logCtx"](args, this.page);
|
|
200
|
+
const query = this.prepare(this.query);
|
|
201
|
+
const results = (await this.adapter.raw({ ...query, page: page - 1, perPage: this.size }, false, ...ctxArgs));
|
|
202
|
+
const data = results.data ?? [];
|
|
203
|
+
this._recordCount = results.count ?? data.length;
|
|
204
|
+
this._totalPages = Math.max(1, Math.ceil(this._recordCount / this.size));
|
|
205
|
+
this.validatePage(page);
|
|
206
|
+
this._currentPage = page;
|
|
207
|
+
const pkName = decorator_validation_1.Model.pk(this.clazz);
|
|
208
|
+
const bookmark = data.length
|
|
209
|
+
? data[data.length - 1][pkName]
|
|
210
|
+
: undefined;
|
|
211
|
+
this._bookmark =
|
|
212
|
+
typeof bookmark === "string" || typeof bookmark === "number"
|
|
213
|
+
? bookmark
|
|
214
|
+
: undefined;
|
|
215
|
+
return data;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
exports.MastraMetricsPaginator = MastraMetricsPaginator;
|
|
219
|
+
//# sourceMappingURL=MastraMetricsStatement.js.map
|
|
220
|
+
//# sourceMappingURL=MastraMetricsStatement.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mastra/MastraMetricsStatement.cjs","sourceRoot":"","sources":["mastra/MastraMetricsStat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BACxD,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,SAAS,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAnDD,wDAmDC;AACD,kDAAkD"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE = void 0;
|
|
4
|
+
exports.mastraSchemaFromModel = mastraSchemaFromModel;
|
|
5
|
+
exports.mastraModelFromSchema = mastraModelFromSchema;
|
|
6
|
+
const as_zod_1 = require("@decaf-ts/as-zod");
|
|
7
|
+
const GraphExecutionError_js_1 = require("./../engine/errors/GraphExecutionError.cjs");
|
|
8
|
+
/**
|
|
9
|
+
* The schema conversion failed or produced no usable schema: the model carries
|
|
10
|
+
* no convertible attributes, or the Zod schema is not an object schema that can
|
|
11
|
+
* drive structured output (SAA-836 S1).
|
|
12
|
+
*/
|
|
13
|
+
exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE = "GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE";
|
|
14
|
+
/**
|
|
15
|
+
* Converts a decaf Model constructor into the mastra Zod object schema through
|
|
16
|
+
* `@decaf-ts/as-zod` (SAA-836 S1: the single conversion path). The result is
|
|
17
|
+
* what mastra agents consume as their structured-output schema.
|
|
18
|
+
*
|
|
19
|
+
* @param model - The decaf Model constructor to convert.
|
|
20
|
+
* @returns The converted Zod object schema.
|
|
21
|
+
* @throws {GraphExecutionError} {@link GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE}
|
|
22
|
+
* when the model is not a decaf Model, or the conversion does not produce a
|
|
23
|
+
* Zod object schema.
|
|
24
|
+
*/
|
|
25
|
+
function mastraSchemaFromModel(model) {
|
|
26
|
+
if (typeof model !== "function") {
|
|
27
|
+
throw new GraphExecutionError_js_1.GraphExecutionError("A decaf model constructor is required to convert to a mastra schema", exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE);
|
|
28
|
+
}
|
|
29
|
+
let converted;
|
|
30
|
+
try {
|
|
31
|
+
converted = (0, as_zod_1.modelToZod)(model);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
throw new GraphExecutionError_js_1.GraphExecutionError(`Decaf model '${model.name ?? String(model)}' could not be converted to a mastra schema via @decaf-ts/as-zod: ${error instanceof Error ? error.message : String(error)}`, exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE);
|
|
35
|
+
}
|
|
36
|
+
if (!isZodObjectSchema(converted)) {
|
|
37
|
+
throw new GraphExecutionError_js_1.GraphExecutionError(`Decaf model '${model.name ?? String(model)}' converted to a schema that cannot drive mastra structured output`, exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE, { model: model.name });
|
|
38
|
+
}
|
|
39
|
+
return converted;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts a mastra Zod object schema back into a decaf Model constructor
|
|
43
|
+
* through `@decaf-ts/as-zod` (SAA-836 S1: the single conversion path, reverse
|
|
44
|
+
* direction).
|
|
45
|
+
*
|
|
46
|
+
* @param schema - The Zod schema to convert back.
|
|
47
|
+
* @param name - Optional decaf model name the generated constructor registers.
|
|
48
|
+
* @returns The generated decaf Model constructor.
|
|
49
|
+
* @throws {GraphExecutionError} {@link GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE}
|
|
50
|
+
* when the schema is not convertible, or the generated constructor is not a
|
|
51
|
+
* decaf Model.
|
|
52
|
+
*/
|
|
53
|
+
function mastraModelFromSchema(schema, name) {
|
|
54
|
+
if (!schema || typeof schema.parse !== "function") {
|
|
55
|
+
throw new GraphExecutionError_js_1.GraphExecutionError("A Zod schema is required to convert back to a decaf model", exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE);
|
|
56
|
+
}
|
|
57
|
+
let converted;
|
|
58
|
+
try {
|
|
59
|
+
converted = (0, as_zod_1.zodToModel)(schema, name);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
throw new GraphExecutionError_js_1.GraphExecutionError(`The mastra Zod schema could not be converted back to a decaf model via @decaf-ts/as-zod: ${error instanceof Error ? error.message : String(error)}`, exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE);
|
|
63
|
+
}
|
|
64
|
+
if (typeof converted !== "function") {
|
|
65
|
+
throw new GraphExecutionError_js_1.GraphExecutionError("The mastra Zod schema conversion produced no decaf model constructor", exports.GRAPH_MASTRA_MODEL_SCHEMA_UNAVAILABLE);
|
|
66
|
+
}
|
|
67
|
+
return converted;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Structural check that an unknown conversion result is a Zod object schema
|
|
71
|
+
* with a non-empty declared shape — the only schema shape that can drive
|
|
72
|
+
* mastra structured output.
|
|
73
|
+
*
|
|
74
|
+
* @param candidate - The conversion result to check.
|
|
75
|
+
* @returns `true` when the candidate is a Zod object schema.
|
|
76
|
+
*/
|
|
77
|
+
function isZodObjectSchema(candidate) {
|
|
78
|
+
return (!!candidate &&
|
|
79
|
+
typeof candidate === "object" &&
|
|
80
|
+
typeof candidate.parse === "function" &&
|
|
81
|
+
!!candidate.shape);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=MastraModelSchemaConverter.js.map
|
|
84
|
+
//# sourceMappingURL=MastraModelSchemaConverter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mastra/MastraModelSchemaConverter.cjs","sourceRoot":"","sources":["mastra/MastraModelSchemaConverter.js"],"names":[],"mappings":";;;AAmBA,sDAeC;AAaD,sDAeC;AA9DD,6CAA0D;AAC1D,sFAAgF;AAChF;;;;GAIG;AACU,QAAA,qCAAqC,GAAG,uCAAuC,CAAC;AAC7F;;;;;;;;;;GAUG;AACH,SAAgB,qBAAqB,CAAC,KAAK;IACvC,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAC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,EAAE,EAAE,6CAAqC,CAAC,CAAC;IAC/N,CAAC;IACD,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;QAClC,MAAM,IAAI,4CAAmB,CAAC,sEAAsE,EAAE,6CAAqC,CAAC,CAAC;IACjJ,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AACD;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,SAAS;IAChC,OAAO,CAAC,CAAC,CAAC,SAAS;QACf,OAAO,SAAS,KAAK,QAAQ;QAC7B,OAAO,SAAS,CAAC,KAAK,KAAK,UAAU;QACrC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AACD,sDAAsD"}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DecafNodeObservabilityExporter = exports.MASTRA_DECAF_NODE_ORIGIN_KEY = exports.GRAPH_MASTRA_OBSERVABILITY_RUNTIME_METHOD = void 0;
|
|
4
|
+
exports.resolveMastraObservabilityConfig = resolveMastraObservabilityConfig;
|
|
5
|
+
exports.decafNodeOriginOf = decafNodeOriginOf;
|
|
6
|
+
exports.wireMastraObservability = wireMastraObservability;
|
|
7
|
+
/**
|
|
8
|
+
* @module as-graph/mastra/MastraObservability
|
|
9
|
+
* @summary The mastra engine observability layer with the langfuse default
|
|
10
|
+
* target and the OUR-node isolation exporter (SAA-836 O1).
|
|
11
|
+
* @description Mastra observability is configured **on the mastra engine**:
|
|
12
|
+
* the mastra runtime's own observability entrypoint catches every signal the
|
|
13
|
+
* engine emits (workflow runs/steps, agent runs, model generations, tool
|
|
14
|
+
* calls, logs, metrics, scores) and exports them, by default and always, to
|
|
15
|
+
* the deployed langfuse target through mastra's official
|
|
16
|
+
* `@mastra/langfuse` exporter. On top of the engine-wide export, the decaf
|
|
17
|
+
* node observability exporter implements OUR observability layer: it receives
|
|
18
|
+
* every exported event, attributes each trace to the canonical graph node it
|
|
19
|
+
* belongs to (the compiler stamps a `decafNode` origin onto every mastra step
|
|
20
|
+
* it translates), and scopes OUR-node signals separately from engine-internal
|
|
21
|
+
* signals, so OUR nodes remain isolatable in OUR observability while mastra
|
|
22
|
+
* catches everything on its engine.
|
|
23
|
+
*
|
|
24
|
+
* Wiring is environment-driven (SAA-836 S1/O1): `MASTRA__OBSERVABILITY__*`
|
|
25
|
+
* carries the non-secret config from `.env`; the langfuse credentials are
|
|
26
|
+
* referenced **by name only** from the user-supplied `.env.secret` (tracked
|
|
27
|
+
* `.env.secret.template`, gate C) and the layer **fails closed** when they
|
|
28
|
+
* are missing — no unauthenticated trace export is ever attempted.
|
|
29
|
+
*
|
|
30
|
+
* R2 justification (direct-library wrap): trace export to langfuse has no
|
|
31
|
+
* decaf-service equivalent — tracing spans are a mastra-native engine concern
|
|
32
|
+
* — so the mastra-official `@mastra/observability` registry and
|
|
33
|
+
* `@mastra/langfuse` exporter are wrapped directly instead of reimplementing
|
|
34
|
+
* an OTel exporter inside decaf.
|
|
35
|
+
*/
|
|
36
|
+
const logging_1 = require("@decaf-ts/logging");
|
|
37
|
+
// SAA-836 O1 (R2 wrap justification recorded in the module docs): mastra's
|
|
38
|
+
// official observability registry and langfuse exporter are wrapped directly —
|
|
39
|
+
// trace export has no decaf-service equivalent. Static imports keep the C11
|
|
40
|
+
// no-dynamic-import invariant for src/mastra/**.
|
|
41
|
+
const langfuse_1 = require("@mastra/langfuse");
|
|
42
|
+
const observability_1 = require("@mastra/observability");
|
|
43
|
+
const MastraEnvironment_js_1 = require("./MastraEnvironment.cjs");
|
|
44
|
+
/** The mastra runtime surface the observability layer attaches through
|
|
45
|
+
* (`@mastra/core`'s `Mastra.registerExporter`). Real mastra runtimes always
|
|
46
|
+
* expose it; duck-typed test doubles do not, and for those the wiring is
|
|
47
|
+
* skipped so the general engine keeps booting them unchanged.
|
|
48
|
+
*/
|
|
49
|
+
exports.GRAPH_MASTRA_OBSERVABILITY_RUNTIME_METHOD = "registerExporter";
|
|
50
|
+
/** Canonical attribute key the compiler stamps onto every translated mastra
|
|
51
|
+
* step so exported spans carry the OUR-node origin. */
|
|
52
|
+
exports.MASTRA_DECAF_NODE_ORIGIN_KEY = "decafNode";
|
|
53
|
+
/**
|
|
54
|
+
* Reads the mastra observability configuration from the accumulated mastra
|
|
55
|
+
* environment (the `MASTRA__OBSERVABILITY__*` overrides are already applied by
|
|
56
|
+
* {@link MastraEnvironment}).
|
|
57
|
+
*
|
|
58
|
+
* @returns The resolved observability configuration.
|
|
59
|
+
*/
|
|
60
|
+
function resolveMastraObservabilityConfig() {
|
|
61
|
+
const source = MastraEnvironment_js_1.MastraEnvironment.mastra.observability;
|
|
62
|
+
return {
|
|
63
|
+
enabled: source.enabled,
|
|
64
|
+
serviceName: source.serviceName || "as-graph-mastra",
|
|
65
|
+
environment: source.environment ?? "",
|
|
66
|
+
langfuse: {
|
|
67
|
+
endpoint: source.langfuse.endpoint || MastraEnvironment_js_1.MASTRA_DEFAULT_LANGFUSE_ENDPOINT,
|
|
68
|
+
publicKeyEnv: source.langfuse.publicKeyEnv || "LANGFUSE_PUBLIC_KEY",
|
|
69
|
+
secretKeyEnv: source.langfuse.secretKeyEnv || "LANGFUSE_SECRET_KEY",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolves the OUR-node origin an exported span carries **by metadata**, when
|
|
75
|
+
* any. The origin is stamped by the workflow compiler under
|
|
76
|
+
* {@link MASTRA_DECAF_NODE_ORIGIN_KEY} on the step's entry metadata.
|
|
77
|
+
*
|
|
78
|
+
* @param span - The exported span to classify.
|
|
79
|
+
* @returns The OUR-node origin, or `undefined` for engine-internal spans.
|
|
80
|
+
*/
|
|
81
|
+
function decafNodeOriginOf(span) {
|
|
82
|
+
if (!span)
|
|
83
|
+
return undefined;
|
|
84
|
+
const attributes = span.attributes;
|
|
85
|
+
if (attributes && typeof attributes === "object") {
|
|
86
|
+
const entryMetadata = attributes["entryMetadata"];
|
|
87
|
+
if (entryMetadata && typeof entryMetadata === "object") {
|
|
88
|
+
const origin = entryMetadata[exports.MASTRA_DECAF_NODE_ORIGIN_KEY];
|
|
89
|
+
if (origin &&
|
|
90
|
+
typeof origin === "object" &&
|
|
91
|
+
typeof origin["id"] === "string" &&
|
|
92
|
+
typeof origin["kind"] === "string") {
|
|
93
|
+
return origin;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
/** Mastra names every `WORKFLOW_STEP` span `workflow step: '<stepId>'`, where
|
|
100
|
+
* the step id is the canonical node id the compiler translated. */
|
|
101
|
+
const MASTRA_WORKFLOW_STEP_NAME_PATTERN = /^workflow step: '(.+)'$/;
|
|
102
|
+
/**
|
|
103
|
+
* The OUR-node isolation exporter (SAA-836 O1). Implements mastra's
|
|
104
|
+
* `ObservabilityExporter` contract on top of OUR observability layer: every
|
|
105
|
+
* event the mastra engine exports is received here and logged through the
|
|
106
|
+
* decaf logger, attributed to the canonical graph node it belongs to when the
|
|
107
|
+
* span carries the compiler-stamped `decafNode` origin — so OUR-node signals
|
|
108
|
+
* are isolatable in OUR observability (`decaf-node` scope) from
|
|
109
|
+
* engine-internal signals (`decaf-engine` scope) while mastra still catches
|
|
110
|
+
* everything on its engine.
|
|
111
|
+
*
|
|
112
|
+
* The exporter never throws into the engine's export pipeline: a logging
|
|
113
|
+
* failure is swallowed so observability cannot break a run.
|
|
114
|
+
*/
|
|
115
|
+
class DecafNodeObservabilityExporter {
|
|
116
|
+
constructor(logger) {
|
|
117
|
+
/** The exporter name mastra registers. */
|
|
118
|
+
this.name = "decaf-node-observability";
|
|
119
|
+
/** Canonical node origins known to the isolation classifier, keyed by node
|
|
120
|
+
* id. The backend tracks the executed document's nodes per run. */
|
|
121
|
+
this.knownNodes = new Map();
|
|
122
|
+
this.logger = logger ?? logging_1.Logging.for("MastraObservability");
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Tracks the canonical nodes of a document about to run, so the isolation
|
|
126
|
+
* classifier can attribute mastra's `workflow step: '<stepId>'` spans (the
|
|
127
|
+
* step id is the canonical node id) to their OUR-node origin.
|
|
128
|
+
*
|
|
129
|
+
* @param nodes - The canonical nodes of the document being executed.
|
|
130
|
+
*/
|
|
131
|
+
trackNodes(nodes) {
|
|
132
|
+
for (const node of nodes) {
|
|
133
|
+
this.knownNodes.set(node.id, { id: node.id, kind: node.kind });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Classifies an exported span: the OUR-node origin when the span belongs to
|
|
138
|
+
* a canonical graph node (via the compiler-stamped entry metadata or a
|
|
139
|
+
* mastra workflow-step span naming a tracked canonical node id),
|
|
140
|
+
* `undefined` for engine-internal spans.
|
|
141
|
+
*
|
|
142
|
+
* @param span - The exported span to classify.
|
|
143
|
+
* @returns The OUR-node origin, or `undefined`.
|
|
144
|
+
*/
|
|
145
|
+
originOf(span) {
|
|
146
|
+
const byMetadata = decafNodeOriginOf(span);
|
|
147
|
+
if (byMetadata)
|
|
148
|
+
return byMetadata;
|
|
149
|
+
const name = span?.name;
|
|
150
|
+
if (typeof name !== "string")
|
|
151
|
+
return undefined;
|
|
152
|
+
const match = MASTRA_WORKFLOW_STEP_NAME_PATTERN.exec(name);
|
|
153
|
+
if (!match)
|
|
154
|
+
return undefined;
|
|
155
|
+
return this.knownNodes.get(match[1]);
|
|
156
|
+
}
|
|
157
|
+
/** The engine-scope logger for signals without an OUR-node origin. */
|
|
158
|
+
engineFor(span) {
|
|
159
|
+
if (!this.originOf(span)) {
|
|
160
|
+
return this.logger.for({ scope: "decaf-engine" });
|
|
161
|
+
}
|
|
162
|
+
return this.logger.for({ scope: "decaf-node" });
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Exports a tracing event into OUR observability layer, attributed to the
|
|
166
|
+
* canonical node when the span belongs to one.
|
|
167
|
+
*
|
|
168
|
+
* @param event - The tracing event mastra's export pipeline emitted.
|
|
169
|
+
*/
|
|
170
|
+
async exportTracingEvent(event) {
|
|
171
|
+
try {
|
|
172
|
+
const span = event.exportedSpan;
|
|
173
|
+
const origin = this.originOf(span);
|
|
174
|
+
const logger = this.engineFor(span).for({
|
|
175
|
+
spanType: span?.type,
|
|
176
|
+
...(span?.traceId ? { traceId: span.traceId } : {}),
|
|
177
|
+
...(span?.id ? { spanId: span.id } : {}),
|
|
178
|
+
...(origin ? { nodeId: origin.id, nodeKind: origin.kind } : {}),
|
|
179
|
+
});
|
|
180
|
+
logger.info(`[mastra-observability] ${event.type} ${span?.name ?? "<unknown>"}${origin ? ` (node ${origin.id}, kind ${origin.kind})` : ""}`);
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
// OUR observability must never break the engine's export pipeline.
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** Aliased mastra tracing-event hook (pipeline calls both spellings). */
|
|
187
|
+
async onTracingEvent(event) {
|
|
188
|
+
await this.exportTracingEvent(event);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Exports a log event into OUR observability layer.
|
|
192
|
+
*
|
|
193
|
+
* @param event - The log event mastra's export pipeline emitted.
|
|
194
|
+
*/
|
|
195
|
+
async onLogEvent(event) {
|
|
196
|
+
try {
|
|
197
|
+
this.logger.for({ scope: "decaf-engine", signal: "log" }).info(`[mastra-observability] log ${JSON.stringify(event?.message ?? event)}`);
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
// Never break the export pipeline.
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Exports a metric event into OUR observability layer.
|
|
205
|
+
*
|
|
206
|
+
* @param event - The metric event mastra's export pipeline emitted.
|
|
207
|
+
*/
|
|
208
|
+
async onMetricEvent(event) {
|
|
209
|
+
try {
|
|
210
|
+
this.logger
|
|
211
|
+
.for({ scope: "decaf-engine", signal: "metric" })
|
|
212
|
+
.info(`[mastra-observability] metric ${JSON.stringify(event)}`);
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
// Never break the export pipeline.
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Exports a score event into OUR observability layer.
|
|
220
|
+
*
|
|
221
|
+
* @param event - The score event mastra's export pipeline emitted.
|
|
222
|
+
*/
|
|
223
|
+
async onScoreEvent(event) {
|
|
224
|
+
try {
|
|
225
|
+
this.logger
|
|
226
|
+
.for({ scope: "decaf-engine", signal: "score" })
|
|
227
|
+
.info(`[mastra-observability] score ${JSON.stringify(event)}`);
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// Never break the export pipeline.
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Exports an exporter-pipeline drop event into OUR observability layer.
|
|
235
|
+
*
|
|
236
|
+
* @param event - The drop event mastra's export pipeline emitted.
|
|
237
|
+
*/
|
|
238
|
+
async onDroppedEvent(event) {
|
|
239
|
+
try {
|
|
240
|
+
this.logger
|
|
241
|
+
.for({ scope: "decaf-engine", signal: "drop" })
|
|
242
|
+
.warn(`[mastra-observability] dropped ${JSON.stringify(event)}`);
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
// Never break the export pipeline.
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/** No buffered state: flush resolves immediately. */
|
|
249
|
+
async flush() {
|
|
250
|
+
/* nothing buffered */
|
|
251
|
+
}
|
|
252
|
+
/** No external resources held: shutdown resolves immediately. */
|
|
253
|
+
async shutdown() {
|
|
254
|
+
/* nothing to release */
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
exports.DecafNodeObservabilityExporter = DecafNodeObservabilityExporter;
|
|
258
|
+
/**
|
|
259
|
+
* Wires the mastra observability layer onto a real mastra runtime
|
|
260
|
+
* (SAA-836 O1). When the observability lane is disabled, or when the runtime
|
|
261
|
+
* exposes no mastra `registerExporter` surface (a duck-typed test double,
|
|
262
|
+
* never a real `@mastra/core` runtime), the runtime is left untouched and
|
|
263
|
+
* `undefined` is returned. When enabled on a mastra-native runtime, wiring
|
|
264
|
+
* fails closed on credentials: without the user-supplied langfuse
|
|
265
|
+
* `.env.secret` credentials the layer throws
|
|
266
|
+
* {@link GRAPH_MASTRA_OBSERVABILITY_CREDENTIALS_UNAVAILABLE} (gate C) —
|
|
267
|
+
* langfuse is the default and always-present target, so no degraded
|
|
268
|
+
* unauthenticated export path exists.
|
|
269
|
+
*
|
|
270
|
+
* The langfuse exporter is mastra's official `@mastra/langfuse`
|
|
271
|
+
* `LangfuseExporter` (R2 wrap justification recorded in the module docs). The
|
|
272
|
+
* OUR-node isolation exporter is registered alongside it so OUR nodes stay
|
|
273
|
+
* isolatable in OUR observability layer.
|
|
274
|
+
*
|
|
275
|
+
* @param runtime - The wired mastra runtime (a real `@mastra/core` `Mastra`).
|
|
276
|
+
* @param env - The runtime environment bag the credentials are read from;
|
|
277
|
+
* defaults to `process.env`.
|
|
278
|
+
* @returns The observability handle, or `undefined` when the lane is disabled
|
|
279
|
+
* or the runtime is not mastra-native.
|
|
280
|
+
* @throws {GraphExecutionError} when the lane is enabled on a mastra-native
|
|
281
|
+
* runtime but the langfuse credentials are unavailable.
|
|
282
|
+
*/
|
|
283
|
+
async function wireMastraObservability(runtime, env = globalThis.process?.env ?? {}) {
|
|
284
|
+
const config = resolveMastraObservabilityConfig();
|
|
285
|
+
if (!config.enabled)
|
|
286
|
+
return undefined;
|
|
287
|
+
if (!runtime ||
|
|
288
|
+
typeof runtime[exports.GRAPH_MASTRA_OBSERVABILITY_RUNTIME_METHOD] !== "function") {
|
|
289
|
+
return undefined;
|
|
290
|
+
}
|
|
291
|
+
// Gate C: fail closed without the user-supplied langfuse credentials. The
|
|
292
|
+
// resolved names are returned; the values are only read into the exporter.
|
|
293
|
+
const credentials = (0, MastraEnvironment_js_1.assertMastraObservabilityCredentials)(env);
|
|
294
|
+
const decafExporter = new DecafNodeObservabilityExporter();
|
|
295
|
+
const langfuseExporter = new langfuse_1.LangfuseExporter({
|
|
296
|
+
// Gate C: the credential values are read from the user-supplied
|
|
297
|
+
// `.env.secret` here and handed straight to the exporter; they are never
|
|
298
|
+
// logged, persisted, or held elsewhere in the graph layer.
|
|
299
|
+
publicKey: env[credentials.publicKeyEnv],
|
|
300
|
+
secretKey: env[credentials.secretKeyEnv],
|
|
301
|
+
baseUrl: config.langfuse.endpoint,
|
|
302
|
+
...(config.environment ? { environment: config.environment } : {}),
|
|
303
|
+
});
|
|
304
|
+
const registry = new observability_1.Observability({
|
|
305
|
+
configs: {},
|
|
306
|
+
});
|
|
307
|
+
const instance = new observability_1.DefaultObservabilityInstance({
|
|
308
|
+
name: "default",
|
|
309
|
+
serviceName: config.serviceName,
|
|
310
|
+
exporters: [],
|
|
311
|
+
});
|
|
312
|
+
// Bootstrap the real entrypoint over the runtime's no-op default, then add
|
|
313
|
+
// both exporters to the resulting default instance. The first call
|
|
314
|
+
// bootstraps (no-op → entrypoint, instance registered as default) and adds
|
|
315
|
+
// the langfuse exporter; the second adds the OUR-node exporter to the now
|
|
316
|
+
// real default instance.
|
|
317
|
+
const register = runtime["registerExporter"];
|
|
318
|
+
register.call(runtime, langfuseExporter, instance, registry);
|
|
319
|
+
register.call(runtime, decafExporter, instance, registry);
|
|
320
|
+
return {
|
|
321
|
+
decafExporter,
|
|
322
|
+
flush: async () => {
|
|
323
|
+
for (const exporter of [langfuseExporter, decafExporter]) {
|
|
324
|
+
await exporter.flush?.();
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
shutdown: async () => {
|
|
328
|
+
for (const exporter of [langfuseExporter, decafExporter]) {
|
|
329
|
+
await exporter.shutdown?.();
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
//# sourceMappingURL=MastraObservability.js.map
|
|
335
|
+
//# sourceMappingURL=MastraObservability.cjs.map
|
|
@@ -0,0 +1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