@mastra/core 1.4.0 → 1.5.0-alpha.1
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/CHANGELOG.md +368 -0
- package/dist/agent/agent.d.ts +3 -2
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/conversion/output-converter.d.ts.map +1 -1
- package/dist/agent/message-list/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/merge/MessageMerger.d.ts.map +1 -1
- package/dist/agent/message-list/message-list.d.ts.map +1 -1
- package/dist/agent/types.d.ts +2 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +1 -0
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +1 -0
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +8 -0
- package/dist/agent/workflows/prepare-stream/schema.d.ts.map +1 -1
- package/dist/{chunk-Y3TQ52UE.js → chunk-33TGTTTS.js} +4 -3
- package/dist/chunk-33TGTTTS.js.map +1 -0
- package/dist/{chunk-3X3CZUXI.js → chunk-3KJW4EMO.js} +660 -206
- package/dist/chunk-3KJW4EMO.js.map +1 -0
- package/dist/{chunk-YNNJLLFN.cjs → chunk-3YMDR4OL.cjs} +661 -207
- package/dist/chunk-3YMDR4OL.cjs.map +1 -0
- package/dist/{chunk-NJ7TL3LQ.js → chunk-5EOLBHHS.js} +26 -15
- package/dist/chunk-5EOLBHHS.js.map +1 -0
- package/dist/{chunk-RZ4CIIZR.js → chunk-6DUTLERJ.js} +4 -4
- package/dist/{chunk-RZ4CIIZR.js.map → chunk-6DUTLERJ.js.map} +1 -1
- package/dist/{chunk-VTE2OBKS.cjs → chunk-A6EWCOGA.cjs} +417 -77
- package/dist/chunk-A6EWCOGA.cjs.map +1 -0
- package/dist/{chunk-4XSAZPPS.js → chunk-A7V2NSY3.js} +313 -137
- package/dist/chunk-A7V2NSY3.js.map +1 -0
- package/dist/{chunk-FLPEGTEK.js → chunk-AIRMLZ43.js} +5 -5
- package/dist/{chunk-FLPEGTEK.js.map → chunk-AIRMLZ43.js.map} +1 -1
- package/dist/{chunk-DBSVT6AR.cjs → chunk-BKQAP27M.cjs} +9 -9
- package/dist/{chunk-DBSVT6AR.cjs.map → chunk-BKQAP27M.cjs.map} +1 -1
- package/dist/{chunk-RS6CZXGA.js → chunk-BQHWJLXU.js} +15 -4
- package/dist/chunk-BQHWJLXU.js.map +1 -0
- package/dist/{chunk-V2MLGA7T.js → chunk-CXVMDV2B.js} +417 -78
- package/dist/chunk-CXVMDV2B.js.map +1 -0
- package/dist/{chunk-NKYWDNCI.cjs → chunk-E2FHTXAI.cjs} +7 -7
- package/dist/{chunk-NKYWDNCI.cjs.map → chunk-E2FHTXAI.cjs.map} +1 -1
- package/dist/{chunk-7UWHFWST.cjs → chunk-EAZ6YDCQ.cjs} +15 -3
- package/dist/chunk-EAZ6YDCQ.cjs.map +1 -0
- package/dist/{chunk-64WGYTQK.cjs → chunk-FTBLAVTF.cjs} +55 -55
- package/dist/{chunk-64WGYTQK.cjs.map → chunk-FTBLAVTF.cjs.map} +1 -1
- package/dist/{chunk-4EHGOATH.js → chunk-FZ5DRHKE.js} +1337 -547
- package/dist/chunk-FZ5DRHKE.js.map +1 -0
- package/dist/{chunk-4TQ4EBYX.js → chunk-GEDGDKQ6.js} +9 -9
- package/dist/chunk-GEDGDKQ6.js.map +1 -0
- package/dist/{chunk-QTTWRCB5.js → chunk-I3AWF54W.js} +5 -5
- package/dist/{chunk-QTTWRCB5.js.map → chunk-I3AWF54W.js.map} +1 -1
- package/dist/{chunk-U2HKJZCI.js → chunk-IBNCZTNQ.js} +6 -6
- package/dist/{chunk-U2HKJZCI.js.map → chunk-IBNCZTNQ.js.map} +1 -1
- package/dist/{chunk-3JVFFAJX.cjs → chunk-IJIE3ZID.cjs} +27 -16
- package/dist/chunk-IJIE3ZID.cjs.map +1 -0
- package/dist/{chunk-NZG2JAKS.cjs → chunk-JWG272ZZ.cjs} +19 -19
- package/dist/chunk-JWG272ZZ.cjs.map +1 -0
- package/dist/{chunk-BP7VYTOP.cjs → chunk-JZ6TH4HQ.cjs} +954 -401
- package/dist/chunk-JZ6TH4HQ.cjs.map +1 -0
- package/dist/{chunk-SU5APAM6.cjs → chunk-KNXZ7KYL.cjs} +94 -6
- package/dist/chunk-KNXZ7KYL.cjs.map +1 -0
- package/dist/{chunk-CYUP7QWT.cjs → chunk-KRAGJ433.cjs} +4 -3
- package/dist/chunk-KRAGJ433.cjs.map +1 -0
- package/dist/{chunk-XDD5V446.cjs → chunk-MDC6VYA6.cjs} +6 -2
- package/dist/{chunk-XDD5V446.cjs.map → chunk-MDC6VYA6.cjs.map} +1 -1
- package/dist/{chunk-AXHBJ4GX.js → chunk-NN26FSKL.js} +10 -8
- package/dist/chunk-NN26FSKL.js.map +1 -0
- package/dist/{chunk-AY6DBRS3.js → chunk-OHLVZVIK.js} +36 -2
- package/dist/chunk-OHLVZVIK.js.map +1 -0
- package/dist/{chunk-5Q5Y34SS.js → chunk-PECKKR4C.js} +4 -4
- package/dist/{chunk-5Q5Y34SS.js.map → chunk-PECKKR4C.js.map} +1 -1
- package/dist/{chunk-HYRYTTMT.cjs → chunk-PHHJLGZU.cjs} +9 -9
- package/dist/{chunk-HYRYTTMT.cjs.map → chunk-PHHJLGZU.cjs.map} +1 -1
- package/dist/{chunk-65PHUUMF.cjs → chunk-QDH6MVJ7.cjs} +24 -22
- package/dist/chunk-QDH6MVJ7.cjs.map +1 -0
- package/dist/{chunk-VD5YA6RH.cjs → chunk-QSN5KQXZ.cjs} +18 -18
- package/dist/{chunk-VD5YA6RH.cjs.map → chunk-QSN5KQXZ.cjs.map} +1 -1
- package/dist/{chunk-4IJ4UDZX.cjs → chunk-RH2K66O2.cjs} +399 -223
- package/dist/chunk-RH2K66O2.cjs.map +1 -0
- package/dist/{chunk-4KFEMXTV.cjs → chunk-S4VVZI4E.cjs} +1361 -546
- package/dist/chunk-S4VVZI4E.cjs.map +1 -0
- package/dist/{chunk-ZATLLPIH.js → chunk-TPDMP7OD.js} +6 -2
- package/dist/chunk-TPDMP7OD.js.map +1 -0
- package/dist/{chunk-PS5ONCXY.js → chunk-UZFGMMKU.js} +82 -4
- package/dist/chunk-UZFGMMKU.js.map +1 -0
- package/dist/{chunk-7NKUSQEV.js → chunk-YIN5F7VO.js} +936 -389
- package/dist/chunk-YIN5F7VO.js.map +1 -0
- package/dist/{chunk-CZ4NQANZ.cjs → chunk-YW54RH77.cjs} +36 -2
- package/dist/chunk-YW54RH77.cjs.map +1 -0
- package/dist/datasets/experiment/executor.d.ts.map +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +27 -1
- package/dist/docs/assets/SOURCE_MAP.json +463 -389
- package/dist/docs/references/docs-agents-processors.md +52 -0
- package/dist/docs/references/docs-observability-datasets-overview.md +188 -0
- package/dist/docs/references/docs-observability-datasets-running-experiments.md +266 -0
- package/dist/docs/references/docs-observability-tracing-exporters-cloud.md +7 -4
- package/dist/docs/references/reference-agents-generate.md +1 -1
- package/dist/docs/references/reference-configuration.md +3 -4
- package/dist/docs/references/reference-datasets-addItem.md +35 -0
- package/dist/docs/references/reference-datasets-addItems.md +33 -0
- package/dist/docs/references/reference-datasets-compareExperiments.md +48 -0
- package/dist/docs/references/reference-datasets-create.md +49 -0
- package/dist/docs/references/reference-datasets-dataset.md +78 -0
- package/dist/docs/references/reference-datasets-datasets-manager.md +84 -0
- package/dist/docs/references/reference-datasets-delete.md +23 -0
- package/dist/docs/references/reference-datasets-deleteExperiment.md +25 -0
- package/dist/docs/references/reference-datasets-deleteItem.md +25 -0
- package/dist/docs/references/reference-datasets-deleteItems.md +27 -0
- package/dist/docs/references/reference-datasets-get.md +29 -0
- package/dist/docs/references/reference-datasets-getDetails.md +45 -0
- package/dist/docs/references/reference-datasets-getExperiment.md +28 -0
- package/dist/docs/references/reference-datasets-getItem.md +31 -0
- package/dist/docs/references/reference-datasets-getItemHistory.md +29 -0
- package/dist/docs/references/reference-datasets-list.md +29 -0
- package/dist/docs/references/reference-datasets-listExperimentResults.md +37 -0
- package/dist/docs/references/reference-datasets-listExperiments.md +31 -0
- package/dist/docs/references/reference-datasets-listItems.md +44 -0
- package/dist/docs/references/reference-datasets-listVersions.md +31 -0
- package/dist/docs/references/reference-datasets-startExperiment.md +60 -0
- package/dist/docs/references/reference-datasets-startExperimentAsync.md +41 -0
- package/dist/docs/references/reference-datasets-update.md +46 -0
- package/dist/docs/references/reference-datasets-updateItem.md +36 -0
- package/dist/docs/references/reference-memory-observational-memory.md +36 -0
- package/dist/docs/references/reference-processors-processor-interface.md +4 -0
- package/dist/docs/references/reference-tools-create-tool.md +1 -1
- package/dist/docs/references/reference.md +24 -0
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/types.d.ts +108 -2
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/evals/index.cjs +20 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/harness/harness.d.ts +281 -0
- package/dist/harness/harness.d.ts.map +1 -0
- package/dist/harness/index.cjs +1728 -0
- package/dist/harness/index.cjs.map +1 -0
- package/dist/harness/index.d.ts +4 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +1723 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/tools.d.ts +65 -0
- package/dist/harness/tools.d.ts.map +1 -0
- package/dist/harness/types.d.ts +561 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +20 -20
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/gateways/constants.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts +2 -3
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +312 -93
- package/dist/loop/index.cjs +12 -12
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/test-utils/tools.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +3 -3
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +10 -0
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/types.d.ts +24 -0
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-BW2GAM3K.cjs +12 -0
- package/dist/{models-dev-PPIXUUCU.cjs.map → models-dev-BW2GAM3K.cjs.map} +1 -1
- package/dist/models-dev-MDI5E2YA.js +3 -0
- package/dist/{models-dev-FQVUTQ7L.js.map → models-dev-MDI5E2YA.js.map} +1 -1
- package/dist/observability/index.cjs +11 -11
- package/dist/observability/index.js +1 -1
- package/dist/observability/utils.d.ts.map +1 -1
- package/dist/processors/index.cjs +41 -41
- package/dist/processors/index.js +1 -1
- package/dist/processors/processors/skills.d.ts +5 -0
- package/dist/processors/processors/skills.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +2 -2
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/processors/step-schema.d.ts +218 -49453
- package/dist/processors/step-schema.d.ts.map +1 -1
- package/dist/provider-registry-4PH2JPIA.cjs +40 -0
- package/dist/{provider-registry-6LZAGQET.cjs.map → provider-registry-4PH2JPIA.cjs.map} +1 -1
- package/dist/provider-registry-VEJ3PN4S.js +3 -0
- package/dist/{provider-registry-QUNT7S55.js.map → provider-registry-VEJ3PN4S.js.map} +1 -1
- package/dist/provider-registry.json +657 -203
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/server/composite-auth.d.ts.map +1 -1
- package/dist/server/index.cjs +6 -1
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +6 -1
- package/dist/server/index.js.map +1 -1
- package/dist/storage/base.d.ts +4 -1
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.cjs +82 -42
- package/dist/storage/constants.d.ts +11 -1
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/blobs/base.d.ts +47 -0
- package/dist/storage/domains/blobs/base.d.ts.map +1 -0
- package/dist/storage/domains/blobs/index.d.ts +3 -0
- package/dist/storage/domains/blobs/index.d.ts.map +1 -0
- package/dist/storage/domains/blobs/inmemory.d.ts +17 -0
- package/dist/storage/domains/blobs/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/datasets/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/index.d.ts +3 -0
- package/dist/storage/domains/index.d.ts.map +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +7 -1
- package/dist/storage/domains/inmemory-db.d.ts.map +1 -1
- package/dist/storage/domains/mcp-clients/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/prompt-blocks/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/scorer-definitions/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/skills/base.d.ts +47 -0
- package/dist/storage/domains/skills/base.d.ts.map +1 -0
- package/dist/storage/domains/skills/index.d.ts +3 -0
- package/dist/storage/domains/skills/index.d.ts.map +1 -0
- package/dist/storage/domains/skills/inmemory.d.ts +31 -0
- package/dist/storage/domains/skills/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/versioned.d.ts +12 -3
- package/dist/storage/domains/versioned.d.ts.map +1 -1
- package/dist/storage/domains/workspaces/base.d.ts +47 -0
- package/dist/storage/domains/workspaces/base.d.ts.map +1 -0
- package/dist/storage/domains/workspaces/index.d.ts +3 -0
- package/dist/storage/domains/workspaces/index.d.ts.map +1 -0
- package/dist/storage/domains/workspaces/inmemory.d.ts +31 -0
- package/dist/storage/domains/workspaces/inmemory.d.ts.map +1 -0
- package/dist/storage/index.cjs +202 -138
- package/dist/storage/index.js +2 -2
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +422 -12
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/tools/index.cjs +8 -4
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/tool.d.ts +13 -0
- package/dist/tools/tool.d.ts.map +1 -1
- package/dist/tools/toolchecks.d.ts.map +1 -1
- package/dist/tools/types.d.ts +24 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/types/zod-compat.d.ts +27 -6
- package/dist/types/zod-compat.d.ts.map +1 -1
- package/dist/utils.cjs +23 -23
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +12 -12
- package/dist/vector/index.js +2 -2
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/handlers/entry.d.ts.map +1 -1
- package/dist/workflows/index.cjs +25 -25
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/workflow.d.ts +2 -2
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/dist/workspace/constants/index.d.ts +1 -0
- package/dist/workspace/constants/index.d.ts.map +1 -1
- package/dist/workspace/errors.d.ts +3 -0
- package/dist/workspace/errors.d.ts.map +1 -1
- package/dist/workspace/filesystem/composite-filesystem.d.ts +75 -6
- package/dist/workspace/filesystem/composite-filesystem.d.ts.map +1 -1
- package/dist/workspace/filesystem/local-filesystem.d.ts +42 -0
- package/dist/workspace/filesystem/local-filesystem.d.ts.map +1 -1
- package/dist/workspace/glob.d.ts +61 -0
- package/dist/workspace/glob.d.ts.map +1 -0
- package/dist/workspace/index.cjs +133 -41
- package/dist/workspace/index.d.ts +8 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/sandbox/local-sandbox.d.ts.map +1 -1
- package/dist/workspace/skills/composite-versioned-skill-source.d.ts +44 -0
- package/dist/workspace/skills/composite-versioned-skill-source.d.ts.map +1 -0
- package/dist/workspace/skills/index.d.ts +3 -0
- package/dist/workspace/skills/index.d.ts.map +1 -1
- package/dist/workspace/skills/local-skill-source.d.ts.map +1 -1
- package/dist/workspace/skills/publish.d.ts +34 -0
- package/dist/workspace/skills/publish.d.ts.map +1 -0
- package/dist/workspace/skills/skill-source.d.ts +2 -0
- package/dist/workspace/skills/skill-source.d.ts.map +1 -1
- package/dist/workspace/skills/types.d.ts +16 -0
- package/dist/workspace/skills/types.d.ts.map +1 -1
- package/dist/workspace/skills/versioned-skill-source.d.ts +20 -0
- package/dist/workspace/skills/versioned-skill-source.d.ts.map +1 -0
- package/dist/workspace/skills/workspace-skills.d.ts +5 -0
- package/dist/workspace/skills/workspace-skills.d.ts.map +1 -1
- package/dist/workspace/tools/delete-file.d.ts +5 -0
- package/dist/workspace/tools/delete-file.d.ts.map +1 -0
- package/dist/workspace/tools/edit-file.d.ts +7 -0
- package/dist/workspace/tools/edit-file.d.ts.map +1 -0
- package/dist/workspace/tools/execute-command.d.ts +7 -0
- package/dist/workspace/tools/execute-command.d.ts.map +1 -0
- package/dist/workspace/tools/file-stat.d.ts +4 -0
- package/dist/workspace/tools/file-stat.d.ts.map +1 -0
- package/dist/workspace/tools/grep.d.ts +9 -0
- package/dist/workspace/tools/grep.d.ts.map +1 -0
- package/dist/workspace/tools/helpers.d.ts +36 -0
- package/dist/workspace/tools/helpers.d.ts.map +1 -0
- package/dist/workspace/tools/index-content.d.ts +6 -0
- package/dist/workspace/tools/index-content.d.ts.map +1 -0
- package/dist/workspace/tools/index.d.ts +13 -1
- package/dist/workspace/tools/index.d.ts.map +1 -1
- package/dist/workspace/tools/list-files.d.ts +10 -0
- package/dist/workspace/tools/list-files.d.ts.map +1 -0
- package/dist/workspace/tools/mkdir.d.ts +5 -0
- package/dist/workspace/tools/mkdir.d.ts.map +1 -0
- package/dist/workspace/tools/read-file.d.ts +8 -0
- package/dist/workspace/tools/read-file.d.ts.map +1 -0
- package/dist/workspace/tools/search.d.ts +7 -0
- package/dist/workspace/tools/search.d.ts.map +1 -0
- package/dist/workspace/tools/tools.d.ts +5 -7
- package/dist/workspace/tools/tools.d.ts.map +1 -1
- package/dist/workspace/tools/tree-formatter.d.ts +2 -0
- package/dist/workspace/tools/tree-formatter.d.ts.map +1 -1
- package/dist/workspace/tools/write-file.d.ts +6 -0
- package/dist/workspace/tools/write-file.d.ts.map +1 -0
- package/dist/workspace/workspace.d.ts +56 -10
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/harness.d.ts +1 -0
- package/package.json +8 -6
- package/src/llm/model/provider-types.generated.d.ts +312 -93
- package/dist/chunk-3JVFFAJX.cjs.map +0 -1
- package/dist/chunk-3X3CZUXI.js.map +0 -1
- package/dist/chunk-4EHGOATH.js.map +0 -1
- package/dist/chunk-4IJ4UDZX.cjs.map +0 -1
- package/dist/chunk-4KFEMXTV.cjs.map +0 -1
- package/dist/chunk-4TQ4EBYX.js.map +0 -1
- package/dist/chunk-4XSAZPPS.js.map +0 -1
- package/dist/chunk-65PHUUMF.cjs.map +0 -1
- package/dist/chunk-7NKUSQEV.js.map +0 -1
- package/dist/chunk-7UWHFWST.cjs.map +0 -1
- package/dist/chunk-AXHBJ4GX.js.map +0 -1
- package/dist/chunk-AY6DBRS3.js.map +0 -1
- package/dist/chunk-BP7VYTOP.cjs.map +0 -1
- package/dist/chunk-CYUP7QWT.cjs.map +0 -1
- package/dist/chunk-CZ4NQANZ.cjs.map +0 -1
- package/dist/chunk-NJ7TL3LQ.js.map +0 -1
- package/dist/chunk-NZG2JAKS.cjs.map +0 -1
- package/dist/chunk-PS5ONCXY.js.map +0 -1
- package/dist/chunk-RS6CZXGA.js.map +0 -1
- package/dist/chunk-SU5APAM6.cjs.map +0 -1
- package/dist/chunk-V2MLGA7T.js.map +0 -1
- package/dist/chunk-VTE2OBKS.cjs.map +0 -1
- package/dist/chunk-Y3TQ52UE.js.map +0 -1
- package/dist/chunk-YNNJLLFN.cjs.map +0 -1
- package/dist/chunk-ZATLLPIH.js.map +0 -1
- package/dist/models-dev-FQVUTQ7L.js +0 -3
- package/dist/models-dev-PPIXUUCU.cjs +0 -12
- package/dist/provider-registry-6LZAGQET.cjs +0 -40
- package/dist/provider-registry-QUNT7S55.js +0 -3
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { Agent } from '../agent/index.js';
|
|
3
|
+
import type { ToolsInput } from '../agent/types.js';
|
|
4
|
+
import type { MastraLanguageModel } from '../llm/model/shared.types.js';
|
|
5
|
+
import type { MastraMemory } from '../memory/memory.js';
|
|
6
|
+
import type { MastraCompositeStore } from '../storage/base.js';
|
|
7
|
+
import type { DynamicArgument } from '../types/index.js';
|
|
8
|
+
import type { Workspace, WorkspaceConfig, WorkspaceStatus } from '../workspace/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* A periodic task that the Harness runs on a timer.
|
|
11
|
+
* Heartbeat handlers start during `init()` and are cleaned up on `stopHeartbeats()`.
|
|
12
|
+
*/
|
|
13
|
+
export interface HeartbeatHandler {
|
|
14
|
+
/** Unique identifier for this handler (used for dedup and logging) */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Interval in milliseconds between invocations */
|
|
17
|
+
intervalMs: number;
|
|
18
|
+
/** The function to run on each tick */
|
|
19
|
+
handler: () => void | Promise<void>;
|
|
20
|
+
/** Whether to run the handler immediately on start (default: true) */
|
|
21
|
+
immediate?: boolean;
|
|
22
|
+
/** Called when the handler is removed or all heartbeats are stopped */
|
|
23
|
+
shutdown?: () => void | Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for a single agent mode within the harness.
|
|
27
|
+
* Each mode represents a different "personality" or capability set.
|
|
28
|
+
*/
|
|
29
|
+
export interface HarnessMode<TState extends HarnessStateSchema = HarnessStateSchema> {
|
|
30
|
+
/** Unique identifier for this mode (e.g., "plan", "build", "review") */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Human-readable name for display */
|
|
33
|
+
name?: string;
|
|
34
|
+
/** Whether this is the default mode when harness starts */
|
|
35
|
+
default?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Default model ID for this mode (e.g., "anthropic/claude-sonnet-4-20250514").
|
|
38
|
+
* Used when no per-mode model has been explicitly selected.
|
|
39
|
+
*/
|
|
40
|
+
defaultModelId?: string;
|
|
41
|
+
/** Hex color for the mode indicator (e.g., "#7c3aed") */
|
|
42
|
+
color?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The agent for this mode.
|
|
45
|
+
* Can be a static Agent or a function that receives harness state.
|
|
46
|
+
*/
|
|
47
|
+
agent: Agent | ((state: z.infer<TState>) => Agent);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Definition of a subagent that the Harness can spawn via the built-in `subagent` tool.
|
|
51
|
+
* Each subagent runs as a fresh Agent with constrained tools and its own instructions.
|
|
52
|
+
*/
|
|
53
|
+
export interface HarnessSubagent {
|
|
54
|
+
/** Unique identifier for this subagent type (e.g., "explore", "plan", "execute") */
|
|
55
|
+
id: string;
|
|
56
|
+
/** Human-readable name shown in tool output (e.g., "Explore") */
|
|
57
|
+
name: string;
|
|
58
|
+
/** Description of what this subagent does (used in auto-generated tool description) */
|
|
59
|
+
description: string;
|
|
60
|
+
/** System prompt for this subagent */
|
|
61
|
+
instructions: string;
|
|
62
|
+
/** Tools this subagent has direct access to */
|
|
63
|
+
tools?: ToolsInput;
|
|
64
|
+
/**
|
|
65
|
+
* Tool IDs to pull from the harness's shared `tools` config.
|
|
66
|
+
* Merged with `tools` above — allows subagents to use a subset of harness tools.
|
|
67
|
+
*/
|
|
68
|
+
allowedHarnessTools?: string[];
|
|
69
|
+
/** Default model ID for this subagent type (e.g., "anthropic/claude-sonnet-4-20250514") */
|
|
70
|
+
defaultModelId?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Schema type for harness state - must be a Zod object schema.
|
|
74
|
+
*/
|
|
75
|
+
export type HarnessStateSchema = z.ZodObject<z.ZodRawShape>;
|
|
76
|
+
/**
|
|
77
|
+
* Configuration for creating a Harness instance.
|
|
78
|
+
*/
|
|
79
|
+
export interface HarnessConfig<TState extends HarnessStateSchema = HarnessStateSchema> {
|
|
80
|
+
/** Unique identifier for this harness instance */
|
|
81
|
+
id: string;
|
|
82
|
+
/**
|
|
83
|
+
* Resource ID for grouping threads (e.g., project identifier).
|
|
84
|
+
* Threads are scoped to this resource ID.
|
|
85
|
+
*/
|
|
86
|
+
resourceId?: string;
|
|
87
|
+
/** Storage backend for persistence (threads, messages, state) */
|
|
88
|
+
storage?: MastraCompositeStore;
|
|
89
|
+
/** Zod schema defining the shape of harness state */
|
|
90
|
+
stateSchema?: TState;
|
|
91
|
+
/** Initial state values (must conform to schema) */
|
|
92
|
+
initialState?: Partial<z.infer<TState>>;
|
|
93
|
+
/** Memory configuration (shared across all modes) */
|
|
94
|
+
memory?: MastraMemory;
|
|
95
|
+
/** Available agent modes */
|
|
96
|
+
modes: HarnessMode<TState>[];
|
|
97
|
+
/**
|
|
98
|
+
* Tools available to all agents across all modes.
|
|
99
|
+
* Can be a static tools object or a dynamic function that receives
|
|
100
|
+
* the request context and returns tools per-request.
|
|
101
|
+
*/
|
|
102
|
+
tools?: DynamicArgument<ToolsInput | undefined>;
|
|
103
|
+
/**
|
|
104
|
+
* Workspace configuration.
|
|
105
|
+
* Accepts a pre-constructed Workspace instance, a WorkspaceConfig for
|
|
106
|
+
* Harness to construct internally, or a dynamic factory function that
|
|
107
|
+
* receives the request context and returns a Workspace per-request.
|
|
108
|
+
*/
|
|
109
|
+
workspace?: DynamicArgument<Workspace | undefined> | WorkspaceConfig;
|
|
110
|
+
/**
|
|
111
|
+
* Periodic heartbeat handlers started during `init()`.
|
|
112
|
+
* Use for background tasks like gateway sync, cache refresh, etc.
|
|
113
|
+
*/
|
|
114
|
+
heartbeatHandlers?: HeartbeatHandler[];
|
|
115
|
+
/**
|
|
116
|
+
* Custom ID generator for threads, messages, and other entities.
|
|
117
|
+
* Defaults to a timestamp + random string generator.
|
|
118
|
+
*/
|
|
119
|
+
idGenerator?: () => string;
|
|
120
|
+
/**
|
|
121
|
+
* Custom auth checker for model providers.
|
|
122
|
+
* Lets the app layer provide additional auth sources (e.g., OAuth tokens)
|
|
123
|
+
* beyond the default env var check from the provider registry.
|
|
124
|
+
*/
|
|
125
|
+
modelAuthChecker?: ModelAuthChecker;
|
|
126
|
+
/**
|
|
127
|
+
* Provides per-model use counts for `getAvailableModels()` sorting/display.
|
|
128
|
+
* Lets the app layer track and report how often each model has been used.
|
|
129
|
+
*/
|
|
130
|
+
modelUseCountProvider?: ModelUseCountProvider;
|
|
131
|
+
/**
|
|
132
|
+
* Subagent definitions. The Harness auto-creates a `subagent` built-in tool
|
|
133
|
+
* that parent agents can call to spawn focused subagents.
|
|
134
|
+
*/
|
|
135
|
+
subagents?: HarnessSubagent[];
|
|
136
|
+
/**
|
|
137
|
+
* Converts a model ID string (e.g., "anthropic/claude-sonnet-4-20250514") to a
|
|
138
|
+
* language model instance. Used by subagents and OM model resolution.
|
|
139
|
+
*/
|
|
140
|
+
resolveModel?: (modelId: string) => MastraLanguageModel;
|
|
141
|
+
/**
|
|
142
|
+
* Observational Memory configuration defaults.
|
|
143
|
+
* The Harness auto-manages OM state (model IDs, thresholds) internally
|
|
144
|
+
* and provides accessors that Memory's dynamic model functions can close over.
|
|
145
|
+
*/
|
|
146
|
+
omConfig?: HarnessOMConfig;
|
|
147
|
+
/**
|
|
148
|
+
* Maps tool names to permission categories.
|
|
149
|
+
* Used by the permission system to resolve category-level policies.
|
|
150
|
+
* If not provided, all tools default to the "other" category.
|
|
151
|
+
*/
|
|
152
|
+
toolCategoryResolver?: (toolName: string) => ToolCategory | null;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Default configuration for Observational Memory.
|
|
156
|
+
* These values are used when harness state doesn't have explicit OM values
|
|
157
|
+
* (e.g., fresh thread with no persisted OM settings).
|
|
158
|
+
*/
|
|
159
|
+
export interface HarnessOMConfig {
|
|
160
|
+
/** Default model ID for the observer agent */
|
|
161
|
+
defaultObserverModelId?: string;
|
|
162
|
+
/** Default model ID for the reflector agent */
|
|
163
|
+
defaultReflectorModelId?: string;
|
|
164
|
+
/** Default observation threshold in tokens */
|
|
165
|
+
defaultObservationThreshold?: number;
|
|
166
|
+
/** Default reflection threshold in tokens */
|
|
167
|
+
defaultReflectionThreshold?: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Tool category for permission grouping.
|
|
171
|
+
* Consumers define how tool names map to categories via `toolCategoryResolver`.
|
|
172
|
+
*/
|
|
173
|
+
export type ToolCategory = 'read' | 'edit' | 'execute' | 'mcp' | 'other';
|
|
174
|
+
/**
|
|
175
|
+
* Permission policy for a tool or category.
|
|
176
|
+
*/
|
|
177
|
+
export type PermissionPolicy = 'allow' | 'ask' | 'deny';
|
|
178
|
+
/**
|
|
179
|
+
* Permission rules for controlling tool approval behavior.
|
|
180
|
+
* Per-tool overrides take precedence over category policies.
|
|
181
|
+
*/
|
|
182
|
+
export interface PermissionRules {
|
|
183
|
+
categories: Partial<Record<ToolCategory, PermissionPolicy>>;
|
|
184
|
+
tools: Partial<Record<string, PermissionPolicy>>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Auth status for a model's provider.
|
|
188
|
+
*/
|
|
189
|
+
export interface ModelAuthStatus {
|
|
190
|
+
hasAuth: boolean;
|
|
191
|
+
apiKeyEnvVar?: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Info about an available model from the provider registry.
|
|
195
|
+
*/
|
|
196
|
+
export interface AvailableModel {
|
|
197
|
+
/** Full model ID (e.g., "anthropic/claude-sonnet-4-20250514") */
|
|
198
|
+
id: string;
|
|
199
|
+
/** Provider prefix (e.g., "anthropic") */
|
|
200
|
+
provider: string;
|
|
201
|
+
/** Model name without provider prefix */
|
|
202
|
+
modelName: string;
|
|
203
|
+
/** Whether the provider has valid authentication */
|
|
204
|
+
hasApiKey: boolean;
|
|
205
|
+
/** Environment variable for the provider's API key */
|
|
206
|
+
apiKeyEnvVar?: string;
|
|
207
|
+
/** Number of times this model has been used (from external tracking) */
|
|
208
|
+
useCount: number;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Custom auth checker for model providers.
|
|
212
|
+
* Called by `getCurrentModelAuthStatus()` and `getAvailableModels()` to determine
|
|
213
|
+
* whether a provider has valid authentication beyond just env var checks
|
|
214
|
+
* (e.g., OAuth tokens, stored credentials).
|
|
215
|
+
*
|
|
216
|
+
* Return `true` if the provider is authenticated, `false` if not,
|
|
217
|
+
* or `undefined` to fall back to the default env var check.
|
|
218
|
+
*/
|
|
219
|
+
export type ModelAuthChecker = (provider: string) => boolean | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* Provides per-model use counts for sorting in `getAvailableModels()`.
|
|
222
|
+
* Return a map of model ID → use count.
|
|
223
|
+
*/
|
|
224
|
+
export type ModelUseCountProvider = () => Record<string, number>;
|
|
225
|
+
/**
|
|
226
|
+
* Thread metadata stored in the harness.
|
|
227
|
+
*/
|
|
228
|
+
export interface HarnessThread {
|
|
229
|
+
id: string;
|
|
230
|
+
resourceId: string;
|
|
231
|
+
title?: string;
|
|
232
|
+
createdAt: Date;
|
|
233
|
+
updatedAt: Date;
|
|
234
|
+
tokenUsage?: TokenUsage;
|
|
235
|
+
metadata?: Record<string, unknown>;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Session info for the current harness instance.
|
|
239
|
+
*/
|
|
240
|
+
export interface HarnessSession {
|
|
241
|
+
currentThreadId: string | null;
|
|
242
|
+
currentModeId: string;
|
|
243
|
+
threads: HarnessThread[];
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Token usage statistics from the model.
|
|
247
|
+
*/
|
|
248
|
+
export interface TokenUsage {
|
|
249
|
+
promptTokens: number;
|
|
250
|
+
completionTokens: number;
|
|
251
|
+
totalTokens: number;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Events emitted by the harness that UIs can subscribe to.
|
|
255
|
+
*/
|
|
256
|
+
export type HarnessEvent = {
|
|
257
|
+
type: 'mode_changed';
|
|
258
|
+
modeId: string;
|
|
259
|
+
previousModeId: string;
|
|
260
|
+
} | {
|
|
261
|
+
type: 'model_changed';
|
|
262
|
+
modelId: string;
|
|
263
|
+
scope?: 'global' | 'thread' | 'mode';
|
|
264
|
+
modeId?: string;
|
|
265
|
+
} | {
|
|
266
|
+
type: 'thread_changed';
|
|
267
|
+
threadId: string;
|
|
268
|
+
previousThreadId: string | null;
|
|
269
|
+
} | {
|
|
270
|
+
type: 'thread_created';
|
|
271
|
+
thread: HarnessThread;
|
|
272
|
+
} | {
|
|
273
|
+
type: 'state_changed';
|
|
274
|
+
state: Record<string, unknown>;
|
|
275
|
+
changedKeys: string[];
|
|
276
|
+
} | {
|
|
277
|
+
type: 'agent_start';
|
|
278
|
+
} | {
|
|
279
|
+
type: 'agent_end';
|
|
280
|
+
reason?: 'complete' | 'aborted' | 'error';
|
|
281
|
+
} | {
|
|
282
|
+
type: 'message_start';
|
|
283
|
+
message: HarnessMessage;
|
|
284
|
+
} | {
|
|
285
|
+
type: 'message_update';
|
|
286
|
+
message: HarnessMessage;
|
|
287
|
+
} | {
|
|
288
|
+
type: 'message_end';
|
|
289
|
+
message: HarnessMessage;
|
|
290
|
+
} | {
|
|
291
|
+
type: 'tool_start';
|
|
292
|
+
toolCallId: string;
|
|
293
|
+
toolName: string;
|
|
294
|
+
args: unknown;
|
|
295
|
+
} | {
|
|
296
|
+
type: 'tool_approval_required';
|
|
297
|
+
toolCallId: string;
|
|
298
|
+
toolName: string;
|
|
299
|
+
args: unknown;
|
|
300
|
+
} | {
|
|
301
|
+
type: 'tool_update';
|
|
302
|
+
toolCallId: string;
|
|
303
|
+
partialResult: unknown;
|
|
304
|
+
} | {
|
|
305
|
+
type: 'tool_end';
|
|
306
|
+
toolCallId: string;
|
|
307
|
+
result: unknown;
|
|
308
|
+
isError: boolean;
|
|
309
|
+
} | {
|
|
310
|
+
type: 'shell_output';
|
|
311
|
+
toolCallId: string;
|
|
312
|
+
output: string;
|
|
313
|
+
stream: 'stdout' | 'stderr';
|
|
314
|
+
} | {
|
|
315
|
+
type: 'usage_update';
|
|
316
|
+
usage: TokenUsage;
|
|
317
|
+
} | {
|
|
318
|
+
type: 'info';
|
|
319
|
+
message: string;
|
|
320
|
+
} | {
|
|
321
|
+
type: 'error';
|
|
322
|
+
error: Error;
|
|
323
|
+
errorType?: string;
|
|
324
|
+
retryable?: boolean;
|
|
325
|
+
retryDelay?: number;
|
|
326
|
+
} | {
|
|
327
|
+
type: 'follow_up_queued';
|
|
328
|
+
count: number;
|
|
329
|
+
} | {
|
|
330
|
+
type: 'workspace_status_changed';
|
|
331
|
+
status: WorkspaceStatus;
|
|
332
|
+
error?: Error;
|
|
333
|
+
} | {
|
|
334
|
+
type: 'workspace_ready';
|
|
335
|
+
workspaceId: string;
|
|
336
|
+
workspaceName: string;
|
|
337
|
+
} | {
|
|
338
|
+
type: 'workspace_error';
|
|
339
|
+
error: Error;
|
|
340
|
+
} | {
|
|
341
|
+
type: 'om_status';
|
|
342
|
+
windows: {
|
|
343
|
+
active: {
|
|
344
|
+
messages: {
|
|
345
|
+
tokens: number;
|
|
346
|
+
threshold: number;
|
|
347
|
+
};
|
|
348
|
+
observations: {
|
|
349
|
+
tokens: number;
|
|
350
|
+
threshold: number;
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
buffered: {
|
|
354
|
+
observations: {
|
|
355
|
+
status: 'idle' | 'running' | 'complete';
|
|
356
|
+
chunks: number;
|
|
357
|
+
messageTokens: number;
|
|
358
|
+
projectedMessageRemoval: number;
|
|
359
|
+
observationTokens: number;
|
|
360
|
+
};
|
|
361
|
+
reflection: {
|
|
362
|
+
status: 'idle' | 'running' | 'complete';
|
|
363
|
+
inputObservationTokens: number;
|
|
364
|
+
observationTokens: number;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
recordId: string;
|
|
369
|
+
threadId: string;
|
|
370
|
+
stepNumber: number;
|
|
371
|
+
generationCount: number;
|
|
372
|
+
} | {
|
|
373
|
+
type: 'om_observation_start';
|
|
374
|
+
cycleId: string;
|
|
375
|
+
operationType: 'observation' | 'reflection';
|
|
376
|
+
tokensToObserve: number;
|
|
377
|
+
} | {
|
|
378
|
+
type: 'om_observation_end';
|
|
379
|
+
cycleId: string;
|
|
380
|
+
durationMs: number;
|
|
381
|
+
tokensObserved: number;
|
|
382
|
+
observationTokens: number;
|
|
383
|
+
observations?: string;
|
|
384
|
+
currentTask?: string;
|
|
385
|
+
suggestedResponse?: string;
|
|
386
|
+
} | {
|
|
387
|
+
type: 'om_observation_failed';
|
|
388
|
+
cycleId: string;
|
|
389
|
+
error: string;
|
|
390
|
+
durationMs: number;
|
|
391
|
+
} | {
|
|
392
|
+
type: 'om_reflection_start';
|
|
393
|
+
cycleId: string;
|
|
394
|
+
tokensToReflect: number;
|
|
395
|
+
} | {
|
|
396
|
+
type: 'om_reflection_end';
|
|
397
|
+
cycleId: string;
|
|
398
|
+
durationMs: number;
|
|
399
|
+
compressedTokens: number;
|
|
400
|
+
observations?: string;
|
|
401
|
+
} | {
|
|
402
|
+
type: 'om_reflection_failed';
|
|
403
|
+
cycleId: string;
|
|
404
|
+
error: string;
|
|
405
|
+
durationMs: number;
|
|
406
|
+
} | {
|
|
407
|
+
type: 'om_model_changed';
|
|
408
|
+
role: 'observer' | 'reflector';
|
|
409
|
+
modelId: string;
|
|
410
|
+
} | {
|
|
411
|
+
type: 'om_buffering_start';
|
|
412
|
+
cycleId: string;
|
|
413
|
+
operationType: 'observation' | 'reflection';
|
|
414
|
+
tokensToBuffer: number;
|
|
415
|
+
} | {
|
|
416
|
+
type: 'om_buffering_end';
|
|
417
|
+
cycleId: string;
|
|
418
|
+
operationType: 'observation' | 'reflection';
|
|
419
|
+
tokensBuffered: number;
|
|
420
|
+
bufferedTokens: number;
|
|
421
|
+
observations?: string;
|
|
422
|
+
} | {
|
|
423
|
+
type: 'om_buffering_failed';
|
|
424
|
+
cycleId: string;
|
|
425
|
+
operationType: 'observation' | 'reflection';
|
|
426
|
+
error: string;
|
|
427
|
+
} | {
|
|
428
|
+
type: 'om_activation';
|
|
429
|
+
cycleId: string;
|
|
430
|
+
operationType: 'observation' | 'reflection';
|
|
431
|
+
chunksActivated: number;
|
|
432
|
+
tokensActivated: number;
|
|
433
|
+
observationTokens: number;
|
|
434
|
+
messagesActivated: number;
|
|
435
|
+
generationCount: number;
|
|
436
|
+
} | {
|
|
437
|
+
type: 'ask_question';
|
|
438
|
+
questionId: string;
|
|
439
|
+
question: string;
|
|
440
|
+
options?: Array<{
|
|
441
|
+
label: string;
|
|
442
|
+
description?: string;
|
|
443
|
+
}>;
|
|
444
|
+
} | {
|
|
445
|
+
type: 'plan_approval_required';
|
|
446
|
+
planId: string;
|
|
447
|
+
title: string;
|
|
448
|
+
plan: string;
|
|
449
|
+
} | {
|
|
450
|
+
type: 'plan_approved';
|
|
451
|
+
} | {
|
|
452
|
+
type: 'subagent_start';
|
|
453
|
+
toolCallId: string;
|
|
454
|
+
agentType: string;
|
|
455
|
+
task: string;
|
|
456
|
+
modelId: string;
|
|
457
|
+
} | {
|
|
458
|
+
type: 'subagent_text_delta';
|
|
459
|
+
toolCallId: string;
|
|
460
|
+
agentType: string;
|
|
461
|
+
textDelta: string;
|
|
462
|
+
} | {
|
|
463
|
+
type: 'subagent_tool_start';
|
|
464
|
+
toolCallId: string;
|
|
465
|
+
agentType: string;
|
|
466
|
+
subToolName: string;
|
|
467
|
+
subToolArgs: unknown;
|
|
468
|
+
} | {
|
|
469
|
+
type: 'subagent_tool_end';
|
|
470
|
+
toolCallId: string;
|
|
471
|
+
agentType: string;
|
|
472
|
+
subToolName: string;
|
|
473
|
+
subToolResult: unknown;
|
|
474
|
+
isError: boolean;
|
|
475
|
+
} | {
|
|
476
|
+
type: 'subagent_end';
|
|
477
|
+
toolCallId: string;
|
|
478
|
+
agentType: string;
|
|
479
|
+
result: string;
|
|
480
|
+
isError: boolean;
|
|
481
|
+
durationMs: number;
|
|
482
|
+
} | {
|
|
483
|
+
type: 'subagent_model_changed';
|
|
484
|
+
modelId: string;
|
|
485
|
+
scope: 'global' | 'thread';
|
|
486
|
+
agentType?: string;
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* Listener function for harness events.
|
|
490
|
+
*/
|
|
491
|
+
export type HarnessEventListener = (event: HarnessEvent) => void | Promise<void>;
|
|
492
|
+
/**
|
|
493
|
+
* Simplified message type for UI consumption.
|
|
494
|
+
* Maps from Mastra's internal message format.
|
|
495
|
+
*/
|
|
496
|
+
export interface HarnessMessage {
|
|
497
|
+
id: string;
|
|
498
|
+
role: 'user' | 'assistant' | 'system';
|
|
499
|
+
content: HarnessMessageContent[];
|
|
500
|
+
createdAt: Date;
|
|
501
|
+
stopReason?: 'complete' | 'tool_use' | 'aborted' | 'error';
|
|
502
|
+
errorMessage?: string;
|
|
503
|
+
}
|
|
504
|
+
export type HarnessMessageContent = {
|
|
505
|
+
type: 'text';
|
|
506
|
+
text: string;
|
|
507
|
+
} | {
|
|
508
|
+
type: 'thinking';
|
|
509
|
+
thinking: string;
|
|
510
|
+
} | {
|
|
511
|
+
type: 'tool_call';
|
|
512
|
+
id: string;
|
|
513
|
+
name: string;
|
|
514
|
+
args: unknown;
|
|
515
|
+
} | {
|
|
516
|
+
type: 'tool_result';
|
|
517
|
+
id: string;
|
|
518
|
+
name: string;
|
|
519
|
+
result: unknown;
|
|
520
|
+
isError: boolean;
|
|
521
|
+
} | {
|
|
522
|
+
type: 'image';
|
|
523
|
+
data: string;
|
|
524
|
+
mimeType: string;
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* Harness-specific context set on the RequestContext under the 'harness' key.
|
|
528
|
+
* Tools can access harness state and methods through requestContext.get('harness').
|
|
529
|
+
*/
|
|
530
|
+
export interface HarnessRequestContext<TState extends HarnessStateSchema = HarnessStateSchema> {
|
|
531
|
+
/** The harness instance ID */
|
|
532
|
+
harnessId: string;
|
|
533
|
+
/** Current harness state (read-only snapshot) */
|
|
534
|
+
state: z.infer<TState>;
|
|
535
|
+
/** Get the current harness state (live, not snapshot) */
|
|
536
|
+
getState: () => z.infer<TState>;
|
|
537
|
+
/** Update harness state */
|
|
538
|
+
setState: (updates: Partial<z.infer<TState>>) => Promise<void>;
|
|
539
|
+
/** Current thread ID */
|
|
540
|
+
threadId: string | null;
|
|
541
|
+
/** Current resource ID */
|
|
542
|
+
resourceId: string;
|
|
543
|
+
/** Current mode ID */
|
|
544
|
+
modeId: string;
|
|
545
|
+
/** Abort signal for the current operation */
|
|
546
|
+
abortSignal?: AbortSignal;
|
|
547
|
+
/** Workspace instance (if configured on the Harness) */
|
|
548
|
+
workspace?: Workspace;
|
|
549
|
+
/** Emit a harness event (used by tools to forward events) */
|
|
550
|
+
emitEvent?: (event: HarnessEvent) => void;
|
|
551
|
+
/** Register a pending question resolver (used by ask_user tools) */
|
|
552
|
+
registerQuestion?: (questionId: string, resolve: (answer: string) => void) => void;
|
|
553
|
+
/** Register a pending plan approval resolver (used by submit_plan tools) */
|
|
554
|
+
registerPlanApproval?: (planId: string, resolve: (result: {
|
|
555
|
+
action: 'approved' | 'rejected';
|
|
556
|
+
feedback?: string;
|
|
557
|
+
}) => void) => void;
|
|
558
|
+
/** Get the configured subagent model ID for a specific agent type */
|
|
559
|
+
getSubagentModelId?: (agentType?: string) => string | null;
|
|
560
|
+
}
|
|
561
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMhF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,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AY,KAAK,IAAI,CAAC;IAE1C,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IAEnF,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,KAC9E,IAAI,CAAC;IAEV,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC5D"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJWG272ZZ_cjs = require('./chunk-JWG272ZZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Mastra", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkJWG272ZZ_cjs.Mastra; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkEAZ6YDCQ_cjs = require('../chunk-EAZ6YDCQ.cjs');
|
|
4
4
|
var zod = require('zod');
|
|
5
5
|
|
|
6
6
|
// src/integration/integration.ts
|
|
@@ -68,7 +68,7 @@ var OpenAPIToolset = class {
|
|
|
68
68
|
const tools = Object.keys(clientMethods).reduce((acc, key) => {
|
|
69
69
|
const comment = documentations[key]?.comment;
|
|
70
70
|
const fallbackComment = `Execute ${key}`;
|
|
71
|
-
const tool =
|
|
71
|
+
const tool = chunkEAZ6YDCQ_cjs.createTool({
|
|
72
72
|
id: key,
|
|
73
73
|
inputSchema: schemas[key] || zod.z.object({}),
|
|
74
74
|
description: comment || fallbackComment,
|