@futdevpro/nts-dynamo 1.15.294 → 1.15.297

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/build/_modules/mcp/_collections/mcp-error.util.d.ts +38 -0
  2. package/build/_modules/mcp/_collections/mcp-error.util.d.ts.map +1 -0
  3. package/build/_modules/mcp/_collections/mcp-error.util.js +103 -0
  4. package/build/_modules/mcp/_collections/mcp-error.util.js.map +1 -0
  5. package/build/_modules/mcp/_collections/mcp-ref.util.d.ts +74 -0
  6. package/build/_modules/mcp/_collections/mcp-ref.util.d.ts.map +1 -0
  7. package/build/_modules/mcp/_collections/mcp-ref.util.js +115 -0
  8. package/build/_modules/mcp/_collections/mcp-ref.util.js.map +1 -0
  9. package/build/_modules/mcp/_enums/mcp-error-code.type-enum.d.ts +17 -0
  10. package/build/_modules/mcp/_enums/mcp-error-code.type-enum.d.ts.map +1 -0
  11. package/build/_modules/mcp/_enums/mcp-error-code.type-enum.js +21 -0
  12. package/build/_modules/mcp/_enums/mcp-error-code.type-enum.js.map +1 -0
  13. package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.d.ts +19 -1
  14. package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.d.ts.map +1 -1
  15. package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.js +35 -0
  16. package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.js.map +1 -1
  17. package/build/_modules/mcp/_models/errors/mcp-conflict.error.d.ts +7 -0
  18. package/build/_modules/mcp/_models/errors/mcp-conflict.error.d.ts.map +1 -0
  19. package/build/_modules/mcp/_models/errors/mcp-conflict.error.js +11 -0
  20. package/build/_modules/mcp/_models/errors/mcp-conflict.error.js.map +1 -0
  21. package/build/_modules/mcp/_models/errors/mcp-forbidden.error.d.ts +7 -0
  22. package/build/_modules/mcp/_models/errors/mcp-forbidden.error.d.ts.map +1 -0
  23. package/build/_modules/mcp/_models/errors/mcp-forbidden.error.js +11 -0
  24. package/build/_modules/mcp/_models/errors/mcp-forbidden.error.js.map +1 -0
  25. package/build/_modules/mcp/_models/errors/mcp-internal.error.d.ts +7 -0
  26. package/build/_modules/mcp/_models/errors/mcp-internal.error.d.ts.map +1 -0
  27. package/build/_modules/mcp/_models/errors/mcp-internal.error.js +11 -0
  28. package/build/_modules/mcp/_models/errors/mcp-internal.error.js.map +1 -0
  29. package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.d.ts +7 -0
  30. package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.d.ts.map +1 -0
  31. package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.js +11 -0
  32. package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.js.map +1 -0
  33. package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.d.ts +7 -0
  34. package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.d.ts.map +1 -0
  35. package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.js +11 -0
  36. package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.js.map +1 -0
  37. package/build/_modules/mcp/_models/errors/mcp.error-base.d.ts +21 -0
  38. package/build/_modules/mcp/_models/errors/mcp.error-base.d.ts.map +1 -0
  39. package/build/_modules/mcp/_models/errors/mcp.error-base.js +25 -0
  40. package/build/_modules/mcp/_models/errors/mcp.error-base.js.map +1 -0
  41. package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.d.ts +32 -0
  42. package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.d.ts.map +1 -0
  43. package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.js +3 -0
  44. package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.js.map +1 -0
  45. package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.d.ts +12 -0
  46. package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.d.ts.map +1 -0
  47. package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.js +3 -0
  48. package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.js.map +1 -0
  49. package/build/_modules/mcp/_models/interfaces/mcp-settings.interface.d.ts +2 -0
  50. package/build/_modules/mcp/_models/interfaces/mcp-settings.interface.d.ts.map +1 -1
  51. package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.d.ts +8 -0
  52. package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.d.ts.map +1 -0
  53. package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.js +3 -0
  54. package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.js.map +1 -0
  55. package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts +5 -3
  56. package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts.map +1 -1
  57. package/build/_modules/mcp/_services/dynts-mcp.adapter.js +23 -20
  58. package/build/_modules/mcp/_services/dynts-mcp.adapter.js.map +1 -1
  59. package/build/_modules/mcp/index.d.ts +12 -0
  60. package/build/_modules/mcp/index.d.ts.map +1 -1
  61. package/build/_modules/mcp/index.js +13 -0
  62. package/build/_modules/mcp/index.js.map +1 -1
  63. package/package.json +1 -1
