@apify/actors-mcp-server 0.11.5-beta.9 → 0.11.6-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/const.d.ts +40 -25
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +39 -26
- package/dist/const.js.map +1 -1
- package/dist/index_internals.d.ts +30 -3
- package/dist/index_internals.d.ts.map +1 -1
- package/dist/index_internals.js +5 -3
- package/dist/index_internals.js.map +1 -1
- package/dist/mcp/proxy.js +1 -1
- package/dist/mcp/proxy.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +26 -22
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/utils.d.ts +2 -2
- package/dist/mcp/utils.d.ts.map +1 -1
- package/dist/mcp/utils.js +2 -2
- package/dist/mcp/utils.js.map +1 -1
- package/dist/payments/const.d.ts +2 -2
- package/dist/payments/const.d.ts.map +1 -1
- package/dist/payments/const.js +11 -11
- package/dist/payments/const.js.map +1 -1
- package/dist/resources/resource_service.d.ts +2 -2
- package/dist/resources/resource_service.d.ts.map +1 -1
- package/dist/resources/resource_service.js +3 -3
- package/dist/resources/resource_service.js.map +1 -1
- package/dist/tools/{utils.d.ts → actor_input_schema.d.ts} +2 -17
- package/dist/tools/actor_input_schema.d.ts.map +1 -0
- package/dist/tools/{utils.js → actor_input_schema.js} +2 -49
- package/dist/tools/actor_input_schema.js.map +1 -0
- package/dist/tools/actor_tool_naming.d.ts +17 -0
- package/dist/tools/actor_tool_naming.d.ts.map +1 -0
- package/dist/tools/actor_tool_naming.js +49 -0
- package/dist/tools/actor_tool_naming.js.map +1 -0
- package/dist/tools/actors/actor_executor.js +1 -1
- package/dist/tools/actors/actor_executor.js.map +1 -1
- package/dist/tools/actors/actor_run_response.d.ts +2 -2
- package/dist/tools/actors/actor_run_response.d.ts.map +1 -1
- package/dist/tools/actors/actor_run_response.js +10 -15
- package/dist/tools/actors/actor_run_response.js.map +1 -1
- package/dist/tools/actors/actor_tools_factory.d.ts +1 -1
- package/dist/tools/actors/actor_tools_factory.d.ts.map +1 -1
- package/dist/tools/actors/actor_tools_factory.js +6 -5
- package/dist/tools/actors/actor_tools_factory.js.map +1 -1
- package/dist/tools/actors/add_actor.d.ts.map +1 -1
- package/dist/tools/actors/add_actor.js +8 -17
- package/dist/tools/actors/add_actor.js.map +1 -1
- package/dist/tools/actors/call_actor.d.ts +131 -1
- package/dist/tools/actors/call_actor.d.ts.map +1 -1
- package/dist/tools/actors/call_actor.js +484 -3
- package/dist/tools/actors/call_actor.js.map +1 -1
- package/dist/tools/actors/fetch_actor_details.d.ts +88 -1
- package/dist/tools/actors/fetch_actor_details.d.ts.map +1 -1
- package/dist/tools/actors/fetch_actor_details.js +229 -1
- package/dist/tools/actors/fetch_actor_details.js.map +1 -1
- package/dist/tools/actors/search_actors.d.ts +22 -1
- package/dist/tools/actors/search_actors.d.ts.map +1 -1
- package/dist/tools/actors/search_actors.js +123 -8
- package/dist/tools/actors/search_actors.js.map +1 -1
- package/dist/tools/docs/fetch_apify_docs.d.ts.map +1 -1
- package/dist/tools/docs/fetch_apify_docs.js +11 -33
- package/dist/tools/docs/fetch_apify_docs.js.map +1 -1
- package/dist/tools/docs/search_apify_docs.js +6 -6
- package/dist/tools/docs/search_apify_docs.js.map +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/registry.d.ts +6 -6
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +9 -9
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/runs/abort_actor_run.d.ts.map +1 -1
- package/dist/tools/runs/abort_actor_run.js +4 -7
- package/dist/tools/runs/abort_actor_run.js.map +1 -1
- package/dist/tools/runs/get_actor_run.d.ts +28 -1
- package/dist/tools/runs/get_actor_run.d.ts.map +1 -1
- package/dist/tools/runs/get_actor_run.js +99 -2
- package/dist/tools/runs/get_actor_run.js.map +1 -1
- package/dist/tools/runs/get_actor_run_list.js +2 -2
- package/dist/tools/runs/get_actor_run_list.js.map +1 -1
- package/dist/tools/runs/get_actor_run_log.js +2 -2
- package/dist/tools/runs/get_actor_run_log.js.map +1 -1
- package/dist/tools/storage/get_dataset.d.ts.map +1 -1
- package/dist/tools/storage/get_dataset.js +7 -6
- package/dist/tools/storage/get_dataset.js.map +1 -1
- package/dist/tools/storage/get_dataset_items.d.ts.map +1 -1
- package/dist/tools/storage/get_dataset_items.js +6 -5
- package/dist/tools/storage/get_dataset_items.js.map +1 -1
- package/dist/tools/storage/get_dataset_list.js +4 -4
- package/dist/tools/storage/get_dataset_list.js.map +1 -1
- package/dist/tools/storage/get_dataset_schema.d.ts.map +1 -1
- package/dist/tools/storage/get_dataset_schema.js +9 -13
- package/dist/tools/storage/get_dataset_schema.js.map +1 -1
- package/dist/tools/storage/get_key_value_store.d.ts.map +1 -1
- package/dist/tools/storage/get_key_value_store.js +6 -5
- package/dist/tools/storage/get_key_value_store.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_keys.d.ts.map +1 -1
- package/dist/tools/storage/get_key_value_store_keys.js +5 -4
- package/dist/tools/storage/get_key_value_store_keys.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_list.js +4 -4
- package/dist/tools/storage/get_key_value_store_list.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_record.d.ts.map +1 -1
- package/dist/tools/storage/get_key_value_store_record.js +5 -4
- package/dist/tools/storage/get_key_value_store_record.js.map +1 -1
- package/dist/tools/storage/storage_helpers.d.ts +0 -15
- package/dist/tools/storage/storage_helpers.d.ts.map +1 -1
- package/dist/tools/storage/storage_helpers.js +9 -22
- package/dist/tools/storage/storage_helpers.js.map +1 -1
- package/dist/tools/widgets/call_actor_widget.d.ts.map +1 -1
- package/dist/tools/widgets/call_actor_widget.js +14 -17
- package/dist/tools/widgets/call_actor_widget.js.map +1 -1
- package/dist/tools/widgets/fetch_actor_details_widget.d.ts.map +1 -1
- package/dist/tools/widgets/fetch_actor_details_widget.js +8 -9
- package/dist/tools/widgets/fetch_actor_details_widget.js.map +1 -1
- package/dist/tools/widgets/get_actor_run_widget.js +4 -4
- package/dist/tools/widgets/get_actor_run_widget.js.map +1 -1
- package/dist/tools/widgets/search_actors_widget.d.ts.map +1 -1
- package/dist/tools/widgets/search_actors_widget.js +8 -10
- package/dist/tools/widgets/search_actors_widget.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +6 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/dist/utils/actor_details.js +1 -1
- package/dist/utils/actor_details.js.map +1 -1
- package/dist/utils/apify_docs.d.ts.map +1 -1
- package/dist/utils/apify_docs.js +16 -3
- package/dist/utils/apify_docs.js.map +1 -1
- package/dist/utils/mcp.d.ts +56 -9
- package/dist/utils/mcp.d.ts.map +1 -1
- package/dist/utils/mcp.js +80 -16
- package/dist/utils/mcp.js.map +1 -1
- package/dist/utils/payment_errors.js +2 -2
- package/dist/utils/payment_errors.js.map +1 -1
- package/dist/utils/server-instructions/index.d.ts +2 -2
- package/dist/utils/server-instructions/index.d.ts.map +1 -1
- package/dist/utils/server-instructions/index.js +19 -19
- package/dist/utils/server-instructions/index.js.map +1 -1
- package/dist/utils/server_mode.d.ts +5 -5
- package/dist/utils/server_mode.d.ts.map +1 -1
- package/dist/utils/server_mode.js +10 -10
- package/dist/utils/server_mode.js.map +1 -1
- package/dist/utils/tool_categories_helpers.d.ts +2 -2
- package/dist/utils/tool_categories_helpers.d.ts.map +1 -1
- package/dist/utils/tool_categories_helpers.js.map +1 -1
- package/dist/utils/tools.d.ts +2 -2
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +2 -2
- package/dist/utils/tools.js.map +1 -1
- package/dist/utils/tools_loader.d.ts +3 -3
- package/dist/utils/tools_loader.d.ts.map +1 -1
- package/dist/utils/tools_loader.js +12 -12
- package/dist/utils/tools_loader.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +1 -1
- package/dist/tools/actors/call_actor_common.d.ts +0 -132
- package/dist/tools/actors/call_actor_common.d.ts.map +0 -1
- package/dist/tools/actors/call_actor_common.js +0 -554
- package/dist/tools/actors/call_actor_common.js.map +0 -1
- package/dist/tools/actors/fetch_actor_details_common.d.ts +0 -89
- package/dist/tools/actors/fetch_actor_details_common.d.ts.map +0 -1
- package/dist/tools/actors/fetch_actor_details_common.js +0 -235
- package/dist/tools/actors/fetch_actor_details_common.js.map +0 -1
- package/dist/tools/actors/search_actors_common.d.ts +0 -25
- package/dist/tools/actors/search_actors_common.d.ts.map +0 -1
- package/dist/tools/actors/search_actors_common.js +0 -125
- package/dist/tools/actors/search_actors_common.js.map +0 -1
- package/dist/tools/runs/get_actor_run_common.d.ts +0 -29
- package/dist/tools/runs/get_actor_run_common.d.ts.map +0 -1
- package/dist/tools/runs/get_actor_run_common.js +0 -111
- package/dist/tools/runs/get_actor_run_common.js.map +0 -1
- package/dist/tools/utils.d.ts.map +0 -1
- package/dist/tools/utils.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SERVER_MODE, type ServerModeOption } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Parse an untrusted raw mode string (from CLI flag, env var, or URL param) into a {@link ServerModeOption}.
|
|
4
4
|
*
|
|
@@ -13,9 +13,9 @@ import { ServerMode, type ServerModeOption } from '../types.js';
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function parseServerMode(rawMode: string | null | undefined): ServerModeOption;
|
|
15
15
|
/**
|
|
16
|
-
* Resolve a {@link ServerModeOption} to a concrete {@link
|
|
17
|
-
* Concrete modes are returned as-is. `'auto'` resolves to {@link
|
|
18
|
-
* when the client advertises MCP Apps UI support, {@link
|
|
16
|
+
* Resolve a {@link ServerModeOption} to a concrete {@link SERVER_MODE}.
|
|
17
|
+
* Concrete modes are returned as-is. `'auto'` resolves to {@link SERVER_MODE.APPS}
|
|
18
|
+
* when the client advertises MCP Apps UI support, {@link SERVER_MODE.DEFAULT} otherwise.
|
|
19
19
|
*/
|
|
20
|
-
export declare function resolveServerMode(option: ServerModeOption, clientSupportsUi: boolean):
|
|
20
|
+
export declare function resolveServerMode(option: ServerModeOption, clientSupportsUi: boolean): SERVER_MODE;
|
|
21
21
|
//# sourceMappingURL=server_mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server_mode.d.ts","sourceRoot":"","sources":["../../src/utils/server_mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server_mode.d.ts","sourceRoot":"","sources":["../../src/utils/server_mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,CAMpF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,GAAG,WAAW,CAIlG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SERVER_MODE_AUTO_DETECTION_ENABLED } from '../const.js';
|
|
2
|
-
import {
|
|
2
|
+
import { SERVER_MODE } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Parse an untrusted raw mode string (from CLI flag, env var, or URL param) into a {@link ServerModeOption}.
|
|
5
5
|
*
|
|
@@ -15,22 +15,22 @@ import { ServerMode } from '../types.js';
|
|
|
15
15
|
export function parseServerMode(rawMode) {
|
|
16
16
|
if (!rawMode)
|
|
17
17
|
return 'auto';
|
|
18
|
-
if (rawMode === 'true' || rawMode === 'on' || rawMode ===
|
|
19
|
-
return
|
|
20
|
-
if (rawMode === 'false' || rawMode === 'off' || rawMode ===
|
|
21
|
-
return
|
|
18
|
+
if (rawMode === 'true' || rawMode === 'on' || rawMode === SERVER_MODE.APPS || rawMode === 'openai')
|
|
19
|
+
return SERVER_MODE.APPS;
|
|
20
|
+
if (rawMode === 'false' || rawMode === 'off' || rawMode === SERVER_MODE.DEFAULT)
|
|
21
|
+
return SERVER_MODE.DEFAULT;
|
|
22
22
|
return 'auto';
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Resolve a {@link ServerModeOption} to a concrete {@link
|
|
26
|
-
* Concrete modes are returned as-is. `'auto'` resolves to {@link
|
|
27
|
-
* when the client advertises MCP Apps UI support, {@link
|
|
25
|
+
* Resolve a {@link ServerModeOption} to a concrete {@link SERVER_MODE}.
|
|
26
|
+
* Concrete modes are returned as-is. `'auto'` resolves to {@link SERVER_MODE.APPS}
|
|
27
|
+
* when the client advertises MCP Apps UI support, {@link SERVER_MODE.DEFAULT} otherwise.
|
|
28
28
|
*/
|
|
29
29
|
export function resolveServerMode(option, clientSupportsUi) {
|
|
30
30
|
if (option !== 'auto')
|
|
31
31
|
return option;
|
|
32
32
|
if (!SERVER_MODE_AUTO_DETECTION_ENABLED)
|
|
33
|
-
return
|
|
34
|
-
return clientSupportsUi ?
|
|
33
|
+
return SERVER_MODE.DEFAULT;
|
|
34
|
+
return clientSupportsUi ? SERVER_MODE.APPS : SERVER_MODE.DEFAULT;
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=server_mode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server_mode.js","sourceRoot":"","sources":["../../src/utils/server_mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server_mode.js","sourceRoot":"","sources":["../../src/utils/server_mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,WAAW,EAAyB,MAAM,aAAa,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,OAAkC;IAC9D,IAAI,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC;IAC5B,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,WAAW,CAAC,IAAI,IAAI,OAAO,KAAK,QAAQ;QAC9F,OAAO,WAAW,CAAC,IAAI,CAAC;IAC5B,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,WAAW,CAAC,OAAO;QAAE,OAAO,WAAW,CAAC,OAAO,CAAC;IAC5G,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAwB,EAAE,gBAAyB;IACjF,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IACrC,IAAI,CAAC,kCAAkC;QAAE,OAAO,WAAW,CAAC,OAAO,CAAC;IACpE,OAAO,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC;AACrE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SERVER_MODE, ToolCategory, ToolEntry } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Returns the tool objects for the given category names resolved for the specified mode.
|
|
4
4
|
*/
|
|
5
|
-
export declare function getExpectedToolsByCategories(categories: ToolCategory[], mode:
|
|
5
|
+
export declare function getExpectedToolsByCategories(categories: ToolCategory[], mode: SERVER_MODE): ToolEntry[];
|
|
6
6
|
/**
|
|
7
7
|
* Returns the tool names for the given category names.
|
|
8
8
|
* Tool names are identical across all server modes, so no mode parameter is needed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool_categories_helpers.d.ts","sourceRoot":"","sources":["../../src/utils/tool_categories_helpers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tool_categories_helpers.d.ts","sourceRoot":"","sources":["../../src/utils/tool_categories_helpers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExE;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,CAGvG;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAErF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool_categories_helpers.js","sourceRoot":"","sources":["../../src/utils/tool_categories_helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"tool_categories_helpers.js","sourceRoot":"","sources":["../../src/utils/tool_categories_helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,UAA0B,EAAE,IAAiB;IACtF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAAC,UAA0B;IACvE,OAAO,4BAA4B,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC"}
|
package/dist/utils/tools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CallDiagnostics, ToolBase, ToolEntry } from '../types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { SERVER_MODE } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the canonical full name for a tool.
|
|
5
5
|
* For actor tools this is actorFullName (e.g. "apify/rag-web-browser"),
|
|
@@ -22,7 +22,7 @@ export declare function buildActorFields(actorName?: string, actorId?: string):
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function extractActorName(tool: ToolEntry, args?: Record<string, unknown>): string | undefined;
|
|
24
24
|
type ToolPublicFieldOptions = {
|
|
25
|
-
mode?:
|
|
25
|
+
mode?: SERVER_MODE;
|
|
26
26
|
filterWidgetMeta?: boolean;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/utils/tools.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAc,QAAQ,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/utils/tools.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAc,QAAQ,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAUvD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAGlE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,GACjB,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,UAAU,CAAC,CAKlD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,CAUpG;AAED,KAAK,sBAAsB,GAAG;IAC1B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AA2BF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,sBAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe1F;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAoB9D;AAUD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAsBnE"}
|
package/dist/utils/tools.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SKYFIRE_ENABLED_TOOLS, SKYFIRE_PAY_ID_PROPERTY_DESCRIPTION, SKYFIRE_TOOL_INSTRUCTIONS, } from '../payments/const.js';
|
|
2
|
-
import {
|
|
2
|
+
import { SERVER_MODE, TOOL_TYPE } from '../types.js';
|
|
3
3
|
import { fixZodSchemaRequired } from './ajv.js';
|
|
4
4
|
/**
|
|
5
5
|
* Returns the canonical full name for a tool.
|
|
@@ -81,7 +81,7 @@ function fixZodInputSchemaRequired(inputSchema) {
|
|
|
81
81
|
*/
|
|
82
82
|
export function getToolPublicFieldOnly(tool, options = {}) {
|
|
83
83
|
const { mode, filterWidgetMeta = false } = options;
|
|
84
|
-
const meta = filterWidgetMeta && mode !==
|
|
84
|
+
const meta = filterWidgetMeta && mode !== SERVER_MODE.APPS ? stripWidgetMeta(tool._meta) : tool._meta;
|
|
85
85
|
return {
|
|
86
86
|
name: tool.name,
|
|
87
87
|
title: tool.title,
|
package/dist/utils/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/utils/tools.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,EACrB,mCAAmC,EACnC,yBAAyB,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/utils/tools.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,EACrB,mCAAmC,EACnC,yBAAyB,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAAe;IAC3C,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,SAAS,CAAC,KAAK;YAChB,OAAO,IAAI,CAAC,aAAa,CAAC;QAC9B,KAAK,SAAS,CAAC,QAAQ,CAAC;QACxB,KAAK,SAAS,CAAC,SAAS;YACpB,OAAO,IAAI,CAAC,IAAI,CAAC;QACrB;YACI,OAAQ,IAAkC,CAAC,IAAI,CAAC;IACxD,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAe;IAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC,OAAO,CAAC;IAC5F,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC5B,SAAkB,EAClB,OAAgB;IAEhB,OAAO;QACH,GAA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,CAAC;YAC3B,KAAK,CAAC,gBAAgB,CAAC,GAAG;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mCAAmC;aACnD,CAAC;QACN,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { ApifyClient } from 'apify-client';
|
|
6
6
|
import type { PaymentProvider } from '../payments/types.js';
|
|
7
7
|
import type { ActorStore, Input, ToolEntry } from '../types.js';
|
|
8
|
-
import {
|
|
8
|
+
import { SERVER_MODE } from '../types.js';
|
|
9
9
|
/**
|
|
10
10
|
* Tools auto-injected alongside any actor-running tool (call-actor / direct
|
|
11
11
|
* actor tools / add-actor). Order matches the workflow: fetch run status →
|
|
@@ -26,7 +26,7 @@ export declare function getActors(input: Input, apifyClient: ApifyClient, option
|
|
|
26
26
|
/** Build a restore {@link Input} from concrete tool names: internal names → `tools`, actor names → `actors`. */
|
|
27
27
|
export declare function toolNamesToInput(toolNames: string[]): Input;
|
|
28
28
|
/** Compose the final tool list from pre-fetched actor tools and the original input for the given mode. */
|
|
29
|
-
export declare function getToolsForServerMode(input: Input, actorTools: ToolEntry[], mode?:
|
|
29
|
+
export declare function getToolsForServerMode(input: Input, actorTools: ToolEntry[], mode?: SERVER_MODE): ToolEntry[];
|
|
30
30
|
/** Convenience wrapper: {@link getActors} + {@link getToolsForServerMode} in sequence. */
|
|
31
|
-
export declare function loadToolsFromInput(input: Input, apifyClient: ApifyClient, mode?:
|
|
31
|
+
export declare function loadToolsFromInput(input: Input, apifyClient: ApifyClient, mode?: SERVER_MODE, actorStore?: ActorStore): Promise<ToolEntry[]>;
|
|
32
32
|
//# sourceMappingURL=tools_loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools_loader.d.ts","sourceRoot":"","sources":["../../src/utils/tools_loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA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,GACxB,OAAO,CAAC,SAAS,EAAE,CAAC,CAGtB"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* {@link loadToolsFromInput} runs both in sequence.
|
|
4
4
|
*/
|
|
5
5
|
import log from '@apify/log';
|
|
6
|
-
import { defaults,
|
|
6
|
+
import { defaults, HELPER_TOOLS } from '../const.js';
|
|
7
7
|
import { addActor } from '../tools/actors/add_actor.js';
|
|
8
8
|
import { getActorsAsTools } from '../tools/index.js';
|
|
9
9
|
import { CATEGORY_NAME_SET, CATEGORY_NAMES, getCategoryTools, toolCategoriesEnabledByDefault, WIDGET_BY_BASE_TOOL, } from '../tools/registry.js';
|
|
@@ -11,7 +11,7 @@ import { abortActorRun } from '../tools/runs/abort_actor_run.js';
|
|
|
11
11
|
import { getActorRun } from '../tools/runs/get_actor_run.js';
|
|
12
12
|
import { getDatasetItems } from '../tools/storage/get_dataset_items.js';
|
|
13
13
|
import { getKeyValueStoreRecord } from '../tools/storage/get_key_value_store_record.js';
|
|
14
|
-
import { SERVER_MODES,
|
|
14
|
+
import { SERVER_MODES, SERVER_MODE, TOOL_TYPE } from '../types.js';
|
|
15
15
|
/**
|
|
16
16
|
* Tools auto-injected alongside any actor-running tool (call-actor / direct
|
|
17
17
|
* actor tools / add-actor). Order matches the workflow: fetch run status →
|
|
@@ -62,7 +62,7 @@ function normalizeInput(input) {
|
|
|
62
62
|
/**
|
|
63
63
|
* Resolve the list of Actor names (`username/name`) to fetch from the input.
|
|
64
64
|
*
|
|
65
|
-
* **Mode-agnostic** — the result does NOT depend on `
|
|
65
|
+
* **Mode-agnostic** — the result does NOT depend on `SERVER_MODE`. An Actor tool
|
|
66
66
|
* is identified by name, and the same Actor entry is reused across modes; only
|
|
67
67
|
* the *internal* tool variants around it differ by mode.
|
|
68
68
|
*
|
|
@@ -145,7 +145,7 @@ export function toolNamesToInput(toolNames) {
|
|
|
145
145
|
return input;
|
|
146
146
|
}
|
|
147
147
|
/** Compose the final tool list from pre-fetched actor tools and the original input for the given mode. */
|
|
148
|
-
export function getToolsForServerMode(input, actorTools, mode =
|
|
148
|
+
export function getToolsForServerMode(input, actorTools, mode = SERVER_MODE.DEFAULT) {
|
|
149
149
|
// Build mode-resolved categories — tools are already the correct variant for this mode
|
|
150
150
|
const categories = getCategoryTools(mode);
|
|
151
151
|
const { selectors, addActorEnabled, actorsExplicitlyEmpty } = normalizeInput(input);
|
|
@@ -158,7 +158,7 @@ export function getToolsForServerMode(input, actorTools, mode = ServerMode.DEFAU
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
// Widgets are apps-only and not in any category; include it for direct selection
|
|
161
|
-
if (mode ===
|
|
161
|
+
if (mode === SERVER_MODE.APPS) {
|
|
162
162
|
for (const widget of WIDGET_BY_BASE_TOOL.values()) {
|
|
163
163
|
toolsByName.set(widget.name, widget);
|
|
164
164
|
}
|
|
@@ -171,7 +171,7 @@ export function getToolsForServerMode(input, actorTools, mode = ServerMode.DEFAU
|
|
|
171
171
|
if (sel === 'preview') {
|
|
172
172
|
// 'preview' category is deprecated. It contained `call-actor` which is now default.
|
|
173
173
|
log.warning('Tool category "preview" is deprecated');
|
|
174
|
-
const callActorTool = toolsByName.get(
|
|
174
|
+
const callActorTool = toolsByName.get(HELPER_TOOLS.ACTOR_CALL);
|
|
175
175
|
if (callActorTool)
|
|
176
176
|
internalSelections.push(callActorTool);
|
|
177
177
|
continue;
|
|
@@ -227,20 +227,20 @@ export function getToolsForServerMode(input, actorTools, mode = ServerMode.DEFAU
|
|
|
227
227
|
* get-key-value-store-record → abort-actor-run. If the user explicitly selected these tools
|
|
228
228
|
* via category before `actors`, the de-dup pass below preserves their selector order.
|
|
229
229
|
*/
|
|
230
|
-
const hasCallActor = result.some((entry) => entry.name ===
|
|
230
|
+
const hasCallActor = result.some((entry) => entry.name === HELPER_TOOLS.ACTOR_CALL);
|
|
231
231
|
const hasActorTools = result.some((entry) => entry.type === TOOL_TYPE.ACTOR);
|
|
232
|
-
const hasAddActorTool = result.some((entry) => entry.name ===
|
|
232
|
+
const hasAddActorTool = result.some((entry) => entry.name === HELPER_TOOLS.ACTOR_ADD);
|
|
233
233
|
// `get-actor-run`'s nextStep templates point at `get-dataset-items` / `get-key-value-store-record`,
|
|
234
234
|
// and the apps-mode widget calls `get-dataset-items` to fetch its preview. A runs-only session
|
|
235
235
|
// (e.g. `tools: ['runs']`) would otherwise land on an unrecommendable tool / empty widget.
|
|
236
|
-
const hasGetActorRun = result.some((entry) => entry.name ===
|
|
236
|
+
const hasGetActorRun = result.some((entry) => entry.name === HELPER_TOOLS.ACTOR_RUNS_GET);
|
|
237
237
|
// Inject run-workflow helpers whenever any actor-running entrypoint is present; de-dup pass below drops repeats.
|
|
238
238
|
const toolsToInject = [];
|
|
239
239
|
if (hasCallActor || hasActorTools || hasAddActorTool || hasGetActorRun) {
|
|
240
240
|
toolsToInject.push(...AUTO_INJECTED_TOOLS);
|
|
241
241
|
}
|
|
242
242
|
if (toolsToInject.length > 0) {
|
|
243
|
-
const callActorIndex = result.findIndex((entry) => entry.name ===
|
|
243
|
+
const callActorIndex = result.findIndex((entry) => entry.name === HELPER_TOOLS.ACTOR_CALL);
|
|
244
244
|
if (callActorIndex !== -1) {
|
|
245
245
|
result.splice(callActorIndex + 1, 0, ...toolsToInject);
|
|
246
246
|
}
|
|
@@ -251,7 +251,7 @@ export function getToolsForServerMode(input, actorTools, mode = ServerMode.DEFAU
|
|
|
251
251
|
// Apps mode: append a widget tool for each base tool already in the result.
|
|
252
252
|
// Runs after the get-actor-run auto-inject, so an auto-injected base still
|
|
253
253
|
// brings its widget sibling.
|
|
254
|
-
if (mode ===
|
|
254
|
+
if (mode === SERVER_MODE.APPS) {
|
|
255
255
|
for (const entry of [...result]) {
|
|
256
256
|
const widget = WIDGET_BY_BASE_TOOL.get(entry.name);
|
|
257
257
|
// Push unconditionally; any duplicates are stripped by the de-dup pass below.
|
|
@@ -264,7 +264,7 @@ export function getToolsForServerMode(input, actorTools, mode = ServerMode.DEFAU
|
|
|
264
264
|
return result.filter((entry) => !seen.has(entry.name) && seen.add(entry.name));
|
|
265
265
|
}
|
|
266
266
|
/** Convenience wrapper: {@link getActors} + {@link getToolsForServerMode} in sequence. */
|
|
267
|
-
export async function loadToolsFromInput(input, apifyClient, mode =
|
|
267
|
+
export async function loadToolsFromInput(input, apifyClient, mode = SERVER_MODE.DEFAULT, actorStore) {
|
|
268
268
|
const actorTools = await getActors(input, apifyClient, { actorStore });
|
|
269
269
|
return getToolsForServerMode(input, actorTools, mode);
|
|
270
270
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools_loader.js","sourceRoot":"","sources":["../../src/utils/tools_loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"tools_loader.js","sourceRoot":"","sources":["../../src/utils/tools_loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACH,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,8BAA8B,EAC9B,mBAAmB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;GAIG;AACH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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "apify-mcp-server",
|
|
4
4
|
"display_name": "Apify",
|
|
5
|
-
"version": "0.11.
|
|
5
|
+
"version": "0.11.6",
|
|
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
package/server.json
CHANGED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import type { ApifyApiError } from 'apify-client';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { HelperTools } from '../../const.js';
|
|
4
|
-
import type { PaymentProvider } from '../../payments/types.js';
|
|
5
|
-
import type { ApifyToken, InternalToolArgs, ToolEntry, ToolInputSchema } from '../../types.js';
|
|
6
|
-
import { buildMCPResponse } from '../../utils/mcp.js';
|
|
7
|
-
export declare const CALL_ACTOR_MCP_MISSING_TOOL_NAME_MSG = "When calling an MCP server Actor, you must specify the tool name in the actor parameter as \"{actorName}:{toolName}\" in the \"actor\" input property.";
|
|
8
|
-
/** Shared MCP server instructions — identical in both modes. */
|
|
9
|
-
export declare const CALL_ACTOR_MCP_SERVER_SECTION = "For MCP server Actors:\n- Use fetch-actor-details with output={ mcpTools: true } to list available tools\n- Call using format: \"actorName:toolName\" (e.g., \"apify/actors-mcp-server:fetch-apify-docs\")";
|
|
10
|
-
/** Shared "two ways to run" + USAGE section — identical in both modes. */
|
|
11
|
-
export declare const CALL_ACTOR_USAGE_SECTION: string;
|
|
12
|
-
/** Shared examples section — identical in both modes. */
|
|
13
|
-
export declare const CALL_ACTOR_EXAMPLES_SECTION = "EXAMPLES:\n- user_input: Get instagram posts using apify/instagram-scraper";
|
|
14
|
-
type CallActorErrorResponseParams = {
|
|
15
|
-
actorName: string;
|
|
16
|
-
error: unknown;
|
|
17
|
-
actorId?: string;
|
|
18
|
-
mcpSessionId?: string;
|
|
19
|
-
actorGetDetailsTool: HelperTools.ACTOR_GET_DETAILS;
|
|
20
|
-
};
|
|
21
|
-
export declare function buildCallActorDescription(): string;
|
|
22
|
-
export declare function buildCallActorAppsDescription(): string;
|
|
23
|
-
/** Exported for native actor tool error handling in server.ts — no logging, no telemetry. */
|
|
24
|
-
export declare function buildPermissionApprovalResponse(error: ApifyApiError): ReturnType<typeof buildMCPResponse>;
|
|
25
|
-
export declare function buildCallActorErrorResponse(params: CallActorErrorResponseParams): ReturnType<typeof buildMCPResponse>;
|
|
26
|
-
export declare const callOptionsSchema: z.ZodObject<{
|
|
27
|
-
memory: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
29
|
-
build: z.ZodOptional<z.ZodString>;
|
|
30
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
maxTotalChargeUsd: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
}, z.core.$strip>;
|
|
33
|
-
/** Zod schema for call-actor arguments — shared between default and apps variants. */
|
|
34
|
-
export declare const callActorArgs: z.ZodObject<{
|
|
35
|
-
actor: z.ZodString;
|
|
36
|
-
input: z.ZodObject<{}, z.core.$loose>;
|
|
37
|
-
waitSecs: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
38
|
-
callOptions: z.ZodOptional<z.ZodObject<{
|
|
39
|
-
memory: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
41
|
-
build: z.ZodOptional<z.ZodString>;
|
|
42
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
43
|
-
maxTotalChargeUsd: z.ZodOptional<z.ZodNumber>;
|
|
44
|
-
}, z.core.$strip>>;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
|
-
export declare const callActorInputSchema: ToolInputSchema;
|
|
47
|
-
export declare const callActorAjvValidate: import("ajv").ValidateFunction<unknown>;
|
|
48
|
-
/**
|
|
49
|
-
* Parsed call-actor arguments.
|
|
50
|
-
*/
|
|
51
|
-
export type CallActorParsedArgs = z.infer<typeof callActorArgs>;
|
|
52
|
-
/**
|
|
53
|
-
* Returns a rejection MCP response when the requested Actor is a standby
|
|
54
|
-
* (or MCP-server) Actor AND the session uses a third-party payment provider.
|
|
55
|
-
* Otherwise returns `null`.
|
|
56
|
-
*
|
|
57
|
-
* Standby Actors cannot be paid for via x402 / Skyfire — calling them in
|
|
58
|
-
* payment mode is a hard input error, so this guard must run BEFORE the
|
|
59
|
-
* generic payment-required short-circuit in the tool-call handler so the
|
|
60
|
-
* agent receives the precise reason instead of a generic 402.
|
|
61
|
-
*
|
|
62
|
-
* Uses `actorDefinitionCache` — one definition fetch on a cold cache.
|
|
63
|
-
*/
|
|
64
|
-
export declare function checkPaymentProviderStandbyConflict(params: {
|
|
65
|
-
actorName: string;
|
|
66
|
-
paymentProvider: PaymentProvider;
|
|
67
|
-
apifyToken: ApifyToken;
|
|
68
|
-
mcpSessionId?: string;
|
|
69
|
-
}): Promise<Record<string, unknown> | null>;
|
|
70
|
-
/**
|
|
71
|
-
* Resolves MCP URL and parses the "actor:tool" format.
|
|
72
|
-
* Shared pre-processing step used by both default and apps variants.
|
|
73
|
-
*/
|
|
74
|
-
export declare function resolveActorContext(actorName: string): {
|
|
75
|
-
baseActorName: string;
|
|
76
|
-
mcpToolName: string | undefined;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Handles the MCP tool call flow (when actorName contains ":toolName").
|
|
80
|
-
* Returns a response if handled, or null if this is not an MCP tool call.
|
|
81
|
-
*/
|
|
82
|
-
export declare function handleMcpToolCall(params: {
|
|
83
|
-
baseActorName: string;
|
|
84
|
-
mcpToolName: string;
|
|
85
|
-
input: Record<string, unknown>;
|
|
86
|
-
isActorMcpServer: boolean;
|
|
87
|
-
mcpServerUrl: string | false;
|
|
88
|
-
apifyToken: string;
|
|
89
|
-
mcpSessionId?: string;
|
|
90
|
-
}): Promise<object | null>;
|
|
91
|
-
/**
|
|
92
|
-
* Validates the actor and its input, returning the resolved actor tool or an error response.
|
|
93
|
-
* Shared validation logic used by both default and openai execution paths.
|
|
94
|
-
*/
|
|
95
|
-
export declare function resolveAndValidateActor(params: {
|
|
96
|
-
actorName: string;
|
|
97
|
-
input: Record<string, unknown>;
|
|
98
|
-
toolArgs: InternalToolArgs;
|
|
99
|
-
}): Promise<{
|
|
100
|
-
error: object;
|
|
101
|
-
} | {
|
|
102
|
-
actor: ToolEntry;
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* Performs the pre-execution checks common to both modes:
|
|
106
|
-
* - Parses args
|
|
107
|
-
* - Resolves actor/MCP context
|
|
108
|
-
* - Handles payment provider restrictions
|
|
109
|
-
* - Handles MCP tool calls
|
|
110
|
-
*
|
|
111
|
-
* Returns either an early response (error or MCP tool result) or the parsed context for mode-specific execution.
|
|
112
|
-
*
|
|
113
|
-
* Applies the same `actor` string normalization as `getActorsAsTools` **before** MCP URL lookup and routing so
|
|
114
|
-
* clients cannot pass a clean-enough id for definition fetch but a dirty id to `apifyClient.actor()` (see Mezmo:
|
|
115
|
-
* e.g. trailing `` ` `` on `apify/rag-web-browser`).
|
|
116
|
-
*/
|
|
117
|
-
export declare function callActorPreExecute(toolArgs: InternalToolArgs, options: {
|
|
118
|
-
route: string;
|
|
119
|
-
}): Promise<{
|
|
120
|
-
earlyResponse: object;
|
|
121
|
-
} | {
|
|
122
|
-
parsed: CallActorParsedArgs;
|
|
123
|
-
baseActorName: string;
|
|
124
|
-
mcpToolName: string | undefined;
|
|
125
|
-
}>;
|
|
126
|
-
/**
|
|
127
|
-
* Shared start-then-wait flow for call-actor variants (default + apps).
|
|
128
|
-
* `taskMode` is honored — when true, `waitSecs` is ignored and the SDK waits until terminal.
|
|
129
|
-
*/
|
|
130
|
-
export declare function executeCallActor(toolArgs: InternalToolArgs): Promise<object>;
|
|
131
|
-
export {};
|
|
132
|
-
//# sourceMappingURL=call_actor_common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"call_actor_common.d.ts","sourceRoot":"","sources":["../../../src/tools/actors/call_actor_common.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAKH,WAAW,EAEd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAa,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAY1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAmBtD,eAAO,MAAM,oCAAoC,2JAAuJ,CAAC;AAEzM,gEAAgE;AAChE,eAAO,MAAM,6BAA6B,+MAEmD,CAAC;AAE9F,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,QAMqD,CAAC;AAE3F,yDAAyD;AACzD,eAAO,MAAM,2BAA2B,+EACwB,CAAC;AAEjE,KAAK,4BAA4B,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,WAAW,CAAC,iBAAiB,CAAC;CACtD,CAAC;AAqCF,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AAED,6FAA6F;AAC7F,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAMzG;AAyBD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,4BAA4B,GAAG,UAAU,CAAC,OAAO,gBAAgB,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