@servicelabsco/slabs-access-manager 1.0.64 → 1.0.67
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/access/controllers/dashboard.report.controller.js +3 -1
- package/dist/access/controllers/dashboard.report.controller.js.map +1 -1
- package/dist/access/controllers/index.d.ts +2 -0
- package/dist/access/controllers/index.js +2 -0
- package/dist/access/controllers/index.js.map +1 -1
- package/dist/access/controllers/listing.controller.d.ts +19 -0
- package/dist/access/controllers/listing.controller.js +44 -0
- package/dist/access/controllers/listing.controller.js.map +1 -1
- package/dist/access/controllers/mcp.reports.controller.d.ts +18 -0
- package/dist/access/controllers/mcp.reports.controller.js +67 -0
- package/dist/access/controllers/mcp.reports.controller.js.map +1 -0
- package/dist/access/controllers/oauth.as.controller.d.ts +9 -0
- package/dist/access/controllers/overriding.script.controller.js +1 -1
- package/dist/access/controllers/overriding.script.controller.js.map +1 -1
- package/dist/access/controllers/user.business.secret.controller.d.ts +17 -5
- package/dist/access/controllers/user.business.secret.controller.js +62 -14
- package/dist/access/controllers/user.business.secret.controller.js.map +1 -1
- package/dist/access/controllers/whoami.controller.d.ts +22 -0
- package/dist/access/controllers/whoami.controller.js +48 -0
- package/dist/access/controllers/whoami.controller.js.map +1 -0
- package/dist/access/dtos/index.d.ts +1 -0
- package/dist/access/dtos/index.js +1 -0
- package/dist/access/dtos/index.js.map +1 -1
- package/dist/access/dtos/update.user.secret.dto.d.ts +3 -0
- package/dist/access/dtos/update.user.secret.dto.js +24 -0
- package/dist/access/dtos/update.user.secret.dto.js.map +1 -0
- package/dist/access/es6.classes.d.ts +9 -4
- package/dist/access/es6.classes.js +11 -1
- package/dist/access/es6.classes.js.map +1 -1
- package/dist/access/libraries/__snapshots__/index.d.ts +1 -0
- package/dist/access/libraries/__snapshots__/index.js +3 -0
- package/dist/access/libraries/__snapshots__/index.js.map +1 -0
- package/dist/access/libraries/create.user.business.secret.d.ts +7 -1
- package/dist/access/libraries/create.user.business.secret.js +38 -1
- package/dist/access/libraries/create.user.business.secret.js.map +1 -1
- package/dist/access/libraries/index.d.ts +3 -0
- package/dist/access/libraries/index.js +3 -0
- package/dist/access/libraries/index.js.map +1 -1
- package/dist/access/libraries/process.listing.page.query.d.ts +11 -0
- package/dist/access/libraries/process.listing.page.query.js +24 -0
- package/dist/access/libraries/process.listing.page.query.js.map +1 -0
- package/dist/access/libraries/user.secret.view.d.ts +15 -0
- package/dist/access/libraries/user.secret.view.js +26 -0
- package/dist/access/libraries/user.secret.view.js.map +1 -0
- package/dist/access/middlewares/idempotency.middleware.d.ts +5 -0
- package/dist/access/middlewares/idempotency.middleware.js +46 -0
- package/dist/access/middlewares/idempotency.middleware.js.map +1 -0
- package/dist/access/middlewares/index.d.ts +2 -0
- package/dist/access/middlewares/index.js +2 -0
- package/dist/access/middlewares/index.js.map +1 -1
- package/dist/access/middlewares/mcp.access.middleware.js +11 -1
- package/dist/access/middlewares/mcp.access.middleware.js.map +1 -1
- package/dist/access/middlewares/mcp.rate.limit.middleware.d.ts +6 -0
- package/dist/access/middlewares/mcp.rate.limit.middleware.js +50 -0
- package/dist/access/middlewares/mcp.rate.limit.middleware.js.map +1 -0
- package/dist/access/services/access.business.service.d.ts +7 -0
- package/dist/access/services/access.business.service.js +34 -0
- package/dist/access/services/access.business.service.js.map +1 -1
- package/dist/access/services/access.report.service.d.ts +5 -0
- package/dist/access/services/access.report.service.js +19 -0
- package/dist/access/services/access.report.service.js.map +1 -1
- package/dist/access/services/credential.resolve.service.d.ts +1 -0
- package/dist/access/services/credential.resolve.service.js +4 -1
- package/dist/access/services/credential.resolve.service.js.map +1 -1
- package/dist/access/services/listing.service.d.ts +2 -0
- package/dist/access/services/listing.service.js +26 -1
- package/dist/access/services/listing.service.js.map +1 -1
- package/dist/access/services/oauth.as.service.d.ts +9 -0
- package/dist/access/services/oauth.as.service.js +15 -8
- package/dist/access/services/oauth.as.service.js.map +1 -1
- package/dist/app.module.js +4 -0
- package/dist/app.module.js.map +1 -1
- package/dist/mcp/auth/index.d.ts +1 -0
- package/dist/mcp/auth/index.js +1 -0
- package/dist/mcp/auth/index.js.map +1 -1
- package/dist/mcp/auth/mcp.idempotency.store.d.ts +11 -0
- package/dist/mcp/auth/mcp.idempotency.store.js +70 -0
- package/dist/mcp/auth/mcp.idempotency.store.js.map +1 -0
- package/dist/mcp/catalog/assert.valid.catalog.d.ts +7 -0
- package/dist/mcp/catalog/assert.valid.catalog.js +41 -0
- package/dist/mcp/catalog/assert.valid.catalog.js.map +1 -0
- package/dist/mcp/catalog/index.d.ts +2 -0
- package/dist/mcp/catalog/index.js +19 -0
- package/dist/mcp/catalog/index.js.map +1 -0
- package/dist/mcp/catalog/mcp.catalog.gate.d.ts +5 -0
- package/dist/mcp/catalog/mcp.catalog.gate.js +38 -0
- package/dist/mcp/catalog/mcp.catalog.gate.js.map +1 -0
- package/dist/mcp/client/slabs.api.client.js +1 -0
- package/dist/mcp/client/slabs.api.client.js.map +1 -1
- package/dist/mcp/es6.classes.d.ts +3 -3
- package/dist/mcp/es6.classes.js +2 -2
- package/dist/mcp/es6.classes.js.map +1 -1
- package/dist/mcp/http/admin.mcp.controller.js +2 -1
- package/dist/mcp/http/admin.mcp.controller.js.map +1 -1
- package/dist/mcp/http/business.mcp.controller.d.ts +6 -1
- package/dist/mcp/http/business.mcp.controller.js +59 -3
- package/dist/mcp/http/business.mcp.controller.js.map +1 -1
- package/dist/mcp/http/mcp.http.module.js +3 -1
- package/dist/mcp/http/mcp.http.module.js.map +1 -1
- package/dist/mcp/http/prm.controller.d.ts +8 -0
- package/dist/mcp/http/prm.controller.js +13 -0
- package/dist/mcp/http/prm.controller.js.map +1 -1
- package/dist/mcp/http/unauthorized.mcp.response.d.ts +1 -0
- package/dist/mcp/http/unauthorized.mcp.response.js +6 -3
- package/dist/mcp/http/unauthorized.mcp.response.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/interfaces/mcp.tool.interface.d.ts +1 -0
- package/dist/mcp/interfaces/slabs.api.request.interface.d.ts +1 -0
- package/dist/mcp/mcp.constants.d.ts +13 -0
- package/dist/mcp/mcp.constants.js +43 -0
- package/dist/mcp/mcp.constants.js.map +1 -0
- package/dist/mcp/mcp.module.d.ts +9 -0
- package/dist/mcp/mcp.module.js +29 -3
- package/dist/mcp/mcp.module.js.map +1 -1
- package/dist/mcp/tools/ap.tool.registry.d.ts +7 -0
- package/dist/mcp/tools/ap.tool.registry.js +71 -0
- package/dist/mcp/tools/ap.tool.registry.js.map +1 -0
- package/dist/mcp/tools/ar.tool.registry.d.ts +7 -0
- package/dist/mcp/tools/ar.tool.registry.js +71 -0
- package/dist/mcp/tools/ar.tool.registry.js.map +1 -0
- package/dist/mcp/tools/catalog.slugs.d.ts +10 -0
- package/dist/mcp/tools/catalog.slugs.js +17 -0
- package/dist/mcp/tools/catalog.slugs.js.map +1 -0
- package/dist/mcp/tools/delete.listing.preference.tool.d.ts +1 -0
- package/dist/mcp/tools/delete.listing.preference.tool.js +2 -1
- package/dist/mcp/tools/delete.listing.preference.tool.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +9 -1
- package/dist/mcp/tools/index.js +9 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/listing.describe.tool.d.ts +18 -0
- package/dist/mcp/tools/{get.listing.tool.js → listing.describe.tool.js} +8 -8
- package/dist/mcp/tools/listing.describe.tool.js.map +1 -0
- package/dist/mcp/tools/listing.query.tool.d.ts +32 -0
- package/dist/mcp/tools/listing.query.tool.js +36 -0
- package/dist/mcp/tools/listing.query.tool.js.map +1 -0
- package/dist/mcp/tools/listings.list.tool.d.ts +18 -0
- package/dist/mcp/tools/listings.list.tool.js +24 -0
- package/dist/mcp/tools/listings.list.tool.js.map +1 -0
- package/dist/mcp/tools/mcp.tool.d.ts +4 -0
- package/dist/mcp/tools/mcp.tool.js +55 -2
- package/dist/mcp/tools/mcp.tool.js.map +1 -1
- package/dist/mcp/tools/reports.list.tool.d.ts +18 -0
- package/dist/mcp/tools/reports.list.tool.js +25 -0
- package/dist/mcp/tools/reports.list.tool.js.map +1 -0
- package/dist/mcp/tools/reports.run.tool.d.ts +26 -0
- package/dist/mcp/tools/reports.run.tool.js +29 -0
- package/dist/mcp/tools/reports.run.tool.js.map +1 -0
- package/dist/mcp/tools/save.listing.preference.tool.d.ts +2 -0
- package/dist/mcp/tools/save.listing.preference.tool.js +4 -1
- package/dist/mcp/tools/save.listing.preference.tool.js.map +1 -1
- package/dist/mcp/tools/tool.registry.js +20 -2
- package/dist/mcp/tools/tool.registry.js.map +1 -1
- package/dist/mcp/tools/whoami.tool.d.ts +10 -0
- package/dist/mcp/tools/whoami.tool.js +19 -0
- package/dist/mcp/tools/whoami.tool.js.map +1 -0
- package/package.json +1 -1
- package/dist/mcp/tools/get.listing.tool.d.ts +0 -17
- package/dist/mcp/tools/get.listing.tool.js.map +0 -1
|
@@ -6,5 +6,13 @@ export declare class PrmController {
|
|
|
6
6
|
bearer_methods_supported: string[];
|
|
7
7
|
resource_documentation: string;
|
|
8
8
|
};
|
|
9
|
+
protectedResourceMetadataSuffixed(): {
|
|
10
|
+
resource: string;
|
|
11
|
+
authorization_servers: string[];
|
|
12
|
+
scopes_supported: string[];
|
|
13
|
+
bearer_methods_supported: string[];
|
|
14
|
+
resource_documentation: string;
|
|
15
|
+
};
|
|
16
|
+
private document;
|
|
9
17
|
private baseUrl;
|
|
10
18
|
}
|
|
@@ -13,6 +13,12 @@ exports.PrmController = void 0;
|
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
let PrmController = class PrmController {
|
|
15
15
|
protectedResourceMetadata() {
|
|
16
|
+
return this.document();
|
|
17
|
+
}
|
|
18
|
+
protectedResourceMetadataSuffixed() {
|
|
19
|
+
return this.document();
|
|
20
|
+
}
|
|
21
|
+
document() {
|
|
16
22
|
const resource = process.env.MCP_CANONICAL_URI || `${this.baseUrl()}/mcp`;
|
|
17
23
|
const authorizationServer = process.env.MCP_AUTHORIZATION_SERVER || process.env.SERVER_URL || this.baseUrl();
|
|
18
24
|
const scopes = (process.env.MCP_SCOPES_SUPPORTED || 'mcp,reporting:read')
|
|
@@ -39,6 +45,13 @@ __decorate([
|
|
|
39
45
|
__metadata("design:paramtypes", []),
|
|
40
46
|
__metadata("design:returntype", void 0)
|
|
41
47
|
], PrmController.prototype, "protectedResourceMetadata", null);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, common_1.Get)('oauth-protected-resource/mcp'),
|
|
50
|
+
(0, common_1.Header)('Cache-Control', 'public, max-age=3600'),
|
|
51
|
+
__metadata("design:type", Function),
|
|
52
|
+
__metadata("design:paramtypes", []),
|
|
53
|
+
__metadata("design:returntype", void 0)
|
|
54
|
+
], PrmController.prototype, "protectedResourceMetadataSuffixed", null);
|
|
42
55
|
exports.PrmController = PrmController = __decorate([
|
|
43
56
|
(0, common_1.Controller)('.well-known')
|
|
44
57
|
], PrmController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prm.controller.js","sourceRoot":"","sources":["../../../src/mcp/http/prm.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyD;
|
|
1
|
+
{"version":3,"file":"prm.controller.js","sourceRoot":"","sources":["../../../src/mcp/http/prm.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyD;AAUlD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGtB,yBAAyB;QACrB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAID,iCAAiC;QAC7B,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAEO,QAAQ;QACZ,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;QAC1E,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7G,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,oBAAoB,CAAC;aACpE,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,OAAO,CAAC,CAAC;QAErB,OAAO;YACH,QAAQ;YACR,qBAAqB,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAChE,gBAAgB,EAAE,MAAM;YACxB,wBAAwB,EAAE,CAAC,QAAQ,CAAC;YACpC,sBAAsB,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,oCAAoC;SACzG,CAAC;IACN,CAAC;IAEO,OAAO;QACX,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,oBAAoB,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjH,CAAC;CACJ,CAAA;AAjCY,sCAAa;AAGtB;IAFC,IAAA,YAAG,EAAC,0BAA0B,CAAC;IAC/B,IAAA,eAAM,EAAC,eAAe,EAAE,sBAAsB,CAAC;;;;8DAG/C;AAID;IAFC,IAAA,YAAG,EAAC,8BAA8B,CAAC;IACnC,IAAA,eAAM,EAAC,eAAe,EAAE,sBAAsB,CAAC;;;;sEAG/C;wBAXQ,aAAa;IADzB,IAAA,mBAAU,EAAC,aAAa,CAAC;GACb,aAAa,CAiCzB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
2
|
export declare class UnauthorizedMcpResponse {
|
|
3
3
|
static error(res: Response, status: number, code: number, message: string): void;
|
|
4
|
+
static resourceMetadataUrl(): string;
|
|
4
5
|
static challenge(): string;
|
|
5
6
|
static unauthorized(res: Response, message: string): void;
|
|
6
7
|
static internal(res: Response, message: string): void;
|
|
@@ -13,11 +13,14 @@ class UnauthorizedMcpResponse {
|
|
|
13
13
|
id: null,
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
static
|
|
16
|
+
static resourceMetadataUrl() {
|
|
17
17
|
const resource = process.env.MCP_CANONICAL_URI || `${(process.env.SERVER_URL || 'http://127.0.0.1:4000').replace(/\/+$/, '')}/mcp`;
|
|
18
|
-
const
|
|
18
|
+
const origin = resource.replace(/\/mcp\/?$/, '');
|
|
19
|
+
return `${origin}/.well-known/oauth-protected-resource/mcp`;
|
|
20
|
+
}
|
|
21
|
+
static challenge() {
|
|
19
22
|
const scope = process.env.MCP_SCOPES_SUPPORTED?.split(',')[0]?.trim() || 'mcp';
|
|
20
|
-
return `Bearer resource_metadata="${
|
|
23
|
+
return `Bearer resource_metadata="${UnauthorizedMcpResponse.resourceMetadataUrl()}", scope="${scope}"`;
|
|
21
24
|
}
|
|
22
25
|
static unauthorized(res, message) {
|
|
23
26
|
if (!res.headersSent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unauthorized.mcp.response.js","sourceRoot":"","sources":["../../../src/mcp/http/unauthorized.mcp.response.ts"],"names":[],"mappings":";;;AAGA,MAAM,oBAAoB,GAAG,CAAC,KAAK,CAAC;AAGpC,MAAM,sBAAsB,GAAG,CAAC,KAAK,CAAC;AAKtC,MAAa,uBAAuB;IAKhC,MAAM,CAAC,KAAK,CAAC,GAAa,EAAE,MAAc,EAAE,IAAY,EAAE,OAAe;QACrE,IAAI,GAAG,CAAC,WAAW;YAAE,OAAO;QAE5B,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;YACpB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YACxB,EAAE,EAAE,IAAI;SACX,CAAC,CAAC;IAC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AAS,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,SAAS,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAKD,MAAM,CAAC,QAAQ,CAAC,GAAa,EAAE,OAAe;QAC1C,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;CACJ;AAjDD,0DAiDC"}
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './admin';
|
|
2
2
|
export * from './auth';
|
|
3
|
+
export * from './catalog';
|
|
3
4
|
export * from './client';
|
|
4
5
|
export * from './http';
|
|
5
6
|
export * from './interfaces';
|
|
6
7
|
export * from './tools';
|
|
8
|
+
export * from './mcp.constants';
|
|
7
9
|
export * from './mcp.module';
|
|
8
10
|
export * from './slabs.mcp.server';
|
package/dist/mcp/index.js
CHANGED
|
@@ -16,10 +16,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./admin"), exports);
|
|
18
18
|
__exportStar(require("./auth"), exports);
|
|
19
|
+
__exportStar(require("./catalog"), exports);
|
|
19
20
|
__exportStar(require("./client"), exports);
|
|
20
21
|
__exportStar(require("./http"), exports);
|
|
21
22
|
__exportStar(require("./interfaces"), exports);
|
|
22
23
|
__exportStar(require("./tools"), exports);
|
|
24
|
+
__exportStar(require("./mcp.constants"), exports);
|
|
23
25
|
__exportStar(require("./mcp.module"), exports);
|
|
24
26
|
__exportStar(require("./slabs.mcp.server"), exports);
|
|
25
27
|
//# sourceMappingURL=index.js.map
|
package/dist/mcp/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AAAA,yCAAuB;AAAA,2CAAyB;AAAA,yCAAuB;AAAA,+CAA6B;AAAA,0CAAwB;AAAA,+CAA6B;AAAA,qDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AAAA,yCAAuB;AAAA,4CAA0B;AAAA,2CAAyB;AAAA,yCAAuB;AAAA,+CAA6B;AAAA,0CAAwB;AAAA,kDAAgC;AAAA,+CAA6B;AAAA,qDAAkC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SlabsApiClient } from './client/slabs.api.client';
|
|
2
|
+
import { McpToolInterface } from './interfaces/mcp.tool.interface';
|
|
3
|
+
export declare const MCP_TOOL_REGISTRIES = "MCP_TOOL_REGISTRIES";
|
|
4
|
+
export type McpToolRegistryFactory = (client: SlabsApiClient) => McpToolInterface[];
|
|
5
|
+
export interface McpModuleOptions {
|
|
6
|
+
registries?: McpToolRegistryFactory[];
|
|
7
|
+
}
|
|
8
|
+
export declare function getMcpServerName(): string;
|
|
9
|
+
export declare function mcpToolNameMax(serverName?: string): number;
|
|
10
|
+
export declare function getHostMcpRegistries(): McpToolRegistryFactory[];
|
|
11
|
+
export declare function setHostMcpRegistries(factories: McpToolRegistryFactory[]): void;
|
|
12
|
+
export declare function provisionMcpServer(options?: McpModuleOptions): void;
|
|
13
|
+
export declare function assertPublicMcpBootConfig(): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCP_TOOL_REGISTRIES = void 0;
|
|
4
|
+
exports.getMcpServerName = getMcpServerName;
|
|
5
|
+
exports.mcpToolNameMax = mcpToolNameMax;
|
|
6
|
+
exports.getHostMcpRegistries = getHostMcpRegistries;
|
|
7
|
+
exports.setHostMcpRegistries = setHostMcpRegistries;
|
|
8
|
+
exports.provisionMcpServer = provisionMcpServer;
|
|
9
|
+
exports.assertPublicMcpBootConfig = assertPublicMcpBootConfig;
|
|
10
|
+
exports.MCP_TOOL_REGISTRIES = 'MCP_TOOL_REGISTRIES';
|
|
11
|
+
const SERVER_NAME = /^[a-z0-9][a-z0-9-]{0,23}$/;
|
|
12
|
+
const DEFAULT_SERVER_NAME = 'slabs-access-manager';
|
|
13
|
+
const hostRegistries = [];
|
|
14
|
+
function assertServerName(name) {
|
|
15
|
+
if (!SERVER_NAME.test(name)) {
|
|
16
|
+
throw new Error(`MCP_SERVER_NAME '${name}' is invalid (use lowercase alphanumeric + hyphen, max 24 chars, e.g. fn-expense).`);
|
|
17
|
+
}
|
|
18
|
+
return name;
|
|
19
|
+
}
|
|
20
|
+
function getMcpServerName() {
|
|
21
|
+
return assertServerName(process.env.MCP_SERVER_NAME?.trim() || DEFAULT_SERVER_NAME);
|
|
22
|
+
}
|
|
23
|
+
function mcpToolNameMax(serverName = getMcpServerName()) {
|
|
24
|
+
const prefixLen = `mcp__${serverName}__`.length;
|
|
25
|
+
return Math.max(1, 64 - prefixLen);
|
|
26
|
+
}
|
|
27
|
+
function getHostMcpRegistries() {
|
|
28
|
+
return hostRegistries;
|
|
29
|
+
}
|
|
30
|
+
function setHostMcpRegistries(factories) {
|
|
31
|
+
hostRegistries.splice(0, hostRegistries.length, ...(factories || []));
|
|
32
|
+
}
|
|
33
|
+
function provisionMcpServer(options = {}) {
|
|
34
|
+
setHostMcpRegistries(options.registries ?? []);
|
|
35
|
+
}
|
|
36
|
+
function assertPublicMcpBootConfig() {
|
|
37
|
+
const canonical = process.env.MCP_CANONICAL_URI?.trim();
|
|
38
|
+
const name = process.env.MCP_SERVER_NAME?.trim();
|
|
39
|
+
if (canonical && !name) {
|
|
40
|
+
throw new Error('MCP_CANONICAL_URI is set but MCP_SERVER_NAME is missing. Public connector hosts must set MCP_SERVER_NAME (e.g. fn-expense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AAE;IAC7D,oBAAoB,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC;AAMD,SAAgB,yBAAyB;IACrC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC;IACxD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC;IACjD,IAAI,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACX,6HAA6H,CAChI,CAAC;IACN,CAAC;AACL,CAAC"}
|
package/dist/mcp/mcp.module.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { McpModuleOptions } from './mcp.constants';
|
|
1
3
|
export declare class McpModule {
|
|
4
|
+
static forRoot(options?: McpModuleOptions): DynamicModule;
|
|
2
5
|
}
|
|
6
|
+
export { assertValidCatalog } from './catalog/assert.valid.catalog';
|
|
7
|
+
export { assertPublicMcpBootConfig, MCP_TOOL_REGISTRIES, getHostMcpRegistries, getMcpServerName, mcpToolNameMax, provisionMcpServer, setHostMcpRegistries } from './mcp.constants';
|
|
8
|
+
export type { McpModuleOptions, McpToolRegistryFactory } from './mcp.constants';
|
|
9
|
+
export { ApToolRegistry } from './tools/ap.tool.registry';
|
|
10
|
+
export { ArToolRegistry } from './tools/ar.tool.registry';
|
|
11
|
+
export { ToolRegistry } from './tools/tool.registry';
|
package/dist/mcp/mcp.module.js
CHANGED
|
@@ -5,18 +5,44 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var McpModule_1;
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.McpModule = void 0;
|
|
10
|
+
exports.ToolRegistry = exports.ArToolRegistry = exports.ApToolRegistry = exports.setHostMcpRegistries = exports.provisionMcpServer = exports.mcpToolNameMax = exports.getMcpServerName = exports.getHostMcpRegistries = exports.MCP_TOOL_REGISTRIES = exports.assertPublicMcpBootConfig = exports.assertValidCatalog = exports.McpModule = void 0;
|
|
10
11
|
const common_1 = require("@nestjs/common");
|
|
11
12
|
const development_module_1 = require("../development/development.module");
|
|
12
13
|
const mcp_http_module_1 = require("./http/mcp.http.module");
|
|
13
|
-
|
|
14
|
+
const mcp_constants_1 = require("./mcp.constants");
|
|
15
|
+
let McpModule = McpModule_1 = class McpModule {
|
|
16
|
+
static forRoot(options = {}) {
|
|
17
|
+
(0, mcp_constants_1.provisionMcpServer)(options);
|
|
18
|
+
return {
|
|
19
|
+
module: McpModule_1,
|
|
20
|
+
imports: [mcp_http_module_1.McpHttpModule, development_module_1.DevelopmentModule],
|
|
21
|
+
exports: [mcp_http_module_1.McpHttpModule, development_module_1.DevelopmentModule],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
14
24
|
};
|
|
15
25
|
exports.McpModule = McpModule;
|
|
16
|
-
exports.McpModule = McpModule = __decorate([
|
|
26
|
+
exports.McpModule = McpModule = McpModule_1 = __decorate([
|
|
17
27
|
(0, common_1.Module)({
|
|
18
28
|
imports: [mcp_http_module_1.McpHttpModule, development_module_1.DevelopmentModule],
|
|
19
29
|
exports: [mcp_http_module_1.McpHttpModule, development_module_1.DevelopmentModule],
|
|
20
30
|
})
|
|
21
31
|
], McpModule);
|
|
32
|
+
var assert_valid_catalog_1 = require("./catalog/assert.valid.catalog");
|
|
33
|
+
Object.defineProperty(exports, "assertValidCatalog", { enumerable: true, get: function () { return assert_valid_catalog_1.assertValidCatalog; } });
|
|
34
|
+
var mcp_constants_2 = require("./mcp.constants");
|
|
35
|
+
Object.defineProperty(exports, "assertPublicMcpBootConfig", { enumerable: true, get: function () { return mcp_constants_2.assertPublicMcpBootConfig; } });
|
|
36
|
+
Object.defineProperty(exports, "MCP_TOOL_REGISTRIES", { enumerable: true, get: function () { return mcp_constants_2.MCP_TOOL_REGISTRIES; } });
|
|
37
|
+
Object.defineProperty(exports, "getHostMcpRegistries", { enumerable: true, get: function () { return mcp_constants_2.getHostMcpRegistries; } });
|
|
38
|
+
Object.defineProperty(exports, "getMcpServerName", { enumerable: true, get: function () { return mcp_constants_2.getMcpServerName; } });
|
|
39
|
+
Object.defineProperty(exports, "mcpToolNameMax", { enumerable: true, get: function () { return mcp_constants_2.mcpToolNameMax; } });
|
|
40
|
+
Object.defineProperty(exports, "provisionMcpServer", { enumerable: true, get: function () { return mcp_constants_2.provisionMcpServer; } });
|
|
41
|
+
Object.defineProperty(exports, "setHostMcpRegistries", { enumerable: true, get: function () { return mcp_constants_2.setHostMcpRegistries; } });
|
|
42
|
+
var ap_tool_registry_1 = require("./tools/ap.tool.registry");
|
|
43
|
+
Object.defineProperty(exports, "ApToolRegistry", { enumerable: true, get: function () { return ap_tool_registry_1.ApToolRegistry; } });
|
|
44
|
+
var ar_tool_registry_1 = require("./tools/ar.tool.registry");
|
|
45
|
+
Object.defineProperty(exports, "ArToolRegistry", { enumerable: true, get: function () { return ar_tool_registry_1.ArToolRegistry; } });
|
|
46
|
+
var tool_registry_1 = require("./tools/tool.registry");
|
|
47
|
+
Object.defineProperty(exports, "ToolRegistry", { enumerable: true, get: function () { return tool_registry_1.ToolRegistry; } });
|
|
22
48
|
//# sourceMappingURL=mcp.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.module.js","sourceRoot":"","sources":["../../src/mcp/mcp.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.module.js","sourceRoot":"","sources":["../../src/mcp/mcp.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,0EAAsE;AACtE,4DAAuD;AACvD,mDAAuE;AA0BhE,IAAM,SAAS,iBAAf,MAAM,SAAS;IAClB,MAAM,CAAC,OAAO,CAAC,UAA4B,EAAE;QACzC,IAAA,kCAAkB,EAAC,OAAO,CAAC,CAAC;QAC5B,OAAO;YACH,MAAM,EAAE,WAAS;YACjB,OAAO,EAAE,CAAC,+BAAa,EAAE,sCAAiB,CAAC;YAC3C,OAAO,EAAE,CAAC,+BAAa,EAAE,sCAAiB,CAAC;SAC9C,CAAC;IACN,CAAC;CACJ,CAAA;AATY,8BAAS;oBAAT,SAAS;IAJrB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE,CAAC,+BAAa,EAAE,sCAAiB,CAAC;QAC3C,OAAO,EAAE,CAAC,+BAAa,EAAE,sCAAiB,CAAC;KAC9C,CAAC;GACW,SAAS,CASrB;AAED,uEAAoE;AAA3D,0HAAA,kBAAkB,OAAA;AAC3B,iDAAmL;AAA1K,0HAAA,yBAAyB,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AAAE,qHAAA,oBAAoB,OAAA;AAAE,iHAAA,gBAAgB,OAAA;AAAE,+GAAA,cAAc,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AAAE,qHAAA,oBAAoB,OAAA;AAEzJ,6DAA0D;AAAjD,kHAAA,cAAc,OAAA;AACvB,6DAA0D;AAAjD,kHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SlabsApiClient } from '../client/slabs.api.client';
|
|
2
|
+
import { McpToolInterface } from '../interfaces/mcp.tool.interface';
|
|
3
|
+
export declare class ApToolRegistry {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: SlabsApiClient);
|
|
6
|
+
tools(): McpToolInterface[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApToolRegistry = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const catalog_slugs_1 = require("./catalog.slugs");
|
|
6
|
+
const mcp_tool_1 = require("./mcp.tool");
|
|
7
|
+
const listSchema = {
|
|
8
|
+
search: zod_1.z.string().optional().describe('Free-text search.'),
|
|
9
|
+
filter_query: zod_1.z.string().optional().describe('Standard listing filter_query.'),
|
|
10
|
+
limit: zod_1.z.number().int().min(1).max(500).optional().describe('Page size (default 50).'),
|
|
11
|
+
offset: zod_1.z.number().int().min(0).optional().describe('Rows to skip (default 0).'),
|
|
12
|
+
date: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Portal date filter.'),
|
|
13
|
+
};
|
|
14
|
+
const getSchema = {
|
|
15
|
+
id: zod_1.z.number().int().positive().describe('Row id to fetch.'),
|
|
16
|
+
};
|
|
17
|
+
class ListingListProxyTool extends mcp_tool_1.McpTool {
|
|
18
|
+
constructor(client, name, title, description, slugFn) {
|
|
19
|
+
super(client);
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.title = title;
|
|
22
|
+
this.description = description;
|
|
23
|
+
this.slugFn = slugFn;
|
|
24
|
+
this.readOnly = true;
|
|
25
|
+
this.requiredScopes = ['reporting:read'];
|
|
26
|
+
this.inputSchema = listSchema;
|
|
27
|
+
}
|
|
28
|
+
execute(args) {
|
|
29
|
+
return this.run(() => this.client.request({
|
|
30
|
+
method: 'POST',
|
|
31
|
+
path: `v1/b/listing-page/${encodeURIComponent(this.slugFn())}/query`,
|
|
32
|
+
body: args,
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class ListingGetProxyTool extends mcp_tool_1.McpTool {
|
|
37
|
+
constructor(client, name, title, description, slugFn) {
|
|
38
|
+
super(client);
|
|
39
|
+
this.name = name;
|
|
40
|
+
this.title = title;
|
|
41
|
+
this.description = description;
|
|
42
|
+
this.slugFn = slugFn;
|
|
43
|
+
this.readOnly = true;
|
|
44
|
+
this.requiredScopes = ['reporting:read'];
|
|
45
|
+
this.inputSchema = getSchema;
|
|
46
|
+
}
|
|
47
|
+
execute(args) {
|
|
48
|
+
return this.run(() => this.client.request({
|
|
49
|
+
method: 'POST',
|
|
50
|
+
path: `v1/b/listing-page/${encodeURIComponent(this.slugFn())}/query`,
|
|
51
|
+
body: { filter_query: `id = ${args.id}`, limit: 1, offset: 0 },
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class ApToolRegistry {
|
|
56
|
+
constructor(client) {
|
|
57
|
+
this.client = client;
|
|
58
|
+
}
|
|
59
|
+
tools() {
|
|
60
|
+
return [
|
|
61
|
+
new ListingListProxyTool(this.client, 'expenses_list', 'List expenses', 'List expenses for the connected business. Use for "what is pending my approval" on AP spend. Line tax math on expenses_get is governed by is_rate_exclusive. Returns { rows, total, limit, offset }.', catalog_slugs_1.CatalogSlugs.expenses),
|
|
62
|
+
new ListingGetProxyTool(this.client, 'expenses_get', 'Get expense', 'Fetch one expense by id, including line items. is_rate_exclusive governs line tax math. Preferred vendor is a detail field, not a party.', catalog_slugs_1.CatalogSlugs.expenses),
|
|
63
|
+
new ListingListProxyTool(this.client, 'advances_list', 'List advances', 'List employee advances. Each row exposes four distinct balance figures: outstanding_balance, settlement_balance, attachable_amount (bounded by confirmed payments, NOT the settlement headline), and pending_confirmation. Do not conflate them.', catalog_slugs_1.CatalogSlugs.advances),
|
|
64
|
+
new ListingGetProxyTool(this.client, 'advances_get', 'Get advance', 'Fetch one advance by id. Returns outstanding_balance, settlement_balance, attachable_amount (bounded by confirmed payments, not the settlement headline), and pending_confirmation as distinct fields.', catalog_slugs_1.CatalogSlugs.advances),
|
|
65
|
+
new ListingListProxyTool(this.client, 'purchase_requests_list', 'List purchase requests', 'List purchase requests. Two independent status scales: party_status (approval: On Hold/Rejected/Submitted/Approved) and lifecycle_status (Raised…Completed, 3070–3076). Both are filterable and returned. TO = billing business, FROM = requesting employee; preferred vendor is a detail field, not a party.', catalog_slugs_1.CatalogSlugs.purchaseRequests),
|
|
66
|
+
new ListingGetProxyTool(this.client, 'purchase_requests_get', 'Get purchase request', 'Fetch one purchase request by id with line items. party_status and lifecycle_status are independent. is_rate_exclusive governs line tax math. TO = billing business, FROM = requesting employee.', catalog_slugs_1.CatalogSlugs.purchaseRequests),
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.ApToolRegistry = ApToolRegistry;
|
|
71
|
+
//# sourceMappingURL=ap.tool.registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ap.tool.registry.js","sourceRoot":"","sources":["../../../src/mcp/tools/ap.tool.registry.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAIxB,mDAA+C;AAC/C,yCAAqC;AAErC,MAAM,UAAU,GAAG;IACf,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC3D,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC9E,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACtF,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAChF,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;CACrF,CAAC;AAEF,MAAM,SAAS,GAAG;IACd,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC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AC;YAChB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ;YACpE,IAAI,EAAE,EAAE,YAAY,EAAE,QAAQ,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;SACjE,CAAC,CACL,CAAC;IACN,CAAC;CACJ;AAMD,MAAa,cAAc;IACvB,YAA6B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAEvD,KAAK;QACD,OAAO;YACH,IAAI,oBAAoB,CACpB,IAAI,CAAC,MAAM,EACX,eAAe,EACf,eAAe,EACf,sMAAsM,EACtM,4BAAY,CAAC,QAAQ,CACxB;YACD,IAAI,mBAAmB,CACnB,IAAI,CAAC,MAAM,EACX,cAAc,EACd,aAAa,EACb,0IAA0I,EAC1I,4BAAY,CAAC,QAAQ,CACxB;YACD,IAAI,oBAAoB,CACpB,IAAI,CAAC,MAAM,EACX,eAAe,EACf,eAAe,EACf,kPAAkP,EAClP,4BAAY,CAAC,QAAQ,CACxB;YACD,IAAI,mBAAmB,CACnB,IAAI,CAAC,MAAM,EACX,cAAc,EACd,aAAa,EACb,wMAAwM,EACxM,4BAAY,CAAC,QAAQ,CACxB;YACD,IAAI,oBAAoB,CACpB,IAAI,CAAC,MAAM,EACX,wBAAwB,EACxB,wBAAwB,EACxB,+SAA+S,EAC/S,4BAAY,CAAC,gBAAgB,CAChC;YACD,IAAI,mBAAmB,CACnB,IAAI,CAAC,MAAM,EACX,uBAAuB,EACvB,sBAAsB,EACtB,kMAAkM,EAClM,4BAAY,CAAC,gBAAgB,CAChC;SACJ,CAAC;IACN,CAAC;CACJ;AAjDD,wCAiDC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SlabsApiClient } from '../client/slabs.api.client';
|
|
2
|
+
import { McpToolInterface } from '../interfaces/mcp.tool.interface';
|
|
3
|
+
export declare class ArToolRegistry {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: SlabsApiClient);
|
|
6
|
+
tools(): McpToolInterface[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArToolRegistry = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const catalog_slugs_1 = require("./catalog.slugs");
|
|
6
|
+
const mcp_tool_1 = require("./mcp.tool");
|
|
7
|
+
const periodSchema = {
|
|
8
|
+
date: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Portal date filter for the same period as the dashboard.'),
|
|
9
|
+
start_time: zod_1.z.string().optional(),
|
|
10
|
+
end_time: zod_1.z.string().optional(),
|
|
11
|
+
};
|
|
12
|
+
const listSchema = {
|
|
13
|
+
search: zod_1.z.string().optional(),
|
|
14
|
+
filter_query: zod_1.z.string().optional().describe('Filter by reconciliation state / gateway / channel / settlement dates / ageing / customer.'),
|
|
15
|
+
limit: zod_1.z.number().int().min(1).max(500).optional(),
|
|
16
|
+
offset: zod_1.z.number().int().min(0).optional(),
|
|
17
|
+
date: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
18
|
+
};
|
|
19
|
+
class ReportRunProxyTool extends mcp_tool_1.McpTool {
|
|
20
|
+
constructor(client, name, title, description, slugFn) {
|
|
21
|
+
super(client);
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.title = title;
|
|
24
|
+
this.description = description;
|
|
25
|
+
this.slugFn = slugFn;
|
|
26
|
+
this.readOnly = true;
|
|
27
|
+
this.requiredScopes = ['reporting:read'];
|
|
28
|
+
this.inputSchema = periodSchema;
|
|
29
|
+
}
|
|
30
|
+
execute(args) {
|
|
31
|
+
return this.run(() => this.client.request({
|
|
32
|
+
method: 'POST',
|
|
33
|
+
path: `v1/b/reports/${encodeURIComponent(this.slugFn())}/run`,
|
|
34
|
+
body: args,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
class ListingListProxyTool extends mcp_tool_1.McpTool {
|
|
39
|
+
constructor(client, name, title, description, slugFn) {
|
|
40
|
+
super(client);
|
|
41
|
+
this.name = name;
|
|
42
|
+
this.title = title;
|
|
43
|
+
this.description = description;
|
|
44
|
+
this.slugFn = slugFn;
|
|
45
|
+
this.readOnly = true;
|
|
46
|
+
this.requiredScopes = ['reporting:read'];
|
|
47
|
+
this.inputSchema = listSchema;
|
|
48
|
+
}
|
|
49
|
+
execute(args) {
|
|
50
|
+
return this.run(() => this.client.request({
|
|
51
|
+
method: 'POST',
|
|
52
|
+
path: `v1/b/listing-page/${encodeURIComponent(this.slugFn())}/query`,
|
|
53
|
+
body: args,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
class ArToolRegistry {
|
|
58
|
+
constructor(client) {
|
|
59
|
+
this.client = client;
|
|
60
|
+
}
|
|
61
|
+
tools() {
|
|
62
|
+
return [
|
|
63
|
+
new ReportRunProxyTool(this.client, 'ar_dashboard_summary', 'AR dashboard summary', 'AR Portal (RECO) reconciliation summary for a period: total transactions; reconciled/excess/deficit/unknown payments (three-way OMS vs PG vs settlement); reconciled orders; refunds pending/processed; cash in transit. Not ARC collections.', catalog_slugs_1.CatalogSlugs.arDashboard),
|
|
64
|
+
new ListingListProxyTool(this.client, 'ar_transactions_list', 'AR transactions', 'Row-level AR (RECO) transactions by reconciliation state / gateway / channel / settlement dates, including MDR/prepaid charges where available. This is AR Portal data, not ARC receivables.', catalog_slugs_1.CatalogSlugs.arTransactions),
|
|
65
|
+
new ReportRunProxyTool(this.client, 'arc_collections_overview', 'ARC collections overview', 'ARC collections overview: receivables by invoice status, ageing buckets, DSO, promise-to-pay, period totals. This is ARC, not AR Portal reconciliation.', catalog_slugs_1.CatalogSlugs.arcCollections),
|
|
66
|
+
new ListingListProxyTool(this.client, 'arc_receivables_list', 'ARC receivables', 'Open ARC invoices by customer, ageing bucket, and due dates. Product/tenancy scoped to the caller. Not AR Portal RECO transactions.', catalog_slugs_1.CatalogSlugs.arcReceivables),
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.ArToolRegistry = ArToolRegistry;
|
|
71
|
+
//# sourceMappingURL=ar.tool.registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ar.tool.registry.js","sourceRoot":"","sources":["../../../src/mcp/tools/ar.tool.registry.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAIxB,mDAA+C;AAC/C,yCAAqC;AAErC,MAAM,YAAY,GAAG;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;IACvH,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;AAEF,MAAM,UAAU,GAAG;IACf,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4FAA4F,CAAC;IAC1I,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAClD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC1C,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,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AI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ;YACpE,IAAI,EAAE,IAAI;SACb,CAAC,CACL,CAAC;IACN,CAAC;CACJ;AAKD,MAAa,cAAc;IACvB,YAA6B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAEvD,KAAK;QACD,OAAO;YACH,IAAI,kBAAkB,CAClB,IAAI,CAAC,MAAM,EACX,sBAAsB,EACtB,sBAAsB,EACtB,+OAA+O,EAC/O,4BAAY,CAAC,WAAW,CAC3B;YACD,IAAI,oBAAoB,CACpB,IAAI,CAAC,MAAM,EACX,sBAAsB,EACtB,iBAAiB,EACjB,8LAA8L,EAC9L,4BAAY,CAAC,cAAc,CAC9B;YACD,IAAI,kBAAkB,CAClB,IAAI,CAAC,MAAM,EACX,0BAA0B,EAC1B,0BAA0B,EAC1B,yJAAyJ,EACzJ,4BAAY,CAAC,cAAc,CAC9B;YACD,IAAI,oBAAoB,CACpB,IAAI,CAAC,MAAM,EACX,sBAAsB,EACtB,iBAAiB,EACjB,qIAAqI,EACrI,4BAAY,CAAC,cAAc,CAC9B;SACJ,CAAC;IACN,CAAC;CACJ;AAnCD,wCAmCC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function catalogSlug(envKey: string, fallback: string): string;
|
|
2
|
+
export declare const CatalogSlugs: {
|
|
3
|
+
expenses: () => string;
|
|
4
|
+
advances: () => string;
|
|
5
|
+
purchaseRequests: () => string;
|
|
6
|
+
arDashboard: () => string;
|
|
7
|
+
arTransactions: () => string;
|
|
8
|
+
arcCollections: () => string;
|
|
9
|
+
arcReceivables: () => string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CatalogSlugs = void 0;
|
|
4
|
+
exports.catalogSlug = catalogSlug;
|
|
5
|
+
function catalogSlug(envKey, fallback) {
|
|
6
|
+
return (process.env[envKey] || fallback).trim();
|
|
7
|
+
}
|
|
8
|
+
exports.CatalogSlugs = {
|
|
9
|
+
expenses: () => catalogSlug('MCP_SLUG_EXPENSES', 'expenses'),
|
|
10
|
+
advances: () => catalogSlug('MCP_SLUG_ADVANCES', 'advances'),
|
|
11
|
+
purchaseRequests: () => catalogSlug('MCP_SLUG_PURCHASE_REQUESTS', 'purchase_requests'),
|
|
12
|
+
arDashboard: () => catalogSlug('MCP_SLUG_AR_DASHBOARD', 'ar.reconciled.payments.dashbaord.summary'),
|
|
13
|
+
arTransactions: () => catalogSlug('MCP_SLUG_AR_TRANSACTIONS', 'ar.transactions'),
|
|
14
|
+
arcCollections: () => catalogSlug('MCP_SLUG_ARC_COLLECTIONS', 'arc.collections.overview'),
|
|
15
|
+
arcReceivables: () => catalogSlug('MCP_SLUG_ARC_RECEIVABLES', 'arc.receivables'),
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=catalog.slugs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.slugs.js","sourceRoot":"","sources":["../../../src/mcp/tools/catalog.slugs.ts"],"names":[],"mappings":";;;AACA,kCAEC;AAFD,SAAgB,WAAW,CAAC,MAAc,EAAE,QAAgB;IACxD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;AACpD,CAAC;AAEY,QAAA,YAAY,GAAG;IACxB,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,mBAAmB,EAAE,UAAU,CAAC;IAC5D,QAAQ,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,mBAAmB,EAAE,UAAU,CAAC;IAC5D,gBAAgB,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,4BAA4B,EAAE,mBAAmB,CAAC;IACtF,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,uBAAuB,EAAE,0CAA0C,CAAC;IACnG,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,0BAA0B,EAAE,iBAAiB,CAAC;IAChF,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IACzF,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,0BAA0B,EAAE,iBAAiB,CAAC;CACnF,CAAC"}
|
|
@@ -13,6 +13,7 @@ export declare class DeleteListingPreferenceTool extends McpTool<DeleteListingPr
|
|
|
13
13
|
slug: z.ZodString;
|
|
14
14
|
id: z.ZodNumber;
|
|
15
15
|
};
|
|
16
|
+
readonly requiredScopes: string[];
|
|
16
17
|
protected readonly destructive = true;
|
|
17
18
|
execute(args: DeleteListingPreferenceInput): Promise<McpToolResultInterface>;
|
|
18
19
|
}
|
|
@@ -13,8 +13,9 @@ class DeleteListingPreferenceTool extends mcp_tool_1.McpTool {
|
|
|
13
13
|
this.name = 'delete_listing_preference';
|
|
14
14
|
this.title = 'Delete listing preference';
|
|
15
15
|
this.description = 'Soft-delete a listing preference by id. Only a preference owned by the calling API user can be deleted; ' +
|
|
16
|
-
"attempting to delete another owner's preference returns an access error.";
|
|
16
|
+
"attempting to delete another owner's preference returns an access error. Requires confirm: true. Requires the mcp scope.";
|
|
17
17
|
this.inputSchema = inputSchema;
|
|
18
|
+
this.requiredScopes = ['mcp'];
|
|
18
19
|
this.destructive = true;
|
|
19
20
|
}
|
|
20
21
|
execute(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.listing.preference.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/delete.listing.preference.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACzF,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;CAC9E,CAAC;AAQF,MAAa,2BAA4B,SAAQ,kBAAqC;IAAtF;;QACa,SAAI,GAAG,2BAA2B,CAAC;QACnC,UAAK,GAAG,2BAA2B,CAAC;QACpC,gBAAW,GAChB,0GAA0G;YAC1G,
|
|
1
|
+
{"version":3,"file":"delete.listing.preference.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/delete.listing.preference.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACzF,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;CAC9E,CAAC;AAQF,MAAa,2BAA4B,SAAQ,kBAAqC;IAAtF;;QACa,SAAI,GAAG,2BAA2B,CAAC;QACnC,UAAK,GAAG,2BAA2B,CAAC;QACpC,gBAAW,GAChB,0GAA0G;YAC1G,0HAA0H,CAAC;QACtH,gBAAW,GAAG,WAAW,CAAC;QAC1B,mBAAc,GAAG,CAAC,KAAK,CAAC,CAAC;QACf,gBAAW,GAAG,IAAI,CAAC;IAU1C,CAAC;IARG,OAAO,CAAC,IAAkC;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAChB,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;SACxE,CAAC,CACL,CAAC;IACN,CAAC;CACJ;AAlBD,kEAkBC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
export * from './ap.tool.registry';
|
|
2
|
+
export * from './ar.tool.registry';
|
|
3
|
+
export * from './catalog.slugs';
|
|
1
4
|
export * from './delete.listing.preference.tool';
|
|
2
|
-
export * from './
|
|
5
|
+
export * from './listing.describe.tool';
|
|
6
|
+
export * from './listing.query.tool';
|
|
7
|
+
export * from './listings.list.tool';
|
|
3
8
|
export * from './mcp.tool';
|
|
9
|
+
export * from './reports.list.tool';
|
|
10
|
+
export * from './reports.run.tool';
|
|
4
11
|
export * from './save.listing.preference.tool';
|
|
5
12
|
export * from './tool.registry';
|
|
13
|
+
export * from './whoami.tool';
|
package/dist/mcp/tools/index.js
CHANGED
|
@@ -14,9 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ap.tool.registry"), exports);
|
|
18
|
+
__exportStar(require("./ar.tool.registry"), exports);
|
|
19
|
+
__exportStar(require("./catalog.slugs"), exports);
|
|
17
20
|
__exportStar(require("./delete.listing.preference.tool"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./listing.describe.tool"), exports);
|
|
22
|
+
__exportStar(require("./listing.query.tool"), exports);
|
|
23
|
+
__exportStar(require("./listings.list.tool"), exports);
|
|
19
24
|
__exportStar(require("./mcp.tool"), exports);
|
|
25
|
+
__exportStar(require("./reports.list.tool"), exports);
|
|
26
|
+
__exportStar(require("./reports.run.tool"), exports);
|
|
20
27
|
__exportStar(require("./save.listing.preference.tool"), exports);
|
|
21
28
|
__exportStar(require("./tool.registry"), exports);
|
|
29
|
+
__exportStar(require("./whoami.tool"), exports);
|
|
22
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AAAA,qDAAmC;AAAA,kDAAgC;AAAA,mEAAiD;AAAA,0DAAwC;AAAA,uDAAqC;AAAA,uDAAqC;AAAA,6CAA2B;AAAA,sDAAoC;AAAA,qDAAmC;AAAA,iEAA+C;AAAA,kDAAgC;AAAA,gDAA6B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { McpToolResultInterface } from '../interfaces/mcp.tool.result.interface';
|
|
3
|
+
import { McpTool } from './mcp.tool';
|
|
4
|
+
type ListingDescribeInput = {
|
|
5
|
+
slug: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class ListingDescribeTool extends McpTool<ListingDescribeInput> {
|
|
8
|
+
readonly name = "listing_describe";
|
|
9
|
+
readonly title = "Describe listing page";
|
|
10
|
+
readonly description = "Fetch columns, filters, sort, and visible preferences for a listing page by slug. Returns { definition, preferences, detail }. Call this before listing_query to know which filters and columns exist.";
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
slug: z.ZodString;
|
|
13
|
+
};
|
|
14
|
+
protected readonly readOnly = true;
|
|
15
|
+
readonly requiredScopes: string[];
|
|
16
|
+
execute(args: ListingDescribeInput): Promise<McpToolResultInterface>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ListingDescribeTool = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const mcp_tool_1 = require("./mcp.tool");
|
|
6
6
|
const inputSchema = {
|
|
7
7
|
slug: zod_1.z.string().min(3).max(100).describe('Listing page identifier/slug, e.g. "orders" or "business-users".'),
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class ListingDescribeTool extends mcp_tool_1.McpTool {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
|
-
this.name = '
|
|
13
|
-
this.title = '
|
|
14
|
-
this.description = 'Fetch
|
|
15
|
-
"Use this to discover a listing's columns and existing preferences before creating or updating one.";
|
|
12
|
+
this.name = 'listing_describe';
|
|
13
|
+
this.title = 'Describe listing page';
|
|
14
|
+
this.description = 'Fetch columns, filters, sort, and visible preferences for a listing page by slug. Returns { definition, preferences, detail }. Call this before listing_query to know which filters and columns exist.';
|
|
16
15
|
this.inputSchema = inputSchema;
|
|
17
16
|
this.readOnly = true;
|
|
17
|
+
this.requiredScopes = ['reporting:read'];
|
|
18
18
|
}
|
|
19
19
|
execute(args) {
|
|
20
20
|
return this.run(() => this.client.request({ method: 'GET', path: `v1/b/listing-page/${encodeURIComponent(args.slug)}` }));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
exports.
|
|
24
|
-
//# sourceMappingURL=
|
|
23
|
+
exports.ListingDescribeTool = ListingDescribeTool;
|
|
24
|
+
//# sourceMappingURL=listing.describe.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listing.describe.tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/listing.describe.tool.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,yCAAqC;AAErC,MAAM,WAAW,GAAG;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,kEAAkE,CAAC;CAChH,CAAC;AAQF,MAAa,mBAAoB,SAAQ,kBAA6B;IAAtE;;QACa,SAAI,GAAG,kBAAkB,CAAC;QAC1B,UAAK,GAAG,uBAAuB,CAAC;QAChC,gBAAW,GAChB,wMAAwM,CAAC;QACpM,gBAAW,GAAG,WAAW,CAAC;QAChB,aAAQ,GAAG,IAAI,CAAC;QAC1B,mBAAc,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAKjD,CAAC;IAHG,OAAO,CAAC,IAA0B;QAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9H,CAAC;CACJ;AAZD,kDAYC"}
|