@apify/actors-mcp-server 0.9.21-beta.2 → 0.9.21-beta.4
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 +2 -0
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +2 -0
- package/dist/const.js.map +1 -1
- package/dist/tools/apps/call_actor.d.ts +2 -2
- package/dist/tools/apps/call_actor.d.ts.map +1 -1
- package/dist/tools/apps/call_actor.js +4 -10
- package/dist/tools/apps/call_actor.js.map +1 -1
- package/dist/tools/apps/call_actor_widget.d.ts +3 -0
- package/dist/tools/apps/call_actor_widget.d.ts.map +1 -0
- package/dist/tools/apps/call_actor_widget.js +142 -0
- package/dist/tools/apps/call_actor_widget.js.map +1 -0
- package/dist/tools/apps/get_actor_run_widget.d.ts +3 -0
- package/dist/tools/apps/get_actor_run_widget.d.ts.map +1 -0
- package/dist/tools/apps/get_actor_run_widget.js +69 -0
- package/dist/tools/apps/get_actor_run_widget.js.map +1 -0
- package/dist/tools/categories.d.ts +1 -4
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +5 -2
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/core/call_actor_common.d.ts +3 -1
- package/dist/tools/core/call_actor_common.d.ts.map +1 -1
- package/dist/tools/core/call_actor_common.js +5 -4
- package/dist/tools/core/call_actor_common.js.map +1 -1
- package/dist/tools/core/get_actor_run_common.d.ts +3 -2
- package/dist/tools/core/get_actor_run_common.d.ts.map +1 -1
- package/dist/tools/core/get_actor_run_common.js +9 -13
- package/dist/tools/core/get_actor_run_common.js.map +1 -1
- package/dist/tools/default/call_actor.d.ts.map +1 -1
- package/dist/tools/default/call_actor.js +1 -7
- package/dist/tools/default/call_actor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/server-instructions/index.d.ts +0 -4
- package/dist/utils/server-instructions/index.d.ts.map +1 -1
- package/dist/utils/server-instructions/index.js +7 -9
- package/dist/utils/server-instructions/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/tools/apps/get_actor_run.d.ts +0 -7
- package/dist/tools/apps/get_actor_run.d.ts.map +0 -1
- package/dist/tools/apps/get_actor_run.js +0 -29
- package/dist/tools/apps/get_actor_run.js.map +0 -1
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
* only when the resolved server mode is `'apps'`. Default-mode clients never
|
|
6
6
|
* see widget tool names like `search-actors-widget` or `fetch-actor-details-widget`,
|
|
7
7
|
* avoiding hallucinated calls to tools absent from `tools/list`.
|
|
8
|
-
*
|
|
9
|
-
* Note: the `-widget` suffix split is rolling out per-tool.
|
|
10
|
-
* `fetch-actor-details` and `search-actors` are already split; `call-actor` and
|
|
11
|
-
* `get-actor-run` still render widgets on their base names until their own splits land.
|
|
12
8
|
*/
|
|
13
9
|
import { ServerMode } from '../../types.js';
|
|
14
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,UAA+B,GAAG,MAAM,CA+DnF"}
|
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
* only when the resolved server mode is `'apps'`. Default-mode clients never
|
|
6
6
|
* see widget tool names like `search-actors-widget` or `fetch-actor-details-widget`,
|
|
7
7
|
* avoiding hallucinated calls to tools absent from `tools/list`.
|
|
8
|
-
*
|
|
9
|
-
* Note: the `-widget` suffix split is rolling out per-tool.
|
|
10
|
-
* `fetch-actor-details` and `search-actors` are already split; `call-actor` and
|
|
11
|
-
* `get-actor-run` still render widgets on their base names until their own splits land.
|
|
12
8
|
*/
|
|
13
9
|
import { HelperTools, RAG_WEB_BROWSER } from '../../const.js';
|
|
14
10
|
import { ServerMode } from '../../types.js';
|
|
@@ -49,9 +45,8 @@ ${isApps ? `
|
|
|
49
45
|
## Widget workflow (applies when tool responses include widget metadata)
|
|
50
46
|
Some clients render widget-backed Actor tools: the response includes a live UI that automatically polls run status. When a widget is rendered, follow-up status polling by the model is a forbidden duplicate.
|
|
51
47
|
|
|
52
|
-
- **Never call \`${HelperTools.ACTOR_RUNS_GET}\`
|
|
53
|
-
-
|
|
54
|
-
- The \`-widget\` suffix split is rolling out per-tool (\`${HelperTools.ACTOR_GET_DETAILS_WIDGET}\` and \`${HelperTools.STORE_SEARCH_WIDGET}\` already split); until the rest split, widget rendering happens on the base \`${HelperTools.ACTOR_CALL}\` and \`${HelperTools.ACTOR_RUNS_GET}\` tool names when the client supports it.
|
|
48
|
+
- **Never call \`${HelperTools.ACTOR_RUNS_GET}\` or \`${HelperTools.ACTOR_RUNS_GET_WIDGET}\` after \`${HelperTools.ACTOR_CALL_WIDGET}\` or \`${HelperTools.ACTOR_RUNS_GET_WIDGET}\`.** Both widgets render live progress and poll themselves — stop after the widget response and defer to it for run status. Re-rendering the same run via \`${HelperTools.ACTOR_RUNS_GET_WIDGET}\` is a duplicate.
|
|
49
|
+
- Polling \`${HelperTools.ACTOR_RUNS_GET}\` after \`${HelperTools.ACTOR_CALL}\` (the silent async variant, no widget) is fine — that tool renders no UI, so polling is expected when you need the run status.
|
|
55
50
|
` : ''}
|
|
56
51
|
## Tool dependencies and disambiguation
|
|
57
52
|
|
|
@@ -59,10 +54,11 @@ Some clients render widget-backed Actor tools: the response includes a live UI t
|
|
|
59
54
|
- \`${HelperTools.ACTOR_CALL}\`:
|
|
60
55
|
- Use \`${HelperTools.ACTOR_GET_DETAILS}\` first to obtain the Actor's input schema.
|
|
61
56
|
- Then call with proper input to execute the Actor.
|
|
62
|
-
- For MCP server Actors, use format "actorName:toolName" to call specific tools
|
|
57
|
+
- For MCP server Actors, use format "actorName:toolName" to call specific tools.${isApps ? `
|
|
58
|
+
- In this mode \`${HelperTools.ACTOR_CALL}\` always runs asynchronously — it starts the run and returns immediately with a runId. Use \`${HelperTools.ACTOR_RUNS_GET}\` to check status and \`${HelperTools.ACTOR_OUTPUT_GET}\` to fetch output once the run completes.` : `
|
|
63
59
|
- Supports async execution via the \`async\` parameter:
|
|
64
60
|
- \`async: false\` or unset: waits for completion and returns results immediately.
|
|
65
|
-
- \`async: true\`: starts the run and returns immediately with a runId
|
|
61
|
+
- \`async: true\`: starts the run and returns immediately with a runId.`}
|
|
66
62
|
|
|
67
63
|
### Tool disambiguation
|
|
68
64
|
- **\`${HelperTools.ACTOR_OUTPUT_GET}\` vs \`${HelperTools.DATASET_GET_ITEMS}\`:**
|
|
@@ -72,6 +68,8 @@ Some clients render widget-backed Actor tools: the response includes a live UI t
|
|
|
72
68
|
${isApps ? `- **Data vs widget Actor tools (when the client supports widgets):**
|
|
73
69
|
- \`${HelperTools.STORE_SEARCH}\` is a silent data lookup (Actor list for name resolution) with no UI; \`${HelperTools.STORE_SEARCH_WIDGET}\` renders an interactive UI element (widget) with Actor search results for the user to browse — use it only when the user explicitly asks to search or discover Actors.
|
|
74
70
|
- \`${HelperTools.ACTOR_GET_DETAILS}\` is a silent data lookup (input schema, README, metadata) with no UI; \`${HelperTools.ACTOR_GET_DETAILS_WIDGET}\` renders an interactive UI element (widget) with Actor details — use it only when the user explicitly asks to see or browse the Actor.
|
|
71
|
+
- \`${HelperTools.ACTOR_CALL}\` is a silent async start (returns runId, no UI); \`${HelperTools.ACTOR_CALL_WIDGET}\` renders an interactive UI element (widget) that tracks live Actor run progress — use it only when the user explicitly asks to see progress.
|
|
72
|
+
- \`${HelperTools.ACTOR_RUNS_GET}\` is a silent data lookup (run status, dataset IDs, stats) with no UI; \`${HelperTools.ACTOR_RUNS_GET_WIDGET}\` renders an interactive UI element (widget) showing live run progress for the user — use it only when the user explicitly asks to see run progress.
|
|
75
73
|
- When the next step is running an Actor, prefer silent lookups (\`${HelperTools.STORE_SEARCH}\`, \`${HelperTools.ACTOR_GET_DETAILS}\`) over widget-backed variants.
|
|
76
74
|
` : ''}- **\`${HelperTools.STORE_SEARCH}\` vs ${RAG_WEB_BROWSER}:**
|
|
77
75
|
\`${HelperTools.STORE_SEARCH}\` finds robust and reliable Actors for specific websites; ${RAG_WEB_BROWSER} is a general and versatile web scraping tool.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAmB,UAAU,CAAC,OAAO;IACvE,MAAM,MAAM,GAAG,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC;IAExC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;EAyBT,MAAM,CAAC,CAAC,CAAC;;;;mBAIQ,WAAW,CAAC,cAAc,WAAW,WAAW,CAAC,qBAAqB,cAAc,WAAW,CAAC,iBAAiB,WAAW,WAAW,CAAC,qBAAqB,gKAAgK,WAAW,CAAC,qBAAqB;cACnW,WAAW,CAAC,cAAc,cAAc,WAAW,CAAC,UAAU;CAC3E,CAAC,CAAC,CAAC,EAAE;;;;MAIA,WAAW,CAAC,UAAU;YAChB,WAAW,CAAC,iBAAiB;;oFAE2C,MAAM,CAAC,CAAC,CAAC;qBACxE,WAAW,CAAC,UAAU,iGAAiG,WAAW,CAAC,cAAc,4BAA4B,WAAW,CAAC,gBAAgB,4CAA4C,CAAC,CAAC,CAAC;;;4EAGjM;;;QAGpE,WAAW,CAAC,gBAAgB,WAAW,WAAW,CAAC,iBAAiB;UAClE,WAAW,CAAC,gBAAgB,kCAAkC,WAAW,CAAC,iBAAiB;QAC7F,WAAW,CAAC,YAAY,WAAW,WAAW,CAAC,iBAAiB;MAClE,WAAW,CAAC,YAAY,sBAAsB,WAAW,CAAC,iBAAiB;EAC/E,MAAM,CAAC,CAAC,CAAC;QACH,WAAW,CAAC,YAAY,6EAA6E,WAAW,CAAC,mBAAmB;QACpI,WAAW,CAAC,iBAAiB,6EAA6E,WAAW,CAAC,wBAAwB;QAC9I,WAAW,CAAC,UAAU,wDAAwD,WAAW,CAAC,iBAAiB;QAC3G,WAAW,CAAC,cAAc,6EAA6E,WAAW,CAAC,qBAAqB;uEACzE,WAAW,CAAC,YAAY,SAAS,WAAW,CAAC,iBAAiB;CACpI,CAAC,CAAC,CAAC,EAAE,SAAS,WAAW,CAAC,YAAY,SAAS,eAAe;MACzD,WAAW,CAAC,YAAY,8DAA8D,eAAe;kCACzE,eAAe,UAAU,WAAW,CAAC,UAAU;iDAChC,WAAW,CAAC,UAAU;CACtE,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ToolEntry } from '../../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Apps mode get-actor-run tool.
|
|
4
|
-
* Returns abbreviated text with widget metadata for interactive progress display.
|
|
5
|
-
*/
|
|
6
|
-
export declare const appsGetActorRun: ToolEntry;
|
|
7
|
-
//# sourceMappingURL=get_actor_run.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_actor_run.d.ts","sourceRoot":"","sources":["../../../src/tools/apps/get_actor_run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAUlE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAuBnB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { logHttpError } from '../../utils/logging.js';
|
|
2
|
-
import { buildGetActorRunError, buildGetActorRunSuccessResponse, fetchActorRunData, getActorRunArgs, getActorRunMetadata, } from '../core/get_actor_run_common.js';
|
|
3
|
-
/**
|
|
4
|
-
* Apps mode get-actor-run tool.
|
|
5
|
-
* Returns abbreviated text with widget metadata for interactive progress display.
|
|
6
|
-
*/
|
|
7
|
-
export const appsGetActorRun = Object.freeze({
|
|
8
|
-
...getActorRunMetadata,
|
|
9
|
-
call: async (toolArgs) => {
|
|
10
|
-
const { args, apifyClient: client, mcpSessionId } = toolArgs;
|
|
11
|
-
const parsed = getActorRunArgs.parse(args);
|
|
12
|
-
try {
|
|
13
|
-
const fetchResult = await fetchActorRunData({
|
|
14
|
-
runId: parsed.runId,
|
|
15
|
-
client,
|
|
16
|
-
mcpSessionId,
|
|
17
|
-
});
|
|
18
|
-
if ('error' in fetchResult) {
|
|
19
|
-
return fetchResult.error;
|
|
20
|
-
}
|
|
21
|
-
return buildGetActorRunSuccessResponse({ ...fetchResult.result, widget: true });
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
logHttpError(error, 'Failed to get Actor run', { runId: parsed.runId });
|
|
25
|
-
return buildGetActorRunError(parsed.runId, error);
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=get_actor_run.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_actor_run.js","sourceRoot":"","sources":["../../../src/tools/apps/get_actor_run.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACH,qBAAqB,EACrB,+BAA+B,EAC/B,iBAAiB,EACjB,eAAe,EACf,mBAAmB,GACtB,MAAM,iCAAiC,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAc,MAAM,CAAC,MAAM,CAAC;IACpD,GAAG,mBAAmB;IACtB,IAAI,EAAE,KAAK,EAAE,QAA0B,EAAE,EAAE;QACvC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;QAC7D,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,CAAC;YACD,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC;gBACxC,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM;gBACN,YAAY;aACf,CAAC,CAAC;YAEH,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;gBACzB,OAAO,WAAW,CAAC,KAAK,CAAC;YAC7B,CAAC;YAED,OAAO,+BAA+B,CAAC,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACpF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,YAAY,CAAC,KAAK,EAAE,yBAAyB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACxE,OAAO,qBAAqB,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;CACK,CAAC,CAAC"}
|