mcp-creatio 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/creatio/engines/engine-manager.d.ts +3 -0
- package/dist/creatio/engines/engine-manager.d.ts.map +1 -1
- package/dist/creatio/engines/engine-manager.js +5 -0
- package/dist/creatio/engines/engine-manager.js.map +1 -1
- package/dist/creatio/provider-context.d.ts +3 -0
- package/dist/creatio/provider-context.d.ts.map +1 -1
- package/dist/creatio/services/client-cache-hash-client.d.ts +22 -0
- package/dist/creatio/services/client-cache-hash-client.d.ts.map +1 -0
- package/dist/creatio/services/client-cache-hash-client.js +56 -0
- package/dist/creatio/services/client-cache-hash-client.js.map +1 -0
- package/dist/creatio/services/creatio-service-context.d.ts +5 -0
- package/dist/creatio/services/creatio-service-context.d.ts.map +1 -1
- package/dist/creatio/services/creatio-service-context.js +15 -1
- package/dist/creatio/services/creatio-service-context.js.map +1 -1
- package/dist/creatio/services/crud-provider-factory.d.ts +4 -0
- package/dist/creatio/services/crud-provider-factory.d.ts.map +1 -1
- package/dist/creatio/services/crud-provider-factory.js +1 -1
- package/dist/creatio/services/crud-provider-factory.js.map +1 -1
- package/dist/creatio/services/dataservice/data-service-crud-provider.d.ts +2 -0
- package/dist/creatio/services/dataservice/data-service-crud-provider.d.ts.map +1 -1
- package/dist/creatio/services/dataservice/data-service-crud-provider.js +3 -1
- package/dist/creatio/services/dataservice/data-service-crud-provider.js.map +1 -1
- package/dist/creatio/services/dataservice/data-service-schema.d.ts +3 -1
- package/dist/creatio/services/dataservice/data-service-schema.d.ts.map +1 -1
- package/dist/creatio/services/dataservice/data-service-schema.js +13 -4
- package/dist/creatio/services/dataservice/data-service-schema.js.map +1 -1
- package/dist/creatio/services/dataservice/data-service-transport.d.ts +3 -0
- package/dist/creatio/services/dataservice/data-service-transport.d.ts.map +1 -1
- package/dist/creatio/services/dataservice/data-service-transport.js +5 -0
- package/dist/creatio/services/dataservice/data-service-transport.js.map +1 -1
- package/dist/creatio/services/index.d.ts +2 -0
- package/dist/creatio/services/index.d.ts.map +1 -1
- package/dist/creatio/services/index.js +2 -0
- package/dist/creatio/services/index.js.map +1 -1
- package/dist/creatio/services/odata/metadata-store.d.ts +10 -1
- package/dist/creatio/services/odata/metadata-store.d.ts.map +1 -1
- package/dist/creatio/services/odata/metadata-store.js +35 -4
- package/dist/creatio/services/odata/metadata-store.js.map +1 -1
- package/dist/creatio/services/schema-freshness-gate.d.ts +26 -0
- package/dist/creatio/services/schema-freshness-gate.d.ts.map +1 -0
- package/dist/creatio/services/schema-freshness-gate.js +58 -0
- package/dist/creatio/services/schema-freshness-gate.js.map +1 -0
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +4 -1
- package/dist/log.js.map +1 -1
- package/dist/server/http/mcp-handlers.d.ts.map +1 -1
- package/dist/server/http/mcp-handlers.js +8 -6
- package/dist/server/http/mcp-handlers.js.map +1 -1
- package/dist/server/mcp/server.d.ts +37 -28
- package/dist/server/mcp/server.d.ts.map +1 -1
- package/dist/server/mcp/server.js +106 -75
- package/dist/server/mcp/server.js.map +1 -1
- package/dist/server/mcp/tenant-tool-registry.d.ts +66 -0
- package/dist/server/mcp/tenant-tool-registry.d.ts.map +1 -0
- package/dist/server/mcp/tenant-tool-registry.js +113 -0
- package/dist/server/mcp/tenant-tool-registry.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/redact.d.ts +25 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +64 -0
- package/dist/utils/redact.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central secret-scrubber for anything that crosses an outward boundary — tool results relayed to
|
|
3
|
+
* the LLM client and log lines. Invariant #7 / §9 in AGENTS.md ("do not leak secrets or access
|
|
4
|
+
* tokens in tool responses; strip or mask token-like values") used to be a convention enforced by
|
|
5
|
+
* hand at each call site; this turns it into one guaranteed choke point.
|
|
6
|
+
*
|
|
7
|
+
* It is defense-in-depth, NOT the primary control: providers should still avoid putting credentials
|
|
8
|
+
* into messages/results in the first place. Because it errs toward over-redaction (a stray "Token
|
|
9
|
+
* abc" in prose is scrubbed), it is intentionally applied only at the two outward edges, never to
|
|
10
|
+
* data the server operates on internally.
|
|
11
|
+
*
|
|
12
|
+
* Complements {@link redactUrl} in the HTTP middleware (which scrubs single-use OAuth codes from
|
|
13
|
+
* request URLs) — that one is URL/query-specific; this one is a general value scrubber.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Mask credential-looking substrings in arbitrary text. Idempotent (re-running yields the same
|
|
17
|
+
* output) and safe on non-secret text (returns it unchanged). Always returns a string.
|
|
18
|
+
*/
|
|
19
|
+
export declare function redactSecrets(input: unknown): string;
|
|
20
|
+
/**
|
|
21
|
+
* Redact secrets from an Error's message while preserving the Error instance (type + stack), so the
|
|
22
|
+
* MCP layer can relay a clean message without losing diagnostics. Non-Error throwables are wrapped.
|
|
23
|
+
*/
|
|
24
|
+
export declare function redactError(err: unknown): Error;
|
|
25
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAqBH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQpD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAY/C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Central secret-scrubber for anything that crosses an outward boundary — tool results relayed to
|
|
4
|
+
* the LLM client and log lines. Invariant #7 / §9 in AGENTS.md ("do not leak secrets or access
|
|
5
|
+
* tokens in tool responses; strip or mask token-like values") used to be a convention enforced by
|
|
6
|
+
* hand at each call site; this turns it into one guaranteed choke point.
|
|
7
|
+
*
|
|
8
|
+
* It is defense-in-depth, NOT the primary control: providers should still avoid putting credentials
|
|
9
|
+
* into messages/results in the first place. Because it errs toward over-redaction (a stray "Token
|
|
10
|
+
* abc" in prose is scrubbed), it is intentionally applied only at the two outward edges, never to
|
|
11
|
+
* data the server operates on internally.
|
|
12
|
+
*
|
|
13
|
+
* Complements {@link redactUrl} in the HTTP middleware (which scrubs single-use OAuth codes from
|
|
14
|
+
* request URLs) — that one is URL/query-specific; this one is a general value scrubber.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.redactSecrets = redactSecrets;
|
|
18
|
+
exports.redactError = redactError;
|
|
19
|
+
const REDACTED = '[REDACTED]';
|
|
20
|
+
/**
|
|
21
|
+
* A value following an auth scheme keyword: `Bearer <jwt>`, `Basic <b64>`, `ApiKey <v>`, `Token <v>`.
|
|
22
|
+
* The scheme is preserved (it is not the secret); only the credential after it is masked.
|
|
23
|
+
*/
|
|
24
|
+
const AUTH_SCHEME_VALUE_RE = /\b(Bearer|Basic|ApiKey|Token)\s+[\w.\-+/=]+/gi;
|
|
25
|
+
/** An `Authorization` header value in either `Authorization: <v>` or `Authorization=<v>` form. */
|
|
26
|
+
const AUTHORIZATION_HEADER_RE = /\b(Authorization)(\s*[:=]\s*)[^\s,;"']+/gi;
|
|
27
|
+
/**
|
|
28
|
+
* A secret-bearing parameter's VALUE in query-string (`client_secret=…`), form, or JSON
|
|
29
|
+
* (`"password":"…"`) shape. The key (and an optional opening quote) is preserved; the value up to
|
|
30
|
+
* the next delimiter/closing quote is masked. Stops before a closing `"` so JSON stays well-formed.
|
|
31
|
+
*/
|
|
32
|
+
const SECRET_PARAM_RE = /("?\b(?:client_secret|client_id_secret|api_key|apikey|password|passwd|pwd|access_token|refresh_token|id_token|session_token|secret|bpmcsrf)\b"?\s*[:=]\s*)("?)[^"\s,;&}]+/gi;
|
|
33
|
+
/**
|
|
34
|
+
* Mask credential-looking substrings in arbitrary text. Idempotent (re-running yields the same
|
|
35
|
+
* output) and safe on non-secret text (returns it unchanged). Always returns a string.
|
|
36
|
+
*/
|
|
37
|
+
function redactSecrets(input) {
|
|
38
|
+
if (typeof input !== 'string' || input.length === 0) {
|
|
39
|
+
return typeof input === 'string' ? input : String(input ?? '');
|
|
40
|
+
}
|
|
41
|
+
return input
|
|
42
|
+
.replace(AUTH_SCHEME_VALUE_RE, (_m, scheme) => `${scheme} ${REDACTED}`)
|
|
43
|
+
.replace(AUTHORIZATION_HEADER_RE, (_m, key, sep) => `${key}${sep}${REDACTED}`)
|
|
44
|
+
.replace(SECRET_PARAM_RE, (_m, prefix, openQuote) => `${prefix}${openQuote}${REDACTED}`);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Redact secrets from an Error's message while preserving the Error instance (type + stack), so the
|
|
48
|
+
* MCP layer can relay a clean message without losing diagnostics. Non-Error throwables are wrapped.
|
|
49
|
+
*/
|
|
50
|
+
function redactError(err) {
|
|
51
|
+
if (err instanceof Error) {
|
|
52
|
+
try {
|
|
53
|
+
err.message = redactSecrets(err.message);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Some exotic Error subclasses define a non-writable `message`; fall back to a wrapper
|
|
57
|
+
// that carries the redacted text while keeping the original as the cause for debugging.
|
|
58
|
+
return new Error(redactSecrets(err.message), { cause: err });
|
|
59
|
+
}
|
|
60
|
+
return err;
|
|
61
|
+
}
|
|
62
|
+
return new Error(redactSecrets(typeof err === 'string' ? err : String(err)));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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