@apify/actors-mcp-server 0.9.21-beta.0 → 0.9.21-beta.2

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.
Files changed (63) hide show
  1. package/dist/const.d.ts +2 -2
  2. package/dist/const.d.ts.map +1 -1
  3. package/dist/const.js +2 -2
  4. package/dist/const.js.map +1 -1
  5. package/dist/tools/apps/call_actor.d.ts.map +1 -1
  6. package/dist/tools/apps/call_actor.js +2 -5
  7. package/dist/tools/apps/call_actor.js.map +1 -1
  8. package/dist/tools/apps/fetch_actor_details_widget.d.ts +3 -0
  9. package/dist/tools/apps/fetch_actor_details_widget.d.ts.map +1 -0
  10. package/dist/tools/apps/fetch_actor_details_widget.js +91 -0
  11. package/dist/tools/apps/fetch_actor_details_widget.js.map +1 -0
  12. package/dist/tools/apps/search_actors_widget.d.ts +3 -0
  13. package/dist/tools/apps/search_actors_widget.d.ts.map +1 -0
  14. package/dist/tools/apps/search_actors_widget.js +113 -0
  15. package/dist/tools/apps/search_actors_widget.js.map +1 -0
  16. package/dist/tools/categories.d.ts +2 -2
  17. package/dist/tools/categories.d.ts.map +1 -1
  18. package/dist/tools/categories.js +6 -8
  19. package/dist/tools/categories.js.map +1 -1
  20. package/dist/tools/core/call_actor_common.d.ts +2 -5
  21. package/dist/tools/core/call_actor_common.d.ts.map +1 -1
  22. package/dist/tools/core/call_actor_common.js +7 -12
  23. package/dist/tools/core/call_actor_common.js.map +1 -1
  24. package/dist/tools/core/fetch_actor_details_common.d.ts +9 -7
  25. package/dist/tools/core/fetch_actor_details_common.d.ts.map +1 -1
  26. package/dist/tools/core/fetch_actor_details_common.js +10 -13
  27. package/dist/tools/core/fetch_actor_details_common.js.map +1 -1
  28. package/dist/tools/core/search_actors_common.d.ts +5 -4
  29. package/dist/tools/core/search_actors_common.d.ts.map +1 -1
  30. package/dist/tools/core/search_actors_common.js +5 -9
  31. package/dist/tools/core/search_actors_common.js.map +1 -1
  32. package/dist/tools/default/call_actor.d.ts.map +1 -1
  33. package/dist/tools/default/call_actor.js +0 -3
  34. package/dist/tools/default/call_actor.js.map +1 -1
  35. package/dist/tools/default/fetch_actor_details.d.ts.map +1 -1
  36. package/dist/tools/default/fetch_actor_details.js +1 -2
  37. package/dist/tools/default/fetch_actor_details.js.map +1 -1
  38. package/dist/tools/structured_output_schemas.d.ts +214 -4
  39. package/dist/tools/structured_output_schemas.d.ts.map +1 -1
  40. package/dist/tools/structured_output_schemas.js +36 -15
  41. package/dist/tools/structured_output_schemas.js.map +1 -1
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/dist/utils/server-instructions/index.d.ts +4 -5
  44. package/dist/utils/server-instructions/index.d.ts.map +1 -1
  45. package/dist/utils/server-instructions/index.js +9 -7
  46. package/dist/utils/server-instructions/index.js.map +1 -1
  47. package/package.json +1 -1
  48. package/dist/tools/apps/fetch_actor_details.d.ts +0 -7
  49. package/dist/tools/apps/fetch_actor_details.d.ts.map +0 -1
  50. package/dist/tools/apps/fetch_actor_details.js +0 -55
  51. package/dist/tools/apps/fetch_actor_details.js.map +0 -1
  52. package/dist/tools/apps/fetch_actor_details_internal.d.ts +0 -3
  53. package/dist/tools/apps/fetch_actor_details_internal.d.ts.map +0 -1
  54. package/dist/tools/apps/fetch_actor_details_internal.js +0 -36
  55. package/dist/tools/apps/fetch_actor_details_internal.js.map +0 -1
  56. package/dist/tools/apps/search_actors.d.ts +0 -7
  57. package/dist/tools/apps/search_actors.d.ts.map +0 -1
  58. package/dist/tools/apps/search_actors.js +0 -89
  59. package/dist/tools/apps/search_actors.js.map +0 -1
  60. package/dist/tools/apps/search_actors_internal.d.ts +0 -3
  61. package/dist/tools/apps/search_actors_internal.d.ts.map +0 -1
  62. package/dist/tools/apps/search_actors_internal.js +0 -65
  63. package/dist/tools/apps/search_actors_internal.js.map +0 -1
