@dbx-tools/appkit-email-shared 0.1.67 → 0.1.69

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/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@dbx-tools/appkit-email-shared",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
4
4
  "dependencies": {
5
5
  "zod": "^4.3.6"
6
6
  },
7
7
  "exports": {
8
8
  ".": {
9
- "source": "./src/index.ts",
10
9
  "types": "./dist/index.d.ts",
11
10
  "default": "./dist/index.js"
12
11
  }
@@ -15,8 +14,7 @@
15
14
  "main": "./dist/index.js",
16
15
  "types": "./dist/index.d.ts",
17
16
  "files": [
18
- "dist",
19
- "src"
17
+ "dist"
20
18
  ],
21
19
  "license": "Apache-2.0"
22
20
  }
package/src/index.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Wire-format contract for `@dbx-tools/appkit-email`: the email a model
3
- * drafts and the result of dispatching it (zod schemas + inferred
4
- * types). Pure and browser-safe - no `node:*` imports - so the
5
- * server-side sender, the Mastra tool, and the React approval UI all
6
- * validate and type against one definition.
7
- */
8
- export * from "./protocol.js";
package/src/protocol.ts DELETED
@@ -1,53 +0,0 @@
1
- // Wire-format contract for `@dbx-tools/appkit-email`: the email a model
2
- // drafts and the result of dispatching it. Pure (zod + inferred types,
3
- // no Node-only imports) so the server-side sender, the Mastra tool, and
4
- // the React approval UI all validate / type against one definition.
5
- //
6
- // Array fields intentionally avoid `.min()` / `.nonempty()`: those emit
7
- // `minItems` in the JSON schema, which some Model Serving endpoints
8
- // reject ("array types do not support minItems") when the schema is
9
- // forwarded as a tool definition.
10
-
11
- import { z } from "zod";
12
-
13
- /** Schema for the email a model asks to send (the tool input). */
14
- export const emailMessageSchema = z.object({
15
- to: z
16
- .string()
17
- .describe(
18
- 'Single recipient email address (e.g. "alice@example.com"). Comma-separate multiple recipients yourself.',
19
- ),
20
- subject: z.string().describe("Subject line. Keep it short and specific."),
21
- body: z
22
- .string()
23
- .describe(
24
- [
25
- "Email body in GitHub-Flavored Markdown; it is rendered to HTML before sending.",
26
- "Use real Markdown structure: '#'/'##' headings, '-' or '1.' lists, **bold**/_italic_, '>' blockquotes, and fenced ``` code blocks.",
27
- "For tabular data, emit a real Markdown table: a header row, then a '| --- | --- |' separator row, then one '| ... |' row per record.",
28
- "Do NOT format with ASCII art: no '=====' or '-----' divider lines, and never hand-draw tables or bar charts with spaces, pipes, or '#'. Use the Markdown constructs above instead.",
29
- "Be self-contained: the recipient has none of the chat context.",
30
- ].join(" "),
31
- ),
32
- cc: z.array(z.string()).optional().describe("Optional CC recipient addresses."),
33
- bcc: z.array(z.string()).optional().describe("Optional BCC recipient addresses."),
34
- });
35
-
36
- /** A validated outbound email message. */
37
- export type EmailMessage = z.infer<typeof emailMessageSchema>;
38
-
39
- /** Schema for the dispatch result returned to the model after a send. */
40
- export const emailResultSchema = z.object({
41
- sent: z.boolean().describe("True once the message was handed to the SMTP server."),
42
- recipient: z.string().describe("Echo of the `to` field for confirmation."),
43
- from: z
44
- .string()
45
- .describe("The resolved sender address the message was actually sent from."),
46
- messageId: z
47
- .string()
48
- .optional()
49
- .describe("SMTP message id assigned by the server, when one was returned."),
50
- });
51
-
52
- /** The outcome of dispatching an {@link EmailMessage}. */
53
- export type EmailResult = z.infer<typeof emailResultSchema>;