@apify/actors-mcp-server 0.10.5-beta.0 → 0.10.5-beta.10

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 (107) hide show
  1. package/dist/apify_client.d.ts.map +1 -1
  2. package/dist/apify_client.js +16 -1
  3. package/dist/apify_client.js.map +1 -1
  4. package/dist/const.d.ts +1 -1
  5. package/dist/const.d.ts.map +1 -1
  6. package/dist/const.js +1 -3
  7. package/dist/const.js.map +1 -1
  8. package/dist/dev_server.d.ts.map +1 -1
  9. package/dist/dev_server.js +24 -5
  10. package/dist/dev_server.js.map +1 -1
  11. package/dist/mcp/server.d.ts +3 -2
  12. package/dist/mcp/server.d.ts.map +1 -1
  13. package/dist/mcp/server.js +96 -51
  14. package/dist/mcp/server.js.map +1 -1
  15. package/dist/mcp/utils.d.ts +1 -1
  16. package/dist/mcp/utils.js +1 -1
  17. package/dist/tools/actor_executor.d.ts +10 -0
  18. package/dist/tools/actor_executor.d.ts.map +1 -0
  19. package/dist/tools/actor_executor.js +79 -0
  20. package/dist/tools/actor_executor.js.map +1 -0
  21. package/dist/tools/apps/call_actor.d.ts +0 -1
  22. package/dist/tools/apps/call_actor.d.ts.map +1 -1
  23. package/dist/tools/apps/call_actor.js +8 -54
  24. package/dist/tools/apps/call_actor.js.map +1 -1
  25. package/dist/tools/apps/call_actor_widget.d.ts.map +1 -1
  26. package/dist/tools/apps/call_actor_widget.js +8 -32
  27. package/dist/tools/apps/call_actor_widget.js.map +1 -1
  28. package/dist/tools/apps/get_actor_run_widget.d.ts.map +1 -1
  29. package/dist/tools/apps/get_actor_run_widget.js +15 -9
  30. package/dist/tools/apps/get_actor_run_widget.js.map +1 -1
  31. package/dist/tools/categories.d.ts +6 -0
  32. package/dist/tools/categories.d.ts.map +1 -1
  33. package/dist/tools/categories.js +7 -1
  34. package/dist/tools/categories.js.map +1 -1
  35. package/dist/tools/core/actor_run_response.d.ts +127 -0
  36. package/dist/tools/core/actor_run_response.d.ts.map +1 -0
  37. package/dist/tools/core/actor_run_response.js +551 -0
  38. package/dist/tools/core/actor_run_response.js.map +1 -0
  39. package/dist/tools/core/actor_tools_factory.d.ts +8 -3
  40. package/dist/tools/core/actor_tools_factory.d.ts.map +1 -1
  41. package/dist/tools/core/actor_tools_factory.js +39 -15
  42. package/dist/tools/core/actor_tools_factory.js.map +1 -1
  43. package/dist/tools/core/call_actor_common.d.ts +19 -39
  44. package/dist/tools/core/call_actor_common.d.ts.map +1 -1
  45. package/dist/tools/core/call_actor_common.js +196 -129
  46. package/dist/tools/core/call_actor_common.js.map +1 -1
  47. package/dist/tools/core/fetch_actor_details_common.d.ts.map +1 -1
  48. package/dist/tools/core/fetch_actor_details_common.js +1 -0
  49. package/dist/tools/core/fetch_actor_details_common.js.map +1 -1
  50. package/dist/tools/core/get_actor_run_common.d.ts +10 -49
  51. package/dist/tools/core/get_actor_run_common.d.ts.map +1 -1
  52. package/dist/tools/core/get_actor_run_common.js +51 -86
  53. package/dist/tools/core/get_actor_run_common.js.map +1 -1
  54. package/dist/tools/default/call_actor.d.ts +0 -2
  55. package/dist/tools/default/call_actor.d.ts.map +1 -1
  56. package/dist/tools/default/call_actor.js +5 -85
  57. package/dist/tools/default/call_actor.js.map +1 -1
  58. package/dist/tools/default/get_actor_run.d.ts +1 -2
  59. package/dist/tools/default/get_actor_run.d.ts.map +1 -1
  60. package/dist/tools/default/get_actor_run.js +12 -6
  61. package/dist/tools/default/get_actor_run.js.map +1 -1
  62. package/dist/tools/index.d.ts +1 -2
  63. package/dist/tools/index.d.ts.map +1 -1
  64. package/dist/tools/index.js +1 -2
  65. package/dist/tools/index.js.map +1 -1
  66. package/dist/tools/structured_output_schemas.d.ts +258 -51
  67. package/dist/tools/structured_output_schemas.d.ts.map +1 -1
  68. package/dist/tools/structured_output_schemas.js +128 -68
  69. package/dist/tools/structured_output_schemas.js.map +1 -1
  70. package/dist/tsconfig.tsbuildinfo +1 -1
  71. package/dist/types.d.ts +26 -1
  72. package/dist/types.d.ts.map +1 -1
  73. package/dist/types.js.map +1 -1
  74. package/dist/utils/mcp.d.ts +6 -0
  75. package/dist/utils/mcp.d.ts.map +1 -1
  76. package/dist/utils/mcp.js +30 -0
  77. package/dist/utils/mcp.js.map +1 -1
  78. package/dist/utils/progress.d.ts +1 -0
  79. package/dist/utils/progress.d.ts.map +1 -1
  80. package/dist/utils/progress.js +2 -2
  81. package/dist/utils/progress.js.map +1 -1
  82. package/dist/utils/server-instructions/index.d.ts.map +1 -1
  83. package/dist/utils/server-instructions/index.js +6 -7
  84. package/dist/utils/server-instructions/index.js.map +1 -1
  85. package/dist/utils/tools_loader.d.ts.map +1 -1
  86. package/dist/utils/tools_loader.js +9 -3
  87. package/dist/utils/tools_loader.js.map +1 -1
  88. package/dist/web/dist/actor-detail-widget.js +3 -0
  89. package/dist/web/dist/actor-run-widget.js +219 -216
  90. package/dist/web/dist/search-actors-widget.js +3 -0
  91. package/package.json +7 -7
  92. package/dist/tools/apps/actor_executor.d.ts +0 -8
  93. package/dist/tools/apps/actor_executor.d.ts.map +0 -1
  94. package/dist/tools/apps/actor_executor.js +0 -29
  95. package/dist/tools/apps/actor_executor.js.map +0 -1
  96. package/dist/tools/core/actor_execution.d.ts +0 -39
  97. package/dist/tools/core/actor_execution.d.ts.map +0 -1
  98. package/dist/tools/core/actor_execution.js +0 -135
  99. package/dist/tools/core/actor_execution.js.map +0 -1
  100. package/dist/tools/core/actor_response.d.ts +0 -37
  101. package/dist/tools/core/actor_response.d.ts.map +0 -1
  102. package/dist/tools/core/actor_response.js +0 -94
  103. package/dist/tools/core/actor_response.js.map +0 -1
  104. package/dist/tools/default/actor_executor.d.ts +0 -7
  105. package/dist/tools/default/actor_executor.d.ts.map +0 -1
  106. package/dist/tools/default/actor_executor.js +0 -31
  107. package/dist/tools/default/actor_executor.js.map +0 -1
