@apify/actors-mcp-server 0.12.1-beta.2 → 0.13.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/README.md +2 -6
- package/dist/apify_client.js +4 -1
- package/dist/apify_client.js.map +1 -1
- package/dist/const.d.ts +7 -1
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +11 -2
- package/dist/const.js.map +1 -1
- package/dist/dev_server.js +4 -1
- package/dist/dev_server.js.map +1 -1
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +7 -4
- package/dist/errors.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index_internals.d.ts +1 -7
- package/dist/index_internals.d.ts.map +1 -1
- package/dist/index_internals.js +5 -7
- package/dist/index_internals.js.map +1 -1
- package/dist/input.d.ts +0 -1
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +4 -22
- package/dist/input.js.map +1 -1
- package/dist/instrument.js +4 -1
- package/dist/instrument.js.map +1 -1
- package/dist/mcp/actors.js +4 -1
- package/dist/mcp/actors.js.map +1 -1
- package/dist/mcp/client.js +4 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/client_context.js +4 -1
- package/dist/mcp/client_context.js.map +1 -1
- package/dist/mcp/const.js +4 -1
- package/dist/mcp/const.js.map +1 -1
- package/dist/mcp/errors.js +4 -1
- package/dist/mcp/errors.js.map +1 -1
- package/dist/mcp/proxy.js +4 -1
- package/dist/mcp/proxy.js.map +1 -1
- package/dist/mcp/server.d.ts +5 -36
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +24 -95
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/task_execution.js +4 -1
- package/dist/mcp/task_execution.js.map +1 -1
- package/dist/mcp/tool_call_engine.js +4 -1
- package/dist/mcp/tool_call_engine.js.map +1 -1
- package/dist/mcp/tool_call_error_mapper.js +4 -1
- package/dist/mcp/tool_call_error_mapper.js.map +1 -1
- package/dist/mcp/tool_call_telemetry.js +4 -1
- package/dist/mcp/tool_call_telemetry.js.map +1 -1
- package/dist/mcp/tool_dispatch.js +4 -1
- package/dist/mcp/tool_dispatch.js.map +1 -1
- package/dist/mcp/utils.d.ts.map +1 -1
- package/dist/mcp/utils.js +6 -1
- package/dist/mcp/utils.js.map +1 -1
- package/dist/payments/const.js +4 -1
- package/dist/payments/const.js.map +1 -1
- package/dist/payments/helpers.js +4 -1
- package/dist/payments/helpers.js.map +1 -1
- package/dist/payments/index.js +4 -1
- package/dist/payments/index.js.map +1 -1
- package/dist/payments/resolve.js +4 -1
- package/dist/payments/resolve.js.map +1 -1
- package/dist/payments/skyfire.js +4 -1
- package/dist/payments/skyfire.js.map +1 -1
- package/dist/payments/types.js +4 -1
- package/dist/payments/types.js.map +1 -1
- package/dist/payments/x402.js +4 -1
- package/dist/payments/x402.js.map +1 -1
- package/dist/prompts/index.js +4 -1
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/prompt_service.js +4 -1
- package/dist/prompts/prompt_service.js.map +1 -1
- package/dist/resources/api_resources.js +4 -1
- package/dist/resources/api_resources.js.map +1 -1
- package/dist/resources/resource_service.js +4 -1
- package/dist/resources/resource_service.js.map +1 -1
- package/dist/resources/widgets.js +4 -1
- package/dist/resources/widgets.js.map +1 -1
- package/dist/server_card.js +4 -1
- package/dist/server_card.js.map +1 -1
- package/dist/state.js +4 -1
- package/dist/state.js.map +1 -1
- package/dist/stdio.js +4 -16
- package/dist/stdio.js.map +1 -1
- package/dist/telemetry.js +4 -1
- package/dist/telemetry.js.map +1 -1
- package/dist/tools/actor_input_schema.js +4 -1
- package/dist/tools/actor_input_schema.js.map +1 -1
- package/dist/tools/actor_tool_naming.js +4 -1
- package/dist/tools/actor_tool_naming.js.map +1 -1
- package/dist/tools/actors/actor_definition.js +4 -1
- package/dist/tools/actors/actor_definition.js.map +1 -1
- package/dist/tools/actors/actor_executor.js +4 -1
- package/dist/tools/actors/actor_executor.js.map +1 -1
- package/dist/tools/actors/actor_run_response.js +4 -1
- package/dist/tools/actors/actor_run_response.js.map +1 -1
- package/dist/tools/actors/actor_tools_factory.d.ts +5 -5
- package/dist/tools/actors/actor_tools_factory.js +7 -4
- package/dist/tools/actors/actor_tools_factory.js.map +1 -1
- package/dist/tools/actors/call_actor.js +4 -1
- package/dist/tools/actors/call_actor.js.map +1 -1
- package/dist/tools/actors/fetch_actor_details.js +4 -1
- package/dist/tools/actors/fetch_actor_details.js.map +1 -1
- package/dist/tools/actors/search_actors.js +4 -1
- package/dist/tools/actors/search_actors.js.map +1 -1
- package/dist/tools/dev/report_problem.js +4 -1
- package/dist/tools/dev/report_problem.js.map +1 -1
- package/dist/tools/docs/fetch_apify_docs.js +4 -1
- package/dist/tools/docs/fetch_apify_docs.js.map +1 -1
- package/dist/tools/docs/search_apify_docs.js +4 -1
- package/dist/tools/docs/search_apify_docs.js.map +1 -1
- package/dist/tools/index.js +4 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/registry.d.ts +0 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +4 -3
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/runs/abort_actor_run.js +4 -1
- package/dist/tools/runs/abort_actor_run.js.map +1 -1
- package/dist/tools/runs/get_actor_run.js +4 -1
- package/dist/tools/runs/get_actor_run.js.map +1 -1
- package/dist/tools/runs/get_actor_run_list.js +4 -1
- package/dist/tools/runs/get_actor_run_list.js.map +1 -1
- package/dist/tools/runs/get_actor_run_log.js +4 -1
- package/dist/tools/runs/get_actor_run_log.js.map +1 -1
- package/dist/tools/storage/get_dataset.js +4 -1
- package/dist/tools/storage/get_dataset.js.map +1 -1
- package/dist/tools/storage/get_dataset_items.js +4 -1
- package/dist/tools/storage/get_dataset_items.js.map +1 -1
- package/dist/tools/storage/get_dataset_list.js +4 -1
- package/dist/tools/storage/get_dataset_list.js.map +1 -1
- package/dist/tools/storage/get_dataset_schema.js +4 -1
- package/dist/tools/storage/get_dataset_schema.js.map +1 -1
- package/dist/tools/storage/get_key_value_store.js +4 -1
- package/dist/tools/storage/get_key_value_store.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_keys.js +4 -1
- package/dist/tools/storage/get_key_value_store_keys.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_list.js +4 -1
- package/dist/tools/storage/get_key_value_store_list.js.map +1 -1
- package/dist/tools/storage/get_key_value_store_record.js +4 -1
- package/dist/tools/storage/get_key_value_store_record.js.map +1 -1
- package/dist/tools/storage/storage_helpers.js +4 -1
- package/dist/tools/storage/storage_helpers.js.map +1 -1
- package/dist/tools/structured_output_schemas.js +4 -1
- package/dist/tools/structured_output_schemas.js.map +1 -1
- package/dist/tools/widgets/call_actor_widget.js +4 -1
- package/dist/tools/widgets/call_actor_widget.js.map +1 -1
- package/dist/tools/widgets/fetch_actor_details_widget.js +4 -1
- package/dist/tools/widgets/fetch_actor_details_widget.js.map +1 -1
- package/dist/tools/widgets/get_actor_run_widget.js +4 -1
- package/dist/tools/widgets/get_actor_run_widget.js.map +1 -1
- package/dist/tools/widgets/search_actors_widget.js +4 -1
- package/dist/tools/widgets/search_actors_widget.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +0 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/actor.js +4 -1
- package/dist/utils/actor.js.map +1 -1
- package/dist/utils/actor_card.js +4 -1
- package/dist/utils/actor_card.js.map +1 -1
- package/dist/utils/actor_details.js +4 -1
- package/dist/utils/actor_details.js.map +1 -1
- package/dist/utils/actor_search.js +4 -1
- package/dist/utils/actor_search.js.map +1 -1
- package/dist/utils/ajv.js +4 -1
- package/dist/utils/ajv.js.map +1 -1
- package/dist/utils/apify_docs.js +4 -1
- package/dist/utils/apify_docs.js.map +1 -1
- package/dist/utils/apify_errors.js +4 -1
- package/dist/utils/apify_errors.js.map +1 -1
- package/dist/utils/apify_properties.js +4 -1
- package/dist/utils/apify_properties.js.map +1 -1
- package/dist/utils/auth.d.ts +0 -1
- package/dist/utils/auth.d.ts.map +1 -1
- package/dist/utils/auth.js +15 -9
- package/dist/utils/auth.js.map +1 -1
- package/dist/utils/console_link.js +4 -1
- package/dist/utils/console_link.js.map +1 -1
- package/dist/utils/encode_text.js +4 -1
- package/dist/utils/encode_text.js.map +1 -1
- package/dist/utils/generic.js +4 -1
- package/dist/utils/generic.js.map +1 -1
- package/dist/utils/logging.js +4 -1
- package/dist/utils/logging.js.map +1 -1
- package/dist/utils/mcp.js +4 -1
- package/dist/utils/mcp.js.map +1 -1
- package/dist/utils/mcp_clients.js +4 -1
- package/dist/utils/mcp_clients.js.map +1 -1
- package/dist/utils/payment_errors.js +4 -1
- package/dist/utils/payment_errors.js.map +1 -1
- package/dist/utils/pricing_info.js +4 -1
- package/dist/utils/pricing_info.js.map +1 -1
- package/dist/utils/progress.js +4 -1
- package/dist/utils/progress.js.map +1 -1
- package/dist/utils/schema_generation.js +4 -1
- package/dist/utils/schema_generation.js.map +1 -1
- package/dist/utils/server-instructions/index.js +4 -1
- package/dist/utils/server-instructions/index.js.map +1 -1
- package/dist/utils/server_mode.js +4 -1
- package/dist/utils/server_mode.js.map +1 -1
- package/dist/utils/tool_categories_helpers.js +4 -1
- package/dist/utils/tool_categories_helpers.js.map +1 -1
- package/dist/utils/tool_status.js +4 -1
- package/dist/utils/tool_status.js.map +1 -1
- package/dist/utils/tools.js +4 -1
- package/dist/utils/tools.js.map +1 -1
- package/dist/utils/tools_loader.d.ts +2 -6
- package/dist/utils/tools_loader.d.ts.map +1 -1
- package/dist/utils/tools_loader.js +24 -45
- package/dist/utils/tools_loader.js.map +1 -1
- package/dist/utils/ttl_lru.js +4 -1
- package/dist/utils/ttl_lru.js.map +1 -1
- package/dist/utils/userid_cache.js +4 -1
- package/dist/utils/userid_cache.js.map +1 -1
- package/dist/utils/version.js +4 -1
- package/dist/utils/version.js.map +1 -1
- package/dist/web/dist/actor-run-widget.js +2 -0
- package/dist/web/dist/search-actors-widget.js +2 -0
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +1 -1
- package/dist/tools/actors/add_actor.d.ts +0 -7
- package/dist/tools/actors/add_actor.d.ts.map +0 -1
- package/dist/tools/actors/add_actor.js +0 -60
- package/dist/tools/actors/add_actor.js.map +0 -1
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Two-phase tool loading: {@link getActors} fetches Actor metadata (async, mode-agnostic);
|
|
3
3
|
* {@link loadToolsFromInput} runs both in sequence.
|
|
4
4
|
*/
|
|
5
|
+
|
|
6
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f905d977-87c6-52de-8d12-0a86e0447d19")}catch(e){}}();
|
|
5
7
|
import log from '@apify/log';
|
|
6
|
-
import { defaults, HELPER_TOOLS } from '../const.js';
|
|
8
|
+
import { defaults, HELPER_TOOLS, RETIRED_SELECTOR_NAMES } from '../const.js';
|
|
7
9
|
import { reportProblem } from '../tools/dev/report_problem.js';
|
|
8
10
|
import { getActorsAsTools } from '../tools/index.js';
|
|
9
11
|
import { CATEGORY_NAME_SET, CATEGORY_NAMES, getCategoryTools, toolCategoriesEnabledByDefault, WIDGET_BY_BASE_TOOL, } from '../tools/registry.js';
|
|
@@ -14,7 +16,7 @@ import { getKeyValueStoreRecord } from '../tools/storage/get_key_value_store_rec
|
|
|
14
16
|
import { SERVER_MODES, SERVER_MODE, TOOL_TYPE } from '../types.js';
|
|
15
17
|
/**
|
|
16
18
|
* Tools auto-injected alongside any actor-running tool (call-actor / direct
|
|
17
|
-
* actor tools /
|
|
19
|
+
* actor tools / get-actor-run). Order matches the workflow: fetch run status →
|
|
18
20
|
* fetch items → fetch KV record → abort.
|
|
19
21
|
*/
|
|
20
22
|
export const AUTO_INJECTED_TOOLS = [
|
|
@@ -42,7 +44,7 @@ const ALL_INTERNAL_TOOL_NAMES = (() => {
|
|
|
42
44
|
return names;
|
|
43
45
|
})();
|
|
44
46
|
/**
|
|
45
|
-
* Normalize the raw {@link Input} into cleaned selectors +
|
|
47
|
+
* Normalize the raw {@link Input} into cleaned selectors + the explicit-empty flag.
|
|
46
48
|
* Shared by both loader phases so semantics stay consistent.
|
|
47
49
|
*/
|
|
48
50
|
function normalizeInput(input) {
|
|
@@ -55,7 +57,6 @@ function normalizeInput(input) {
|
|
|
55
57
|
.filter((s) => s !== '');
|
|
56
58
|
return {
|
|
57
59
|
selectors,
|
|
58
|
-
addActorEnabled: input.enableAddingActors === true,
|
|
59
60
|
actorsExplicitlyEmpty: input.actors === '' || (Array.isArray(input.actors) && input.actors.length === 0),
|
|
60
61
|
};
|
|
61
62
|
}
|
|
@@ -67,20 +68,20 @@ function normalizeInput(input) {
|
|
|
67
68
|
* the *internal* tool variants around it differ by mode.
|
|
68
69
|
*
|
|
69
70
|
* Selectors classified as "actor names":
|
|
70
|
-
* - NOT
|
|
71
|
+
* - NOT a retired selector (`RETIRED_SELECTOR_NAMES`: `'preview'`, `'experimental'`, `'add-actor'`)
|
|
71
72
|
* - NOT a category name (from `CATEGORY_NAME_SET`)
|
|
72
73
|
* - NOT the name of an internal tool in any mode (from `ALL_INTERNAL_TOOL_NAMES`)
|
|
73
74
|
*
|
|
74
75
|
* If no selectors / no explicit actors: the defaults apply (or empty when
|
|
75
|
-
*
|
|
76
|
+
* `actors` was explicitly set to empty).
|
|
76
77
|
*/
|
|
77
78
|
function resolveActorsToLoad(input) {
|
|
78
|
-
const { selectors,
|
|
79
|
-
// Selectors that aren't categories or internal tools in any mode → Actor names.
|
|
79
|
+
const { selectors, actorsExplicitlyEmpty } = normalizeInput(input);
|
|
80
|
+
// Selectors that aren't retired, categories, or internal tools in any mode → Actor names.
|
|
80
81
|
const actorSelectorsFromTools = [];
|
|
81
82
|
if (selectors !== undefined) {
|
|
82
83
|
for (const sel of selectors) {
|
|
83
|
-
if (sel
|
|
84
|
+
if (RETIRED_SELECTOR_NAMES.has(sel))
|
|
84
85
|
continue;
|
|
85
86
|
if (CATEGORY_NAME_SET.has(sel))
|
|
86
87
|
continue;
|
|
@@ -104,8 +105,8 @@ function resolveActorsToLoad(input) {
|
|
|
104
105
|
if (actorSelectorsFromTools.length > 0)
|
|
105
106
|
return actorSelectorsFromTools;
|
|
106
107
|
if (selectors === undefined) {
|
|
107
|
-
// No selectors supplied: use defaults unless
|
|
108
|
-
return
|
|
108
|
+
// No selectors supplied: use defaults unless actors were explicitly empty
|
|
109
|
+
return actorsExplicitlyEmpty ? [] : defaults.actors;
|
|
109
110
|
}
|
|
110
111
|
// Selectors provided but none are actors => do not load defaults
|
|
111
112
|
return [];
|
|
@@ -129,6 +130,10 @@ export function toolNamesToInput(toolNames) {
|
|
|
129
130
|
const internalToolNames = [];
|
|
130
131
|
const actorToolNames = [];
|
|
131
132
|
for (const toolName of toolNames) {
|
|
133
|
+
// A retired name in a restored session (e.g. a pre-cutoff `add-actor`) is inert: drop it
|
|
134
|
+
// rather than misroute it to `actors`, where it would trigger a fetch for a nonexistent Actor.
|
|
135
|
+
if (RETIRED_SELECTOR_NAMES.has(toolName))
|
|
136
|
+
continue;
|
|
132
137
|
if (ALL_INTERNAL_TOOL_NAMES.has(toolName)) {
|
|
133
138
|
internalToolNames.push(toolName);
|
|
134
139
|
}
|
|
@@ -146,16 +151,11 @@ export function toolNamesToInput(toolNames) {
|
|
|
146
151
|
}
|
|
147
152
|
/**
|
|
148
153
|
* Compose the final tool list from pre-fetched actor tools and the original input for the given mode.
|
|
149
|
-
*
|
|
150
|
-
* @param isSessionRestore - `true` for a session restore (`toolNamesToInput()` via `loadToolsByName()`),
|
|
151
|
-
* as opposed to a live selector. A restored session's stored name can be `'add-actor'` from before
|
|
152
|
-
* the PR 0 cutoff below — it must resolve to itself, not get substituted like a fresh selector.
|
|
153
154
|
*/
|
|
154
|
-
export function getToolsForServerMode(input, actorTools, mode = SERVER_MODE.DEFAULT
|
|
155
|
+
export function getToolsForServerMode(input, actorTools, mode = SERVER_MODE.DEFAULT) {
|
|
155
156
|
// Build mode-resolved categories — tools are already the correct variant for this mode
|
|
156
157
|
const categories = getCategoryTools(mode);
|
|
157
|
-
const { selectors,
|
|
158
|
-
const selectorsExplicitEmpty = (selectors === null || selectors === void 0 ? void 0 : selectors.length) === 0;
|
|
158
|
+
const { selectors, actorsExplicitlyEmpty } = normalizeInput(input);
|
|
159
159
|
// Build mode-specific tool-by-name map for individual tool selection
|
|
160
160
|
const toolsByName = new Map();
|
|
161
161
|
for (const name of CATEGORY_NAMES) {
|
|
@@ -169,23 +169,14 @@ export function getToolsForServerMode(input, actorTools, mode = SERVER_MODE.DEFA
|
|
|
169
169
|
toolsByName.set(widget.name, widget);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
const callActorTool = toolsByName.get(HELPER_TOOLS.ACTOR_CALL);
|
|
173
172
|
// Walk selectors for internal picks (mode-specific). Actor-name classification
|
|
174
173
|
// happened in `resolveActorsToLoad`; we don't need to partition again here.
|
|
175
174
|
const internalSelections = [];
|
|
176
175
|
if (selectors !== undefined && selectors.length > 0) {
|
|
177
176
|
for (const sel of selectors) {
|
|
178
|
-
//
|
|
179
|
-
|
|
180
|
-
// restore, where `sel` may be a pre-cutoff session's own stored name.
|
|
181
|
-
if (sel === 'preview' ||
|
|
182
|
-
(!isSessionRestore && (sel === HELPER_TOOLS.ACTOR_ADD || sel === 'experimental'))) {
|
|
183
|
-
if (sel === 'preview')
|
|
184
|
-
log.warning('Tool category "preview" is deprecated');
|
|
185
|
-
if (callActorTool)
|
|
186
|
-
internalSelections.push(callActorTool);
|
|
177
|
+
// Retired selectors (add-actor, experimental, preview) are inert.
|
|
178
|
+
if (RETIRED_SELECTOR_NAMES.has(sel))
|
|
187
179
|
continue;
|
|
188
|
-
}
|
|
189
180
|
const categoryTools = categories[sel];
|
|
190
181
|
if (categoryTools) {
|
|
191
182
|
internalSelections.push(...categoryTools);
|
|
@@ -209,18 +200,6 @@ export function getToolsForServerMode(input, actorTools, mode = SERVER_MODE.DEFA
|
|
|
209
200
|
// Internal tools
|
|
210
201
|
if (selectors !== undefined) {
|
|
211
202
|
result.push(...internalSelections);
|
|
212
|
-
// enableAddingActors cutoff (PR 0): substitute call-actor for add-actor. Restore inputs never
|
|
213
|
-
// set this flag (toolNamesToInput() doesn't), so this only fires for a live connection.
|
|
214
|
-
if (addActorEnabled && !selectorsExplicitEmpty && !actorsExplicitlyEmpty) {
|
|
215
|
-
const hasCallActor = result.some((e) => e.name === (callActorTool === null || callActorTool === void 0 ? void 0 : callActorTool.name));
|
|
216
|
-
if (callActorTool && !hasCallActor)
|
|
217
|
-
result.push(callActorTool);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
else if (addActorEnabled && !actorsExplicitlyEmpty) {
|
|
221
|
-
// No selectors: either expose only call-actor (add-actor substitution, when enabled) or default categories
|
|
222
|
-
if (callActorTool)
|
|
223
|
-
result.push(callActorTool);
|
|
224
203
|
}
|
|
225
204
|
else if (!actorsExplicitlyEmpty) {
|
|
226
205
|
// Use mode-resolved default categories
|
|
@@ -238,7 +217,7 @@ export function getToolsForServerMode(input, actorTools, mode = SERVER_MODE.DEFA
|
|
|
238
217
|
result.push(...actorTools);
|
|
239
218
|
}
|
|
240
219
|
/**
|
|
241
|
-
* Auto-inject run-status and storage tools when call-actor
|
|
220
|
+
* Auto-inject run-status and storage tools when call-actor or actor tools are present.
|
|
242
221
|
* Insert them right after call-actor (or appended at the end when call-actor is absent) so the
|
|
243
222
|
* default tool list reads in workflow order: call → get-actor-run → get-dataset-items →
|
|
244
223
|
* get-key-value-store-record → abort-actor-run. If the user explicitly selected these tools
|
|
@@ -246,14 +225,13 @@ export function getToolsForServerMode(input, actorTools, mode = SERVER_MODE.DEFA
|
|
|
246
225
|
*/
|
|
247
226
|
const hasCallActor = result.some((entry) => entry.name === HELPER_TOOLS.ACTOR_CALL);
|
|
248
227
|
const hasActorTools = result.some((entry) => entry.type === TOOL_TYPE.ACTOR);
|
|
249
|
-
const hasAddActorTool = result.some((entry) => entry.name === HELPER_TOOLS.ACTOR_ADD);
|
|
250
228
|
// `get-actor-run`'s nextStep templates point at `get-dataset-items` / `get-key-value-store-record`,
|
|
251
229
|
// and the apps-mode widget calls `get-dataset-items` to fetch its preview. A runs-only session
|
|
252
230
|
// (e.g. `tools: ['runs']`) would otherwise land on an unrecommendable tool / empty widget.
|
|
253
231
|
const hasGetActorRun = result.some((entry) => entry.name === HELPER_TOOLS.ACTOR_RUNS_GET);
|
|
254
232
|
// Inject run-workflow helpers whenever any actor-running entrypoint is present; de-dup pass below drops repeats.
|
|
255
233
|
const toolsToInject = [];
|
|
256
|
-
if (hasCallActor || hasActorTools ||
|
|
234
|
+
if (hasCallActor || hasActorTools || hasGetActorRun) {
|
|
257
235
|
toolsToInject.push(...AUTO_INJECTED_TOOLS);
|
|
258
236
|
}
|
|
259
237
|
if (toolsToInject.length > 0) {
|
|
@@ -285,4 +263,5 @@ export async function loadToolsFromInput(input, apifyClient, mode = SERVER_MODE.
|
|
|
285
263
|
const actorTools = await getActors(input, apifyClient, { actorStore });
|
|
286
264
|
return getToolsForServerMode(input, actorTools, mode);
|
|
287
265
|
}
|
|
288
|
-
//# sourceMappingURL=tools_loader.js.map
|
|
266
|
+
//# sourceMappingURL=tools_loader.js.map
|
|
267
|
+
//# debugId=f905d977-87c6-52de-8d12-0a86e0447d19
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools_loader.js","
|
|
1
|
+
{"version":3,"file":"tools_loader.js","sources":["../../src/utils/tools_loader.ts"],"sourceRoot":"","names":[],"mappings":"AAAA;;;GAGG;;;AAIH,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAuB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM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AC;QAClC,CAAC;IACL,CAAC;IAED,4EAA4E;IAC5E,2EAA2E;IAC3E,6BAA6B;IAC7B,IAAI,IAAI,KAAK,WAAW,CAAC,IAAI,EAAE,CAAC;QAC5B,KAAK,MAAM,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAsB,CAAC,CAAC;YACrE,8EAA8E;YAC9E,IAAI,MAAM;gBAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;IACL,CAAC;IAED,uCAAuC;IACvC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,0FAA0F;AAC1F,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACpC,KAAY,EACZ,WAAwB,EACxB,OAAoB,WAAW,CAAC,OAAO,EACvC,UAAuB;IAEvB,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IACvE,OAAO,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;AAC1D,CAAC","debugId":"f905d977-87c6-52de-8d12-0a86e0447d19"}
|
package/dist/utils/ttl_lru.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b2cce002-5516-524f-bc58-9b60227b70b2")}catch(e){}}();
|
|
1
3
|
import { LruCache } from '@apify/datastructures';
|
|
2
4
|
/**
|
|
3
5
|
* LRU cache with TTL: entries expire after a set time and are checked (and evicted if expired)
|
|
@@ -61,4 +63,5 @@ export class TTLLRUCache {
|
|
|
61
63
|
return null;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
//# sourceMappingURL=ttl_lru.js.map
|
|
66
|
+
//# sourceMappingURL=ttl_lru.js.map
|
|
67
|
+
//# debugId=b2cce002-5516-524f-bc58-9b60227b70b2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ttl_lru.js","
|
|
1
|
+
{"version":3,"file":"ttl_lru.js","sources":["../../src/utils/ttl_lru.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,WAAW;IAQpB;;;OAGG;IACH,YAAY,SAAiB,EAAE,OAAe;QAX7B;;;;;WAGd;QAEc;;;;;WAAkB;QAO/B,IAAI,CAAC,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ,CAGtB;YACC,SAAS;SACZ,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,GAAW,EAAE,KAAQ;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;YAChB,KAAK;YACL,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS;SACzC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,GAAW;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC,KAAK,CAAC;QACvB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","debugId":"b2cce002-5516-524f-bc58-9b60227b70b2"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8fc91167-d2d6-56b0-88f3-2fd4bfa12a7b")}catch(e){}}();
|
|
1
3
|
import { createHash } from 'node:crypto';
|
|
2
4
|
import log from '@apify/log';
|
|
3
5
|
import { PRICING_TIERS } from './pricing_info.js';
|
|
@@ -57,4 +59,5 @@ export async function getUserInfoCached(token, apifyClient) {
|
|
|
57
59
|
return { ...ANONYMOUS_USER_INFO };
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
|
-
//# sourceMappingURL=userid_cache.js.map
|
|
62
|
+
//# sourceMappingURL=userid_cache.js.map
|
|
63
|
+
//# debugId=8fc91167-d2d6-56b0-88f3-2fd4bfa12a7b
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userid_cache.js","
|
|
1
|
+
{"version":3,"file":"userid_cache.js","sources":["../../src/utils/userid_cache.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,GAAG,MAAM,YAAY,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,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IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAA,EAAE,CAAC;YACZ,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAC;QACtC,CAAC;QACD,+FAA+F;QAC/F,qEAAqE;QACrE,MAAM,QAAQ,GAAG,MAAC,IAAI,CAAC,IAAsC,0CAAE,IAAI,CAAC;QACpE,+EAA+E;QAC/E,wCAAwC;QACxC,MAAM,EAAE,uBAAuB,EAAE,GAAG,IAA4C,CAAC;QACjF,MAAM,IAAI,GAAmB;YACzB,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,YAAY,EAAE,iBAAiB,CAAC,QAAQ,CAAC;YACzC,cAAc,EAAE,OAAO,CAAC,uBAAuB,CAAC;SACnD,CAAC;QACF,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACtC,CAAC;AACL,CAAC","debugId":"8fc91167-d2d6-56b0-88f3-2fd4bfa12a7b"}
|
package/dist/utils/version.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ccde48ce-1bc5-5db8-8e20-fa79db881ec9")}catch(e){}}();
|
|
1
3
|
import { readJsonFile } from './generic.js';
|
|
2
4
|
const packageJson = readJsonFile(import.meta.url, '../../package.json');
|
|
3
5
|
/**
|
|
@@ -7,4 +9,5 @@ const packageJson = readJsonFile(import.meta.url, '../../package.json');
|
|
|
7
9
|
export function getPackageVersion() {
|
|
8
10
|
return packageJson.version || null;
|
|
9
11
|
}
|
|
10
|
-
//# sourceMappingURL=version.js.map
|
|
12
|
+
//# sourceMappingURL=version.js.map
|
|
13
|
+
//# debugId=ccde48ce-1bc5-5db8-8e20-fa79db881ec9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../src/utils/version.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,GAAG,YAAY,CAAuB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;AAE9F;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC7B,OAAO,WAAW,CAAC,OAAO,IAAI,IAAI,CAAC;AACvC,CAAC","debugId":"ccde48ce-1bc5-5db8-8e20-fa79db881ec9"}
|
|
@@ -4548,3 +4548,5 @@ prism-react-renderer/dist/index.mjs:
|
|
|
4548
4548
|
*)
|
|
4549
4549
|
*)
|
|
4550
4550
|
*/
|
|
4551
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8c0a3135-bd32-5a99-8140-e4b0375e415b")}catch(e){}}();
|
|
4552
|
+
//# debugId=8c0a3135-bd32-5a99-8140-e4b0375e415b
|
|
@@ -4646,3 +4646,5 @@ prism-react-renderer/dist/index.mjs:
|
|
|
4646
4646
|
*)
|
|
4647
4647
|
*)
|
|
4648
4648
|
*/
|
|
4649
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="040c0c22-8c9e-58f6-8532-4011388b2a79")}catch(e){}}();
|
|
4650
|
+
//# debugId=040c0c22-8c9e-58f6-8532-4011388b2a79
|
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.
|
|
5
|
+
"version": "0.13.0",
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add_actor.d.ts","sourceRoot":"","sources":["../../../src/tools/actors/add_actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAoB,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAKnF,eAAO,MAAM,iBAAiB;;iBAK5B,CAAC;AACH,eAAO,MAAM,QAAQ,EAAE,SAsDZ,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { ApifyClient } from '../../apify_client.js';
|
|
3
|
-
import { HELPER_TOOLS } from '../../const.js';
|
|
4
|
-
import { TOOL_TYPE } from '../../types.js';
|
|
5
|
-
import { compileSchema } from '../../utils/ajv.js';
|
|
6
|
-
import { respondOk, respondServerError } from '../../utils/mcp.js';
|
|
7
|
-
export const addToolArgsSchema = z.object({
|
|
8
|
-
actor: z
|
|
9
|
-
.string()
|
|
10
|
-
.min(1)
|
|
11
|
-
.describe(`Actor ID or full name in the format "username/name", e.g., "apify/rag-web-browser".`),
|
|
12
|
-
});
|
|
13
|
-
export const addActor = Object.freeze({
|
|
14
|
-
type: TOOL_TYPE.INTERNAL,
|
|
15
|
-
name: HELPER_TOOLS.ACTOR_ADD,
|
|
16
|
-
title: 'Add tool',
|
|
17
|
-
description: `Add an Actor or MCP server to the Apify MCP Server as an available tool.
|
|
18
|
-
This does not execute the Actor; it only registers it so it can be called later.
|
|
19
|
-
|
|
20
|
-
You can first discover Actors using the ${HELPER_TOOLS.STORE_SEARCH} tool, then add the selected Actor as a tool.
|
|
21
|
-
|
|
22
|
-
USAGE:
|
|
23
|
-
- Use when a user has chosen an Actor to work with and you need to make it available as a callable tool.
|
|
24
|
-
|
|
25
|
-
USAGE EXAMPLES:
|
|
26
|
-
- user_input: Add apify/rag-web-browser as a tool
|
|
27
|
-
- user_input: Add apify/instagram-scraper as a tool`,
|
|
28
|
-
inputSchema: z.toJSONSchema(addToolArgsSchema),
|
|
29
|
-
ajvValidate: compileSchema(z.toJSONSchema(addToolArgsSchema)),
|
|
30
|
-
annotations: {
|
|
31
|
-
title: 'Add tool',
|
|
32
|
-
readOnlyHint: false,
|
|
33
|
-
destructiveHint: false,
|
|
34
|
-
idempotentHint: true,
|
|
35
|
-
openWorldHint: true,
|
|
36
|
-
},
|
|
37
|
-
// TODO: I don't like that we are passing apifyMcpServer and mcpServer to the tool
|
|
38
|
-
call: async (toolArgs) => {
|
|
39
|
-
const { apifyMcpServer, apifyToken, args, extra: { sendNotification }, } = toolArgs;
|
|
40
|
-
const parsed = addToolArgsSchema.parse(args);
|
|
41
|
-
if (apifyMcpServer.listAllToolNames().includes(parsed.actor)) {
|
|
42
|
-
return respondOk(`Actor ${parsed.actor} is already available. No new tools were added.`);
|
|
43
|
-
}
|
|
44
|
-
const apifyClient = new ApifyClient({ token: apifyToken });
|
|
45
|
-
const { tools, errors } = await apifyMcpServer.loadActorsAsTools([parsed.actor], apifyClient);
|
|
46
|
-
// First error is the precise reason this Actor could not be added —
|
|
47
|
-
// safe to forward verbatim (sanitized at source by ActorLoadError factories).
|
|
48
|
-
if (errors[0]) {
|
|
49
|
-
return respondServerError(errors[0].message);
|
|
50
|
-
}
|
|
51
|
-
await sendNotification({ method: 'notifications/tools/list_changed' });
|
|
52
|
-
const toolNames = tools.map((t) => t.name).join(', ');
|
|
53
|
-
// Many MCP clients ignore `notifications/tools/list_changed`, so nudge the LLM to
|
|
54
|
-
// re-list tools itself — otherwise the freshly added Actor stays invisible until the
|
|
55
|
-
// client happens to refresh (apify-mcp-server#851).
|
|
56
|
-
return respondOk(`Actor ${parsed.actor} has been added. Newly available tools: ${toolNames}. ` +
|
|
57
|
-
`If they are not visible yet, refresh the tool list using the tools/list request before calling them.`);
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=add_actor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add_actor.js","sourceRoot":"","sources":["../../../src/tools/actors/add_actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,qFAAqF,CAAC;CACvG,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,QAAQ,GAAc,MAAM,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,SAAS,CAAC,QAAQ;IACxB,IAAI,EAAE,YAAY,CAAC,SAAS;IAC5B,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE;;;0CAGyB,YAAY,CAAC,YAAY;;;;;;;oDAOf;IAChD,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAoB;IACjE,WAAW,EAAE,aAAa,CA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