@@ -0,0 +1,38 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_JsonRpcError } from '../_models/interfaces/mcp-json-rpc-error.interface';
3
+ /**
4
+ * Turns any error into a caller-safe JSON-RPC error of the MCP layer (HP-DOPL MP-3.6, DMCP-006) — lifted from the
5
+ * organizer `Mcp_Controller.toJsonRpcError`, including its measured leak fix (`TD-20260817-003`: an internal provider
6
+ * message carried an API key prefix into the response).
7
+ *
8
+ * - `DyNTS_Mcp_*Error` → its own code, message and data (written for the caller);
9
+ * - `DyFM_Error` → the code from its HTTP status (400/404/422 invalid params · 401/403 forbidden ·
10
+ * 409/412/428 conflict · otherwise internal); the message is the `__userMessage` or a generic text with the error
11
+ * code — ⛔ the internal `_message` is NEVER sent (neither as `message` nor inside `data`);
12
+ * - any other `Error` / value → internal error with a generic message (the detail stays in the server log).
13
+ *
14
+ * ⭐ To give an agent a helpful text for a `DyFM_Error`, set its `userMessage`.
15
+ */
16
+ export declare class DyNTS_McpError_Util {
17
+ /**
18
+ * Builds the JSON-RPC error of an MCP call.
19
+ * @param set.error - the thrown error
20
+ * @param set.method - the called tool / method name
21
+ * @param set.validMethods - the valid method names, added to a method-not-found error
22
+ */
23
+ static toJsonRpcError(set: {
24
+ error: unknown;
25
+ method?: string;
26
+ validMethods?: string[];
27
+ }): DyNTS_Mcp_JsonRpcError;
28
+ /**
29
+ * The JSON-RPC code of an HTTP status — the same rejection on REST and MCP (DMCP-012 parity).
30
+ * @param status - the HTTP status of a `DyFM_Error`
31
+ */
32
+ static codeOfStatus(status: number | undefined): DyNTS_McpErrorCode_Type;
33
+ /** A generic, caller-safe label of a code. */
34
+ private static labelOf;
35
+ /** Drops the undefined fields, so the serialized data stays compact. */
36
+ private static withoutUndefined;
37
+ }
38
+ //# sourceMappingURL=mcp-error.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-error.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/mcp/_collections/mcp-error.util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAG5F;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAmB;IAC9B;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,sBAAsB;IAwChH;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,uBAAuB;IAgBxE,8CAA8C;IAC9C,OAAO,CAAC,MAAM,CAAC,OAAO;IAetB,wEAAwE;IACxE,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAShC"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_McpError_Util = void 0;
4
+ const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
5
+ const mcp_error_code_type_enum_1 = require("../_enums/mcp-error-code.type-enum");
6
+ const mcp_error_base_1 = require("../_models/errors/mcp.error-base");
7
+ const mcp_method_not_found_error_1 = require("../_models/errors/mcp-method-not-found.error");
8
+ /**
9
+ * Turns any error into a caller-safe JSON-RPC error of the MCP layer (HP-DOPL MP-3.6, DMCP-006) — lifted from the
10
+ * organizer `Mcp_Controller.toJsonRpcError`, including its measured leak fix (`TD-20260817-003`: an internal provider
11
+ * message carried an API key prefix into the response).
12
+ *
13
+ * - `DyNTS_Mcp_*Error` → its own code, message and data (written for the caller);
14
+ * - `DyFM_Error` → the code from its HTTP status (400/404/422 invalid params · 401/403 forbidden ·
15
+ * 409/412/428 conflict · otherwise internal); the message is the `__userMessage` or a generic text with the error
16
+ * code — ⛔ the internal `_message` is NEVER sent (neither as `message` nor inside `data`);
17
+ * - any other `Error` / value → internal error with a generic message (the detail stays in the server log).
18
+ *
19
+ * ⭐ To give an agent a helpful text for a `DyFM_Error`, set its `userMessage`.
20
+ */
21
+ class DyNTS_McpError_Util {
22
+ /**
23
+ * Builds the JSON-RPC error of an MCP call.
24
+ * @param set.error - the thrown error
25
+ * @param set.method - the called tool / method name
26
+ * @param set.validMethods - the valid method names, added to a method-not-found error
27
+ */
28
+ static toJsonRpcError(set) {
29
+ const error = set.error;
30
+ if (error instanceof mcp_error_base_1.DyNTS_Mcp_ErrorBase) {
31
+ const data = {
32
+ message: error.message,
33
+ userMessage: error.message,
34
+ ...error.data,
35
+ method: error.data?.method ?? set.method,
36
+ };
37
+ if (error instanceof mcp_method_not_found_error_1.DyNTS_Mcp_MethodNotFoundError && !data.validMethods && set.validMethods) {
38
+ data.validMethods = [...set.validMethods];
39
+ }
40
+ return { code: error.code, message: error.message, data: DyNTS_McpError_Util.withoutUndefined(data) };
41
+ }
42
+ if (error instanceof fsm_dynamo_1.DyFM_Error) {
43
+ const code = DyNTS_McpError_Util.codeOfStatus(error.___status);
44
+ const errorCode = error._errorCode || undefined;
45
+ const message = error.__userMessage ??
46
+ `${DyNTS_McpError_Util.labelOf(code)}${errorCode ? ` (${errorCode})` : ''}`;
47
+ return {
48
+ code: code,
49
+ message: message,
50
+ data: DyNTS_McpError_Util.withoutUndefined({
51
+ message: message, userMessage: error.__userMessage, errorCode: errorCode, method: set.method,
52
+ }),
53
+ };
54
+ }
55
+ return {
56
+ code: mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.internal,
57
+ message: 'Internal error',
58
+ data: DyNTS_McpError_Util.withoutUndefined({ message: 'Internal error', method: set.method }),
59
+ };
60
+ }
61
+ /**
62
+ * The JSON-RPC code of an HTTP status — the same rejection on REST and MCP (DMCP-012 parity).
63
+ * @param status - the HTTP status of a `DyFM_Error`
64
+ */
65
+ static codeOfStatus(status) {
66
+ if (status === 400 || status === 404 || status === 422) {
67
+ return mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.invalidParams;
68
+ }
69
+ if (status === 401 || status === 403) {
70
+ return mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.forbidden;
71
+ }
72
+ if (status === 409 || status === 412 || status === 428) {
73
+ return mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.conflict;
74
+ }
75
+ return mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.internal;
76
+ }
77
+ /** A generic, caller-safe label of a code. */
78
+ static labelOf(code) {
79
+ switch (code) {
80
+ case mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.invalidParams:
81
+ return 'Invalid params';
82
+ case mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.forbidden:
83
+ return 'Forbidden';
84
+ case mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.conflict:
85
+ return 'Conflict';
86
+ case mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.methodNotFound:
87
+ return 'Method not found';
88
+ default:
89
+ return 'Internal error';
90
+ }
91
+ }
92
+ /** Drops the undefined fields, so the serialized data stays compact. */
93
+ static withoutUndefined(data) {
94
+ Object.keys(data).forEach((key) => {
95
+ if (data[key] === undefined) {
96
+ delete data[key];
97
+ }
98
+ });
99
+ return data;
100
+ }
101
+ }
102
+ exports.DyNTS_McpError_Util = DyNTS_McpError_Util;
103
+ //# sourceMappingURL=mcp-error.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-error.util.js","sourceRoot":"","sources":["../../../../src/_modules/mcp/_collections/mcp-error.util.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,iFAA6E;AAC7E,qEAAuE;AACvE,6FAA6F;AAK7F;;;;;;;;;;;;GAYG;AACH,MAAa,mBAAmB;IAC9B;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,GAAiE;QACrF,MAAM,KAAK,GAAY,GAAG,CAAC,KAAK,CAAC;QAEjC,IAAI,KAAK,YAAY,oCAAmB,EAAE,CAAC;YACzC,MAAM,IAAI,GAAwB;gBAChC,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,WAAW,EAAE,KAAK,CAAC,OAAO;gBAC1B,GAAG,KAAK,CAAC,IAAI;gBACb,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM;aACzC,CAAC;YAEF,IAAI,KAAK,YAAY,0DAA6B,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;gBAC7F,IAAI,CAAC,YAAY,GAAG,CAAE,GAAG,GAAG,CAAC,YAAY,CAAE,CAAC;YAC9C,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IA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CAAC;QAED,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YACvD,OAAO,kDAAuB,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,kDAAuB,CAAC,QAAQ,CAAC;IAC1C,CAAC;IAED,8CAA8C;IACtC,MAAM,CAAC,OAAO,CAAC,IAA6B;QAClD,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,kDAAuB,CAAC,aAAa;gBACxC,OAAO,gBAAgB,CAAC;YAC1B,KAAK,kDAAuB,CAAC,SAAS;gBACpC,OAAO,WAAW,CAAC;YACrB,KAAK,kDAAuB,CAAC,QAAQ;gBACnC,OAAO,UAAU,CAAC;YACpB,KAAK,kDAAuB,CAAC,cAAc;gBACzC,OAAO,kBAAkB,CAAC;YAC5B;gBACE,OAAO,gBAAgB,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,wEAAwE;IAChE,MAAM,CAAC,gBAAgB,CAAC,IAAyB;QACvD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAQ,EAAE;YAC9C,IAAK,IAA2C,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;gBACpE,OAAQ,IAA2C,CAAC,GAAG,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA7FD,kDA6FC"}
@@ -0,0 +1,74 @@
1
+ import { DyNTS_Mcp_Settings } from '../_models/interfaces/mcp-settings.interface';
2
+ /**
3
+ * Opaque, agent-friendly entity references (HP-DOPL MP-3.7, DMCP-008) — lifted from the organizer `Mcp_Ref_Util`:
4
+ * `<system>:<namespace>:<id>` (e.g. `org:note:01H…`). The agent never builds an id path, it passes the ref back.
5
+ *
6
+ * Bedrock differences to the organizer original:
7
+ * - the system prefix is not hard-coded (`org`): it comes from `mcp_settings.refSystem` or the call;
8
+ * - the namespace is any consumer string (usually the consumer's own enum), so the bedrock knows no entity;
9
+ * - the `id` is everything after the second `:` (an id may contain `:`), exactly as in the organizer.
10
+ *
11
+ * ⭐ The etag of the same entity is `DyFM_OperationGuardrails_Util.buildEtag(entity.__v)` (fsm, MP-1.2) — the organizer
12
+ * `buildEtag` format, so both refs and etags stay compatible with the organizer MCP.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * DyNTS_global_settings.mcp_settings = { refSystem: 'org' };
17
+ * const ref: string = DyNTS_McpRef_Util.toRef({ namespace: 'note', id: note._id }); // 'org:note:01H…'
18
+ * const { id } = DyNTS_McpRef_Util.parseAndValidateRef({ ref: args.ref, namespace: 'note', method: 'notes.get' });
19
+ * ```
20
+ */
21
+ export declare class DyNTS_McpRef_Util {
22
+ /**
23
+ * Builds the ref of an entity.
24
+ * @param set.namespace - the entity namespace (e.g. `note`)
25
+ * @param set.id - the entity id
26
+ * @param set.system - the system prefix (default: `mcp_settings.refSystem`)
27
+ * @throws 500 `DyNTS-MRF-CFG` when no system is configured or a segment/id is invalid
28
+ */
29
+ static toRef(set: {
30
+ namespace: string;
31
+ id: string;
32
+ system?: string;
33
+ settings?: DyNTS_Mcp_Settings | null;
34
+ }): string;
35
+ /**
36
+ * Splits a ref of the configured system; anything else is `null` (never throws).
37
+ * @param set.ref - the ref from the caller
38
+ * @param set.system - the system prefix (default: `mcp_settings.refSystem`)
39
+ */
40
+ static parseRef(set: {
41
+ ref: unknown;
42
+ system?: string;
43
+ settings?: DyNTS_Mcp_Settings | null;
44
+ }): {
45
+ system: string;
46
+ namespace: string;
47
+ id: string;
48
+ } | null;
49
+ /**
50
+ * Parses the ref and checks its namespace — the input guard of a tool that takes a ref.
51
+ * @param set.ref - the ref from the caller
52
+ * @param set.namespace - the accepted namespace(s)
53
+ * @param set.method - the tool name, for the error data
54
+ * @param set.field - the argument name (default: `ref`, e.g. `parentRef`)
55
+ * @throws `DyNTS_Mcp_InvalidParamsError` (-32602) with field / received / expected / suggestion data
56
+ */
57
+ static parseAndValidateRef(set: {
58
+ ref: unknown;
59
+ namespace: string | string[];
60
+ method: string;
61
+ field?: string;
62
+ system?: string;
63
+ settings?: DyNTS_Mcp_Settings | null;
64
+ }): {
65
+ system: string;
66
+ namespace: string;
67
+ id: string;
68
+ };
69
+ /** The system prefix of a call, validated. */
70
+ private static systemOf;
71
+ /** A server configuration error (not the caller's fault). */
72
+ private static configError;
73
+ }
74
+ //# sourceMappingURL=mcp-ref.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-ref.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/mcp/_collections/mcp-ref.util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAMlF;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAAE,GAAG,MAAM;IAanH;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE;QACnB,GAAG,EAAE,OAAO,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;KACtC,GAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAgB5D;;;;;;;OAOG;IACH,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE;QAC9B,GAAG,EAAE,OAAO,CAAC;QACb,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC7B,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;KACtC,GAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE;IAkCrD,8CAA8C;IAC9C,OAAO,CAAC,MAAM,CAAC,QAAQ;IAavB,6DAA6D;IAC7D,OAAO,CAAC,MAAM,CAAC,WAAW;CAO3B"}
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_McpRef_Util = void 0;
4
+ const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
5
+ const global_settings_const_1 = require("../../../_collections/global-settings.const");
6
+ const mcp_invalid_params_error_1 = require("../_models/errors/mcp-invalid-params.error");
7
+ /** A ref segment (system or namespace): starts with a letter, letters/digits/`_`/`-`, no `:`. */
8
+ const DyNTS_mcpRefSegment = /^[A-Za-z][A-Za-z0-9_-]*$/;
9
+ /**
10
+ * Opaque, agent-friendly entity references (HP-DOPL MP-3.7, DMCP-008) — lifted from the organizer `Mcp_Ref_Util`:
11
+ * `<system>:<namespace>:<id>` (e.g. `org:note:01H…`). The agent never builds an id path, it passes the ref back.
12
+ *
13
+ * Bedrock differences to the organizer original:
14
+ * - the system prefix is not hard-coded (`org`): it comes from `mcp_settings.refSystem` or the call;
15
+ * - the namespace is any consumer string (usually the consumer's own enum), so the bedrock knows no entity;
16
+ * - the `id` is everything after the second `:` (an id may contain `:`), exactly as in the organizer.
17
+ *
18
+ * ⭐ The etag of the same entity is `DyFM_OperationGuardrails_Util.buildEtag(entity.__v)` (fsm, MP-1.2) — the organizer
19
+ * `buildEtag` format, so both refs and etags stay compatible with the organizer MCP.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * DyNTS_global_settings.mcp_settings = { refSystem: 'org' };
24
+ * const ref: string = DyNTS_McpRef_Util.toRef({ namespace: 'note', id: note._id }); // 'org:note:01H…'
25
+ * const { id } = DyNTS_McpRef_Util.parseAndValidateRef({ ref: args.ref, namespace: 'note', method: 'notes.get' });
26
+ * ```
27
+ */
28
+ class DyNTS_McpRef_Util {
29
+ /**
30
+ * Builds the ref of an entity.
31
+ * @param set.namespace - the entity namespace (e.g. `note`)
32
+ * @param set.id - the entity id
33
+ * @param set.system - the system prefix (default: `mcp_settings.refSystem`)
34
+ * @throws 500 `DyNTS-MRF-CFG` when no system is configured or a segment/id is invalid
35
+ */
36
+ static toRef(set) {
37
+ const system = DyNTS_McpRef_Util.systemOf(set.system, set.settings);
38
+ if (!DyNTS_mcpRefSegment.test(set.namespace ?? '') || typeof set.id !== 'string' || !set.id) {
39
+ throw DyNTS_McpRef_Util.configError(`a ref needs a namespace (letters, digits, "_", "-") and a non-empty id (got: ${JSON.stringify(set.namespace)}, ` +
40
+ `${JSON.stringify(set.id)})`);
41
+ }
42
+ return `${system}:${set.namespace}:${set.id}`;
43
+ }
44
+ /**
45
+ * Splits a ref of the configured system; anything else is `null` (never throws).
46
+ * @param set.ref - the ref from the caller
47
+ * @param set.system - the system prefix (default: `mcp_settings.refSystem`)
48
+ */
49
+ static parseRef(set) {
50
+ const system = DyNTS_McpRef_Util.systemOf(set.system, set.settings);
51
+ const prefix = `${system}:`;
52
+ if (typeof set.ref !== 'string' || !set.ref.startsWith(prefix)) {
53
+ return null;
54
+ }
55
+ const rest = set.ref.slice(prefix.length);
56
+ const colon = rest.indexOf(':');
57
+ const namespace = colon > 0 ? rest.slice(0, colon) : '';
58
+ const id = colon > 0 ? rest.slice(colon + 1) : '';
59
+ return DyNTS_mcpRefSegment.test(namespace) && id ? { system: system, namespace: namespace, id: id } : null;
60
+ }
61
+ /**
62
+ * Parses the ref and checks its namespace — the input guard of a tool that takes a ref.
63
+ * @param set.ref - the ref from the caller
64
+ * @param set.namespace - the accepted namespace(s)
65
+ * @param set.method - the tool name, for the error data
66
+ * @param set.field - the argument name (default: `ref`, e.g. `parentRef`)
67
+ * @throws `DyNTS_Mcp_InvalidParamsError` (-32602) with field / received / expected / suggestion data
68
+ */
69
+ static parseAndValidateRef(set) {
70
+ const system = DyNTS_McpRef_Util.systemOf(set.system, set.settings);
71
+ const accepted = Array.isArray(set.namespace) ? set.namespace : [set.namespace];
72
+ const field = set.field ?? 'ref';
73
+ const parsed = DyNTS_McpRef_Util.parseRef({ ref: set.ref, system: system });
74
+ const expected = `${field}: string, format ${system}:<namespace>:<id> (namespace: ${accepted.join(' | ')})`;
75
+ if (!parsed) {
76
+ throw new mcp_invalid_params_error_1.DyNTS_Mcp_InvalidParamsError(`Invalid ${field} format: ${String(set.ref)}`, {
77
+ data: {
78
+ message: `Invalid ${field} format: ${String(set.ref)}`,
79
+ userMessage: `The ${field} is not valid. A ref looks like ${system}:<namespace>:<id>.`,
80
+ method: set.method, field: field, received: set.ref, expected: expected,
81
+ suggestion: `Pass back a ${field} exactly as a previous tool result returned it.`,
82
+ },
83
+ });
84
+ }
85
+ if (!accepted.includes(parsed.namespace)) {
86
+ const message = `Invalid ${field} namespace: expected '${accepted.join("' or '")}' but got '${parsed.namespace}'`;
87
+ throw new mcp_invalid_params_error_1.DyNTS_Mcp_InvalidParamsError(message, {
88
+ data: {
89
+ message: message, userMessage: message, method: set.method, field: field, received: set.ref, expected: expected,
90
+ suggestion: `Use a ${field} of a ${accepted.join(' or ')} entity.`,
91
+ },
92
+ });
93
+ }
94
+ return parsed;
95
+ }
96
+ /** The system prefix of a call, validated. */
97
+ static systemOf(system, settings) {
98
+ const resolved = system ?? (settings === undefined ?
99
+ global_settings_const_1.DyNTS_global_settings.mcp_settings?.refSystem : settings?.refSystem);
100
+ if (!resolved || !DyNTS_mcpRefSegment.test(resolved)) {
101
+ throw DyNTS_McpRef_Util.configError(`the ref system is missing or invalid (got: ${JSON.stringify(resolved)}) - set mcp_settings.refSystem (e.g. 'org')`);
102
+ }
103
+ return resolved;
104
+ }
105
+ /** A server configuration error (not the caller's fault). */
106
+ static configError(message) {
107
+ return new fsm_dynamo_1.DyFM_Error({
108
+ status: 500,
109
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MRF-CFG`,
110
+ message: `DyNTS_McpRef_Util: ${message}`,
111
+ });
112
+ }
113
+ }
114
+ exports.DyNTS_McpRef_Util = DyNTS_McpRef_Util;
115
+ //# sourceMappingURL=mcp-ref.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-ref.util.js","sourceRoot":"","sources":["../../../../src/_modules/mcp/_collections/mcp-ref.util.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,uFAAoF;AACpF,yFAA0F;AAI1F,iGAAiG;AACjG,MAAM,mBAAmB,GAAW,0BAA0B,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,iBAAiB;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,GAA6F;QACxG,MAAM,MAAM,GAAW,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QAE5E,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YAC5F,MAAM,iBAAiB,CAAC,WAAW,CACjC,gFAAgF,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI;gBACjH,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAC7B,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,MAAM,IAAI,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,GAIf;QACC,MAAM,MA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AAE,QAAQ,EAAE,QAAQ;oBAC/G,UAAU,EAAE,SAAS,KAAK,SAAS,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU;iBACnE;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,8CAA8C;IACtC,MAAM,CAAC,QAAQ,CAAC,MAA0B,EAAE,QAA+C;QACjG,MAAM,QAAQ,GAAuB,MAAM,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;YACtE,6CAAqB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAEvE,IAAI,CAAC,QAAQ,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrD,MAAM,iBAAiB,CAAC,WAAW,CACjC,8CAA8C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,6CAA6C,CACpH,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,6DAA6D;IACrD,MAAM,CAAC,WAAW,CAAC,OAAe;QACxC,OAAO,IAAI,uBAAU,CAAC;YACpB,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,gBAAgB;YACvE,OAAO,EAAE,sBAAsB,OAAO,EAAE;SACzC,CAAC,CAAC;IACL,CAAC;CACF;AArHD,8CAqHC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * JSON-RPC error codes of the MCP layer (HP-DOPL MP-3.6, DMCP-006) — lifted from the organizer MCP server, where they
3
+ * are in production. The standard JSON-RPC codes plus two server-defined codes (-32000…-32099 range).
4
+ */
5
+ export declare enum DyNTS_McpErrorCode_Type {
6
+ /** JSON-RPC: the method does not exist. */
7
+ methodNotFound = -32601,
8
+ /** JSON-RPC: invalid method parameters (also used for a missing entity, as in the organizer). */
9
+ invalidParams = -32602,
10
+ /** JSON-RPC: internal error. */
11
+ internal = -32603,
12
+ /** Server-defined: optimistic concurrency conflict (etag / If-Match mismatch). */
13
+ conflict = -32001,
14
+ /** Server-defined: the caller is not allowed (unauthenticated, missing scope, protected entity). */
15
+ forbidden = -32002
16
+ }
17
+ //# sourceMappingURL=mcp-error-code.type-enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-error-code.type-enum.d.ts","sourceRoot":"","sources":["../../../../src/_modules/mcp/_enums/mcp-error-code.type-enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,uBAAuB;IACjC,2CAA2C;IAC3C,cAAc,SAAS;IACvB,iGAAiG;IACjG,aAAa,SAAS;IACtB,gCAAgC;IAChC,QAAQ,SAAS;IACjB,kFAAkF;IAClF,QAAQ,SAAS;IACjB,oGAAoG;IACpG,SAAS,SAAS;CACnB"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_McpErrorCode_Type = void 0;
4
+ /**
5
+ * JSON-RPC error codes of the MCP layer (HP-DOPL MP-3.6, DMCP-006) — lifted from the organizer MCP server, where they
6
+ * are in production. The standard JSON-RPC codes plus two server-defined codes (-32000…-32099 range).
7
+ */
8
+ var DyNTS_McpErrorCode_Type;
9
+ (function (DyNTS_McpErrorCode_Type) {
10
+ /** JSON-RPC: the method does not exist. */
11
+ DyNTS_McpErrorCode_Type[DyNTS_McpErrorCode_Type["methodNotFound"] = -32601] = "methodNotFound";
12
+ /** JSON-RPC: invalid method parameters (also used for a missing entity, as in the organizer). */
13
+ DyNTS_McpErrorCode_Type[DyNTS_McpErrorCode_Type["invalidParams"] = -32602] = "invalidParams";
14
+ /** JSON-RPC: internal error. */
15
+ DyNTS_McpErrorCode_Type[DyNTS_McpErrorCode_Type["internal"] = -32603] = "internal";
16
+ /** Server-defined: optimistic concurrency conflict (etag / If-Match mismatch). */
17
+ DyNTS_McpErrorCode_Type[DyNTS_McpErrorCode_Type["conflict"] = -32001] = "conflict";
18
+ /** Server-defined: the caller is not allowed (unauthenticated, missing scope, protected entity). */
19
+ DyNTS_McpErrorCode_Type[DyNTS_McpErrorCode_Type["forbidden"] = -32002] = "forbidden";
20
+ })(DyNTS_McpErrorCode_Type || (exports.DyNTS_McpErrorCode_Type = DyNTS_McpErrorCode_Type = {}));
21
+ //# sourceMappingURL=mcp-error-code.type-enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-error-code.type-enum.js","sourceRoot":"","sources":["../../../../src/_modules/mcp/_enums/mcp-error-code.type-enum.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,uBAWX;AAXD,WAAY,uBAAuB;IACjC,2CAA2C;IAC3C,8FAAuB,CAAA;IACvB,iGAAiG;IACjG,4FAAsB,CAAA;IACtB,gCAAgC;IAChC,kFAAiB,CAAA;IACjB,kFAAkF;IAClF,kFAAiB,CAAA;IACjB,oGAAoG;IACpG,oFAAkB,CAAA;AACpB,CAAC,EAXW,uBAAuB,uCAAvB,uBAAuB,QAWlC"}
@@ -1,4 +1,4 @@
1
- import { DyFM_Operation_JsonSchema, DyFM_Operation_Settings } from '@futdevpro/fsm-dynamo';
1
+ import { DyFM_Operation_Context, DyFM_Operation_JsonSchema, DyFM_Operation_Settings } from '@futdevpro/fsm-dynamo';
2
2
  import { DyNTS_McpToolExposure_Type } from '../../_enums/mcp-tool-exposure.type-enum';
3
3
  import { DyNTS_Mcp_Settings } from '../interfaces/mcp-settings.interface';
4
4
  /**
@@ -14,6 +14,9 @@ import { DyNTS_Mcp_Settings } from '../interfaces/mcp-settings.interface';
14
14
  * const getNoteTool: DyNTS_McpTool_Params = new DyNTS_McpTool_Params({
15
15
  * operation: getNote, // name: 'notes.get'
16
16
  * exposure: DyNTS_McpToolExposure_Type.readOnly,
17
+ * // agent-friendly output (DMCP-011): may be async and use the caller context, e.g. for a parent name lookup
18
+ * outputMapper: async (note: Note, ctx: DyFM_Operation_Context): Promise<NoteResult> =>
19
+ * NoteMapper.toResult(note, await loadParentName(note, ctx.issuer)),
17
20
  * });
18
21
  * // getNoteTool.getToolName() === 'notes.get' (or 'organizer.notes.get' with mcp_settings.toolPrefix)
19
22
  * ```
@@ -33,6 +36,13 @@ export declare class DyNTS_McpTool_Params {
33
36
  readonly isHeavy: boolean;
34
37
  /** Source location of the construction, for debugging a misconfigured tool. */
35
38
  readonly stackLocation: string;
39
+ /**
40
+ * Maps the operation result to the agent-facing tool output (HP-DOPL MP-3.3, DMCP-011, D-8) — e.g. an entity to
41
+ * `{ ref, etag, summary }`. May be async and may use the caller context (`ctx.issuer`) for lookups; missing = the
42
+ * operation result goes out unchanged. REST is never affected: the mapper runs only on the MCP path.
43
+ * Method syntax on purpose: a typed mapper stays assignable under `strictFunctionTypes`.
44
+ */
45
+ outputMapper?(result: unknown, ctx: DyFM_Operation_Context): unknown;
36
46
  /**
37
47
  * Validates the settings and applies the defaults.
38
48
  * @param set - the tool settings; throws a coded `DyFM_Error` when invalid
@@ -44,8 +54,16 @@ export declare class DyNTS_McpTool_Params {
44
54
  exposure?: DyNTS_McpToolExposure_Type;
45
55
  inputSchema?: DyFM_Operation_JsonSchema;
46
56
  isHeavy?: boolean;
57
+ outputMapper?(result: unknown, ctx: DyFM_Operation_Context): unknown;
47
58
  stackLocation?: string;
48
59
  });
60
+ /**
61
+ * The tool output of an operation result: the `outputMapper` result, or the operation result unchanged.
62
+ * @param result - the operation result
63
+ * @param ctx - the context of the call
64
+ * @throws the mapper's coded `DyFM_Error` unchanged · 500 `DyNTS-MTP-MAP` for any other mapper failure
65
+ */
66
+ mapOutput(result: unknown, ctx: DyFM_Operation_Context): Promise<unknown>;
49
67
  /**
50
68
  * The advertised tool name: the server prefix (`mcp_settings.toolPrefix`) + the tool name.
51
69
  * @param settings - the MCP settings (default: `DyNTS_global_settings.mcp_settings`)
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tool-params.control-model.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/control-models/mcp-tool-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4FAA4F;IAC5F,OAAO,CAAC,MAAM,CAAC,OAAO;CAQvB"}
1
+ {"version":3,"file":"mcp-tool-params.control-model.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/control-models/mcp-tool-params.control-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAC0C,sBAAsB,EAAE,yBAAyB,EAChG,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,oBAAoB;IAC/B,oCAAoC;IACpC,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACzE,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,0BAA0B,CAAC;IAC9C,yGAAyG;IACzG,QAAQ,CAAC,WAAW,EAAE,yBAAyB,CAAC;IAChD,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;;;;OAKG;IACH,YAAY,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO;IAEpE;;;OAGG;gBACS,GAAG,EAAE;QACf,SAAS,EAAE,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,0BAA0B,CAAC;QACtC,WAAW,CAAC,EAAE,yBAAyB,CAAC;QACxC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,YAAY,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC;QACrE,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;IAsED;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAsB/E;;;;OAIG;IACH,WAAW,CAAC,QAAQ,GAAE,kBAAkB,GAAG,IAAyC,GAAG,MAAM;IAY7F;;;OAGG;IACH,YAAY,CAAC,QAAQ,GAAE,kBAAkB,GAAG,IAAyC,GAAG,OAAO;IAQ/F,4FAA4F;IAC5F,OAAO,CAAC,MAAM,CAAC,OAAO;CAQvB"}
@@ -19,6 +19,9 @@ const DyNTS_mcpToolName = /^[A-Za-z0-9_.-]{1,128}$/;
19
19
  * const getNoteTool: DyNTS_McpTool_Params = new DyNTS_McpTool_Params({
20
20
  * operation: getNote, // name: 'notes.get'
21
21
  * exposure: DyNTS_McpToolExposure_Type.readOnly,
22
+ * // agent-friendly output (DMCP-011): may be async and use the caller context, e.g. for a parent name lookup
23
+ * outputMapper: async (note: Note, ctx: DyFM_Operation_Context): Promise<NoteResult> =>
24
+ * NoteMapper.toResult(note, await loadParentName(note, ctx.issuer)),
22
25
  * });
23
26
  * // getNoteTool.getToolName() === 'notes.get' (or 'organizer.notes.get' with mcp_settings.toolPrefix)
24
27
  * ```
@@ -71,6 +74,9 @@ class DyNTS_McpTool_Params {
71
74
  if (set.isHeavy !== undefined && typeof set.isHeavy !== 'boolean') {
72
75
  throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-HVY', `isHeavy must be a boolean (tool "${tool}")`, stackLocation);
73
76
  }
77
+ if (set.outputMapper !== undefined && typeof set.outputMapper !== 'function') {
78
+ throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-OMP', `outputMapper must be a function (tool "${tool}")`, stackLocation);
79
+ }
74
80
  this.operation = operation;
75
81
  this.tool = tool;
76
82
  this.description = set.description ?? operation.description;
@@ -78,6 +84,35 @@ class DyNTS_McpTool_Params {
78
84
  this.inputSchema = set.inputSchema ?? fsm_dynamo_1.DyFM_OperationSchema_Util.inputSchema(operation);
79
85
  this.isHeavy = set.isHeavy === true;
80
86
  this.stackLocation = stackLocation;
87
+ if (set.outputMapper) {
88
+ this.outputMapper = set.outputMapper;
89
+ }
90
+ }
91
+ /**
92
+ * The tool output of an operation result: the `outputMapper` result, or the operation result unchanged.
93
+ * @param result - the operation result
94
+ * @param ctx - the context of the call
95
+ * @throws the mapper's coded `DyFM_Error` unchanged · 500 `DyNTS-MTP-MAP` for any other mapper failure
96
+ */
97
+ async mapOutput(result, ctx) {
98
+ if (!this.outputMapper) {
99
+ return result;
100
+ }
101
+ try {
102
+ return await this.outputMapper(result, ctx);
103
+ }
104
+ catch (error) {
105
+ if (error instanceof fsm_dynamo_1.DyFM_Error) {
106
+ throw error;
107
+ }
108
+ throw new fsm_dynamo_1.DyFM_Error({
109
+ status: 500,
110
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MTP-MAP`,
111
+ message: `the outputMapper of tool "${this.tool}" failed: ${error?.message}`,
112
+ error: error,
113
+ additionalContent: { tool: this.tool, requestId: ctx?.requestId, stackLocation: this.stackLocation },
114
+ });
115
+ }
81
116
  }
82
117
  /**
83
118
  * The advertised tool name: the server prefix (`mcp_settings.toolPrefix`) + the tool name.
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tool-params.control-model.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/control-models/mcp-tool-params.control-model.ts"],"names":[],"mappings":";;;AAAA,sDAG+B;AAE/B,0FAAuF;AACvF,0FAAsF;AAItF,sGAAsG;AACtG,MAAM,iBAAiB,GAAW,yBAAyB,CAAC;AAE5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,oBAAoB;IAC/B,oCAA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AAC;IAED;;;;OAIG;IACH,WAAW,CAAC,WAAsC,6CAAqB,CAAC,YAAY;QAClF,MAAM,IAAI,GAAW,GAAG,QAAQ,EAAE,UAAU,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAEjE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,MAAM,oBAAoB,CAAC,OAAO,CAChC,eAAe,EAAE,sCAAsC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,CAClG,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,WAAsC,6CAAqB,CAAC,YAAY;QACnF,IAAI,IAAI,CAAC,QAAQ,KAAK,wDAA0B,CAAC,IAAI,EAAE,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,wDAA0B,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACpG,CAAC;IAED,4FAA4F;IACpF,MAAM,CAAC,OAAO,CAAC,IAAY,EAAE,MAAc,EAAE,aAAqB;QACxE,OAAO,IAAI,uBAAU,CAAC;YACpB,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,IAAI,IAAI,EAAE;YACjE,OAAO,EAAE,6CAA6C,MAAM,EAAE;YAC9D,iBAAiB,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AA9HD,oDA8HC"}
1
+ {"version":3,"file":"mcp-tool-params.control-model.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/control-models/mcp-tool-params.control-model.ts"],"names":[],"mappings":";;;AAAA,sDAG+B;AAE/B,0FAAuF;AACvF,0FAAsF;AAItF,sGAAs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AClF,MAAM,IAAI,GAAW,GAAG,QAAQ,EAAE,UAAU,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAEjE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,MAAM,oBAAoB,CAAC,OAAO,CAChC,eAAe,EAAE,sCAAsC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,CAClG,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,WAAsC,6CAAqB,CAAC,YAAY;QACnF,IAAI,IAAI,CAAC,QAAQ,KAAK,wDAA0B,CAAC,IAAI,EAAE,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,wDAA0B,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACpG,CAAC;IAED,4FAA4F;IACpF,MAAM,CAAC,OAAO,CAAC,IAAY,EAAE,MAAc,EAAE,aAAqB;QACxE,OAAO,IAAI,uBAAU,CAAC;YACpB,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,IAAI,IAAI,EAAE;YACjE,OAAO,EAAE,6CAA6C,MAAM,EAAE;YAC9D,iBAAiB,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AA7KD,oDA6KC"}
@@ -0,0 +1,7 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_ErrorBase } from './mcp.error-base';
3
+ /** JSON-RPC -32001 Conflict — optimistic concurrency (etag / If-Match mismatch). (HP-DOPL MP-3.6, lifted from the organizer.) */
4
+ export declare class DyNTS_Mcp_ConflictError extends DyNTS_Mcp_ErrorBase {
5
+ readonly code: DyNTS_McpErrorCode_Type;
6
+ }
7
+ //# sourceMappingURL=mcp-conflict.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-conflict.error.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-conflict.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,iIAAiI;AACjI,qBAAa,uBAAwB,SAAQ,mBAAmB;IAC9D,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAoC;CAC3E"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_Mcp_ConflictError = void 0;
4
+ const mcp_error_code_type_enum_1 = require("../../_enums/mcp-error-code.type-enum");
5
+ const mcp_error_base_1 = require("./mcp.error-base");
6
+ /** JSON-RPC -32001 Conflict — optimistic concurrency (etag / If-Match mismatch). (HP-DOPL MP-3.6, lifted from the organizer.) */
7
+ class DyNTS_Mcp_ConflictError extends mcp_error_base_1.DyNTS_Mcp_ErrorBase {
8
+ code = mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.conflict;
9
+ }
10
+ exports.DyNTS_Mcp_ConflictError = DyNTS_Mcp_ConflictError;
11
+ //# sourceMappingURL=mcp-conflict.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-conflict.error.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-conflict.error.ts"],"names":[],"mappings":";;;AAAA,oFAAgF;AAEhF,qDAAuD;AAGvD,iIAAiI;AACjI,MAAa,uBAAwB,SAAQ,oCAAmB;IACrD,IAAI,GAA4B,kDAAuB,CAAC,QAAQ,CAAC;CAC3E;AAFD,0DAEC"}
@@ -0,0 +1,7 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_ErrorBase } from './mcp.error-base';
3
+ /** JSON-RPC -32002 Forbidden — not allowed for the caller (protected or locked entity, missing scope). (HP-DOPL MP-3.6, lifted from the organizer.) */
4
+ export declare class DyNTS_Mcp_ForbiddenError extends DyNTS_Mcp_ErrorBase {
5
+ readonly code: DyNTS_McpErrorCode_Type;
6
+ }
7
+ //# sourceMappingURL=mcp-forbidden.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-forbidden.error.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-forbidden.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,uJAAuJ;AACvJ,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC/D,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAqC;CAC5E"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_Mcp_ForbiddenError = void 0;
4
+ const mcp_error_code_type_enum_1 = require("../../_enums/mcp-error-code.type-enum");
5
+ const mcp_error_base_1 = require("./mcp.error-base");
6
+ /** JSON-RPC -32002 Forbidden — not allowed for the caller (protected or locked entity, missing scope). (HP-DOPL MP-3.6, lifted from the organizer.) */
7
+ class DyNTS_Mcp_ForbiddenError extends mcp_error_base_1.DyNTS_Mcp_ErrorBase {
8
+ code = mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.forbidden;
9
+ }
10
+ exports.DyNTS_Mcp_ForbiddenError = DyNTS_Mcp_ForbiddenError;
11
+ //# sourceMappingURL=mcp-forbidden.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-forbidden.error.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-forbidden.error.ts"],"names":[],"mappings":";;;AAAA,oFAAgF;AAEhF,qDAAuD;AAGvD,uJAAuJ;AACvJ,MAAa,wBAAyB,SAAQ,oCAAmB;IACtD,IAAI,GAA4B,kDAAuB,CAAC,SAAS,CAAC;CAC5E;AAFD,4DAEC"}
@@ -0,0 +1,7 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_ErrorBase } from './mcp.error-base';
3
+ /** JSON-RPC -32603 Internal error — the message must stay generic; details go to the server log. (HP-DOPL MP-3.6, lifted from the organizer.) */
4
+ export declare class DyNTS_Mcp_InternalError extends DyNTS_Mcp_ErrorBase {
5
+ readonly code: DyNTS_McpErrorCode_Type;
6
+ }
7
+ //# sourceMappingURL=mcp-internal.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-internal.error.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-internal.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,iJAAiJ;AACjJ,qBAAa,uBAAwB,SAAQ,mBAAmB;IAC9D,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAoC;CAC3E"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_Mcp_InternalError = void 0;
4
+ const mcp_error_code_type_enum_1 = require("../../_enums/mcp-error-code.type-enum");
5
+ const mcp_error_base_1 = require("./mcp.error-base");
6
+ /** JSON-RPC -32603 Internal error — the message must stay generic; details go to the server log. (HP-DOPL MP-3.6, lifted from the organizer.) */
7
+ class DyNTS_Mcp_InternalError extends mcp_error_base_1.DyNTS_Mcp_ErrorBase {
8
+ code = mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.internal;
9
+ }
10
+ exports.DyNTS_Mcp_InternalError = DyNTS_Mcp_InternalError;
11
+ //# sourceMappingURL=mcp-internal.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-internal.error.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-internal.error.ts"],"names":[],"mappings":";;;AAAA,oFAAgF;AAEhF,qDAAuD;AAGvD,iJAAiJ;AACjJ,MAAa,uBAAwB,SAAQ,oCAAmB;IACrD,IAAI,GAA4B,kDAAuB,CAAC,QAAQ,CAAC;CAC3E;AAFD,0DAEC"}
@@ -0,0 +1,7 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_ErrorBase } from './mcp.error-base';
3
+ /** JSON-RPC -32602 Invalid params — a missing or malformed input, or a missing entity. (HP-DOPL MP-3.6, lifted from the organizer.) */
4
+ export declare class DyNTS_Mcp_InvalidParamsError extends DyNTS_Mcp_ErrorBase {
5
+ readonly code: DyNTS_McpErrorCode_Type;
6
+ }
7
+ //# sourceMappingURL=mcp-invalid-params.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-invalid-params.error.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-invalid-params.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,uIAAuI;AACvI,qBAAa,4BAA6B,SAAQ,mBAAmB;IACnE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAyC;CAChF"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_Mcp_InvalidParamsError = void 0;
4
+ const mcp_error_code_type_enum_1 = require("../../_enums/mcp-error-code.type-enum");
5
+ const mcp_error_base_1 = require("./mcp.error-base");
6
+ /** JSON-RPC -32602 Invalid params — a missing or malformed input, or a missing entity. (HP-DOPL MP-3.6, lifted from the organizer.) */
7
+ class DyNTS_Mcp_InvalidParamsError extends mcp_error_base_1.DyNTS_Mcp_ErrorBase {
8
+ code = mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.invalidParams;
9
+ }
10
+ exports.DyNTS_Mcp_InvalidParamsError = DyNTS_Mcp_InvalidParamsError;
11
+ //# sourceMappingURL=mcp-invalid-params.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-invalid-params.error.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-invalid-params.error.ts"],"names":[],"mappings":";;;AAAA,oFAAgF;AAEhF,qDAAuD;AAGvD,uIAAuI;AACvI,MAAa,4BAA6B,SAAQ,oCAAmB;IAC1D,IAAI,GAA4B,kDAAuB,CAAC,aAAa,CAAC;CAChF;AAFD,oEAEC"}
@@ -0,0 +1,7 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_ErrorBase } from './mcp.error-base';
3
+ /** JSON-RPC -32601 Method not found — an unknown tool / method (`data.validMethods` lists the valid ones). (HP-DOPL MP-3.6, lifted from the organizer.) */
4
+ export declare class DyNTS_Mcp_MethodNotFoundError extends DyNTS_Mcp_ErrorBase {
5
+ readonly code: DyNTS_McpErrorCode_Type;
6
+ }
7
+ //# sourceMappingURL=mcp-method-not-found.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-method-not-found.error.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-method-not-found.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,2JAA2J;AAC3J,qBAAa,6BAA8B,SAAQ,mBAAmB;IACpE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAA0C;CACjF"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_Mcp_MethodNotFoundError = void 0;
4
+ const mcp_error_code_type_enum_1 = require("../../_enums/mcp-error-code.type-enum");
5
+ const mcp_error_base_1 = require("./mcp.error-base");
6
+ /** JSON-RPC -32601 Method not found — an unknown tool / method (`data.validMethods` lists the valid ones). (HP-DOPL MP-3.6, lifted from the organizer.) */
7
+ class DyNTS_Mcp_MethodNotFoundError extends mcp_error_base_1.DyNTS_Mcp_ErrorBase {
8
+ code = mcp_error_code_type_enum_1.DyNTS_McpErrorCode_Type.methodNotFound;
9
+ }
10
+ exports.DyNTS_Mcp_MethodNotFoundError = DyNTS_Mcp_MethodNotFoundError;
11
+ //# sourceMappingURL=mcp-method-not-found.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-method-not-found.error.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp-method-not-found.error.ts"],"names":[],"mappings":";;;AAAA,oFAAgF;AAEhF,qDAAuD;AAGvD,2JAA2J;AAC3J,MAAa,6BAA8B,SAAQ,oCAAmB;IAC3D,IAAI,GAA4B,kDAAuB,CAAC,cAAc,CAAC;CACjF;AAFD,sEAEC"}
@@ -0,0 +1,21 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_ErrorData } from '../interfaces/mcp-error-data.interface';
3
+ /**
4
+ * Base of the MCP errors (HP-DOPL MP-3.6, DMCP-006) — lifted from the organizer `Mcp_*Error` classes: an `Error` with a
5
+ * JSON-RPC `code` and an optional structured `data`. The message and the data are sent to the caller as they are, so
6
+ * they must be written for the caller (see `DyNTS_McpError_Util`).
7
+ */
8
+ export declare abstract class DyNTS_Mcp_ErrorBase extends Error {
9
+ /** The JSON-RPC error code. */
10
+ abstract readonly code: DyNTS_McpErrorCode_Type;
11
+ /** Structured, caller-safe details. */
12
+ readonly data?: DyNTS_Mcp_ErrorData;
13
+ /**
14
+ * @param message - a caller-safe message
15
+ * @param options.data - structured, caller-safe details
16
+ */
17
+ constructor(message: string, options?: {
18
+ data?: DyNTS_Mcp_ErrorData;
19
+ });
20
+ }
21
+ //# sourceMappingURL=mcp.error-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.error-base.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp.error-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAG7E;;;;GAIG;AACH,8BAAsB,mBAAoB,SAAQ,KAAK;IACrD,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAChD,uCAAuC;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAEpC;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,mBAAmB,CAAA;KAAE;CAQtE"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_Mcp_ErrorBase = void 0;
4
+ /**
5
+ * Base of the MCP errors (HP-DOPL MP-3.6, DMCP-006) — lifted from the organizer `Mcp_*Error` classes: an `Error` with a
6
+ * JSON-RPC `code` and an optional structured `data`. The message and the data are sent to the caller as they are, so
7
+ * they must be written for the caller (see `DyNTS_McpError_Util`).
8
+ */
9
+ class DyNTS_Mcp_ErrorBase extends Error {
10
+ /** Structured, caller-safe details. */
11
+ data;
12
+ /**
13
+ * @param message - a caller-safe message
14
+ * @param options.data - structured, caller-safe details
15
+ */
16
+ constructor(message, options) {
17
+ super(message);
18
+ this.name = new.target.name;
19
+ if (options?.data !== undefined) {
20
+ this.data = options.data;
21
+ }
22
+ }
23
+ }
24
+ exports.DyNTS_Mcp_ErrorBase = DyNTS_Mcp_ErrorBase;
25
+ //# sourceMappingURL=mcp.error-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.error-base.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/errors/mcp.error-base.ts"],"names":[],"mappings":";;;AAIA;;;;GAIG;AACH,MAAsB,mBAAoB,SAAQ,KAAK;IAGrD,uCAAuC;IAC9B,IAAI,CAAuB;IAEpC;;;OAGG;IACH,YAAY,OAAe,EAAE,OAAwC;QACnE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;QAE5B,IAAI,OAAO,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAChC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3B,CAAC;IACH,CAAC;CACF;AAlBD,kDAkBC"}
@@ -0,0 +1,32 @@
1
+ import { DyNTS_Mcp_ValidationErrorItem } from './mcp-validation-error-item.interface';
2
+ /**
3
+ * The structured `error.data` of every MCP error (HP-DOPL MP-3.6, DMCP-006; lifted from the organizer `MCP_ErrorData`) —
4
+ * detailed, helpful data for the agent. ⚠️ Never put an internal error message here: only text meant for the caller.
5
+ */
6
+ export interface DyNTS_Mcp_ErrorData {
7
+ /** Short technical summary, safe for the caller. */
8
+ message: string;
9
+ /** Human-readable text that may be shown to a user. */
10
+ userMessage?: string;
11
+ /** The called JSON-RPC method / tool. */
12
+ method?: string;
13
+ /** Correct usage of the method. */
14
+ usage?: string;
15
+ /** The invalid parameter (e.g. `ref`, `title`, `ifMatch`). */
16
+ field?: string;
17
+ /** What the caller sent — only a safe excerpt, never the whole body. */
18
+ received?: unknown;
19
+ /** The expected format or rule. */
20
+ expected?: string;
21
+ /** A concrete suggestion. */
22
+ suggestion?: string;
23
+ /** The internal error code (e.g. of a `DyFM_Error`) — a diagnostic handle, holds no secret. */
24
+ errorCode?: string;
25
+ /** Several invalid fields at once. */
26
+ validationErrors?: DyNTS_Mcp_ValidationErrorItem[];
27
+ /** The request id, when the error belongs to a request. */
28
+ requestId?: string;
29
+ /** Method not found: the valid method names. */
30
+ validMethods?: string[];
31
+ }
32
+ //# sourceMappingURL=mcp-error-data.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-error-data.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-error-data.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAGtF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,6BAA6B,EAAE,CAAC;IACnD,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=mcp-error-data.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-error-data.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-error-data.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { DyNTS_McpErrorCode_Type } from '../../_enums/mcp-error-code.type-enum';
2
+ import { DyNTS_Mcp_ErrorData } from './mcp-error-data.interface';
3
+ /** A JSON-RPC error object of the MCP layer (`{ code, message, data }`, HP-DOPL MP-3.6). */
4
+ export interface DyNTS_Mcp_JsonRpcError {
5
+ /** The JSON-RPC error code. */
6
+ code: DyNTS_McpErrorCode_Type;
7
+ /** A caller-safe message — never an internal error message. */
8
+ message: string;
9
+ /** Structured, caller-safe details. */
10
+ data: DyNTS_Mcp_ErrorData;
11
+ }
12
+ //# sourceMappingURL=mcp-json-rpc-error.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-json-rpc-error.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,4FAA4F;AAC5F,MAAM,WAAW,sBAAsB;IACrC,+BAA+B;IAC/B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,mBAAmB,CAAC;CAC3B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=mcp-json-rpc-error.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-json-rpc-error.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.ts"],"names":[],"mappings":""}
@@ -5,6 +5,8 @@
5
5
  export interface DyNTS_Mcp_Settings {
6
6
  /** Prepended to every generated tool name (e.g. `organizer.` → `organizer.notes.get`); default: none. */
7
7
  toolPrefix?: string;
8
+ /** The system prefix of entity refs (`<refSystem>:<namespace>:<id>`, e.g. `org`); required to use `DyNTS_McpRef_Util`. */
9
+ refSystem?: string;
8
10
  /** A read-only MCP server advertises only `read-only` tools; default: `false`. */
9
11
  readOnly?: boolean;
10
12
  /** How many HEAVY tool calls may run at once (DMCP-013 serialization); default: `1`. */
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-settings.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-settings.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,yGAAyG;IACzG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sHAAsH;IACtH,iCAAiC,CAAC,EAAE,OAAO,CAAC;CAC7C"}
1
+ {"version":3,"file":"mcp-settings.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-settings.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,yGAAyG;IACzG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0HAA0H;IAC1H,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sHAAsH;IACtH,iCAAiC,CAAC,EAAE,OAAO,CAAC;CAC7C"}
@@ -0,0 +1,8 @@
1
+ /** One invalid field of an MCP call (e.g. `ref`, `ifMatch`) — an item of `DyNTS_Mcp_ErrorData.validationErrors`. */
2
+ export interface DyNTS_Mcp_ValidationErrorItem {
3
+ /** The field name. */
4
+ field: string;
5
+ /** What is wrong with it. */
6
+ message: string;
7
+ }
8
+ //# sourceMappingURL=mcp-validation-error-item.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-validation-error-item.interface.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,MAAM,WAAW,6BAA6B;IAC5C,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=mcp-validation-error-item.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-validation-error-item.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.ts"],"names":[],"mappings":""}
@@ -62,10 +62,12 @@ export declare class DyNTS_Mcp_Adapter {
62
62
  private installHandlers;
63
63
  /** Egy sikeres (vagy strukturált-hiba) handler-outcome → `CallToolResult` (text-JSON content). */
64
64
  private toCallResult;
65
- /** Egy hiba → `CallToolResult { isError:true }` strukturált hiba-payload-dal (soha nem néma). */
65
+ /**
66
+ * An error → `CallToolResult { isError:true }` with a CALLER-SAFE payload (HP-DOPL MP-3.6): `{ ok:false, error:{ code,
67
+ * message, errorCode?, data } }` from `DyNTS_McpError_Util` — an internal error message is never sent
68
+ * (lifted organizer leak fix `TD-20260817-003`); the detail belongs in the server log.
69
+ */
66
70
  private errorResult;
67
- /** Egy hiba ember-olvasható üzenete (DyFM_Error → message; Error → message; egyéb → fallback). */
68
- private describeError;
69
71
  /** JSON-stringify (a transport text-content payload-ja); szerializálás-hiba → strukturált hiba. */
70
72
  private stringify;
71
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dynts-mcp.adapter.d.ts","sourceRoot":"","sources":["../../../../src/_modules/mcp/_services/dynts-mcp.adapter.ts"],"names":[],"mappings":"AAiBA,O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D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,iBAAiB;IAE5B,6FAA6F;IAC7F,OAAO,CAAC,MAAM,CAAC,SAAS,CAetB;IAEF,yGAAyG;IACzG,OAAO,CAAC,MAAM,CAAuB;IAErC,6DAA6D;IAC7D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAElD,uFAAuF;IACvF,OAAO,CAAC,QAAQ,CAAC,KAAK,CACwB;gBAElC,GAAG,EAAE,oBAAoB;IAKrC;;;SAGK;IACE,YAAY,CAAC,UAAU,EAAE,wBAAwB,GAAG,IAAI;IAI/D,8EAA8E;IACvE,sBAAsB,IAAI,MAAM,EAAE;IAIzC;;;SAGK;IACQ,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxC,qEAAqE;IACxD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOnC;;;;SAIK;IACQ,gBAAgB,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAsBxG;;;OAGG;mBACkB,OAAO;IAO5B,gEAAgE;IAChE,OAAO,CAAC,SAAS;IAYjB,kFAAkF;IAClF,OAAO,CAAC,eAAe;IAwBvB,kGAAkG;IAClG,OAAO,CAAC,YAAY;IAOpB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAiBnB,mGAAmG;IACnG,OAAO,CAAC,SAAS;CAOlB"}
@@ -35,8 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.DyNTS_Mcp_Adapter = void 0;
37
37
  /* eslint-enable @futdevpro/dynamo/no-js-import */
38
- const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
39
38
  const optional_peer_util_1 = require("../../../_collections/optional-peer.util");
39
+ const mcp_error_util_1 = require("../_collections/mcp-error.util");
40
+ const mcp_method_not_found_error_1 = require("../_models/errors/mcp-method-not-found.error");
40
41
  /** The supported version range of the optional MCP SDK peer (kept in sync with `peerDependencies`). */
41
42
  const DyNTS_mcpSdkRange = '~1.29.0';
42
43
  /**
@@ -120,15 +121,15 @@ class DyNTS_Mcp_Adapter {
120
121
  async dispatchToolCall(set) {
121
122
  const definition = this.tools.get(set.name);
122
123
  if (!definition) {
123
- return this.errorResult(`Unknown tool: '${set.name}'. Advertised tools: `
124
- + `${this.getAdvertisedToolNames().join(', ')}.`);
124
+ // the tool names are ours, so listing them is safe and helps the agent pick the right one
125
+ return this.errorResult(new mcp_method_not_found_error_1.DyNTS_Mcp_MethodNotFoundError(`Unknown tool: '${set.name}'. Advertised tools: ${this.getAdvertisedToolNames().join(', ')}.`), set.name);
125
126
  }
126
127
  try {
127
128
  const outcome = await definition.handler(set.arguments);
128
129
  return this.toCallResult(outcome);
129
130
  }
130
131
  catch (error) {
131
- return this.errorResult(this.describeError(error), error);
132
+ return this.errorResult(error, set.name);
132
133
  }
133
134
  }
134
135
  // =========================================================================
@@ -180,24 +181,26 @@ class DyNTS_Mcp_Adapter {
180
181
  isError: outcome.isError === true,
181
182
  };
182
183
  }
183
- /** Egy hiba → `CallToolResult { isError:true }` strukturált hiba-payload-dal (soha nem néma). */
184
- errorResult(message, error) {
185
- const errorCode = error instanceof fsm_dynamo_1.DyFM_Error
186
- ? fsm_dynamo_1.DyFM_Error.getErrorCode(error)
187
- : undefined;
188
- const payload = { ok: false, error: { errorCode: errorCode, message: message } };
184
+ /**
185
+ * An error → `CallToolResult { isError:true }` with a CALLER-SAFE payload (HP-DOPL MP-3.6): `{ ok:false, error:{ code,
186
+ * message, errorCode?, data } }` from `DyNTS_McpError_Util` — an internal error message is never sent
187
+ * (lifted organizer leak fix `TD-20260817-003`); the detail belongs in the server log.
188
+ */
189
+ errorResult(error, method) {
190
+ const jsonRpcError = mcp_error_util_1.DyNTS_McpError_Util.toJsonRpcError({
191
+ error: error, method: method, validMethods: this.getAdvertisedToolNames(),
192
+ });
193
+ const payload = {
194
+ ok: false,
195
+ error: {
196
+ code: jsonRpcError.code,
197
+ message: jsonRpcError.message,
198
+ errorCode: jsonRpcError.data.errorCode,
199
+ data: jsonRpcError.data,
200
+ },
201
+ };
189
202
  return { content: [{ type: 'text', text: this.stringify(payload) }], isError: true };
190
203
  }
191
- /** Egy hiba ember-olvasható üzenete (DyFM_Error → message; Error → message; egyéb → fallback). */
192
- describeError(error) {
193
- if (error instanceof fsm_dynamo_1.DyFM_Error) {
194
- return fsm_dynamo_1.DyFM_Error.getErrorMessage(error) || 'Unknown DyFM error.';
195
- }
196
- if (error instanceof Error) {
197
- return error.message;
198
- }
199
- return 'Unknown error during tool execution.';
200
- }
201
204
  /** JSON-stringify (a transport text-content payload-ja); szerializálás-hiba → strukturált hiba. */
202
205
  stringify(data) {
203
206
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"dynts-mcp.adapter.js","sourceRoot":"","sources":["../../../../src/_modules/mcp/_services/dynts-mcp.adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,kDAAkD;AAElD,sDAAmD;AAEnD,iFAAmF;AAiBnF,uGAAuG;AACvG,MAAM,iBAAiB,GAAW,SAAS,CAAC;AAE5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,iBAAiB;IAE5B,6FAA6F;IACrF,MAAM,CAAC,SAAS,GAAwC,KAAK,IAAmC,EAAE;QACxG,mDAAmD;QACnD,MAAM,CAAE,YAAY,EAAE,WAAW,EAAE,WAAW,CAAE,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;8DAC5D,2CAA2C;8DAC3C,2CAA2C;8DAC3C,oCAAoC;SAC5C,CAAC,CAAC;QACH,kDAAkD;QAElD,OAAO;YACL,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,oBAAoB,EAAE,WAAW,CAAC,oBAAoB;YACtD,qBAAqB,EAAE,WAAW,CAAC,qBAAqB;YACxD,sBAAsB,EAAE,WAAW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p-error-code.type-enum';
1
2
  export * from './_enums/mcp-tool-exposure.type-enum';
2
3
  export * from './_models/interfaces/dynts-mcp.interface';
4
+ export * from './_models/interfaces/mcp-error-data.interface';
5
+ export * from './_models/interfaces/mcp-json-rpc-error.interface';
3
6
  export * from './_models/interfaces/mcp-settings.interface';
7
+ export * from './_models/interfaces/mcp-validation-error-item.interface';
8
+ export * from './_models/errors/mcp.error-base';
9
+ export * from './_models/errors/mcp-conflict.error';
10
+ export * from './_models/errors/mcp-forbidden.error';
11
+ export * from './_models/errors/mcp-internal.error';
12
+ export * from './_models/errors/mcp-invalid-params.error';
13
+ export * from './_models/errors/mcp-method-not-found.error';
4
14
  export * from './_models/control-models/mcp-tool-params.control-model';
15
+ export * from './_collections/mcp-error.util';
16
+ export * from './_collections/mcp-ref.util';
5
17
  export * from './_collections/mcp-tool-load.util';
6
18
  export * from './_services/dynts-mcp.adapter';
7
19
  export * from './_services/mcp-server.service-base';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/mcp/index.ts"],"names":[],"mappings":"AAQA,cAAc,sCAAsC,CAAC;AAGrD,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAG5D,cAAc,wDAAwD,CAAC;AAGvE,cAAc,mCAAmC,CAAC;AAGlD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/mcp/index.ts"],"names":[],"mappings":"AAQA,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0DAA0D,CAAC;AAGzE,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAG5D,cAAc,wDAAwD,CAAC;AAGvE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAGlD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC"}
@@ -6,13 +6,26 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const tslib_1 = require("tslib");
8
8
  // ENUMS
9
+ tslib_1.__exportStar(require("./_enums/mcp-error-code.type-enum"), exports);
9
10
  tslib_1.__exportStar(require("./_enums/mcp-tool-exposure.type-enum"), exports);
10
11
  // INTERFACES
11
12
  tslib_1.__exportStar(require("./_models/interfaces/dynts-mcp.interface"), exports);
13
+ tslib_1.__exportStar(require("./_models/interfaces/mcp-error-data.interface"), exports);
14
+ tslib_1.__exportStar(require("./_models/interfaces/mcp-json-rpc-error.interface"), exports);
12
15
  tslib_1.__exportStar(require("./_models/interfaces/mcp-settings.interface"), exports);
16
+ tslib_1.__exportStar(require("./_models/interfaces/mcp-validation-error-item.interface"), exports);
17
+ // ERRORS
18
+ tslib_1.__exportStar(require("./_models/errors/mcp.error-base"), exports);
19
+ tslib_1.__exportStar(require("./_models/errors/mcp-conflict.error"), exports);
20
+ tslib_1.__exportStar(require("./_models/errors/mcp-forbidden.error"), exports);
21
+ tslib_1.__exportStar(require("./_models/errors/mcp-internal.error"), exports);
22
+ tslib_1.__exportStar(require("./_models/errors/mcp-invalid-params.error"), exports);
23
+ tslib_1.__exportStar(require("./_models/errors/mcp-method-not-found.error"), exports);
13
24
  // CONTROL MODELS
14
25
  tslib_1.__exportStar(require("./_models/control-models/mcp-tool-params.control-model"), exports);
15
26
  // COLLECTIONS
27
+ tslib_1.__exportStar(require("./_collections/mcp-error.util"), exports);
28
+ tslib_1.__exportStar(require("./_collections/mcp-ref.util"), exports);
16
29
  tslib_1.__exportStar(require("./_collections/mcp-tool-load.util"), exports);
17
30
  // SERVICES
18
31
  tslib_1.__exportStar(require("./_services/dynts-mcp.adapter"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/mcp/index.ts"],"names":[],"mappings":";AAEA,iGAAiG;AACjG,6FAA6F;AAC7F,4GAA4G;AAC5G,kGAAkG;;;AAElG,QAAQ;AACR,+EAAqD;AAErD,aAAa;AACb,mFAAyD;AACzD,sFAA4D;AAE5D,iBAAiB;AACjB,iGAAuE;AAEvE,cAAc;AACd,4EAAkD;AAElD,WAAW;AACX,wEAA8C;AAC9C,8EAAoD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/mcp/index.ts"],"names":[],"mappings":";AAEA,iGAAiG;AACjG,6FAA6F;AAC7F,4GAA4G;AAC5G,kGAAkG;;;AAElG,QAAQ;AACR,4EAAkD;AAClD,+EAAqD;AAErD,aAAa;AACb,mFAAyD;AACzD,wFAA8D;AAC9D,4FAAkE;AAClE,sFAA4D;AAC5D,mGAAyE;AAEzE,SAAS;AACT,0EAAgD;AAChD,8EAAoD;AACpD,+EAAqD;AACrD,8EAAoD;AACpD,oFAA0D;AAC1D,sFAA4D;AAE5D,iBAAiB;AACjB,iGAAuE;AAEvE,cAAc;AACd,wEAA8C;AAC9C,sEAA4C;AAC5C,4EAAkD;AAElD,WAAW;AACX,wEAA8C;AAC9C,8EAAoD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/nts-dynamo",
3
- "version": "01.15.294",
3
+ "version": "01.15.297",
4
4
  "description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Program Ltd.",
5
5
  "DyBu_settings": {
6
6
  "packageType": "server-package",