@apify/actors-mcp-server 0.20.1-beta.9 → 0.20.2-beta.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/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/mcp/proxy.d.ts.map +1 -1
- package/dist/mcp/proxy.js +2 -3
- package/dist/mcp/proxy.js.map +1 -1
- package/dist/test_kit/tsconfig.tsbuildinfo +1 -1
- package/dist/tools/actor_input_schema.d.ts +7 -2
- package/dist/tools/actor_input_schema.d.ts.map +1 -1
- package/dist/tools/actor_input_schema.js +23 -21
- package/dist/tools/actor_input_schema.js.map +1 -1
- package/dist/tools/actors/actor_tools_factory.d.ts.map +1 -1
- package/dist/tools/actors/actor_tools_factory.js +2 -3
- package/dist/tools/actors/actor_tools_factory.js.map +1 -1
- package/dist/tools/schedules/schedule_helpers.d.ts +1 -1
- package/dist/tools/schedules/schedule_helpers.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/ajv.d.ts +6 -2
- package/dist/utils/ajv.d.ts.map +1 -1
- package/dist/utils/ajv.js +22 -15
- package/dist/utils/ajv.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +1 -1
package/dist/utils/ajv.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ValidateFunction } from 'ajv';
|
|
2
2
|
import Ajv from 'ajv';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Ajv with the server's validation policy. One instance per compile, never shared: Ajv caches every compiled
|
|
5
|
+
* schema in a Map that is never evicted.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createAjv(): Ajv;
|
|
4
8
|
/**
|
|
5
9
|
* Removes the `$schema` property and drops fields with real `default` values from `required`.
|
|
6
10
|
*
|
|
@@ -22,7 +26,7 @@ export declare function fixZodSchemaRequired(schema: Record<string, unknown>): R
|
|
|
22
26
|
* and fixing the required array.
|
|
23
27
|
*
|
|
24
28
|
* **Unknown properties are silently stripped** by the AJV `removeAdditional: true` option
|
|
25
|
-
* (set
|
|
29
|
+
* (set in `createAjv`). MCP / LLM clients regularly send extra top-level keys
|
|
26
30
|
* (client metadata, duplicated hints, transport leftovers) that would otherwise cause validation
|
|
27
31
|
* failures. Stripping them is safer than allowing them through with `additionalProperties: true`,
|
|
28
32
|
* because no downstream code should rely on undeclared properties.
|
package/dist/utils/ajv.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ajv.d.ts","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,
|
|
1
|
+
{"version":3,"file":"ajv.d.ts","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB;;;GAGG;AACH,wBAAgB,SAAS,IAAI,GAAG,CAgB/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAc7F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAE/E"}
|
package/dist/utils/ajv.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import Ajv from 'ajv';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Ajv with the server's validation policy. One instance per compile, never shared: Ajv caches every compiled
|
|
4
|
+
* schema in a Map that is never evicted.
|
|
5
|
+
*/
|
|
6
|
+
export function createAjv() {
|
|
7
|
+
const instance = new Ajv({ coerceTypes: 'array', strict: false, removeAdditional: true });
|
|
8
|
+
// `pattern`/`patternProperties` compile a RegExp from untrusted Actor / proxied-MCP input schemas;
|
|
9
|
+
// a catastrophic-backtracking pattern freezes the single-threaded event loop (ReDoS). `format` is
|
|
10
|
+
// inert today (ajv-formats is not registered) but would arm the same vector if it ever were. This
|
|
11
|
+
// layer only sanitizes LLM args — the Actor re-validates its real input on the run — so dropping
|
|
12
|
+
// regex enforcement removes the DoS surface with no loss of protection. Consequence for `src/`
|
|
13
|
+
// schemas: a `.regex()` on a Zod field is NOT enforced here. It still reaches `tools/list` and still
|
|
14
|
+
// fires in a tool body's `parse()`, where it throws a raw ZodError at the client instead of a
|
|
15
|
+
// readable error — so rely on the API's own validation rather than adding one. `taskNameSchema`
|
|
16
|
+
// (`tools/tasks/task_helpers.ts`) still carries one and predates this note.
|
|
17
|
+
instance.removeKeyword('pattern');
|
|
18
|
+
instance.removeKeyword('patternProperties');
|
|
19
|
+
instance.removeKeyword('format');
|
|
20
|
+
return instance;
|
|
21
|
+
}
|
|
15
22
|
/**
|
|
16
23
|
* Removes the `$schema` property and drops fields with real `default` values from `required`.
|
|
17
24
|
*
|
|
@@ -46,7 +53,7 @@ export function fixZodSchemaRequired(schema) {
|
|
|
46
53
|
* and fixing the required array.
|
|
47
54
|
*
|
|
48
55
|
* **Unknown properties are silently stripped** by the AJV `removeAdditional: true` option
|
|
49
|
-
* (set
|
|
56
|
+
* (set in `createAjv`). MCP / LLM clients regularly send extra top-level keys
|
|
50
57
|
* (client metadata, duplicated hints, transport leftovers) that would otherwise cause validation
|
|
51
58
|
* failures. Stripping them is safer than allowing them through with `additionalProperties: true`,
|
|
52
59
|
* because no downstream code should rely on undeclared properties.
|
|
@@ -56,6 +63,6 @@ export function fixZodSchemaRequired(schema) {
|
|
|
56
63
|
* so they are never subject to this stripping.
|
|
57
64
|
*/
|
|
58
65
|
export function compileSchema(schema) {
|
|
59
|
-
return
|
|
66
|
+
return createAjv().compile(fixZodSchemaRequired(schema));
|
|
60
67
|
}
|
|
61
68
|
//# sourceMappingURL=ajv.js.map
|
package/dist/utils/ajv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,
|
|
1
|
+
{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../../src/utils/ajv.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB;;;GAGG;AACH,MAAM,UAAU,SAAS;IACrB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAE1F,mGAAmG;IACnG,kGAAkG;IAClG,kGAAkG;IAClG,iGAAiG;IACjG,+FAA+F;IAC/F,qGAAqG;IACrG,8FAA8F;IAC9F,gGAAgG;IAChG,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC5C,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA+B;IAChE,MAAM,OAAO,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,OAAO,OAAO,CAAC,OAAO,CAAC;IAEvB,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ,IAAI,OAAO,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;QAC3G,MAAM,UAAU,GAAG,OAAO,CAAC,UAAqC,CAAC;QACjE,OAAO,CAAC,QAAQ,GAAI,OAAO,CAAC,QAAqB,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE;YACnE,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;YAC1C,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;YACzE,OAAQ,WAAqC,CAAC,OAAO,KAAK,SAAS,CAAC;QACxE,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,MAA+B;IACzD,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "apify-mcp-server",
|
|
4
4
|
"display_name": "Apify",
|
|
5
|
-
"version": "0.20.
|
|
5
|
+
"version": "0.20.2",
|
|
6
6
|
"description": "Extract data from any website with thousands of scrapers, crawlers, and automations on Apify Store.",
|
|
7
7
|
"long_description": "Apify is the world's largest marketplace of tools for web scraping, crawling, data extraction, and web automation. Get structured data from social media, e-commerce, search engines, maps, travel sites, or any other website.",
|
|
8
8
|
"keywords": [
|
package/package.json
CHANGED