@raytio/mcp-server 10.0.0 → 10.2.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.
Files changed (94) hide show
  1. package/dist/authorization.d.ts.map +1 -1
  2. package/dist/authorization.js +4 -0
  3. package/dist/authorization.js.map +1 -1
  4. package/dist/tools/_shared/side-effect.d.ts +25 -2
  5. package/dist/tools/_shared/side-effect.d.ts.map +1 -1
  6. package/dist/tools/_shared/side-effect.js +29 -4
  7. package/dist/tools/_shared/side-effect.js.map +1 -1
  8. package/dist/tools/bkm/bkm-adapter-configuration-update.d.ts +17 -0
  9. package/dist/tools/bkm/bkm-adapter-configuration-update.d.ts.map +1 -0
  10. package/dist/tools/bkm/bkm-adapter-configuration-update.js +79 -0
  11. package/dist/tools/bkm/bkm-adapter-configuration-update.js.map +1 -0
  12. package/dist/tools/bkm/bkm-availability-search-start.d.ts +20 -0
  13. package/dist/tools/bkm/bkm-availability-search-start.d.ts.map +1 -0
  14. package/dist/tools/bkm/bkm-availability-search-start.js +110 -0
  15. package/dist/tools/bkm/bkm-availability-search-start.js.map +1 -0
  16. package/dist/tools/bkm/bkm-provider-item-mapping-create.d.ts +15 -0
  17. package/dist/tools/bkm/bkm-provider-item-mapping-create.d.ts.map +1 -0
  18. package/dist/tools/bkm/bkm-provider-item-mapping-create.js +62 -0
  19. package/dist/tools/bkm/bkm-provider-item-mapping-create.js.map +1 -0
  20. package/dist/tools/bkm/generated-reads.d.ts +5 -0
  21. package/dist/tools/bkm/generated-reads.d.ts.map +1 -0
  22. package/dist/tools/bkm/generated-reads.js +33 -0
  23. package/dist/tools/bkm/generated-reads.js.map +1 -0
  24. package/dist/tools/bkm/index.d.ts +5 -0
  25. package/dist/tools/bkm/index.d.ts.map +1 -0
  26. package/dist/tools/bkm/index.js +13 -0
  27. package/dist/tools/bkm/index.js.map +1 -0
  28. package/dist/tools/dcm/dcm-device-command-dispatch.d.ts +28 -0
  29. package/dist/tools/dcm/dcm-device-command-dispatch.d.ts.map +1 -0
  30. package/dist/tools/dcm/dcm-device-command-dispatch.js +96 -0
  31. package/dist/tools/dcm/dcm-device-command-dispatch.js.map +1 -0
  32. package/dist/tools/dcm/dcm-device-register.d.ts +22 -0
  33. package/dist/tools/dcm/dcm-device-register.d.ts.map +1 -0
  34. package/dist/tools/dcm/dcm-device-register.js +86 -0
  35. package/dist/tools/dcm/dcm-device-register.js.map +1 -0
  36. package/dist/tools/dcm/dcm-device-slot-configure.d.ts +13 -0
  37. package/dist/tools/dcm/dcm-device-slot-configure.d.ts.map +1 -0
  38. package/dist/tools/dcm/dcm-device-slot-configure.js +68 -0
  39. package/dist/tools/dcm/dcm-device-slot-configure.js.map +1 -0
  40. package/dist/tools/dcm/dcm-device-update.d.ts +13 -0
  41. package/dist/tools/dcm/dcm-device-update.d.ts.map +1 -0
  42. package/dist/tools/dcm/dcm-device-update.js +55 -0
  43. package/dist/tools/dcm/dcm-device-update.js.map +1 -0
  44. package/dist/tools/dcm/generated-reads.d.ts +5 -0
  45. package/dist/tools/dcm/generated-reads.d.ts.map +1 -0
  46. package/dist/tools/dcm/generated-reads.js +30 -0
  47. package/dist/tools/dcm/generated-reads.js.map +1 -0
  48. package/dist/tools/dcm/index.d.ts +5 -0
  49. package/dist/tools/dcm/index.d.ts.map +1 -0
  50. package/dist/tools/dcm/index.js +15 -0
  51. package/dist/tools/dcm/index.js.map +1 -0
  52. package/dist/tools/domains.d.ts.map +1 -1
  53. package/dist/tools/domains.js +36 -0
  54. package/dist/tools/domains.js.map +1 -1
  55. package/dist/tools/ixn/generated-reads.d.ts +5 -0
  56. package/dist/tools/ixn/generated-reads.d.ts.map +1 -0
  57. package/dist/tools/ixn/generated-reads.js +29 -0
  58. package/dist/tools/ixn/generated-reads.js.map +1 -0
  59. package/dist/tools/ixn/index.d.ts +5 -0
  60. package/dist/tools/ixn/index.d.ts.map +1 -0
  61. package/dist/tools/ixn/index.js +8 -0
  62. package/dist/tools/ixn/index.js.map +1 -0
  63. package/dist/tools/ixn/ixn-conversation-start.d.ts +22 -0
  64. package/dist/tools/ixn/ixn-conversation-start.d.ts.map +1 -0
  65. package/dist/tools/ixn/ixn-conversation-start.js +98 -0
  66. package/dist/tools/ixn/ixn-conversation-start.js.map +1 -0
  67. package/dist/tools/ixn/ixn-message-send.d.ts +28 -0
  68. package/dist/tools/ixn/ixn-message-send.d.ts.map +1 -0
  69. package/dist/tools/ixn/ixn-message-send.js +92 -0
  70. package/dist/tools/ixn/ixn-message-send.js.map +1 -0
  71. package/dist/tools/role-mapping.d.ts.map +1 -1
  72. package/dist/tools/role-mapping.js +24 -0
  73. package/dist/tools/role-mapping.js.map +1 -1
  74. package/dist/tools/xrm/generated-reads.d.ts +5 -0
  75. package/dist/tools/xrm/generated-reads.d.ts.map +1 -0
  76. package/dist/tools/xrm/generated-reads.js +37 -0
  77. package/dist/tools/xrm/generated-reads.js.map +1 -0
  78. package/dist/tools/xrm/index.d.ts +5 -0
  79. package/dist/tools/xrm/index.d.ts.map +1 -0
  80. package/dist/tools/xrm/index.js +13 -0
  81. package/dist/tools/xrm/index.js.map +1 -0
  82. package/dist/tools/xrm/xrm-inbound-email-rule-create.d.ts +21 -0
  83. package/dist/tools/xrm/xrm-inbound-email-rule-create.d.ts.map +1 -0
  84. package/dist/tools/xrm/xrm-inbound-email-rule-create.js +85 -0
  85. package/dist/tools/xrm/xrm-inbound-email-rule-create.js.map +1 -0
  86. package/dist/tools/xrm/xrm-merchant-create.d.ts +22 -0
  87. package/dist/tools/xrm/xrm-merchant-create.d.ts.map +1 -0
  88. package/dist/tools/xrm/xrm-merchant-create.js +85 -0
  89. package/dist/tools/xrm/xrm-merchant-create.js.map +1 -0
  90. package/dist/tools/xrm/xrm-merchant-update.d.ts +14 -0
  91. package/dist/tools/xrm/xrm-merchant-update.d.ts.map +1 -0
  92. package/dist/tools/xrm/xrm-merchant-update.js +61 -0
  93. package/dist/tools/xrm/xrm-merchant-update.js.map +1 -0
  94. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { ixnGeneratedReadTools } from './generated-reads.js';