@@ -3,13 +3,12 @@
3
3
  *
4
4
  * Apps-only sections (widget workflow, widget tool disambiguation) are included
5
5
  * only when the resolved server mode is `'apps'`. Default-mode clients never
6
- * see tool names like `search-actors-internal` or `fetch-actor-details-internal`,
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
8
  *
9
- * Note: the `-widget` suffix split (separating widget-backed tools from silent
10
- * variants by name) is planned in follow-up PRs. Until then, widget rendering
11
- * happens on the base tool names (`call-actor`, `search-actors`,
12
- * `fetch-actor-details`) in apps mode.
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.
13
12
  */
14
13
  import { ServerMode } from '../../types.js';
15
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,UAA+B,GAAG,MAAM,CA0DnF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,UAA+B,GAAG,MAAM,CA6DnF"}
@@ -3,13 +3,12 @@
3
3
  *
4
4
  * Apps-only sections (widget workflow, widget tool disambiguation) are included
5
5
  * only when the resolved server mode is `'apps'`. Default-mode clients never
6
- * see tool names like `search-actors-internal` or `fetch-actor-details-internal`,
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
8
  *
9
- * Note: the `-widget` suffix split (separating widget-backed tools from silent
10
- * variants by name) is planned in follow-up PRs. Until then, widget rendering
11
- * happens on the base tool names (`call-actor`, `search-actors`,
12
- * `fetch-actor-details`) in apps mode.
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.
13
12
  */
14
13
  import { HelperTools, RAG_WEB_BROWSER } from '../../const.js';
15
14
  import { ServerMode } from '../../types.js';
@@ -52,7 +51,7 @@ Some clients render widget-backed Actor tools: the response includes a live UI t
52
51
 
53
52
  - **Never call \`${HelperTools.ACTOR_RUNS_GET}\` after a widget-backed \`${HelperTools.ACTOR_CALL}\` response.** The widget renders live progress and polls itself — stop after the widget response and defer to it for run status.
54
53
  - When \`${HelperTools.ACTOR_CALL}\` runs without a widget (the tool response is plain text / structured data only), polling \`${HelperTools.ACTOR_RUNS_GET}\` for status is expected.
55
- - Follow-up PRs will split widget-backed tools into a dedicated \`-widget\`-suffixed namespace; until then, widget rendering happens on the base tool names when the client supports it.
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.
56
55
  ` : ''}
57
56
  ## Tool dependencies and disambiguation
58
57
 
