@zaapi/open-api-mcp 1.1.1 → 1.3.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/dist/client.js +5 -0
- package/dist/client.js.map +1 -1
- package/dist/instructions.js +73 -0
- package/dist/instructions.js.map +1 -0
- package/dist/server.js +134 -12
- package/dist/server.js.map +1 -1
- package/dist/tools/accounts/list-accounts.js +8 -18
- package/dist/tools/accounts/list-accounts.js.map +1 -1
- package/dist/tools/common.js +24 -28
- package/dist/tools/common.js.map +1 -1
- package/dist/tools/contacts/create-contact.js +13 -7
- package/dist/tools/contacts/create-contact.js.map +1 -1
- package/dist/tools/contacts/get-contact-by-id.js +6 -7
- package/dist/tools/contacts/get-contact-by-id.js.map +1 -1
- package/dist/tools/contacts/list-contact-fields.js +5 -3
- package/dist/tools/contacts/list-contact-fields.js.map +1 -1
- package/dist/tools/contacts/list-contacts.js +11 -6
- package/dist/tools/contacts/list-contacts.js.map +1 -1
- package/dist/tools/contacts/search-contacts.js +20 -0
- package/dist/tools/contacts/search-contacts.js.map +1 -0
- package/dist/tools/contacts/update-contact-field.js +12 -7
- package/dist/tools/contacts/update-contact-field.js.map +1 -1
- package/dist/tools/conversations/filter-conversations.js +11 -7
- package/dist/tools/conversations/filter-conversations.js.map +1 -1
- package/dist/tools/conversations/mark-conversation-read.js +4 -6
- package/dist/tools/conversations/mark-conversation-read.js.map +1 -1
- package/dist/tools/conversations/update-conversation-labels.js +10 -9
- package/dist/tools/conversations/update-conversation-labels.js.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/labels/list-labels.js +7 -4
- package/dist/tools/labels/list-labels.js.map +1 -1
- package/dist/tools/messages/create-internal-comment.js +9 -8
- package/dist/tools/messages/create-internal-comment.js.map +1 -1
- package/dist/tools/messages/get-messages.js +9 -7
- package/dist/tools/messages/get-messages.js.map +1 -1
- package/dist/tools/messages/list-internal-comments.js +8 -8
- package/dist/tools/messages/list-internal-comments.js.map +1 -1
- package/dist/tools/messages/search-messages.js +20 -0
- package/dist/tools/messages/search-messages.js.map +1 -0
- package/dist/tools/messages/send-plain-text-message.js +9 -8
- package/dist/tools/messages/send-plain-text-message.js.map +1 -1
- package/dist/tools/responses.js +271 -0
- package/dist/tools/responses.js.map +1 -0
- package/dist/tools/teams/list-teams.js +10 -5
- package/dist/tools/teams/list-teams.js.map +1 -1
- package/dist/tools/tickets/close-ticket.js +17 -10
- package/dist/tools/tickets/close-ticket.js.map +1 -1
- package/dist/tools/tickets/get-ticket-by-id.js +8 -8
- package/dist/tools/tickets/get-ticket-by-id.js.map +1 -1
- package/dist/tools/tickets/list-ticket-fields.js +7 -4
- package/dist/tools/tickets/list-ticket-fields.js.map +1 -1
- package/dist/tools/tickets/list-tickets.js +22 -22
- package/dist/tools/tickets/list-tickets.js.map +1 -1
- package/dist/tools/tickets/update-ticket-field.js +15 -8
- package/dist/tools/tickets/update-ticket-field.js.map +1 -1
- package/dist/tools/users/list-users.js +8 -5
- package/dist/tools/users/list-users.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-contacts.js","sourceRoot":"","sources":["../../../src/tools/contacts/list-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"list-contacts.js","sourceRoot":"","sources":["../../../src/tools/contacts/list-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAqB,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAU,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,+XAA+X;IACjY,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,mBAAmB;IACzB,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,GAAG,gBAAgB;QACnB,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uEAAuE,CACxE;QACH,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,kEAAkE,CACnE;QACH,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;KAC3E,CAAC;IACF,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,qBAAqB,EAAE;QAC9D,SAAS,EAAE,IAAI;KAChB,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { cursor, searchQuery } from '../common.js';
|
|
3
|
+
import { contactSearchHit, envelope } from '../responses.js';
|
|
4
|
+
const queryKeys = ['query', 'cursor'];
|
|
5
|
+
export const searchContacts = {
|
|
6
|
+
name: 'searchContacts',
|
|
7
|
+
title: 'Search contacts',
|
|
8
|
+
description: 'Find contacts by name, email, phone, address or note when you do not have a contact id. Returns 10 hits per page, most relevant first, each listing the fields that matched. A hit is a summary, not the full record — call getContactById with the id for custom fields and the timestamps the write tools need. Page with cursor alone; this operation does not accept pageSize. Requires the contacts:read scope.',
|
|
9
|
+
scope: 'contacts:read',
|
|
10
|
+
method: 'GET',
|
|
11
|
+
path: '/v1/contacts/search',
|
|
12
|
+
queryKeys,
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
query: searchQuery,
|
|
15
|
+
cursor,
|
|
16
|
+
}),
|
|
17
|
+
outputSchema: envelope(z.array(contactSearchHit), 'Matching contacts, most relevant first. Up to 10 per page.', { paginated: true }),
|
|
18
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=search-contacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-contacts.js","sourceRoot":"","sources":["../../../src/tools/contacts/search-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,sZAAsZ;IACxZ,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,WAAW;QAClB,MAAM;KACP,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,EACzB,4DAA4D,EAC5D,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { fieldValue } from '../common.js';
|
|
3
3
|
const queryKeys = [];
|
|
4
4
|
export const updateContactField = {
|
|
5
5
|
name: 'updateContactField',
|
|
6
6
|
title: 'Update a contact field value',
|
|
7
|
-
description:
|
|
7
|
+
description: 'Set or clear one custom field on a contact. Resolve contactFieldId with listContactFields and read the contact first: updatedAt must be the customFieldsUpdatedAt from that read, or the contact’s updatedAt when the contact has no custom field writes yet. A stale value is rejected with 409 — re-read and retry. Send null as value to clear. The response is only an acknowledgement, so re-read with getContactById to confirm. Requires the contacts:write scope.',
|
|
8
|
+
scope: 'contacts:write',
|
|
8
9
|
method: 'PATCH',
|
|
9
10
|
path: '/v1/contacts/fields',
|
|
10
11
|
queryKeys,
|
|
11
12
|
inputSchema: z.object({
|
|
12
|
-
contactId: z.string().min(1).describe('
|
|
13
|
+
contactId: z.string().min(1).describe('The ID of the contact.'),
|
|
13
14
|
contactFieldId: z
|
|
14
15
|
.string()
|
|
15
16
|
.min(1)
|
|
16
|
-
.describe('
|
|
17
|
-
value: fieldValue.describe('
|
|
17
|
+
.describe('The ID of the contact field, from listContactFields.'),
|
|
18
|
+
value: fieldValue.describe('New value, matching the field dataType and any select options. Send null to clear.'),
|
|
18
19
|
updatedAt: z
|
|
19
20
|
.string()
|
|
20
21
|
.min(1)
|
|
21
|
-
.describe('
|
|
22
|
+
.describe('ISO 8601 date-time. The customFieldsUpdatedAt from the last read, or the contact updatedAt when customFieldsUpdatedAt is absent.'),
|
|
22
23
|
}),
|
|
23
|
-
annotations: {
|
|
24
|
+
annotations: {
|
|
25
|
+
readOnlyHint: false,
|
|
26
|
+
destructiveHint: false,
|
|
27
|
+
openWorldHint: true,
|
|
28
|
+
},
|
|
24
29
|
};
|
|
25
30
|
//# sourceMappingURL=update-contact-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-contact-field.js","sourceRoot":"","sources":["../../../src/tools/contacts/update-contact-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"update-contact-field.js","sourceRoot":"","sources":["../../../src/tools/contacts/update-contact-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAC;AAE7D,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,2cAA2c;IAC7c,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC/D,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,sDAAsD,CAAC;QACnE,KAAK,EAAE,UAAU,CAAC,QAAQ,CACxB,oFAAoF,CACrF;QACD,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kIAAkI,CACnI;KACJ,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { expand, paginationFields, paginationQueryKeys, } from '../common.js';
|
|
3
|
+
import { conversation, envelope } from '../responses.js';
|
|
3
4
|
const queryKeys = ['conversationId', 'contactId', ...paginationQueryKeys];
|
|
4
|
-
const filterConversationsExpand = expand('Pass account to replace accountId with { id, name, channel }. assignee is not valid on conversations.');
|
|
5
5
|
export const filterConversations = {
|
|
6
6
|
name: 'filterConversations',
|
|
7
7
|
title: 'Filter conversations by ID or contact',
|
|
8
|
-
description:
|
|
8
|
+
description: 'Fetch conversations by id, or every conversation belonging to one contact. Returns the thread record itself: channel, contact, current labelIds, unread count and a last-message snippet. There is no way to list conversations without an id — to find one, start from listTickets, searchMessages or a contact. Requires the conversations:read scope.',
|
|
9
|
+
scope: 'conversations:read',
|
|
9
10
|
method: 'GET',
|
|
10
11
|
path: '/v1/conversations',
|
|
11
12
|
queryKeys,
|
|
@@ -15,18 +16,21 @@ export const filterConversations = {
|
|
|
15
16
|
.string()
|
|
16
17
|
.min(1)
|
|
17
18
|
.optional()
|
|
18
|
-
.describe('
|
|
19
|
+
.describe('The ID of the conversation.'),
|
|
19
20
|
contactId: z
|
|
20
21
|
.string()
|
|
21
22
|
.min(1)
|
|
22
23
|
.optional()
|
|
23
|
-
.describe('
|
|
24
|
+
.describe('Return every conversation this contact has, across channels.'),
|
|
24
25
|
...paginationFields,
|
|
25
|
-
expand:
|
|
26
|
+
expand: expand(['account'], 'Replace accountId with { id, name, channel }.'),
|
|
26
27
|
})
|
|
27
28
|
.refine((value) => Boolean(value.conversationId || value.contactId), {
|
|
28
29
|
message: 'Send conversationId and/or contactId.',
|
|
29
30
|
}),
|
|
30
|
-
|
|
31
|
+
outputSchema: envelope(z.array(conversation), 'The matching conversations.', {
|
|
32
|
+
paginated: true,
|
|
33
|
+
}),
|
|
34
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
31
35
|
};
|
|
32
36
|
//# sourceMappingURL=filter-conversations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-conversations.js","sourceRoot":"","sources":["../../../src/tools/conversations/filter-conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"filter-conversations.js","sourceRoot":"","sources":["../../../src/tools/conversations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EAAE;CACzD,CAAC"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { describeHttpRequest } from '../common.js';
|
|
3
2
|
const queryKeys = [];
|
|
4
3
|
export const markConversationRead = {
|
|
5
4
|
name: 'markConversationRead',
|
|
6
5
|
title: 'Mark a conversation as read',
|
|
7
|
-
description:
|
|
6
|
+
description: "Clear the unread count on the conversation's open ticket. Idempotent, so it is safe to repeat. A conversation with no open ticket returns 404. Requires the conversations:write scope.",
|
|
7
|
+
scope: 'conversations:write',
|
|
8
8
|
method: 'PATCH',
|
|
9
9
|
path: '/v1/conversations/read',
|
|
10
10
|
queryKeys,
|
|
11
11
|
inputSchema: z.object({
|
|
12
|
-
conversationId: z
|
|
13
|
-
.string()
|
|
14
|
-
.min(1)
|
|
15
|
-
.describe('JSON body. The ID of the conversation.'),
|
|
12
|
+
conversationId: z.string().min(1).describe('The ID of the conversation.'),
|
|
16
13
|
}),
|
|
17
14
|
annotations: {
|
|
18
15
|
readOnlyHint: false,
|
|
19
16
|
destructiveHint: false,
|
|
20
17
|
idempotentHint: true,
|
|
18
|
+
openWorldHint: true,
|
|
21
19
|
},
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=mark-conversation-read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mark-conversation-read.js","sourceRoot":"","sources":["../../../src/tools/conversations/mark-conversation-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"mark-conversation-read.js","sourceRoot":"","sources":["../../../src/tools/conversations/mark-conversation-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,6BAA6B;IACpC,WAAW,EACT,wLAAwL;IAC1L,KAAK,EAAE,qBAAqB;IAC5B,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,wBAAwB;IAC9B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC1E,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { describeHttpRequest } from '../common.js';
|
|
3
2
|
const queryKeys = [];
|
|
4
3
|
const MAX_LABELS_PER_REQUEST = 10;
|
|
5
4
|
export const updateConversationLabels = {
|
|
6
5
|
name: 'updateConversationLabels',
|
|
7
6
|
title: 'Update conversation labels',
|
|
8
|
-
description:
|
|
7
|
+
description: 'Add and/or remove labels on a conversation, up to 10 of each per call. Labels live on the conversation, not on its tickets, so this affects every ticket on the thread. Both lists take existing label ids from listLabels — this does not create labels. At least one of addLabels or removeLabels is required; labels already applied, or already absent, are ignored. The response is only an acknowledgement, so re-read with filterConversations to confirm labelIds. Requires the conversations:write scope.',
|
|
8
|
+
scope: 'conversations:write',
|
|
9
9
|
method: 'PATCH',
|
|
10
10
|
path: '/v1/conversations/labels',
|
|
11
11
|
queryKeys,
|
|
12
12
|
inputSchema: z
|
|
13
13
|
.object({
|
|
14
|
-
conversationId: z
|
|
15
|
-
.string()
|
|
16
|
-
.min(1)
|
|
17
|
-
.describe('JSON body. The ID of the conversation.'),
|
|
14
|
+
conversationId: z.string().min(1).describe('The ID of the conversation.'),
|
|
18
15
|
addLabels: z
|
|
19
16
|
.array(z.string())
|
|
20
17
|
.max(MAX_LABELS_PER_REQUEST)
|
|
21
18
|
.optional()
|
|
22
|
-
.describe('
|
|
19
|
+
.describe('Existing label IDs to add, from listLabels. Maximum 10.'),
|
|
23
20
|
removeLabels: z
|
|
24
21
|
.array(z.string())
|
|
25
22
|
.max(MAX_LABELS_PER_REQUEST)
|
|
26
23
|
.optional()
|
|
27
|
-
.describe('
|
|
24
|
+
.describe('Existing label IDs to remove, from listLabels. Maximum 10.'),
|
|
28
25
|
})
|
|
29
26
|
.refine((value) => (value.addLabels?.length ?? 0) > 0 ||
|
|
30
27
|
(value.removeLabels?.length ?? 0) > 0, { message: 'Send addLabels and/or removeLabels.' }),
|
|
31
|
-
annotations: {
|
|
28
|
+
annotations: {
|
|
29
|
+
readOnlyHint: false,
|
|
30
|
+
destructiveHint: false,
|
|
31
|
+
openWorldHint: true,
|
|
32
|
+
},
|
|
32
33
|
};
|
|
33
34
|
//# sourceMappingURL=update-conversation-labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-conversation-labels.js","sourceRoot":"","sources":["../../../src/tools/conversations/update-conversation-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"update-conversation-labels.js","sourceRoot":"","sources":["../../../src/tools/conversations/update-conversation-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAC9B,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,wBAAwB,GAAiB;IACpD,IAAI,EAAE,0BAA0B;IAChC,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,ofAAof;IACtf,KAAK,EAAE,qBAAqB;IAC5B,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,0BAA0B;IAChC,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,SAAS,EAAE,CAAC;aACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,sBAAsB,CAAC;aAC3B,QAAQ,EAAE;aACV,QAAQ,CAAC,yDAAyD,CAAC;QACtE,YAAY,EAAE,CAAC;aACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,sBAAsB,CAAC;aAC3B,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;KAC1E,CAAC;SACD,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;QAClC,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EACvC,EAAE,OAAO,EAAE,qCAAqC,EAAE,CACnD;IACH,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -15,6 +15,8 @@ import { listTicketFields } from './tickets/list-ticket-fields.js';
|
|
|
15
15
|
import { listTickets } from './tickets/list-tickets.js';
|
|
16
16
|
import { listUsers } from './users/list-users.js';
|
|
17
17
|
import { markConversationRead } from './conversations/mark-conversation-read.js';
|
|
18
|
+
import { searchContacts } from './contacts/search-contacts.js';
|
|
19
|
+
import { searchMessages } from './messages/search-messages.js';
|
|
18
20
|
import { sendPlainTextMessage } from './messages/send-plain-text-message.js';
|
|
19
21
|
import { updateContactField } from './contacts/update-contact-field.js';
|
|
20
22
|
import { updateConversationLabels } from './conversations/update-conversation-labels.js';
|
|
@@ -29,11 +31,13 @@ export const tools = [
|
|
|
29
31
|
markConversationRead,
|
|
30
32
|
updateConversationLabels,
|
|
31
33
|
getContactById,
|
|
34
|
+
searchContacts,
|
|
32
35
|
listContacts,
|
|
33
36
|
listContactFields,
|
|
34
37
|
createContact,
|
|
35
38
|
updateContactField,
|
|
36
39
|
getMessages,
|
|
40
|
+
searchMessages,
|
|
37
41
|
listInternalComments,
|
|
38
42
|
createInternalComment,
|
|
39
43
|
sendPlainTextMessage,
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,oBAAoB,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AAIrE,MAAM,CAAC,MAAM,KAAK,GAAmB;IACnC,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,iBAAiB;IACjB,WAAW;IACX,mBAAmB;IACnB,oBAAoB;IACpB,wBAAwB;IACxB,cAAc;IACd,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,kBAAkB;IAClB,WAAW;IACX,cAAc;IACd,oBAAoB;IACpB,qBAAqB;IACrB,oBAAoB;IACpB,SAAS;IACT,UAAU;IACV,SAAS;IACT,YAAY;CACb,CAAC;AAEF,MAAM,UAAU,UAAU,CACxB,KAA8B,EAC9B,SAA4B;IAE5B,MAAM,KAAK,GAA4B,EAAE,CAAC;IAC1C,MAAM,IAAI,GAA4B,EAAE,CAAC;IAEzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,SAAS;QACX,CAAC;QACD,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK;QACL,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { paginationFields } from '../common.js';
|
|
3
|
+
import { envelope, label } from '../responses.js';
|
|
3
4
|
const queryKeys = ['searchTerm', 'pageSize', 'cursor'];
|
|
4
5
|
export const listLabels = {
|
|
5
6
|
name: 'listLabels',
|
|
6
7
|
title: 'List labels',
|
|
7
|
-
description:
|
|
8
|
+
description: 'Page through the labels defined on the store, most recently updated first. Labels are applied to conversations, not tickets — resolve a label name to its id here before calling updateConversationLabels, which only accepts ids that already exist. searchTerm must be 3 to 100 characters; a shorter one is rejected, and a whitespace-only one is treated as omitted. Requires the labels:read scope.',
|
|
9
|
+
scope: 'labels:read',
|
|
8
10
|
method: 'GET',
|
|
9
11
|
path: '/v1/labels',
|
|
10
12
|
queryKeys,
|
|
@@ -14,9 +16,10 @@ export const listLabels = {
|
|
|
14
16
|
.min(3)
|
|
15
17
|
.max(100)
|
|
16
18
|
.optional()
|
|
17
|
-
.describe('
|
|
19
|
+
.describe('Case-insensitive match on the label text. 3 to 100 characters. Omit to list everything.'),
|
|
18
20
|
...paginationFields,
|
|
19
21
|
}),
|
|
20
|
-
|
|
22
|
+
outputSchema: envelope(z.array(label), 'A page of labels, most recently updated first.', { paginated: true }),
|
|
23
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
21
24
|
};
|
|
22
25
|
//# sourceMappingURL=list-labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-labels.js","sourceRoot":"","sources":["../../../src/tools/labels/list-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"list-labels.js","sourceRoot":"","sources":["../../../src/tools/labels/list-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAqB,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAiB;IACtC,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,2YAA2Y;IAC7Y,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,YAAY;IAClB,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,yFAAyF,CAC1F;QACH,GAAG,gBAAgB;KACpB,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACd,gDAAgD,EAChD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { describeHttpRequest } from '../common.js';
|
|
3
2
|
const queryKeys = [];
|
|
4
3
|
export const createInternalComment = {
|
|
5
4
|
name: 'createInternalComment',
|
|
6
5
|
title: 'Add an internal comment',
|
|
7
|
-
description:
|
|
6
|
+
description: 'Leave a seller-private note on a conversation. It is visible to the team only and is never delivered to the customer — use sendPlainTextMessage for anything the customer should see. The response is only an acknowledgement, so re-read with listInternalComments to confirm. Requires the messages:write scope.',
|
|
7
|
+
scope: 'messages:write',
|
|
8
8
|
method: 'POST',
|
|
9
9
|
path: '/v1/messages/internal-comments',
|
|
10
10
|
queryKeys,
|
|
11
11
|
inputSchema: z.object({
|
|
12
|
-
conversationId: z
|
|
13
|
-
.string()
|
|
14
|
-
.min(1)
|
|
15
|
-
.describe('JSON body. The ID of the conversation.'),
|
|
12
|
+
conversationId: z.string().min(1).describe('The ID of the conversation.'),
|
|
16
13
|
text: z
|
|
17
14
|
.string()
|
|
18
15
|
.min(1)
|
|
19
|
-
.describe('
|
|
16
|
+
.describe('Internal comment text. Seller-private, not sent to the customer.'),
|
|
20
17
|
}),
|
|
21
|
-
annotations: {
|
|
18
|
+
annotations: {
|
|
19
|
+
readOnlyHint: false,
|
|
20
|
+
destructiveHint: false,
|
|
21
|
+
openWorldHint: true,
|
|
22
|
+
},
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=create-internal-comment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-internal-comment.js","sourceRoot":"","sources":["../../../src/tools/messages/create-internal-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"create-internal-comment.js","sourceRoot":"","sources":["../../../src/tools/messages/create-internal-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,oTAAoT;IACtT,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,gCAAgC;IACtC,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kEAAkE,CACnE;KACJ,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { cursor,
|
|
2
|
+
import { cursor, expand, messagePageSize, } from '../common.js';
|
|
3
|
+
import { envelope, message } from '../responses.js';
|
|
3
4
|
const queryKeys = [
|
|
4
5
|
'conversationId',
|
|
5
6
|
'ticketId',
|
|
@@ -7,11 +8,11 @@ const queryKeys = [
|
|
|
7
8
|
'cursor',
|
|
8
9
|
'expand',
|
|
9
10
|
];
|
|
10
|
-
const getMessagesExpand = expand('Pass sentBy,conversation,account to add related names. Those ids stay on the message.');
|
|
11
11
|
export const getMessages = {
|
|
12
12
|
name: 'getMessages',
|
|
13
13
|
title: 'List messages',
|
|
14
|
-
description:
|
|
14
|
+
description: "Read the customer-facing messages on a thread, newest first. System events and internal comments are excluded — use listInternalComments for the private notes. Send conversationId for the whole thread, ticketId to narrow to one ticket's time window, or both. At least one is required. pageSize defaults to 15 and accepts up to 100, so ask for more in one call rather than walking the cursor. Requires the messages:read scope.",
|
|
15
|
+
scope: 'messages:read',
|
|
15
16
|
method: 'GET',
|
|
16
17
|
path: '/v1/messages',
|
|
17
18
|
queryKeys,
|
|
@@ -21,19 +22,20 @@ export const getMessages = {
|
|
|
21
22
|
.string()
|
|
22
23
|
.min(1)
|
|
23
24
|
.optional()
|
|
24
|
-
.describe('
|
|
25
|
+
.describe('The ID of the conversation.'),
|
|
25
26
|
ticketId: z
|
|
26
27
|
.string()
|
|
27
28
|
.min(1)
|
|
28
29
|
.optional()
|
|
29
|
-
.describe("
|
|
30
|
+
.describe("The ID of the ticket. Narrows results to that ticket's time window."),
|
|
30
31
|
pageSize: messagePageSize,
|
|
31
32
|
cursor,
|
|
32
|
-
expand:
|
|
33
|
+
expand: expand(['sentBy', 'conversation', 'account'], 'Add the named object beside the message. The underlying ids stay on the message.'),
|
|
33
34
|
})
|
|
34
35
|
.refine((value) => Boolean(value.conversationId || value.ticketId), {
|
|
35
36
|
message: 'Send conversationId and/or ticketId.',
|
|
36
37
|
}),
|
|
37
|
-
|
|
38
|
+
outputSchema: envelope(z.array(message), 'A page of customer-facing messages, newest first.', { paginated: true }),
|
|
39
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
38
40
|
};
|
|
39
41
|
//# sourceMappingURL=get-messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-messages.js","sourceRoot":"","sources":["../../../src/tools/messages/get-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"get-messages.js","sourceRoot":"","sources":["../../../src/tools/messages/get-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,MAAM,EACN,eAAe,GAEhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,SAAS,GAAG;IAChB,gBAAgB;IAChB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,2aAA2a;IAC7a,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,6BAA6B,CAAC;QAC1C,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,qEAAqE,CACtE;QACH,QAAQ,EAAE,eAAe;QACzB,MAAM;QACN,MAAM,EAAE,MAAM,CACZ,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,CAAC,EACrC,kFAAkF,CACnF;KACF,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE;QAClE,OAAO,EAAE,sCAAsC;KAChD,CAAC;IACJ,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAChB,mDAAmD,EACnD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { expand, paginationFields, paginationQueryKeys, } from '../common.js';
|
|
3
|
+
import { envelope, internalComment } from '../responses.js';
|
|
3
4
|
const queryKeys = ['conversationId', ...paginationQueryKeys];
|
|
4
5
|
export const listInternalComments = {
|
|
5
6
|
name: 'listInternalComments',
|
|
6
7
|
title: 'List internal comments',
|
|
7
|
-
description:
|
|
8
|
+
description: 'Read the seller-private notes on a conversation, newest first. These never reached the customer and are not covered by searchMessages, so check them for context an agent left behind before answering. Requires the messages:read scope.',
|
|
9
|
+
scope: 'messages:read',
|
|
8
10
|
method: 'GET',
|
|
9
11
|
path: '/v1/messages/internal-comments',
|
|
10
12
|
queryKeys,
|
|
11
13
|
inputSchema: z.object({
|
|
12
|
-
conversationId: z
|
|
13
|
-
.string()
|
|
14
|
-
.min(1)
|
|
15
|
-
.describe('Query parameter. The ID of the conversation.'),
|
|
14
|
+
conversationId: z.string().min(1).describe('The ID of the conversation.'),
|
|
16
15
|
...paginationFields,
|
|
17
|
-
expand: expand('
|
|
16
|
+
expand: expand(['createdBy', 'conversation', 'account'], 'Resolve the related names. createdBy replaces noteData.createdBy in place.'),
|
|
18
17
|
}),
|
|
19
|
-
|
|
18
|
+
outputSchema: envelope(z.array(internalComment), 'A page of internal comments, newest first.', { paginated: true }),
|
|
19
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=list-internal-comments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-internal-comments.js","sourceRoot":"","sources":["../../../src/tools/messages/list-internal-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"list-internal-comments.js","sourceRoot":"","sources":["../../../src/tools/messages/list-internal-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,SAAS,GAAG,CAAC,gBAAgB,EAAE,GAAG,mBAAmB,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,2OAA2O;IAC7O,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,gCAAgC;IACtC,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,GAAG,gBAAgB;QACnB,MAAM,EAAE,MAAM,CACZ,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC,EACxC,4EAA4E,CAC7E;KACF,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,EACxB,4CAA4C,EAC5C,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { cursor, searchQuery } from '../common.js';
|
|
3
|
+
import { envelope, messageSearchHit } from '../responses.js';
|
|
4
|
+
const queryKeys = ['query', 'cursor'];
|
|
5
|
+
export const searchMessages = {
|
|
6
|
+
name: 'searchMessages',
|
|
7
|
+
title: 'Search messages',
|
|
8
|
+
description: 'Find conversations by what was said in them. This is the only way to reach a thread from message content, so start here when the request names a topic rather than a ticket, conversation or contact. Returns 10 hits per page, most relevant first; every hit carries conversationId, which getMessages reads in full and listTickets turns into the tickets on that thread. Searches customer-facing message text only — internal comments are not indexed. Page with cursor alone; this operation does not accept pageSize. Requires the messages:read scope.',
|
|
9
|
+
scope: 'messages:read',
|
|
10
|
+
method: 'GET',
|
|
11
|
+
path: '/v1/messages/search',
|
|
12
|
+
queryKeys,
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
query: searchQuery,
|
|
15
|
+
cursor,
|
|
16
|
+
}),
|
|
17
|
+
outputSchema: envelope(z.array(messageSearchHit), 'Matching messages, most relevant first. Up to 10 per page.', { paginated: true }),
|
|
18
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=search-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-messages.js","sourceRoot":"","sources":["../../../src/tools/messages/search-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,kiBAAkiB;IACpiB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,WAAW;QAClB,MAAM;KACP,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,EACzB,4DAA4D,EAC5D,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { describeHttpRequest } from '../common.js';
|
|
3
2
|
const queryKeys = [];
|
|
4
3
|
export const sendPlainTextMessage = {
|
|
5
4
|
name: 'sendPlainTextMessage',
|
|
6
5
|
title: 'Send a plain text message',
|
|
7
|
-
description:
|
|
6
|
+
description: 'Send plain text to the customer on a conversation. This reaches a real person on the channel and cannot be recalled, so confirm the wording before calling it; for a note only the team can see, use createInternalComment instead. Delivery can still fail downstream when the account is unhealthy or the channel has closed its reply window — the response is only an acknowledgement, so re-read with getMessages to confirm the message landed. Requires the messages:write scope.',
|
|
7
|
+
scope: 'messages:write',
|
|
8
8
|
method: 'POST',
|
|
9
9
|
path: '/v1/messages/plain-text',
|
|
10
10
|
queryKeys,
|
|
11
11
|
inputSchema: z.object({
|
|
12
|
-
conversationId: z
|
|
13
|
-
.string()
|
|
14
|
-
.min(1)
|
|
15
|
-
.describe('JSON body. The ID of the conversation.'),
|
|
12
|
+
conversationId: z.string().min(1).describe('The ID of the conversation.'),
|
|
16
13
|
text: z
|
|
17
14
|
.string()
|
|
18
15
|
.min(1)
|
|
19
16
|
.max(1000)
|
|
20
|
-
.describe('
|
|
17
|
+
.describe('Plain text sent to the customer. Maximum 1000 characters.'),
|
|
21
18
|
}),
|
|
22
|
-
annotations: {
|
|
19
|
+
annotations: {
|
|
20
|
+
readOnlyHint: false,
|
|
21
|
+
destructiveHint: false,
|
|
22
|
+
openWorldHint: true,
|
|
23
|
+
},
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=send-plain-text-message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-plain-text-message.js","sourceRoot":"","sources":["../../../src/tools/messages/send-plain-text-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"send-plain-text-message.js","sourceRoot":"","sources":["../../../src/tools/messages/send-plain-text-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,0dAA0d;IAC5d,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,yBAAyB;IAC/B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,IAAI,CAAC;aACT,QAAQ,CAAC,2DAA2D,CAAC;KACzE,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|