nestjs-apcore 0.1.0 → 0.3.1
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/README.md +78 -56
- package/dist/bridge/binding-loader.d.ts +2 -2
- package/dist/bridge/binding-loader.d.ts.map +1 -1
- package/dist/bridge/binding-loader.js +16 -30
- package/dist/bridge/binding-loader.js.map +1 -1
- package/dist/core/apcore-executor.service.d.ts +7 -3
- package/dist/core/apcore-executor.service.d.ts.map +1 -1
- package/dist/core/apcore-executor.service.js +7 -3
- package/dist/core/apcore-executor.service.js.map +1 -1
- package/dist/core/apcore-registry.service.d.ts +26 -9
- package/dist/core/apcore-registry.service.d.ts.map +1 -1
- package/dist/core/apcore-registry.service.js +71 -38
- package/dist/core/apcore-registry.service.js.map +1 -1
- package/dist/core/apcore.module.d.ts +4 -1
- package/dist/core/apcore.module.d.ts.map +1 -1
- package/dist/core/apcore.module.js +20 -2
- package/dist/core/apcore.module.js.map +1 -1
- package/dist/decorators/ap-tool-scanner.service.d.ts +46 -7
- package/dist/decorators/ap-tool-scanner.service.d.ts.map +1 -1
- package/dist/decorators/ap-tool-scanner.service.js +110 -56
- package/dist/decorators/ap-tool-scanner.service.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/apcore-mcp.service.d.ts +21 -3
- package/dist/mcp/apcore-mcp.service.d.ts.map +1 -1
- package/dist/mcp/apcore-mcp.service.js +58 -41
- package/dist/mcp/apcore-mcp.service.js.map +1 -1
- package/dist/types.d.ts +23 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/module-factory.d.ts +29 -0
- package/dist/utils/module-factory.d.ts.map +1 -0
- package/dist/utils/module-factory.js +45 -0
- package/dist/utils/module-factory.js.map +1 -0
- package/package.json +8 -3
|
@@ -9,6 +9,8 @@ import { Global, Module } from '@nestjs/common';
|
|
|
9
9
|
import { Registry, Executor } from 'apcore-js';
|
|
10
10
|
import { ApcoreRegistryService } from './apcore-registry.service.js';
|
|
11
11
|
import { ApcoreExecutorService } from './apcore-executor.service.js';
|
|
12
|
+
import { ApToolScannerService } from '../decorators/ap-tool-scanner.service.js';
|
|
13
|
+
import { ApcoreMcpModule } from '../mcp/apcore-mcp.module.js';
|
|
12
14
|
import { APCORE_MODULE_OPTIONS } from '../constants.js';
|
|
13
15
|
/**
|
|
14
16
|
* Main NestJS dynamic module for the apcore ecosystem.
|
|
@@ -16,6 +18,9 @@ import { APCORE_MODULE_OPTIONS } from '../constants.js';
|
|
|
16
18
|
* Marked `@Global()` so that {@link ApcoreRegistryService} and
|
|
17
19
|
* {@link ApcoreExecutorService} are available application-wide without
|
|
18
20
|
* importing this module into every feature module.
|
|
21
|
+
*
|
|
22
|
+
* Now also handles automatic tool discovery via {@link ApToolScannerService}
|
|
23
|
+
* and optional MCP server integration.
|
|
19
24
|
*/
|
|
20
25
|
let ApcoreModule = ApcoreModule_1 = class ApcoreModule {
|
|
21
26
|
/**
|
|
@@ -25,7 +30,7 @@ let ApcoreModule = ApcoreModule_1 = class ApcoreModule {
|
|
|
25
30
|
* wraps them in NestJS-injectable services, and exports them together with
|
|
26
31
|
* the raw options token.
|
|
27
32
|
*/
|
|
28
|
-
static forRoot(options) {
|
|
33
|
+
static forRoot(options = {}) {
|
|
29
34
|
const registry = new Registry({
|
|
30
35
|
extensionsDir: options.extensionsDir ?? null,
|
|
31
36
|
});
|
|
@@ -36,17 +41,24 @@ let ApcoreModule = ApcoreModule_1 = class ApcoreModule {
|
|
|
36
41
|
});
|
|
37
42
|
const registryService = new ApcoreRegistryService(registry);
|
|
38
43
|
const executorService = new ApcoreExecutorService(executor);
|
|
44
|
+
const imports = [];
|
|
45
|
+
if (options.mcp) {
|
|
46
|
+
imports.push(ApcoreMcpModule.forRoot(options.mcp));
|
|
47
|
+
}
|
|
39
48
|
return {
|
|
40
49
|
module: ApcoreModule_1,
|
|
50
|
+
imports,
|
|
41
51
|
providers: [
|
|
42
52
|
{ provide: APCORE_MODULE_OPTIONS, useValue: options },
|
|
43
53
|
{ provide: ApcoreRegistryService, useValue: registryService },
|
|
44
54
|
{ provide: ApcoreExecutorService, useValue: executorService },
|
|
55
|
+
ApToolScannerService,
|
|
45
56
|
],
|
|
46
57
|
exports: [
|
|
47
58
|
APCORE_MODULE_OPTIONS,
|
|
48
59
|
ApcoreRegistryService,
|
|
49
60
|
ApcoreExecutorService,
|
|
61
|
+
ApToolScannerService,
|
|
50
62
|
],
|
|
51
63
|
};
|
|
52
64
|
}
|
|
@@ -57,9 +69,13 @@ let ApcoreModule = ApcoreModule_1 = class ApcoreModule {
|
|
|
57
69
|
* ConfigService) are available to the factory function.
|
|
58
70
|
*/
|
|
59
71
|
static forRootAsync(options) {
|
|
72
|
+
const imports = [...(options.imports ?? [])];
|
|
73
|
+
if (options.mcp) {
|
|
74
|
+
imports.push(ApcoreMcpModule.forRoot(options.mcp));
|
|
75
|
+
}
|
|
60
76
|
return {
|
|
61
77
|
module: ApcoreModule_1,
|
|
62
|
-
imports
|
|
78
|
+
imports,
|
|
63
79
|
providers: [
|
|
64
80
|
{
|
|
65
81
|
provide: APCORE_MODULE_OPTIONS,
|
|
@@ -88,11 +104,13 @@ let ApcoreModule = ApcoreModule_1 = class ApcoreModule {
|
|
|
88
104
|
},
|
|
89
105
|
inject: [APCORE_MODULE_OPTIONS, ApcoreRegistryService],
|
|
90
106
|
},
|
|
107
|
+
ApToolScannerService,
|
|
91
108
|
],
|
|
92
109
|
exports: [
|
|
93
110
|
APCORE_MODULE_OPTIONS,
|
|
94
111
|
ApcoreRegistryService,
|
|
95
112
|
ApcoreExecutorService,
|
|
113
|
+
ApToolScannerService,
|
|
96
114
|
],
|
|
97
115
|
};
|
|
98
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apcore.module.js","sourceRoot":"","sources":["../../src/core/apcore.module.ts"],"names":[],"mappings":";;;;;;;AAAA,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,GAAG,IAAI,QAAQ,CAAC;4BAC5B,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI;yBAC1C,CAAC,CAAC;wBACH,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAAC;oBAC7C,CAAC;oBACD,MAAM,EAAE,CAAC,qBAAqB,CAAC;iBAChC;gBACD;oBACE,OAAO,EAAE,qBAAqB;oBAC9B,UAAU,EAAE,CACV,IAAyB,EACzB,eAAsC,EACtC,EAAE;wBACF,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC;4BAC5B,QAAQ,EAAE,eAAe,CAAC,GAAG;4BAC7B,GAAG,EAAG,IAAI,CAAC,GAAkB,IAAI,IAAI;4BACrC,WAAW,EAAG,IAAI,CAAC,UAA2B,IAAI,IAAI;yBACvD,CAAC,CAAC;wBACH,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAAC;oBAC7C,CAAC;oBACD,MAAM,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;iBACvD;gBACD,oBAAoB;aACrB;YACD,OAAO,EAAE;gBACP,qBAAqB;gBACrB,qBAAqB;gBACrB,qBAAqB;gBACrB,oBAAoB;aACrB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AArGY,YAAY;IAFxB,MAAM,EAAE;IACR,MAAM,CAAC,EAAE,CAAC;GACE,YAAY,CAqGxB"}
|
|
@@ -1,25 +1,64 @@
|
|
|
1
1
|
import { type OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { ModulesContainer } from '@nestjs/core';
|
|
3
|
+
import { BaseScanner } from 'apcore-toolkit';
|
|
4
|
+
import type { ScannedModule } from 'apcore-toolkit';
|
|
3
5
|
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
6
|
+
import type { BoundExecuteFn } from '../utils/module-factory.js';
|
|
7
|
+
/**
|
|
8
|
+
* Options for controlling the scan behaviour.
|
|
9
|
+
*/
|
|
10
|
+
export interface ScanOptions {
|
|
11
|
+
/** Regex pattern — only register modules whose ID matches. */
|
|
12
|
+
include?: string;
|
|
13
|
+
/** Regex pattern — skip modules whose ID matches. */
|
|
14
|
+
exclude?: string;
|
|
15
|
+
}
|
|
4
16
|
/**
|
|
5
17
|
* NestJS service that auto-discovers and registers `@ApTool` decorated
|
|
6
18
|
* methods at module initialization time.
|
|
7
19
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
20
|
+
* Extends apcore-toolkit's {@link BaseScanner} to leverage shared scanning
|
|
21
|
+
* utilities (filterModules, deduplicateIds, extractDocstring,
|
|
22
|
+
* enrichSchemaDescriptions) and produce standardised {@link ScannedModule}
|
|
23
|
+
* intermediates before registration.
|
|
11
24
|
*/
|
|
12
|
-
export declare class ApToolScannerService implements OnModuleInit {
|
|
25
|
+
export declare class ApToolScannerService extends BaseScanner implements OnModuleInit {
|
|
13
26
|
private readonly registry;
|
|
14
27
|
private readonly modulesContainer;
|
|
15
28
|
private readonly schemaExtractor;
|
|
29
|
+
private _scanOptions;
|
|
30
|
+
/**
|
|
31
|
+
* Parallel map keyed by moduleId that holds the bound execute functions.
|
|
32
|
+
* Kept separate from ScannedModule.metadata so that `scan()` produces
|
|
33
|
+
* clean, serialisable intermediates without leaking closures.
|
|
34
|
+
*/
|
|
35
|
+
private readonly _executeFns;
|
|
16
36
|
constructor(registry: ApcoreRegistryService, modulesContainer: ModulesContainer);
|
|
37
|
+
/** Configure include/exclude filters applied during scanAndRegister(). */
|
|
38
|
+
setScanOptions(options: ScanOptions): void;
|
|
39
|
+
getSourceName(): string;
|
|
17
40
|
onModuleInit(): void;
|
|
18
41
|
/**
|
|
19
|
-
* Scan all NestJS providers for @ApTool decorated methods
|
|
20
|
-
*
|
|
42
|
+
* Scan all NestJS providers for @ApTool decorated methods.
|
|
43
|
+
*
|
|
44
|
+
* Returns ScannedModule[] (the apcore-toolkit standard intermediate)
|
|
45
|
+
* without registering — useful for inspection, filtering, or serialisation.
|
|
46
|
+
*
|
|
47
|
+
* Execute functions are stored in a parallel map accessible via
|
|
48
|
+
* {@link getExecuteFn} rather than embedded in metadata.
|
|
49
|
+
*/
|
|
50
|
+
scan(): ScannedModule[];
|
|
51
|
+
/**
|
|
52
|
+
* Retrieve the bound execute function for a scanned module.
|
|
53
|
+
*
|
|
54
|
+
* Available after {@link scan} has been called. Returns `undefined` if
|
|
55
|
+
* the moduleId was not discovered during the last scan.
|
|
56
|
+
*/
|
|
57
|
+
getExecuteFn(moduleId: string): BoundExecuteFn | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Scan, deduplicate, filter, then register all discovered modules.
|
|
21
60
|
*/
|
|
22
|
-
private
|
|
61
|
+
private scanAndRegister;
|
|
23
62
|
/**
|
|
24
63
|
* Scan a single provider instance for @ApTool decorated methods.
|
|
25
64
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ap-tool-scanner.service.d.ts","sourceRoot":"","sources":["../../src/decorators/ap-tool-scanner.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ap-tool-scanner.service.d.ts","sourceRoot":"","sources":["../../src/decorators/ap-tool-scanner.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAiD,MAAM,gBAAgB,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAgB3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA6BjE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,qBACa,oBAAqB,SAAQ,WAAY,YAAW,YAAY;IAazE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAdnC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IACzD,OAAO,CAAC,YAAY,CAAmB;IAEvC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqC;gBAI9C,QAAQ,EAAE,qBAAqB,EAE/B,gBAAgB,EAAE,gBAAgB;IAKrD,0EAA0E;IAC1E,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAI1C,aAAa,IAAI,MAAM;IAIvB,YAAY,IAAI,IAAI;IAIpB;;;;;;;;OAQG;IACH,IAAI,IAAI,aAAa,EAAE;IAsBvB;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAQ1D;;OAEG;IACH,OAAO,CAAC,eAAe;IAsBvB;;OAEG;IACH,OAAO,CAAC,YAAY;CA4HrB"}
|
|
@@ -10,117 +10,169 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
|
-
import { Inject, Injectable } from '@nestjs/common';
|
|
13
|
+
import { Inject, Injectable, Logger } from '@nestjs/common';
|
|
14
14
|
import { ModulesContainer } from '@nestjs/core';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { normalizeResult } from 'apcore-js';
|
|
16
|
+
import { BaseScanner, createScannedModule, enrichSchemaDescriptions } from 'apcore-toolkit';
|
|
17
17
|
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
18
18
|
import { SchemaExtractor } from '../schema/schema-extractor.service.js';
|
|
19
19
|
import { AP_TOOL_METADATA_KEY, AP_MODULE_METADATA_KEY, AP_CONTEXT_METADATA_KEY, } from '../constants.js';
|
|
20
20
|
import { normalizeClassName, normalizeMethodName, generateModuleId, } from '../utils/id-generator.js';
|
|
21
|
+
import { scannedModuleToFunctionModule, toModuleAnnotations, } from '../utils/module-factory.js';
|
|
22
|
+
const logger = new Logger('ApToolScannerService');
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* - null / undefined -> {}
|
|
25
|
-
* - non-object (string, number, boolean, array) -> { result: value }
|
|
26
|
-
* - object -> returned as-is
|
|
27
|
-
*/
|
|
28
|
-
function normalizeReturnValue(value) {
|
|
29
|
-
if (value == null) {
|
|
30
|
-
return {};
|
|
31
|
-
}
|
|
32
|
-
if (typeof value !== 'object' || Array.isArray(value)) {
|
|
33
|
-
return { result: value };
|
|
34
|
-
}
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Try to extract a TSchema from the given input using SchemaExtractor.
|
|
39
|
-
* Falls back to the raw value if extraction fails.
|
|
24
|
+
* Try to extract a JSON Schema from the given input using SchemaExtractor.
|
|
25
|
+
* Falls back to the raw value if extraction fails, logging a warning.
|
|
40
26
|
*/
|
|
41
|
-
function
|
|
27
|
+
function tryExtractJsonSchema(extractor, input, moduleId, field) {
|
|
42
28
|
try {
|
|
43
|
-
return extractor.
|
|
29
|
+
return extractor.extractJsonSchema(input);
|
|
44
30
|
}
|
|
45
|
-
catch {
|
|
46
|
-
|
|
31
|
+
catch (err) {
|
|
32
|
+
logger.warn(`Failed to extract ${field} for "${moduleId}": ${err instanceof Error ? err.message : String(err)}. ` +
|
|
33
|
+
'Falling back to raw value.');
|
|
34
|
+
if (input != null && typeof input === 'object') {
|
|
35
|
+
return input;
|
|
36
|
+
}
|
|
37
|
+
return { type: 'object', properties: {} };
|
|
47
38
|
}
|
|
48
39
|
}
|
|
49
40
|
/**
|
|
50
41
|
* NestJS service that auto-discovers and registers `@ApTool` decorated
|
|
51
42
|
* methods at module initialization time.
|
|
52
43
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
44
|
+
* Extends apcore-toolkit's {@link BaseScanner} to leverage shared scanning
|
|
45
|
+
* utilities (filterModules, deduplicateIds, extractDocstring,
|
|
46
|
+
* enrichSchemaDescriptions) and produce standardised {@link ScannedModule}
|
|
47
|
+
* intermediates before registration.
|
|
56
48
|
*/
|
|
57
|
-
let ApToolScannerService = class ApToolScannerService {
|
|
49
|
+
let ApToolScannerService = class ApToolScannerService extends BaseScanner {
|
|
58
50
|
registry;
|
|
59
51
|
modulesContainer;
|
|
60
52
|
schemaExtractor = new SchemaExtractor();
|
|
53
|
+
_scanOptions = {};
|
|
54
|
+
/**
|
|
55
|
+
* Parallel map keyed by moduleId that holds the bound execute functions.
|
|
56
|
+
* Kept separate from ScannedModule.metadata so that `scan()` produces
|
|
57
|
+
* clean, serialisable intermediates without leaking closures.
|
|
58
|
+
*/
|
|
59
|
+
_executeFns = new Map();
|
|
61
60
|
constructor(registry, modulesContainer) {
|
|
61
|
+
super();
|
|
62
62
|
this.registry = registry;
|
|
63
63
|
this.modulesContainer = modulesContainer;
|
|
64
64
|
}
|
|
65
|
+
/** Configure include/exclude filters applied during scanAndRegister(). */
|
|
66
|
+
setScanOptions(options) {
|
|
67
|
+
this._scanOptions = options;
|
|
68
|
+
}
|
|
69
|
+
getSourceName() {
|
|
70
|
+
return 'nestjs-decorators';
|
|
71
|
+
}
|
|
65
72
|
onModuleInit() {
|
|
66
|
-
this.
|
|
73
|
+
this.scanAndRegister();
|
|
67
74
|
}
|
|
68
75
|
/**
|
|
69
|
-
* Scan all NestJS providers for @ApTool decorated methods
|
|
70
|
-
*
|
|
76
|
+
* Scan all NestJS providers for @ApTool decorated methods.
|
|
77
|
+
*
|
|
78
|
+
* Returns ScannedModule[] (the apcore-toolkit standard intermediate)
|
|
79
|
+
* without registering — useful for inspection, filtering, or serialisation.
|
|
80
|
+
*
|
|
81
|
+
* Execute functions are stored in a parallel map accessible via
|
|
82
|
+
* {@link getExecuteFn} rather than embedded in metadata.
|
|
71
83
|
*/
|
|
72
84
|
scan() {
|
|
85
|
+
this._executeFns.clear();
|
|
86
|
+
const modules = [];
|
|
73
87
|
for (const nestModule of this.modulesContainer.values()) {
|
|
74
88
|
for (const wrapper of nestModule.providers.values()) {
|
|
75
89
|
const instance = wrapper.instance;
|
|
76
90
|
const metatype = wrapper.metatype;
|
|
77
|
-
// Skip providers without a real instance or metatype (e.g. value providers)
|
|
78
91
|
if (!instance || !metatype || typeof metatype !== 'function') {
|
|
79
92
|
continue;
|
|
80
93
|
}
|
|
81
|
-
this.scanProvider(instance, metatype);
|
|
94
|
+
modules.push(...this.scanProvider(instance, metatype));
|
|
82
95
|
}
|
|
83
96
|
}
|
|
97
|
+
return this.deduplicateIds(modules);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Retrieve the bound execute function for a scanned module.
|
|
101
|
+
*
|
|
102
|
+
* Available after {@link scan} has been called. Returns `undefined` if
|
|
103
|
+
* the moduleId was not discovered during the last scan.
|
|
104
|
+
*/
|
|
105
|
+
getExecuteFn(moduleId) {
|
|
106
|
+
return this._executeFns.get(moduleId);
|
|
107
|
+
}
|
|
108
|
+
// -------------------------------------------------------------------------
|
|
109
|
+
// Private
|
|
110
|
+
// -------------------------------------------------------------------------
|
|
111
|
+
/**
|
|
112
|
+
* Scan, deduplicate, filter, then register all discovered modules.
|
|
113
|
+
*/
|
|
114
|
+
scanAndRegister() {
|
|
115
|
+
let scannedModules = this.scan();
|
|
116
|
+
// Apply include/exclude filtering via inherited BaseScanner.filterModules()
|
|
117
|
+
if (this._scanOptions.include || this._scanOptions.exclude) {
|
|
118
|
+
scannedModules = this.filterModules(scannedModules, this._scanOptions);
|
|
119
|
+
}
|
|
120
|
+
for (const mod of scannedModules) {
|
|
121
|
+
const execute = this._executeFns.get(mod.moduleId);
|
|
122
|
+
if (typeof execute !== 'function') {
|
|
123
|
+
logger.error(`No execute function found for module "${mod.moduleId}" — skipping registration.`);
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const fm = scannedModuleToFunctionModule(mod, execute);
|
|
127
|
+
this.registry.register(mod.moduleId, fm);
|
|
128
|
+
}
|
|
84
129
|
}
|
|
85
130
|
/**
|
|
86
131
|
* Scan a single provider instance for @ApTool decorated methods.
|
|
87
132
|
*/
|
|
88
133
|
scanProvider(instance, metatype) {
|
|
89
|
-
|
|
134
|
+
const results = [];
|
|
90
135
|
const moduleOptions = Reflect.getMetadata(AP_MODULE_METADATA_KEY, metatype);
|
|
91
136
|
const namespace = moduleOptions?.namespace ?? normalizeClassName(metatype.name);
|
|
92
|
-
// Iterate all methods on the prototype
|
|
93
137
|
const prototype = Object.getPrototypeOf(instance);
|
|
94
138
|
if (!prototype)
|
|
95
|
-
return;
|
|
139
|
+
return results;
|
|
96
140
|
const methodNames = Object.getOwnPropertyNames(prototype).filter((name) => {
|
|
97
141
|
if (name === 'constructor')
|
|
98
142
|
return false;
|
|
99
143
|
const descriptor = Object.getOwnPropertyDescriptor(prototype, name);
|
|
100
|
-
// Only include actual methods (not getters/setters)
|
|
101
144
|
return descriptor !== undefined && typeof descriptor.value === 'function';
|
|
102
145
|
});
|
|
103
146
|
for (const methodName of methodNames) {
|
|
104
|
-
// Check for @ApTool metadata on this method
|
|
105
147
|
const toolOptions = Reflect.getMetadata(AP_TOOL_METADATA_KEY, prototype, methodName);
|
|
106
148
|
if (!toolOptions)
|
|
107
149
|
continue;
|
|
108
|
-
// Read @ApContext metadata (parameter index) if present
|
|
109
150
|
const contextIndex = Reflect.getMetadata(AP_CONTEXT_METADATA_KEY, prototype, methodName);
|
|
110
|
-
// Generate module ID
|
|
111
151
|
const normalizedMethod = normalizeMethodName(methodName);
|
|
112
152
|
const moduleId = toolOptions.id ?? generateModuleId(namespace, normalizedMethod);
|
|
113
|
-
// Extract schemas
|
|
114
|
-
let inputSchema =
|
|
115
|
-
let outputSchema =
|
|
153
|
+
// Extract schemas to JSON Schema (toolkit standard)
|
|
154
|
+
let inputSchema = { type: 'object', properties: {} };
|
|
155
|
+
let outputSchema = { type: 'object', properties: {} };
|
|
116
156
|
if (toolOptions.inputSchema != null) {
|
|
117
|
-
inputSchema =
|
|
157
|
+
inputSchema = tryExtractJsonSchema(this.schemaExtractor, toolOptions.inputSchema, moduleId, 'inputSchema');
|
|
118
158
|
}
|
|
119
159
|
if (toolOptions.outputSchema != null) {
|
|
120
|
-
outputSchema =
|
|
160
|
+
outputSchema = tryExtractJsonSchema(this.schemaExtractor, toolOptions.outputSchema, moduleId, 'outputSchema');
|
|
121
161
|
}
|
|
122
|
-
//
|
|
162
|
+
// Use toolkit's extractDocstring() to auto-fill documentation and
|
|
163
|
+
// enrich input schema descriptions from JSDoc @param tags when the
|
|
164
|
+
// decorator doesn't provide them explicitly.
|
|
123
165
|
const fn = instance[methodName];
|
|
166
|
+
let documentation = toolOptions.documentation ?? null;
|
|
167
|
+
const docstring = this.extractDocstring(fn);
|
|
168
|
+
if (documentation == null && docstring.documentation != null) {
|
|
169
|
+
documentation = docstring.documentation;
|
|
170
|
+
}
|
|
171
|
+
// Merge JSDoc @param descriptions into input schema properties via toolkit
|
|
172
|
+
if (Object.keys(docstring.params).length > 0) {
|
|
173
|
+
inputSchema = enrichSchemaDescriptions(inputSchema, docstring.params);
|
|
174
|
+
}
|
|
175
|
+
// Build the bound execute function
|
|
124
176
|
const execute = async (inputs, context) => {
|
|
125
177
|
let raw;
|
|
126
178
|
if (contextIndex != null) {
|
|
@@ -138,21 +190,23 @@ let ApToolScannerService = class ApToolScannerService {
|
|
|
138
190
|
else {
|
|
139
191
|
raw = await fn.call(instance, inputs);
|
|
140
192
|
}
|
|
141
|
-
return
|
|
193
|
+
return normalizeResult(raw);
|
|
142
194
|
};
|
|
143
|
-
|
|
195
|
+
// Store execute fn in parallel map (not in ScannedModule.metadata)
|
|
196
|
+
this._executeFns.set(moduleId, execute);
|
|
197
|
+
results.push(createScannedModule({
|
|
144
198
|
moduleId,
|
|
145
199
|
description: toolOptions.description,
|
|
146
200
|
inputSchema,
|
|
147
201
|
outputSchema,
|
|
148
|
-
tags: toolOptions.tags ??
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
});
|
|
154
|
-
this.registry.register(moduleId, funcModule);
|
|
202
|
+
tags: toolOptions.tags ?? [],
|
|
203
|
+
target: `${metatype.name}.${methodName}`,
|
|
204
|
+
annotations: toModuleAnnotations(toolOptions.annotations),
|
|
205
|
+
documentation,
|
|
206
|
+
examples: toolOptions.examples ?? [],
|
|
207
|
+
}));
|
|
155
208
|
}
|
|
209
|
+
return results;
|
|
156
210
|
}
|
|
157
211
|
};
|
|
158
212
|
ApToolScannerService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ap-tool-scanner.service.js","sourceRoot":"","sources":["../../src/decorators/ap-tool-scanner.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ap-tool-scanner.service.js","sourceRoot":"","sources":["../../src/decorators/ap-tool-scanner.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAqB,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,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AC,IAAI,IAAI,EAAE;gBAC5B,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,IAAI,UAAU,EAAE;gBACxC,WAAW,EAAE,mBAAmB,CAAC,WAAW,CAAC,WAAW,CAAC;gBACzD,aAAa;gBACb,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;aACrC,CAAC,CACH,CAAC;QACJ,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AAtOY,oBAAoB;IADhC,UAAU,EAAE;IAaR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAE7B,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;qCADE,qBAAqB;QAEb,gBAAgB;GAf1C,oBAAoB,CAsOhC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,12 +3,15 @@ export { ApcoreRegistryService } from './core/apcore-registry.service.js';
|
|
|
3
3
|
export { ApcoreExecutorService } from './core/apcore-executor.service.js';
|
|
4
4
|
export { ApcoreMcpModule } from './mcp/apcore-mcp.module.js';
|
|
5
5
|
export { ApcoreMcpService } from './mcp/apcore-mcp.service.js';
|
|
6
|
-
export { reportProgress, elicit, createBridgeContext } from 'apcore-mcp';
|
|
7
|
-
export type { BridgeContext, OpenAIToolDef, ServeOptions, MetricsExporter, ElicitResult } from 'apcore-mcp';
|
|
6
|
+
export { reportProgress, elicit, createBridgeContext, asyncServe, APCoreMCP } from 'apcore-mcp';
|
|
7
|
+
export type { BridgeContext, OpenAIToolDef, ServeOptions, AsyncServeOptions, AsyncServeApp, MetricsExporter, ElicitResult, APCoreMCPOptions, APCoreMCPServeOptions, APCoreMCPAsyncServeOptions, ToOpenaiToolsOptions, } from 'apcore-mcp';
|
|
8
8
|
export { JWTAuthenticator, getCurrentIdentity, identityStorage } from 'apcore-mcp';
|
|
9
9
|
export type { Authenticator, ClaimMapping, JWTAuthenticatorOptions } from 'apcore-mcp';
|
|
10
|
+
export { BaseScanner, createScannedModule, cloneModule, extractInputSchema, extractOutputSchema, resolveRef, resolveSchema, enrichSchemaDescriptions, YAMLWriter, TypeScriptWriter, RegistryWriter, getWriter, moduleToDict, modulesToDicts, annotationsToDict, resolveTarget, flattenParams, toMarkdown, } from 'apcore-toolkit';
|
|
11
|
+
export type { ScannedModule } from 'apcore-toolkit';
|
|
10
12
|
export { ApTool, ApModule, ApContext } from './decorators/index.js';
|
|
11
13
|
export { ApToolScannerService } from './decorators/ap-tool-scanner.service.js';
|
|
14
|
+
export type { ScanOptions } from './decorators/ap-tool-scanner.service.js';
|
|
12
15
|
export { SchemaExtractor, SchemaExtractionError } from './schema/schema-extractor.service.js';
|
|
13
16
|
export type { SchemaAdapter } from './schema/adapters/schema-adapter.interface.js';
|
|
14
17
|
export { TypeBoxAdapter } from './schema/adapters/typebox.adapter.js';
|
|
@@ -18,6 +21,8 @@ export { JsonSchemaAdapter } from './schema/adapters/json-schema.adapter.js';
|
|
|
18
21
|
export { ApBindingLoader } from './bridge/index.js';
|
|
19
22
|
export type { InstanceProvider } from './bridge/index.js';
|
|
20
23
|
export { normalizeClassName, normalizeMethodName, generateModuleId, } from './utils/id-generator.js';
|
|
24
|
+
export { scannedModuleToFunctionModule, toModuleAnnotations } from './utils/module-factory.js';
|
|
25
|
+
export type { BoundExecuteFn } from './utils/module-factory.js';
|
|
21
26
|
export { APCORE_MODULE_OPTIONS, APCORE_MCP_MODULE_OPTIONS, AP_TOOL_METADATA_KEY, AP_MODULE_METADATA_KEY, AP_CONTEXT_METADATA_KEY, } from './constants.js';
|
|
22
|
-
export type { ModuleAnnotations, ModuleExample, Module, Context, Identity, ModuleDescriptor, ApToolAnnotations, ApToolExample, ApToolOptions, ApModuleOptions, ApcoreModuleOptions, ApcoreModuleAsyncOptions, ApcoreMcpModuleOptions, ApcoreMcpModuleAsyncOptions, RegisterMethodOptions, RegisterServiceOptions, } from './types.js';
|
|
27
|
+
export type { ModuleAnnotations, ModuleExample, Module, Context, Identity, ModuleDescriptor, PreflightResult, PreflightCheckResult, ValidationResult, ApToolAnnotations, ApToolExample, ApToolOptions, ApModuleOptions, ApcoreModuleOptions, ApcoreModuleAsyncOptions, ApcoreMcpModuleOptions, ApcoreMcpModuleAsyncOptions, RegisterMethodOptions, RegisterServiceOptions, } from './types.js';
|
|
23
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAK1E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAK1E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAChG,YAAY,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,o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AAM,2BAA2B,CAAC;AAC/F,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAKxB,YAAY,EAEV,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAEhB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,10 +10,14 @@ export { ApcoreExecutorService } from './core/apcore-executor.service.js';
|
|
|
10
10
|
export { ApcoreMcpModule } from './mcp/apcore-mcp.module.js';
|
|
11
11
|
export { ApcoreMcpService } from './mcp/apcore-mcp.service.js';
|
|
12
12
|
// Re-export apcore-mcp helpers and types for convenience
|
|
13
|
-
export { reportProgress, elicit, createBridgeContext } from 'apcore-mcp';
|
|
13
|
+
export { reportProgress, elicit, createBridgeContext, asyncServe, APCoreMCP } from 'apcore-mcp';
|
|
14
14
|
// Re-export apcore-mcp auth utilities
|
|
15
15
|
export { JWTAuthenticator, getCurrentIdentity, identityStorage } from 'apcore-mcp';
|
|
16
16
|
// ---------------------------------------------------------------------------
|
|
17
|
+
// Toolkit (scanner & schema extraction from apcore-toolkit)
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
export { BaseScanner, createScannedModule, cloneModule, extractInputSchema, extractOutputSchema, resolveRef, resolveSchema, enrichSchemaDescriptions, YAMLWriter, TypeScriptWriter, RegistryWriter, getWriter, moduleToDict, modulesToDicts, annotationsToDict, resolveTarget, flattenParams, toMarkdown, } from 'apcore-toolkit';
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
17
21
|
// Decorators
|
|
18
22
|
// ---------------------------------------------------------------------------
|
|
19
23
|
export { ApTool, ApModule, ApContext } from './decorators/index.js';
|
|
@@ -34,6 +38,7 @@ export { ApBindingLoader } from './bridge/index.js';
|
|
|
34
38
|
// Utilities
|
|
35
39
|
// ---------------------------------------------------------------------------
|
|
36
40
|
export { normalizeClassName, normalizeMethodName, generateModuleId, } from './utils/id-generator.js';
|
|
41
|
+
export { scannedModuleToFunctionModule, toModuleAnnotations } from './utils/module-factory.js';
|
|
37
42
|
// ---------------------------------------------------------------------------
|
|
38
43
|
// Constants
|
|
39
44
|
// ---------------------------------------------------------------------------
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,8EAA8E;AAC9E,MAAM;AACN,8EAA8E;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,yDAAyD;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,8EAA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D,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAC9E,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAG/F,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAC9E,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { OnApplicationBootstrap, OnModuleDestroy } from '@nestjs/common';
|
|
2
|
-
import type { OpenAIToolDef } from 'apcore-mcp';
|
|
2
|
+
import type { OpenAIToolDef, AsyncServeApp } from 'apcore-mcp';
|
|
3
3
|
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
4
4
|
import { ApcoreExecutorService } from '../core/apcore-executor.service.js';
|
|
5
5
|
import type { ApcoreMcpModuleOptions } from '../types.js';
|
|
6
6
|
/**
|
|
7
7
|
* NestJS service that manages the MCP (Model Context Protocol) server lifecycle.
|
|
8
8
|
*
|
|
9
|
-
* Wraps the `serve()` and `toOpenaiTools()` functions from
|
|
10
|
-
* integrating them with NestJS lifecycle hooks for automatic
|
|
9
|
+
* Wraps the `serve()`, `asyncServe()`, and `toOpenaiTools()` functions from
|
|
10
|
+
* `apcore-mcp`, integrating them with NestJS lifecycle hooks for automatic
|
|
11
|
+
* startup/shutdown.
|
|
11
12
|
*/
|
|
12
13
|
export declare class ApcoreMcpService implements OnApplicationBootstrap, OnModuleDestroy {
|
|
13
14
|
private readonly registry;
|
|
@@ -24,6 +25,18 @@ export declare class ApcoreMcpService implements OnApplicationBootstrap, OnModul
|
|
|
24
25
|
get toolCount(): number;
|
|
25
26
|
/** Starts the MCP server using the configured transport and options. */
|
|
26
27
|
start(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Build an embeddable HTTP request handler without starting a standalone server.
|
|
30
|
+
*
|
|
31
|
+
* Returns an `AsyncServeApp` with `handler` and `close` methods, suitable for
|
|
32
|
+
* mounting into Express, Fastify, or any Node HTTP framework.
|
|
33
|
+
*/
|
|
34
|
+
asyncServe(options?: {
|
|
35
|
+
endpoint?: string;
|
|
36
|
+
explorer?: boolean;
|
|
37
|
+
explorerPrefix?: string;
|
|
38
|
+
allowExecute?: boolean;
|
|
39
|
+
}): Promise<AsyncServeApp>;
|
|
27
40
|
/** Stops the MCP server. */
|
|
28
41
|
stop(): Promise<void>;
|
|
29
42
|
/** Restarts the MCP server (stop, then start). */
|
|
@@ -49,5 +62,10 @@ export declare class ApcoreMcpService implements OnApplicationBootstrap, OnModul
|
|
|
49
62
|
onApplicationBootstrap(): Promise<void>;
|
|
50
63
|
/** Auto-stops the MCP server on module destruction. */
|
|
51
64
|
onModuleDestroy(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Collect defined option values from this.options for the given keys.
|
|
67
|
+
* Only includes keys whose values are not `undefined`.
|
|
68
|
+
*/
|
|
69
|
+
private collectOptions;
|
|
52
70
|
}
|
|
53
71
|
//# sourceMappingURL=apcore-mcp.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apcore-mcp.service.d.ts","sourceRoot":"","sources":["../../src/mcp/apcore-mcp.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"apcore-mcp.service.d.ts","sourceRoot":"","sources":["../../src/mcp/apcore-mcp.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAA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