@mastra/code-sdk 1.2.0-alpha.8 → 1.2.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.
Files changed (132) hide show
  1. package/CHANGELOG.md +237 -0
  2. package/README.md +22 -0
  3. package/dist/agents/model.d.ts.map +1 -1
  4. package/dist/agents/model.js +5 -2
  5. package/dist/agents/model.js.map +1 -1
  6. package/dist/agents/modes/build.d.ts.map +1 -1
  7. package/dist/agents/modes/build.js +6 -1
  8. package/dist/agents/modes/build.js.map +1 -1
  9. package/dist/agents/modes/explore.d.ts.map +1 -1
  10. package/dist/agents/modes/explore.js +4 -1
  11. package/dist/agents/modes/explore.js.map +1 -1
  12. package/dist/agents/modes/plan.d.ts.map +1 -1
  13. package/dist/agents/modes/plan.js +8 -3
  14. package/dist/agents/modes/plan.js.map +1 -1
  15. package/dist/agents/prompts/index.d.ts.map +1 -1
  16. package/dist/agents/prompts/index.js +4 -1
  17. package/dist/agents/prompts/index.js.map +1 -1
  18. package/dist/agents/prompts/plan.d.ts +1 -1
  19. package/dist/agents/prompts/plan.d.ts.map +1 -1
  20. package/dist/agents/prompts/plan.js +2 -2
  21. package/dist/agents/prompts/plan.js.map +1 -1
  22. package/dist/agents/prompts/tool-guidance.d.ts +2 -0
  23. package/dist/agents/prompts/tool-guidance.d.ts.map +1 -1
  24. package/dist/agents/prompts/tool-guidance.js +3 -2
  25. package/dist/agents/prompts/tool-guidance.js.map +1 -1
  26. package/dist/agents/tool-availability.d.ts.map +1 -1
  27. package/dist/agents/tool-availability.js +15 -6
  28. package/dist/agents/tool-availability.js.map +1 -1
  29. package/dist/agents/tools.d.ts +16 -0
  30. package/dist/agents/tools.d.ts.map +1 -1
  31. package/dist/agents/tools.js +16 -3
  32. package/dist/agents/tools.js.map +1 -1
  33. package/dist/agents/workflow-builder-agent.d.ts +2 -0
  34. package/dist/agents/workflow-builder-agent.d.ts.map +1 -0
  35. package/dist/agents/workflow-builder-agent.js +80 -0
  36. package/dist/agents/workflow-builder-agent.js.map +1 -0
  37. package/dist/headless/cli.d.ts.map +1 -1
  38. package/dist/headless/cli.js +3 -0
  39. package/dist/headless/cli.js.map +1 -1
  40. package/dist/hooks/manager.d.ts +9 -2
  41. package/dist/hooks/manager.d.ts.map +1 -1
  42. package/dist/hooks/manager.js +19 -3
  43. package/dist/hooks/manager.js.map +1 -1
  44. package/dist/hooks/types.d.ts +20 -0
  45. package/dist/hooks/types.d.ts.map +1 -1
  46. package/dist/hooks/types.js.map +1 -1
  47. package/dist/index.d.ts +73 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +204 -69
  50. package/dist/index.js.map +1 -1
  51. package/dist/permissions.d.ts.map +1 -1
  52. package/dist/permissions.js +6 -1
  53. package/dist/permissions.js.map +1 -1
  54. package/dist/plugin.d.ts +64 -1
  55. package/dist/plugin.d.ts.map +1 -1
  56. package/dist/plugin.js +3 -1
  57. package/dist/plugin.js.map +1 -1
  58. package/dist/plugins/loader.d.ts +7 -3
  59. package/dist/plugins/loader.d.ts.map +1 -1
  60. package/dist/plugins/loader.js +53 -1
  61. package/dist/plugins/loader.js.map +1 -1
  62. package/dist/plugins/manager.d.ts +36 -2
  63. package/dist/plugins/manager.d.ts.map +1 -1
  64. package/dist/plugins/manager.js +74 -2
  65. package/dist/plugins/manager.js.map +1 -1
  66. package/dist/plugins/signal-lane.d.ts +58 -0
  67. package/dist/plugins/signal-lane.d.ts.map +1 -0
  68. package/dist/plugins/signal-lane.js +166 -0
  69. package/dist/plugins/signal-lane.js.map +1 -0
  70. package/dist/plugins/types.d.ts +36 -0
  71. package/dist/plugins/types.d.ts.map +1 -1
  72. package/dist/tools/workflows/create-workflow.d.ts +7 -0
  73. package/dist/tools/workflows/create-workflow.d.ts.map +1 -0
  74. package/dist/tools/workflows/create-workflow.js +81 -0
  75. package/dist/tools/workflows/create-workflow.js.map +1 -0
  76. package/dist/tools/workflows/delete-workflow.d.ts +7 -0
  77. package/dist/tools/workflows/delete-workflow.d.ts.map +1 -0
  78. package/dist/tools/workflows/delete-workflow.js +21 -0
  79. package/dist/tools/workflows/delete-workflow.js.map +1 -0
  80. package/dist/tools/workflows/ephemeral-memory.d.ts +7 -0
  81. package/dist/tools/workflows/ephemeral-memory.d.ts.map +1 -0
  82. package/dist/tools/workflows/ephemeral-memory.js +45 -0
  83. package/dist/tools/workflows/ephemeral-memory.js.map +1 -0
  84. package/dist/tools/workflows/extract-json-schema.d.ts +12 -0
  85. package/dist/tools/workflows/extract-json-schema.d.ts.map +1 -0
  86. package/dist/tools/workflows/extract-json-schema.js +22 -0
  87. package/dist/tools/workflows/extract-json-schema.js.map +1 -0
  88. package/dist/tools/workflows/get-workflow.d.ts +11 -0
  89. package/dist/tools/workflows/get-workflow.d.ts.map +1 -0
  90. package/dist/tools/workflows/get-workflow.js +34 -0
  91. package/dist/tools/workflows/get-workflow.js.map +1 -0
  92. package/dist/tools/workflows/list-available-agents.d.ts +8 -0
  93. package/dist/tools/workflows/list-available-agents.d.ts.map +1 -0
  94. package/dist/tools/workflows/list-available-agents.js +32 -0
  95. package/dist/tools/workflows/list-available-agents.js.map +1 -0
  96. package/dist/tools/workflows/list-available-tools.d.ts +9 -0
  97. package/dist/tools/workflows/list-available-tools.d.ts.map +1 -0
  98. package/dist/tools/workflows/list-available-tools.js +40 -0
  99. package/dist/tools/workflows/list-available-tools.js.map +1 -0
  100. package/dist/tools/workflows/list-available-workflows.d.ts +9 -0
  101. package/dist/tools/workflows/list-available-workflows.d.ts.map +1 -0
  102. package/dist/tools/workflows/list-available-workflows.js +32 -0
  103. package/dist/tools/workflows/list-available-workflows.js.map +1 -0
  104. package/dist/tools/workflows/list-workflows.d.ts +9 -0
  105. package/dist/tools/workflows/list-workflows.d.ts.map +1 -0
  106. package/dist/tools/workflows/list-workflows.js +33 -0
  107. package/dist/tools/workflows/list-workflows.js.map +1 -0
  108. package/dist/tools/workflows/run-workflow.d.ts +9 -0
  109. package/dist/tools/workflows/run-workflow.d.ts.map +1 -0
  110. package/dist/tools/workflows/run-workflow.js +52 -0
  111. package/dist/tools/workflows/run-workflow.js.map +1 -0
  112. package/dist/tools/workflows/save-workflow.d.ts +369 -0
  113. package/dist/tools/workflows/save-workflow.d.ts.map +1 -0
  114. package/dist/tools/workflows/save-workflow.js +28 -0
  115. package/dist/tools/workflows/save-workflow.js.map +1 -0
  116. package/dist/tools/workflows/tool-ids.d.ts +15 -0
  117. package/dist/tools/workflows/tool-ids.d.ts.map +1 -0
  118. package/dist/tools/workflows/tool-ids.js +19 -0
  119. package/dist/tools/workflows/tool-ids.js.map +1 -0
  120. package/dist/utils/plans.d.ts +9 -6
  121. package/dist/utils/plans.d.ts.map +1 -1
  122. package/dist/utils/plans.js +11 -11
  123. package/dist/utils/plans.js.map +1 -1
  124. package/dist/workflows/register-primitives.d.ts +52 -0
  125. package/dist/workflows/register-primitives.d.ts.map +1 -0
  126. package/dist/workflows/register-primitives.js +39 -0
  127. package/dist/workflows/register-primitives.js.map +1 -0
  128. package/dist/workflows/service.d.ts +64 -0
  129. package/dist/workflows/service.d.ts.map +1 -0
  130. package/dist/workflows/service.js +53 -0
  131. package/dist/workflows/service.js.map +1 -0
  132. package/package.json +15 -15
