@voicelayer/sdk 0.5.0 → 0.5.1

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.
@@ -81,14 +81,14 @@ declare const ConnectorUpFrame: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
81
81
  code: z.ZodEnum<["upstream_timeout", "upstream_error", "bad_response", "normalize_failed", "unreachable"]>;
82
82
  message: z.ZodString;
83
83
  }, "strip", z.ZodTypeAny, {
84
+ kind: "brain.error";
84
85
  code: "upstream_timeout" | "upstream_error" | "bad_response" | "normalize_failed" | "unreachable";
85
86
  message: string;
86
- kind: "brain.error";
87
87
  streamId: string;
88
88
  }, {
89
+ kind: "brain.error";
89
90
  code: "upstream_timeout" | "upstream_error" | "bad_response" | "normalize_failed" | "unreachable";
90
91
  message: string;
91
- kind: "brain.error";
92
92
  streamId: string;
93
93
  }>]>;
94
94
  type ConnectorUpFrame = z.infer<typeof ConnectorUpFrame>;
@@ -434,6 +434,8 @@ var FlowNodeType = z.enum([
434
434
  "ask",
435
435
  "confirm",
436
436
  "tool",
437
+ // Send an email through the workspace's email (metered, wallet-gated; From on a verified domain) — burn-down G-22.
438
+ "email",
437
439
  "decision",
438
440
  "handoff",
439
441
  "end",
@@ -1395,6 +1397,56 @@ z.object({
1395
1397
  ok: z.literal(true),
1396
1398
  scopesPurged: z.array(MemoryScope)
1397
1399
  });
1400
+ var EMAIL_RE = /^[^\s@<>"]+@[^\s@<>"]+\.[^\s@<>"]+$/;
1401
+ function isEmailAddress(value) {
1402
+ return EMAIL_RE.test(value) && value.length <= 254;
1403
+ }
1404
+ var EMAIL_SUBJECT_MAX = 200;
1405
+ var EMAIL_TEXT_MAX = 5e4;
1406
+ var EMAIL_HTML_MAX = 2e5;
1407
+ var address = z.string().max(254).refine(isEmailAddress, { message: "must be an email address" });
1408
+ z.object({
1409
+ to: address,
1410
+ subject: z.string().min(1).max(EMAIL_SUBJECT_MAX),
1411
+ text: z.string().min(1).max(EMAIL_TEXT_MAX),
1412
+ html: z.string().min(1).max(EMAIL_HTML_MAX).optional(),
1413
+ // An address on one of the workspace's verified sending domains; omitted → the platform sender.
1414
+ from: address.optional(),
1415
+ // The display name shown beside `from` (or beside the platform sender's address).
1416
+ fromName: z.string().trim().min(1).max(64).refine((v) => !/[\r\n<>"]/.test(v), { message: 'must not contain line breaks, <, > or "' }).optional(),
1417
+ // Where a reply goes — any address; it needs no verification.
1418
+ replyTo: address.optional(),
1419
+ // The conversation (a call, a text conversation) the email belongs to — a conversation sends at most 3 emails.
1420
+ conversationId: z.string().min(1).max(128).optional()
1421
+ });
1422
+ var DOMAIN_RE = /^(?=.{4,253}$)(?!-)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
1423
+ function normalizeDomain(input) {
1424
+ return input.trim().toLowerCase().replace(/^[a-z]+:\/\//, "").replace(/\/.*$/, "").replace(/\.$/, "");
1425
+ }
1426
+ function isDomainName(value) {
1427
+ return DOMAIN_RE.test(value);
1428
+ }
1429
+ z.object({
1430
+ domain: z.string().max(253).transform(normalizeDomain).refine(isDomainName, { message: "must be a domain like example.com" })
1431
+ });
1432
+ var EmailDomainStatus = z.enum(["pending", "verified", "failed"]);
1433
+ var EmailDnsRecord = z.object({
1434
+ type: z.enum(["CNAME", "TXT"]),
1435
+ name: z.string(),
1436
+ value: z.string(),
1437
+ // dkim: proves the domain (required); dmarc: recommended, only when the domain has no DMARC record yet.
1438
+ purpose: z.enum(["dkim", "dmarc"]),
1439
+ required: z.boolean()
1440
+ });
1441
+ z.object({
1442
+ id: z.string(),
1443
+ domain: z.string(),
1444
+ status: EmailDomainStatus,
1445
+ records: z.array(EmailDnsRecord),
1446
+ createdAt: z.string().datetime(),
1447
+ lastCheckedAt: z.string().datetime().nullable(),
1448
+ verifiedAt: z.string().datetime().nullable()
1449
+ });
1398
1450
  z.object({
1399
1451
  systemPrompt: z.string().max(64e3),
1400
1452
  routingInstructions: z.string().max(32e3).nullable(),