@mastra/agent-builder 1.0.0-beta.11 → 1.0.0-beta.13
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 +76 -0
- package/dist/agent/index.d.ts +17 -5
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/defaults.d.ts +56 -2203
- package/dist/defaults.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/workflows/task-planning/task-planning.d.ts +20 -815
- package/dist/workflows/task-planning/task-planning.d.ts.map +1 -1
- package/dist/workflows/template-builder/template-builder.d.ts +65 -1648
- package/dist/workflows/template-builder/template-builder.d.ts.map +1 -1
- package/dist/workflows/workflow-builder/tools.d.ts +3 -227
- package/dist/workflows/workflow-builder/tools.d.ts.map +1 -1
- package/dist/workflows/workflow-builder/workflow-builder.d.ts +239 -2430
- package/dist/workflows/workflow-builder/workflow-builder.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
1
|
# @mastra/agent-builder
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.13
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Refactor workflow and tool types to remove Zod-specific constraints ([#11814](https://github.com/mastra-ai/mastra/pull/11814))
|
|
8
|
+
|
|
9
|
+
Removed Zod-specific type constraints across all workflow implementations and tool types, replacing them with generic types. This ensures type consistency across default, evented, and inngest workflows while preparing for Zod v4 migration.
|
|
10
|
+
|
|
11
|
+
**Workflow Changes:**
|
|
12
|
+
- Removed `z.ZodObject<any>` and `z.ZodType<any>` constraints from all workflow generic types
|
|
13
|
+
- Updated method signatures to use `TInput` and `TState` directly instead of `z.infer<TInput>` and `z.infer<TState>`
|
|
14
|
+
- Aligned conditional types across all workflow implementations using `TInput extends unknown` pattern
|
|
15
|
+
- Fixed `TSteps` generic to properly use `TEngineType` instead of `any`
|
|
16
|
+
|
|
17
|
+
**Tool Changes:**
|
|
18
|
+
- Removed Zod schema constraints from `ToolExecutionContext` and related interfaces
|
|
19
|
+
- Simplified type parameters from `TSuspendSchema extends ZodLikeSchema` to `TSuspend` and `TResume`
|
|
20
|
+
- Updated tool execution context types to use generic types
|
|
21
|
+
|
|
22
|
+
**Type Utilities:**
|
|
23
|
+
- Refactored type helpers to work with generic schemas instead of Zod-specific types
|
|
24
|
+
- Updated type extraction utilities for better compatibility
|
|
25
|
+
|
|
26
|
+
This change maintains backward compatibility while improving type consistency and preparing for Zod v4 support across all affected packages.
|
|
27
|
+
|
|
28
|
+
- **Breaking Change**: Convert OUTPUT generic from `OutputSchema` constraint to plain generic ([#11741](https://github.com/mastra-ai/mastra/pull/11741))
|
|
29
|
+
|
|
30
|
+
This change removes the direct dependency on Zod typings in the public API by converting all `OUTPUT extends OutputSchema` generic constraints to plain `OUTPUT` generics throughout the codebase. This is preparation for moving to a standard schema approach.
|
|
31
|
+
- All generic type parameters previously constrained to `OutputSchema` (e.g., `<OUTPUT extends OutputSchema = undefined>`) are now plain generics with defaults (e.g., `<OUTPUT = undefined>`)
|
|
32
|
+
- Affects all public APIs including `Agent`, `MastraModelOutput`, `AgentExecutionOptions`, and stream/generate methods
|
|
33
|
+
- `InferSchemaOutput<OUTPUT>` replaced with `OUTPUT` throughout
|
|
34
|
+
- `PartialSchemaOutput<OUTPUT>` replaced with `Partial<OUTPUT>`
|
|
35
|
+
- Schema fields now use `NonNullable<OutputSchema<OUTPUT>>` instead of `OUTPUT` directly
|
|
36
|
+
- Added `FullOutput<OUTPUT>` type representing complete output with all fields
|
|
37
|
+
- Added `AgentExecutionOptionsBase<OUTPUT>` type
|
|
38
|
+
- `getFullOutput()` method now returns `Promise<FullOutput<OUTPUT>>`
|
|
39
|
+
- `Agent` class now generic: `Agent<TAgentId, TTools, TOutput>`
|
|
40
|
+
- `agent.generate()` and `agent.stream()` methods have updated signatures
|
|
41
|
+
- `MastraModelOutput<OUTPUT>` no longer requires `OutputSchema` constraint
|
|
42
|
+
- Network route and streaming APIs updated to use plain OUTPUT generic
|
|
43
|
+
|
|
44
|
+
**Before:**
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const output = await agent.generate<z.ZodType>({
|
|
48
|
+
messages: [...],
|
|
49
|
+
structuredOutput: { schema: mySchema }
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
**After:**
|
|
53
|
+
const output = await agent.generate<z.infer<typeof mySchema>>({
|
|
54
|
+
messages: [...],
|
|
55
|
+
structuredOutput: { schema: mySchema }
|
|
56
|
+
});
|
|
57
|
+
// Or rely on type inference:
|
|
58
|
+
const output = await agent.generate({
|
|
59
|
+
messages: [...],
|
|
60
|
+
structuredOutput: { schema: mySchema }
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [[`ebae12a`](https://github.com/mastra-ai/mastra/commit/ebae12a2dd0212e75478981053b148a2c246962d), [`c61a0a5`](https://github.com/mastra-ai/mastra/commit/c61a0a5de4904c88fd8b3718bc26d1be1c2ec6e7), [`69136e7`](https://github.com/mastra-ai/mastra/commit/69136e748e32f57297728a4e0f9a75988462f1a7), [`449aed2`](https://github.com/mastra-ai/mastra/commit/449aed2ba9d507b75bf93d427646ea94f734dfd1), [`eb648a2`](https://github.com/mastra-ai/mastra/commit/eb648a2cc1728f7678768dd70cd77619b448dab9), [`0131105`](https://github.com/mastra-ai/mastra/commit/0131105532e83bdcbb73352fc7d0879eebf140dc), [`9d5059e`](https://github.com/mastra-ai/mastra/commit/9d5059eae810829935fb08e81a9bb7ecd5b144a7), [`ef756c6`](https://github.com/mastra-ai/mastra/commit/ef756c65f82d16531c43f49a27290a416611e526), [`b00ccd3`](https://github.com/mastra-ai/mastra/commit/b00ccd325ebd5d9e37e34dd0a105caae67eb568f), [`3bdfa75`](https://github.com/mastra-ai/mastra/commit/3bdfa7507a91db66f176ba8221aa28dd546e464a), [`c583f71`](https://github.com/mastra-ai/mastra/commit/c583f71a86651f04256c708f0625ebb609cd8405), [`e770de9`](https://github.com/mastra-ai/mastra/commit/e770de941a287a49b1964d44db5a5763d19890a6), [`52e2716`](https://github.com/mastra-ai/mastra/commit/52e2716b42df6eff443de72360ae83e86ec23993), [`27b4040`](https://github.com/mastra-ai/mastra/commit/27b4040bfa1a95d92546f420a02a626b1419a1d6), [`610a70b`](https://github.com/mastra-ai/mastra/commit/610a70bdad282079f0c630e0d7bb284578f20151), [`8dc7f55`](https://github.com/mastra-ai/mastra/commit/8dc7f55900395771da851dc7d78d53ae84fe34ec), [`8379099`](https://github.com/mastra-ai/mastra/commit/8379099fc467af6bef54dd7f80c9bd75bf8bbddf), [`8c0ec25`](https://github.com/mastra-ai/mastra/commit/8c0ec25646c8a7df253ed1e5ff4863a0d3f1316c), [`ff4d9a6`](https://github.com/mastra-ai/mastra/commit/ff4d9a6704fc87b31a380a76ed22736fdedbba5a), [`69821ef`](https://github.com/mastra-ai/mastra/commit/69821ef806482e2c44e2197ac0b050c3fe3a5285), [`1ed5716`](https://github.com/mastra-ai/mastra/commit/1ed5716830867b3774c4a1b43cc0d82935f32b96), [`4186bdd`](https://github.com/mastra-ai/mastra/commit/4186bdd00731305726fa06adba0b076a1d50b49f), [`7aaf973`](https://github.com/mastra-ai/mastra/commit/7aaf973f83fbbe9521f1f9e7a4fd99b8de464617)]:
|
|
68
|
+
- @mastra/core@1.0.0-beta.22
|
|
69
|
+
- @mastra/memory@1.0.0-beta.13
|
|
70
|
+
|
|
71
|
+
## 1.0.0-beta.12
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [[`08766f1`](https://github.com/mastra-ai/mastra/commit/08766f15e13ac0692fde2a8bd366c2e16e4321df), [`ae8baf7`](https://github.com/mastra-ai/mastra/commit/ae8baf7d8adcb0ff9dac11880400452bc49b33ff), [`cfabdd4`](https://github.com/mastra-ai/mastra/commit/cfabdd4aae7a726b706942d6836eeca110fb6267), [`a0e437f`](https://github.com/mastra-ai/mastra/commit/a0e437fac561b28ee719e0302d72b2f9b4c138f0), [`bec5efd`](https://github.com/mastra-ai/mastra/commit/bec5efde96653ccae6604e68c696d1bc6c1a0bf5), [`9eedf7d`](https://github.com/mastra-ai/mastra/commit/9eedf7de1d6e0022a2f4e5e9e6fe1ec468f9b43c)]:
|
|
76
|
+
- @mastra/core@1.0.0-beta.21
|
|
77
|
+
- @mastra/memory@1.0.0-beta.12
|
|
78
|
+
|
|
3
79
|
## 1.0.0-beta.11
|
|
4
80
|
|
|
5
81
|
### Patch Changes
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Agent } from '@mastra/core/agent';
|
|
2
|
-
import type { AgentExecutionOptions } from '@mastra/core/agent';
|
|
2
|
+
import type { AgentExecutionOptions, StructuredOutputOptions, AgentExecutionOptionsBase, ToolsInput } from '@mastra/core/agent';
|
|
3
3
|
import type { MessageListInput } from '@mastra/core/agent/message-list';
|
|
4
|
-
import type { MastraModelOutput,
|
|
4
|
+
import type { MastraModelOutput, FullOutput } from '@mastra/core/stream';
|
|
5
5
|
import type { AgentBuilderConfig } from '../types.js';
|
|
6
|
-
export declare class AgentBuilder extends Agent {
|
|
6
|
+
export declare class AgentBuilder<TTools extends ToolsInput = ToolsInput, TOutput = undefined> extends Agent<'agent-builder', TTools, TOutput> {
|
|
7
7
|
private builderConfig;
|
|
8
8
|
/**
|
|
9
9
|
* Constructor for AgentBuilder
|
|
@@ -23,7 +23,19 @@ export declare class AgentBuilder extends Agent {
|
|
|
23
23
|
* Enhanced stream method with AgentBuilder-specific configuration
|
|
24
24
|
* Overrides the base Agent stream method to provide additional project context
|
|
25
25
|
*/
|
|
26
|
-
stream<OUTPUT extends
|
|
27
|
-
|
|
26
|
+
stream<OUTPUT extends {}>(messages: MessageListInput, streamOptions: AgentExecutionOptionsBase<OUTPUT> & {
|
|
27
|
+
structuredOutput: StructuredOutputOptions<OUTPUT>;
|
|
28
|
+
}): Promise<MastraModelOutput<OUTPUT>>;
|
|
29
|
+
stream<OUTPUT>(messages: MessageListInput, streamOptions: AgentExecutionOptionsBase<any> & {
|
|
30
|
+
structuredOutput?: StructuredOutputOptions<any>;
|
|
31
|
+
}): Promise<MastraModelOutput<OUTPUT>>;
|
|
32
|
+
stream(messages: MessageListInput, streamOptions?: AgentExecutionOptions): Promise<MastraModelOutput>;
|
|
33
|
+
generate(messages: MessageListInput, options?: AgentExecutionOptions<TOutput>): Promise<FullOutput<TOutput>>;
|
|
34
|
+
generate<OUTPUT extends {}>(messages: MessageListInput, options: AgentExecutionOptionsBase<OUTPUT> & {
|
|
35
|
+
structuredOutput: StructuredOutputOptions<OUTPUT>;
|
|
36
|
+
}): Promise<FullOutput<OUTPUT>>;
|
|
37
|
+
generate<OUTPUT>(messages: MessageListInput, options?: AgentExecutionOptionsBase<any> & {
|
|
38
|
+
structuredOutput?: StructuredOutputOptions<any>;
|
|
39
|
+
}): Promise<FullOutput<OUTPUT>>;
|
|
28
40
|
}
|
|
29
41
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAIV,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EAIV,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,iBAAiB,EAAE,U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