@@ -578,6 +578,10 @@ export declare const actorDetailsOutputSchema: {
578
578
  type: "object";
579
579
  description: string;
580
580
  };
581
+ mcpTools: {
582
+ type: string;
583
+ description: string;
584
+ };
581
585
  };
582
586
  };
583
587
  /**
@@ -1140,18 +1144,18 @@ export declare const fetchApifyDocsToolOutputSchema: {
1140
1144
  };
1141
1145
  required: string[];
1142
1146
  };
1143
- /**
1144
- * Schema for call-actor and direct actor tool outputs.
1145
- * Contains Actor run metadata and dataset items (sync mode only).
1146
- * In async mode, only runId is present.
1147
- */
1148
- export declare const callActorOutputSchema: {
1147
+ /** Schema for get-actor-run tool output. */
1148
+ export declare const getActorRunOutputSchema: {
1149
1149
  type: "object";
1150
1150
  properties: {
1151
1151
  runId: {
1152
1152
  type: string;
1153
1153
  description: string;
1154
1154
  };
1155
+ actorId: {
1156
+ type: string;
1157
+ description: string;
1158
+ };
1155
1159
  actorName: {
1156
1160
  type: string;
1157
1161
  description: string;
@@ -1160,30 +1164,134 @@ export declare const callActorOutputSchema: {
1160
1164
  type: string;
1161
1165
  description: string;
1162
1166
  };
1163
- startedAt: {
1167
+ statusMessage: {
1164
1168
  type: string;
1165
1169
  description: string;
1166
1170
  };
1167
- input: {
1168
- type: "object";
1171
+ exitCode: {
1172
+ type: string;
1169
1173
  description: string;
1170
1174
  };
1171
- datasetId: {
1175
+ startedAt: {
1172
1176
  type: string;
1173
1177
  description: string;
1174
1178
  };
1175
- totalItemCount: {
1179
+ finishedAt: {
1176
1180
  type: string;
1177
1181
  description: string;
1178
1182
  };
1179
- items: {
1180
- type: "array";
1181
- items: {
1182
- type: "object";
1183
+ stats: {
1184
+ type: "object";
1185
+ description: string;
1186
+ properties: {
1187
+ runTimeSecs: {
1188
+ type: string;
1189
+ };
1190
+ computeUnits: {
1191
+ type: string;
1192
+ };
1193
+ memMaxBytes: {
1194
+ type: string;
1195
+ };
1183
1196
  };
1197
+ };
1198
+ storages: {
1199
+ type: "object";
1184
1200
  description: string;
1201
+ properties: {
1202
+ datasets: {
1203
+ type: "object";
1204
+ description: string;
1205
+ properties: {
1206
+ default: {
1207
+ type: "object";
1208
+ properties: {
1209
+ id: {
1210
+ type: string;
1211
+ description: string;
1212
+ };
1213
+ name: {
1214
+ type: string;
1215
+ };
1216
+ title: {
1217
+ type: string;
1218
+ };
1219
+ itemCount: {
1220
+ type: string;
1221
+ };
1222
+ cleanItemCount: {
1223
+ type: string;
1224
+ };
1225
+ fields: {
1226
+ type: "array";
1227
+ items: {
1228
+ type: string;
1229
+ };
1230
+ description: string;
1231
+ };
1232
+ };
1233
+ required: string[];
1234
+ };
1235
+ };
1236
+ additionalProperties: {
1237
+ type: "object";
1238
+ properties: {
1239
+ id: {
1240
+ type: string;
1241
+ };
1242
+ };
1243
+ required: string[];
1244
+ };
1245
+ };
1246
+ keyValueStores: {
1247
+ type: "object";
1248
+ description: string;
1249
+ properties: {
1250
+ default: {
1251
+ type: "object";
1252
+ properties: {
1253
+ id: {
1254
+ type: string;
1255
+ description: string;
1256
+ };
1257
+ name: {
1258
+ type: string;
1259
+ };
1260
+ title: {
1261
+ type: string;
1262
+ };
1263
+ keyCount: {
1264
+ type: string;
1265
+ description: string;
1266
+ };
1267
+ keys: {
1268
+ type: "array";
1269
+ items: {
1270
+ type: string;
1271
+ };
1272
+ description: string;
1273
+ };
1274
+ };
1275
+ required: string[];
1276
+ };
1277
+ };
1278
+ additionalProperties: {
1279
+ type: "object";
1280
+ properties: {
1281
+ id: {
1282
+ type: string;
1283
+ };
1284
+ };
1285
+ required: string[];
1286
+ };
1287
+ };
1288
+ };
1185
1289
  };
1186
- instructions: {
1290
+ summary: {
1291
+ type: string;
1292
+ description: string;
1293
+ };
1294
+ nextStep: {
1187
1295
  type: string;
1188
1296
  description: string;
1189
1297
  };
@@ -1191,16 +1299,126 @@ export declare const callActorOutputSchema: {
1191
1299
  required: string[];
1192
1300
  };
1193
1301
  /**
1194
- * Schema for get-actor-run tool output.
1195
- * Contains full run information including status, timestamps, stats, and dataset preview.
1302
+ * Returns a per-tool clone of {@link getActorRunOutputSchema} with `storages.datasets.default.itemsSchema`
1303
+ * declared as a JSON Schema describing each dataset row, inferred from historical successful runs.
1304
+ *
1305
+ * Used for direct actor tools (e.g. `apify--rag-web-browser`) where the target Actor is known
1306
+ * at `tools/list` time, so the LLM can plan field projection before calling the tool. The same
1307
+ * shape is injected into `structuredContent.storages.datasets.default.itemsSchema` by the direct
1308
+ * actor executors so the declared schema matches the runtime response.
1309
+ *
1310
+ * `call-actor` and `get-actor-run` cannot use this because their target Actor is dynamic.
1311
+ *
1312
+ * @param itemProperties - JSON Schema properties for dataset item fields
1313
+ * (e.g. `{ url: { type: 'string' }, price: { type: 'number' } }`).
1196
1314
  */
1197
- export declare const getActorRunOutputSchema: {
1198
- type: "object";
1315
+ export declare function buildEnrichedDirectActorOutputSchema(itemProperties: Record<string, unknown>): {
1199
1316
  properties: {
1317
+ storages: {
1318
+ properties: {
1319
+ datasets: {
1320
+ properties: {
1321
+ default: {
1322
+ properties: {
1323
+ itemsSchema: {
1324
+ type: "object";
1325
+ description: string;
1326
+ properties: Record<string, unknown>;
1327
+ };
1328
+ id: {
1329
+ type: string;
1330
+ description: string;
1331
+ };
1332
+ name: {
1333
+ type: string;
1334
+ };
1335
+ title: {
1336
+ type: string;
1337
+ };
1338
+ itemCount: {
1339
+ type: string;
1340
+ };
1341
+ cleanItemCount: {
1342
+ type: string;
1343
+ };
1344
+ fields: {
1345
+ type: "array";
1346
+ items: {
1347
+ type: string;
1348
+ };
1349
+ description: string;
1350
+ };
1351
+ };
1352
+ type: "object";
1353
+ required: string[];
1354
+ };
1355
+ };
1356
+ type: "object";
1357
+ description: string;
1358
+ additionalProperties: {
1359
+ type: "object";
1360
+ properties: {
1361
+ id: {
1362
+ type: string;
1363
+ };
1364
+ };
1365
+ required: string[];
1366
+ };
1367
+ };
1368
+ keyValueStores: {
1369
+ type: "object";
1370
+ description: string;
1371
+ properties: {
1372
+ default: {
1373
+ type: "object";
1374
+ properties: {
1375
+ id: {
1376
+ type: string;
1377
+ description: string;
1378
+ };
1379
+ name: {
1380
+ type: string;
1381
+ };
1382
+ title: {
1383
+ type: string;
1384
+ };
1385
+ keyCount: {
1386
+ type: string;
1387
+ description: string;
1388
+ };
1389
+ keys: {
1390
+ type: "array";
1391
+ items: {
1392
+ type: string;
1393
+ };
1394
+ description: string;
1395
+ };
1396
+ };
1397
+ required: string[];
1398
+ };
1399
+ };
1400
+ additionalProperties: {
1401
+ type: "object";
1402
+ properties: {
1403
+ id: {
1404
+ type: string;
1405
+ };
1406
+ };
1407
+ required: string[];
1408
+ };
1409
+ };
1410
+ };
1411
+ type: "object";
1412
+ description: string;
1413
+ };
1200
1414
  runId: {
1201
1415
  type: string;
1202
1416
  description: string;
1203
1417
  };
1418
+ actorId: {
1419
+ type: string;
1420
+ description: string;
1421
+ };
1204
1422
  actorName: {
1205
1423
  type: string;
1206
1424
  description: string;
@@ -1209,6 +1427,14 @@ export declare const getActorRunOutputSchema: {
1209
1427
  type: string;
1210
1428
  description: string;
1211
1429
  };
1430
+ statusMessage: {
1431
+ type: string;
1432
+ description: string;
1433
+ };
1434
+ exitCode: {
1435
+ type: string;
1436
+ description: string;
1437
+ };
1212
1438
  startedAt: {
1213
1439
  type: string;
1214
1440
  description: string;
@@ -1220,38 +1446,28 @@ export declare const getActorRunOutputSchema: {
1220
1446
  stats: {
1221
1447
  type: "object";
1222
1448
  description: string;
1223
- };
1224
- dataset: {
1225
- type: "object";
1226
- description: string;
1227
1449
  properties: {
1228
- datasetId: {
1450
+ runTimeSecs: {
1229
1451
  type: string;
1230
- description: string;
1231
1452
  };
1232
- totalItemCount: {
1453
+ computeUnits: {
1233
1454
  type: string;
1234
- description: string;
1235
1455
  };
1236
- previewItemCount: {
1456
+ memMaxBytes: {
1237
1457
  type: string;
1238
- description: string;
1239
- };
1240
- schema: {
1241
- type: "object";
1242
- description: string;
1243
- };
1244
- previewItems: {
1245
- type: "array";
1246
- items: {
1247
- type: "object";
1248
- };
1249
- description: string;
1250
1458
  };
1251
1459
  };
1252
- required: string[];
1460
+ };
1461
+ summary: {
1462
+ type: string;
1463
+ description: string;
1464
+ };
1465
+ nextStep: {
1466
+ type: string;
1467
+ description: string;
1253
1468
  };
1254
1469
  };
1470
+ type: "object";
1255
1471
  required: string[];
1256
1472
  };
1257
1473
  /**
@@ -1291,13 +1507,4 @@ export declare const datasetItemsOutputSchema: {
1291
1507
  };
1292
1508
  required: string[];
1293
1509
  };
1294
- /**
1295
- * Creates an enriched version of callActorOutputSchema where the `items` field
1296
- * contains actual property definitions inferred from Actor run history.
1297
- *
1298
- * @param itemProperties - JSON Schema properties object describing dataset item fields
1299
- * (e.g., `{ url: { type: 'string' }, price: { type: 'number' } }`)
1300
- * @returns A copy of callActorOutputSchema with enriched items schema
1301
- */
1302
- export declare function buildEnrichedCallActorOutputSchema(itemProperties: Record<string, unknown>): typeof callActorOutputSchema;
1303
1510
  //# sourceMappingURL=structured_output_schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"structured_output_schemas.d.ts","sourceRoot":"","sources":["../../src/tools/structured_output_schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6DH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;CAQvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD3B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;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;CAsFnC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oCAAoC,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoC3F;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAapC,CAAC"}
@@ -179,6 +179,10 @@ export const actorDetailsOutputSchema = {
179
179
  readme: { type: 'string', description: 'Actor README summary when available, otherwise the full README documentation.' },
180
180
  inputSchema: { type: 'object', description: 'Actor input schema.' }, // Literal type required for MCP SDK type compatibility
181
181
  outputSchema: { type: 'object', description: 'Output schema inferred from successful runs.' },
182
+ mcpTools: {
183
+ type: 'string',
184
+ description: 'Markdown listing of MCP tools exposed by the Actor (only present when `output.mcpTools` is requested).',
185
+ },
182
186
  },
183
187
  };
184
188
  /**
@@ -271,65 +275,145 @@ export const fetchApifyDocsToolOutputSchema = {
271
275
  },
272
276
  required: ['url', 'content'],
273
277
  };
274
- /**
275
- * Schema for call-actor and direct actor tool outputs.
276
- * Contains Actor run metadata and dataset items (sync mode only).
277
- * In async mode, only runId is present.
278
- */
279
- export const callActorOutputSchema = {
280
- type: 'object',
281
- properties: {
282
- runId: { type: 'string', description: 'Actor run ID' },
283
- actorName: { type: 'string', description: 'Name of the Actor (only in async mode)' },
284
- status: { type: 'string', description: 'Run status (only in async mode) - READY, RUNNING, SUCCEEDED, FAILED, ABORTING, ABORTED, TIMED-OUT' },
285
- startedAt: { type: 'string', description: 'ISO timestamp when the run started (only in async mode)' },
286
- input: { type: 'object', description: 'Input parameters passed to the Actor (only in async mode)' },
287
- datasetId: { type: 'string', description: 'Dataset ID containing the full results (sync mode only)' },
288
- totalItemCount: { type: 'number', description: 'Total number of items in the dataset (sync mode only)' },
289
- items: {
290
- type: 'array',
291
- items: { type: 'object' },
292
- description: 'Dataset items from the Actor run (sync mode only, may be truncated due to size limits)',
293
- },
294
- instructions: { type: 'string', description: 'Instructions for the LLM on how to process or retrieve additional data' },
295
- },
296
- required: ['runId'],
297
- };
298
- /**
299
- * Schema for get-actor-run tool output.
300
- * Contains full run information including status, timestamps, stats, and dataset preview.
301
- */
278
+ /** Schema for get-actor-run tool output. */
302
279
  export const getActorRunOutputSchema = {
303
280
  type: 'object',
304
281
  properties: {
305
282
  runId: { type: 'string', description: 'Actor run ID' },
306
- actorName: { type: 'string', description: 'Name of the Actor' },
307
- status: { type: 'string', description: 'Run status (READY, RUNNING, SUCCEEDED, FAILED, ABORTING, ABORTED, TIMED-OUT)' },
283
+ actorId: { type: 'string', description: 'Stable Apify Actor ID from the run record' },
284
+ actorName: { type: 'string', description: '"username/actor-name"' },
285
+ status: { type: 'string', description: 'Run status: READY | RUNNING | TIMING-OUT | TIMED-OUT | ABORTING | ABORTED | SUCCEEDED | FAILED' },
286
+ statusMessage: { type: 'string', description: 'Pass-through from Apify run.statusMessage' },
287
+ exitCode: { type: 'number', description: 'Actor process exit code; populated for terminal states (especially FAILED)' },
308
288
  startedAt: { type: 'string', description: 'ISO timestamp when the run started' },
309
- finishedAt: { type: 'string', description: 'ISO timestamp when the run finished (only for completed runs)' },
289
+ finishedAt: { type: 'string', description: 'ISO timestamp when the run finished (terminal states only)' },
310
290
  stats: {
311
291
  type: 'object',
312
- description: 'Run statistics (compute units, memory, duration, etc.)',
292
+ description: 'Run statistics',
293
+ properties: {
294
+ runTimeSecs: { type: 'number' },
295
+ computeUnits: { type: 'number' },
296
+ memMaxBytes: { type: 'number' },
297
+ },
313
298
  },
314
- dataset: {
299
+ storages: {
315
300
  type: 'object',
316
- description: 'Dataset information (only for completed runs with results)',
301
+ // Alias-map shape mirrors ActorRunStorageIds from the Apify client.
302
+ // `datasets.default` / `keyValueStores.default` are the primary entries;
303
+ // named Actor storages (e.g. datasets.results) occupy additional alias keys.
304
+ description: 'Dataset and key-value store metadata, keyed by alias. "default" is always the primary entry.',
317
305
  properties: {
318
- datasetId: { type: 'string', description: 'Default dataset ID' },
319
- totalItemCount: { type: 'number', description: 'Total number of items in dataset' },
320
- previewItemCount: { type: 'number', description: 'Number of preview items returned' },
321
- schema: { type: 'object', description: 'Auto-generated JSON schema from dataset items' },
322
- previewItems: {
323
- type: 'array',
324
- items: { type: 'object' },
325
- description: 'Preview of first 5 dataset items',
306
+ datasets: {
307
+ type: 'object',
308
+ description: 'Map of dataset alias metadata. Key "default" is always the run\'s primary dataset.',
309
+ properties: {
310
+ default: {
311
+ type: 'object',
312
+ properties: {
313
+ id: { type: 'string', description: 'Dataset ID' },
314
+ name: { type: 'string' },
315
+ title: { type: 'string' },
316
+ itemCount: { type: 'number' },
317
+ cleanItemCount: { type: 'number' },
318
+ fields: {
319
+ type: 'array',
320
+ items: { type: 'string' },
321
+ description: 'Dataset field paths in dot notation (e.g. ["metadata.url"])',
322
+ },
323
+ },
324
+ required: ['id'],
325
+ },
326
+ },
327
+ additionalProperties: {
328
+ type: 'object',
329
+ properties: { id: { type: 'string' } },
330
+ required: ['id'],
331
+ },
332
+ },
333
+ keyValueStores: {
334
+ type: 'object',
335
+ description: 'Map of key-value store alias → metadata. Key "default" is always the run\'s primary store.',
336
+ properties: {
337
+ default: {
338
+ type: 'object',
339
+ properties: {
340
+ id: { type: 'string', description: 'Key-value store ID' },
341
+ name: { type: 'string' },
342
+ title: { type: 'string' },
343
+ keyCount: { type: 'number', description: 'Total number of keys (omitted when truncated)' },
344
+ keys: {
345
+ type: 'array',
346
+ items: { type: 'string' },
347
+ description: 'Up to 50 key names',
348
+ },
349
+ },
350
+ required: ['id'],
351
+ },
352
+ },
353
+ additionalProperties: {
354
+ type: 'object',
355
+ properties: { id: { type: 'string' } },
356
+ required: ['id'],
357
+ },
326
358
  },
327
359
  },
328
- required: ['datasetId', 'totalItemCount', 'previewItemCount', 'schema', 'previewItems'],
329
360
  },
361
+ summary: { type: 'string', description: 'Past-tense summary of the run state' },
362
+ nextStep: { type: 'string', description: 'One primary follow-up action with identifiers interpolated' },
330
363
  },
331
- required: ['runId', 'status', 'startedAt'],
364
+ required: ['runId', 'actorId', 'status', 'storages', 'summary', 'nextStep'],
332
365
  };
366
+ /**
367
+ * Returns a per-tool clone of {@link getActorRunOutputSchema} with `storages.datasets.default.itemsSchema`
368
+ * declared as a JSON Schema describing each dataset row, inferred from historical successful runs.
369
+ *
370
+ * Used for direct actor tools (e.g. `apify--rag-web-browser`) where the target Actor is known
371
+ * at `tools/list` time, so the LLM can plan field projection before calling the tool. The same
372
+ * shape is injected into `structuredContent.storages.datasets.default.itemsSchema` by the direct
373
+ * actor executors so the declared schema matches the runtime response.
374
+ *
375
+ * `call-actor` and `get-actor-run` cannot use this because their target Actor is dynamic.
376
+ *
377
+ * @param itemProperties - JSON Schema properties for dataset item fields
378
+ * (e.g. `{ url: { type: 'string' }, price: { type: 'number' } }`).
379
+ */
380
+ export function buildEnrichedDirectActorOutputSchema(itemProperties) {
381
+ const { datasets } = getActorRunOutputSchema.properties.storages.properties;
382
+ const { default: defaultDataset } = datasets.properties;
383
+ const itemsSchema = {
384
+ type: 'object',
385
+ description: 'JSON Schema for rows in the dataset at `storages.datasets.default.id` — describes row '
386
+ + 'shape only; the rows themselves are NOT returned inline in this response. Inferred from this '
387
+ + 'Actor\'s historical successful runs. To fetch actual rows, call `get-dataset-items` with the '
388
+ + 'dataset id and a `fields` projection drawn from this schema.',
389
+ properties: itemProperties,
390
+ };
391
+ return {
392
+ ...getActorRunOutputSchema,
393
+ properties: {
394
+ ...getActorRunOutputSchema.properties,
395
+ storages: {
396
+ ...getActorRunOutputSchema.properties.storages,
397
+ properties: {
398
+ ...getActorRunOutputSchema.properties.storages.properties,
399
+ datasets: {
400
+ ...datasets,
401
+ properties: {
402
+ ...datasets.properties,
403
+ default: {
404
+ ...defaultDataset,
405
+ properties: {
406
+ ...defaultDataset.properties,
407
+ itemsSchema,
408
+ },
409
+ },
410
+ },
411
+ },
412
+ },
413
+ },
414
+ },
415
+ };
416
+ }
333
417
  /**
334
418
  * Schema for dataset items retrieval tools (get-actor-output, get-dataset-items).
335
419
  * Contains dataset items with pagination and count information.
@@ -348,28 +432,4 @@ export const datasetItemsOutputSchema = {
348
432
  },
349
433
  required: ['datasetId', 'items', 'itemCount'],
350
434
  };
351
- /**
352
- * Creates an enriched version of callActorOutputSchema where the `items` field
353
- * contains actual property definitions inferred from Actor run history.
354
- *
355
- * @param itemProperties - JSON Schema properties object describing dataset item fields
356
- * (e.g., `{ url: { type: 'string' }, price: { type: 'number' } }`)
357
- * @returns A copy of callActorOutputSchema with enriched items schema
358
- */
359
- export function buildEnrichedCallActorOutputSchema(itemProperties) {
360
- return {
361
- ...callActorOutputSchema,
362
- properties: {
363
- ...callActorOutputSchema.properties,
364
- items: {
365
- type: 'array',
366
- items: {
367
- type: 'object',
368
- properties: itemProperties,
369
- },
370
- description: callActorOutputSchema.properties.items.description,
371
- },
372
- },
373
- };
374
- }
375
435
  //# sourceMappingURL=structured_output_schemas.js.map