@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/context/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wEAAwE;AACxE,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/context/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wEAAwE;AACxE,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,iEAAiE;AACjE,gFAAgF;AAChF,8EAA8E;AAC9E,kCAAkC;AAClC,EAAE;AACF,6EAA6E;A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;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACvD,CAAC;QACF,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE;YACtB,wEAAwE;YACxE,8DAA8D;YAC9D,MAAM,IAAI,GAAG,QAAyC,CAAA;YACtD,MAAM,KAAK,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,KAAK,CAAA;YAC7C,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,IAAI,CAAA;YAC/B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACtE,CAAC;KACF;CACF,CAAA;AAED,8DAA8D;AAC9D,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,oBAAoB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -11,7 +11,8 @@ import { nextCursor, pageLimit } from '../input-fields.js';
|
|
|
11
11
|
import { queryHandler } from '../query-handler.js';
|
|
12
12
|
import { pickQuery } from '../request-fields.js';
|
|
13
13
|
import { CONTEXT_TYPES } from './create.js';
|
|
14
|
-
import {
|
|
14
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
15
|
+
import { CONTEXTS_PATH } from './shared.js';
|
|
15
16
|
/** Lifecycle statuses a context can be filtered by on the list endpoint. */
|
|
16
17
|
export const CONTEXT_STATUSES = ['DRAFT', 'ACTIVE', 'PAUSED', 'ARCHIVED'];
|
|
17
18
|
/** Zod raw shape for `context_list` input — pagination knobs + optional filters. */
|
|
@@ -46,6 +47,6 @@ export function registerContextListTool(server) {
|
|
|
46
47
|
'the returned nextCursor. No tenant field is accepted; the tenant is ' +
|
|
47
48
|
'derived from your bearer token.',
|
|
48
49
|
inputSchema: listContextsInputShape,
|
|
49
|
-
}, queryHandler(buildListQuery, () => CONTEXTS_PATH,
|
|
50
|
+
}, queryHandler(buildListQuery, () => CONTEXTS_PATH, dispatchToolRequest));
|
|
50
51
|
}
|
|
51
52
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/tools/context/list.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,kFAAkF;AAClF,gFAAgF;AAChF,4EAA4E;AAC5E,YAAY;AAEZ,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,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/tools/context/list.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,kFAAkF;AAClF,gFAAgF;AAChF,4EAA4E;AAC5E,YAAY;AAEZ,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,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAA;AAElF,oFAAoF;AACpF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,aAAa,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CACP,8EAA8E,CAC/E;IACH,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,gBAAgB,CAAC;SACtB,QAAQ,EAAE;SACV,QAAQ,CACP,0EAA0E;QACxE,2CAA2C,CAC9C;CACJ,CAAA;AAOD,+EAA+E;AAC/E,SAAS,cAAc,CAAC,IAAuB;IAC7C,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAA;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,WAAW,EACT,2DAA2D;YAC3D,0EAA0E;YAC1E,4EAA4E;YAC5E,2EAA2E;YAC3E,sEAAsE;YACtE,iCAAiC;QACnC,WAAW,EAAE,sBAAsB;KACpC,EACD,YAAY,CACV,cAAc,EACd,GAAG,EAAE,CAAC,aAAa,EACnB,mBAAmB,CACpB,CACF,CAAA;AACH,CAAC"}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
// contextId is the only input (a UUID path param); no tenant field is
|
|
14
14
|
// accepted (matcher scopes to the relayed token's tenant).
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
-
import {
|
|
16
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
17
|
+
import { contextPath } from './shared.js';
|
|
17
18
|
/** Build the setup-progress sub-path for a context. */
|
|
18
19
|
export function contextSetupProgressPath(contextId) {
|
|
19
20
|
return `${contextPath(contextId)}/setup-progress`;
|
|
@@ -56,7 +57,7 @@ export function registerContextSetupProgressTool(server) {
|
|
|
56
57
|
'not yours).',
|
|
57
58
|
inputSchema: getContextSetupProgressInputShape,
|
|
58
59
|
}, async (args, extra) => {
|
|
59
|
-
return
|
|
60
|
+
return dispatchToolRequest({ method: 'GET', path: contextSetupProgressPath(args.contextId) }, extra);
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
//# sourceMappingURL=setup-progress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-progress.js","sourceRoot":"","sources":["../../../src/tools/context/setup-progress.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,+EAA+E;AAC/E,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,sEAAsE;AACtE,qEAAqE;AACrE,sEAAsE;AACtE,EAAE;AACF,sEAAsE;AACtE,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"setup-progress.js","sourceRoot":"","sources":["../../../src/tools/context/setup-progress.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,+EAA+E;AAC/E,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,sEAAsE;AACtE,qEAAqE;AACrE,sEAAsE;AACtE,EAAE;AACF,sEAAsE;AACtE,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,uDAAuD;AACvD,MAAM,UAAU,wBAAwB,CAAC,SAAiB;IACxD,OAAO,GAAG,WAAW,CAAC,SAAS,CAAC,iBAAiB,CAAA;AACnD,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,mEAAmE,CAAC;CACjF,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAAC,MAAiB;IAChE,MAAM,CAAC,YAAY,CACjB,wBAAwB,EACxB;QACE,WAAW,EACT,mEAAmE;YACnE,uEAAuE;YACvE,sEAAsE;YACtE,oEAAoE;YACpE,sEAAsE;YACtE,qEAAqE;YACrE,sEAAsE;YACtE,+DAA+D;YAC/D,kEAAkE;YAClE,4DAA4D;YAC5D,sEAAsE;YACtE,+DAA+D;YAC/D,sEAAsE;YACtE,sDAAsD;YACtD,8CAA8C;YAC9C,+CAA+C;YAC/C,iDAAiD;YACjD,6CAA6C;YAC7C,8CAA8C;YAC9C,mEAAmE;YACnE,sEAAsE;YACtE,aAAa;QACf,WAAW,EAAE,iCAAiC;KAC/C,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,mBAAmB,CACxB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EACjE,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,35 +1,20 @@
|
|
|
1
1
|
// Shared plumbing for the curated context tools.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// pattern established in Phase 1.
|
|
3
|
+
// This module holds the context resource paths, nothing else: the base path and
|
|
4
|
+
// the single-context sub-path builder, factored exactly once so every context
|
|
5
|
+
// tool — the table rows in index.ts and the tools that keep their own file —
|
|
6
|
+
// addresses the same URLs. The relay itself lives in shared-dispatch.ts, so
|
|
7
|
+
// curated and generic surfaces map matcher errors through the identical path
|
|
8
|
+
// (toToolError).
|
|
10
9
|
//
|
|
11
|
-
// Security:
|
|
12
|
-
// owns the request-scoped relay and fails closed when no usable credential was
|
|
13
|
-
// provided. No tenant identifier is ever read or injected (matcher derives
|
|
10
|
+
// Security: no tenant identifier is ever read or injected (matcher derives
|
|
14
11
|
// tenant from the relayed JWT); no context tool input carries one. The
|
|
15
12
|
// `contextId` forwarded into the path is a routing param matcher validates
|
|
16
13
|
// ownership of, not a tenant field.
|
|
17
|
-
import { dispatchToolRequest, } from '../shared-dispatch.js';
|
|
18
14
|
/** Base path for the reconciliation-context resource (tenant-scoped; tenant from the token). */
|
|
19
15
|
export const CONTEXTS_PATH = '/v1/contexts';
|
|
20
16
|
/** Build the single-context sub-path, URL-encoding the id so reserved chars are safe. */
|
|
21
17
|
export function contextPath(contextId) {
|
|
22
18
|
return `${CONTEXTS_PATH}/${encodeURIComponent(contextId)}`;
|
|
23
19
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Run one assembled request through the relay: fail-closed auth, dispatch, and
|
|
26
|
-
* RFC 9457 → tool-error mapping — identical to the generic invoke's dispatch so
|
|
27
|
-
* both surfaces produce the same structured error shape.
|
|
28
|
-
*
|
|
29
|
-
* `clientFor` is injectable for tests; production callers pass nothing and get
|
|
30
|
-
* the request-scoped, fail-closed `requireMatcherClient`.
|
|
31
|
-
*/
|
|
32
|
-
export async function dispatchContext(request, extra, clientFor) {
|
|
33
|
-
return dispatchToolRequest(request, extra, clientFor);
|
|
34
|
-
}
|
|
35
20
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/context/shared.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/context/shared.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,6EAA6E;AAC7E,iBAAiB;AACjB,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,2EAA2E;AAC3E,oCAAoC;AAEpC,gGAAgG;AAChG,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAA;AAE3C,yFAAyF;AACzF,MAAM,UAAU,WAAW,CAAC,SAAiB;IAC3C,OAAO,GAAG,aAAa,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAA;AAC5D,CAAC"}
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import { bodyWithout } from '../request-fields.js';
|
|
14
14
|
import { CONTEXT_TYPES, FEE_NORMALIZATIONS } from './create.js';
|
|
15
|
-
import {
|
|
15
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
16
|
+
import { contextPath } from './shared.js';
|
|
16
17
|
/**
|
|
17
18
|
* Lifecycle statuses an update may transition a context to. Narrower than the
|
|
18
19
|
* list filter's CONTEXT_STATUSES: DRAFT is the unactivated initial state and is
|
|
@@ -109,7 +110,7 @@ export function registerContextUpdateTool(server) {
|
|
|
109
110
|
'context, or a structured RFC 9457 error.',
|
|
110
111
|
inputSchema: updateContextInputShape,
|
|
111
112
|
}, async (args, extra) => {
|
|
112
|
-
return
|
|
113
|
+
return dispatchToolRequest({
|
|
113
114
|
method: 'PATCH',
|
|
114
115
|
path: contextPath(args.contextId),
|
|
115
116
|
body: buildUpdateBody(args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/tools/context/update.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,iFAAiF;AACjF,6EAA6E;AAC7E,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,iF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,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,WAAW,EACT,yEAAyE;YACzE,qEAAqE;YACrE,2EAA2E;YAC3E,qEAAqE;YACrE,+DAA+D;YAC/D,qBAAqB;YACrB,2DAA2D;YAC3D,uEAAuE;YACvE,0CAA0C;QAC5C,WAAW,EAAE,uBAAuB;KACrC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,mBAAmB,CACxB;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC;YACjC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC;SAC5B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// One curated tool declared as data, plus the loop that registers a family table.
|
|
2
|
+
//
|
|
3
|
+
// Every thin curated tool is the same five facts: a name, a description, a Zod
|
|
4
|
+
// raw shape, a function from validated args to a MatcherRequest, and (rarely) a
|
|
5
|
+
// success-body transform. Declaring them as rows removes the per-tool file
|
|
6
|
+
// without moving one byte of the published surface — the name, description and
|
|
7
|
+
// input schema a client sees are exactly the row's fields.
|
|
8
|
+
//
|
|
9
|
+
// Security: this loop never reads the bearer token. Every row dispatches through
|
|
10
|
+
// shared-dispatch.ts, whose requireMatcherClient default owns the request-scoped
|
|
11
|
+
// relay and fails closed when no usable credential was provided. `extra` is
|
|
12
|
+
// forwarded untouched so the per-request credential reaches that relay.
|
|
13
|
+
import { dispatchToolRequest, } from './shared-dispatch.js';
|
|
14
|
+
/**
|
|
15
|
+
* Spread a built query into a MatcherRequest, OMITTING the key when the builder
|
|
16
|
+
* returned undefined, so a tool that means "no query at all" assembles the same
|
|
17
|
+
* request object as one that never had a query builder. The one owner of that
|
|
18
|
+
* rule: `queryHandler` spreads this too, rather than repeating the ternary.
|
|
19
|
+
*/
|
|
20
|
+
export function withQuery(query) {
|
|
21
|
+
return query === undefined ? {} : { query };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Register every entry in a family's list on the server, in list order — which
|
|
25
|
+
* is the order a client receives from `tools/list`.
|
|
26
|
+
*
|
|
27
|
+
* A repeated name throws from `McpServer.registerTool` itself ("Tool <name> is
|
|
28
|
+
* already registered") — a programming error in the list, caught at boot.
|
|
29
|
+
*/
|
|
30
|
+
export function registerCuratedTools(server, entries) {
|
|
31
|
+
for (const entry of entries) {
|
|
32
|
+
if (typeof entry === 'function') {
|
|
33
|
+
entry(server);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
server.registerTool(entry.name, { description: entry.description, inputSchema: entry.inputShape }, (args, extra) => dispatchToolRequest(entry.request(args), extra, undefined, entry.transform));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=curated-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curated-tool.js","sourceRoot":"","sources":["../../src/tools/curated-tool.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,+EAA+E;AAC/E,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,4EAA4E;AAC5E,wEAAwE;AAMxE,OAAO,EACL,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAW7B;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CACvB,KAA8B;IAE9B,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAA;AAC7C,CAAC;AAeD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,OAAgC;IAEhC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;YAChC,KAAK,CAAC,MAAM,CAAC,CAAA;YACb,SAAQ;QACV,CAAC;QAED,MAAM,CAAC,YAAY,CACjB,KAAK,CAAC,IAAI,EACV,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,EACjE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,mBAAmB,CACjB,KAAK,CAAC,OAAO,CAAC,IAA+B,CAAC,EAC9C,KAAK,EACL,SAAS,EACT,KAAK,CAAC,SAAS,CAChB,CACJ,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -2,26 +2,131 @@
|
|
|
2
2
|
// dashboard surface — the combined aggregates plus six focused slices
|
|
3
3
|
// (cash-impact, match-rate, metrics, sla, source-breakdown, volume). Every op is
|
|
4
4
|
// a context-nested GET sharing one input shape (contextId path + optional
|
|
5
|
-
// date_from/date_to/source_id query) and the fail-closed relay
|
|
6
|
-
// the RFC 9457 → tool-error mapping (toToolError) with
|
|
7
|
-
// curated and generic map matcher errors identically.
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
// date_from/date_to/source_id query) and the fail-closed relay
|
|
6
|
+
// (shared-dispatch.ts) and the RFC 9457 → tool-error mapping (toToolError) with
|
|
7
|
+
// the generic surface, so curated and generic map matcher errors identically.
|
|
8
|
+
// The seven differ only in their name, their slice and their description, so
|
|
9
|
+
// they are declared as seven rows and registered by the one shared loop. No
|
|
10
|
+
// tool carries a tenant field; contextId is a routing path param matcher
|
|
11
|
+
// validates against the relayed token's tenant, and source_id is a data filter.
|
|
12
|
+
import { registerCuratedTools, withQuery, } from '../curated-tool.js';
|
|
13
|
+
import { buildDashboardQuery, contextDashboardPath, contextDashboardSlicePath, dashboardQueryInputShape, } from './shared.js';
|
|
14
|
+
/**
|
|
15
|
+
* Build a row's request: the context-scoped GET plus the shared date/source
|
|
16
|
+
* query. `slice` is a fixed literal owned by the table, never caller input;
|
|
17
|
+
* omitting it addresses the combined-aggregates base path.
|
|
18
|
+
*/
|
|
19
|
+
function dashboardRequest(slice) {
|
|
20
|
+
return (args) => {
|
|
21
|
+
const input = args;
|
|
22
|
+
return {
|
|
23
|
+
method: 'GET',
|
|
24
|
+
path: slice === undefined
|
|
25
|
+
? contextDashboardPath(input.contextId)
|
|
26
|
+
: contextDashboardSlicePath(input.contextId, slice),
|
|
27
|
+
...withQuery(buildDashboardQuery(input)),
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The seven curated dashboard reads. Every description string is the
|
|
33
|
+
* hand-tuned LLM guidance a client sees verbatim; the published-surface golden
|
|
34
|
+
* is what proves an edit here did not drop a character.
|
|
35
|
+
*/
|
|
36
|
+
const DASHBOARD_TOOLS = [
|
|
37
|
+
{
|
|
38
|
+
name: 'dashboard_aggregates',
|
|
39
|
+
description: 'Get the combined dashboard aggregates (volume, match rate, SLA, and ' +
|
|
40
|
+
'unmatchedByCurrency: the unreconciled exposure split into one entry per ' +
|
|
41
|
+
'currency, each with amount and transactionCount, whose amounts sum to ' +
|
|
42
|
+
'volume.unmatchedAmount and whose counts sum to volume.unmatchedCount; ' +
|
|
43
|
+
'empty when no transaction in the window is UNMATCHED or ' +
|
|
44
|
+
'PENDING_REVIEW, and the only place the payload ' +
|
|
45
|
+
'names a currency, since volume.unmatchedAmount carries none) ' +
|
|
46
|
+
'for a reconciliation context. Pass contextId (UUID path param — not a ' +
|
|
47
|
+
'tenant field), and optionally date_from/date_to (YYYY-MM-DD; matcher ' +
|
|
48
|
+
'defaults to the last ~30 days and SILENTLY EXCLUDES older data — for ' +
|
|
49
|
+
'a full picture pass an explicit date_from/date_to, max 90-day span) ' +
|
|
50
|
+
'and/or source_id (UUID data filter). The resolved window is echoed ' +
|
|
51
|
+
'back in volume.periodStart/volume.periodEnd — check those before ' +
|
|
52
|
+
'reporting a number as final. No tenant field is accepted.',
|
|
53
|
+
inputShape: dashboardQueryInputShape,
|
|
54
|
+
request: dashboardRequest(),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'dashboard_cash_impact',
|
|
58
|
+
description: 'Get the cash-impact summary (unreconciled financial exposure, with ' +
|
|
59
|
+
'currency and age breakdowns) for a reconciliation context. Pass ' +
|
|
60
|
+
'contextId (UUID path param — not a tenant field), and optionally ' +
|
|
61
|
+
'date_from/date_to (YYYY-MM-DD; matcher defaults to the last ~30 days ' +
|
|
62
|
+
'and SILENTLY EXCLUDES older exposure — for a full picture pass an ' +
|
|
63
|
+
'explicit date_from/date_to, max 90-day span) and/or source_id (UUID ' +
|
|
64
|
+
'data filter). No tenant field is accepted.',
|
|
65
|
+
inputShape: dashboardQueryInputShape,
|
|
66
|
+
request: dashboardRequest('cash-impact'),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'dashboard_match_rate',
|
|
70
|
+
description: 'Get the match-rate statistics (percentage plus trend) for a ' +
|
|
71
|
+
'reconciliation context. Pass contextId (UUID path param — not a tenant ' +
|
|
72
|
+
'field), and optionally date_from/date_to (YYYY-MM-DD; matcher defaults ' +
|
|
73
|
+
'to the last ~30 days and SILENTLY EXCLUDES older transactions — a ' +
|
|
74
|
+
'windowed match rate is NOT the overall result; for a full picture pass ' +
|
|
75
|
+
'an explicit date_from/date_to, max 90-day span) and/or source_id (UUID ' +
|
|
76
|
+
'data filter). No tenant field is accepted.',
|
|
77
|
+
inputShape: dashboardQueryInputShape,
|
|
78
|
+
request: dashboardRequest('match-rate'),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'dashboard_metrics',
|
|
82
|
+
description: 'Get the comprehensive Command Center dashboard metrics (summary, ' +
|
|
83
|
+
'trends, and breakdowns) for a reconciliation context. Pass contextId ' +
|
|
84
|
+
'(UUID path param — not a tenant field), and optionally date_from/' +
|
|
85
|
+
'date_to (YYYY-MM-DD; matcher defaults to the last ~30 days and ' +
|
|
86
|
+
'SILENTLY EXCLUDES older data — for a full picture pass an explicit ' +
|
|
87
|
+
'date_from/date_to, max 90-day span) and/or source_id (UUID data ' +
|
|
88
|
+
'filter). No tenant field is accepted.',
|
|
89
|
+
inputShape: dashboardQueryInputShape,
|
|
90
|
+
request: dashboardRequest('metrics'),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'dashboard_sla',
|
|
94
|
+
description: 'Get the SLA compliance statistics for a reconciliation context. Pass ' +
|
|
95
|
+
'contextId (UUID path param — not a tenant field), and optionally ' +
|
|
96
|
+
'date_from/date_to (YYYY-MM-DD; matcher defaults to the last ~30 days ' +
|
|
97
|
+
'and SILENTLY EXCLUDES older exceptions — for a full picture pass an ' +
|
|
98
|
+
'explicit date_from/date_to, max 90-day span) and/or source_id (UUID ' +
|
|
99
|
+
'data filter). No tenant field is accepted.',
|
|
100
|
+
inputShape: dashboardQueryInputShape,
|
|
101
|
+
request: dashboardRequest('sla'),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'dashboard_source_breakdown',
|
|
105
|
+
description: 'Get the per-source reconciliation breakdown for a context (statistics ' +
|
|
106
|
+
'grouped by source). Pass contextId (UUID path param — not a tenant ' +
|
|
107
|
+
'field), and optionally date_from/date_to (YYYY-MM-DD; matcher defaults ' +
|
|
108
|
+
'to the last ~30 days and SILENTLY EXCLUDES older data — for a full ' +
|
|
109
|
+
'picture pass an explicit date_from/date_to, max 90-day span) and/or ' +
|
|
110
|
+
'source_id (UUID data filter, to narrow to a single source). No tenant ' +
|
|
111
|
+
'field is accepted.',
|
|
112
|
+
inputShape: dashboardQueryInputShape,
|
|
113
|
+
request: dashboardRequest('source-breakdown'),
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'dashboard_volume',
|
|
117
|
+
description: 'Get the transaction volume statistics for a reconciliation context. ' +
|
|
118
|
+
'Pass contextId (UUID path param — not a tenant field), and optionally ' +
|
|
119
|
+
'date_from/date_to (YYYY-MM-DD; matcher defaults to the last ~30 days ' +
|
|
120
|
+
'and SILENTLY EXCLUDES older volume — for a full picture pass an ' +
|
|
121
|
+
'explicit date_from/date_to, max 90-day span). The response echoes the ' +
|
|
122
|
+
'resolved window in periodStart/periodEnd. Optionally also pass ' +
|
|
123
|
+
'source_id (UUID data filter). No tenant field is accepted.',
|
|
124
|
+
inputShape: dashboardQueryInputShape,
|
|
125
|
+
request: dashboardRequest('volume'),
|
|
126
|
+
},
|
|
127
|
+
];
|
|
17
128
|
/** Register all seven curated dashboard tools on the given server. */
|
|
18
129
|
export function registerDashboardTools(server) {
|
|
19
|
-
|
|
20
|
-
registerDashboardCashImpactTool(server);
|
|
21
|
-
registerDashboardMatchRateTool(server);
|
|
22
|
-
registerDashboardMetricsTool(server);
|
|
23
|
-
registerDashboardSlaTool(server);
|
|
24
|
-
registerDashboardSourceBreakdownTool(server);
|
|
25
|
-
registerDashboardVolumeTool(server);
|
|
130
|
+
registerCuratedTools(server, DASHBOARD_TOOLS);
|
|
26
131
|
}
|
|
27
132
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/dashboard/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,sEAAsE;AACtE,iFAAiF;AACjF,0EAA0E;AAC1E,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/dashboard/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,sEAAsE;AACtE,iFAAiF;AACjF,0EAA0E;AAC1E,+DAA+D;AAC/D,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,gFAAgF;AAIhF,OAAO,EACL,oBAAoB,EACpB,SAAS,GAEV,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,E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,YAAY,CAAC;KACxC;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,mEAAmE;YACnE,uEAAuE;YACvE,mEAAmE;YACnE,iEAAiE;YACjE,qEAAqE;YACrE,kEAAkE;YAClE,uCAAuC;QACzC,UAAU,EAAE,wBAAwB;QACpC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC;KACrC;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,uEAAuE;YACvE,mEAAmE;YACnE,uEAAuE;YACvE,sEAAsE;YACtE,sEAAsE;YACtE,4CAA4C;QAC9C,UAAU,EAAE,wBAAwB;QACpC,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC;KACjC;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,WAAW,EACT,wEAAwE;YACxE,qEAAqE;YACrE,yEAAyE;YACzE,qEAAqE;YACrE,sEAAsE;YACtE,wEAAwE;YACxE,oBAAoB;QACtB,UAAU,EAAE,wBAAwB;QACpC,OAAO,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;KAC9C;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,sEAAsE;YACtE,wEAAwE;YACxE,uEAAuE;YACvE,kEAAkE;YAClE,wEAAwE;YACxE,iEAAiE;YACjE,4DAA4D;QAC9D,UAAU,EAAE,wBAAwB;QACpC,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAAC;KACpC;CACF,CAAA;AAED,sEAAsE;AACtE,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,oBAAoB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;AAC/C,CAAC"}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
// hanging off /v1/reports/contexts/{contextId}/dashboard[/<slice>] and every op
|
|
7
7
|
// shares the IDENTICAL inputs — a contextId path param plus an optional
|
|
8
8
|
// date_from/date_to/source_id query. This module factors all of that exactly
|
|
9
|
-
// once (the base path + slice builder, the shared input shape, the query
|
|
10
|
-
// builder
|
|
11
|
-
//
|
|
12
|
-
// identical path (toToolError).
|
|
9
|
+
// once (the base path + slice builder, the shared input shape, and the query
|
|
10
|
+
// builder) so the seven table rows stay thin (just "name the slice"). The relay
|
|
11
|
+
// itself lives in shared-dispatch.ts, so curated + generic surfaces map matcher
|
|
12
|
+
// errors through the identical path (toToolError).
|
|
13
13
|
//
|
|
14
14
|
// Security: the bearer token is never read here directly — requireMatcherClient
|
|
15
15
|
// owns the request-scoped relay and fails closed when no usable credential was
|
|
@@ -19,9 +19,7 @@
|
|
|
19
19
|
// data filter, never a tenant field.
|
|
20
20
|
import { z } from 'zod';
|
|
21
21
|
import { reportDateFrom, reportDateTo } from '../input-fields.js';
|
|
22
|
-
import { requireMatcherClient, UnauthenticatedError, } from '../../auth/request-token.js';
|
|
23
22
|
import { pickQuery } from '../request-fields.js';
|
|
24
|
-
import { isMatcherApiError, toToolError } from '../tool-error.js';
|
|
25
23
|
/** Build the context-scoped dashboard base path (the combined-aggregates op). */
|
|
26
24
|
export function contextDashboardPath(contextId) {
|
|
27
25
|
return `/v1/reports/contexts/${encodeURIComponent(contextId)}/dashboard`;
|
|
@@ -74,40 +72,4 @@ export const dashboardQueryInputShape = {
|
|
|
74
72
|
export function buildDashboardQuery(args) {
|
|
75
73
|
return pickQuery(args, ['date_from', 'date_to', 'source_id']);
|
|
76
74
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Run one assembled request through the relay: fail-closed auth, dispatch, and
|
|
79
|
-
* RFC 9457 → tool-error mapping — identical to the generic invoke's dispatch so
|
|
80
|
-
* both surfaces produce the same structured error shape.
|
|
81
|
-
*
|
|
82
|
-
* `clientFor` is injectable for tests; production callers pass nothing and get
|
|
83
|
-
* the request-scoped, fail-closed `requireMatcherClient`.
|
|
84
|
-
*/
|
|
85
|
-
export async function dispatchDashboard(request, extra, clientFor = requireMatcherClient) {
|
|
86
|
-
let client;
|
|
87
|
-
try {
|
|
88
|
-
// Fail-closed on a missing / empty / non-Bearer credential.
|
|
89
|
-
client = clientFor(extra);
|
|
90
|
-
}
|
|
91
|
-
catch (err) {
|
|
92
|
-
if (err instanceof UnauthenticatedError) {
|
|
93
|
-
return { isError: true, content: [{ type: 'text', text: err.message }] };
|
|
94
|
-
}
|
|
95
|
-
throw err;
|
|
96
|
-
}
|
|
97
|
-
try {
|
|
98
|
-
const result = await client.request(request);
|
|
99
|
-
// Success → matcher's JSON returned as-is (an empty/204 body → null, though
|
|
100
|
-
// these reads always return a body).
|
|
101
|
-
return { content: [{ type: 'text', text: JSON.stringify(result ?? null) }] };
|
|
102
|
-
}
|
|
103
|
-
catch (err) {
|
|
104
|
-
// RFC 9457 problem → the SHARED structured tool error (status/title/detail/
|
|
105
|
-
// code preserved). A non-matcher error is a bug, not a matcher failure, and
|
|
106
|
-
// is re-thrown rather than masqueraded as one.
|
|
107
|
-
if (isMatcherApiError(err)) {
|
|
108
|
-
return toToolError(err);
|
|
109
|
-
}
|
|
110
|
-
throw err;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
75
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/dashboard/shared.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,kFAAkF;AAClF,gFAAgF;AAChF,gFAAgF;AAChF,wEAAwE;AACxE,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/tools/dashboard/shared.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,kFAAkF;AAClF,gFAAgF;AAChF,gFAAgF;AAChF,wEAAwE;AACxE,6EAA6E;AAC7E,6EAA6E;AAC7E,gFAAgF;AAChF,gFAAgF;AAChF,mDAAmD;AACnD,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;AAC9E,iFAAiF;AACjF,qCAAqC;AAErC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,OAAO,wBAAwB,kBAAkB,CAAC,SAAS,CAAC,YAAY,CAAA;AAC1E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAAiB,EACjB,KAAa;IAEb,OAAO,GAAG,oBAAoB,CAAC,SAAS,CAAC,IAAI,KAAK,EAAE,CAAA;AACtD,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yEAAyE;QACvE,qBAAqB,CACxB;IACH,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,sEAAsE;QACpE,kCAAkC,CACrC;CACJ,CAAA;AAOD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAyB;IAEzB,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAA;AAC/D,CAAC"}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
// and is stripped from the POST body; no tenant field is accepted.
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import { bodyWithout } from '../request-fields.js';
|
|
9
|
-
import {
|
|
9
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
10
|
+
import { disputeClosePath } from './shared.js';
|
|
10
11
|
/** Zod raw shape for `dispute_close` input — id (path) + the resolution body. */
|
|
11
12
|
export const closeDisputeInputShape = {
|
|
12
13
|
disputeId: z.string().min(1).describe('The dispute id (UUID) to close.'),
|
|
@@ -38,7 +39,7 @@ export function registerDisputeCloseTool(server) {
|
|
|
38
39
|
'or a structured RFC 9457 error. No tenant field is accepted.',
|
|
39
40
|
inputSchema: closeDisputeInputShape,
|
|
40
41
|
}, async (args, extra) => {
|
|
41
|
-
return
|
|
42
|
+
return dispatchToolRequest({
|
|
42
43
|
method: 'POST',
|
|
43
44
|
path: disputeClosePath(args.disputeId),
|
|
44
45
|
body: buildCloseBody(args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close.js","sourceRoot":"","sources":["../../../src/tools/dispute/close.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,mEAAmE;AAEnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"close.js","sourceRoot":"","sources":["../../../src/tools/dispute/close.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,gFAAgF;AAChF,mEAAmE;AAEnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACxE,GAAG,EAAE,CAAC;SACH,OAAO,EAAE;SACT,QAAQ,CAAC,qDAAqD,CAAC;IAClE,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,IAAI,CAAC;SACT,QAAQ,CACP,2EAA2E;QACzE,8DAA8D,CACjE;CACJ,CAAA;AAOD,gFAAgF;AAChF,MAAM,UAAU,cAAc,CAC5B,IAAuB;IAEvB,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EACT,qEAAqE;YACrE,sEAAsE;YACtE,wEAAwE;YACxE,8DAA8D;QAChE,WAAW,EAAE,sBAAsB;KACpC,EACD,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QACpB,OAAO,mBAAmB,CACxB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC;YACtC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;SAC3B,EACD,KAAK,CACN,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
// Curated dispute vertical: four typed tools over the matcher dispute resource —
|
|
2
2
|
// list, get, close, submit-evidence — covering the dispute lifecycle surface.
|
|
3
|
-
// Each tool shares the fail-closed relay (shared.ts) and the RFC 9457 →
|
|
3
|
+
// Each tool shares the fail-closed relay (shared-dispatch.ts) and the RFC 9457 →
|
|
4
4
|
// tool-error mapping (toToolError) with the generic surface, so curated and
|
|
5
5
|
// generic map matcher errors identically. No tool carries a tenant field.
|
|
6
|
+
//
|
|
7
|
+
// dispute_get is the one tool that is nothing but a name, a path and a
|
|
8
|
+
// description, so it is declared as a data row; the other three carry bodies or
|
|
9
|
+
// query builders and stay as files. All four sit in ONE ordered list, because
|
|
10
|
+
// that list IS the order `tools/list` publishes.
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { registerCuratedTools } from '../curated-tool.js';
|
|
6
13
|
import { registerDisputeCloseTool } from './close.js';
|
|
7
|
-
import { registerDisputeGetTool } from './get.js';
|
|
8
14
|
import { registerDisputeListTool } from './list.js';
|
|
15
|
+
import { disputePath } from './shared.js';
|
|
9
16
|
import { registerDisputeSubmitEvidenceTool } from './submit-evidence.js';
|
|
17
|
+
/**
|
|
18
|
+
* The family's four tools in published order: list, the id-only read as a data
|
|
19
|
+
* row, close, submit-evidence. Every description string is the hand-tuned LLM
|
|
20
|
+
* guidance a client sees verbatim; the published-surface golden is what proves
|
|
21
|
+
* an edit here did not drop a character, or move a tool.
|
|
22
|
+
*/
|
|
23
|
+
const DISPUTE_TOOLS = [
|
|
24
|
+
registerDisputeListTool,
|
|
25
|
+
{
|
|
26
|
+
name: 'dispute_get',
|
|
27
|
+
description: 'Fetch a single dispute by id (UUID). The dispute must belong to your ' +
|
|
28
|
+
"token's tenant. Returns the dispute, or a structured RFC 9457 error " +
|
|
29
|
+
'(e.g. 404 if it does not exist or is not yours).',
|
|
30
|
+
inputShape: {
|
|
31
|
+
disputeId: z.string().min(1).describe('The dispute id (UUID) to fetch.'),
|
|
32
|
+
},
|
|
33
|
+
request: (args) => ({
|
|
34
|
+
method: 'GET',
|
|
35
|
+
path: disputePath(String(args.disputeId)),
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
registerDisputeCloseTool,
|
|
39
|
+
registerDisputeSubmitEvidenceTool,
|
|
40
|
+
];
|
|
10
41
|
/** Register all four curated dispute tools on the given server. */
|
|
11
42
|
export function registerDisputeTools(server) {
|
|
12
|
-
|
|
13
|
-
registerDisputeGetTool(server);
|
|
14
|
-
registerDisputeCloseTool(server);
|
|
15
|
-
registerDisputeSubmitEvidenceTool(server);
|
|
43
|
+
registerCuratedTools(server, DISPUTE_TOOLS);
|
|
16
44
|
}
|
|
17
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/dispute/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,8EAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/dispute/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,8EAA8E;AAC9E,iFAAiF;AACjF,4EAA4E;AAC5E,0EAA0E;AAC1E,EAAE;AACF,uEAAuE;AACvE,gFAAgF;AAChF,8EAA8E;AAC9E,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,oBAAoB,EAAqB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAA;AAExE;;;;;GAKG;AACH,MAAM,aAAa,GAA4B;IAC7C,uBAAuB;IACvB;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,uEAAuE;YACvE,sEAAsE;YACtE,kDAAkD;QACpD,UAAU,EAAE;YACV,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;SACzE;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAClB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC1C,CAAC;KACH;IACD,wBAAwB;IACxB,iCAAiC;CAClC,CAAA;AAED,mEAAmE;AACnE,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,oBAAoB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -12,7 +12,8 @@ import { z } from 'zod';
|
|
|
12
12
|
import { nextCursor, pageLimit } from '../input-fields.js';
|
|
13
13
|
import { queryHandler } from '../query-handler.js';
|
|
14
14
|
import { optionalQuery } from '../request-fields.js';
|
|
15
|
-
import {
|
|
15
|
+
import { dispatchToolRequest } from '../shared-dispatch.js';
|
|
16
|
+
import { DISPUTES_PATH } from './shared.js';
|
|
16
17
|
/** Lifecycle states a dispute can be filtered by. */
|
|
17
18
|
export const DISPUTE_STATES = [
|
|
18
19
|
'DRAFT',
|
|
@@ -102,6 +103,6 @@ export function registerDisputeListTool(server) {
|
|
|
102
103
|
'paginate by re-calling with the returned nextCursor. No tenant field is ' +
|
|
103
104
|
'accepted; the tenant is derived from your bearer token.',
|
|
104
105
|
inputSchema: listDisputesInputShape,
|
|
105
|
-
}, queryHandler(buildListQuery, () => DISPUTES_PATH,
|
|
106
|
+
}, queryHandler(buildListQuery, () => DISPUTES_PATH, dispatchToolRequest));
|
|
106
107
|
}
|
|
107
108
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/tools/dispute/list.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF;AAChF,6EAA6E;AAC7E,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAE9E,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,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/tools/disp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 @@
|
|
|
1
1
|
// Shared plumbing for the curated dispute tools.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// "build the request") and so curated + generic surfaces map matcher errors
|
|
3
|
+
// This module holds the dispute resource paths and nothing else, factored
|
|
4
|
+
// exactly once so the table row in index.ts and the three tools that keep
|
|
5
|
+
// their own file address the same URLs. The relay itself lives in
|
|
6
|
+
// shared-dispatch.ts, so curated and generic surfaces map matcher errors
|
|
8
7
|
// through the identical path (toToolError).
|
|
9
8
|
//
|
|
10
9
|
// Security: the bearer token is never read here directly — requireMatcherClient
|
|
11
10
|
// owns the request-scoped relay and fails closed when no usable credential was
|
|
12
11
|
// provided. No tenant identifier is ever read or injected (matcher derives
|
|
13
12
|
// tenant from the relayed JWT); no dispute tool input carries one.
|
|
14
|
-
import { dispatchToolRequest, } from '../shared-dispatch.js';
|
|
15
13
|
/** Base path for the dispute resource (tenant-scoped; tenant from the token). */
|
|
16
14
|
export const DISPUTES_PATH = '/v1/disputes';
|
|
17
15
|
/** Build the single-dispute sub-path, URL-encoding the id so reserved chars are safe. */
|
|
@@ -26,15 +24,4 @@ export function disputeClosePath(disputeId) {
|
|
|
26
24
|
export function disputeEvidencePath(disputeId) {
|
|
27
25
|
return `${disputePath(disputeId)}/evidence`;
|
|
28
26
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Run one assembled request through the relay: fail-closed auth, dispatch, and
|
|
31
|
-
* RFC 9457 → tool-error mapping — identical to the generic invoke's dispatch so
|
|
32
|
-
* both surfaces produce the same structured error shape.
|
|
33
|
-
*
|
|
34
|
-
* `clientFor` is injectable for tests; production callers pass nothing and get
|
|
35
|
-
* the request-scoped, fail-closed `requireMatcherClient`.
|
|
36
|
-
*/
|
|
37
|
-
export async function dispatchDispute(request, extra, clientFor) {
|
|
38
|
-
return dispatchToolRequest(request, extra, clientFor);
|
|
39
|
-
}
|
|
40
27
|
//# sourceMappingURL=shared.js.map
|