2
+ import { ixnConversationStartTool } from './ixn-conversation-start.js';
3
+ import { ixnMessageSendTool } from './ixn-message-send.js';
4
+ const ixnWriteTools = [ixnConversationStartTool, ixnMessageSendTool];
5
+ export const ixnTools = [...ixnGeneratedReadTools, ...ixnWriteTools];
6
+ /** Read-only slice used by the `ixn-readonly` selectable sub-domain. */
7
+ export const ixnReadOnlyTools = ixnGeneratedReadTools;
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/ixn/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,aAAa,GAAW,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,QAAQ,GAAW,CAAC,GAAG,qBAAqB,EAAE,GAAG,aAAa,CAAC,CAAC;AAE7E,wEAAwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAW,qBAAqB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { Tool } from '../registry.js';
2
+ /**
3
+ * State-change semantic tool: open a new interaction conversation
4
+ * (`ixn_conversations`). Starting a conversation binds a channel
5
+ * endpoint / queue to a work-item, lead, or deal, so the tool
6
+ * requires:
7
+ *
8
+ * - `confirm: true` to prevent accidental invocation;
9
+ * - a `channel_endpoint_id` (the outbound / inbound channel this
10
+ * thread is being opened on) — required by the pinned contract.
11
+ *
12
+ * Only `thread_id` protects a retry: (channel_endpoint_id, thread_id,
13
+ * tenant_id) is unique, so a repeat fails with a duplicate-key error.
14
+ * Without it each call opens another conversation, so the tool is not
15
+ * idempotent by default.
16
+ *
17
+ * `ixn_queues` is EXCLUDED from the MCP surface by the queue
18
+ * guardrail; queue routing is a persist-side concern and callers
19
+ * reference the queue by id only.
20
+ */
21
+ export declare const ixnConversationStartTool: Tool;
22
+ //# sourceMappingURL=ixn-conversation-start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ixn-conversation-start.d.ts","sourceRoot":"","sources":["../../../src/tools/ixn/ixn-conversation-start.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB,EAAE,IA+EtC,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { z } from 'zod';
2
+ import { API_ERROR, errorResponse, successResponse } from '../types.js';
3
+ import { cap } from '../../capabilities/tool-capability.js';
4
+ import { confirmFlagSchema, unenforcedIdempotencyKeySchema, writeHeadersWithIdempotency, } from '../_shared/side-effect.js';
5
+ /**
6
+ * State-change semantic tool: open a new interaction conversation
7
+ * (`ixn_conversations`). Starting a conversation binds a channel
8
+ * endpoint / queue to a work-item, lead, or deal, so the tool
9
+ * requires:
10
+ *
11
+ * - `confirm: true` to prevent accidental invocation;
12
+ * - a `channel_endpoint_id` (the outbound / inbound channel this
13
+ * thread is being opened on) — required by the pinned contract.
14
+ *
15
+ * Only `thread_id` protects a retry: (channel_endpoint_id, thread_id,
16
+ * tenant_id) is unique, so a repeat fails with a duplicate-key error.
17
+ * Without it each call opens another conversation, so the tool is not
18
+ * idempotent by default.
19
+ *
20
+ * `ixn_queues` is EXCLUDED from the MCP surface by the queue
21
+ * guardrail; queue routing is a persist-side concern and callers
22
+ * reference the queue by id only.
23
+ */
24
+ export const ixnConversationStartTool = {
25
+ name: 'ixn_conversation_start',
26
+ description: 'Start a new interaction conversation (ixn_conversations) on a channel endpoint. ' +
27
+ 'Requires confirm=true and a channel_endpoint_id. With thread_id, a retry on the same ' +
28
+ 'channel endpoint fails with a duplicate-key error. Without it, calling again opens another ' +
29
+ 'conversation, so check ixn_conversations_list before retrying.',
30
+ inputSchema: z.object({
31
+ channel_endpoint_id: z
32
+ .string()
33
+ .min(1)
34
+ .describe('UUID of the ixn_channel_endpoints row this conversation runs on'),
35
+ queue_id: z
36
+ .string()
37
+ .min(1)
38
+ .optional()
39
+ .describe('UUID of the ixn_queues row that routes this conversation'),
40
+ thread_id: z
41
+ .string()
42
+ .max(512)
43
+ .optional()
44
+ .describe('External channel-side thread identifier. Unique per channel endpoint.'),
45
+ conversation_status: z
46
+ .string()
47
+ .max(32)
48
+ .optional()
49
+ .describe('Initial status from the IXN_CONVERSATIONS_CONVERSATION_STATUS lookup (OPEN, CLOSED)'),
50
+ lead_id: z.string().min(1).optional().describe('UUID of the sfa_leads row this conversation is scoped to'),
51
+ deal_id: z.string().min(1).optional().describe('UUID of the sfa_deals row this conversation is scoped to'),
52
+ org_id: z.string().min(1).optional().describe('UUID of the hrm_organizations_c row this conversation is scoped to'),
53
+ work_item_id: z
54
+ .string()
55
+ .min(1)
56
+ .optional()
57
+ .describe('UUID of the ppm_work_items row this conversation is scoped to'),
58
+ resource_url: z
59
+ .string()
60
+ .optional()
61
+ .describe('Optional URL of the external resource this conversation is anchored on'),
62
+ metadata: z.record(z.unknown()).optional(),
63
+ confirm: confirmFlagSchema,
64
+ idempotency_key: unenforcedIdempotencyKeySchema,
65
+ }),
66
+ capabilities: [cap('ixn_conversations', 'INSERT')],
67
+ sideEffect: 'state_change',
68
+ confirmation: 'caller_confirms',
69
+ idempotency: 'not_idempotent',
70
+ handler: async (args, ctx) => {
71
+ const input = args;
72
+ const body = {
73
+ channel_endpoint_id: input.channel_endpoint_id,
74
+ };
75
+ for (const field of [
76
+ 'queue_id',
77
+ 'thread_id',
78
+ 'conversation_status',
79
+ 'lead_id',
80
+ 'deal_id',
81
+ 'org_id',
82
+ 'work_item_id',
83
+ 'resource_url',
84
+ 'metadata',
85
+ ]) {
86
+ if (input[field] !== undefined)
87
+ body[field] = input[field];
88
+ }
89
+ try {
90
+ const rows = await ctx.apiClient.post(`${ctx.apiClient.dbBasePath}/ixn_conversations?select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
91
+ return successResponse(rows[0]);
92
+ }
93
+ catch (error) {
94
+ return errorResponse(API_ERROR, `Failed to start IXN conversation: ${error.message}`);
95
+ }
96
+ },
97
+ };
98
+ //# sourceMappingURL=ixn-conversation-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ixn-conversation-start.js","sourceRoot":"","sources":["../../../src/tools/ixn/ixn-conversation-start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAS;IAC5C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,kFAAkF;QAClF,uFAAuF;QACvF,6FAA6F;QAC7F,gEAAgE;IAClE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,mBAAmB,EAAE,CAAC;aACnB,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,iEAAiE,CAAC;QAC9E,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,0DAA0D,CAAC;QACvE,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,uEAAuE,CAAC;QACpF,mBAAmB,EAAE,CAAC;aACnB,MAAM,EAAE;aACR,GAAG,CAAC,EAAE,C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AQ;YACR,cAAc;YACd,cAAc;YACd,UAAU;SACX,EAAE,CAAC;YACF,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CACnC,GAAG,GAAG,CAAC,SAAS,CAAC,UAAU,6BAA6B,EACxD,IAAI,EACJ,EAAE,OAAO,EAAE,2BAA2B,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAChE,CAAC;YACF,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,aAAa,CAClB,SAAS,EACT,qCAAqC,KAAK,CAAC,OAAO,EAAE,CACrD,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { Tool } from '../registry.js';
2
+ /**
3
+ * Communication semantic tool: dispatch an outbound message on an
4
+ * existing conversation (`ixn_messages`). The row this creates is
5
+ * picked up by the channel delivery worker and sent to the customer,
6
+ * so the tool requires:
7
+ *
8
+ * - `confirm: true` to prevent accidental invocation.
9
+ *
10
+ * Not deduplicated: Persist ignores the `Idempotency-Key` header and
11
+ * `ixn_messages` has no idempotent create path yet, so a repeat call
12
+ * sends a second message. The description tells callers to check first.
13
+ *
14
+ * `direction` is force-set to `OUTBOUND`, the exact value the
15
+ * `IXN_MESSAGES_DIRECTION` lookup holds and the only value the delivery
16
+ * trigger fires on — inbound messages arrive
17
+ * via the channel delivery worker, never via MCP; a caller wanting
18
+ * to log an inbound message should use the read tools plus the
19
+ * dedicated inbound-processing endpoints. `delivery_status` is
20
+ * server-assigned and returned on the created row for status
21
+ * polling via `ixn_messages_get`.
22
+ *
23
+ * Provider credentials (`ixn_channel_endpoints.outbound_credential_ssm_names`)
24
+ * are never read or set from this tool — the delivery worker
25
+ * resolves them server-side.
26
+ */
27
+ export declare const ixnMessageSendTool: Tool;
28
+ //# sourceMappingURL=ixn-message-send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ixn-message-send.d.ts","sourceRoot":"","sources":["../../../src/tools/ixn/ixn-message-send.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,kBAAkB,EAAE,IAmEhC,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { z } from 'zod';
2
+ import { API_ERROR, errorResponse, successResponse } from '../types.js';
3
+ import { cap } from '../../capabilities/tool-capability.js';
4
+ import { confirmFlagSchema, unenforcedIdempotencyKeySchema, writeHeadersWithIdempotency, } from '../_shared/side-effect.js';
5
+ /**
6
+ * Communication semantic tool: dispatch an outbound message on an
7
+ * existing conversation (`ixn_messages`). The row this creates is
8
+ * picked up by the channel delivery worker and sent to the customer,
9
+ * so the tool requires:
10
+ *
11
+ * - `confirm: true` to prevent accidental invocation.
12
+ *
13
+ * Not deduplicated: Persist ignores the `Idempotency-Key` header and
14
+ * `ixn_messages` has no idempotent create path yet, so a repeat call
15
+ * sends a second message. The description tells callers to check first.
16
+ *
17
+ * `direction` is force-set to `OUTBOUND`, the exact value the
18
+ * `IXN_MESSAGES_DIRECTION` lookup holds and the only value the delivery
19
+ * trigger fires on — inbound messages arrive
20
+ * via the channel delivery worker, never via MCP; a caller wanting
21
+ * to log an inbound message should use the read tools plus the
22
+ * dedicated inbound-processing endpoints. `delivery_status` is
23
+ * server-assigned and returned on the created row for status
24
+ * polling via `ixn_messages_get`.
25
+ *
26
+ * Provider credentials (`ixn_channel_endpoints.outbound_credential_ssm_names`)
27
+ * are never read or set from this tool — the delivery worker
28
+ * resolves them server-side.
29
+ */
30
+ export const ixnMessageSendTool = {
31
+ name: 'ixn_message_send',
32
+ description: 'Dispatch an outbound message on an existing IXN conversation (ixn_messages). ' +
33
+ 'Requires confirm=true, conversation_id, sender_identity and body_text. direction is ' +
34
+ 'forced to OUTBOUND. delivery_status is server-assigned; poll status via ixn_messages_get ' +
35
+ 'on the returned row id. Not deduplicated: calling it again sends the message again, so ' +
36
+ 'check ixn_messages_list filtered on conversation_id before retrying.',
37
+ inputSchema: z.object({
38
+ conversation_id: z
39
+ .string()
40
+ .min(1)
41
+ .describe('UUID of the ixn_conversations row this message is posted to'),
42
+ sender_identity: z
43
+ .string()
44
+ .min(1)
45
+ .max(256)
46
+ .describe('The sender recorded on the message. Email is sent from the channel endpoint address, not this value.'),
47
+ body_text: z.string().min(1).describe('The plain-text message body to dispatch'),
48
+ channel_msg_id: z
49
+ .string()
50
+ .max(256)
51
+ .optional()
52
+ .describe('Optional caller-supplied channel-side message identifier'),
53
+ sent_by_worker_id: z
54
+ .string()
55
+ .min(1)
56
+ .optional()
57
+ .describe('Optional UUID of the wrm_workers row this send is attributed to'),
58
+ org_id: z
59
+ .string()
60
+ .min(1)
61
+ .optional()
62
+ .describe('UUID of the hrm_organizations_c row this send is scoped to'),
63
+ metadata: z.record(z.unknown()).optional(),
64
+ confirm: confirmFlagSchema,
65
+ idempotency_key: unenforcedIdempotencyKeySchema,
66
+ }),
67
+ capabilities: [cap('ixn_messages', 'INSERT')],
68
+ sideEffect: 'communication',
69
+ confirmation: 'caller_confirms',
70
+ idempotency: 'not_idempotent',
71
+ handler: async (args, ctx) => {
72
+ const input = args;
73
+ const body = {
74
+ conversation_id: input.conversation_id,
75
+ sender_identity: input.sender_identity,
76
+ body_text: input.body_text,
77
+ direction: 'OUTBOUND',
78
+ };
79
+ for (const field of ['channel_msg_id', 'sent_by_worker_id', 'org_id', 'metadata']) {
80
+ if (input[field] !== undefined)
81
+ body[field] = input[field];
82
+ }
83
+ try {
84
+ const rows = await ctx.apiClient.post(`${ctx.apiClient.dbBasePath}/ixn_messages?select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
85
+ return successResponse(rows[0]);
86
+ }
87
+ catch (error) {
88
+ return errorResponse(API_ERROR, `Failed to send IXN outbound message: ${error.message}`);
89
+ }
90
+ },
91
+ };
92
+ //# sourceMappingURL=ixn-message-send.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ixn-message-send.js","sourceRoot":"","sources":["../../../src/tools/ixn/ixn-message-send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACtC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,+EAA+E;QAC/E,sFAAsF;QACtF,2FAA2F;QAC3F,yFAAyF;QACzF,sEAAsE;IACxE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,eAAe,EAAE,CAAC;aACf,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,6DAA6D,CAAC;QAC1E,eAAe,EAAE,CAAC;aACf,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,CAAC,sGAAsG,CAAC;QACnH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;QAChF,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,0DAA0D,CAAC;QACvE,iBAAiB,EAAE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AC,EAAE,CAChE,CAAC;YACF,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,aAAa,CAClB,SAAS,EACT,wCAAwC,KAAK,CAAC,OAAO,EAAE,CACxD,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"role-mapping.d.ts","sourceRoot":"","sources":["../../src/tools/role-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAuCD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAiChE;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,eAAe,GACzB,OAAO,CAAC,SAAS,EAAE,CAAC,CAEtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,eAAe,GACzB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B"}
1
+ {"version":3,"file":"role-mapping.d.ts","sourceRoot":"","sources":["../../src/tools/role-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAmDD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA6ChE;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,eAAe,GACzB,OAAO,CAAC,SAAS,EAAE,CAAC,CAEtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,eAAe,GACzB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B"}
@@ -33,6 +33,18 @@ const ROLE_TO_DOMAINS = {
33
33
  'Accounts payable administrator': ['fap'],
34
34
  'Accounts payable user': ['fap'],
35
35
  'Accounts payable viewer': ['fap-readonly'],
36
+ 'Device administrator': ['dcm'],
37
+ 'Device user': ['dcm'],
38
+ 'Device viewer': ['dcm-readonly'],
39
+ 'Booking administrator': ['bkm'],
40
+ 'Booking user': ['bkm'],
41
+ 'Booking viewer': ['bkm-readonly'],
42
+ 'Merchant administrator': ['xrm'],
43
+ 'Merchant user': ['xrm'],
44
+ 'Merchant viewer': ['xrm-readonly'],
45
+ 'Interaction administrator': ['ixn'],
46
+ 'Interaction user': ['ixn'],
47
+ 'Interaction viewer': ['ixn-readonly'],
36
48
  };
37
49
  /**
38
50
  * Given a list of user group names, resolve the set of tool domain IDs
@@ -72,6 +84,18 @@ export function mapRolesToDomains(groupNames) {
72
84
  if (domains.has('fap') && domains.has('fap-readonly')) {
73
85
  domains.delete('fap-readonly');
74
86
  }
87
+ if (domains.has('dcm') && domains.has('dcm-readonly')) {
88
+ domains.delete('dcm-readonly');
89
+ }
90
+ if (domains.has('bkm') && domains.has('bkm-readonly')) {
91
+ domains.delete('bkm-readonly');
92
+ }
93
+ if (domains.has('xrm') && domains.has('xrm-readonly')) {
94
+ domains.delete('xrm-readonly');
95
+ }
96
+ if (domains.has('ixn') && domains.has('ixn-readonly')) {
97
+ domains.delete('ixn-readonly');
98
+ }
75
99
  return [...domains];
76
100
  }
77
101
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"role-mapping.js","sourceRoot":"","sources":["../../src/tools/role-mapping.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,MAAM,eAAe,GAA6B;IAChD,uBAAuB,EAAE,CAAC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kCAAkC,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,SAA0B;IAE1B,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,MAAM;SACjB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;SACxB,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Tool } from '../registry.js';
2
+ import { CatalogueReport } from '../../generated-reads/index.js';
3
+ export declare const xrmGeneratedReadReport: CatalogueReport;
4
+ export declare const xrmGeneratedReadTools: Tool[];
5
+ //# sourceMappingURL=generated-reads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-reads.d.ts","sourceRoot":"","sources":["../../../src/tools/xrm/generated-reads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAGL,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAqCxC,eAAO,MAAM,sBAAsB,EAAE,eAC8B,CAAC;AAEpE,eAAO,MAAM,qBAAqB,EAAE,IAAI,EAGvC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { buildGeneratedReadCatalogue, buildGeneratedReadCatalogueReport, } from '../../generated-reads/index.js';
2
+ import { loadPersistResourceContract } from '../../contracts/persist-resource-contract.js';
3
+ /**
4
+ * Bounded read tools for the XRM module (WI-0003508).
5
+ *
6
+ * The schema-driven catalogue (WI-0003500) emits describe/list/get for
7
+ * every `normal`-sensitivity XRM resource that declares a read
8
+ * operation and has no side effects. The pinned Persist contract
9
+ * already excludes credential material via the standard credentials
10
+ * guardrail — `xrm_merchant_authentication_configuration_details`
11
+ * and `xrm_merchant_payment_processor_credentials` are never surfaced
12
+ * — so this module gets bounded reads for the safe subset:
13
+ *
14
+ * - `xrm_merchants` — marketplace merchants (organisation records).
15
+ * - `xrm_merchant_classifications` — merchant-to-classification
16
+ * mapping used by marketplace faceting.
17
+ * - `xrm_merchant_countries` — countries a merchant operates in.
18
+ * - `xrm_merchant_items` — merchant-to-item catalogue mapping.
19
+ * - `xrm_inbound_domain_rules` / `xrm_inbound_email_addresses` /
20
+ * `xrm_inbound_email_rules` — inbound-email routing metadata used
21
+ * to configure how incoming messages are dispatched.
22
+ * - `xrm_inbound_email_quarantine_items` — the read side of the
23
+ * inbound-email quarantine so callers can inspect quarantined
24
+ * messages.
25
+ *
26
+ * The four inbound resources get `describe` only for now: their `list`
27
+ * and `get` tools need a SELECT capability that no role holds yet
28
+ * (WI-0009403), so they appear once Persist adds it.
29
+ *
30
+ * Every write on a merchant / rule row lives in a dedicated hand-
31
+ * written tool with explicit confirmation semantics (see
32
+ * `xrm-merchant-*`, `xrm-inbound-email-rule-*`).
33
+ */
34
+ const contract = loadPersistResourceContract();
35
+ export const xrmGeneratedReadReport = buildGeneratedReadCatalogueReport(contract, { modules: ['xrm'] });
36
+ export const xrmGeneratedReadTools = buildGeneratedReadCatalogue(contract, { modules: ['xrm'] });
37
+ //# sourceMappingURL=generated-reads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-reads.js","sourceRoot":"","sources":["../../../src/tools/xrm/generated-reads.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAElC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,QAAQ,GAAG,2BAA2B,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GACjC,iCAAiC,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAEpE,MAAM,CAAC,MAAM,qBAAqB,GAAW,2BAA2B,CACtE,QAAQ,EACR,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CACrB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Tool } from '../registry.js';
2
+ export declare const xrmTools: Tool[];
3
+ /** Read-only slice used by the `xrm-readonly` selectable sub-domain. */
4
+ export declare const xrmReadOnlyTools: Tool[];
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/xrm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAYtC,eAAO,MAAM,QAAQ,EAAE,IAAI,EAAiD,CAAC;AAE7E,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAA0B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { xrmGeneratedReadTools } from './generated-reads.js';
2
+ import { xrmMerchantCreateTool } from './xrm-merchant-create.js';
3
+ import { xrmMerchantUpdateTool } from './xrm-merchant-update.js';
4
+ import { xrmInboundEmailRuleCreateTool } from './xrm-inbound-email-rule-create.js';
5
+ const xrmWriteTools = [
6
+ xrmMerchantCreateTool,
7
+ xrmMerchantUpdateTool,
8
+ xrmInboundEmailRuleCreateTool,
9
+ ];
10
+ export const xrmTools = [...xrmGeneratedReadTools, ...xrmWriteTools];
11
+ /** Read-only slice used by the `xrm-readonly` selectable sub-domain. */
12
+ export const xrmReadOnlyTools = xrmGeneratedReadTools;
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/xrm/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,MAAM,aAAa,GAAW;IAC5B,qBAAqB;IACrB,qBAAqB;IACrB,6BAA6B;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAW,CAAC,GAAG,qBAAqB,EAAE,GAAG,aAAa,CAAC,CAAC;AAE7E,wEAAwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAW,qBAAqB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Tool } from '../registry.js';
2
+ /**
3
+ * State-change semantic tool: create an inbound email routing rule
4
+ * (`xrm_inbound_email_rules`). Adding a rule changes how future
5
+ * incoming email is dispatched (or quarantined) for a given inbound
6
+ * email address, so the tool requires:
7
+ *
8
+ * - `confirm: true` to prevent a model wiring routing changes into
9
+ * live mail delivery accidentally;
10
+ * - the target `email_id`, the match rule, and the local-part
11
+ * pattern set. Persist validates the match type and the FK. It does
12
+ * not validate the match rule: IXN capture only recognises `DROP`
13
+ * (or `D`), so any other value is stored and has no effect there.
14
+ *
15
+ * Not deduplicated: the table's only unique key is its id, so a retry
16
+ * creates a second rule. Callers cannot check first through MCP yet,
17
+ * because no role holds SELECT on the inbound email tables, so the
18
+ * generated reads do not appear (WI-0009403). The description says so.
19
+ */
20
+ export declare const xrmInboundEmailRuleCreateTool: Tool;
21
+ //# sourceMappingURL=xrm-inbound-email-rule-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xrm-inbound-email-rule-create.d.ts","sourceRoot":"","sources":["../../../src/tools/xrm/xrm-inbound-email-rule-create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,6BAA6B,EAAE,IAsE3C,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { z } from 'zod';
2
+ import { API_ERROR, errorResponse, successResponse } from '../types.js';
3
+ import { cap } from '../../capabilities/tool-capability.js';
4
+ import { confirmFlagSchema, unenforcedIdempotencyKeySchema, writeHeadersWithIdempotency, } from '../_shared/side-effect.js';
5
+ /**
6
+ * State-change semantic tool: create an inbound email routing rule
7
+ * (`xrm_inbound_email_rules`). Adding a rule changes how future
8
+ * incoming email is dispatched (or quarantined) for a given inbound
9
+ * email address, so the tool requires:
10
+ *
11
+ * - `confirm: true` to prevent a model wiring routing changes into
12
+ * live mail delivery accidentally;
13
+ * - the target `email_id`, the match rule, and the local-part
14
+ * pattern set. Persist validates the match type and the FK. It does
15
+ * not validate the match rule: IXN capture only recognises `DROP`
16
+ * (or `D`), so any other value is stored and has no effect there.
17
+ *
18
+ * Not deduplicated: the table's only unique key is its id, so a retry
19
+ * creates a second rule. Callers cannot check first through MCP yet,
20
+ * because no role holds SELECT on the inbound email tables, so the
21
+ * generated reads do not appear (WI-0009403). The description says so.
22
+ */
23
+ export const xrmInboundEmailRuleCreateTool = {
24
+ name: 'xrm_inbound_email_rule_create',
25
+ description: 'Create an inbound email routing rule (xrm_inbound_email_rules). Requires confirm=true, ' +
26
+ 'the target email_id, a match rule, and the local-part patterns to match. Changes how ' +
27
+ 'future incoming mail is dispatched. Not deduplicated: calling it again creates another ' +
28
+ 'rule, and MCP cannot read existing rules or look up an email_id yet, so do not retry ' +
29
+ 'after an unclear result: ask a person to check instead.',
30
+ inputSchema: z.object({
31
+ email_id: z
32
+ .string()
33
+ .min(1)
34
+ .describe('UUID of the xrm_inbound_email_addresses row this rule attaches to'),
35
+ inbound_sender_email_match_rule: z
36
+ .string()
37
+ .max(16)
38
+ .describe('Match rule. DROP (or D) stops matched mail being captured by IXN. Persist does not ' +
39
+ 'validate this field, and IXN capture recognises no other value.'),
40
+ inbound_sender_email_local_part_matches_text: z
41
+ .array(z.string().min(1))
42
+ .min(1)
43
+ .describe('Local-part patterns the rule matches on'),
44
+ inbound_sender_email_match_type: z
45
+ .string()
46
+ .max(16)
47
+ .optional()
48
+ .describe('Match type from the XRM_SENDER_MATCH_TYPE lookup (EXACT, REGEX). Defaults to EXACT.'),
49
+ inbound_sender_email_match_destinations: z
50
+ .array(z.string().min(1))
51
+ .optional()
52
+ .describe('Optional set of destinations the matched mail is dispatched to'),
53
+ metadata: z.record(z.unknown()).optional(),
54
+ confirm: confirmFlagSchema,
55
+ idempotency_key: unenforcedIdempotencyKeySchema,
56
+ }),
57
+ capabilities: [cap('xrm_inbound_email_rules', 'INSERT')],
58
+ sideEffect: 'state_change',
59
+ confirmation: 'caller_confirms',
60
+ idempotency: 'not_idempotent',
61
+ handler: async (args, ctx) => {
62
+ const input = args;
63
+ const body = {
64
+ email_id: input.email_id,
65
+ inbound_sender_email_match_rule: input.inbound_sender_email_match_rule,
66
+ inbound_sender_email_local_part_matches_text: input.inbound_sender_email_local_part_matches_text,
67
+ };
68
+ for (const field of [
69
+ 'inbound_sender_email_match_type',
70
+ 'inbound_sender_email_match_destinations',
71
+ 'metadata',
72
+ ]) {
73
+ if (input[field] !== undefined)
74
+ body[field] = input[field];
75
+ }
76
+ try {
77
+ const rows = await ctx.apiClient.post(`${ctx.apiClient.dbBasePath}/xrm_inbound_email_rules?select=*`, body, { headers: writeHeadersWithIdempotency(input.idempotency_key) });
78
+ return successResponse(rows[0]);
79
+ }
80
+ catch (error) {
81
+ return errorResponse(API_ERROR, `Failed to create XRM inbound email rule: ${error.message}`);
82
+ }
83
+ },
84
+ };
85
+ //# sourceMappingURL=xrm-inbound-email-rule-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xrm-inbound-email-rule-create.js","sourceRoot":"","sources":["../../../src/tools/xrm/xrm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isioning semantic tool: create a new marketplace merchant
4
+ * (`xrm_merchants`) linked to an existing PRM party. Creating a
5
+ * merchant makes it discoverable to buyers and causes downstream
6
+ * provisioning (search indexing, listings), so the tool requires:
7
+ *
8
+ * - `confirm: true` to prevent accidental invocation;
9
+ * - a `party_id` (natural key — the merchant's owning PRM party).
10
+ * (party_id, tenant_id) is unique, so a retry fails with a
11
+ * duplicate-key error rather than provisioning a duplicate.
12
+ *
13
+ * `merchant_approval_status_code` is deliberately not an input:
14
+ * approving a merchant is a separate decision from creating one.
15
+ *
16
+ * Provider credentials (`xrm_merchant_authentication_configuration_details`
17
+ * and `xrm_merchant_payment_processor_credentials`) are EXCLUDED from
18
+ * the MCP surface by the credentials guardrail and are never written
19
+ * or returned by this tool.
20
+ */
21
+ export declare const xrmMerchantCreateTool: Tool;
22
+ //# sourceMappingURL=xrm-merchant-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xrm-merchant-create.d.ts","sourceRoot":"","sources":["../../../src/tools/xrm/xrm-merchant-create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAStC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,EAAE,IA+DnC,CAAC"}