@dbx-tools/appkit-mastra 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -303
- package/dist/src/agents.d.ts +10 -0
- package/dist/src/agents.js +15 -2
- package/dist/src/chart.d.ts +131 -79
- package/dist/src/chart.js +386 -279
- package/dist/src/config.d.ts +19 -16
- package/dist/src/genie.d.ts +90 -106
- package/dist/src/genie.js +523 -642
- package/dist/src/intercept.d.ts +48 -0
- package/dist/src/intercept.js +167 -0
- package/dist/src/plugin.d.ts +12 -0
- package/dist/src/plugin.js +185 -1
- package/dist/src/processors/strip-stale-charts.d.ts +16 -13
- package/dist/src/processors/strip-stale-charts.js +16 -13
- package/dist/src/statement.d.ts +73 -0
- package/dist/src/statement.js +118 -0
- package/dist/src/tools/email.js +27 -28
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/agents.ts +16 -2
- package/src/chart.ts +499 -319
- package/src/config.ts +19 -16
- package/src/genie.ts +560 -768
- package/src/intercept.ts +206 -0
- package/src/plugin.ts +210 -2
- package/src/processors/strip-stale-charts.ts +16 -13
- package/src/statement.ts +127 -0
- package/src/tools/email.ts +27 -28
package/src/tools/email.ts
CHANGED
|
@@ -33,41 +33,41 @@ import { z } from "zod";
|
|
|
33
33
|
const log = logUtils.logger("mastra/tool/send-email");
|
|
34
34
|
|
|
35
35
|
const emailInputSchema = z.object({
|
|
36
|
-
to: z.string().describe(stringUtils.toDescription`
|
|
36
|
+
to: z.string().describe(stringUtils.toDescription(`
|
|
37
37
|
Single recipient email address (e.g. "alice@example.com"). For
|
|
38
38
|
multiple recipients, comma-separate them yourself.
|
|
39
|
-
`),
|
|
40
|
-
subject: z.string().describe(stringUtils.toDescription`
|
|
39
|
+
`)),
|
|
40
|
+
subject: z.string().describe(stringUtils.toDescription(`
|
|
41
41
|
Subject line.
|
|
42
|
-
`),
|
|
43
|
-
body: z.string().describe(stringUtils.toDescription`
|
|
44
|
-
Email body. Plain text or markdown; the renderer downstream
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`),
|
|
42
|
+
`)),
|
|
43
|
+
body: z.string().describe(stringUtils.toDescription(`
|
|
44
|
+
Email body. Plain text or markdown; the renderer downstream decides
|
|
45
|
+
which to honour. Be specific - the recipient may not have any
|
|
46
|
+
context the model has from prior chat turns.
|
|
47
|
+
`)),
|
|
48
48
|
cc: z
|
|
49
49
|
.array(z.string())
|
|
50
50
|
.optional()
|
|
51
|
-
.describe(stringUtils.toDescription`
|
|
51
|
+
.describe(stringUtils.toDescription(`
|
|
52
52
|
Optional CC recipients.
|
|
53
|
-
`),
|
|
53
|
+
`)),
|
|
54
54
|
bcc: z
|
|
55
55
|
.array(z.string())
|
|
56
56
|
.optional()
|
|
57
|
-
.describe(stringUtils.toDescription`
|
|
57
|
+
.describe(stringUtils.toDescription(`
|
|
58
58
|
Optional BCC recipients.
|
|
59
|
-
`),
|
|
59
|
+
`)),
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
const emailOutputSchema = z.object({
|
|
63
|
-
sent: z.boolean().describe(stringUtils.toDescription`
|
|
63
|
+
sent: z.boolean().describe(stringUtils.toDescription(`
|
|
64
64
|
True when the email was dispatched. The current implementation
|
|
65
|
-
always returns true after console-logging the would-be email;
|
|
66
|
-
|
|
67
|
-
`),
|
|
68
|
-
recipient: z.string().describe(stringUtils.toDescription`
|
|
65
|
+
always returns true after console-logging the would-be email; swap
|
|
66
|
+
in a real provider to make this meaningful.
|
|
67
|
+
`)),
|
|
68
|
+
recipient: z.string().describe(stringUtils.toDescription(`
|
|
69
69
|
Echo of the \`to\` field for confirmation.
|
|
70
|
-
`),
|
|
70
|
+
`)),
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
/** Options accepted by {@link buildEmailTool}. */
|
|
@@ -111,15 +111,14 @@ export interface BuildEmailToolOptions {
|
|
|
111
111
|
export function buildEmailTool(opts: BuildEmailToolOptions = {}) {
|
|
112
112
|
return createTool({
|
|
113
113
|
id: opts.id ?? "send_email",
|
|
114
|
-
description: stringUtils.toDescription`
|
|
115
|
-
Send an email on the user's behalf. Pass a recipient
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
`,
|
|
114
|
+
description: stringUtils.toDescription(`
|
|
115
|
+
Send an email on the user's behalf. Pass a recipient address,
|
|
116
|
+
subject, and body; the user will be prompted to approve the send
|
|
117
|
+
before it goes out (the tool is approval-gated). Use this when
|
|
118
|
+
the user explicitly asks to send / forward / share something via
|
|
119
|
+
email - never autonomously. Keep subjects short and bodies
|
|
120
|
+
focused; the recipient may not have any of the chat context.
|
|
121
|
+
`),
|
|
123
122
|
inputSchema: emailInputSchema,
|
|
124
123
|
outputSchema: emailOutputSchema,
|
|
125
124
|
requireApproval: true,
|