@apify/actors-mcp-server 0.10.13-beta.3 → 0.10.13-beta.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/dist/const.d.ts +0 -7
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +0 -8
- package/dist/const.js.map +1 -1
- package/dist/tools/common/dataset_collection.d.ts.map +1 -1
- package/dist/tools/common/dataset_collection.js +4 -2
- package/dist/tools/common/dataset_collection.js.map +1 -1
- package/dist/tools/common/get_dataset.js +1 -1
- package/dist/tools/common/get_dataset.js.map +1 -1
- package/dist/tools/common/get_dataset_items.js +2 -2
- package/dist/tools/common/get_dataset_items.js.map +1 -1
- package/dist/tools/common/get_dataset_schema.d.ts.map +1 -1
- package/dist/tools/common/get_dataset_schema.js +2 -1
- package/dist/tools/common/get_dataset_schema.js.map +1 -1
- package/dist/tools/common/get_key_value_store.js +1 -1
- package/dist/tools/common/get_key_value_store.js.map +1 -1
- package/dist/tools/common/get_key_value_store_keys.d.ts.map +1 -1
- package/dist/tools/common/get_key_value_store_keys.js +4 -2
- package/dist/tools/common/get_key_value_store_keys.js.map +1 -1
- package/dist/tools/common/get_key_value_store_record.js +1 -1
- package/dist/tools/common/get_key_value_store_record.js.map +1 -1
- package/dist/tools/common/key_value_store_collection.d.ts.map +1 -1
- package/dist/tools/common/key_value_store_collection.js +4 -2
- package/dist/tools/common/key_value_store_collection.js.map +1 -1
- package/dist/tools/common/run_collection.d.ts.map +1 -1
- package/dist/tools/common/run_collection.js +4 -4
- package/dist/tools/common/run_collection.js.map +1 -1
- package/dist/tools/structured_output_schemas.d.ts +144 -0
- package/dist/tools/structured_output_schemas.d.ts.map +1 -1
- package/dist/tools/structured_output_schemas.js +145 -0
- package/dist/tools/structured_output_schemas.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/encode_text.d.ts +36 -0
- package/dist/utils/encode_text.d.ts.map +1 -0
- package/dist/utils/encode_text.js +94 -0
- package/dist/utils/encode_text.js.map +1 -0
- package/dist/utils/mcp.d.ts +0 -9
- package/dist/utils/mcp.d.ts.map +1 -1
- package/dist/utils/mcp.js +0 -11
- package/dist/utils/mcp.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Markdown code fences keyed by encoding. Labels are ASCII, so char length == byte length. */
|
|
2
|
+
export declare const FENCES: {
|
|
3
|
+
readonly json: {
|
|
4
|
+
readonly prefix: "```json\n";
|
|
5
|
+
readonly suffix: "\n```";
|
|
6
|
+
};
|
|
7
|
+
readonly toon: {
|
|
8
|
+
readonly prefix: "```toon\n";
|
|
9
|
+
readonly suffix: "\n```";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Lifts nested-object keys into dot-joined top-level keys so arrays of uniform objects qualify
|
|
14
|
+
* for TOON's tabular form. Arrays are preserved (each object element flattened individually);
|
|
15
|
+
* scalars, null, and inline scalar arrays are unchanged. Throws `RangeError` on depth overflow
|
|
16
|
+
* or a normalisation collision — the caller drops the TOON candidate and ships JSON.
|
|
17
|
+
*
|
|
18
|
+
* Lossy w.r.t. the original key names only when a source key contains a literal `.`
|
|
19
|
+
* (normalised to `_`); `structuredContent` preserves the originals for programmatic consumers.
|
|
20
|
+
*/
|
|
21
|
+
export declare function dotFlatten(value: unknown): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* Wrap a JSON-serialisable value in a ```json code fence. Used by single-object tools, which have
|
|
24
|
+
* no `structuredContent` fallback, so this can never emit anything but JSON.
|
|
25
|
+
*/
|
|
26
|
+
export declare function wrapJsonText(value: unknown): string;
|
|
27
|
+
/**
|
|
28
|
+
* Encodes a JSON-serialisable value as a dot-flattened ```toon code fence for the LLM, falling back
|
|
29
|
+
* to a ```json fence only if `dotFlatten`/`encode` throws (depth overflow or a normalisation key
|
|
30
|
+
* collision). TOON is the stable shape; JSON is the error path, not a byte-driven alternative.
|
|
31
|
+
*
|
|
32
|
+
* The text may be TOON — programmatic JSON consumers must read `structuredContent` instead. Only
|
|
33
|
+
* wire this on tools that ship `structuredContent` as the JSON fallback.
|
|
34
|
+
*/
|
|
35
|
+
export declare function encodeToon(value: unknown): string;
|
|
36
|
+
//# sourceMappingURL=encode_text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode_text.d.ts","sourceRoot":"","sources":["../../src/utils/encode_text.ts"],"names":[],"mappings":"AAWA,+FAA+F;AAC/F,eAAO,MAAM,MAAM;;;;;;;;;CAGT,CAAC;AAsCX;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAElD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAajD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { encode } from '@toon-format/toon';
|
|
2
|
+
import log from '@apify/log';
|
|
3
|
+
/**
|
|
4
|
+
* Recursion guard for {@link dotFlatten}. The deepest real Apify-API fixture measured is
|
|
5
|
+
* depth 9 (a user-declared dataset schema), so 20 leaves a comfortable margin while still
|
|
6
|
+
* stopping runaway recursion on pathological input.
|
|
7
|
+
*/
|
|
8
|
+
const MAX_DEPTH = 20;
|
|
9
|
+
/** Markdown code fences keyed by encoding. Labels are ASCII, so char length == byte length. */
|
|
10
|
+
export const FENCES = {
|
|
11
|
+
json: { prefix: '```json\n', suffix: '\n```' },
|
|
12
|
+
toon: { prefix: '```toon\n', suffix: '\n```' },
|
|
13
|
+
};
|
|
14
|
+
/** Wrap an already-encoded body in the Markdown code fence for its format. */
|
|
15
|
+
function fence(format, body) {
|
|
16
|
+
return `${FENCES[format].prefix}${body}${FENCES[format].suffix}`;
|
|
17
|
+
}
|
|
18
|
+
function flattenValue(value, depth) {
|
|
19
|
+
if (depth > MAX_DEPTH)
|
|
20
|
+
throw new RangeError('dotFlatten: max depth exceeded');
|
|
21
|
+
if (Array.isArray(value))
|
|
22
|
+
return value.map((item) => flattenValue(item, depth + 1));
|
|
23
|
+
if (value !== null && typeof value === 'object') {
|
|
24
|
+
// Null prototype so `key in out` (below) tests own keys only: source keys named like an
|
|
25
|
+
// `Object.prototype` member (`constructor`, `__proto__`, `toString`, …) neither trip a
|
|
26
|
+
// false-positive collision nor reach the prototype setter.
|
|
27
|
+
const out = Object.create(null);
|
|
28
|
+
flattenInto(value, '', depth, out);
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
return value; // scalar or null — unchanged
|
|
32
|
+
}
|
|
33
|
+
function flattenInto(obj, prefix, depth, out) {
|
|
34
|
+
if (depth > MAX_DEPTH)
|
|
35
|
+
throw new RangeError('dotFlatten: max depth exceeded');
|
|
36
|
+
for (const [rawKey, v] of Object.entries(obj)) {
|
|
37
|
+
// `.` is the nesting separator, so normalise any literal dot in a source key to avoid
|
|
38
|
+
// ambiguity. The collision guard below catches the case where this would overwrite a key.
|
|
39
|
+
const key = prefix ? `${prefix}.${rawKey.replaceAll('.', '_')}` : rawKey.replaceAll('.', '_');
|
|
40
|
+
if (v !== null && typeof v === 'object' && !Array.isArray(v)) {
|
|
41
|
+
flattenInto(v, key, depth + 1, out); // lift nested object into dotted keys
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Only a genuine normalisation clash remains (`a.b` and `a_b` both map to `a_b`); fail
|
|
45
|
+
// loud so the caller drops TOON and ships lossless JSON instead of overwriting silently.
|
|
46
|
+
if (key in out)
|
|
47
|
+
throw new RangeError(`dotFlatten: key collision on "${key}"`);
|
|
48
|
+
out[key] = flattenValue(v, depth + 1); // scalars unchanged; arrays recursed into
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Lifts nested-object keys into dot-joined top-level keys so arrays of uniform objects qualify
|
|
54
|
+
* for TOON's tabular form. Arrays are preserved (each object element flattened individually);
|
|
55
|
+
* scalars, null, and inline scalar arrays are unchanged. Throws `RangeError` on depth overflow
|
|
56
|
+
* or a normalisation collision — the caller drops the TOON candidate and ships JSON.
|
|
57
|
+
*
|
|
58
|
+
* Lossy w.r.t. the original key names only when a source key contains a literal `.`
|
|
59
|
+
* (normalised to `_`); `structuredContent` preserves the originals for programmatic consumers.
|
|
60
|
+
*/
|
|
61
|
+
export function dotFlatten(value) {
|
|
62
|
+
return flattenValue(value, 0);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Wrap a JSON-serialisable value in a ```json code fence. Used by single-object tools, which have
|
|
66
|
+
* no `structuredContent` fallback, so this can never emit anything but JSON.
|
|
67
|
+
*/
|
|
68
|
+
export function wrapJsonText(value) {
|
|
69
|
+
return fence('json', JSON.stringify(value));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Encodes a JSON-serialisable value as a dot-flattened ```toon code fence for the LLM, falling back
|
|
73
|
+
* to a ```json fence only if `dotFlatten`/`encode` throws (depth overflow or a normalisation key
|
|
74
|
+
* collision). TOON is the stable shape; JSON is the error path, not a byte-driven alternative.
|
|
75
|
+
*
|
|
76
|
+
* The text may be TOON — programmatic JSON consumers must read `structuredContent` instead. Only
|
|
77
|
+
* wire this on tools that ship `structuredContent` as the JSON fallback.
|
|
78
|
+
*/
|
|
79
|
+
export function encodeToon(value) {
|
|
80
|
+
// `value` is serialised through JSON so `dotFlatten` works on the JSON data model only: a `Date`
|
|
81
|
+
// (or any `toJSON` carrier) becomes its ISO string here, not an empty object. A non-serialisable
|
|
82
|
+
// value (circular, BigInt) throws here; API payloads are always JSON, so let it crash.
|
|
83
|
+
const jsonStr = JSON.stringify(value);
|
|
84
|
+
try {
|
|
85
|
+
return fence('toon', encode(dotFlatten(JSON.parse(jsonStr))));
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
// dotFlatten threw (depth overflow or key collision) or encode failed — ship JSON instead.
|
|
89
|
+
// Log it: the fallback is lossless, but a recurring failure means TOON is silently disabled.
|
|
90
|
+
log.debug('encodeToon: TOON encoding failed, shipping JSON', { err });
|
|
91
|
+
return fence('json', jsonStr);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=encode_text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode_text.js","sourceRoot":"","sources":["../../src/utils/encode_text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B;;;;GAIG;AACH,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,+FAA+F;AAC/F,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE;IAC9C,IAAI,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE;CACxC,CAAC;AAEX,8EAA8E;AAC9E,SAAS,KAAK,CAAC,MAA2B,EAAE,IAAY;IACpD,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,KAAc,EAAE,KAAa;IAC/C,IAAI,KAAK,GAAG,SAAS;QAAE,MAAM,IAAI,UAAU,CAAC,gCAAgC,CAAC,CAAC;IAC9E,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACpF,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9C,wFAAw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AAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACrC,OAAO,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACvC,OAAO,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACrC,iGAAiG;IACjG,iGAAiG;IACjG,uFAAuF;IACvF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,2FAA2F;QAC3F,6FAA6F;QAC7F,GAAG,CAAC,KAAK,CAAC,iDAAiD,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACtE,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;AACL,CAAC"}
|
package/dist/utils/mcp.d.ts
CHANGED
|
@@ -36,15 +36,6 @@ export declare function buildMCPResponse(options: {
|
|
|
36
36
|
}[];
|
|
37
37
|
isError: boolean;
|
|
38
38
|
};
|
|
39
|
-
/** Markdown JSON code-fence prefix used by `wrapJsonText` and the test-side `parseFencedJson`. */
|
|
40
|
-
export declare const JSON_FENCE_PREFIX = "```json\n";
|
|
41
|
-
/** Markdown JSON code-fence suffix used by `wrapJsonText` and the test-side `parseFencedJson`. */
|
|
42
|
-
export declare const JSON_FENCE_SUFFIX = "\n```";
|
|
43
|
-
/**
|
|
44
|
-
* Wrap a JSON-serializable value in a Markdown ` ```json ` code fence.
|
|
45
|
-
* Used by any tool that returns SDK payloads to the LLM.
|
|
46
|
-
*/
|
|
47
|
-
export declare function wrapJsonText(value: unknown): string;
|
|
48
39
|
/**
|
|
49
40
|
* Computes tool response payload bytes, split by payload side:
|
|
50
41
|
* `contentBytes` sums the UTF-8 byte length of every text item in `content[]`;
|
package/dist/utils/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAOtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACtC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;;;;;;;;;EAUA;AAED
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAOtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACtC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;;;;;;;;;EAUA;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;CAClC,CAuBA;AAED,gFAAgF;AAChF,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAUjF"}
|
package/dist/utils/mcp.js
CHANGED
|
@@ -34,17 +34,6 @@ export function buildMCPResponse(options) {
|
|
|
34
34
|
...(_meta !== undefined && { _meta }),
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
/** Markdown JSON code-fence prefix used by `wrapJsonText` and the test-side `parseFencedJson`. */
|
|
38
|
-
export const JSON_FENCE_PREFIX = '```json\n';
|
|
39
|
-
/** Markdown JSON code-fence suffix used by `wrapJsonText` and the test-side `parseFencedJson`. */
|
|
40
|
-
export const JSON_FENCE_SUFFIX = '\n```';
|
|
41
|
-
/**
|
|
42
|
-
* Wrap a JSON-serializable value in a Markdown ` ```json ` code fence.
|
|
43
|
-
* Used by any tool that returns SDK payloads to the LLM.
|
|
44
|
-
*/
|
|
45
|
-
export function wrapJsonText(value) {
|
|
46
|
-
return `${JSON_FENCE_PREFIX}${JSON.stringify(value)}${JSON_FENCE_SUFFIX}`;
|
|
47
|
-
}
|
|
48
37
|
/**
|
|
49
38
|
* Computes tool response payload bytes, split by payload side:
|
|
50
39
|
* `contentBytes` sums the UTF-8 byte length of every text item in `content[]`;
|
package/dist/utils/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,gFAAgF;AAChF,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,MAG9B;IACG,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC3C,OAAO,aAAa,KAAK,SAAS;QAC9B,CAAC,CAAC;YACI,CAAC,wBAAwB,CAAC,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE;SAC1D;QACH,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAMhC;IACG,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAEhF,OAAO;QACH,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/D,OAAO;QACP,GAAG,CAAC,SAAS,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;QAC9C,GAAG,CAAC,iBAAiB,KAAK,SAAS,IAAI,EAAE,iBAAiB,EAAE,CAAC;QAC7D,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;KACxC,CAAC;AACN,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/utils/mcp.ts"],"names":[],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AAClG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/actors-mcp-server",
|
|
3
|
-
"version": "0.10.13-beta.
|
|
3
|
+
"version": "0.10.13-beta.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Apify MCP Server",
|
|
6
6
|
"mcpName": "com.apify/apify-mcp-server",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
55
55
|
"@segment/analytics-node": "^2.3.0",
|
|
56
56
|
"@sentry/node": "^10.38.0",
|
|
57
|
+
"@toon-format/toon": "2.3.0",
|
|
57
58
|
"ajv": "^8.17.1",
|
|
58
59
|
"algoliasearch": "^5.31.0",
|
|
59
60
|
"apify-client": "^2.22.1",
|