@futdevpro/nts-dynamo 1.15.293 → 1.15.296
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/build/_collections/global-settings.const.d.ts.map +1 -1
- package/build/_collections/global-settings.const.js +1 -0
- package/build/_collections/global-settings.const.js.map +1 -1
- package/build/_models/interfaces/global-settings.interface.d.ts +6 -0
- package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
- package/build/_modules/mcp/_collections/mcp-error.util.d.ts +38 -0
- package/build/_modules/mcp/_collections/mcp-error.util.d.ts.map +1 -0
- package/build/_modules/mcp/_collections/mcp-error.util.js +103 -0
- package/build/_modules/mcp/_collections/mcp-error.util.js.map +1 -0
- package/build/_modules/mcp/_collections/mcp-tool-load.util.d.ts +46 -0
- package/build/_modules/mcp/_collections/mcp-tool-load.util.d.ts.map +1 -0
- package/build/_modules/mcp/_collections/mcp-tool-load.util.js +93 -0
- package/build/_modules/mcp/_collections/mcp-tool-load.util.js.map +1 -0
- package/build/_modules/mcp/_enums/mcp-error-code.type-enum.d.ts +17 -0
- package/build/_modules/mcp/_enums/mcp-error-code.type-enum.d.ts.map +1 -0
- package/build/_modules/mcp/_enums/mcp-error-code.type-enum.js +21 -0
- package/build/_modules/mcp/_enums/mcp-error-code.type-enum.js.map +1 -0
- package/build/_modules/mcp/_enums/mcp-tool-exposure.type-enum.d.ts +14 -0
- package/build/_modules/mcp/_enums/mcp-tool-exposure.type-enum.d.ts.map +1 -0
- package/build/_modules/mcp/_enums/mcp-tool-exposure.type-enum.js +18 -0
- package/build/_modules/mcp/_enums/mcp-tool-exposure.type-enum.js.map +1 -0
- package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.d.ts +81 -0
- package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.d.ts.map +1 -0
- package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.js +150 -0
- package/build/_modules/mcp/_models/control-models/mcp-tool-params.control-model.js.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-conflict.error.d.ts +7 -0
- package/build/_modules/mcp/_models/errors/mcp-conflict.error.d.ts.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-conflict.error.js +11 -0
- package/build/_modules/mcp/_models/errors/mcp-conflict.error.js.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-forbidden.error.d.ts +7 -0
- package/build/_modules/mcp/_models/errors/mcp-forbidden.error.d.ts.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-forbidden.error.js +11 -0
- package/build/_modules/mcp/_models/errors/mcp-forbidden.error.js.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-internal.error.d.ts +7 -0
- package/build/_modules/mcp/_models/errors/mcp-internal.error.d.ts.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-internal.error.js +11 -0
- package/build/_modules/mcp/_models/errors/mcp-internal.error.js.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.d.ts +7 -0
- package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.d.ts.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.js +11 -0
- package/build/_modules/mcp/_models/errors/mcp-invalid-params.error.js.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.d.ts +7 -0
- package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.d.ts.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.js +11 -0
- package/build/_modules/mcp/_models/errors/mcp-method-not-found.error.js.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp.error-base.d.ts +21 -0
- package/build/_modules/mcp/_models/errors/mcp.error-base.d.ts.map +1 -0
- package/build/_modules/mcp/_models/errors/mcp.error-base.js +25 -0
- package/build/_modules/mcp/_models/errors/mcp.error-base.js.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.d.ts +32 -0
- package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.d.ts.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.js +3 -0
- package/build/_modules/mcp/_models/interfaces/mcp-error-data.interface.js.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.d.ts +12 -0
- package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.d.ts.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.js +3 -0
- package/build/_modules/mcp/_models/interfaces/mcp-json-rpc-error.interface.js.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-settings.interface.d.ts +15 -0
- package/build/_modules/mcp/_models/interfaces/mcp-settings.interface.d.ts.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-settings.interface.js +3 -0
- package/build/_modules/mcp/_models/interfaces/mcp-settings.interface.js.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.d.ts +8 -0
- package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.d.ts.map +1 -0
- package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.js +3 -0
- package/build/_modules/mcp/_models/interfaces/mcp-validation-error-item.interface.js.map +1 -0
- package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts +5 -3
- package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts.map +1 -1
- package/build/_modules/mcp/_services/dynts-mcp.adapter.js +23 -20
- package/build/_modules/mcp/_services/dynts-mcp.adapter.js.map +1 -1
- package/build/_modules/mcp/index.d.ts +15 -0
- package/build/_modules/mcp/index.d.ts.map +1 -1
- package/build/_modules/mcp/index.js +19 -0
- package/build/_modules/mcp/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_McpTool_Params = 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_tool_exposure_type_enum_1 = require("../../_enums/mcp-tool-exposure.type-enum");
|
|
7
|
+
/** MCP tool name characters (MCP specification: letters, digits, `_`, `-`, `.`; 1–128 characters). */
|
|
8
|
+
const DyNTS_mcpToolName = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
9
|
+
/**
|
|
10
|
+
* An operation exposed as an MCP tool (HP-DOPL MP-3.2, decision B+C): the MCP-specific settings on top of a
|
|
11
|
+
* transport-independent `DyFM_Operation_Settings` — the tool name, the exposure, an optional input schema override
|
|
12
|
+
* and the load protection flag. The operation stays the single source of the implementation (`run`).
|
|
13
|
+
*
|
|
14
|
+
* Follows the Dynamo settings pattern: a `set` constructor, defaults applied in the constructor, construction-time
|
|
15
|
+
* validation with a coded `DyFM_Error` that carries the construction location.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const getNoteTool: DyNTS_McpTool_Params = new DyNTS_McpTool_Params({
|
|
20
|
+
* operation: getNote, // name: 'notes.get'
|
|
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)),
|
|
25
|
+
* });
|
|
26
|
+
* // getNoteTool.getToolName() === 'notes.get' (or 'organizer.notes.get' with mcp_settings.toolPrefix)
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
class DyNTS_McpTool_Params {
|
|
30
|
+
/** The operation this tool runs. */
|
|
31
|
+
operation;
|
|
32
|
+
/** The tool name without the server prefix; default: the operation name (`<domain>.<action>`). */
|
|
33
|
+
tool;
|
|
34
|
+
/** The tool description for the agent; default: the operation description. */
|
|
35
|
+
description;
|
|
36
|
+
/** How the tool is advertised; default: `default`. */
|
|
37
|
+
exposure;
|
|
38
|
+
/** The input schema; default: generated from the operation (`DyFM_OperationSchema_Util.inputSchema`). */
|
|
39
|
+
inputSchema;
|
|
40
|
+
/** A heavy tool is serialized and shed under memory pressure (DMCP-013); default: `false`. */
|
|
41
|
+
isHeavy;
|
|
42
|
+
/** Source location of the construction, for debugging a misconfigured tool. */
|
|
43
|
+
stackLocation;
|
|
44
|
+
/**
|
|
45
|
+
* Validates the settings and applies the defaults.
|
|
46
|
+
* @param set - the tool settings; throws a coded `DyFM_Error` when invalid
|
|
47
|
+
*/
|
|
48
|
+
constructor(set) {
|
|
49
|
+
const stackLocation = set?.stackLocation ?? (0, fsm_dynamo_1.DyFM_getConstructionStackLocation)();
|
|
50
|
+
const operation = set?.operation;
|
|
51
|
+
// a plain object would skip the construction-time validation of the operation
|
|
52
|
+
if (typeof operation?.name !== 'string' || !operation?.expose) {
|
|
53
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-OPR', 'operation must be a constructed DyFM_Operation_Settings', stackLocation);
|
|
54
|
+
}
|
|
55
|
+
const label = operation.name;
|
|
56
|
+
if (operation.expose.mcp === false) {
|
|
57
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-EXP', `operation "${label}" is not exposed on MCP (expose.mcp: false)`, stackLocation);
|
|
58
|
+
}
|
|
59
|
+
if (typeof operation.run !== 'function') {
|
|
60
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-RUN', `operation "${label}" has no run implementation, so it can not be a tool`, stackLocation);
|
|
61
|
+
}
|
|
62
|
+
const tool = set.tool ?? operation.name;
|
|
63
|
+
if (typeof tool !== 'string' || !DyNTS_mcpToolName.test(tool)) {
|
|
64
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-NAM', `tool name must be 1-128 letters, digits, "_", "-" or "." (got: ${JSON.stringify(tool)})`, stackLocation);
|
|
65
|
+
}
|
|
66
|
+
const exposure = set.exposure ?? mcp_tool_exposure_type_enum_1.DyNTS_McpToolExposure_Type.default;
|
|
67
|
+
if (!Object.values(mcp_tool_exposure_type_enum_1.DyNTS_McpToolExposure_Type).includes(exposure)) {
|
|
68
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-EXV', `unknown exposure ${JSON.stringify(exposure)} (tool "${tool}")`, stackLocation);
|
|
69
|
+
}
|
|
70
|
+
// an MCP tool input is always a JSON object (the arguments of tools/call)
|
|
71
|
+
if (set.inputSchema !== undefined && set.inputSchema?.type !== 'object') {
|
|
72
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-SCH', `inputSchema override must be an object schema (tool "${tool}")`, stackLocation);
|
|
73
|
+
}
|
|
74
|
+
if (set.isHeavy !== undefined && typeof set.isHeavy !== 'boolean') {
|
|
75
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-HVY', `isHeavy must be a boolean (tool "${tool}")`, stackLocation);
|
|
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
|
+
}
|
|
80
|
+
this.operation = operation;
|
|
81
|
+
this.tool = tool;
|
|
82
|
+
this.description = set.description ?? operation.description;
|
|
83
|
+
this.exposure = exposure;
|
|
84
|
+
this.inputSchema = set.inputSchema ?? fsm_dynamo_1.DyFM_OperationSchema_Util.inputSchema(operation);
|
|
85
|
+
this.isHeavy = set.isHeavy === true;
|
|
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
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The advertised tool name: the server prefix (`mcp_settings.toolPrefix`) + the tool name.
|
|
119
|
+
* @param settings - the MCP settings (default: `DyNTS_global_settings.mcp_settings`)
|
|
120
|
+
* @throws `DyNTS-MTP-PFX` when the prefixed name is not a valid tool name
|
|
121
|
+
*/
|
|
122
|
+
getToolName(settings = global_settings_const_1.DyNTS_global_settings.mcp_settings) {
|
|
123
|
+
const name = `${settings?.toolPrefix ?? ''}${this.tool}`;
|
|
124
|
+
if (!DyNTS_mcpToolName.test(name)) {
|
|
125
|
+
throw DyNTS_McpTool_Params.invalid('DyNTS-MTP-PFX', `the prefixed tool name is invalid: ${JSON.stringify(name)}`, this.stackLocation);
|
|
126
|
+
}
|
|
127
|
+
return name;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Whether the tool appears in `tools/list`: never for `none`; on a read-only server only for `read-only`.
|
|
131
|
+
* @param settings - the MCP settings (default: `DyNTS_global_settings.mcp_settings`)
|
|
132
|
+
*/
|
|
133
|
+
isAdvertised(settings = global_settings_const_1.DyNTS_global_settings.mcp_settings) {
|
|
134
|
+
if (this.exposure === mcp_tool_exposure_type_enum_1.DyNTS_McpToolExposure_Type.none) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
return settings?.readOnly === true ? this.exposure === mcp_tool_exposure_type_enum_1.DyNTS_McpToolExposure_Type.readOnly : true;
|
|
138
|
+
}
|
|
139
|
+
/** Builds the construction error with a stable error code and the construction location. */
|
|
140
|
+
static invalid(code, reason, stackLocation) {
|
|
141
|
+
return new fsm_dynamo_1.DyFM_Error({
|
|
142
|
+
status: 500,
|
|
143
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|${code}`,
|
|
144
|
+
message: `DyNTS_McpTool_Params construction failed: ${reason}`,
|
|
145
|
+
additionalContent: { stackLocation: stackLocation },
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.DyNTS_McpTool_Params = DyNTS_McpTool_Params;
|
|
150
|
+
//# sourceMappingURL=mcp-tool-params.control-model.js.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,oBAAoB;IAC/B,oCAAoC;IAC3B,SAAS,CAAuD;IACzE,kGAAkG;IACzF,IAAI,CAAS;IACtB,8EAA8E;IACrE,WAAW,CAAS;IAC7B,sDAAsD;IAC7C,QAAQ,CAA6B;IAC9C,yGAAyG;IAChG,WAAW,CAA4B;IAChD,8FAA8F;IACrF,OAAO,CAAU;IAC1B,+EAA+E;IACtE,aAAa,CAAS;IAU/B;;;OAGG;IACH,YAA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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 @@
|
|
|
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 @@
|
|
|
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":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-wide MCP defaults (`DyNTS_global_settings.mcp_settings`, HP-DOPL MP-3.2). `null` (the default) means every
|
|
3
|
+
* field below takes its documented default.
|
|
4
|
+
*/
|
|
5
|
+
export interface DyNTS_Mcp_Settings {
|
|
6
|
+
/** Prepended to every generated tool name (e.g. `organizer.` → `organizer.notes.get`); default: none. */
|
|
7
|
+
toolPrefix?: string;
|
|
8
|
+
/** A read-only MCP server advertises only `read-only` tools; default: `false`. */
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
/** How many HEAVY tool calls may run at once (DMCP-013 serialization); default: `1`. */
|
|
11
|
+
heavyToolConcurrency?: number;
|
|
12
|
+
/** Reject a HEAVY tool call with 503 while the memory guard reports critical pressure (DMCP-013); default: `true`. */
|
|
13
|
+
shedHeavyToolsUnderMemoryPressure?: boolean;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=mcp-settings.interface.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-settings.interface.js","sourceRoot":"","sources":["../../../../../src/_modules/mcp/_models/interfaces/mcp-settings.interface.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
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
|
-
/**
|
|
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":"
|
|
1
|
+
{"version":3,"file":"dynts-mcp.adapter.d.ts","sourceRoot":"","sources":["../../../../src/_modules/mcp/_services/dynts-mcp.adapter.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EAEzB,MAAM,2CAA2C,CAAC;AAanD;;;;;;;;;;;;;;;;;;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
|
-
|
|
124
|
-
|
|
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(
|
|
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
|
-
/**
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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 {
|