@lerianstudio/matcher-mcp 5.0.0-beta.7 → 5.0.0-beta.71

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 (273) hide show
  1. package/README.md +28 -13
  2. package/dist/auth/request-token.js +11 -69
  3. package/dist/auth/request-token.js.map +1 -1
  4. package/dist/config.js +6 -21
  5. package/dist/config.js.map +1 -1
  6. package/dist/copilot/agent.js +5 -9
  7. package/dist/copilot/agent.js.map +1 -1
  8. package/dist/copilot/provider-anthropic.js +75 -23
  9. package/dist/copilot/provider-anthropic.js.map +1 -1
  10. package/dist/copilot/provider-openrouter.js +5 -18
  11. package/dist/copilot/provider-openrouter.js.map +1 -1
  12. package/dist/copilot/provider-shared.js +11 -0
  13. package/dist/copilot/provider-shared.js.map +1 -1
  14. package/dist/copilot/speech-provider.js +84 -0
  15. package/dist/copilot/speech-provider.js.map +1 -0
  16. package/dist/copilot/sse.js +5 -0
  17. package/dist/copilot/sse.js.map +1 -1
  18. package/dist/copilot/tools.js +14 -65
  19. package/dist/copilot/tools.js.map +1 -1
  20. package/dist/copilot/transcribe-handler.js +8 -93
  21. package/dist/copilot/transcribe-handler.js.map +1 -1
  22. package/dist/copilot/turn-request.js +76 -0
  23. package/dist/copilot/turn-request.js.map +1 -0
  24. package/dist/copilot/turns-handler.js +11 -102
  25. package/dist/copilot/turns-handler.js.map +1 -1
  26. package/dist/matcher/client.js +14 -0
  27. package/dist/matcher/client.js.map +1 -1
  28. package/dist/matcher/idempotency.js +94 -0
  29. package/dist/matcher/idempotency.js.map +1 -0
  30. package/dist/observability/otel.js +7 -29
  31. package/dist/observability/otel.js.map +1 -1
  32. package/dist/server.js +12 -81
  33. package/dist/server.js.map +1 -1
  34. package/dist/spec/curated-operations.js +111 -95
  35. package/dist/spec/curated-operations.js.map +1 -1
  36. package/dist/spec/enum-policy.js +21 -26
  37. package/dist/spec/enum-policy.js.map +1 -1
  38. package/dist/spec/openapi.yaml +841 -56
  39. package/dist/spec/schema-parity.js +23 -28
  40. package/dist/spec/schema-parity.js.map +1 -1
  41. package/dist/tools/context/create.js +3 -2
  42. package/dist/tools/context/create.js.map +1 -1
  43. package/dist/tools/context/index.js +137 -17
  44. package/dist/tools/context/index.js.map +1 -1
  45. package/dist/tools/context/list.js +9 -35
  46. package/dist/tools/context/list.js.map +1 -1
  47. package/dist/tools/context/setup-progress.js +3 -2
  48. package/dist/tools/context/setup-progress.js.map +1 -1
  49. package/dist/tools/context/shared.js +7 -48
  50. package/dist/tools/context/shared.js.map +1 -1
  51. package/dist/tools/context/update.js +5 -5
  52. package/dist/tools/context/update.js.map +1 -1
  53. package/dist/tools/curated-tool.js +39 -0
  54. package/dist/tools/curated-tool.js.map +1 -0
  55. package/dist/tools/dashboard/index.js +124 -19
  56. package/dist/tools/dashboard/index.js.map +1 -1
  57. package/dist/tools/dashboard/shared.js +9 -68
  58. package/dist/tools/dashboard/shared.js.map +1 -1
  59. package/dist/tools/dispute/close.js +5 -5
  60. package/dist/tools/dispute/close.js.map +1 -1
  61. package/dist/tools/dispute/index.js +34 -6
  62. package/dist/tools/dispute/index.js.map +1 -1
  63. package/dist/tools/dispute/list.js +18 -47
  64. package/dist/tools/dispute/list.js.map +1 -1
  65. package/dist/tools/dispute/shared.js +4 -43
  66. package/dist/tools/dispute/shared.js.map +1 -1
  67. package/dist/tools/dispute/submit-evidence.js +5 -5
  68. package/dist/tools/dispute/submit-evidence.js.map +1 -1
  69. package/dist/tools/exception/add-comment.js +3 -2
  70. package/dist/tools/exception/add-comment.js.map +1 -1
  71. package/dist/tools/exception/adjust-entry.js +5 -5
  72. package/dist/tools/exception/adjust-entry.js.map +1 -1
  73. package/dist/tools/exception/bulk-assign.js +3 -2
  74. package/dist/tools/exception/bulk-assign.js.map +1 -1
  75. package/dist/tools/exception/bulk-dispatch.js +12 -4
  76. package/dist/tools/exception/bulk-dispatch.js.map +1 -1
  77. package/dist/tools/exception/bulk-resolve.js +3 -2
  78. package/dist/tools/exception/bulk-resolve.js.map +1 -1
  79. package/dist/tools/exception/dispatch.js +13 -5
  80. package/dist/tools/exception/dispatch.js.map +1 -1
  81. package/dist/tools/exception/force-match.js +3 -2
  82. package/dist/tools/exception/force-match.js.map +1 -1
  83. package/dist/tools/exception/history.js +8 -24
  84. package/dist/tools/exception/history.js.map +1 -1
  85. package/dist/tools/exception/index.js +88 -18
  86. package/dist/tools/exception/index.js.map +1 -1
  87. package/dist/tools/exception/list.js +14 -57
  88. package/dist/tools/exception/list.js.map +1 -1
  89. package/dist/tools/exception/open-dispute.js +3 -2
  90. package/dist/tools/exception/open-dispute.js.map +1 -1
  91. package/dist/tools/exception/shared.js +10 -46
  92. package/dist/tools/exception/shared.js.map +1 -1
  93. package/dist/tools/fee-rule/create.js +5 -5
  94. package/dist/tools/fee-rule/create.js.map +1 -1
  95. package/dist/tools/fee-rule/index.js +50 -8
  96. package/dist/tools/fee-rule/index.js.map +1 -1
  97. package/dist/tools/fee-rule/list.js +9 -29
  98. package/dist/tools/fee-rule/list.js.map +1 -1
  99. package/dist/tools/fee-rule/shared.js +5 -47
  100. package/dist/tools/fee-rule/shared.js.map +1 -1
  101. package/dist/tools/fee-rule/update.js +5 -5
  102. package/dist/tools/fee-rule/update.js.map +1 -1
  103. package/dist/tools/fee-schedule/create.js +8 -3
  104. package/dist/tools/fee-schedule/create.js.map +1 -1
  105. package/dist/tools/fee-schedule/index.js +62 -11
  106. package/dist/tools/fee-schedule/index.js.map +1 -1
  107. package/dist/tools/fee-schedule/list.js +8 -24
  108. package/dist/tools/fee-schedule/list.js.map +1 -1
  109. package/dist/tools/fee-schedule/shared.js +5 -44
  110. package/dist/tools/fee-schedule/shared.js.map +1 -1
  111. package/dist/tools/fee-schedule/simulate.js +5 -5
  112. package/dist/tools/fee-schedule/simulate.js.map +1 -1
  113. package/dist/tools/fee-schedule/update.js +5 -5
  114. package/dist/tools/fee-schedule/update.js.map +1 -1
  115. package/dist/tools/field-map/create.js +3 -2
  116. package/dist/tools/field-map/create.js.map +1 -1
  117. package/dist/tools/field-map/index.js +65 -11
  118. package/dist/tools/field-map/index.js.map +1 -1
  119. package/dist/tools/field-map/list.js +9 -29
  120. package/dist/tools/field-map/list.js.map +1 -1
  121. package/dist/tools/field-map/shared.js +6 -42
  122. package/dist/tools/field-map/shared.js.map +1 -1
  123. package/dist/tools/field-map/update.js +3 -2
  124. package/dist/tools/field-map/update.js.map +1 -1
  125. package/dist/tools/generic/invoke.js +16 -39
  126. package/dist/tools/generic/invoke.js.map +1 -1
  127. package/dist/tools/ingestion/index.js +100 -12
  128. package/dist/tools/ingestion/index.js.map +1 -1
  129. package/dist/tools/ingestion/job-transactions-list.js +10 -40
  130. package/dist/tools/ingestion/job-transactions-list.js.map +1 -1
  131. package/dist/tools/ingestion/jobs-list.js +9 -35
  132. package/dist/tools/ingestion/jobs-list.js.map +1 -1
  133. package/dist/tools/ingestion/shared.js +4 -41
  134. package/dist/tools/ingestion/shared.js.map +1 -1
  135. package/dist/tools/ingestion/transactions-search.js +9 -44
  136. package/dist/tools/ingestion/transactions-search.js.map +1 -1
  137. package/dist/tools/ingestion/upload-begin.js +5 -2
  138. package/dist/tools/ingestion/upload-begin.js.map +1 -1
  139. package/dist/tools/ingestion/upload.js +3 -2
  140. package/dist/tools/ingestion/upload.js.map +1 -1
  141. package/dist/tools/input-fields.js +51 -0
  142. package/dist/tools/input-fields.js.map +1 -0
  143. package/dist/tools/match-rule/index.js +130 -13
  144. package/dist/tools/match-rule/index.js.map +1 -1
  145. package/dist/tools/match-rule/list.js +9 -33
  146. package/dist/tools/match-rule/list.js.map +1 -1
  147. package/dist/tools/match-rule/shared.js +16 -46
  148. package/dist/tools/match-rule/shared.js.map +1 -1
  149. package/dist/tools/match-rule/update.js +7 -11
  150. package/dist/tools/match-rule/update.js.map +1 -1
  151. package/dist/tools/matching/get.js +5 -5
  152. package/dist/tools/matching/get.js.map +1 -1
  153. package/dist/tools/matching/groups.js +6 -14
  154. package/dist/tools/matching/groups.js.map +1 -1
  155. package/dist/tools/matching/index.js +77 -5
  156. package/dist/tools/matching/index.js.map +1 -1
  157. package/dist/tools/matching/list.js +9 -32
  158. package/dist/tools/matching/list.js.map +1 -1
  159. package/dist/tools/matching/shared.js +5 -46
  160. package/dist/tools/matching/shared.js.map +1 -1
  161. package/dist/tools/query-handler.js +9 -0
  162. package/dist/tools/query-handler.js.map +1 -0
  163. package/dist/tools/report/index.js +260 -30
  164. package/dist/tools/report/index.js.map +1 -1
  165. package/dist/tools/report/shared.js +24 -98
  166. package/dist/tools/report/shared.js.map +1 -1
  167. package/dist/tools/request-fields.js +17 -0
  168. package/dist/tools/request-fields.js.map +1 -0
  169. package/dist/tools/shared-dispatch.js +38 -0
  170. package/dist/tools/shared-dispatch.js.map +1 -0
  171. package/dist/tools/source/create.js +146 -23
  172. package/dist/tools/source/create.js.map +1 -1
  173. package/dist/tools/source/index.js +101 -13
  174. package/dist/tools/source/index.js.map +1 -1
  175. package/dist/tools/source/list.js +9 -32
  176. package/dist/tools/source/list.js.map +1 -1
  177. package/dist/tools/source/shared.js +5 -42
  178. package/dist/tools/source/shared.js.map +1 -1
  179. package/dist/tools/source/update.js +16 -33
  180. package/dist/tools/source/update.js.map +1 -1
  181. package/dist/tools/workspace/usage.js +12 -40
  182. package/dist/tools/workspace/usage.js.map +1 -1
  183. package/package.json +4 -4
  184. package/dist/tools/context/archive.js +0 -37
  185. package/dist/tools/context/archive.js.map +0 -1
  186. package/dist/tools/context/get.js +0 -31
  187. package/dist/tools/context/get.js.map +0 -1
  188. package/dist/tools/context/next-step.js +0 -99
  189. package/dist/tools/context/next-step.js.map +0 -1
  190. package/dist/tools/context/restore.js +0 -34
  191. package/dist/tools/context/restore.js.map +0 -1
  192. package/dist/tools/dashboard/aggregates.js +0 -37
  193. package/dist/tools/dashboard/aggregates.js.map +0 -1
  194. package/dist/tools/dashboard/cash-impact.js +0 -37
  195. package/dist/tools/dashboard/cash-impact.js.map +0 -1
  196. package/dist/tools/dashboard/match-rate.js +0 -37
  197. package/dist/tools/dashboard/match-rate.js.map +0 -1
  198. package/dist/tools/dashboard/metrics.js +0 -37
  199. package/dist/tools/dashboard/metrics.js.map +0 -1
  200. package/dist/tools/dashboard/sla.js +0 -34
  201. package/dist/tools/dashboard/sla.js.map +0 -1
  202. package/dist/tools/dashboard/source-breakdown.js +0 -37
  203. package/dist/tools/dashboard/source-breakdown.js.map +0 -1
  204. package/dist/tools/dashboard/volume.js +0 -37
  205. package/dist/tools/dashboard/volume.js.map +0 -1
  206. package/dist/tools/dispute/get.js +0 -27
  207. package/dist/tools/dispute/get.js.map +0 -1
  208. package/dist/tools/exception/delete-comment.js +0 -40
  209. package/dist/tools/exception/delete-comment.js.map +0 -1
  210. package/dist/tools/exception/get.js +0 -34
  211. package/dist/tools/exception/get.js.map +0 -1
  212. package/dist/tools/exception/list-comments.js +0 -35
  213. package/dist/tools/exception/list-comments.js.map +0 -1
  214. package/dist/tools/fee-rule/delete.js +0 -27
  215. package/dist/tools/fee-rule/delete.js.map +0 -1
  216. package/dist/tools/fee-rule/get.js +0 -27
  217. package/dist/tools/fee-rule/get.js.map +0 -1
  218. package/dist/tools/fee-schedule/delete.js +0 -32
  219. package/dist/tools/fee-schedule/delete.js.map +0 -1
  220. package/dist/tools/fee-schedule/get.js +0 -30
  221. package/dist/tools/fee-schedule/get.js.map +0 -1
  222. package/dist/tools/field-map/delete.js +0 -37
  223. package/dist/tools/field-map/delete.js.map +0 -1
  224. package/dist/tools/field-map/get.js +0 -43
  225. package/dist/tools/field-map/get.js.map +0 -1
  226. package/dist/tools/ingestion/job-errors-list.js +0 -45
  227. package/dist/tools/ingestion/job-errors-list.js.map +0 -1
  228. package/dist/tools/ingestion/job-get.js +0 -42
  229. package/dist/tools/ingestion/job-get.js.map +0 -1
  230. package/dist/tools/ingestion/transaction-ignore.js +0 -51
  231. package/dist/tools/ingestion/transaction-ignore.js.map +0 -1
  232. package/dist/tools/match-rule/create.js +0 -67
  233. package/dist/tools/match-rule/create.js.map +0 -1
  234. package/dist/tools/match-rule/delete.js +0 -35
  235. package/dist/tools/match-rule/delete.js.map +0 -1
  236. package/dist/tools/match-rule/get.js +0 -32
  237. package/dist/tools/match-rule/get.js.map +0 -1
  238. package/dist/tools/match-rule/reorder.js +0 -45
  239. package/dist/tools/match-rule/reorder.js.map +0 -1
  240. package/dist/tools/matching/start.js +0 -81
  241. package/dist/tools/matching/start.js.map +0 -1
  242. package/dist/tools/report/count-exceptions.js +0 -46
  243. package/dist/tools/report/count-exceptions.js.map +0 -1
  244. package/dist/tools/report/count-matched.js +0 -47
  245. package/dist/tools/report/count-matched.js.map +0 -1
  246. package/dist/tools/report/count-transactions.js +0 -45
  247. package/dist/tools/report/count-transactions.js.map +0 -1
  248. package/dist/tools/report/count-unmatched.js +0 -45
  249. package/dist/tools/report/count-unmatched.js.map +0 -1
  250. package/dist/tools/report/export-exceptions.js +0 -48
  251. package/dist/tools/report/export-exceptions.js.map +0 -1
  252. package/dist/tools/report/export-matched.js +0 -49
  253. package/dist/tools/report/export-matched.js.map +0 -1
  254. package/dist/tools/report/export-summary.js +0 -49
  255. package/dist/tools/report/export-summary.js.map +0 -1
  256. package/dist/tools/report/export-unmatched.js +0 -49
  257. package/dist/tools/report/export-unmatched.js.map +0 -1
  258. package/dist/tools/report/export-variance.js +0 -48
  259. package/dist/tools/report/export-variance.js.map +0 -1
  260. package/dist/tools/report/matched.js +0 -48
  261. package/dist/tools/report/matched.js.map +0 -1
  262. package/dist/tools/report/summary.js +0 -43
  263. package/dist/tools/report/summary.js.map +0 -1
  264. package/dist/tools/report/unmatched.js +0 -48
  265. package/dist/tools/report/unmatched.js.map +0 -1
  266. package/dist/tools/report/variance.js +0 -48
  267. package/dist/tools/report/variance.js.map +0 -1
  268. package/dist/tools/source/archive.js +0 -46
  269. package/dist/tools/source/archive.js.map +0 -1
  270. package/dist/tools/source/get.js +0 -57
  271. package/dist/tools/source/get.js.map +0 -1
  272. package/dist/tools/source/restore.js +0 -39
  273. package/dist/tools/source/restore.js.map +0 -1
