@jclvsh/iris 0.3.0 → 0.5.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.
- package/README.md +201 -202
- package/dist/cli-utils.js +4 -1
- package/dist/commands/ai.js +4 -21
- package/dist/commands/campaigns.js +59 -1
- package/dist/commands/channels.js +4 -1
- package/dist/commands/keys.js +6 -11
- package/dist/commands/messages.js +6 -3
- package/dist/commands/webhooks.js +12 -0
- package/dist/index.js +4 -1
- package/dist/tools/ai.js +29 -26
- package/dist/tools/analytics.js +33 -17
- package/dist/tools/billing.js +7 -2
- package/dist/tools/campaigns.js +82 -23
- package/dist/tools/channels.js +21 -6
- package/dist/tools/contacts.js +56 -16
- package/dist/tools/conversations.js +35 -10
- package/dist/tools/discovery.js +29 -13
- package/dist/tools/keys.js +27 -33
- package/dist/tools/messages.js +43 -13
- package/dist/tools/notifications.js +28 -8
- package/dist/tools/webhooks.js +56 -16
- package/dist/types.d.ts +0 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerNotificationTools(server, client) {
|
|
3
|
-
server.tool("list_notifications", "list user notifications. requires
|
|
3
|
+
server.tool("list_notifications", "list user notifications. requires read scope.", {
|
|
4
4
|
page: z.number().int().positive().optional().describe("page number (default 1)"),
|
|
5
5
|
page_size: z.number().int().min(1).max(100).optional().describe("items per page (default 50, max 100)"),
|
|
6
6
|
}, async ({ page, page_size }) => {
|
|
@@ -15,12 +15,17 @@ export function registerNotificationTools(server, client) {
|
|
|
15
15
|
}
|
|
16
16
|
catch (error) {
|
|
17
17
|
return {
|
|
18
|
-
content: [
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
19
24
|
isError: true,
|
|
20
25
|
};
|
|
21
26
|
}
|
|
22
27
|
});
|
|
23
|
-
server.tool("update_notification", "update a notification (e.g., mark as read). requires
|
|
28
|
+
server.tool("update_notification", "update a notification (e.g., mark as read). requires write scope.", {
|
|
24
29
|
id: z.string().uuid().describe("notification ID"),
|
|
25
30
|
read: z.boolean().optional().describe("mark as read or unread"),
|
|
26
31
|
}, async ({ id, ...body }) => {
|
|
@@ -30,12 +35,17 @@ export function registerNotificationTools(server, client) {
|
|
|
30
35
|
}
|
|
31
36
|
catch (error) {
|
|
32
37
|
return {
|
|
33
|
-
content: [
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: "text",
|
|
41
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
34
44
|
isError: true,
|
|
35
45
|
};
|
|
36
46
|
}
|
|
37
47
|
});
|
|
38
|
-
server.tool("delete_notification", "delete a notification. requires
|
|
48
|
+
server.tool("delete_notification", "delete a notification. requires write scope.", {
|
|
39
49
|
id: z.string().uuid().describe("notification ID"),
|
|
40
50
|
}, async ({ id }) => {
|
|
41
51
|
try {
|
|
@@ -44,19 +54,29 @@ export function registerNotificationTools(server, client) {
|
|
|
44
54
|
}
|
|
45
55
|
catch (error) {
|
|
46
56
|
return {
|
|
47
|
-
content: [
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
type: "text",
|
|
60
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
48
63
|
isError: true,
|
|
49
64
|
};
|
|
50
65
|
}
|
|
51
66
|
});
|
|
52
|
-
server.tool("mark_all_notifications_read", "mark all notifications as read. requires
|
|
67
|
+
server.tool("mark_all_notifications_read", "mark all notifications as read. requires write scope.", {}, async () => {
|
|
53
68
|
try {
|
|
54
69
|
await client.post("/notifications/read-all");
|
|
55
70
|
return { content: [{ type: "text", text: "all notifications marked as read" }] };
|
|
56
71
|
}
|
|
57
72
|
catch (error) {
|
|
58
73
|
return {
|
|
59
|
-
content: [
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: "text",
|
|
77
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
60
80
|
isError: true,
|
|
61
81
|
};
|
|
62
82
|
}
|
package/dist/tools/webhooks.js
CHANGED
|
@@ -20,7 +20,7 @@ const WEBHOOK_EVENTS = [
|
|
|
20
20
|
"discovery.failed",
|
|
21
21
|
];
|
|
22
22
|
export function registerWebhookTools(server, client) {
|
|
23
|
-
server.tool("list_webhooks", "list all configured webhooks. requires
|
|
23
|
+
server.tool("list_webhooks", "list all configured webhooks. requires admin scope.", {
|
|
24
24
|
page: z.number().int().positive().optional().describe("page number (default 1)"),
|
|
25
25
|
page_size: z.number().int().min(1).max(100).optional().describe("items per page (default 50, max 100)"),
|
|
26
26
|
}, async ({ page, page_size }) => {
|
|
@@ -35,12 +35,17 @@ export function registerWebhookTools(server, client) {
|
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
37
37
|
return {
|
|
38
|
-
content: [
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: "text",
|
|
41
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
39
44
|
isError: true,
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
});
|
|
43
|
-
server.tool("create_webhook", "create a new webhook endpoint. requires
|
|
48
|
+
server.tool("create_webhook", "create a new webhook endpoint. requires admin scope.", {
|
|
44
49
|
url: z
|
|
45
50
|
.string()
|
|
46
51
|
.url()
|
|
@@ -55,12 +60,17 @@ export function registerWebhookTools(server, client) {
|
|
|
55
60
|
}
|
|
56
61
|
catch (error) {
|
|
57
62
|
return {
|
|
58
|
-
content: [
|
|
63
|
+
content: [
|
|
64
|
+
{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
59
69
|
isError: true,
|
|
60
70
|
};
|
|
61
71
|
}
|
|
62
72
|
});
|
|
63
|
-
server.tool("get_webhook", "get a webhook by ID. requires
|
|
73
|
+
server.tool("get_webhook", "get a webhook by ID. requires admin scope.", {
|
|
64
74
|
id: z.string().uuid().describe("webhook ID"),
|
|
65
75
|
}, async ({ id }) => {
|
|
66
76
|
try {
|
|
@@ -69,12 +79,17 @@ export function registerWebhookTools(server, client) {
|
|
|
69
79
|
}
|
|
70
80
|
catch (error) {
|
|
71
81
|
return {
|
|
72
|
-
content: [
|
|
82
|
+
content: [
|
|
83
|
+
{
|
|
84
|
+
type: "text",
|
|
85
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
73
88
|
isError: true,
|
|
74
89
|
};
|
|
75
90
|
}
|
|
76
91
|
});
|
|
77
|
-
server.tool("update_webhook", "update a webhook's configuration. requires
|
|
92
|
+
server.tool("update_webhook", "update a webhook's configuration. requires admin scope.", {
|
|
78
93
|
id: z.string().uuid().describe("webhook ID"),
|
|
79
94
|
url: z
|
|
80
95
|
.string()
|
|
@@ -91,12 +106,17 @@ export function registerWebhookTools(server, client) {
|
|
|
91
106
|
}
|
|
92
107
|
catch (error) {
|
|
93
108
|
return {
|
|
94
|
-
content: [
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
type: "text",
|
|
112
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
95
115
|
isError: true,
|
|
96
116
|
};
|
|
97
117
|
}
|
|
98
118
|
});
|
|
99
|
-
server.tool("delete_webhook", "delete a webhook. requires
|
|
119
|
+
server.tool("delete_webhook", "delete a webhook. requires admin scope.", {
|
|
100
120
|
id: z.string().uuid().describe("webhook ID"),
|
|
101
121
|
}, async ({ id }) => {
|
|
102
122
|
try {
|
|
@@ -105,12 +125,17 @@ export function registerWebhookTools(server, client) {
|
|
|
105
125
|
}
|
|
106
126
|
catch (error) {
|
|
107
127
|
return {
|
|
108
|
-
content: [
|
|
128
|
+
content: [
|
|
129
|
+
{
|
|
130
|
+
type: "text",
|
|
131
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
132
|
+
},
|
|
133
|
+
],
|
|
109
134
|
isError: true,
|
|
110
135
|
};
|
|
111
136
|
}
|
|
112
137
|
});
|
|
113
|
-
server.tool("test_webhook", "send a test event to a webhook endpoint to verify it's working. requires
|
|
138
|
+
server.tool("test_webhook", "send a test event to a webhook endpoint to verify it's working. requires admin scope.", {
|
|
114
139
|
id: z.string().uuid().describe("webhook ID"),
|
|
115
140
|
}, async ({ id }) => {
|
|
116
141
|
try {
|
|
@@ -119,12 +144,17 @@ export function registerWebhookTools(server, client) {
|
|
|
119
144
|
}
|
|
120
145
|
catch (error) {
|
|
121
146
|
return {
|
|
122
|
-
content: [
|
|
147
|
+
content: [
|
|
148
|
+
{
|
|
149
|
+
type: "text",
|
|
150
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
151
|
+
},
|
|
152
|
+
],
|
|
123
153
|
isError: true,
|
|
124
154
|
};
|
|
125
155
|
}
|
|
126
156
|
});
|
|
127
|
-
server.tool("rotate_webhook_secret", "rotate the signing secret for a webhook. the new secret is returned in the response. requires
|
|
157
|
+
server.tool("rotate_webhook_secret", "rotate the signing secret for a webhook. the new secret is returned in the response. requires admin scope.", {
|
|
128
158
|
id: z.string().uuid().describe("webhook ID"),
|
|
129
159
|
}, async ({ id }) => {
|
|
130
160
|
try {
|
|
@@ -133,12 +163,17 @@ export function registerWebhookTools(server, client) {
|
|
|
133
163
|
}
|
|
134
164
|
catch (error) {
|
|
135
165
|
return {
|
|
136
|
-
content: [
|
|
166
|
+
content: [
|
|
167
|
+
{
|
|
168
|
+
type: "text",
|
|
169
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
137
172
|
isError: true,
|
|
138
173
|
};
|
|
139
174
|
}
|
|
140
175
|
});
|
|
141
|
-
server.tool("list_webhook_deliveries", "list delivery history for a webhook. requires
|
|
176
|
+
server.tool("list_webhook_deliveries", "list delivery history for a webhook. requires admin scope.", {
|
|
142
177
|
id: z.string().uuid().describe("webhook ID"),
|
|
143
178
|
page: z.number().int().positive().optional().describe("page number (default 1)"),
|
|
144
179
|
page_size: z.number().int().min(1).max(100).optional().describe("items per page (default 50, max 100)"),
|
|
@@ -154,7 +189,12 @@ export function registerWebhookTools(server, client) {
|
|
|
154
189
|
}
|
|
155
190
|
catch (error) {
|
|
156
191
|
return {
|
|
157
|
-
content: [
|
|
192
|
+
content: [
|
|
193
|
+
{
|
|
194
|
+
type: "text",
|
|
195
|
+
text: `error: ${error instanceof Error ? error.message : String(error)}`,
|
|
196
|
+
},
|
|
197
|
+
],
|
|
158
198
|
isError: true,
|
|
159
199
|
};
|
|
160
200
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -131,11 +131,6 @@ export interface AiUsage {
|
|
|
131
131
|
period_start: string;
|
|
132
132
|
period_end: string;
|
|
133
133
|
}
|
|
134
|
-
export interface AiSuggestion {
|
|
135
|
-
type: string;
|
|
136
|
-
content: string;
|
|
137
|
-
confidence: number;
|
|
138
|
-
}
|
|
139
134
|
export interface DiscoveryJob {
|
|
140
135
|
id: string;
|
|
141
136
|
campaign_id: string | null;
|