@@ -0,0 +1,369 @@
1
+ import { z } from 'zod';
2
+ export { WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION as MAPPING_CONFIG_DESCRIPTION } from '@mastra/core/workflows/builder';
3
+ export declare const workflowDefinitionInputSchema: z.ZodPreprocess<z.ZodObject<{
4
+ id: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7
+ inputSchema: z.ZodUnknown;
8
+ outputSchema: z.ZodUnknown;
9
+ stateSchema: z.ZodOptional<z.ZodUnknown>;
10
+ requestContextSchema: z.ZodOptional<z.ZodUnknown>;
11
+ graph: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ type: z.ZodLiteral<"agent">;
13
+ id: z.ZodString;
14
+ agentId: z.ZodString;
15
+ description: z.ZodOptional<z.ZodString>;
16
+ outputSchema: z.ZodOptional<z.ZodUnknown>;
17
+ options: z.ZodOptional<z.ZodObject<{
18
+ retries: z.ZodOptional<z.ZodNumber>;
19
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strict>, z.ZodObject<{
22
+ type: z.ZodLiteral<"tool">;
23
+ id: z.ZodString;
24
+ toolId: z.ZodString;
25
+ description: z.ZodOptional<z.ZodString>;
26
+ options: z.ZodOptional<z.ZodObject<{
27
+ retries: z.ZodOptional<z.ZodNumber>;
28
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
+ }, z.core.$strip>>;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ type: z.ZodLiteral<"mapping">;
32
+ id: z.ZodString;
33
+ mapConfig: z.ZodString;
34
+ }, z.core.$strict>, z.ZodObject<{
35
+ type: z.ZodLiteral<"workflow">;
36
+ id: z.ZodString;
37
+ workflowId: z.ZodString;
38
+ description: z.ZodOptional<z.ZodString>;
39
+ options: z.ZodOptional<z.ZodObject<{
40
+ retries: z.ZodOptional<z.ZodNumber>;
41
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strict>, z.ZodObject<{
44
+ type: z.ZodLiteral<"parallel">;
45
+ steps: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
46
+ type: z.ZodLiteral<"agent">;
47
+ id: z.ZodString;
48
+ agentId: z.ZodString;
49
+ description: z.ZodOptional<z.ZodString>;
50
+ outputSchema: z.ZodOptional<z.ZodUnknown>;
51
+ options: z.ZodOptional<z.ZodObject<{
52
+ retries: z.ZodOptional<z.ZodNumber>;
53
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strict>, z.ZodObject<{
56
+ type: z.ZodLiteral<"tool">;
57
+ id: z.ZodString;
58
+ toolId: z.ZodString;
59
+ description: z.ZodOptional<z.ZodString>;
60
+ options: z.ZodOptional<z.ZodObject<{
61
+ retries: z.ZodOptional<z.ZodNumber>;
62
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
63
+ }, z.core.$strip>>;
64
+ }, z.core.$strict>, z.ZodObject<{
65
+ type: z.ZodLiteral<"workflow">;
66
+ id: z.ZodString;
67
+ workflowId: z.ZodString;
68
+ description: z.ZodOptional<z.ZodString>;
69
+ options: z.ZodOptional<z.ZodObject<{
70
+ retries: z.ZodOptional<z.ZodNumber>;
71
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strict>]>>;
74
+ }, z.core.$strict>, z.ZodObject<{
75
+ type: z.ZodLiteral<"foreach">;
76
+ step: z.ZodUnion<readonly [z.ZodObject<{
77
+ type: z.ZodLiteral<"agent">;
78
+ id: z.ZodString;
79
+ agentId: z.ZodString;
80
+ description: z.ZodOptional<z.ZodString>;
81
+ outputSchema: z.ZodOptional<z.ZodUnknown>;
82
+ options: z.ZodOptional<z.ZodObject<{
83
+ retries: z.ZodOptional<z.ZodNumber>;
84
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
85
+ }, z.core.$strip>>;
86
+ }, z.core.$strict>, z.ZodObject<{
87
+ type: z.ZodLiteral<"tool">;
88
+ id: z.ZodString;
89
+ toolId: z.ZodString;
90
+ description: z.ZodOptional<z.ZodString>;
91
+ options: z.ZodOptional<z.ZodObject<{
92
+ retries: z.ZodOptional<z.ZodNumber>;
93
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
94
+ }, z.core.$strip>>;
95
+ }, z.core.$strict>, z.ZodObject<{
96
+ type: z.ZodLiteral<"workflow">;
97
+ id: z.ZodString;
98
+ workflowId: z.ZodString;
99
+ description: z.ZodOptional<z.ZodString>;
100
+ options: z.ZodOptional<z.ZodObject<{
101
+ retries: z.ZodOptional<z.ZodNumber>;
102
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strict>]>;
105
+ opts: z.ZodOptional<z.ZodObject<{
106
+ concurrency: z.ZodNumber;
107
+ }, z.core.$strip>>;
108
+ }, z.core.$strict>, z.ZodObject<{
109
+ type: z.ZodLiteral<"sleep">;
110
+ id: z.ZodString;
111
+ duration: z.ZodNumber;
112
+ }, z.core.$strict>, z.ZodObject<{
113
+ type: z.ZodLiteral<"sleepUntil">;
114
+ id: z.ZodString;
115
+ date: z.ZodString;
116
+ }, z.core.$strict>, z.ZodObject<{
117
+ type: z.ZodLiteral<"conditional">;
118
+ steps: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
119
+ type: z.ZodLiteral<"agent">;
120
+ id: z.ZodString;
121
+ agentId: z.ZodString;
122
+ description: z.ZodOptional<z.ZodString>;
123
+ outputSchema: z.ZodOptional<z.ZodUnknown>;
124
+ options: z.ZodOptional<z.ZodObject<{
125
+ retries: z.ZodOptional<z.ZodNumber>;
126
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
127
+ }, z.core.$strip>>;
128
+ }, z.core.$strict>, z.ZodObject<{
129
+ type: z.ZodLiteral<"tool">;
130
+ id: z.ZodString;
131
+ toolId: z.ZodString;
132
+ description: z.ZodOptional<z.ZodString>;
133
+ options: z.ZodOptional<z.ZodObject<{
134
+ retries: z.ZodOptional<z.ZodNumber>;
135
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
136
+ }, z.core.$strip>>;
137
+ }, z.core.$strict>, z.ZodObject<{
138
+ type: z.ZodLiteral<"workflow">;
139
+ id: z.ZodString;
140
+ workflowId: z.ZodString;
141
+ description: z.ZodOptional<z.ZodString>;
142
+ options: z.ZodOptional<z.ZodObject<{
143
+ retries: z.ZodOptional<z.ZodNumber>;
144
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
145
+ }, z.core.$strip>>;
146
+ }, z.core.$strict>]>>;
147
+ predicates: z.ZodArray<z.ZodType<import("@mastra/core/workflows").Predicate, unknown, z.core.$ZodTypeInternals<import("@mastra/core/workflows").Predicate, unknown>>>;
148
+ }, z.core.$strict>, z.ZodObject<{
149
+ type: z.ZodLiteral<"loop">;
150
+ step: z.ZodUnion<readonly [z.ZodObject<{
151
+ type: z.ZodLiteral<"agent">;
152
+ id: z.ZodString;
153
+ agentId: z.ZodString;
154
+ description: z.ZodOptional<z.ZodString>;
155
+ outputSchema: z.ZodOptional<z.ZodUnknown>;
156
+ options: z.ZodOptional<z.ZodObject<{
157
+ retries: z.ZodOptional<z.ZodNumber>;
158
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
159
+ }, z.core.$strip>>;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ type: z.ZodLiteral<"tool">;
162
+ id: z.ZodString;
163
+ toolId: z.ZodString;
164
+ description: z.ZodOptional<z.ZodString>;
165
+ options: z.ZodOptional<z.ZodObject<{
166
+ retries: z.ZodOptional<z.ZodNumber>;
167
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
168
+ }, z.core.$strip>>;
169
+ }, z.core.$strict>, z.ZodObject<{
170
+ type: z.ZodLiteral<"workflow">;
171
+ id: z.ZodString;
172
+ workflowId: z.ZodString;
173
+ description: z.ZodOptional<z.ZodString>;
174
+ options: z.ZodOptional<z.ZodObject<{
175
+ retries: z.ZodOptional<z.ZodNumber>;
176
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, z.core.$strip>>;
178
+ }, z.core.$strict>]>;
179
+ loopType: z.ZodEnum<{
180
+ dowhile: "dowhile";
181
+ dountil: "dountil";
182
+ }>;
183
+ predicate: z.ZodType<import("@mastra/core/workflows").Predicate, unknown, z.core.$ZodTypeInternals<import("@mastra/core/workflows").Predicate, unknown>>;
184
+ }, z.core.$strict>], "type">>;
185
+ }, z.core.$strict>>;
186
+ export declare const saveWorkflowTool: import("@mastra/core/tools").Tool<{
187
+ id: string;
188
+ inputSchema: unknown;
189
+ outputSchema: unknown;
190
+ graph: ({
191
+ type: "agent";
192
+ id: string;
193
+ agentId: string;
194
+ description?: string | undefined;
195
+ outputSchema?: unknown;
196
+ options?: {
197
+ retries?: number | undefined;
198
+ metadata?: Record<string, unknown> | undefined;
199
+ } | undefined;
200
+ } | {
201
+ type: "tool";
202
+ id: string;
203
+ toolId: string;
204
+ description?: string | undefined;
205
+ options?: {
206
+ retries?: number | undefined;
207
+ metadata?: Record<string, unknown> | undefined;
208
+ } | undefined;
209
+ } | {
210
+ type: "mapping";
211
+ id: string;
212
+ mapConfig: string;
213
+ } | {
214
+ type: "workflow";
215
+ id: string;
216
+ workflowId: string;
217
+ description?: string | undefined;
218
+ options?: {
219
+ retries?: number | undefined;
220
+ metadata?: Record<string, unknown> | undefined;
221
+ } | undefined;
222
+ } | {
223
+ type: "parallel";
224
+ steps: ({
225
+ type: "agent";
226
+ id: string;
227
+ agentId: string;
228
+ description?: string | undefined;
229
+ outputSchema?: unknown;
230
+ options?: {
231
+ retries?: number | undefined;
232
+ metadata?: Record<string, unknown> | undefined;
233
+ } | undefined;
234
+ } | {
235
+ type: "tool";
236
+ id: string;
237
+ toolId: string;
238
+ description?: string | undefined;
239
+ options?: {
240
+ retries?: number | undefined;
241
+ metadata?: Record<string, unknown> | undefined;
242
+ } | undefined;
243
+ } | {
244
+ type: "workflow";
245
+ id: string;
246
+ workflowId: string;
247
+ description?: string | undefined;
248
+ options?: {
249
+ retries?: number | undefined;
250
+ metadata?: Record<string, unknown> | undefined;
251
+ } | undefined;
252
+ })[];
253
+ } | {
254
+ type: "foreach";
255
+ step: {
256
+ type: "agent";
257
+ id: string;
258
+ agentId: string;
259
+ description?: string | undefined;
260
+ outputSchema?: unknown;
261
+ options?: {
262
+ retries?: number | undefined;
263
+ metadata?: Record<string, unknown> | undefined;
264
+ } | undefined;
265
+ } | {
266
+ type: "tool";
267
+ id: string;
268
+ toolId: string;
269
+ description?: string | undefined;
270
+ options?: {
271
+ retries?: number | undefined;
272
+ metadata?: Record<string, unknown> | undefined;
273
+ } | undefined;
274
+ } | {
275
+ type: "workflow";
276
+ id: string;
277
+ workflowId: string;
278
+ description?: string | undefined;
279
+ options?: {
280
+ retries?: number | undefined;
281
+ metadata?: Record<string, unknown> | undefined;
282
+ } | undefined;
283
+ };
284
+ opts?: {
285
+ concurrency: number;
286
+ } | undefined;
287
+ } | {
288
+ type: "sleep";
289
+ id: string;
290
+ duration: number;
291
+ } | {
292
+ type: "sleepUntil";
293
+ id: string;
294
+ date: string;
295
+ } | {
296
+ type: "conditional";
297
+ steps: ({
298
+ type: "agent";
299
+ id: string;
300
+ agentId: string;
301
+ description?: string | undefined;
302
+ outputSchema?: unknown;
303
+ options?: {
304
+ retries?: number | undefined;
305
+ metadata?: Record<string, unknown> | undefined;
306
+ } | undefined;
307
+ } | {
308
+ type: "tool";
309
+ id: string;
310
+ toolId: string;
311
+ description?: string | undefined;
312
+ options?: {
313
+ retries?: number | undefined;
314
+ metadata?: Record<string, unknown> | undefined;
315
+ } | undefined;
316
+ } | {
317
+ type: "workflow";
318
+ id: string;
319
+ workflowId: string;
320
+ description?: string | undefined;
321
+ options?: {
322
+ retries?: number | undefined;
323
+ metadata?: Record<string, unknown> | undefined;
324
+ } | undefined;
325
+ })[];
326
+ predicates: import("@mastra/core/workflows").Predicate[];
327
+ } | {
328
+ type: "loop";
329
+ step: {
330
+ type: "agent";
331
+ id: string;
332
+ agentId: string;
333
+ description?: string | undefined;
334
+ outputSchema?: unknown;
335
+ options?: {
336
+ retries?: number | undefined;
337
+ metadata?: Record<string, unknown> | undefined;
338
+ } | undefined;
339
+ } | {
340
+ type: "tool";
341
+ id: string;
342
+ toolId: string;
343
+ description?: string | undefined;
344
+ options?: {
345
+ retries?: number | undefined;
346
+ metadata?: Record<string, unknown> | undefined;
347
+ } | undefined;
348
+ } | {
349
+ type: "workflow";
350
+ id: string;
351
+ workflowId: string;
352
+ description?: string | undefined;
353
+ options?: {
354
+ retries?: number | undefined;
355
+ metadata?: Record<string, unknown> | undefined;
356
+ } | undefined;
357
+ };
358
+ loopType: "dowhile" | "dountil";
359
+ predicate: import("@mastra/core/workflows").Predicate;
360
+ })[];
361
+ description?: string | undefined;
362
+ metadata?: Record<string, unknown> | undefined;
363
+ stateSchema?: unknown;
364
+ requestContextSchema?: unknown;
365
+ }, {
366
+ ok: true;
367
+ id: string;
368
+ }, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "save-workflow", unknown>;
369
+ //# sourceMappingURL=save-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-workflow.d.ts","sourceRoot":"","sources":["../../../src/tools/workflows/save-workflow.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,2CAA2C,IAAI,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE3H,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAGzC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4HAsB3B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { createTool } from "@mastra/core/tools";
2
+ import { z } from "zod";
3
+ import { WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION as MAPPING_CONFIG_DESCRIPTION, normalizeWorkflowBuilderDefinition, workflowBuilderDefinitionSchema } from "@mastra/core/workflows/builder";
4
+ //#region src/tools/workflows/save-workflow.ts
5
+ const workflowDefinitionInputSchema = z.preprocess(normalizeWorkflowBuilderDefinition, workflowBuilderDefinitionSchema);
6
+ const saveWorkflowTool = createTool({
7
+ id: "save-workflow",
8
+ description: "Persist a Dynamic Workflow definition and live-register it on the running Mastra instance. Supports all ten persisted graph families: agent, tool, mapping, nested workflow, parallel, foreach, sleep, sleepUntil, conditional, and loop. Conditional and loop entries require declarative predicates; JS closures cannot round-trip through storage. After this returns, the workflow is immediately runnable. Call it exactly once with the complete definition; there is no incremental save API.",
9
+ inputSchema: workflowDefinitionInputSchema,
10
+ outputSchema: z.object({
11
+ ok: z.literal(true),
12
+ id: z.string()
13
+ }),
14
+ execute: async (def, { mastra }) => {
15
+ if (!mastra) throw new Error("save-workflow requires a Mastra context.");
16
+ const m = mastra;
17
+ const normalizedDefinition = normalizeWorkflowBuilderDefinition(def);
18
+ await m.addDynamicWorkflow(normalizedDefinition);
19
+ return {
20
+ ok: true,
21
+ id: normalizedDefinition.id
22
+ };
23
+ }
24
+ });
25
+ //#endregion
26
+ export { MAPPING_CONFIG_DESCRIPTION, saveWorkflowTool, workflowDefinitionInputSchema };
27
+
28
+ //# sourceMappingURL=save-workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-workflow.js","names":[],"sources":["../../../src/tools/workflows/save-workflow.ts"],"sourcesContent":["/**\n * Sub-agent tool: persist the Dynamic Workflow definition and live-register it.\n * Calls `mastra.addDynamicWorkflow()`. After this returns the workflow is\n * immediately runnable.\n *\n * The complete-definition authoring contract (graph families, mapping sources,\n * predicate DSL, and all model-facing guidance) is shared with Studio's\n * `submit-workflow-draft` and lives in `@mastra/core/workflows/builder`.\n */\nimport type { Mastra } from '@mastra/core/mastra';\nimport { createTool } from '@mastra/core/tools';\nimport { normalizeWorkflowBuilderDefinition, workflowBuilderDefinitionSchema } from '@mastra/core/workflows/builder';\nimport { z } from 'zod';\n\nexport { WORKFLOW_BUILDER_MAPPING_CONFIG_DESCRIPTION as MAPPING_CONFIG_DESCRIPTION } from '@mastra/core/workflows/builder';\n\nexport const workflowDefinitionInputSchema = z.preprocess(\n normalizeWorkflowBuilderDefinition,\n workflowBuilderDefinitionSchema,\n);\n\nexport const saveWorkflowTool = createTool({\n id: 'save-workflow',\n description:\n 'Persist a Dynamic Workflow definition and live-register it on the running Mastra instance. Supports all ten persisted graph families: agent, tool, mapping, nested workflow, parallel, foreach, sleep, sleepUntil, conditional, and loop. Conditional and loop entries require declarative predicates; JS closures cannot round-trip through storage. After this returns, the workflow is immediately runnable. Call it exactly once with the complete definition; there is no incremental save API.',\n inputSchema: workflowDefinitionInputSchema,\n outputSchema: z.object({\n ok: z.literal(true),\n id: z.string(),\n }),\n execute: async (def, { mastra }) => {\n if (!mastra) throw new Error('save-workflow requires a Mastra context.');\n const m = mastra as Mastra;\n const normalizedDefinition = normalizeWorkflowBuilderDefinition(def);\n\n // `mastra.addDynamicWorkflow` performs registry pre-flight — a mis-classified\n // agentId/toolId or unregistered id throws before rehydration with an\n // actionable message listing every offender. It also rejects JSON Schemas\n // that use keywords the storage-side converter can't rehydrate\n // (oneOf/anyOf/allOf/not/$ref/patternProperties/discriminator).\n await m.addDynamicWorkflow(normalizedDefinition as Parameters<Mastra['addDynamicWorkflow']>[0]);\n return { ok: true as const, id: normalizedDefinition.id };\n },\n});\n"],"mappings":";;;;AAgBA,MAAa,gCAAgC,EAAE,WAC7C,oCACA,+BACF;AAEA,MAAa,mBAAmB,WAAW;CACzC,IAAI;CACJ,aACE;CACF,aAAa;CACb,cAAc,EAAE,OAAO;EACrB,IAAI,EAAE,QAAQ,IAAI;EAClB,IAAI,EAAE,OAAO;CACf,CAAC;CACD,SAAS,OAAO,KAAK,EAAE,aAAa;EAClC,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,0CAA0C;EACvE,MAAM,IAAI;EACV,MAAM,uBAAuB,mCAAmC,GAAG;EAOnE,MAAM,EAAE,mBAAmB,oBAAmE;EAC9F,OAAO;GAAE,IAAI;GAAe,IAAI,qBAAqB;EAAG;CAC1D;AACF,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare const WORKFLOW_AUTHORING_TOOL_IDS: {
2
+ readonly listAgents: "list-available-agents";
3
+ readonly listTools: "list-available-tools";
4
+ readonly listWorkflows: "list-available-workflows";
5
+ readonly saveWorkflow: "save-workflow";
6
+ };
7
+ export declare const WORKFLOW_MANAGEMENT_TOOL_IDS: {
8
+ readonly createWorkflow: "create-workflow";
9
+ readonly listWorkflows: "list-workflows";
10
+ readonly getWorkflow: "get-workflow";
11
+ readonly runWorkflow: "run-workflow";
12
+ readonly deleteWorkflow: "delete-workflow";
13
+ };
14
+ export declare const WORKFLOW_BUILDER_NOISE_TOOL_IDS: readonly ("create-workflow" | "delete-workflow" | "get-workflow" | "list-workflows" | "run-workflow" | "list-available-agents" | "list-available-tools" | "list-available-workflows" | "save-workflow")[];
15
+ //# sourceMappingURL=tool-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-ids.d.ts","sourceRoot":"","sources":["../../../src/tools/workflows/tool-ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B;;;;;CAK9B,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;;CAM/B,CAAC;AAEX,eAAO,MAAM,+BAA+B,2MAGlC,CAAC"}
@@ -0,0 +1,19 @@
1
+ //#region src/tools/workflows/tool-ids.ts
2
+ const WORKFLOW_AUTHORING_TOOL_IDS = {
3
+ listAgents: "list-available-agents",
4
+ listTools: "list-available-tools",
5
+ listWorkflows: "list-available-workflows",
6
+ saveWorkflow: "save-workflow"
7
+ };
8
+ const WORKFLOW_MANAGEMENT_TOOL_IDS = {
9
+ createWorkflow: "create-workflow",
10
+ listWorkflows: "list-workflows",
11
+ getWorkflow: "get-workflow",
12
+ runWorkflow: "run-workflow",
13
+ deleteWorkflow: "delete-workflow"
14
+ };
15
+ const WORKFLOW_BUILDER_NOISE_TOOL_IDS = [...Object.values(WORKFLOW_AUTHORING_TOOL_IDS), ...Object.values(WORKFLOW_MANAGEMENT_TOOL_IDS)];
16
+ //#endregion
17
+ export { WORKFLOW_AUTHORING_TOOL_IDS, WORKFLOW_BUILDER_NOISE_TOOL_IDS, WORKFLOW_MANAGEMENT_TOOL_IDS };
18
+
19
+ //# sourceMappingURL=tool-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-ids.js","names":[],"sources":["../../../src/tools/workflows/tool-ids.ts"],"sourcesContent":["export const WORKFLOW_AUTHORING_TOOL_IDS = {\n listAgents: 'list-available-agents',\n listTools: 'list-available-tools',\n listWorkflows: 'list-available-workflows',\n saveWorkflow: 'save-workflow',\n} as const;\n\nexport const WORKFLOW_MANAGEMENT_TOOL_IDS = {\n createWorkflow: 'create-workflow',\n listWorkflows: 'list-workflows',\n getWorkflow: 'get-workflow',\n runWorkflow: 'run-workflow',\n deleteWorkflow: 'delete-workflow',\n} as const;\n\nexport const WORKFLOW_BUILDER_NOISE_TOOL_IDS = [\n ...Object.values(WORKFLOW_AUTHORING_TOOL_IDS),\n ...Object.values(WORKFLOW_MANAGEMENT_TOOL_IDS),\n] as const;\n"],"mappings":";AAAA,MAAa,8BAA8B;CACzC,YAAY;CACZ,WAAW;CACX,eAAe;CACf,cAAc;AAChB;AAEA,MAAa,+BAA+B;CAC1C,gBAAgB;CAChB,eAAe;CACf,aAAa;CACb,aAAa;CACb,gBAAgB;AAClB;AAEA,MAAa,kCAAkC,CAC7C,GAAG,OAAO,OAAO,2BAA2B,GAC5C,GAAG,OAAO,OAAO,4BAA4B,CAC/C"}
@@ -1,16 +1,19 @@
1
1
  /** Global plans directory for approved-plan archives. */
2
2
  export declare function getPlansDir(): string;
3
- /** Local (project-scoped) plans directory where the agent writes named plan files. */
4
- export declare function getLocalPlansDir(projectPath: string): string;
3
+ export interface LocalPlansOptions {
4
+ factoryProjectId?: string | null;
5
+ }
5
6
  /** Workspace-relative directory the agent writes plan files into. */
6
- export declare function getLocalPlansRelativeDir(): string;
7
+ export declare function getLocalPlansRelativeDir(options?: LocalPlansOptions): string;
8
+ /** Local (project-scoped) plans directory where the agent writes named plan files. */
9
+ export declare function getLocalPlansDir(projectPath: string, options?: LocalPlansOptions): string;
7
10
  /** Derive a plan filename from a title (e.g. `add-dark-mode.md`). */
8
11
  export declare function getPlanFilename(title: string): string;
9
12
  /**
10
13
  * Suggested workspace-relative path for a new plan file, shown in plan-mode prompts.
11
14
  * Without a title we fall back to a generic name the agent can rename later.
12
15
  */
13
- export declare function getSuggestedPlanRelativePath(title?: string): string;
16
+ export declare function getSuggestedPlanRelativePath(title?: string, options?: LocalPlansOptions): string;
14
17
  /**
15
18
  * Resolve a plan path submitted by the agent (absolute or project-relative) to an
16
19
  * absolute path. Returns `undefined` when no usable path was provided.
@@ -18,11 +21,11 @@ export declare function getSuggestedPlanRelativePath(title?: string): string;
18
21
  export declare function resolvePlanPath(projectPath: string, submittedPath: string): string | undefined;
19
22
  /**
20
23
  * Whether `targetPath` (absolute or project-relative) is a valid plan file: a `.md`
21
- * file located directly inside the project's `.mastracode/plans/` directory. Used by the
24
+ * file located directly inside the project's configured plan directory. Used by the
22
25
  * plan-mode write guard so the agent can write any named plan file there, but nothing
23
26
  * outside that directory.
24
27
  */
25
- export declare function isPlanFilePath(projectPath: string, targetPath: string): boolean;
28
+ export declare function isPlanFilePath(projectPath: string, targetPath: string, options?: LocalPlansOptions): boolean;
26
29
  export declare function savePlanToDisk(opts: {
27
30
  title: string;
28
31
  plan: string;
@@ -1 +1 @@
1
- {"version":3,"file":"plans.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B,eAAe,CAAC,IAAI,EAAE;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAc9B"}
@@ -7,13 +7,13 @@ import fs from "fs/promises";
7
7
  function getPlansDir() {
8
8
  return process.env.MASTRA_PLANS_DIR ?? path.join(getAppDataDir(), "plans");
9
9
  }
10
- /** Local (project-scoped) plans directory where the agent writes named plan files. */
11
- function getLocalPlansDir(projectPath) {
12
- return path.join(projectPath, DEFAULT_CONFIG_DIR, "plans");
13
- }
14
10
  /** Workspace-relative directory the agent writes plan files into. */
15
- function getLocalPlansRelativeDir() {
16
- return path.join(DEFAULT_CONFIG_DIR, "plans");
11
+ function getLocalPlansRelativeDir(options = {}) {
12
+ return options.factoryProjectId ? path.join(".artifacts", "plans") : path.join(DEFAULT_CONFIG_DIR, "plans");
13
+ }
14
+ /** Local (project-scoped) plans directory where the agent writes named plan files. */
15
+ function getLocalPlansDir(projectPath, options = {}) {
16
+ return path.join(projectPath, getLocalPlansRelativeDir(options));
17
17
  }
18
18
  function slugify(str) {
19
19
  return str.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "untitled";
@@ -26,9 +26,9 @@ function getPlanFilename(title) {
26
26
  * Suggested workspace-relative path for a new plan file, shown in plan-mode prompts.
27
27
  * Without a title we fall back to a generic name the agent can rename later.
28
28
  */
29
- function getSuggestedPlanRelativePath(title) {
29
+ function getSuggestedPlanRelativePath(title, options = {}) {
30
30
  const filename = title ? getPlanFilename(title) : "plan.md";
31
- return path.join(getLocalPlansRelativeDir(), filename);
31
+ return path.join(getLocalPlansRelativeDir(options), filename);
32
32
  }
33
33
  /**
34
34
  * Resolve a plan path submitted by the agent (absolute or project-relative) to an
@@ -40,15 +40,15 @@ function resolvePlanPath(projectPath, submittedPath) {
40
40
  }
41
41
  /**
42
42
  * Whether `targetPath` (absolute or project-relative) is a valid plan file: a `.md`
43
- * file located directly inside the project's `.mastracode/plans/` directory. Used by the
43
+ * file located directly inside the project's configured plan directory. Used by the
44
44
  * plan-mode write guard so the agent can write any named plan file there, but nothing
45
45
  * outside that directory.
46
46
  */
47
- function isPlanFilePath(projectPath, targetPath) {
47
+ function isPlanFilePath(projectPath, targetPath, options = {}) {
48
48
  const abs = resolvePlanPath(projectPath, targetPath);
49
49
  if (!abs) return false;
50
50
  if (path.extname(abs).toLowerCase() !== ".md") return false;
51
- const plansDir = path.resolve(getLocalPlansDir(projectPath));
51
+ const plansDir = path.resolve(getLocalPlansDir(projectPath, options));
52
52
  const rel = path.relative(plansDir, abs);
53
53
  if (rel === "" || rel.startsWith("..") || path.isAbsolute(rel)) return false;
54
54
  return !rel.includes(path.sep);
@@ -1 +1 @@
1
- {"version":3,"file":"plans.js","names":[],"sources":["../../src/utils/plans.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { DEFAULT_CONFIG_DIR } from '../constants.js';\nimport { getAppDataDir } from './project.js';\n\n/** Global plans directory for approved-plan archives. */\nexport function getPlansDir(): string {\n return process.env.MASTRA_PLANS_DIR ?? path.join(getAppDataDir(), 'plans');\n}\n\n/** Local (project-scoped) plans directory where the agent writes named plan files. */\nexport function getLocalPlansDir(projectPath: string): string {\n return path.join(projectPath, DEFAULT_CONFIG_DIR, 'plans');\n}\n\n/** Workspace-relative directory the agent writes plan files into. */\nexport function getLocalPlansRelativeDir(): string {\n return path.join(DEFAULT_CONFIG_DIR, 'plans');\n}\n\nfunction slugify(str: string): string {\n const slug = str\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '');\n return slug || 'untitled';\n}\n\n/** Derive a plan filename from a title (e.g. `add-dark-mode.md`). */\nexport function getPlanFilename(title: string): string {\n return `${slugify(title)}.md`;\n}\n\n/**\n * Suggested workspace-relative path for a new plan file, shown in plan-mode prompts.\n * Without a title we fall back to a generic name the agent can rename later.\n */\nexport function getSuggestedPlanRelativePath(title?: string): string {\n const filename = title ? getPlanFilename(title) : 'plan.md';\n return path.join(getLocalPlansRelativeDir(), filename);\n}\n\n/**\n * Resolve a plan path submitted by the agent (absolute or project-relative) to an\n * absolute path. Returns `undefined` when no usable path was provided.\n */\nexport function resolvePlanPath(projectPath: string, submittedPath: string): string | undefined {\n if (!submittedPath) return undefined;\n return path.isAbsolute(submittedPath) ? submittedPath : path.resolve(projectPath, submittedPath);\n}\n\n/**\n * Whether `targetPath` (absolute or project-relative) is a valid plan file: a `.md`\n * file located directly inside the project's `.mastracode/plans/` directory. Used by the\n * plan-mode write guard so the agent can write any named plan file there, but nothing\n * outside that directory.\n */\nexport function isPlanFilePath(projectPath: string, targetPath: string): boolean {\n const abs = resolvePlanPath(projectPath, targetPath);\n if (!abs) return false;\n if (path.extname(abs).toLowerCase() !== '.md') return false;\n\n const plansDir = path.resolve(getLocalPlansDir(projectPath));\n const rel = path.relative(plansDir, abs);\n // Must be directly inside the plans dir (no nested subdirectories, no escaping it).\n if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel)) return false;\n return !rel.includes(path.sep);\n}\n\nexport async function savePlanToDisk(opts: {\n title: string;\n plan: string;\n resourceId: string;\n plansDir?: string;\n}): Promise<void> {\n const { title, plan, resourceId } = opts;\n const plansDir = opts.plansDir ?? getPlansDir();\n const baseDir = path.resolve(plansDir);\n const dir = path.resolve(baseDir, resourceId);\n const rel = path.relative(baseDir, dir);\n if (rel.startsWith('..') || path.isAbsolute(rel)) {\n throw new Error(`Invalid resourceId: ${resourceId}`);\n }\n\n await fs.mkdir(dir, { recursive: true });\n\n const now = new Date();\n const timestamp = now.toISOString().replace(/:/g, '-');\n const slug = slugify(title);\n const filename = `${timestamp}-${slug}.md`;\n\n const content = `# ${title}\\n\\nApproved: ${now.toISOString()}\\n\\n${plan}\\n`;\n\n await fs.writeFile(path.join(dir, filename), content, 'utf-8');\n}\n\n/**\n * Read a plan markdown file by absolute path.\n *\n * The leading `# <title>` heading (if present) is parsed as the title and the remaining\n * content is returned as the plan body. Returns `undefined` when the file does not exist.\n */\nexport async function readPlanFile(absPath: string): Promise<{ title: string; plan: string } | undefined> {\n let raw: string;\n try {\n raw = await fs.readFile(absPath, 'utf-8');\n } catch {\n return undefined;\n }\n\n const lines = raw.split(/\\r?\\n/);\n const headingIndex = lines.findIndex(line => line.trim().length > 0);\n const heading = headingIndex >= 0 ? lines[headingIndex] : undefined;\n if (heading?.startsWith('# ')) {\n const title = heading.slice(2).trim();\n const plan = lines\n .slice(headingIndex + 1)\n .join('\\n')\n .replace(/^\\n+/, '')\n .trimEnd();\n return { title, plan };\n }\n\n return { title: '', plan: raw.trimEnd() };\n}\n\n/**\n * Approve the plan file at `planPath`: write a timestamped copy to the global plans\n * archive so approved plans are findable later. The local named plan file is left in\n * place so the user can review every plan made over time.\n *\n * Returns the local plan filename (e.g. `add-dark-mode.md`), or `undefined` when there\n * was no plan file to approve.\n */\nexport async function approvePlanFile(opts: {\n planPath: string;\n title: string;\n resourceId: string;\n plansDir?: string;\n}): Promise<string | undefined> {\n const { planPath, title, resourceId, plansDir } = opts;\n\n const current = await readPlanFile(planPath);\n if (!current) {\n return undefined;\n }\n\n const resolvedTitle = title || current.title || 'Implementation Plan';\n\n // Global archive (timestamped, never overwritten) so approved plans are findable later.\n await savePlanToDisk({ title: resolvedTitle, plan: current.plan, resourceId, plansDir });\n\n return path.basename(planPath);\n}\n"],"mappings":";;;;;;AAMA,SAAgB,cAAsB;CACpC,OAAO,QAAQ,IAAI,oBAAoB,KAAK,KAAK,cAAc,GAAG,OAAO;AAC3E;;AAGA,SAAgB,iBAAiB,aAA6B;CAC5D,OAAO,KAAK,KAAK,aAAa,oBAAoB,OAAO;AAC3D;;AAGA,SAAgB,2BAAmC;CACjD,OAAO,KAAK,KAAK,oBAAoB,OAAO;AAC9C;AAEA,SAAS,QAAQ,KAAqB;CAKpC,OAJa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MAAM,sBAAM,IAAI,KAAK;CAGrB,MAAM,WAAW,GAFC,IAAI,YAAY,CAAC,CAAC,QAAQ,MAAM,GAEtB,EAAE,GADjB,QAAQ,KACe,EAAE;CAEtC,MAAM,UAAU,KAAK,MAAM,gBAAgB,IAAI,YAAY,EAAE,MAAM,KAAK;CAExE,MAAM,GAAG,UAAU,KAAK,KAAK,KAAK,QAAQ,GAAG,SAAS,OAAO;AAC/D;;;;;;;AAQA,eAAsB,aAAa,SAAuE;CACxG,IAAI;CACJ,IAAI;EACF,MAAM,MAAM,GAAG,SAAS,SAAS,OAAO;CAC1C,QAAQ;EACN;CACF;CAEA,MAAM,QAAQ,IAAI,MAAM,OAAO;CAC/B,MAAM,eAAe,MAAM,WAAU,SAAQ,KAAK,KAAK,CAAC,CAAC,SAAS,CAAC;CACnE,MAAM,UAAU,gBAAgB,IAAI,MAAM,gBAAgB,KAAA;CAC1D,IAAI,SAAS,WAAW,IAAI,GAO1B,OAAO;EAAE,OANK,QAAQ,MAAM,CAAC,CAAC,CAAC,KAMlB;EAAG,MALH,MACV,MAAM,eAAe,CAAC,CAAC,CACvB,KAAK,IAAI,CAAC,CACV,QAAQ,QAAQ,EAAE,CAAC,CACnB,QACgB;CAAE;CAGvB,OAAO;EAAE,OAAO;EAAI,MAAM,IAAI,QAAQ;CAAE;AAC1C;;;;;;;;;AAUA,eAAsB,gBAAgB,MAKN;CAC9B,MAAM,EAAE,UAAU,OAAO,YAAY,aAAa;CAElD,MAAM,UAAU,MAAM,aAAa,QAAQ;CAC3C,IAAI,CAAC,SACH;CAMF,MAAM,eAAe;EAAE,OAHD,SAAS,QAAQ,SAAS;EAGH,MAAM,QAAQ;EAAM;EAAY;CAAS,CAAC;CAEvF,OAAO,KAAK,SAAS,QAAQ;AAC/B"}
1
+ {"version":3,"file":"plans.js","names":[],"sources":["../../src/utils/plans.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { DEFAULT_CONFIG_DIR } from '../constants.js';\nimport { getAppDataDir } from './project.js';\n\n/** Global plans directory for approved-plan archives. */\nexport function getPlansDir(): string {\n return process.env.MASTRA_PLANS_DIR ?? path.join(getAppDataDir(), 'plans');\n}\n\nexport interface LocalPlansOptions {\n factoryProjectId?: string | null;\n}\n\n/** Workspace-relative directory the agent writes plan files into. */\nexport function getLocalPlansRelativeDir(options: LocalPlansOptions = {}): string {\n return options.factoryProjectId ? path.join('.artifacts', 'plans') : path.join(DEFAULT_CONFIG_DIR, 'plans');\n}\n\n/** Local (project-scoped) plans directory where the agent writes named plan files. */\nexport function getLocalPlansDir(projectPath: string, options: LocalPlansOptions = {}): string {\n return path.join(projectPath, getLocalPlansRelativeDir(options));\n}\n\nfunction slugify(str: string): string {\n const slug = str\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '');\n return slug || 'untitled';\n}\n\n/** Derive a plan filename from a title (e.g. `add-dark-mode.md`). */\nexport function getPlanFilename(title: string): string {\n return `${slugify(title)}.md`;\n}\n\n/**\n * Suggested workspace-relative path for a new plan file, shown in plan-mode prompts.\n * Without a title we fall back to a generic name the agent can rename later.\n */\nexport function getSuggestedPlanRelativePath(title?: string, options: LocalPlansOptions = {}): string {\n const filename = title ? getPlanFilename(title) : 'plan.md';\n return path.join(getLocalPlansRelativeDir(options), filename);\n}\n\n/**\n * Resolve a plan path submitted by the agent (absolute or project-relative) to an\n * absolute path. Returns `undefined` when no usable path was provided.\n */\nexport function resolvePlanPath(projectPath: string, submittedPath: string): string | undefined {\n if (!submittedPath) return undefined;\n return path.isAbsolute(submittedPath) ? submittedPath : path.resolve(projectPath, submittedPath);\n}\n\n/**\n * Whether `targetPath` (absolute or project-relative) is a valid plan file: a `.md`\n * file located directly inside the project's configured plan directory. Used by the\n * plan-mode write guard so the agent can write any named plan file there, but nothing\n * outside that directory.\n */\nexport function isPlanFilePath(projectPath: string, targetPath: string, options: LocalPlansOptions = {}): boolean {\n const abs = resolvePlanPath(projectPath, targetPath);\n if (!abs) return false;\n if (path.extname(abs).toLowerCase() !== '.md') return false;\n\n const plansDir = path.resolve(getLocalPlansDir(projectPath, options));\n const rel = path.relative(plansDir, abs);\n // Must be directly inside the plans dir (no nested subdirectories, no escaping it).\n if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel)) return false;\n return !rel.includes(path.sep);\n}\n\nexport async function savePlanToDisk(opts: {\n title: string;\n plan: string;\n resourceId: string;\n plansDir?: string;\n}): Promise<void> {\n const { title, plan, resourceId } = opts;\n const plansDir = opts.plansDir ?? getPlansDir();\n const baseDir = path.resolve(plansDir);\n const dir = path.resolve(baseDir, resourceId);\n const rel = path.relative(baseDir, dir);\n if (rel.startsWith('..') || path.isAbsolute(rel)) {\n throw new Error(`Invalid resourceId: ${resourceId}`);\n }\n\n await fs.mkdir(dir, { recursive: true });\n\n const now = new Date();\n const timestamp = now.toISOString().replace(/:/g, '-');\n const slug = slugify(title);\n const filename = `${timestamp}-${slug}.md`;\n\n const content = `# ${title}\\n\\nApproved: ${now.toISOString()}\\n\\n${plan}\\n`;\n\n await fs.writeFile(path.join(dir, filename), content, 'utf-8');\n}\n\n/**\n * Read a plan markdown file by absolute path.\n *\n * The leading `# <title>` heading (if present) is parsed as the title and the remaining\n * content is returned as the plan body. Returns `undefined` when the file does not exist.\n */\nexport async function readPlanFile(absPath: string): Promise<{ title: string; plan: string } | undefined> {\n let raw: string;\n try {\n raw = await fs.readFile(absPath, 'utf-8');\n } catch {\n return undefined;\n }\n\n const lines = raw.split(/\\r?\\n/);\n const headingIndex = lines.findIndex(line => line.trim().length > 0);\n const heading = headingIndex >= 0 ? lines[headingIndex] : undefined;\n if (heading?.startsWith('# ')) {\n const title = heading.slice(2).trim();\n const plan = lines\n .slice(headingIndex + 1)\n .join('\\n')\n .replace(/^\\n+/, '')\n .trimEnd();\n return { title, plan };\n }\n\n return { title: '', plan: raw.trimEnd() };\n}\n\n/**\n * Approve the plan file at `planPath`: write a timestamped copy to the global plans\n * archive so approved plans are findable later. The local named plan file is left in\n * place so the user can review every plan made over time.\n *\n * Returns the local plan filename (e.g. `add-dark-mode.md`), or `undefined` when there\n * was no plan file to approve.\n */\nexport async function approvePlanFile(opts: {\n planPath: string;\n title: string;\n resourceId: string;\n plansDir?: string;\n}): Promise<string | undefined> {\n const { planPath, title, resourceId, plansDir } = opts;\n\n const current = await readPlanFile(planPath);\n if (!current) {\n return undefined;\n }\n\n const resolvedTitle = title || current.title || 'Implementation Plan';\n\n // Global archive (timestamped, never overwritten) so approved plans are findable later.\n await savePlanToDisk({ title: resolvedTitle, plan: current.plan, resourceId, plansDir });\n\n return path.basename(planPath);\n}\n"],"mappings":";;;;;;AAMA,SAAgB,cAAsB;CACpC,OAAO,QAAQ,IAAI,oBAAoB,KAAK,KAAK,cAAc,GAAG,OAAO;AAC3E;;AAOA,SAAgB,yBAAyB,UAA6B,CAAC,GAAW;CAChF,OAAO,QAAQ,mBAAmB,KAAK,KAAK,cAAc,OAAO,IAAI,KAAK,KAAK,oBAAoB,OAAO;AAC5G;;AAGA,SAAgB,iBAAiB,aAAqB,UAA6B,CAAC,GAAW;CAC7F,OAAO,KAAK,KAAK,aAAa,yBAAyB,OAAO,CAAC;AACjE;AAEA,SAAS,QAAQ,KAAqB;CAKpC,OAJa,IACV,YAAY,CAAC,CACb,QAAQ,eAAe,GAAG,CAAC,CAC3B,QAAQ,UAAU,EACX,KAAK;AACjB;;AAGA,SAAgB,gBAAgB,OAAuB;CACrD,OAAO,GAAG,QAAQ,KAAK,EAAE;AAC3B;;;;;AAMA,SAAgB,6BAA6B,OAAgB,UAA6B,CAAC,GAAW;CACpG,MAAM,WAAW,QAAQ,gBAAgB,KAAK,IAAI;CAClD,OAAO,KAAK,KAAK,yBAAyB,OAAO,GAAG,QAAQ;AAC9D;;;;;AAMA,SAAgB,gBAAgB,aAAqB,eAA2C;CAC9F,IAAI,CAAC,eAAe,OAAO,KAAA;CAC3B,OAAO,KAAK,WAAW,aAAa,IAAI,gBAAgB,KAAK,QAAQ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,QAAQ,IAAI,MAAM,OAAO;CAC/B,MAAM,eAAe,MAAM,WAAU,SAAQ,KAAK,KAAK,CAAC,CAAC,SAAS,CAAC;CACnE,MAAM,UAAU,gBAAgB,IAAI,MAAM,gBAAgB,KAAA;CAC1D,IAAI,SAAS,WAAW,IAAI,GAO1B,OAAO;EAAE,OANK,QAAQ,MAAM,CAAC,CAAC,CAAC,KAMlB;EAAG,MALH,MACV,MAAM,eAAe,CAAC,CAAC,CACvB,KAAK,IAAI,CAAC,CACV,QAAQ,QAAQ,EAAE,CAAC,CACnB,QACgB;CAAE;CAGvB,OAAO;EAAE,OAAO;EAAI,MAAM,IAAI,QAAQ;CAAE;AAC1C;;;;;;;;;AAUA,eAAsB,gBAAgB,MAKN;CAC9B,MAAM,EAAE,UAAU,OAAO,YAAY,aAAa;CAElD,MAAM,UAAU,MAAM,aAAa,QAAQ;CAC3C,IAAI,CAAC,SACH;CAMF,MAAM,eAAe;EAAE,OAHD,SAAS,QAAQ,SAAS;EAGH,MAAM,QAAQ;EAAM;EAAY;CAAS,CAAC;CAEvF,OAAO,KAAK,SAAS,QAAQ;AAC/B"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Statically register workflow-related primitives on the mastracode Mastra
3
+ * instance so `mastra.listTools()` + `mastra.listAgents()` — and, therefore,
4
+ * the workflow-builder's discovery + the workflow rehydrator — see everything
5
+ * a workflow might want to compose:
6
+ *
7
+ * - workflow-builder sub-agent (so `create-workflow` can delegate)
8
+ * - code-agent (as a plain agent, callable via agent steps)
9
+ * - workspace tools (view/write/edit/find_files/execute_command/etc.)
10
+ * - web tools (Tavily-gated) so workflows can compose search/extract steps
11
+ * - notification_inbox
12
+ * - snapshot of MCP tools from mcpManager
13
+ *
14
+ * Called after `controller.init()` but before `startWorkers()` in both boot
15
+ * paths, so `loadStoredWorkflows()` (inside startWorkers) sees the full
16
+ * registry when rehydrating previously-saved workflows.
17
+ *
18
+ * Tradeoffs:
19
+ * - MCP tools are snapshotted. Servers added after boot are invisible to
20
+ * the workflow-builder until restart.
21
+ * - Web tool flavor is Tavily-only. Provider-native (Anthropic/OpenAI) web
22
+ * tools are skipped because they'd freeze workflows to one model provider.
23
+ * - Workflow tool steps get the closed-over workspace + auth (Tavily key,
24
+ * MCP server credentials), not per-request permissions — deliberate; if
25
+ * the user built + saved the workflow they meant to run it.
26
+ */
27
+ import type { Agent } from '@mastra/core/agent';
28
+ import type { Mastra } from '@mastra/core/mastra';
29
+ import type { McpManager } from '../mcp/index.js';
30
+ export interface RegisterWorkflowBuilderPrimitivesOptions {
31
+ projectPath: string;
32
+ /**
33
+ * Extra allowed paths the workspace can read/write. Mastracode normally
34
+ * collects skill paths + sandboxAllowedPaths per-request; for the workflow
35
+ * workspace we accept anything the caller wants up-front and trust the
36
+ * worker process to honour the user's intent.
37
+ */
38
+ allowedPaths?: string[];
39
+ /**
40
+ * The code-agent Agent instance. Registered as `code-agent` so workflows
41
+ * can compose it in agent steps. It already has full dynamic tool access
42
+ * (workspace/MCP/web/etc.) via its own `tools: createDynamicTools(...)`.
43
+ */
44
+ codeAgent: Agent;
45
+ /**
46
+ * McpManager for snapshotting MCP tools at boot. Omit or pass undefined
47
+ * if MCP is disabled — workflow-builder will just see fewer tools.
48
+ */
49
+ mcpManager?: McpManager;
50
+ }
51
+ export declare function registerWorkflowBuilderPrimitives(mastra: Mastra, options: RegisterWorkflowBuilderPrimitivesOptions): Promise<void>;
52
+ //# sourceMappingURL=register-primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-primitives.d.ts","sourceRoot":"","sources":["../../src/workflows/register-primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIzC,MAAM,WAAW,wCAAwC;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;OAIG;IACH,SAAS,EAAE,KAAK,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,wBAAsB,iCAAiC,CACrD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wCAAwC,GAChD,OAAO,CAAC,IAAI,CAAC,CAiDf"}