@mastra/core 1.18.0-alpha.1 → 1.18.0-alpha.2

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.js +1 -1
  4. package/dist/{chunk-WYFCQAHY.js → chunk-45M6KUQZ.js} +6 -6
  5. package/dist/{chunk-WYFCQAHY.js.map → chunk-45M6KUQZ.js.map} +1 -1
  6. package/dist/{chunk-UEZU2TA2.cjs → chunk-4KGTZPYF.cjs} +185 -185
  7. package/dist/{chunk-UEZU2TA2.cjs.map → chunk-4KGTZPYF.cjs.map} +1 -1
  8. package/dist/{chunk-UPCNNWXW.cjs → chunk-5AVTFQEP.cjs} +5 -5
  9. package/dist/{chunk-UPCNNWXW.cjs.map → chunk-5AVTFQEP.cjs.map} +1 -1
  10. package/dist/{chunk-MSDZQ4DW.cjs → chunk-6WVZQBYQ.cjs} +9 -9
  11. package/dist/{chunk-MSDZQ4DW.cjs.map → chunk-6WVZQBYQ.cjs.map} +1 -1
  12. package/dist/{chunk-KL2IRBNK.cjs → chunk-DQYOFNZ7.cjs} +5 -5
  13. package/dist/{chunk-KL2IRBNK.cjs.map → chunk-DQYOFNZ7.cjs.map} +1 -1
  14. package/dist/{chunk-D4DCPE5Y.js → chunk-E6XNM5ES.js} +3 -3
  15. package/dist/{chunk-D4DCPE5Y.js.map → chunk-E6XNM5ES.js.map} +1 -1
  16. package/dist/{chunk-2U4M4SGY.cjs → chunk-H5O522FY.cjs} +15 -15
  17. package/dist/{chunk-2U4M4SGY.cjs.map → chunk-H5O522FY.cjs.map} +1 -1
  18. package/dist/{chunk-TKKBZUWD.js → chunk-IOCCTQYZ.js} +4 -4
  19. package/dist/{chunk-TKKBZUWD.js.map → chunk-IOCCTQYZ.js.map} +1 -1
  20. package/dist/{chunk-UQ2HAEHL.js → chunk-JEWTRDRI.js} +3 -3
  21. package/dist/{chunk-UQ2HAEHL.js.map → chunk-JEWTRDRI.js.map} +1 -1
  22. package/dist/{chunk-BYJDWJCX.js → chunk-L53NRDFU.js} +3 -3
  23. package/dist/{chunk-BYJDWJCX.js.map → chunk-L53NRDFU.js.map} +1 -1
  24. package/dist/{chunk-PQWEJELD.cjs → chunk-LUONHWL6.cjs} +6 -6
  25. package/dist/{chunk-PQWEJELD.cjs.map → chunk-LUONHWL6.cjs.map} +1 -1
  26. package/dist/{chunk-HEHK7LXS.js → chunk-M5CZCWWW.js} +4 -4
  27. package/dist/{chunk-HEHK7LXS.js.map → chunk-M5CZCWWW.js.map} +1 -1
  28. package/dist/{chunk-K22Q6XPG.js → chunk-QR2Z4WQ7.js} +3 -3
  29. package/dist/{chunk-K22Q6XPG.js.map → chunk-QR2Z4WQ7.js.map} +1 -1
  30. package/dist/{chunk-JFPVUKPB.cjs → chunk-T2CILERS.cjs} +48 -48
  31. package/dist/{chunk-JFPVUKPB.cjs.map → chunk-T2CILERS.cjs.map} +1 -1
  32. package/dist/{chunk-RB2QRGRV.js → chunk-URN2SKVG.js} +4 -4
  33. package/dist/{chunk-RB2QRGRV.js.map → chunk-URN2SKVG.js.map} +1 -1
  34. package/dist/{chunk-GFBH7Q4W.cjs → chunk-VAVK4KJI.cjs} +26 -26
  35. package/dist/chunk-VAVK4KJI.cjs.map +1 -0
  36. package/dist/{chunk-3U4ZNZIF.js → chunk-VF3CL3JV.js} +18 -18
  37. package/dist/chunk-VF3CL3JV.js.map +1 -0
  38. package/dist/{chunk-Z3VUDCXI.cjs → chunk-WPDB2VAM.cjs} +7 -7
  39. package/dist/{chunk-Z3VUDCXI.cjs.map → chunk-WPDB2VAM.cjs.map} +1 -1
  40. package/dist/{chunk-A2Z26HFR.js → chunk-WVTVBWOQ.js} +8 -8
  41. package/dist/{chunk-A2Z26HFR.js.map → chunk-WVTVBWOQ.js.map} +1 -1
  42. package/dist/{chunk-G62XEVSI.cjs → chunk-XRZNAZRP.cjs} +3 -3
  43. package/dist/{chunk-G62XEVSI.cjs.map → chunk-XRZNAZRP.cjs.map} +1 -1
  44. package/dist/{chunk-3O73Q6M2.cjs → chunk-YEKQKMCU.cjs} +75 -75
  45. package/dist/{chunk-3O73Q6M2.cjs.map → chunk-YEKQKMCU.cjs.map} +1 -1
  46. package/dist/{chunk-3NMSFQPY.js → chunk-YN3FI4AD.js} +3 -3
  47. package/dist/{chunk-3NMSFQPY.js.map → chunk-YN3FI4AD.js.map} +1 -1
  48. package/dist/datasets/index.cjs +11 -11
  49. package/dist/datasets/index.js +1 -1
  50. package/dist/docs/SKILL.md +1 -3
  51. package/dist/docs/assets/SOURCE_MAP.json +121 -121
  52. package/dist/docs/references/reference-logging-pino-logger.md +58 -0
  53. package/dist/docs/references/reference.md +0 -2
  54. package/dist/evals/index.cjs +5 -5
  55. package/dist/evals/index.js +2 -2
  56. package/dist/evals/scoreTraces/index.cjs +3 -3
  57. package/dist/evals/scoreTraces/index.js +1 -1
  58. package/dist/harness/index.cjs +7 -7
  59. package/dist/harness/index.js +5 -5
  60. package/dist/index.cjs +2 -2
  61. package/dist/index.js +1 -1
  62. package/dist/llm/index.cjs +16 -16
  63. package/dist/llm/index.js +5 -5
  64. package/dist/loop/index.cjs +14 -14
  65. package/dist/loop/index.js +1 -1
  66. package/dist/mastra/index.cjs +2 -2
  67. package/dist/mastra/index.js +1 -1
  68. package/dist/memory/index.cjs +14 -14
  69. package/dist/memory/index.js +1 -1
  70. package/dist/models-dev-GLFQVCT4.cjs +12 -0
  71. package/dist/{models-dev-BJHT4GXA.cjs.map → models-dev-GLFQVCT4.cjs.map} +1 -1
  72. package/dist/models-dev-WSLKK6FO.js +3 -0
  73. package/dist/{models-dev-3U6ICCNW.js.map → models-dev-WSLKK6FO.js.map} +1 -1
  74. package/dist/netlify-SNTN56QS.js +3 -0
  75. package/dist/{netlify-DE3IXMT2.js.map → netlify-SNTN56QS.js.map} +1 -1
  76. package/dist/netlify-VFRYJYBK.cjs +12 -0
  77. package/dist/{netlify-UARJYMCW.cjs.map → netlify-VFRYJYBK.cjs.map} +1 -1
  78. package/dist/processor-provider/index.cjs +10 -10
  79. package/dist/processor-provider/index.js +1 -1
  80. package/dist/processors/index.cjs +44 -44
  81. package/dist/processors/index.js +1 -1
  82. package/dist/provider-registry-L6KDLMFM.cjs +40 -0
  83. package/dist/{provider-registry-65CPGTUU.cjs.map → provider-registry-L6KDLMFM.cjs.map} +1 -1
  84. package/dist/provider-registry-LEXW2E53.js +3 -0
  85. package/dist/{provider-registry-EQAT7FXK.js.map → provider-registry-LEXW2E53.js.map} +1 -1
  86. package/dist/relevance/index.cjs +3 -3
  87. package/dist/relevance/index.js +1 -1
  88. package/dist/stream/index.cjs +8 -8
  89. package/dist/stream/index.js +1 -1
  90. package/dist/tool-loop-agent/index.cjs +4 -4
  91. package/dist/tool-loop-agent/index.js +1 -1
  92. package/dist/workflows/evented/index.cjs +10 -10
  93. package/dist/workflows/evented/index.js +1 -1
  94. package/dist/workflows/index.cjs +24 -24
  95. package/dist/workflows/index.js +1 -1
  96. package/package.json +4 -4
  97. package/dist/chunk-3U4ZNZIF.js.map +0 -1
  98. package/dist/chunk-GFBH7Q4W.cjs.map +0 -1
  99. package/dist/docs/references/reference-core-getStoredAgentById.md +0 -87
  100. package/dist/docs/references/reference-core-listStoredAgents.md +0 -91
  101. package/dist/models-dev-3U6ICCNW.js +0 -3
  102. package/dist/models-dev-BJHT4GXA.cjs +0 -12
  103. package/dist/netlify-DE3IXMT2.js +0 -3
  104. package/dist/netlify-UARJYMCW.cjs +0 -12
  105. package/dist/provider-registry-65CPGTUU.cjs +0 -40
  106. package/dist/provider-registry-EQAT7FXK.js +0 -3
