node-autotask 0.37.1 → 0.38.0
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/CHANGELOG.md +17 -0
- package/MCP_TOOL_CATALOG.json +127 -44
- package/MCP_TOOL_MANIFEST.md +8 -8
- package/N8N_MCP_MANIFEST.json +4 -4
- package/N8N_MCP_MANIFEST.md +5 -5
- package/README.md +3 -0
- package/capabilities.json +2454 -1698
- package/dist/capabilities.cjs +2 -2
- package/dist/capabilities.js +1 -1
- package/dist/{chunk-7IADHNBZ.js → chunk-4QHGCYEI.js} +2255 -1946
- package/dist/chunk-5VHSLJMR.js +71 -0
- package/dist/{chunk-HBYKTXN3.cjs → chunk-73JMTV4O.cjs} +2453 -1697
- package/dist/{chunk-PFFW4DIK.cjs → chunk-7FNKFNIJ.cjs} +285 -285
- package/dist/{chunk-25VGFT5M.cjs → chunk-DCTUBUIZ.cjs} +143 -143
- package/dist/{chunk-7WI7FBPB.js → chunk-IY3WCPCK.js} +2 -2
- package/dist/{chunk-TBFXRNNE.cjs → chunk-IY5QZZVF.cjs} +2389 -2080
- package/dist/{chunk-PFJAMFUL.js → chunk-KPYXO7F5.js} +2 -2
- package/dist/chunk-MJTKK3QG.cjs +71 -0
- package/dist/{chunk-KQ6HMBB4.js → chunk-U3K6IDKB.js} +2453 -1697
- package/dist/{index-CqepIQfp.d.cts → index-BFbUB5YD.d.cts} +28 -8
- package/dist/{index-m-7fOwFl.d.cts → index-BQVStxwi.d.cts} +15 -1
- package/dist/{index-m-7fOwFl.d.ts → index-BQVStxwi.d.ts} +15 -1
- package/dist/{index-BDqw377y.d.ts → index-Q-4HQEEb.d.ts} +28 -8
- package/dist/index.cjs +27 -22
- package/dist/index.d.cts +26 -5
- package/dist/index.d.ts +26 -5
- package/dist/index.js +9 -4
- package/dist/operations/index.cjs +247 -227
- package/dist/operations/index.d.cts +16 -4
- package/dist/operations/index.d.ts +16 -4
- package/dist/operations/index.js +58 -38
- package/dist/pool.cjs +10 -9
- package/dist/pool.d.cts +2 -2
- package/dist/pool.d.ts +2 -2
- package/dist/pool.js +5 -4
- package/dist/resources/index.cjs +5 -4
- package/dist/resources/index.d.cts +2 -2
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +4 -3
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/untrusted.cjs +24 -70
- package/dist/untrusted.js +12 -58
- package/docs/API.md +101 -0
- package/examples/mcp/manifest.ts +5 -0
- package/examples/mcp/rank.ts +62 -0
- package/examples/mcp/tools-meta.ts +6 -1
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/untrusted.ts
|
|
2
|
+
var UNTRUSTED_OPEN = "<untrusted_content>";
|
|
3
|
+
var UNTRUSTED_CLOSE = "</untrusted_content>";
|
|
4
|
+
var UNTRUSTED_OPEN_NEUTRALISED = "\\u003Cuntrusted_content\\u003E";
|
|
5
|
+
var UNTRUSTED_CLOSE_NEUTRALISED = "\\u003C\\/untrusted_content\\u003E";
|
|
6
|
+
var REDACTED_MARKER = "[REDACTED]";
|
|
7
|
+
function isPlainRecord(value) {
|
|
8
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
9
|
+
const proto = Object.getPrototypeOf(value);
|
|
10
|
+
return proto === Object.prototype || proto === null;
|
|
11
|
+
}
|
|
12
|
+
function wrapUntrusted(value) {
|
|
13
|
+
if (typeof value !== "string") return void 0;
|
|
14
|
+
if (value === "") return void 0;
|
|
15
|
+
if (value === REDACTED_MARKER) return void 0;
|
|
16
|
+
if (value.startsWith(UNTRUSTED_OPEN) && value.endsWith(UNTRUSTED_CLOSE) && !value.slice(UNTRUSTED_OPEN.length, value.length - UNTRUSTED_CLOSE.length).includes(UNTRUSTED_OPEN) && !value.slice(UNTRUSTED_OPEN.length, value.length - UNTRUSTED_CLOSE.length).includes(UNTRUSTED_CLOSE)) {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
const inner = value.split(UNTRUSTED_OPEN).join(UNTRUSTED_OPEN_NEUTRALISED).split(UNTRUSTED_CLOSE).join(UNTRUSTED_CLOSE_NEUTRALISED);
|
|
20
|
+
return `${UNTRUSTED_OPEN}${inner}${UNTRUSTED_CLOSE}`;
|
|
21
|
+
}
|
|
22
|
+
function markUntrusted(record, fields) {
|
|
23
|
+
if (!isPlainRecord(record)) return record;
|
|
24
|
+
const fieldSet = new Set(fields);
|
|
25
|
+
const out = { ...record };
|
|
26
|
+
for (const key of Object.keys(record)) {
|
|
27
|
+
if (!fieldSet.has(key)) continue;
|
|
28
|
+
const wrapped = wrapUntrusted(record[key]);
|
|
29
|
+
if (wrapped !== void 0) out[key] = wrapped;
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
function deepMarkUntrusted(value, fields) {
|
|
34
|
+
if (Array.isArray(value)) return value.map((entry) => deepMarkUntrusted(entry, fields));
|
|
35
|
+
if (!isPlainRecord(value)) return value;
|
|
36
|
+
const marked = markUntrusted(value, fields);
|
|
37
|
+
const out = {};
|
|
38
|
+
for (const [key, entry] of Object.entries(marked)) {
|
|
39
|
+
out[key] = deepMarkUntrusted(entry, fields);
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
function stripUntrustedWrapper(value) {
|
|
44
|
+
if (typeof value !== "string") return value;
|
|
45
|
+
if (!value.startsWith(UNTRUSTED_OPEN) || !value.endsWith(UNTRUSTED_CLOSE)) return value;
|
|
46
|
+
const inner = value.slice(UNTRUSTED_OPEN.length, value.length - UNTRUSTED_CLOSE.length);
|
|
47
|
+
return inner;
|
|
48
|
+
}
|
|
49
|
+
function stripUntrustedDeep(value) {
|
|
50
|
+
if (typeof value === "string") return stripUntrustedWrapper(value);
|
|
51
|
+
if (Array.isArray(value)) return value.map((entry) => stripUntrustedDeep(entry));
|
|
52
|
+
if (!isPlainRecord(value)) return value;
|
|
53
|
+
const out = {};
|
|
54
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
55
|
+
out[key] = stripUntrustedDeep(entry);
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
UNTRUSTED_OPEN,
|
|
62
|
+
UNTRUSTED_CLOSE,
|
|
63
|
+
UNTRUSTED_OPEN_NEUTRALISED,
|
|
64
|
+
UNTRUSTED_CLOSE_NEUTRALISED,
|
|
65
|
+
REDACTED_MARKER,
|
|
66
|
+
wrapUntrusted,
|
|
67
|
+
markUntrusted,
|
|
68
|
+
deepMarkUntrusted,
|
|
69
|
+
stripUntrustedWrapper,
|
|
70
|
+
stripUntrustedDeep
|
|
71
|
+
};
|