@lerianstudio/matcher-mcp 5.0.0-beta.67 → 5.0.0-beta.69
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/spec/curated-operations.js +107 -95
- package/dist/spec/curated-operations.js.map +1 -1
- package/dist/spec/schema-parity.js +19 -10
- package/dist/spec/schema-parity.js.map +1 -1
- package/dist/tools/context/create.js +3 -2
- package/dist/tools/context/create.js.map +1 -1
- package/dist/tools/context/index.js +137 -17
- package/dist/tools/context/index.js.map +1 -1
- package/dist/tools/context/list.js +3 -2
- package/dist/tools/context/list.js.map +1 -1
- package/dist/tools/context/setup-progress.js +3 -2
- package/dist/tools/context/setup-progress.js.map +1 -1
- package/dist/tools/context/shared.js +7 -22
- package/dist/tools/context/shared.js.map +1 -1
- package/dist/tools/context/update.js +3 -2
- package/dist/tools/context/update.js.map +1 -1
- package/dist/tools/curated-tool.js +39 -0
- package/dist/tools/curated-tool.js.map +1 -0
- package/dist/tools/dashboard/index.js +124 -19
- package/dist/tools/dashboard/index.js.map +1 -1
- package/dist/tools/dashboard/shared.js +4 -42
- package/dist/tools/dashboard/shared.js.map +1 -1
- package/dist/tools/dispute/close.js +3 -2
- package/dist/tools/dispute/close.js.map +1 -1
- package/dist/tools/dispute/index.js +34 -6
- package/dist/tools/dispute/index.js.map +1 -1
- package/dist/tools/dispute/list.js +3 -2
- package/dist/tools/dispute/list.js.map +1 -1
- package/dist/tools/dispute/shared.js +4 -17
- package/dist/tools/dispute/shared.js.map +1 -1
- package/dist/tools/dispute/submit-evidence.js +3 -2
- package/dist/tools/dispute/submit-evidence.js.map +1 -1
- package/dist/tools/exception/add-comment.js +3 -2
- package/dist/tools/exception/add-comment.js.map +1 -1
- package/dist/tools/exception/adjust-entry.js +3 -2
- package/dist/tools/exception/adjust-entry.js.map +1 -1
- package/dist/tools/exception/bulk-assign.js +3 -2
- package/dist/tools/exception/bulk-assign.js.map +1 -1
- package/dist/tools/exception/bulk-dispatch.js +3 -2
- package/dist/tools/exception/bulk-dispatch.js.map +1 -1
- package/dist/tools/exception/bulk-resolve.js +3 -2
- package/dist/tools/exception/bulk-resolve.js.map +1 -1
- package/dist/tools/exception/dispatch.js +3 -2
- package/dist/tools/exception/dispatch.js.map +1 -1
- package/dist/tools/exception/force-match.js +3 -2
- package/dist/tools/exception/force-match.js.map +1 -1
- package/dist/tools/exception/history.js +3 -2
- package/dist/tools/exception/history.js.map +1 -1
- package/dist/tools/exception/index.js +88 -18
- package/dist/tools/exception/index.js.map +1 -1
- package/dist/tools/exception/list.js +3 -2
- package/dist/tools/exception/list.js.map +1 -1
- package/dist/tools/exception/open-dispute.js +3 -2
- package/dist/tools/exception/open-dispute.js.map +1 -1
- package/dist/tools/exception/shared.js +5 -20
- package/dist/tools/exception/shared.js.map +1 -1
- package/dist/tools/fee-rule/create.js +3 -2
- package/dist/tools/fee-rule/create.js.map +1 -1
- package/dist/tools/fee-rule/index.js +50 -8
- package/dist/tools/fee-rule/index.js.map +1 -1
- package/dist/tools/fee-rule/list.js +3 -2
- package/dist/tools/fee-rule/list.js.map +1 -1
- package/dist/tools/fee-rule/shared.js +5 -21
- package/dist/tools/fee-rule/shared.js.map +1 -1
- package/dist/tools/fee-rule/update.js +3 -2
- package/dist/tools/fee-rule/update.js.map +1 -1
- package/dist/tools/fee-schedule/create.js +3 -2
- package/dist/tools/fee-schedule/create.js.map +1 -1
- package/dist/tools/fee-schedule/index.js +62 -11
- package/dist/tools/fee-schedule/index.js.map +1 -1
- package/dist/tools/fee-schedule/list.js +3 -2
- package/dist/tools/fee-schedule/list.js.map +1 -1
- package/dist/tools/fee-schedule/shared.js +5 -18
- package/dist/tools/fee-schedule/shared.js.map +1 -1
- package/dist/tools/fee-schedule/simulate.js +3 -2
- package/dist/tools/fee-schedule/simulate.js.map +1 -1
- package/dist/tools/fee-schedule/update.js +3 -2
- package/dist/tools/fee-schedule/update.js.map +1 -1
- package/dist/tools/field-map/create.js +3 -2
- package/dist/tools/field-map/create.js.map +1 -1
- package/dist/tools/field-map/index.js +65 -11
- package/dist/tools/field-map/index.js.map +1 -1
- package/dist/tools/field-map/list.js +3 -2
- package/dist/tools/field-map/list.js.map +1 -1
- package/dist/tools/field-map/shared.js +6 -16
- package/dist/tools/field-map/shared.js.map +1 -1
- package/dist/tools/field-map/update.js +3 -2
- package/dist/tools/field-map/update.js.map +1 -1
- package/dist/tools/generic/invoke.js +3 -16
- package/dist/tools/generic/invoke.js.map +1 -1
- package/dist/tools/ingestion/index.js +100 -12
- package/dist/tools/ingestion/index.js.map +1 -1
- package/dist/tools/ingestion/job-transactions-list.js +3 -2
- package/dist/tools/ingestion/job-transactions-list.js.map +1 -1
- package/dist/tools/ingestion/jobs-list.js +3 -2
- package/dist/tools/ingestion/jobs-list.js.map +1 -1
- package/dist/tools/ingestion/shared.js +4 -15
- package/dist/tools/ingestion/shared.js.map +1 -1
- package/dist/tools/ingestion/transactions-search.js +3 -2
- package/dist/tools/ingestion/transactions-search.js.map +1 -1
- package/dist/tools/ingestion/upload.js +3 -2
- package/dist/tools/ingestion/upload.js.map +1 -1
- package/dist/tools/input-fields.js +15 -0
- package/dist/tools/input-fields.js.map +1 -1
- package/dist/tools/match-rule/index.js +130 -13
- package/dist/tools/match-rule/index.js.map +1 -1
- package/dist/tools/match-rule/list.js +3 -3
- package/dist/tools/match-rule/list.js.map +1 -1
- package/dist/tools/match-rule/shared.js +16 -20
- package/dist/tools/match-rule/shared.js.map +1 -1
- package/dist/tools/match-rule/update.js +3 -3
- package/dist/tools/match-rule/update.js.map +1 -1
- package/dist/tools/matching/get.js +5 -5
- package/dist/tools/matching/get.js.map +1 -1
- package/dist/tools/matching/groups.js +3 -2
- package/dist/tools/matching/groups.js.map +1 -1
- package/dist/tools/matching/index.js +77 -5
- package/dist/tools/matching/index.js.map +1 -1
- package/dist/tools/matching/list.js +3 -2
- package/dist/tools/matching/list.js.map +1 -1
- package/dist/tools/matching/shared.js +5 -18
- package/dist/tools/matching/shared.js.map +1 -1
- package/dist/tools/query-handler.js +2 -1
- package/dist/tools/query-handler.js.map +1 -1
- package/dist/tools/report/index.js +260 -30
- package/dist/tools/report/index.js.map +1 -1
- package/dist/tools/report/shared.js +15 -43
- package/dist/tools/report/shared.js.map +1 -1
- package/dist/tools/source/create.js +3 -2
- package/dist/tools/source/create.js.map +1 -1
- package/dist/tools/source/index.js +101 -13
- package/dist/tools/source/index.js.map +1 -1
- package/dist/tools/source/list.js +3 -2
- package/dist/tools/source/list.js.map +1 -1
- package/dist/tools/source/shared.js +5 -16
- package/dist/tools/source/shared.js.map +1 -1
- package/dist/tools/source/update.js +3 -2
- package/dist/tools/source/update.js.map +1 -1
- package/dist/tools/workspace/usage.js +12 -40
- package/dist/tools/workspace/usage.js.map +1 -1
- package/package.json +3 -3
- package/dist/copilot/test_helpers.js +0 -50
- package/dist/copilot/test_helpers.js.map +0 -1
- package/dist/tools/context/archive.js +0 -37
- package/dist/tools/context/archive.js.map +0 -1
- package/dist/tools/context/get.js +0 -31
- package/dist/tools/context/get.js.map +0 -1
- package/dist/tools/context/next-step.js +0 -99
- package/dist/tools/context/next-step.js.map +0 -1
- package/dist/tools/context/restore.js +0 -34
- package/dist/tools/context/restore.js.map +0 -1
- package/dist/tools/dashboard/aggregates.js +0 -38
- package/dist/tools/dashboard/aggregates.js.map +0 -1
- package/dist/tools/dashboard/cash-impact.js +0 -31
- package/dist/tools/dashboard/cash-impact.js.map +0 -1
- package/dist/tools/dashboard/match-rate.js +0 -31
- package/dist/tools/dashboard/match-rate.js.map +0 -1
- package/dist/tools/dashboard/metrics.js +0 -31
- package/dist/tools/dashboard/metrics.js.map +0 -1
- package/dist/tools/dashboard/sla.js +0 -28
- package/dist/tools/dashboard/sla.js.map +0 -1
- package/dist/tools/dashboard/source-breakdown.js +0 -31
- package/dist/tools/dashboard/source-breakdown.js.map +0 -1
- package/dist/tools/dashboard/volume.js +0 -31
- package/dist/tools/dashboard/volume.js.map +0 -1
- package/dist/tools/dispute/get.js +0 -27
- package/dist/tools/dispute/get.js.map +0 -1
- package/dist/tools/exception/delete-comment.js +0 -40
- package/dist/tools/exception/delete-comment.js.map +0 -1
- package/dist/tools/exception/get.js +0 -34
- package/dist/tools/exception/get.js.map +0 -1
- package/dist/tools/exception/list-comments.js +0 -35
- package/dist/tools/exception/list-comments.js.map +0 -1
- package/dist/tools/fee-rule/delete.js +0 -27
- package/dist/tools/fee-rule/delete.js.map +0 -1
- package/dist/tools/fee-rule/get.js +0 -27
- package/dist/tools/fee-rule/get.js.map +0 -1
- package/dist/tools/fee-schedule/delete.js +0 -32
- package/dist/tools/fee-schedule/delete.js.map +0 -1
- package/dist/tools/fee-schedule/get.js +0 -30
- package/dist/tools/fee-schedule/get.js.map +0 -1
- package/dist/tools/field-map/delete.js +0 -37
- package/dist/tools/field-map/delete.js.map +0 -1
- package/dist/tools/field-map/get.js +0 -40
- package/dist/tools/field-map/get.js.map +0 -1
- package/dist/tools/ingestion/job-errors-list.js +0 -42
- package/dist/tools/ingestion/job-errors-list.js.map +0 -1
- package/dist/tools/ingestion/job-get.js +0 -39
- package/dist/tools/ingestion/job-get.js.map +0 -1
- package/dist/tools/ingestion/transaction-ignore.js +0 -48
- package/dist/tools/ingestion/transaction-ignore.js.map +0 -1
- package/dist/tools/match-rule/create.js +0 -67
- package/dist/tools/match-rule/create.js.map +0 -1
- package/dist/tools/match-rule/delete.js +0 -33
- package/dist/tools/match-rule/delete.js.map +0 -1
- package/dist/tools/match-rule/get.js +0 -30
- package/dist/tools/match-rule/get.js.map +0 -1
- package/dist/tools/match-rule/reorder.js +0 -45
- package/dist/tools/match-rule/reorder.js.map +0 -1
- package/dist/tools/matching/start.js +0 -81
- package/dist/tools/matching/start.js.map +0 -1
- package/dist/tools/report/count-exceptions.js +0 -40
- package/dist/tools/report/count-exceptions.js.map +0 -1
- package/dist/tools/report/count-matched.js +0 -41
- package/dist/tools/report/count-matched.js.map +0 -1
- package/dist/tools/report/count-transactions.js +0 -39
- package/dist/tools/report/count-transactions.js.map +0 -1
- package/dist/tools/report/count-unmatched.js +0 -39
- package/dist/tools/report/count-unmatched.js.map +0 -1
- package/dist/tools/report/export-exceptions.js +0 -42
- package/dist/tools/report/export-exceptions.js.map +0 -1
- package/dist/tools/report/export-matched.js +0 -43
- package/dist/tools/report/export-matched.js.map +0 -1
- package/dist/tools/report/export-summary.js +0 -43
- package/dist/tools/report/export-summary.js.map +0 -1
- package/dist/tools/report/export-unmatched.js +0 -43
- package/dist/tools/report/export-unmatched.js.map +0 -1
- package/dist/tools/report/export-variance.js +0 -42
- package/dist/tools/report/export-variance.js.map +0 -1
- package/dist/tools/report/matched.js +0 -42
- package/dist/tools/report/matched.js.map +0 -1
- package/dist/tools/report/summary.js +0 -37
- package/dist/tools/report/summary.js.map +0 -1
- package/dist/tools/report/unmatched.js +0 -42
- package/dist/tools/report/unmatched.js.map +0 -1
- package/dist/tools/report/variance.js +0 -42
- package/dist/tools/report/variance.js.map +0 -1
- package/dist/tools/source/archive.js +0 -43
- package/dist/tools/source/archive.js.map +0 -1
- package/dist/tools/source/get.js +0 -54
- package/dist/tools/source/get.js.map +0 -1
- package/dist/tools/source/restore.js +0 -36
- package/dist/tools/source/restore.js.map +0 -1
|
@@ -1,22 +1,139 @@
|
|
|
1
1
|
// Curated match-rule vertical (task 2.1.2): six typed tools over the matcher
|
|
2
2
|
// match-rule resource — create, list, get, update, delete, reorder. All ops are
|
|
3
3
|
// fully context-nested (/v1/contexts/{contextId}/rules[...]). Each tool shares
|
|
4
|
-
// the fail-closed relay (shared.ts) and the RFC 9457 → tool-error
|
|
5
|
-
// (toToolError) with the generic surface, so curated and generic map
|
|
6
|
-
// errors identically. No tool carries a tenant field.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
// the fail-closed relay (shared-dispatch.ts) and the RFC 9457 → tool-error
|
|
5
|
+
// mapping (toToolError) with the generic surface, so curated and generic map
|
|
6
|
+
// matcher errors identically. No tool carries a tenant field.
|
|
7
|
+
//
|
|
8
|
+
// create, get, delete and reorder are nothing but a rule path, a method, a
|
|
9
|
+
// body-from-args and a description, so they are declared as four rows and
|
|
10
|
+
// registered by the one shared loop; list and update carry query builders or
|
|
11
|
+
// partial-update composition and stay as files.
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { registerCuratedTools } from '../curated-tool.js';
|
|
14
|
+
import { contextRoutingId } from '../input-fields.js';
|
|
10
15
|
import { registerMatchRuleListTool } from './list.js';
|
|
11
|
-
import {
|
|
16
|
+
import { contextRulePath, contextRulesPath, contextRulesReorderPath, MATCH_RULE_TYPES, RULE_CONFIG_DESC_BODY, } from './shared.js';
|
|
12
17
|
import { registerMatchRuleUpdateTool } from './update.js';
|
|
18
|
+
/**
|
|
19
|
+
* Zod raw shape for `match_rule_create` input — mirrors CreateMatchRuleRequest.
|
|
20
|
+
* Exported because `spec/schema-parity.ts` diffs it against the vendored spec's
|
|
21
|
+
* request body; the row below is its only other consumer.
|
|
22
|
+
*/
|
|
23
|
+
export const createMatchRuleInputShape = {
|
|
24
|
+
contextId: z
|
|
25
|
+
.string()
|
|
26
|
+
.min(1)
|
|
27
|
+
.describe('The reconciliation context id (UUID) the rule belongs to. Routing path ' +
|
|
28
|
+
'param, not a tenant field — matcher validates the context is yours.'),
|
|
29
|
+
priority: z
|
|
30
|
+
.number()
|
|
31
|
+
.int()
|
|
32
|
+
.min(1)
|
|
33
|
+
.max(1000)
|
|
34
|
+
.describe('Execution priority (1–1000); lower numbers run first. Must be unique ' +
|
|
35
|
+
'within the context.'),
|
|
36
|
+
type: z
|
|
37
|
+
.enum(MATCH_RULE_TYPES)
|
|
38
|
+
.describe('Matching strategy. EXACT requires identical field values; TOLERANCE ' +
|
|
39
|
+
'allows configured numeric slack; DATE_LAG allows a configured date ' +
|
|
40
|
+
'offset between sides; FUZZY matches on normalized/similarity-scored ' +
|
|
41
|
+
'references (free-text memos, truncated refs) and ALWAYS proposes for ' +
|
|
42
|
+
'review — never auto-confirms.'),
|
|
43
|
+
config: z
|
|
44
|
+
.record(z.string(), z.unknown())
|
|
45
|
+
.describe('Rule-specific ' + RULE_CONFIG_DESC_BODY),
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Zod raw shape for `match_rule_reorder` input — context (path) + ordered
|
|
49
|
+
* ruleIds. Exported for the same parity diff as the create shape.
|
|
50
|
+
*/
|
|
51
|
+
export const reorderMatchRulesInputShape = {
|
|
52
|
+
contextId: z
|
|
53
|
+
.string()
|
|
54
|
+
.min(1)
|
|
55
|
+
.describe('The reconciliation context id (UUID) whose rules to reorder. Routing path ' +
|
|
56
|
+
'param, not a tenant field.'),
|
|
57
|
+
ruleIds: z
|
|
58
|
+
.array(z.string().min(1))
|
|
59
|
+
.min(1)
|
|
60
|
+
.max(100)
|
|
61
|
+
.describe('Ordered list of match rule UUIDs (1–100). Each rule’s new priority is ' +
|
|
62
|
+
'its position in this list: the first id runs first. Include every rule ' +
|
|
63
|
+
'you intend to reorder.'),
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The match-rule registration list, IN PUBLISHED ORDER: thin tools inline as data
|
|
67
|
+
* rows, the tools that still need their own file by their register function.
|
|
68
|
+
* This list is the order `tools/list` returns, so moving an entry moves what a
|
|
69
|
+
* client renders and what an agent prompt built from it reads first.
|
|
70
|
+
*
|
|
71
|
+
* Every description string is the hand-tuned LLM guidance a client sees
|
|
72
|
+
* verbatim; the published-surface golden is what proves an edit here dropped no
|
|
73
|
+
* character and moved no tool.
|
|
74
|
+
*/
|
|
75
|
+
const MATCH_RULE_TOOLS = [
|
|
76
|
+
{
|
|
77
|
+
name: 'match_rule_create',
|
|
78
|
+
description: 'Create a match rule within a reconciliation context. Provide contextId ' +
|
|
79
|
+
'(UUID path), priority (1–1000, unique within the context), type ' +
|
|
80
|
+
'(EXACT|TOLERANCE|DATE_LAG|FUZZY), and config (a type-specific object validated ' +
|
|
81
|
+
'server-side). No tenant field is accepted — the rule is created for your ' +
|
|
82
|
+
"token's tenant. Returns the created rule, or a structured RFC 9457 error.",
|
|
83
|
+
inputShape: createMatchRuleInputShape,
|
|
84
|
+
request: (args) => {
|
|
85
|
+
// contextId routes; every other validated field is the body.
|
|
86
|
+
const { contextId, ...body } = args;
|
|
87
|
+
return { method: 'POST', path: contextRulesPath(String(contextId)), body };
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
registerMatchRuleListTool,
|
|
91
|
+
{
|
|
92
|
+
name: 'match_rule_get',
|
|
93
|
+
description: 'Fetch a single match rule by id (UUID) within a context (UUID). Both ' +
|
|
94
|
+
'the rule and its context must belong to your token. Returns the rule, ' +
|
|
95
|
+
'or a structured RFC 9457 error (e.g. 404 if it does not exist or is not ' +
|
|
96
|
+
'yours).',
|
|
97
|
+
inputShape: {
|
|
98
|
+
contextId: contextRoutingId,
|
|
99
|
+
ruleId: z.string().min(1).describe('The match rule id (UUID) to fetch.'),
|
|
100
|
+
},
|
|
101
|
+
request: (args) => ({
|
|
102
|
+
method: 'GET',
|
|
103
|
+
path: contextRulePath(String(args.contextId), String(args.ruleId)),
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
registerMatchRuleUpdateTool,
|
|
107
|
+
{
|
|
108
|
+
name: 'match_rule_delete',
|
|
109
|
+
description: 'Delete a match rule by id (UUID) within a context (UUID). The rule and ' +
|
|
110
|
+
"its context must belong to your token's tenant (no tenant field is " +
|
|
111
|
+
'accepted). Returns no content on success, or a structured RFC 9457 error.',
|
|
112
|
+
inputShape: {
|
|
113
|
+
contextId: contextRoutingId,
|
|
114
|
+
ruleId: z.string().min(1).describe('The match rule id (UUID) to delete.'),
|
|
115
|
+
},
|
|
116
|
+
request: (args) => ({
|
|
117
|
+
method: 'DELETE',
|
|
118
|
+
path: contextRulePath(String(args.contextId), String(args.ruleId)),
|
|
119
|
+
}),
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'match_rule_reorder',
|
|
123
|
+
description: 'Reorder the match rules of a reconciliation context. Provide contextId ' +
|
|
124
|
+
'(UUID path) and ruleIds, an ordered array of rule UUIDs whose position ' +
|
|
125
|
+
'becomes the new priority (first = runs first). No tenant field is ' +
|
|
126
|
+
'accepted. Returns no content on success, or a structured RFC 9457 error.',
|
|
127
|
+
inputShape: reorderMatchRulesInputShape,
|
|
128
|
+
request: (args) => ({
|
|
129
|
+
method: 'POST',
|
|
130
|
+
path: contextRulesReorderPath(String(args.contextId)),
|
|
131
|
+
body: { ruleIds: args.ruleIds },
|
|
132
|
+
}),
|
|
133
|
+
},
|
|
134
|
+
];
|
|
13
135
|
/** Register all six curated match-rule tools on the given server. */
|
|
14
136
|
export function registerMatchRuleTools(server) {
|
|
15
|
-
|
|
16
|
-
registerMatchRuleListTool(server);
|
|
17
|
-
registerMatchRuleGetTool(server);
|
|
18
|
-
registerMatchRuleUpdateTool(server);
|
|
19
|
-
registerMatchRuleDeleteTool(server);
|
|
20
|
-
registerMatchRuleReorderTool(server);
|
|
137
|
+
registerCuratedTools(server, MATCH_RULE_TOOLS);
|
|
21
138
|
}
|
|
22
139
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/match-rule/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,gFAAgF;AAChF,+EAA+E;AAC/E,0EAA0E;AAC1E,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/match-rule/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,gFAAgF;AAChF,+EAA+E;AAC/E,2EAA2E;AAC3E,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,gDAAgD;AAEhD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,oBAAoB,EAAqB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,g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ACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClB,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACnE,CAAC;KACH;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,yEAAyE;YACzE,yEAAyE;YACzE,oEAAoE;YACpE,0EAA0E;QAC5E,UAAU,EAAE,2BAA2B;QACvC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACrD,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;SAChC,CAAC;KACH;CACF,CAAA;AAED,qEAAqE;AACrE,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;AAChD,CAAC"}
|
|
@@ -10,8 +10,8 @@ import { z } from 'zod';
|
|
|
10
10
|
import { nextCursor, pageLimit } from '../input-fields.js';
|
|
11
11
|
import { queryHandler } from '../query-handler.js';
|
|
12
12
|
import { pickQuery } from '../request-fields.js';
|
|
13
|
-
import {
|
|
14
|
-
import { contextRulesPath,
|
|
13
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
14
|
+
import { contextRulesPath, MATCH_RULE_TYPES } from './shared.js';
|
|
15
15
|
/** Zod raw shape for `match_rule_list` input — context, optional type filter, pagination. */
|
|
16
16
|
export const listMatchRulesInputShape = {
|
|
17
17
|
contextId: z
|
|
@@ -43,6 +43,6 @@ export function registerMatchRuleListTool(server) {
|
|
|
43
43
|
'response carries { items, nextCursor } — paginate by re-calling with the ' +
|
|
44
44
|
'returned nextCursor. No tenant field is accepted.',
|
|
45
45
|
inputSchema: listMatchRulesInputShape,
|
|
46
|
-
}, queryHandler(buildListQuery, (args) => contextRulesPath(args.contextId),
|
|
46
|
+
}, queryHandler(buildListQuery, (args) => contextRulesPath(args.contextId), dispatchToolRequest));
|
|
47
47
|
}
|
|
48
48
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/tools/match-rule/list.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,4EAA4E;AAC5E,iEAAiE;AACjE,6EAA6E;AAC7E,wEAAwE;AACxE,iFAAiF;AACjF,4BAA4B;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/tools/match-rule/list.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,4EAA4E;AAC5E,iEAAiE;AACjE,6EAA6E;AAC7E,wEAAwE;AACxE,iFAAiF;AACjF,4BAA4B;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEhE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,4BAA4B,CAC/B;IACH,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,gBAAgB,CAAC;SACtB,QAAQ,EAAE;SACV,QAAQ,CACP,kFAAkF,CACnF;IACH,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,UAAU;CACnB,CAAA;AAOD,+EAA+E;AAC/E,SAAS,cAAc,CAAC,IAAyB;IAC/C,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EACT,uEAAuE;YACvE,2DAA2D;YAC3D,6EAA6E;YAC7E,2EAA2E;YAC3E,mDAAmD;QACrD,WAAW,EAAE,wBAAwB;KACtC,EACD,YAAY,CACV,cAAc,EACd,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,EAC1C,mBAAmB,CACpB,CACF,CAAA;AACH,CAAC"}
|
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
// Match rules are fully context-nested: every op lives under
|
|
4
4
|
// /v1/contexts/{contextId}/rules (list/create), .../rules/{ruleId}
|
|
5
5
|
// (get/update/delete), and .../rules/reorder (the custom reorder action). This
|
|
6
|
-
// module
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// return matcher's JSON on success or the SHARED toToolError on a
|
|
12
|
-
// MatcherApiError. Curated and generic surfaces therefore map matcher errors
|
|
13
|
-
// through the same path.
|
|
6
|
+
// module holds the path construction and nothing else, factored exactly once so
|
|
7
|
+
// the four table rows in index.ts and the two tools that keep their own file
|
|
8
|
+
// address the same URLs. The relay itself lives in shared-dispatch.ts, so
|
|
9
|
+
// curated and generic surfaces map matcher errors through the identical path
|
|
10
|
+
// (toToolError).
|
|
14
11
|
//
|
|
15
12
|
// Security: the bearer token is never read here directly — requireMatcherClient
|
|
16
13
|
// owns the request-scoped relay and fails closed when no usable credential was
|
|
@@ -18,7 +15,6 @@
|
|
|
18
15
|
// tenant from the relayed JWT); no match-rule tool input carries one. The
|
|
19
16
|
// `contextId` segment is a routing path param — matcher validates that the
|
|
20
17
|
// context belongs to the token's tenant.
|
|
21
|
-
import { dispatchToolRequest, } from '../shared-dispatch.js';
|
|
22
18
|
/** Path for the match-rule collection under a context (list + create). */
|
|
23
19
|
export function contextRulesPath(contextId) {
|
|
24
20
|
return `/v1/contexts/${encodeURIComponent(contextId)}/rules`;
|
|
@@ -31,6 +27,17 @@ export function contextRulePath(contextId, ruleId) {
|
|
|
31
27
|
export function contextRulesReorderPath(contextId) {
|
|
32
28
|
return `${contextRulesPath(contextId)}/reorder`;
|
|
33
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Matching strategy vocabulary. EXACT / TOLERANCE / DATE_LAG / FUZZY (spec
|
|
32
|
+
* oneof), centralized here because create's input shape, list's filter and
|
|
33
|
+
* update's optional type all enumerate the same four values.
|
|
34
|
+
*/
|
|
35
|
+
export const MATCH_RULE_TYPES = [
|
|
36
|
+
'EXACT',
|
|
37
|
+
'TOLERANCE',
|
|
38
|
+
'DATE_LAG',
|
|
39
|
+
'FUZZY',
|
|
40
|
+
];
|
|
34
41
|
/**
|
|
35
42
|
* Shared body of the `config` field description, centralized so create and
|
|
36
43
|
* update stay in lockstep as the rule vocabulary grows. Callers prepend the
|
|
@@ -54,15 +61,4 @@ export const RULE_CONFIG_DESC_BODY = 'configuration object; shape depends on `ty
|
|
|
54
61
|
'tolerance? }]). Optional across types: timezone (IANA zone), calendar ' +
|
|
55
62
|
'(US_FED|BR_ANBIMA), businessDayMode (DATE_LAG only), and signMode ' +
|
|
56
63
|
'(same|opposite|ignore).';
|
|
57
|
-
/**
|
|
58
|
-
* Run one assembled request through the relay: fail-closed auth, dispatch, and
|
|
59
|
-
* RFC 9457 → tool-error mapping — identical to the generic invoke's dispatch so
|
|
60
|
-
* both surfaces produce the same structured error shape.
|
|
61
|
-
*
|
|
62
|
-
* `clientFor` is injectable for tests; production callers pass nothing and get
|
|
63
|
-
* the request-scoped, fail-closed `requireMatcherClient`.
|
|
64
|
-
*/
|
|
65
|
-
export async function dispatchMatchRule(request, extra, clientFor) {
|
|
66
|
-
return dispatchToolRequest(request, extra, clientFor);
|
|
67
|
-
}
|
|
68
64
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/match-rule/shared.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,6DAA6D;AAC7D,mEAAmE;AACnE,+EAA+E;AAC/E
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/match-rule/shared.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,6DAA6D;AAC7D,mEAAmE;AACnE,+EAA+E;AAC/E,gFAAgF;AAChF,6EAA6E;AAC7E,0EAA0E;AAC1E,6EAA6E;AAC7E,iBAAiB;AACjB,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,yCAAyC;AAEzC,0EAA0E;AAC1E,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,gBAAgB,kBAAkB,CAAC,SAAS,CAAC,QAAQ,CAAA;AAC9D,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,MAAc;IAC/D,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAA;AACvE,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACvD,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAA;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO;IACP,WAAW;IACX,UAAU;IACV,OAAO;CACC,CAAA;AAEV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,uDAAuD;IACvD,yEAAyE;IACzE,iEAAiE;IACjE,sEAAsE;IACtE,wEAAwE;IACxE,yEAAyE;IACzE,4EAA4E;IAC5E,uEAAuE;IACvE,uEAAuE;IACvE,yEAAyE;IACzE,yEAAyE;IACzE,uEAAuE;IACvE,iEAAiE;IACjE,kEAAkE;IAClE,wEAAwE;IACxE,oEAAoE;IACpE,yBAAyB,CAAA"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import { contextRoutingId } from '../input-fields.js';
|
|
9
9
|
import { bodyWithout } from '../request-fields.js';
|
|
10
|
-
import {
|
|
11
|
-
import { contextRulePath,
|
|
10
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
11
|
+
import { contextRulePath, MATCH_RULE_TYPES, RULE_CONFIG_DESC_BODY, } from './shared.js';
|
|
12
12
|
/** Zod raw shape for `match_rule_update` input — ids (path) + optional fields. */
|
|
13
13
|
export const updateMatchRuleInputShape = {
|
|
14
14
|
contextId: contextRoutingId,
|
|
@@ -54,7 +54,7 @@ export function registerMatchRuleUpdateTool(server) {
|
|
|
54
54
|
'RFC 9457 error.',
|
|
55
55
|
inputSchema: updateMatchRuleInputShape,
|
|
56
56
|
}, async (args, extra) => {
|
|
57
|
-
return
|
|
57
|
+
return dispatchToolRequest({
|
|
58
58
|
method: 'PATCH',
|
|
59
59
|
path: contextRulePath(args.contextId, args.ruleId),
|
|
60
60
|
body: buildUpdateBody(args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/tools/match-rule/update.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE;AACzE,kEAAkE;AAElE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/tools/match-rule/update.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE;AACzE,kEAAkE;AAElE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,aAAa,CAAA;AAEpB,kFAAkF;AAClF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,gBAAgB;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACzE,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,IAAI,CAAC;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,wEAAwE;QACtE,qBAAqB,CACxB;IACH,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,gBAAgB,CAAC;SACtB,QAAQ,EAAE;SACV,QAAQ,CACP,2EAA2E;QACzE,qEAAqE;QACrE,4EAA4E,CAC/E;IACH,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,CAAC,oBAAoB,GAAG,qBAAqB,CAAC;CAC1D,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,IAA0B;IAE1B,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAiB;IAC3D,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,WAAW,EACT,2EAA2E;YAC3E,oDAAoD;YACpD,mFAAmF;YACnF,yEAAyE;YACzE,iBAAiB;QACnB,WAAW,EAAE,yBAAyB;KACvC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,mBAAmB,CACxB;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;YAClD,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC;SAC5B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
// the right context. `contextId` is a routing param matcher validates ownership
|
|
18
18
|
// of, NOT a tenant field; no tenant field is accepted.
|
|
19
19
|
import { z } from 'zod';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
21
|
+
import { runPath, stripRuleStatKeys } from './shared.js';
|
|
22
22
|
/** Zod raw shape for `match_run_get` input — runId (path) + contextId (query, required). */
|
|
23
23
|
export const getMatchRunInputShape = {
|
|
24
24
|
runId: z
|
|
@@ -33,12 +33,12 @@ export const getMatchRunInputShape = {
|
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* Fetch the run and return it with `stats` cleaned of the dynamic per-rule
|
|
36
|
-
* keys (see `stripRuleStatKeys`). Delegates to the shared `
|
|
36
|
+
* keys (see `stripRuleStatKeys`). Delegates to the shared `dispatchToolRequest`
|
|
37
37
|
* relay (fail-closed auth, RFC 9457 → tool-error mapping) and passes a
|
|
38
38
|
* success-body transform — the one matching read that post-processes the body.
|
|
39
39
|
*/
|
|
40
|
-
function fetchAndCleanRun(runId, contextId, extra
|
|
41
|
-
return
|
|
40
|
+
function fetchAndCleanRun(runId, contextId, extra) {
|
|
41
|
+
return dispatchToolRequest({ method: 'GET', path: runPath(runId), query: { contextId } }, extra, undefined, (run) => run !== undefined && run !== null
|
|
42
42
|
? {
|
|
43
43
|
...run,
|
|
44
44
|
stats: stripRuleStatKeys(run.stats),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/tools/matching/get.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE;AACF,kEAAkE;AAClE,6EAA6E;AAC7E,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,+CAA+C;AAC/C,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;AAChF,uDAAuD;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/tools/matching/get.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE;AACF,kEAAkE;AAClE,6EAA6E;AAC7E,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,+CAA+C;AAC/C,E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W,EAAE,qBAAqB;KACnC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IAC5D,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import { nextCursor, pageLimit } from '../input-fields.js';
|
|
14
14
|
import { SORT_ORDERS } from './list.js';
|
|
15
|
-
import {
|
|
15
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
16
|
+
import { runGroupsPath } from './shared.js';
|
|
16
17
|
/** Sort fields matcher accepts for the run-groups listing. */
|
|
17
18
|
export const GROUP_SORT_FIELDS = ['id', 'created_at', 'status'];
|
|
18
19
|
/**
|
|
@@ -79,7 +80,7 @@ export function registerMatchRunGroupsTool(server) {
|
|
|
79
80
|
'field is accepted.',
|
|
80
81
|
inputSchema: getMatchRunGroupsInputShape,
|
|
81
82
|
}, async (args, extra) => {
|
|
82
|
-
return
|
|
83
|
+
return dispatchToolRequest({
|
|
83
84
|
method: 'GET',
|
|
84
85
|
path: runGroupsPath(args.runId),
|
|
85
86
|
query: buildGroupsQuery(args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../src/tools/matching/groups.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,+EAA+E;AAC/E,4EAA4E;AAC5E,iDAAiD;AACjD,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,iEAAiE;AAEjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAK1D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,
|
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AAE,IAAI,CAAC,SAAS;KAC1B,CAAA;IACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC7B,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IAC1B,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9B,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC5B,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAClC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IACpC,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC/B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;IAC9B,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAiB;IAC1D,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,WAAW,EACT,wEAAwE;YACxE,2EAA2E;YAC3E,4EAA4E;YAC5E,yEAAyE;YACzE,2EAA2E;YAC3E,0EAA0E;YAC1E,oBAAoB;QACtB,WAAW,EAAE,2BAA2B;KACzC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,mBAAmB,CACxB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;YAC/B,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAC9B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -5,15 +5,87 @@
|
|
|
5
5
|
// RFC 9457 → tool-error mapping (toToolError) with every other curated surface,
|
|
6
6
|
// so they map matcher errors identically. No tool carries a tenant field;
|
|
7
7
|
// contextId is a routing param matcher validates ownership of.
|
|
8
|
+
//
|
|
9
|
+
// start is nothing but the context run path, a POST, a body built from the
|
|
10
|
+
// validated args and a description, so it is declared as one row; list, get and
|
|
11
|
+
// groups carry query builders or a result transform and stay as files. All four
|
|
12
|
+
// sit in ONE ordered list, because that list IS the order `tools/list` publishes.
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { registerCuratedTools } from '../curated-tool.js';
|
|
8
15
|
import { registerMatchRunGroupsTool } from './groups.js';
|
|
9
16
|
import { registerMatchRunGetTool } from './get.js';
|
|
10
17
|
import { registerMatchRunListTool } from './list.js';
|
|
11
|
-
import {
|
|
18
|
+
import { contextRunPath } from './shared.js';
|
|
19
|
+
/**
|
|
20
|
+
* Execution modes for a matching run.
|
|
21
|
+
* - DRY_RUN tests the context's rules and reports what WOULD match without
|
|
22
|
+
* committing any results.
|
|
23
|
+
* - COMMIT executes the rules and persists the resulting matches.
|
|
24
|
+
*/
|
|
25
|
+
const RUN_MODES = ['DRY_RUN', 'COMMIT'];
|
|
26
|
+
/**
|
|
27
|
+
* Zod raw shape for `match_run_start` input — contextId (path) + required mode.
|
|
28
|
+
* Exported because `spec/schema-parity.ts` diffs it against the vendored spec's
|
|
29
|
+
* RunMatchRequest; the row below is its only other consumer.
|
|
30
|
+
*/
|
|
31
|
+
export const startMatchRunInputShape = {
|
|
32
|
+
contextId: z
|
|
33
|
+
.string()
|
|
34
|
+
.min(1)
|
|
35
|
+
.describe('The reconciliation context id (UUID) to run matching for. Routing param; ' +
|
|
36
|
+
'matcher validates it belongs to your tenant.'),
|
|
37
|
+
mode: z
|
|
38
|
+
.enum(RUN_MODES)
|
|
39
|
+
.describe('Execution mode. DRY_RUN tests the rules without committing any matches; ' +
|
|
40
|
+
'COMMIT executes the rules and persists the resulting matches.'),
|
|
41
|
+
async: z
|
|
42
|
+
.boolean()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Submit path (optional, default false). Both return 202 with ' +
|
|
45
|
+
'{ runId, status }; the status distinguishes them. Omit (or false) to ' +
|
|
46
|
+
'run in-request: the 202 carries the TERMINAL run (status COMPLETED or ' +
|
|
47
|
+
'FAILED). Set true to enqueue: the run is created QUEUED and a background ' +
|
|
48
|
+
'worker executes it — the 202 status is QUEUED and you poll match_run_get ' +
|
|
49
|
+
'with the runId until it reaches COMPLETED/FAILED.'),
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The family's four tools in published order: the one thin row, then the three
|
|
53
|
+
* that keep their own file. Every description string is the hand-tuned LLM
|
|
54
|
+
* guidance a client sees verbatim; the published-surface golden is what proves
|
|
55
|
+
* an edit here did not drop a character, or move a tool.
|
|
56
|
+
*/
|
|
57
|
+
const MATCHING_TOOLS = [
|
|
58
|
+
{
|
|
59
|
+
name: 'match_run_start',
|
|
60
|
+
description: 'Trigger a matching run for a reconciliation context. Both submit paths ' +
|
|
61
|
+
'return 202 with { runId, status }; the status distinguishes them. Omit ' +
|
|
62
|
+
'async (or set false) to run in-request: the 202 carries the TERMINAL run ' +
|
|
63
|
+
'(status COMPLETED or FAILED). Set async:true to enqueue: the run is ' +
|
|
64
|
+
'created QUEUED and a background worker executes it (202 status QUEUED) — ' +
|
|
65
|
+
'poll match_run_get with the runId to follow progress (this tool does not ' +
|
|
66
|
+
'auto-poll). mode is required: DRY_RUN tests rules without committing, ' +
|
|
67
|
+
'COMMIT persists the matches. contextId is a routing param scoped to your ' +
|
|
68
|
+
'token (no tenant field is accepted). Returns the acceptance body, or a ' +
|
|
69
|
+
'structured RFC 9457 error (e.g. 422 when the rule set is not ' +
|
|
70
|
+
'stream-bounded and cannot run at unbounded scale).',
|
|
71
|
+
inputShape: startMatchRunInputShape,
|
|
72
|
+
request: (args) => ({
|
|
73
|
+
method: 'POST',
|
|
74
|
+
path: contextRunPath(String(args.contextId)),
|
|
75
|
+
// `async` is omitted unless the caller set it — RunMatchRequest forbids
|
|
76
|
+
// unknown properties, so the body stays exactly what was asked for.
|
|
77
|
+
body: {
|
|
78
|
+
mode: args.mode,
|
|
79
|
+
...(args.async === undefined ? {} : { async: args.async }),
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
},
|
|
83
|
+
registerMatchRunListTool,
|
|
84
|
+
registerMatchRunGetTool,
|
|
85
|
+
registerMatchRunGroupsTool,
|
|
86
|
+
];
|
|
12
87
|
/** Register all four curated match-run tools on the given server. */
|
|
13
88
|
export function registerMatchingTools(server) {
|
|
14
|
-
|
|
15
|
-
registerMatchRunListTool(server);
|
|
16
|
-
registerMatchRunGetTool(server);
|
|
17
|
-
registerMatchRunGroupsTool(server);
|
|
89
|
+
registerCuratedTools(server, MATCHING_TOOLS);
|
|
18
90
|
}
|
|
19
91
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/matching/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,gFAAgF;AAChF,0EAA0E;AAC1E,+DAA+D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/matching/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,gFAAgF;AAChF,0EAA0E;AAC1E,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,gFAAgF;AAChF,kFAAkF;AAElF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,oBAAoB,EAAqB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;;;;GAKG;AACH,MAAM,SAAS,GAAG,CAAC,SAAS,E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B,CAAC,MAAiB;IACrD,oBAAoB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAC9C,CAAC"}
|
|
@@ -11,7 +11,8 @@ import { z } from 'zod';
|
|
|
11
11
|
import { nextCursor, pageLimit } from '../input-fields.js';
|
|
12
12
|
import { queryHandler } from '../query-handler.js';
|
|
13
13
|
import { pickQuery } from '../request-fields.js';
|
|
14
|
-
import {
|
|
14
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
15
|
+
import { contextRunsPath } from './shared.js';
|
|
15
16
|
/** Sort orders matcher accepts for the run-history listing. */
|
|
16
17
|
export const SORT_ORDERS = ['asc', 'desc'];
|
|
17
18
|
/** Zod raw shape for `match_run_list` input — contextId (path) + pagination/sort. */
|
|
@@ -47,6 +48,6 @@ export function registerMatchRunListTool(server) {
|
|
|
47
48
|
'contextId is a routing param scoped to your token; no tenant field is ' +
|
|
48
49
|
'accepted.',
|
|
49
50
|
inputSchema: listMatchRunsInputShape,
|
|
50
|
-
}, queryHandler(buildListQuery, (args) => contextRunsPath(args.contextId),
|
|
51
|
+
}, queryHandler(buildListQuery, (args) => contextRunsPath(args.contextId), dispatchToolRequest));
|
|
51
52
|
}
|
|
52
53
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/tools/matching/list.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,kFAAkF;AAClF,4EAA4E;AAC5E,EAAE;AACF,4EAA4E;AAC5E,uCAAuC;AAEvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,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;YACvE,0EAA0E;YAC1E,mEAAmE;YACnE,sEAAsE;YACtE,wEAAwE;YACxE,WAAW;QACb,WAAW,EAAE,uBAAuB;KACrC,EACD,YAAY,CACV,cAAc,EACd,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,EACzC,mBAAmB,CACpB,CACF,CAAA;AACH,CAAC"}
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
// Unlike the configuration resources (fee schedules, rules, contexts, sources),
|
|
4
4
|
// the match-run family is NOT CRUD — it is a set of action/read verbs over the
|
|
5
5
|
// matcher engine: start a run, list a context's runs, read one run's results,
|
|
6
|
-
// and page its match groups.
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// surfaces map matcher errors through the identical path (toToolError).
|
|
6
|
+
// and page its match groups. This module holds the path helpers and the run
|
|
7
|
+
// stats projection, and nothing else, factored exactly once so the four tools
|
|
8
|
+
// address the same URLs. The relay itself lives in shared-dispatch.ts, so
|
|
9
|
+
// curated and generic surfaces map matcher errors through the identical path
|
|
10
|
+
// (toToolError).
|
|
12
11
|
//
|
|
13
12
|
// Two path families exist (mirroring the spec): runs are triggered/listed under
|
|
14
13
|
// the context (`/v1/matching/contexts/{contextId}/...`), while a run's detail and
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
// provided. No tenant identifier is ever read or injected (matcher derives
|
|
21
20
|
// tenant from the relayed JWT); no match-run tool input carries one. `contextId`
|
|
22
21
|
// is a routing param matcher validates ownership of, not a tenant field.
|
|
23
|
-
import { dispatchToolRequest, } from '../shared-dispatch.js';
|
|
24
22
|
/** Trigger path for a context's matching run: POST starts a run. */
|
|
25
23
|
export function contextRunPath(contextId) {
|
|
26
24
|
return `/v1/matching/contexts/${encodeURIComponent(contextId)}/run`;
|
|
@@ -65,15 +63,4 @@ export function stripRuleStatKeys(stats) {
|
|
|
65
63
|
}
|
|
66
64
|
return cleaned;
|
|
67
65
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Run one assembled request through the relay: fail-closed auth, dispatch, and
|
|
70
|
-
* RFC 9457 → tool-error mapping — identical to the generic invoke's dispatch so
|
|
71
|
-
* both surfaces produce the same structured error shape.
|
|
72
|
-
*
|
|
73
|
-
* `clientFor` is injectable for tests; production callers pass nothing and get
|
|
74
|
-
* the request-scoped, fail-closed `requireMatcherClient`.
|
|
75
|
-
*/
|
|
76
|
-
export async function dispatchMatching(request, extra, clientFor, transform) {
|
|
77
|
-
return dispatchToolRequest(request, extra, clientFor, transform);
|
|
78
|
-
}
|
|
79
66
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/matching/shared.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/matching/shared.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,6EAA6E;AAC7E,iBAAiB;AACjB,EAAE;AACF,gFAAgF;AAChF,kFAAkF;AAClF,6EAA6E;AAC7E,kFAAkF;AAClF,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,2EAA2E;AAC3E,iFAAiF;AACjF,yEAAyE;AAEzE,oEAAoE;AACpE,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC9C,OAAO,yBAAyB,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAA;AACrE,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,OAAO,yBAAyB,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAA;AACtE,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,qBAAqB,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAA;AACzD,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,qBAAqB,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAA;AAChE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAAG,CAAC,eAAe,EAAE,YAAY,CAAU,CAAA;AAEvE;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAiD;IAEjD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,OAAO,GAA4B,EAAE,CAAA;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YACrE,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACtB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { withQuery } from './curated-tool.js';
|
|
1
2
|
/** Assemble one curated GET, leaving auth, errors and output with its family relay. */
|
|
2
3
|
export function queryHandler(buildQuery, path, dispatch) {
|
|
3
4
|
return async (args, extra) => {
|
|
4
5
|
const query = buildQuery(args);
|
|
5
|
-
return dispatch({ method: 'GET', path: path(args), ...(query
|
|
6
|
+
return dispatch({ method: 'GET', path: path(args), ...withQuery(query) }, extra);
|
|
6
7
|
};
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=query-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-handler.js","sourceRoot":"","sources":["../../src/tools/query-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query-handler.js","sourceRoot":"","sources":["../../src/tools/query-handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAO7C,uFAAuF;AACvF,MAAM,UAAU,YAAY,CAC1B,UAAmD,EACnD,IAA4B,EAC5B,QAAuB;IAEvB,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAC3B,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;QAC9B,OAAO,QAAQ,CACb,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,EAAE,EACxD,KAAK,CACN,CAAA;IACH,CAAC,CAAA;AACH,CAAC"}
|