@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.
@@ -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 notifications:read scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 notifications:write scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 notifications:write scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 notifications:write scope.", {}, async () => {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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
  }
@@ -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 webhooks:read scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 webhooks:write scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 webhooks:read scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 webhooks:write scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 webhooks:write scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 webhooks:write scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 webhooks:write scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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 webhooks:read scope.", {
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: [{ type: "text", text: `error: ${error instanceof Error ? error.message : String(error)}` }],
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jclvsh/iris",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "MCP server for the Iris API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",