@@ -1,43 +0,0 @@
1
- // `field_map_get` — curated GET
2
- // /v1/contexts/{contextId}/sources/{sourceId}/field-maps.
3
- //
4
- // Reads the field map bound to one source (getFieldMapBySource in the spec —
5
- // a source has at most one field map, so this is a singular fetch, not a
6
- // list). Both contextId and sourceId are path params; the source must belong
7
- // to a context owned by the relayed token's tenant — matcher enforces that;
8
- // no tenant field is accepted.
9
- import { z } from 'zod';
10
- import { dispatchFieldMap, sourceFieldMapPath } from './shared.js';
11
- /** Zod raw shape for `field_map_get` input — both path ids. */
12
- export const getFieldMapInputShape = {
13
- contextId: z
14
- .string()
15
- .min(1)
16
- .describe('The reconciliation context id (UUID). Routing path param, not a tenant ' +
17
- 'field.'),
18
- sourceId: z
19
- .string()
20
- .min(1)
21
- .describe('The reconciliation source id (UUID) whose field map to fetch.'),
22
- };
23
- /**
24
- * Register `field_map_get`. Substitutes both ids into the path and dispatches
25
- * a GET through the shared fail-closed relay; a matcher error (e.g. 404 when
26
- * the source has no field map yet) surfaces via the shared toToolError.
27
- */
28
- export function registerFieldMapGetTool(server) {
29
- server.registerTool('field_map_get', {
30
- description: 'Fetch the field map bound to a source (a source has at most one). ' +
31
- 'Provide both contextId and sourceId (UUID path params; contextId is ' +
32
- "not a tenant field). The source must belong to your token's tenant. " +
33
- 'Returns the field map, or a structured RFC 9457 error (e.g. 404 if ' +
34
- 'the source has no field map yet).',
35
- inputSchema: getFieldMapInputShape,
36
- }, async (args, extra) => {
37
- return dispatchFieldMap({
38
- method: 'GET',
39
- path: sourceFieldMapPath(args.contextId, args.sourceId),
40
- }, extra);
41
- });
42
- }
43
- //# sourceMappingURL=get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/tools/field-map/get.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,0DAA0D;AAC1D,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,4EAA4E;AAC5E,+BAA+B;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAElE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,+DAA+D,CAAC;CAC7E,CAAA;AAKD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EACT,oEAAoE;YACpE,sEAAsE;YACtE,sEAAsE;YACtE,qEAAqE;YACrE,mCAAmC;QACrC,WAAW,EAAE,qBAAqB;KACnC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,gBAAgB,CACrB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;SACxD,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,45 +0,0 @@
1
- // `ingestion_job_errors_list` — curated GET
2
- // /v1/imports/contexts/{contextId}/jobs/{jobId}/errors.
3
- //
4
- // Returns the stored per-row parse/normalization errors for an ingestion job
5
- // (capped at 100 per job by matcher), with the uncapped failure total and
6
- // truncation accounting, so a client can explain a failed or partially-failed
7
- // import. No query params — just the two path ids. The job must belong to a
8
- // context owned by the relayed token's tenant; no tenant field is accepted.
9
- import { z } from 'zod';
10
- import { contextJobErrorsPath, dispatchIngestion } from './shared.js';
11
- /** Zod raw shape for `ingestion_job_errors_list` input — both path ids. */
12
- export const listIngestionJobErrorsInputShape = {
13
- contextId: z
14
- .string()
15
- .min(1)
16
- .describe('The reconciliation context id (UUID). Routing path param, not a tenant ' +
17
- 'field.'),
18
- jobId: z
19
- .string()
20
- .min(1)
21
- .describe('The ingestion job id (UUID) whose per-row errors to list.'),
22
- };
23
- /**
24
- * Register `ingestion_job_errors_list`. Substitutes both ids into the path and
25
- * dispatches a GET through the shared fail-closed relay; matcher returns the
26
- * capped error list plus the uncapped total, and a matcher error surfaces via
27
- * the shared toToolError.
28
- */
29
- export function registerIngestionJobErrorsListTool(server) {
30
- server.registerTool('ingestion_job_errors_list', {
31
- description: 'List the per-row parse/normalization errors for an ingestion job ' +
32
- '(capped at 100 by matcher, with the uncapped failure total and ' +
33
- 'truncation accounting) — use it to explain a failed or partially-failed ' +
34
- 'import. Provide both contextId and jobId (path params; contextId is not ' +
35
- 'a tenant field). No tenant field is accepted. Errors surface as ' +
36
- 'structured RFC 9457 problems.',
37
- inputSchema: listIngestionJobErrorsInputShape,
38
- }, async (args, extra) => {
39
- return dispatchIngestion({
40
- method: 'GET',
41
- path: contextJobErrorsPath(args.contextId, args.jobId),
42
- }, extra);
43
- });
44
- }
45
- //# sourceMappingURL=job-errors-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"job-errors-list.js","sourceRoot":"","sources":["../../../src/tools/ingestion/job-errors-list.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,wDAAwD;AACxD,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAE5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAErE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,2DAA2D,CAAC;CACzE,CAAA;AAOD;;;;;GAKG;AACH,MAAM,UAAU,kCAAkC,CAAC,MAAiB;IAClE,MAAM,CAAC,YAAY,CACjB,2BAA2B,EAC3B;QACE,WAAW,EACT,mEAAmE;YACnE,iEAAiE;YACjE,0EAA0E;YAC1E,0EAA0E;YAC1E,kEAAkE;YAClE,+BAA+B;QACjC,WAAW,EAAE,gCAAgC;KAC9C,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;SACvD,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,42 +0,0 @@
1
- // `ingestion_job_get` — curated GET
2
- // /v1/imports/contexts/{contextId}/jobs/{jobId}.
3
- //
4
- // Reads one ingestion job by id, including its progress metrics and error
5
- // summary. Both contextId and jobId are path params; the job must belong to a
6
- // context owned by the relayed token's tenant — matcher enforces that; no tenant
7
- // field is accepted.
8
- import { z } from 'zod';
9
- import { contextJobPath, dispatchIngestion } from './shared.js';
10
- /** Zod raw shape for `ingestion_job_get` input — both path ids. */
11
- export const getIngestionJobInputShape = {
12
- contextId: z
13
- .string()
14
- .min(1)
15
- .describe('The reconciliation context id (UUID). Routing path param, not a tenant ' +
16
- 'field.'),
17
- jobId: z
18
- .string()
19
- .min(1)
20
- .describe('The ingestion job id (UUID) to fetch.'),
21
- };
22
- /**
23
- * Register `ingestion_job_get`. Substitutes both ids into the path and
24
- * dispatches a GET through the shared fail-closed relay; a matcher error (e.g.
25
- * 404) surfaces via the shared toToolError.
26
- */
27
- export function registerIngestionJobGetTool(server) {
28
- server.registerTool('ingestion_job_get', {
29
- description: 'Fetch a single ingestion job by id (UUID) within a context, including ' +
30
- 'its status and progress metrics. Provide both contextId and jobId (path ' +
31
- 'params; contextId is not a tenant field). The job must belong to your ' +
32
- "token's tenant. Returns the job, or a structured RFC 9457 error (e.g. " +
33
- '404 if it does not exist or is not yours).',
34
- inputSchema: getIngestionJobInputShape,
35
- }, async (args, extra) => {
36
- return dispatchIngestion({
37
- method: 'GET',
38
- path: contextJobPath(args.contextId, args.jobId),
39
- }, extra);
40
- });
41
- }
42
- //# sourceMappingURL=job-get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"job-get.js","sourceRoot":"","sources":["../../../src/tools/ingestion/job-get.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,iDAAiD;AACjD,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,iFAAiF;AACjF,qBAAqB;AAErB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAE/D,mEAAmE;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,uCAAuC,CAAC;CACrD,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAiB;IAC3D,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,WAAW,EACT,wEAAwE;YACxE,0EAA0E;YAC1E,wEAAwE;YACxE,wEAAwE;YACxE,4CAA4C;QAC9C,WAAW,EAAE,yBAAyB;KACvC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC;SACjD,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,51 +0,0 @@
1
- // `ingestion_transaction_ignore` — curated POST
2
- // /v1/imports/contexts/{contextId}/transactions/{transactionId}/ignore.
3
- //
4
- // Marks a transaction as "Do Not Match" with a required reason. Only UNMATCHED
5
- // transactions can be ignored (matcher rejects others). contextId and
6
- // transactionId are routing path params; the reason is the only body field
7
- // (required, non-empty, per the spec's IgnoreTransactionRequest). No tenant
8
- // field is accepted — matcher scopes to the relayed token's tenant.
9
- import { z } from 'zod';
10
- import { contextTransactionIgnorePath, dispatchIngestion } from './shared.js';
11
- /** Zod raw shape for `ingestion_transaction_ignore` input — path ids + reason body. */
12
- export const ignoreTransactionInputShape = {
13
- contextId: z
14
- .string()
15
- .min(1)
16
- .describe('The reconciliation context id (UUID). Routing path param, not a tenant ' +
17
- 'field.'),
18
- transactionId: z
19
- .string()
20
- .min(1)
21
- .describe('The transaction id (UUID) to ignore (mark "Do Not Match").'),
22
- reason: z
23
- .string()
24
- .min(1)
25
- .describe('Reason for ignoring the transaction (required, non-empty), e.g. ' +
26
- '"Duplicate entry - already processed manually".'),
27
- };
28
- /**
29
- * Register `ingestion_transaction_ignore`. Splits the routing ids (path) from
30
- * the `reason` body and dispatches the POST through the shared fail-closed
31
- * relay; a matcher error (e.g. 422 when the transaction is not UNMATCHED)
32
- * surfaces via the shared toToolError.
33
- */
34
- export function registerIngestionTransactionIgnoreTool(server) {
35
- server.registerTool('ingestion_transaction_ignore', {
36
- description: 'Mark a transaction as "Do Not Match" with a required reason. Only ' +
37
- 'UNMATCHED transactions can be ignored. Provide contextId and ' +
38
- 'transactionId (UUID path params; contextId is not a tenant field) and a ' +
39
- 'non-empty reason. No tenant field is accepted. Returns the updated ' +
40
- 'transaction, or a structured RFC 9457 error (e.g. 422 if it is not ' +
41
- 'UNMATCHED).',
42
- inputSchema: ignoreTransactionInputShape,
43
- }, async (args, extra) => {
44
- return dispatchIngestion({
45
- method: 'POST',
46
- path: contextTransactionIgnorePath(args.contextId, args.transactionId),
47
- body: { reason: args.reason },
48
- }, extra);
49
- });
50
- }
51
- //# sourceMappingURL=transaction-ignore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transaction-ignore.js","sourceRoot":"","sources":["../../../src/tools/ingestion/transaction-ignore.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,wEAAwE;AACxE,EAAE;AACF,+EAA+E;AAC/E,sEAAsE;AACtE,2EAA2E;AAC3E,4EAA4E;AAC5E,oEAAoE;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAE7E,uFAAuF;AACvF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,QAAQ,CACX;IACH,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,4DAA4D,CAAC;IACzE,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,kEAAkE;QAChE,iDAAiD,CACpD;CACJ,CAAA;AAOD;;;;;GAKG;AACH,MAAM,UAAU,sCAAsC,CACpD,MAAiB;IAEjB,MAAM,CAAC,YAAY,CACjB,8BAA8B,EAC9B;QACE,WAAW,EACT,oEAAoE;YACpE,+DAA+D;YAC/D,0EAA0E;YAC1E,qEAAqE;YACrE,qEAAqE;YACrE,aAAa;QACf,WAAW,EAAE,2BAA2B;KACzC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,4BAA4B,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC;YACtE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SAC9B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,67 +0,0 @@
1
- // `match_rule_create` — curated POST /v1/contexts/{contextId}/rules.
2
- //
3
- // A typed, richly-described front door to defining a match rule within a
4
- // reconciliation context, mirroring the spec's CreateMatchRuleRequest. The Zod
5
- // schema models the required scalars (priority, type) and the documented type
6
- // enum so an operator-driving LLM gets the shape and the semantics up front; the
7
- // `config` object is type-specific and is modeled as a permissive open record
8
- // (per the established pattern) — matcher's server-side validation + the returned
9
- // RFC 9457 problem are the authoritative per-type check, so we do not duplicate
10
- // it here.
11
- //
12
- // `contextId` is a routing path param, not a tenant field. No tenant field
13
- // exists in the schema: the rule is created for the tenant of the relayed bearer
14
- // token, and matcher validates that the context belongs to that tenant.
15
- import { z } from 'zod';
16
- import { contextRulesPath, dispatchMatchRule, RULE_CONFIG_DESC_BODY, } from './shared.js';
17
- /** Matching strategy. EXACT / TOLERANCE / DATE_LAG / FUZZY (spec oneof). */
18
- export const MATCH_RULE_TYPES = [
19
- 'EXACT',
20
- 'TOLERANCE',
21
- 'DATE_LAG',
22
- 'FUZZY',
23
- ];
24
- /** Zod raw shape for `match_rule_create` input — mirrors CreateMatchRuleRequest. */
25
- export const createMatchRuleInputShape = {
26
- contextId: z
27
- .string()
28
- .min(1)
29
- .describe('The reconciliation context id (UUID) the rule belongs to. Routing path ' +
30
- 'param, not a tenant field — matcher validates the context is yours.'),
31
- priority: z
32
- .number()
33
- .int()
34
- .min(1)
35
- .max(1000)
36
- .describe('Execution priority (1–1000); lower numbers run first. Must be unique ' +
37
- 'within the context.'),
38
- type: z
39
- .enum(MATCH_RULE_TYPES)
40
- .describe('Matching strategy. EXACT requires identical field values; TOLERANCE ' +
41
- 'allows configured numeric slack; DATE_LAG allows a configured date ' +
42
- 'offset between sides; FUZZY matches on normalized/similarity-scored ' +
43
- 'references (free-text memos, truncated refs) and ALWAYS proposes for ' +
44
- 'review — never auto-confirms.'),
45
- config: z
46
- .record(z.string(), z.unknown())
47
- .describe('Rule-specific ' + RULE_CONFIG_DESC_BODY),
48
- };
49
- /**
50
- * Register `match_rule_create`. Splits the routing `contextId` (path) from the
51
- * body fields and dispatches the POST through the shared fail-closed relay; a
52
- * matcher error surfaces via the shared toToolError (same shape as matcher_invoke).
53
- */
54
- export function registerMatchRuleCreateTool(server) {
55
- server.registerTool('match_rule_create', {
56
- description: 'Create a match rule within a reconciliation context. Provide contextId ' +
57
- '(UUID path), priority (1–1000, unique within the context), type ' +
58
- '(EXACT|TOLERANCE|DATE_LAG|FUZZY), and config (a type-specific object validated ' +
59
- 'server-side). No tenant field is accepted — the rule is created for your ' +
60
- "token's tenant. Returns the created rule, or a structured RFC 9457 error.",
61
- inputSchema: createMatchRuleInputShape,
62
- }, async (args, extra) => {
63
- const { contextId, ...body } = args;
64
- return dispatchMatchRule({ method: 'POST', path: contextRulesPath(contextId), body }, extra);
65
- });
66
- }
67
- //# sourceMappingURL=create.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/tools/match-rule/create.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,yEAAyE;AACzE,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,8EAA8E;AAC9E,kFAAkF;AAClF,gFAAgF;AAChF,WAAW;AACX,EAAE;AACF,2EAA2E;AAC3E,iFAAiF;AACjF,wEAAwE;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAA;AAEpB,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO;IACP,WAAW;IACX,UAAU;IACV,OAAO;CACC,CAAA;AAEV,oFAAoF;AACpF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,qEAAqE,CACxE;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,IAAI,CAAC;SACT,QAAQ,CACP,uEAAuE;QACrE,qBAAqB,CACxB;IACH,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,gBAAgB,CAAC;SACtB,QAAQ,CACP,sEAAsE;QACpE,qEAAqE;QACrE,sEAAsE;QACtE,uEAAuE;QACvE,+BAA+B,CAClC;IACH,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,CAAC,gBAAgB,GAAG,qBAAqB,CAAC;CACtD,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAiB;IAC3D,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,WAAW,EACT,yEAAyE;YACzE,kEAAkE;YAClE,iFAAiF;YACjF,2EAA2E;YAC3E,2EAA2E;QAC7E,WAAW,EAAE,yBAAyB;KACvC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;QACnC,OAAO,iBAAiB,CACtB,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAC3D,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,35 +0,0 @@
1
- // `match_rule_delete` — curated DELETE /v1/contexts/{contextId}/rules/{ruleId}.
2
- //
3
- // Removes a match rule by id within a context. A successful delete returns 204
4
- // (no content), which the relay renders as null. Both contextId and ruleId are
5
- // UUID path params; no tenant field is accepted (matcher scopes to the relayed
6
- // token's tenant via the context).
7
- import { z } from 'zod';
8
- import { contextRulePath, dispatchMatchRule } from './shared.js';
9
- /** Zod raw shape for `match_rule_delete` input — context id + rule id (both path). */
10
- export const deleteMatchRuleInputShape = {
11
- contextId: z
12
- .string()
13
- .min(1)
14
- .describe('The reconciliation context id (UUID). Routing path param, not a tenant field.'),
15
- ruleId: z.string().min(1).describe('The match rule id (UUID) to delete.'),
16
- };
17
- /**
18
- * Register `match_rule_delete`. Substitutes both ids into the path and dispatches
19
- * a DELETE through the shared fail-closed relay; any matcher error surfaces via
20
- * the shared toToolError.
21
- */
22
- export function registerMatchRuleDeleteTool(server) {
23
- server.registerTool('match_rule_delete', {
24
- description: 'Delete a match rule by id (UUID) within a context (UUID). The rule and ' +
25
- "its context must belong to your token's tenant (no tenant field is " +
26
- 'accepted). Returns no content on success, or a structured RFC 9457 error.',
27
- inputSchema: deleteMatchRuleInputShape,
28
- }, async (args, extra) => {
29
- return dispatchMatchRule({
30
- method: 'DELETE',
31
- path: contextRulePath(args.contextId, args.ruleId),
32
- }, extra);
33
- });
34
- }
35
- //# sourceMappingURL=delete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/tools/match-rule/delete.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,mCAAmC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEhE,sFAAsF;AACtF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,+EAA+E,CAChF;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;CAC1E,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAiB;IAC3D,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,WAAW,EACT,yEAAyE;YACzE,qEAAqE;YACrE,2EAA2E;QAC7E,WAAW,EAAE,yBAAyB;KACvC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;SACnD,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,32 +0,0 @@
1
- // `match_rule_get` — curated GET /v1/contexts/{contextId}/rules/{ruleId}.
2
- //
3
- // Reads one match rule by id within a context. Both contextId and ruleId are
4
- // path params (UUIDs). The rule must belong to a context owned by the relayed
5
- // token's tenant — matcher enforces that; no tenant field is accepted.
6
- import { z } from 'zod';
7
- import { contextRulePath, dispatchMatchRule } from './shared.js';
8
- /** Zod raw shape for `match_rule_get` input — context id + rule id (both path). */
9
- export const getMatchRuleInputShape = {
10
- contextId: z
11
- .string()
12
- .min(1)
13
- .describe('The reconciliation context id (UUID). Routing path param, not a tenant field.'),
14
- ruleId: z.string().min(1).describe('The match rule id (UUID) to fetch.'),
15
- };
16
- /**
17
- * Register `match_rule_get`. Substitutes both ids into the path and dispatches a
18
- * GET through the shared fail-closed relay; a matcher error (e.g. 404) surfaces
19
- * via the shared toToolError.
20
- */
21
- export function registerMatchRuleGetTool(server) {
22
- server.registerTool('match_rule_get', {
23
- description: 'Fetch a single match rule by id (UUID) within a context (UUID). Both ' +
24
- 'the rule and its context must belong to your token. Returns the rule, ' +
25
- 'or a structured RFC 9457 error (e.g. 404 if it does not exist or is not ' +
26
- 'yours).',
27
- inputSchema: getMatchRuleInputShape,
28
- }, async (args, extra) => {
29
- return dispatchMatchRule({ method: 'GET', path: contextRulePath(args.contextId, args.ruleId) }, extra);
30
- });
31
- }
32
- //# sourceMappingURL=get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/tools/match-rule/get.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,uEAAuE;AAEvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEhE,mFAAmF;AACnF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,+EAA+E,CAChF;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;CACzE,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,WAAW,EACT,uEAAuE;YACvE,wEAAwE;YACxE,0EAA0E;YAC1E,SAAS;QACX,WAAW,EAAE,sBAAsB;KACpC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,iBAAiB,CACtB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EACrE,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,45 +0,0 @@
1
- // `match_rule_reorder` — curated POST /v1/contexts/{contextId}/rules/reorder.
2
- //
3
- // A custom action (not CRUD): re-prioritizes a context's match rules in one
4
- // shot. The body carries an ordered `ruleIds` array — each rule's new priority
5
- // is its position in that list (first = highest priority / runs first). Returns
6
- // 204 (no content), which the relay renders as null. `contextId` is a routing
7
- // path param; no tenant field is accepted.
8
- import { z } from 'zod';
9
- import { contextRulesReorderPath, dispatchMatchRule } from './shared.js';
10
- /** Zod raw shape for `match_rule_reorder` input — context (path) + ordered ruleIds. */
11
- export const reorderMatchRulesInputShape = {
12
- contextId: z
13
- .string()
14
- .min(1)
15
- .describe('The reconciliation context id (UUID) whose rules to reorder. Routing path ' +
16
- 'param, not a tenant field.'),
17
- ruleIds: z
18
- .array(z.string().min(1))
19
- .min(1)
20
- .max(100)
21
- .describe('Ordered list of match rule UUIDs (1–100). Each rule’s new priority is ' +
22
- 'its position in this list: the first id runs first. Include every rule ' +
23
- 'you intend to reorder.'),
24
- };
25
- /**
26
- * Register `match_rule_reorder`. Splits the routing `contextId` (path) from the
27
- * `ruleIds` body and dispatches the POST through the shared fail-closed relay; a
28
- * matcher error surfaces via the shared toToolError.
29
- */
30
- export function registerMatchRuleReorderTool(server) {
31
- server.registerTool('match_rule_reorder', {
32
- description: 'Reorder the match rules of a reconciliation context. Provide contextId ' +
33
- '(UUID path) and ruleIds, an ordered array of rule UUIDs whose position ' +
34
- 'becomes the new priority (first = runs first). No tenant field is ' +
35
- 'accepted. Returns no content on success, or a structured RFC 9457 error.',
36
- inputSchema: reorderMatchRulesInputShape,
37
- }, async (args, extra) => {
38
- return dispatchMatchRule({
39
- method: 'POST',
40
- path: contextRulesReorderPath(args.contextId),
41
- body: { ruleIds: args.ruleIds },
42
- }, extra);
43
- });
44
- }
45
- //# sourceMappingURL=reorder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reorder.js","sourceRoot":"","sources":["../../../src/tools/match-rule/reorder.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,2CAA2C;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAExE,uFAAuF;AACvF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,4EAA4E;QAC1E,4BAA4B,CAC/B;IACH,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxB,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CACP,wEAAwE;QACtE,yEAAyE;QACzE,wBAAwB,CAC3B;CACJ,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,WAAW,EACT,yEAAyE;YACzE,yEAAyE;YACzE,oEAAoE;YACpE,0EAA0E;QAC5E,WAAW,EAAE,2BAA2B;KACzC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC;YAC7C,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;SAChC,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,81 +0,0 @@
1
- // `match_run_start` — curated POST /v1/matching/contexts/{contextId}/run.
2
- //
3
- // Triggers a matching run for a reconciliation context. Both submit paths return
4
- // HTTP 202 with { runId, status }; the `status` distinguishes them:
5
- // - sync (async omitted/false): the run executes in-request and the 202 carries
6
- // the TERMINAL run — status COMPLETED or FAILED. No polling needed.
7
- // - async (async:true): the run is created QUEUED and executed by a background
8
- // worker; the 202 carries status QUEUED. The operator polls `match_run_get`
9
- // with the returned runId to follow progress.
10
- // This tool does NOT auto-poll; it returns the 202 acceptance body verbatim.
11
- //
12
- // `contextId` is a routing path param (matcher validates it belongs to the
13
- // relayed token's tenant), NOT a tenant field. No tenant field is accepted.
14
- import { z } from 'zod';
15
- import { contextRunPath, dispatchMatching } from './shared.js';
16
- /**
17
- * Execution modes for a matching run.
18
- * - DRY_RUN tests the context's rules and reports what WOULD match without
19
- * committing any results.
20
- * - COMMIT executes the rules and persists the resulting matches.
21
- */
22
- export const RUN_MODES = ['DRY_RUN', 'COMMIT'];
23
- /** Zod raw shape for `match_run_start` input — contextId (path) + required mode. */
24
- export const startMatchRunInputShape = {
25
- contextId: z
26
- .string()
27
- .min(1)
28
- .describe('The reconciliation context id (UUID) to run matching for. Routing param; ' +
29
- 'matcher validates it belongs to your tenant.'),
30
- mode: z
31
- .enum(RUN_MODES)
32
- .describe('Execution mode. DRY_RUN tests the rules without committing any matches; ' +
33
- 'COMMIT executes the rules and persists the resulting matches.'),
34
- async: z
35
- .boolean()
36
- .optional()
37
- .describe('Submit path (optional, default false). Both return 202 with ' +
38
- '{ runId, status }; the status distinguishes them. Omit (or false) to ' +
39
- 'run in-request: the 202 carries the TERMINAL run (status COMPLETED or ' +
40
- 'FAILED). Set true to enqueue: the run is created QUEUED and a background ' +
41
- 'worker executes it — the 202 status is QUEUED and you poll match_run_get ' +
42
- 'with the runId until it reaches COMPLETED/FAILED.'),
43
- };
44
- /**
45
- * Register `match_run_start`. Substitutes contextId into the path and sends
46
- * `{ mode }` as the body, adding `async` ONLY when the caller set it (per
47
- * RunMatchRequest, which accepts `async` but forbids unknown properties — so the
48
- * key is omitted when undefined to keep the body minimal). Dispatches through the
49
- * shared fail-closed relay; a matcher error surfaces via the shared toToolError.
50
- */
51
- export function registerMatchRunStartTool(server) {
52
- server.registerTool('match_run_start', {
53
- description: 'Trigger a matching run for a reconciliation context. Both submit paths ' +
54
- 'return 202 with { runId, status }; the status distinguishes them. Omit ' +
55
- 'async (or set false) to run in-request: the 202 carries the TERMINAL run ' +
56
- '(status COMPLETED or FAILED). Set async:true to enqueue: the run is ' +
57
- 'created QUEUED and a background worker executes it (202 status QUEUED) — ' +
58
- 'poll match_run_get with the runId to follow progress (this tool does not ' +
59
- 'auto-poll). mode is required: DRY_RUN tests rules without committing, ' +
60
- 'COMMIT persists the matches. contextId is a routing param scoped to your ' +
61
- 'token (no tenant field is accepted). Returns the acceptance body, or a ' +
62
- 'structured RFC 9457 error (e.g. 422 when the rule set is not ' +
63
- 'stream-bounded and cannot run at unbounded scale).',
64
- inputSchema: startMatchRunInputShape,
65
- }, async (args, extra) => {
66
- // Omit `async` unless the caller set it — match the { mode } body style and
67
- // keep the body minimal for RunMatchRequest's no-unknown-props contract.
68
- const body = {
69
- mode: args.mode,
70
- };
71
- if (args.async !== undefined) {
72
- body.async = args.async;
73
- }
74
- return dispatchMatching({
75
- method: 'POST',
76
- path: contextRunPath(args.contextId),
77
- body,
78
- }, extra);
79
- });
80
- }
81
- //# sourceMappingURL=start.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/tools/matching/start.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,iFAAiF;AACjF,oEAAoE;AACpE,kFAAkF;AAClF,wEAAwE;AACxE,iFAAiF;AACjF,gFAAgF;AAChF,kDAAkD;AAClD,6EAA6E;AAC7E,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAE5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAA;AAEvD,oFAAoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,2EAA2E;QACzE,8CAA8C,CACjD;IACH,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,SAAS,CAAC;SACf,QAAQ,CACP,0EAA0E;QACxE,+DAA+D,CAClE;IACH,KAAK,EAAE,CAAC;SACL,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,8DAA8D;QAC5D,uEAAuE;QACvE,wEAAwE;QACxE,2EAA2E;QAC3E,2EAA2E;QAC3E,mDAAmD,CACtD;CACJ,CAAA;AAOD;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EACT,yEAAyE;YACzE,yEAAyE;YACzE,2EAA2E;YAC3E,sEAAsE;YACtE,2EAA2E;YAC3E,2EAA2E;YAC3E,wEAAwE;YACxE,2EAA2E;YAC3E,yEAAyE;YACzE,+DAA+D;YAC/D,oDAAoD;QACtD,WAAW,EAAE,uBAAuB;KACrC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,4EAA4E;QAC5E,yEAAyE;QACzE,MAAM,IAAI,GAA0D;YAClE,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,CAAC;QACD,OAAO,gBAAgB,CACrB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC;YACpC,IAAI;SACL,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,46 +0,0 @@
1
- // `report_count_exceptions` — curated GET
2
- // /v1/reports/contexts/{contextId}/exceptions/count.
3
- //
4
- // Returns the total count of exceptions for the given filters — used to decide
5
- // between a sync download (<1000 rows) and an async export job. Here the date
6
- // filter applies to the exception's created_at (not the underlying transaction
7
- // date). Takes only the common date filter and returns matcher's
8
- // ExportCountResponse as-is. The count is implicitly tenant-scoped by the
9
- // relayed token; contextId is a routing path param, not a tenant field, and no
10
- // tenant field is accepted.
11
- import { z } from 'zod';
12
- import { buildReportFilterQuery, contextReportPath, dispatchReport, reportFilterInputShape, } from './shared.js';
13
- /** Zod raw shape for `report_count_exceptions` input — contextId path + date filter. */
14
- export const countExceptionsInputShape = {
15
- contextId: z
16
- .string()
17
- .min(1)
18
- .describe('The reconciliation context id (UUID) whose exceptions to count. Routing ' +
19
- 'path param, not a tenant field.'),
20
- ...reportFilterInputShape,
21
- };
22
- /**
23
- * Register `report_count_exceptions`. Passes the date filter through and returns
24
- * matcher's count envelope verbatim; a matcher error surfaces via the shared
25
- * toToolError.
26
- */
27
- export function registerReportCountExceptionsTool(server) {
28
- server.registerTool('report_count_exceptions', {
29
- description: 'Count exceptions for a context within a date window — use it to decide ' +
30
- 'between a sync download (<1000 rows) and an async export. The date ' +
31
- "filter applies to each exception's created_at. Pass contextId (UUID " +
32
- 'path param — not a tenant field), and optionally date_from/date_to ' +
33
- '(YYYY-MM-DD, window ≤ 90 days; if omitted, defaults to the last ~30 ' +
34
- 'days and SILENTLY EXCLUDES older exceptions — pass an explicit range ' +
35
- 'for a full picture) and source_id. No tenant field is accepted.',
36
- inputSchema: countExceptionsInputShape,
37
- }, async (args, extra) => {
38
- const query = buildReportFilterQuery(args);
39
- return dispatchReport({
40
- method: 'GET',
41
- path: contextReportPath(args.contextId, 'exceptions/count'),
42
- ...(query !== undefined ? { query } : {}),
43
- }, extra);
44
- });
45
- }
46
- //# sourceMappingURL=count-exceptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"count-exceptions.js","sourceRoot":"","sources":["../../../src/tools/report/count-exceptions.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,qDAAqD;AACrD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,iEAAiE;AACjE,0EAA0E;AAC1E,+EAA+E;AAC/E,4BAA4B;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,GACvB,MAAM,aAAa,CAAA;AAEpB,wFAAwF;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,0EAA0E;QACxE,iCAAiC,CACpC;IACH,GAAG,sBAAsB;CAC1B,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,MAAiB;IACjE,MAAM,CAAC,YAAY,CACjB,yBAAyB,EACzB;QACE,WAAW,EACT,yEAAyE;YACzE,qEAAqE;YACrE,sEAAsE;YACtE,qEAAqE;YACrE,sEAAsE;YACtE,uEAAuE;YACvE,iEAAiE;QACnE,WAAW,EAAE,yBAAyB;KACvC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,MAAM,KAAK,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAC1C,OAAO,cAAc,CACnB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC;YAC3D,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1C,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
@@ -1,47 +0,0 @@
1
- // `report_count_matched` — curated GET
2
- // /v1/reports/contexts/{contextId}/matches/count.
3
- //
4
- // Returns the total count of matched records for the given filters — used to
5
- // decide between a sync download (<1000 rows) and an async export job. NOTE the
6
- // spec path is `matches/count` (plural "matches"), distinct from the report
7
- // path `matched` — that asymmetry is encoded in the suffix below. The date
8
- // filter applies to the transaction date. Takes only the common date filter and
9
- // returns matcher's ExportCountResponse as-is. The count is implicitly
10
- // tenant-scoped by the relayed token; contextId is a routing path param, not a
11
- // tenant field, and no tenant field is accepted.
12
- import { z } from 'zod';
13
- import { buildReportFilterQuery, contextReportPath, dispatchReport, reportFilterInputShape, } from './shared.js';
14
- /** Zod raw shape for `report_count_matched` input — contextId path + date filter. */
15
- export const countMatchedInputShape = {
16
- contextId: z
17
- .string()
18
- .min(1)
19
- .describe('The reconciliation context id (UUID) whose matched records to count. ' +
20
- 'Routing path param, not a tenant field.'),
21
- ...reportFilterInputShape,
22
- };
23
- /**
24
- * Register `report_count_matched`. Passes the date filter through and returns
25
- * matcher's count envelope verbatim; a matcher error surfaces via the shared
26
- * toToolError. The path suffix is `matches/count` (plural), per the spec.
27
- */
28
- export function registerReportCountMatchedTool(server) {
29
- server.registerTool('report_count_matched', {
30
- description: 'Count matched records for a context within a date window — use it to ' +
31
- 'decide between a sync download (<1000 rows) and an async export. The ' +
32
- 'date filter applies to the transaction date. Pass contextId (UUID path ' +
33
- 'param — not a tenant field), and optionally date_from/date_to ' +
34
- '(YYYY-MM-DD, window ≤ 90 days; if omitted, defaults to the last ~30 ' +
35
- 'days and SILENTLY EXCLUDES older matches — pass an explicit range for ' +
36
- 'a full picture) and source_id. No tenant field is accepted.',
37
- inputSchema: countMatchedInputShape,
38
- }, async (args, extra) => {
39
- const query = buildReportFilterQuery(args);
40
- return dispatchReport({
41
- method: 'GET',
42
- path: contextReportPath(args.contextId, 'matches/count'),
43
- ...(query !== undefined ? { query } : {}),
44
- }, extra);
45
- });
46
- }
47
- //# sourceMappingURL=count-matched.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"count-matched.js","sourceRoot":"","sources":["../../../src/tools/report/count-matched.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,4EAA4E;AAC5E,2EAA2E;AAC3E,gFAAgF;AAChF,uEAAuE;AACvE,+EAA+E;AAC/E,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,GACvB,MAAM,aAAa,CAAA;AAEpB,qFAAqF;AACrF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,uEAAuE;QACrE,yCAAyC,CAC5C;IACH,GAAG,sBAAsB;CAC1B,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,MAAiB;IAC9D,MAAM,CAAC,YAAY,CACjB,sBAAsB,EACtB;QACE,WAAW,EACT,uEAAuE;YACvE,uEAAuE;YACvE,yEAAyE;YACzE,gEAAgE;YAChE,sEAAsE;YACtE,wEAAwE;YACxE,6DAA6D;QAC/D,WAAW,EAAE,sBAAsB;KACpC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,MAAM,KAAK,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAC1C,OAAO,cAAc,CACnB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;YACxD,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1C,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}