@@ -1,87 +0,0 @@
1
- # Mastra.getStoredAgentById()
2
-
3
- The `.getStoredAgentById()` method retrieves an agent configuration from storage by its ID and creates an executable `Agent` instance. Stored agents allow you to persist agent configurations in a database and dynamically load them at runtime.
4
-
5
- ## Usage example
6
-
7
- ```typescript
8
- // Get an Agent instance from storage
9
- const agent = await mastra.getStoredAgentById('my-stored-agent')
10
-
11
- if (agent) {
12
- const response = await agent.generate('Hello')
13
- console.log(response.text)
14
- }
15
- ```
16
-
17
- ```typescript
18
- // Get the raw storage data instead of an Agent instance
19
- const storedConfig = await mastra.getStoredAgentById('my-stored-agent', { raw: true })
20
-
21
- if (storedConfig) {
22
- console.log(storedConfig.instructions)
23
- console.log(storedConfig.createdAt)
24
- }
25
- ```
26
-
27
- ## Parameters
28
-
29
- **id** (`string`): The unique identifier of the stored agent to retrieve.
30
-
31
- **options** (`{ raw?: boolean }`): Optional configuration object.
32
-
33
- **options.raw** (`boolean`): When \`true\`, returns the raw \`StorageAgentType\` object from storage instead of creating an \`Agent\` instance. Useful for inspecting stored configuration or metadata.
34
-
35
- ## Returns
36
-
37
- **result** (`Agent | StorageAgentType | null`): Returns an \`Agent\` instance by default, or \`StorageAgentType\` when \`raw: true\`. Returns \`null\` if no agent with the given ID exists.
38
-
39
- ## Primitive resolution
40
-
41
- When creating an `Agent` instance from stored configuration, the method resolves references to registered primitives:
42
-
43
- - **Tools**: Resolved from `tools` registered in Mastra config
44
- - **Workflows**: Resolved from `workflows` registered in Mastra config
45
- - **Subagents**: Resolved from `agents` registered in Mastra config
46
- - **Memory**: Resolved from `memory` registered in Mastra config
47
- - **Scorers**: Resolved from `scorers` registered in Mastra config, including sampling configuration
48
-
49
- If a referenced primitive isn't found in the registry, a warning is logged but the agent is still created.
50
-
51
- ## `StorageAgentType`
52
-
53
- When using `raw: true`, the returned object has the following structure:
54
-
55
- **id** (`string`): Unique identifier for the agent.
56
-
57
- **name** (`string`): Display name of the agent.
58
-
59
- **description** (`string`): Optional description of the agent.
60
-
61
- **instructions** (`string`): System instructions for the agent.
62
-
63
- **model** (`Record<string, unknown>`): Model configuration with provider and name.
64
-
65
- **tools** (`Record<string, unknown>`): Tool references to resolve from registry.
66
-
67
- **workflows** (`Record<string, unknown>`): Workflow references to resolve from registry.
68
-
69
- **agents** (`Record<string, unknown>`): Subagent references to resolve from registry.
70
-
71
- **memory** (`Record<string, unknown>`): Memory reference to resolve from registry.
72
-
73
- **scorers** (`Record<string, unknown>`): Scorer references with optional sampling config.
74
-
75
- **defaultOptions** (`Record<string, unknown>`): Default options passed to agent execution.
76
-
77
- **metadata** (`Record<string, unknown>`): Custom metadata stored with the agent.
78
-
79
- **createdAt** (`Date`): Timestamp when the agent was created.
80
-
81
- **updatedAt** (`Date`): Timestamp when the agent was last updated.
82
-
83
- ## Related
84
-
85
- - [Mastra.listStoredAgents()](https://mastra.ai/reference/core/listStoredAgents)
86
- - [Storage overview](https://mastra.ai/reference/storage/overview)
87
- - [Agents overview](https://mastra.ai/docs/agents/overview)
@@ -1,91 +0,0 @@
1
- # Mastra.listStoredAgents()
2
-
3
- The `.listStoredAgents()` method retrieves a paginated list of agent configurations from storage. By default, it returns executable `Agent` instances, but can also return raw storage data.
4
-
5
- ## Usage example
6
-
7
- ```typescript
8
- // Get Agent instances from storage
9
- const { agents, total, hasMore } = await mastra.listStoredAgents()
10
-
11
- for (const agent of agents) {
12
- console.log(agent.id, agent.name)
13
- // Each agent is ready to use
14
- // const response = await agent.generate("Hello");
15
- }
16
- ```
17
-
18
- ```typescript
19
- // Get paginated results with raw storage data
20
- const result = await mastra.listStoredAgents({
21
- page: 0,
22
- perPage: 10,
23
- raw: true,
24
- })
25
-
26
- console.log(`Showing ${result.agents.length} of ${result.total} agents`)
27
- console.log(`Has more: ${result.hasMore}`)
28
-
29
- for (const config of result.agents) {
30
- console.log(config.id, config.name, config.createdAt)
31
- }
32
- ```
33
-
34
- ## Parameters
35
-
36
- **args** (`object`): Optional configuration object for pagination and output format.
37
-
38
- **args.page** (`number`): Zero-indexed page number for pagination.
39
-
40
- **args.perPage** (`number | false`): Number of items per page. Set to \`false\` to fetch all records without pagination.
41
-
42
- **args.raw** (`boolean`): When \`true\`, returns raw \`StorageAgentType\` objects instead of \`Agent\` instances.
43
-
44
- ## Returns
45
-
46
- **agents** (`Agent[] | StorageAgentType[]`): Array of \`Agent\` instances by default, or \`StorageAgentType\` objects when \`raw: true\`.
47
-
48
- **total** (`number`): Total number of stored agents across all pages.
49
-
50
- **page** (`number`): Current page number (zero-indexed).
51
-
52
- **perPage** (`number | false`): Number of items per page, or \`false\` if fetching all.
53
-
54
- **hasMore** (`boolean`): Whether there are more pages available.
55
-
56
- ## Primitive resolution
57
-
58
- When creating `Agent` instances (default behavior), each stored agent's configuration is resolved against registered primitives:
59
-
60
- - **Tools**: Resolved from `tools` registered in Mastra config
61
- - **Workflows**: Resolved from `workflows` registered in Mastra config
62
- - **Subagents**: Resolved from `agents` registered in Mastra config
63
- - **Memory**: Resolved from `memory` registered in Mastra config
64
- - **Scorers**: Resolved from `scorers` registered in Mastra config
65
-
66
- If a referenced primitive isn't found, a warning is logged but the agent is still created.
67
-
68
- ## Example: Iterating through all stored agents
69
-
70
- ```typescript
71
- async function getAllStoredAgents(mastra: Mastra) {
72
- const allAgents: Agent[] = []
73
- let page = 0
74
- let hasMore = true
75
-
76
- while (hasMore) {
77
- const result = await mastra.listStoredAgents({ page, perPage: 50 })
78
- allAgents.push(...result.agents)
79
- hasMore = result.hasMore
80
- page++
81
- }
82
-
83
- return allAgents
84
- }
85
- ```
86
-
87
- ## Related
88
-
89
- - [Mastra.getStoredAgentById()](https://mastra.ai/reference/core/getStoredAgentById)
90
- - [Storage overview](https://mastra.ai/reference/storage/overview)
91
- - [Agents overview](https://mastra.ai/docs/agents/overview)
@@ -1,3 +0,0 @@
1
- export { ModelsDevGateway } from './chunk-BYJDWJCX.js';
2
- //# sourceMappingURL=models-dev-3U6ICCNW.js.map
3
- //# sourceMappingURL=models-dev-3U6ICCNW.js.map
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkUEZU2TA2_cjs = require('./chunk-UEZU2TA2.cjs');
4
-
5
-
6
-
7
- Object.defineProperty(exports, "ModelsDevGateway", {
8
- enumerable: true,
9
- get: function () { return chunkUEZU2TA2_cjs.ModelsDevGateway; }
10
- });
11
- //# sourceMappingURL=models-dev-BJHT4GXA.cjs.map
12
- //# sourceMappingURL=models-dev-BJHT4GXA.cjs.map
@@ -1,3 +0,0 @@
1
- export { NetlifyGateway } from './chunk-D4DCPE5Y.js';
2
- //# sourceMappingURL=netlify-DE3IXMT2.js.map
3
- //# sourceMappingURL=netlify-DE3IXMT2.js.map
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkMSDZQ4DW_cjs = require('./chunk-MSDZQ4DW.cjs');
4
-
5
-
6
-
7
- Object.defineProperty(exports, "NetlifyGateway", {
8
- enumerable: true,
9
- get: function () { return chunkMSDZQ4DW_cjs.NetlifyGateway; }
10
- });
11
- //# sourceMappingURL=netlify-UARJYMCW.cjs.map
12
- //# sourceMappingURL=netlify-UARJYMCW.cjs.map
@@ -1,40 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkKL2IRBNK_cjs = require('./chunk-KL2IRBNK.cjs');
4
-
5
-
6
-
7
- Object.defineProperty(exports, "GatewayRegistry", {
8
- enumerable: true,
9
- get: function () { return chunkKL2IRBNK_cjs.GatewayRegistry; }
10
- });
11
- Object.defineProperty(exports, "PROVIDER_MODELS", {
12
- enumerable: true,
13
- get: function () { return chunkKL2IRBNK_cjs.PROVIDER_MODELS; }
14
- });
15
- Object.defineProperty(exports, "PROVIDER_REGISTRY", {
16
- enumerable: true,
17
- get: function () { return chunkKL2IRBNK_cjs.PROVIDER_REGISTRY; }
18
- });
19
- Object.defineProperty(exports, "getProviderConfig", {
20
- enumerable: true,
21
- get: function () { return chunkKL2IRBNK_cjs.getProviderConfig; }
22
- });
23
- Object.defineProperty(exports, "getRegisteredProviders", {
24
- enumerable: true,
25
- get: function () { return chunkKL2IRBNK_cjs.getRegisteredProviders; }
26
- });
27
- Object.defineProperty(exports, "isProviderRegistered", {
28
- enumerable: true,
29
- get: function () { return chunkKL2IRBNK_cjs.isProviderRegistered; }
30
- });
31
- Object.defineProperty(exports, "isValidModelId", {
32
- enumerable: true,
33
- get: function () { return chunkKL2IRBNK_cjs.isValidModelId; }
34
- });
35
- Object.defineProperty(exports, "parseModelString", {
36
- enumerable: true,
37
- get: function () { return chunkKL2IRBNK_cjs.parseModelString; }
38
- });
39
- //# sourceMappingURL=provider-registry-65CPGTUU.cjs.map
40
- //# sourceMappingURL=provider-registry-65CPGTUU.cjs.map
@@ -1,3 +0,0 @@
1
- export { GatewayRegistry, PROVIDER_MODELS, PROVIDER_REGISTRY, getProviderConfig, getRegisteredProviders, isProviderRegistered, isValidModelId, parseModelString } from './chunk-TKKBZUWD.js';
2
- //# sourceMappingURL=provider-registry-EQAT7FXK.js.map
3
- //# sourceMappingURL=provider-registry-EQAT7FXK.js.map