Skip to content

Commit be61a69

Browse files
authored
Update schema description of sendMessage (#15)
1 parent 75ab41f commit be61a69

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

typescript/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trysiren/agent-toolkit",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Agent toolkit for Siren notification platform",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

typescript/src/lib/messaging/sendMessage.ts

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,49 @@ const sendMessageSchema = z.object({
77
recipient_value: z
88
.string()
99
.describe(
10-
'Identifier for the recipient (e.g., Slack user ID, email address)'
10+
'Unique identifier for the recipient, such as a Slack user ID or an email address.'
1111
),
1212
channel: z
1313
.nativeEnum(RecipientChannel)
1414
.describe(
15-
'The channel to send the message through (e.g., "SLACK", "EMAIL")'
15+
'The communication channel to use for sending the message, e.g., "SLACK" or "EMAIL".'
1616
),
1717
body: z
1818
.string()
1919
.optional()
20-
.describe('Message body text (required if no template)'),
20+
.describe(
21+
'The content of the message. Required if no template is specified.'
22+
),
2123
subject: z
2224
.string()
2325
.optional()
2426
.describe(
25-
'Subject line for the message (optional, required for email with body)'
27+
'The subject line of the message. Optional, but required for email messages that include a body.'
2628
),
2729
template_name: z
2830
.string()
2931
.optional()
30-
.describe('Template name (required if no body)'),
32+
.describe(
33+
'The name of the template to use for the message. Required if no body is provided.'
34+
),
3135
template_variables: z
3236
.record(z.any())
3337
.optional()
34-
.describe('Template variables for template-based messages'),
35-
provider_name: z.string().optional().describe('Provider integration name'),
38+
.describe(
39+
'Template variables for template-based messages.'
40+
),
41+
provider_name: z
42+
.string()
43+
.optional()
44+
.describe(
45+
'The name of the provider integration to use for sending the message. Optional; defaults to the default provider if not specified.'
46+
),
3647
provider_code: z
3748
.nativeEnum(ProviderCode)
3849
.optional()
39-
.describe('Provider integration code'),
50+
.describe(
51+
'The code of the provider integration to use for sending the message. Optional; defaults to the default provider if not specified.'
52+
),
4053
});
4154

4255
export const sendMessage = async (

0 commit comments

Comments
 (0)