@@ -70,7 +69,10 @@ Some clients render widget-backed Actor tools: the response includes a live UI t
70
69
  Use \`${HelperTools.ACTOR_OUTPUT_GET}\` for Actor run outputs and \`${HelperTools.DATASET_GET_ITEMS}\` for direct dataset access.
71
70
  - **\`${HelperTools.STORE_SEARCH}\` vs \`${HelperTools.ACTOR_GET_DETAILS}\`:**
72
71
  \`${HelperTools.STORE_SEARCH}\` finds Actors; \`${HelperTools.ACTOR_GET_DETAILS}\` retrieves detailed info, README, and schema for a specific Actor.
73
- ${isApps ? `- **Widget-backed variants (when the client supports them):** Some \`${HelperTools.STORE_SEARCH}\` / \`${HelperTools.ACTOR_GET_DETAILS}\` responses render an interactive widget for the user. Prefer the widget-backed variant when the user explicitly asks to *see*, *browse*, or *view* something; when the next step is to actually run an Actor or perform a programmatic flow, prefer a silent lookup if such a variant is available (for example, \`${HelperTools.STORE_SEARCH_INTERNAL}\` or \`${HelperTools.ACTOR_GET_DETAILS_INTERNAL}\`), otherwise use the standard lookup tools. A \`-widget\` suffix split is planned in a follow-up PR; until then, widget rendering is selected by the server based on client capabilities.
72
+ ${isApps ? `- **Data vs widget Actor tools (when the client supports widgets):**
73
+ - \`${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
+ - \`${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.
75
+ - When the next step is running an Actor, prefer silent lookups (\`${HelperTools.STORE_SEARCH}\`, \`${HelperTools.ACTOR_GET_DETAILS}\`) over widget-backed variants.
74
76
  ` : ''}- **\`${HelperTools.STORE_SEARCH}\` vs ${RAG_WEB_BROWSER}:**
75
77
  \`${HelperTools.STORE_SEARCH}\` finds robust and reliable Actors for specific websites; ${RAG_WEB_BROWSER} is a general and versatile web scraping tool.
76
78
  - **Dedicated Actor tools (e.g. ${RAG_WEB_BROWSER}) vs \`${HelperTools.ACTOR_CALL}\`:**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/server-instructions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;GAKG;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,MAAM,MAAM,GAAG,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC;IAExC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;EAyBT,MAAM,CAAC,CAAC,CAAC;;;;mBAIQ,WAAW,CAAC,cAAc,8BAA8B,WAAW,CAAC,UAAU;WACtF,WAAW,CAAC,UAAU,gGAAgG,WAAW,CAAC,cAAc;4DAC/F,WAAW,CAAC,wBAAwB,YAAY,WAAW,CAAC,mBAAmB,mFAAmF,WAAW,CAAC,UAAU,YAAY,WAAW,CAAC,cAAc;CACzR,CAAC,CAAC,CAAC,EAAE;;;;MAIA,WAAW,CAAC,UAAU;YAChB,WAAW,CAAC,iBAAiB;;;;;;;;QAQjC,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;uEAC/E,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/actors-mcp-server",
3
- "version": "0.9.21-beta.0",
3
+ "version": "0.9.21-beta.2",
4
4
  "type": "module",
5
5
  "description": "Apify MCP Server",
6
6
  "mcpName": "com.apify/apify-mcp-server",
@@ -1,7 +0,0 @@
1
- import type { ToolEntry } from '../../types.js';
2
- /**
3
- * Apps mode fetch-actor-details tool.
4
- * Returns simplified structured content with interactive widget metadata.
5
- */
6
- export declare const appsFetchActorDetails: ToolEntry;
7
- //# sourceMappingURL=fetch_actor_details.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch_actor_details.d.ts","sourceRoot":"","sources":["../../../src/tools/apps/fetch_actor_details.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAgBlE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SA6CzB,CAAC"}
@@ -1,55 +0,0 @@
1
- import dedent from 'dedent';
2
- import { ApifyClient } from '../../apify_client.js';
3
- import { getWidgetConfig, WIDGET_URIS } from '../../resources/widgets.js';
4
- import { buildActorDetailsForWidget, buildCardOptions, fetchActorDetails, } from '../../utils/actor_details.js';
5
- import { buildMCPResponse } from '../../utils/mcp.js';
6
- import { getUserInfoCached } from '../../utils/userid_cache.js';
7
- import { fixActorNameInputAndLog } from '../core/actor_tools_factory.js';
8
- import { buildActorNotFoundResponse, fetchActorDetailsMetadata, fetchActorDetailsToolArgsSchema, resolveOutputOptions, } from '../core/fetch_actor_details_common.js';
9
- /**
10
- * Apps mode fetch-actor-details tool.
11
- * Returns simplified structured content with interactive widget metadata.
12
- */
13
- export const appsFetchActorDetails = Object.freeze({
14
- ...fetchActorDetailsMetadata,
15
- call: async (toolArgs) => {
16
- const { args, apifyToken, mcpSessionId } = toolArgs;
17
- const parsed = fetchActorDetailsToolArgsSchema.parse(args);
18
- const actorName = fixActorNameInputAndLog(parsed.actor, { mcpSessionId, route: 'fetch-actor-details' });
19
- const apifyClient = new ApifyClient({ token: apifyToken });
20
- const { userPlanTier } = await getUserInfoCached(apifyToken, apifyClient);
21
- const cardOptions = { ...buildCardOptions(resolveOutputOptions(parsed.output)), userTier: userPlanTier };
22
- const details = await fetchActorDetails(apifyClient, actorName, cardOptions);
23
- if (!details) {
24
- return buildActorNotFoundResponse(actorName);
25
- }
26
- const { actorUrl, actorDetails } = buildActorDetailsForWidget(details, userPlanTier);
27
- // Pricing is already carried by `actorDetails.actorInfo.currentPricingInfo` (widget-facing,
28
- // tier-aware simplified). Omit the complete-mode `pricing` field from the top-level
29
- // `actorInfo` to avoid two conflicting pricing shapes in the same response.
30
- const { pricing: _pricing, ...actorInfoWithoutPricing } = details.actorCardStructured;
31
- const structuredContent = {
32
- actorInfo: actorInfoWithoutPricing,
33
- inputSchema: details.inputSchema,
34
- actorDetails,
35
- };
36
- const texts = [dedent `
37
- # Actor information:
38
- - **Actor:** ${actorName}
39
- - **URL:** ${actorUrl}
40
-
41
- An interactive widget has been rendered with detailed Actor information.
42
- `];
43
- const widgetConfig = getWidgetConfig(WIDGET_URIS.SEARCH_ACTORS);
44
- return buildMCPResponse({
45
- texts,
46
- structuredContent,
47
- // Response-level meta; only returned in apps mode (this handler is apps-only)
48
- _meta: {
49
- ...widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.meta,
50
- 'openai/widgetDescription': `Actor details for ${actorName} from Apify Store`,
51
- },
52
- });
53
- },
54
- });
55
- //# sourceMappingURL=fetch_actor_details.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch_actor_details.js","sourceRoot":"","sources":["../../../src/tools/apps/fetch_actor_details.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EACH,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM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AAmB,CAAC;QACtF,MAAM,iBAAiB,GAAG;YACtB,SAAS,EAAE,uBAAuB;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,YAAY;SACf,CAAC;QAEF,MAAM,KAAK,GAAG,CAAC,MAAM,CAAA;;2BAEF,SAAS;yBACX,QAAQ;;;SAGxB,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,eAAe,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAChE,OAAO,gBAAgB,CAAC;YACpB,KAAK;YACL,iBAAiB;YACjB,8EAA8E;YAC9E,KAAK,EAAE;gBACH,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI;gBACrB,0BAA0B,EAAE,qBAAqB,SAAS,mBAAmB;aAChF;SACJ,CAAC,CAAC;IACP,CAAC;CACK,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ToolEntry } from '../../types.js';
2
- export declare const fetchActorDetailsInternalTool: ToolEntry;
3
- //# sourceMappingURL=fetch_actor_details_internal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch_actor_details_internal.d.ts","sourceRoot":"","sources":["../../../src/tools/apps/fetch_actor_details_internal.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAQjE,eAAO,MAAM,6BAA6B,EAAE,SA4BjC,CAAC"}
@@ -1,36 +0,0 @@
1
- import dedent from 'dedent';
2
- import { z } from 'zod';
3
- import { HelperTools } from '../../const.js';
4
- import { compileSchema } from '../../utils/ajv.js';
5
- import { buildFetchActorDetailsResult, fetchActorDetailsToolArgsSchema, } from '../core/fetch_actor_details_common.js';
6
- import { actorDetailsOutputSchema } from '../structured_output_schemas.js';
7
- export const fetchActorDetailsInternalTool = Object.freeze({
8
- type: 'internal',
9
- name: HelperTools.ACTOR_GET_DETAILS_INTERNAL,
10
- description: dedent `
11
- Fetch Actor details with flexible output options (apps mode internal tool).
12
-
13
- This tool is available because the LLM is operating in apps mode. Use it for internal lookups
14
- where data presentation to the user is NOT needed - this tool does NOT render a widget.
15
-
16
- Use 'output' parameter with boolean flags to control returned information:
17
- - Default: Fields: description, stats, pricing, rating, metadata, inputSchema, readme - except mcpTools
18
- - Selective: Set desired fields to true to save tokens (e.g., output: { inputSchema: true, readme: false })
19
- - Common patterns: inputSchema only for execution prep, readme + inputSchema for documentation, etc.
20
-
21
- Use this instead of fetch-actor-details when you need Actor information to prepare execution
22
- but the user did NOT explicitly ask for Actor details presentation.
23
- `,
24
- inputSchema: z.toJSONSchema(fetchActorDetailsToolArgsSchema),
25
- outputSchema: actorDetailsOutputSchema,
26
- ajvValidate: compileSchema(z.toJSONSchema(fetchActorDetailsToolArgsSchema)),
27
- annotations: {
28
- title: 'Fetch Actor details internal',
29
- readOnlyHint: true,
30
- destructiveHint: false,
31
- idempotentHint: true,
32
- openWorldHint: false,
33
- },
34
- call: async (toolArgs) => buildFetchActorDetailsResult(toolArgs, HelperTools.ACTOR_GET_DETAILS_INTERNAL),
35
- });
36
- //# sourceMappingURL=fetch_actor_details_internal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch_actor_details_internal.js","sourceRoot":"","sources":["../../../src/tools/apps/fetch_actor_details_internal.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACH,4BAA4B,EAC5B,+BAA+B,GAClC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,CAAC,MAAM,6BAA6B,GAAc,MAAM,CAAC,MAAM,CAAC;IAClE,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,WAAW,CAAC,0BAA0B;IAC5C,WAAW,EAAE,MAAM,CAAA;;;;;;;;;;;;;KAalB;IACD,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,+BAA+B,CAAoB;IAC/E,YAAY,EAAE,wBAAwB;IACtC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC;IAC3E,WAAW,EAAE;QACT,KAAK,EAAE,8BAA8B;QACrC,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,KAAK;KACvB;IACD,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,4BAA4B,CAAC,QAAQ,EAAE,WAAW,CAAC,0BAA0B,CAAC;CAClG,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { ToolEntry } from '../../types.js';
2
- /**
3
- * Apps mode search-actors tool.
4
- * Returns widget-formatted actors with interactive widget metadata.
5
- */
6
- export declare const appsSearchActors: ToolEntry;
7
- //# sourceMappingURL=search_actors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search_actors.d.ts","sourceRoot":"","sources":["../../../src/tools/apps/search_actors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAOlE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAsFpB,CAAC"}
@@ -1,89 +0,0 @@
1
- import dedent from 'dedent';
2
- import { HelperTools } from '../../const.js';
3
- import { getWidgetConfig, WIDGET_URIS } from '../../resources/widgets.js';
4
- import { formatActorForWidget } from '../../utils/actor_card.js';
5
- import { searchAndFilterActors } from '../../utils/actor_search.js';
6
- import { buildMCPResponse } from '../../utils/mcp.js';
7
- import { getUserInfoCached } from '../../utils/userid_cache.js';
8
- import { buildSearchActorsEmptyResponse, buildSearchActorsResult, searchActorsArgsSchema, searchActorsMetadata } from '../core/search_actors_common.js';
9
- /**
10
- * Apps mode search-actors tool.
11
- * Returns widget-formatted actors with interactive widget metadata.
12
- */
13
- export const appsSearchActors = Object.freeze({
14
- ...searchActorsMetadata,
15
- call: async (toolArgs) => {
16
- const { args, apifyToken, apifyClient, userRentedActorIds, apifyMcpServer } = toolArgs;
17
- const parsed = searchActorsArgsSchema.parse(args);
18
- // Actor search and user-info fetch are independent; run in parallel to avoid a
19
- // sequential round-trip on cache miss.
20
- const [actors, { userPlanTier }] = await Promise.all([
21
- searchAndFilterActors({
22
- keywords: parsed.keywords,
23
- apifyToken,
24
- limit: parsed.limit,
25
- offset: parsed.offset,
26
- paymentProvider: apifyMcpServer.options.paymentProvider,
27
- userRentedActorIds,
28
- }),
29
- getUserInfoCached(apifyToken, apifyClient),
30
- ]);
31
- if (actors.length === 0) {
32
- return buildSearchActorsEmptyResponse(parsed.keywords);
33
- }
34
- const { actorCardText, actorCardStructured } = buildSearchActorsResult(actors, userPlanTier);
35
- const structuredContent = {
36
- actors: actorCardStructured,
37
- query: parsed.keywords,
38
- count: actors.length,
39
- instructions: dedent `
40
- Choosing the right details tool: Use ${HelperTools.ACTOR_GET_DETAILS} when the user
41
- wants to browse or explore Actors (e.g., "show me", "find me").
42
- Use ${HelperTools.ACTOR_GET_DETAILS_INTERNAL} when the user wants to execute a task and
43
- you need the input schema (e.g., "scrape", "extract").
44
- IMPORTANT: You MUST always do a second search with broader, more generic keywords
45
- (e.g., just the platform name like "TikTok" instead of "TikTok posts") to make sure
46
- you haven't missed a better Actor.
47
- `,
48
- };
49
- // Add widget-formatted actors for the interactive UI
50
- structuredContent.widgetActors = actors.map((actor) => formatActorForWidget(actor, userPlanTier));
51
- const texts = [dedent `
52
- # Search results:
53
- - **Search query:** ${parsed.keywords}
54
- - **Number of Actors found:** ${actors.length}
55
-
56
- An interactive widget has been rendered with the search results. The user can already see
57
- the list of Actors visually in the widget, so do NOT print or summarize the Actor list
58
- in your response.
59
-
60
- # Actors:
61
-
62
- ${actorCardText}
63
-
64
- ## Choosing the right details tool:
65
- - Use ${HelperTools.ACTOR_GET_DETAILS} when the user wants to **browse or explore**
66
- Actors (e.g., "show me Google Maps scrapers", "find me a TikTok scraper", "what Actors
67
- exist for LinkedIn"). This renders an interactive widget for the user.
68
- - Use ${HelperTools.ACTOR_GET_DETAILS_INTERNAL} when the user wants to **execute a task**
69
- and you need the Actor's input schema to prepare the run (e.g., "scrape Google Maps for
70
- restaurants", "extract emails from this website"). This is a silent lookup — no widget
71
- is rendered.
72
-
73
- IMPORTANT: You MUST always do a second search with broader, more generic keywords
74
- (e.g., just the platform name like "TikTok" instead of "TikTok posts") to make sure
75
- you haven't missed a better Actor.
76
- `];
77
- const widgetConfig = getWidgetConfig(WIDGET_URIS.SEARCH_ACTORS);
78
- return buildMCPResponse({
79
- texts,
80
- structuredContent,
81
- // Response-level meta; only returned in apps mode (this handler is apps-only)
82
- _meta: {
83
- ...widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.meta,
84
- 'openai/widgetDescription': `Interactive actor search results showing ${actors.length} actors from Apify Store`,
85
- },
86
- });
87
- },
88
- });
89
- //# sourceMappingURL=search_actors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search_actors.js","sourceRoot":"","sources":["../../../src/tools/apps/search_actors.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,C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,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;QAElG,MAAM,KAAK,GAAG,CAAC,MAAM,CAAA;;kCAEK,MAAM,CAAC,QAAQ;4CACL,MAAM,CAAC,MAAM;;;;;;;;cAQ3C,aAAa;;;oBAGP,WAAW,CAAC,iBAAiB;;;oBAG7B,WAAW,CAAC,0BAA0B;;;;;;;;SAQjD,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,eAAe,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAChE,OAAO,gBAAgB,CAAC;YACpB,KAAK;YACL,iBAAiB;YACjB,8EAA8E;YAC9E,KAAK,EAAE;gBACH,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI;gBACrB,0BAA0B,EAAE,4CAA4C,MAAM,CAAC,MAAM,0BAA0B;aAClH;SACJ,CAAC,CAAC;IACP,CAAC;CACK,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ToolEntry } from '../../types.js';
2
- export declare const searchActorsInternalTool: ToolEntry;
3
- //# sourceMappingURL=search_actors_internal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search_actors_internal.d.ts","sourceRoot":"","sources":["../../../src/tools/apps/search_actors_internal.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AASnF,eAAO,MAAM,wBAAwB,EAAE,SAwDrC,CAAC"}
@@ -1,65 +0,0 @@
1
- import dedent from 'dedent';
2
- import { z } from 'zod';
3
- import { HelperTools } from '../../const.js';
4
- import { searchAndFilterActors } from '../../utils/actor_search.js';
5
- import { compileSchema } from '../../utils/ajv.js';
6
- import { buildMCPResponse } from '../../utils/mcp.js';
7
- import { searchActorsBaseArgsSchema } from '../core/search_actors_common.js';
8
- import { actorSearchInternalOutputSchema } from '../structured_output_schemas.js';
9
- const searchActorsInternalInputSchema = z.toJSONSchema(searchActorsBaseArgsSchema);
10
- export const searchActorsInternalTool = Object.freeze({
11
- type: 'internal',
12
- name: HelperTools.STORE_SEARCH_INTERNAL,
13
- description: dedent `
14
- Search Actors internally (apps mode internal tool).
15
-
16
- This tool is available because the LLM is operating in apps mode. Use it for internal lookups
17
- where data presentation to the user is NOT needed - this tool does NOT render a widget.
18
-
19
- Use this instead of ${HelperTools.STORE_SEARCH} when you need to find an Actor but the user
20
- did NOT explicitly ask to search Actors. For example, when user says "scrape me google maps"
21
- and you need to find the right Actor for the task, then fetch its schema and call it.
22
-
23
- Returns only minimal fields (fullName, title, description) needed for subsequent calls.
24
- `,
25
- inputSchema: searchActorsInternalInputSchema,
26
- outputSchema: actorSearchInternalOutputSchema,
27
- ajvValidate: compileSchema(searchActorsInternalInputSchema),
28
- annotations: {
29
- title: 'Search Actors (internal)',
30
- readOnlyHint: true,
31
- destructiveHint: false,
32
- idempotentHint: true,
33
- openWorldHint: false,
34
- },
35
- call: async (toolArgs) => {
36
- const { args, apifyToken, userRentedActorIds, apifyMcpServer } = toolArgs;
37
- const parsed = searchActorsBaseArgsSchema.parse(args);
38
- const actors = await searchAndFilterActors({
39
- keywords: parsed.keywords,
40
- apifyToken,
41
- limit: parsed.limit,
42
- offset: parsed.offset,
43
- paymentProvider: apifyMcpServer.options.paymentProvider,
44
- userRentedActorIds,
45
- });
46
- const minimalActors = actors.map((actor) => ({
47
- fullName: `${actor.username}/${actor.name}`,
48
- title: actor.title || actor.name,
49
- description: actor.description || '',
50
- }));
51
- return buildMCPResponse({
52
- texts: [
53
- `Found ${minimalActors.length} Actors for "${parsed.keywords}".`,
54
- `Query: ${parsed.keywords}`,
55
- `Actors:\n\`\`\`json\n${JSON.stringify(minimalActors)}\n\`\`\``,
56
- ],
57
- structuredContent: {
58
- actors: minimalActors,
59
- query: parsed.keywords,
60
- count: minimalActors.length,
61
- },
62
- });
63
- },
64
- });
65
- //# sourceMappingURL=search_actors_internal.js.map
@@ -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