@apify/actors-mcp-server 0.5.9 → 0.6.1
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 -2
- package/dist/actor/types.d.ts +2 -2
- package/dist/actor/types.d.ts.map +1 -1
- package/dist/apify-client.d.ts +2 -2
- package/dist/apify-client.d.ts.map +1 -1
- package/dist/const.d.ts +13 -3
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +55 -1
- package/dist/const.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +33 -15
- package/dist/mcp/server.js.map +1 -1
- package/dist/stdio.js.map +1 -1
- package/dist/telemetry.d.ts +1 -2
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js.map +1 -1
- package/dist/tools/actor.d.ts.map +1 -1
- package/dist/tools/actor.js +47 -19
- package/dist/tools/actor.js.map +1 -1
- package/dist/tools/build.d.ts +2 -6
- package/dist/tools/build.d.ts.map +1 -1
- package/dist/tools/build.js +1 -59
- package/dist/tools/build.js.map +1 -1
- package/dist/tools/dataset.d.ts.map +1 -1
- package/dist/tools/dataset.js +23 -5
- package/dist/tools/dataset.js.map +1 -1
- package/dist/tools/fetch-actor-details.d.ts.map +1 -1
- package/dist/tools/fetch-actor-details.js +15 -6
- package/dist/tools/fetch-actor-details.js.map +1 -1
- package/dist/tools/fetch-apify-docs.d.ts.map +1 -1
- package/dist/tools/fetch-apify-docs.js +23 -8
- package/dist/tools/fetch-apify-docs.js.map +1 -1
- package/dist/tools/get-actor-output.d.ts.map +1 -1
- package/dist/tools/get-actor-output.js +7 -2
- package/dist/tools/get-actor-output.js.map +1 -1
- package/dist/tools/get-html-skeleton.d.ts.map +1 -1
- package/dist/tools/get-html-skeleton.js +19 -6
- package/dist/tools/get-html-skeleton.js.map +1 -1
- package/dist/tools/run.d.ts.map +1 -1
- package/dist/tools/run.js +8 -3
- package/dist/tools/run.js.map +1 -1
- package/dist/tools/run_collection.d.ts.map +1 -1
- package/dist/tools/run_collection.js +4 -1
- package/dist/tools/run_collection.js.map +1 -1
- package/dist/tools/search-apify-docs.d.ts.map +1 -1
- package/dist/tools/search-apify-docs.js +14 -4
- package/dist/tools/search-apify-docs.js.map +1 -1
- package/dist/tools/store_collection.d.ts.map +1 -1
- package/dist/tools/store_collection.js +24 -12
- package/dist/tools/store_collection.js.map +1 -1
- package/dist/tools/structured-output-schemas.d.ts +675 -0
- package/dist/tools/structured-output-schemas.d.ts.map +1 -0
- package/dist/tools/structured-output-schemas.js +169 -0
- package/dist/tools/structured-output-schemas.js.map +1 -0
- package/dist/tools/utils.d.ts +28 -27
- package/dist/tools/utils.d.ts.map +1 -1
- package/dist/tools/utils.js +16 -13
- package/dist/tools/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +68 -35
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/actor-card.d.ts +7 -1
- package/dist/utils/actor-card.d.ts.map +1 -1
- package/dist/utils/actor-card.js +69 -1
- package/dist/utils/actor-card.js.map +1 -1
- package/dist/utils/actor-details.d.ts +5 -4
- package/dist/utils/actor-details.d.ts.map +1 -1
- package/dist/utils/actor-details.js +3 -1
- package/dist/utils/actor-details.js.map +1 -1
- package/dist/utils/apify-properties.d.ts +7 -7
- package/dist/utils/apify-properties.d.ts.map +1 -1
- package/dist/utils/apify-properties.js.map +1 -1
- package/dist/utils/mcp-clients.d.ts +1 -1
- package/dist/utils/mcp-clients.d.ts.map +1 -1
- package/dist/utils/mcp.d.ts +18 -4
- package/dist/utils/mcp.d.ts.map +1 -1
- package/dist/utils/mcp.js +20 -4
- package/dist/utils/mcp.js.map +1 -1
- package/dist/utils/pricing-info.d.ts +29 -0
- package/dist/utils/pricing-info.d.ts.map +1 -1
- package/dist/utils/pricing-info.js +50 -0
- package/dist/utils/pricing-info.js.map +1 -1
- package/dist/utils/schema-generation.d.ts +6 -6
- package/dist/utils/schema-generation.d.ts.map +1 -1
- package/dist/utils/schema-generation.js +2 -4
- package/dist/utils/schema-generation.js.map +1 -1
- package/dist/utils/tool-status.d.ts +10 -0
- package/dist/utils/tool-status.d.ts.map +1 -0
- package/dist/utils/tool-status.js +27 -0
- package/dist/utils/tool-status.js.map +1 -0
- package/dist/utils/tools.d.ts +11 -0
- package/dist/utils/tools.d.ts.map +1 -1
- package/dist/utils/tools.js +3 -0
- package/dist/utils/tools.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +3 -5
- package/server.json +1 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared JSON schema definitions for structured output across tools.
|
|
3
|
+
* These schemas define the format of structured data returned by various tools.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Schema for developer information
|
|
7
|
+
*/
|
|
8
|
+
const developerSchema = {
|
|
9
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
10
|
+
properties: {
|
|
11
|
+
username: { type: 'string', description: 'Developer username' },
|
|
12
|
+
isOfficialApify: { type: 'boolean', description: 'Whether the actor is developed by Apify' },
|
|
13
|
+
url: { type: 'string', description: 'Developer profile URL' },
|
|
14
|
+
},
|
|
15
|
+
required: ['username', 'isOfficialApify', 'url'],
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Schema for tiered pricing within an event
|
|
19
|
+
*/
|
|
20
|
+
const eventTieredPricingSchema = {
|
|
21
|
+
type: 'array', // Literal type required for MCP SDK type compatibility
|
|
22
|
+
items: {
|
|
23
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
24
|
+
properties: {
|
|
25
|
+
tier: { type: 'string' },
|
|
26
|
+
priceUsd: { type: 'number' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Schema for pricing events (PAY_PER_EVENT model)
|
|
32
|
+
*/
|
|
33
|
+
const pricingEventsSchema = {
|
|
34
|
+
type: 'array', // Literal type required for MCP SDK type compatibility
|
|
35
|
+
items: {
|
|
36
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
37
|
+
properties: {
|
|
38
|
+
title: { type: 'string', description: 'Event title' },
|
|
39
|
+
description: { type: 'string', description: 'Event description' },
|
|
40
|
+
priceUsd: { type: 'number', description: 'Price in USD' },
|
|
41
|
+
tieredPricing: eventTieredPricingSchema,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
description: 'Event-based pricing information',
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Schema for tiered pricing (general)
|
|
48
|
+
*/
|
|
49
|
+
const tieredPricingSchema = {
|
|
50
|
+
type: 'array', // Literal type required for MCP SDK type compatibility
|
|
51
|
+
items: {
|
|
52
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
53
|
+
properties: {
|
|
54
|
+
tier: { type: 'string', description: 'Tier name' },
|
|
55
|
+
pricePerUnit: { type: 'number', description: 'Price per unit for this tier' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
description: 'Tiered pricing information',
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Schema for pricing information
|
|
62
|
+
*/
|
|
63
|
+
export const pricingSchema = {
|
|
64
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
65
|
+
properties: {
|
|
66
|
+
model: { type: 'string', description: 'Pricing model (FREE, PRICE_PER_DATASET_ITEM, FLAT_PRICE_PER_MONTH, PAY_PER_EVENT)' },
|
|
67
|
+
isFree: { type: 'boolean', description: 'Whether the Actor is free to use' },
|
|
68
|
+
pricePerUnit: { type: 'number', description: 'Price per unit (for non-free models)' },
|
|
69
|
+
unitName: { type: 'string', description: 'Unit name for pricing' },
|
|
70
|
+
trialMinutes: { type: 'number', description: 'Trial period in minutes' },
|
|
71
|
+
tieredPricing: tieredPricingSchema,
|
|
72
|
+
events: pricingEventsSchema,
|
|
73
|
+
},
|
|
74
|
+
required: ['model', 'isFree'],
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Schema for Actor statistics
|
|
78
|
+
*/
|
|
79
|
+
export const statsSchema = {
|
|
80
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
81
|
+
properties: {
|
|
82
|
+
totalUsers: { type: 'number', description: 'Total users' },
|
|
83
|
+
monthlyUsers: { type: 'number', description: 'Monthly active users' },
|
|
84
|
+
successRate: { type: 'number', description: 'Success rate percentage' },
|
|
85
|
+
bookmarks: { type: 'number', description: 'Number of bookmarks' },
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Schema for Actor information (card)
|
|
90
|
+
* Used in both search results and detailed Actor info
|
|
91
|
+
*/
|
|
92
|
+
export const actorInfoSchema = {
|
|
93
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
94
|
+
properties: {
|
|
95
|
+
title: { type: 'string', description: 'Actor title' },
|
|
96
|
+
url: { type: 'string', description: 'Actor URL' },
|
|
97
|
+
fullName: { type: 'string', description: 'Full Actor name (username/name)' },
|
|
98
|
+
developer: developerSchema,
|
|
99
|
+
description: { type: 'string', description: 'Actor description' },
|
|
100
|
+
categories: {
|
|
101
|
+
type: 'array', // Literal type required for MCP SDK type compatibility
|
|
102
|
+
items: { type: 'string' },
|
|
103
|
+
description: 'Actor categories',
|
|
104
|
+
},
|
|
105
|
+
pricing: pricingSchema,
|
|
106
|
+
stats: statsSchema,
|
|
107
|
+
rating: { type: 'number', description: 'Actor rating' },
|
|
108
|
+
modifiedAt: { type: 'string', description: 'Last modification date' },
|
|
109
|
+
isDeprecated: { type: 'boolean', description: 'Whether the Actor is deprecated' },
|
|
110
|
+
},
|
|
111
|
+
required: ['url', 'fullName', 'developer', 'description', 'categories', 'pricing'],
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Schema for Actor details output (fetch-actor-details tool)
|
|
115
|
+
*/
|
|
116
|
+
export const actorDetailsOutputSchema = {
|
|
117
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
118
|
+
properties: {
|
|
119
|
+
actorInfo: actorInfoSchema,
|
|
120
|
+
readme: { type: 'string', description: 'Actor README documentation.' },
|
|
121
|
+
inputSchema: { type: 'object', description: 'Actor input schema.' }, // Literal type required for MCP SDK type compatibility
|
|
122
|
+
},
|
|
123
|
+
required: ['actorInfo', 'readme', 'inputSchema'],
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Schema for search results output (store-search tool)
|
|
127
|
+
*/
|
|
128
|
+
export const actorSearchOutputSchema = {
|
|
129
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
130
|
+
properties: {
|
|
131
|
+
actors: {
|
|
132
|
+
type: 'array', // Literal type required for MCP SDK type compatibility
|
|
133
|
+
items: actorInfoSchema,
|
|
134
|
+
description: 'List of Actor cards matching the search query',
|
|
135
|
+
},
|
|
136
|
+
query: { type: 'string', description: 'The search query used' },
|
|
137
|
+
count: { type: 'number', description: 'Number of Actors returned' },
|
|
138
|
+
instructions: { type: 'string', description: 'Additional instructions for the LLM to follow when processing the search results.' },
|
|
139
|
+
},
|
|
140
|
+
required: ['actors', 'query', 'count'],
|
|
141
|
+
};
|
|
142
|
+
export const searchApifyDocsToolOutputSchema = {
|
|
143
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
144
|
+
properties: {
|
|
145
|
+
results: {
|
|
146
|
+
type: 'array', // Literal type required for MCP SDK type compatibility
|
|
147
|
+
items: {
|
|
148
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
149
|
+
properties: {
|
|
150
|
+
url: { type: 'string', description: 'URL of the documentation page.' },
|
|
151
|
+
fragment: { type: 'string', description: 'Fragment identifier within the document, if available.' },
|
|
152
|
+
content: { type: 'string', description: 'A limited piece of content that matches the search query.' },
|
|
153
|
+
},
|
|
154
|
+
required: ['url', 'content'],
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
instructions: { type: 'string', description: 'Additional instructions for the LLM to follow when processing the search results.' },
|
|
158
|
+
},
|
|
159
|
+
required: ['results'],
|
|
160
|
+
};
|
|
161
|
+
export const fetchApifyDocsToolOutputSchema = {
|
|
162
|
+
type: 'object', // Literal type required for MCP SDK type compatibility
|
|
163
|
+
properties: {
|
|
164
|
+
url: { type: 'string', description: 'The documentation URL that was fetched' },
|
|
165
|
+
content: { type: 'string', description: 'The full markdown content of the documentation page' },
|
|
166
|
+
},
|
|
167
|
+
required: ['url', 'content'],
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=structured-output-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structured-output-schemas.js","sourceRoot":"","sources":["../../src/tools/structured-output-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,eAAe,GAAG;IACpB,IAAI,EAAE,QAAiB,EAAE,uDAAuD;IAChF,UAAU,EAAE;QACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;QAC/D,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,yCAAyC,EAAE;QAC5F,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;KAChE;IACD,QAAQ,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,KAAK,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,MAAM,wBAAwB,GAAG;IAC7B,IAAI,EAAE,OAAgB,EAAE,uDAAuD;IAC/E,KAAK,EAAE;QACH,IAAI,EAAE,QAAiB,EAAE,uDAAuD;QAChF,UAAU,EAAE;YACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC/B;KACJ;CACJ,CAAC;AAEF;;GAEG;AACH,MAAM,mBAAmB,GAAG;IACxB,IAAI,EAAE,OAAgB,EAAE,uD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,EAAE,uDAAuD;IAChF,UAAU,EAAE;QACR,OAAO,EAAE;YACL,IAAI,EAAE,OAAgB,EAAE,uDAAuD;YAC/E,KAAK,EAAE;gBACH,IAAI,EAAE,QAAiB,EAAE,uDAAuD;gBAChF,UAAU,EAAE;oBACR,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;oBACtE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wDAAwD,EAAE;oBACnG,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2DAA2D,EAAE;iBACxG;gBACD,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC;aAC/B;SACJ;QACD,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mFAAmF,EAAE;KACrI;IACD,QAAQ,EAAE,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC1C,IAAI,EAAE,QAAiB,EAAE,uDAAuD;IAChF,UAAU,EAAE;QACR,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;QAC9E,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qDAAqD,EAAE;KAClG;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC;CAC/B,CAAC"}
|
package/dist/tools/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ValidateFunction } from 'ajv';
|
|
2
2
|
import type Ajv from 'ajv';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ActorInputSchema, ActorInputSchemaProperties, SchemaProperties } from '../types.js';
|
|
4
4
|
export declare function actorNameToToolName(actorName: string): string;
|
|
5
5
|
export declare function getToolSchemaID(actorName: string): string;
|
|
6
6
|
export declare function fixedAjvCompile(ajvInstance: Ajv, schema: object): ValidateFunction<unknown>;
|
|
@@ -15,45 +15,45 @@ export declare function fixedAjvCompile(ajvInstance: Ajv, schema: object): Valid
|
|
|
15
15
|
* For proxy objects (type='object', editor='proxy'), adds 'useApifyProxy' property.
|
|
16
16
|
* For request list sources (type='array', editor='requestListSources'), adds URL structure to items.
|
|
17
17
|
*
|
|
18
|
-
* @param {Record<string,
|
|
19
|
-
* @returns {Record<string,
|
|
18
|
+
* @param {Record<string, SchemaProperties>} properties - The input schema properties
|
|
19
|
+
* @returns {Record<string, SchemaProperties>} Modified properties with nested properties
|
|
20
20
|
*/
|
|
21
|
-
export declare function buildApifySpecificProperties(properties: Record<string,
|
|
21
|
+
export declare function buildApifySpecificProperties(properties: Record<string, SchemaProperties>): Record<string, SchemaProperties>;
|
|
22
22
|
/**
|
|
23
23
|
* Filters schema properties to include only the necessary fields.
|
|
24
24
|
* This is done to reduce the size of the input schema and to make it more readable.
|
|
25
25
|
* @param properties
|
|
26
26
|
*/
|
|
27
27
|
export declare function filterSchemaProperties(properties: {
|
|
28
|
-
[key: string]:
|
|
28
|
+
[key: string]: SchemaProperties;
|
|
29
29
|
}): {
|
|
30
|
-
[key: string]:
|
|
30
|
+
[key: string]: SchemaProperties;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* For array properties missing items.type, infers and sets the type using inferArrayItemType.
|
|
34
34
|
* @param properties
|
|
35
35
|
*/
|
|
36
36
|
export declare function inferArrayItemsTypeIfMissing(properties: {
|
|
37
|
-
[key: string]:
|
|
37
|
+
[key: string]: SchemaProperties;
|
|
38
38
|
}): {
|
|
39
|
-
[key: string]:
|
|
39
|
+
[key: string]: SchemaProperties;
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
42
|
* Marks input properties as required by adding a "REQUIRED" prefix to their descriptions.
|
|
43
|
-
* Takes an
|
|
43
|
+
* Takes an ActorInput object and returns a modified Record of SchemaProperties.
|
|
44
44
|
*
|
|
45
45
|
* This is done for maximum compatibility in case where library or agent framework does not consider
|
|
46
46
|
* required fields and does not handle the JSON schema properly: we are prepending this to the description
|
|
47
47
|
* as a preventive measure.
|
|
48
|
-
* @param {
|
|
49
|
-
* @returns {Record<string,
|
|
48
|
+
* @param {ActorInputSchema} input - Actor input object containing properties and required fields
|
|
49
|
+
* @returns {Record<string, SchemaProperties>} - Modified properties with required fields marked
|
|
50
50
|
*/
|
|
51
|
-
export declare function markInputPropertiesAsRequired(input:
|
|
51
|
+
export declare function markInputPropertiesAsRequired(input: ActorInputSchema): Record<string, SchemaProperties>;
|
|
52
52
|
/**
|
|
53
53
|
* Builds the final Actor input schema for MCP tool usage.
|
|
54
54
|
*/
|
|
55
|
-
export declare function buildActorInputSchema(actorFullName: string, input:
|
|
56
|
-
inputSchema:
|
|
55
|
+
export declare function buildActorInputSchema(actorFullName: string, input: ActorInputSchema | undefined, isRag: boolean): {
|
|
56
|
+
inputSchema: ActorInputSchema;
|
|
57
57
|
};
|
|
58
58
|
/**
|
|
59
59
|
* Returns a shallow-cloned input schema that keeps only whitelisted properties
|
|
@@ -63,7 +63,7 @@ export declare function buildActorInputSchema(actorFullName: string, input: IAct
|
|
|
63
63
|
* This is used specifically for apify/rag-web-browser where we want to expose
|
|
64
64
|
* only a subset of input properties to the MCP tool without redefining the schema.
|
|
65
65
|
*/
|
|
66
|
-
export declare function pruneSchemaPropertiesByWhitelist(input:
|
|
66
|
+
export declare function pruneSchemaPropertiesByWhitelist(input: ActorInputSchema, whitelist: Iterable<string>): ActorInputSchema;
|
|
67
67
|
/**
|
|
68
68
|
* Helps determine the type of items in an array schema property.
|
|
69
69
|
* Priority order: explicit type in items > prefill type > default value type > editor type.
|
|
@@ -71,7 +71,7 @@ export declare function pruneSchemaPropertiesByWhitelist(input: IActorInputSchem
|
|
|
71
71
|
* Based on JSON schema, the array needs a type, and most of the time Actor input schema does not have this, so we need to infer that.
|
|
72
72
|
*
|
|
73
73
|
*/
|
|
74
|
-
export declare function inferArrayItemType(property:
|
|
74
|
+
export declare function inferArrayItemType(property: SchemaProperties): string | null;
|
|
75
75
|
/**
|
|
76
76
|
* Add enum values as string to property descriptions.
|
|
77
77
|
*
|
|
@@ -83,14 +83,15 @@ export declare function inferArrayItemType(property: ISchemaProperties): string
|
|
|
83
83
|
*
|
|
84
84
|
* @param properties
|
|
85
85
|
*/
|
|
86
|
-
export declare function addEnumsToDescriptionsWithExamples(properties: Record<string,
|
|
86
|
+
export declare function addEnumsToDescriptionsWithExamples(properties: Record<string, SchemaProperties>): Record<string, SchemaProperties>;
|
|
87
87
|
/**
|
|
88
|
-
* Helper function to shorten the enum list
|
|
88
|
+
* Helper function to filter and shorten the enum list.
|
|
89
|
+
* Removes empty strings and truncates if the total character count exceeds the limit.
|
|
89
90
|
*
|
|
90
|
-
* @param {string[]} enumList - The list of enum values to be shortened.
|
|
91
|
-
* @returns {string[] | undefined} - The shortened enum list or undefined if the list is too long.
|
|
91
|
+
* @param {string[]} enumList - The list of enum values to be filtered and shortened.
|
|
92
|
+
* @returns {string[] | undefined} - The filtered and shortened enum list or undefined if the list is too long.
|
|
92
93
|
*/
|
|
93
|
-
export declare function
|
|
94
|
+
export declare function filterAndShortenEnum(enumList: string[]): string[] | undefined;
|
|
94
95
|
/**
|
|
95
96
|
* Shortens the description, enum, and items.enum properties of the schema properties.
|
|
96
97
|
* This is mostly problem with compass/crawler-google-places, which has large number of categories
|
|
@@ -98,9 +99,9 @@ export declare function shortenEnum(enumList: string[]): string[] | undefined;
|
|
|
98
99
|
* @param properties
|
|
99
100
|
*/
|
|
100
101
|
export declare function shortenProperties(properties: {
|
|
101
|
-
[key: string]:
|
|
102
|
+
[key: string]: SchemaProperties;
|
|
102
103
|
}): {
|
|
103
|
-
[key: string]:
|
|
104
|
+
[key: string]: SchemaProperties;
|
|
104
105
|
};
|
|
105
106
|
/**
|
|
106
107
|
* Fixes dot notation in the property names of schema properties.
|
|
@@ -108,9 +109,9 @@ export declare function shortenProperties(properties: {
|
|
|
108
109
|
* Some providers, such as Anthropic, allow only the following characters in property names: `^[a-zA-Z0-9_-]{1,64}$`.
|
|
109
110
|
*
|
|
110
111
|
* @param properties - The schema properties to fix.
|
|
111
|
-
* @returns {Record<string,
|
|
112
|
+
* @returns {Record<string, SchemaProperties>} The schema properties with fixed names.
|
|
112
113
|
*/
|
|
113
|
-
export declare function encodeDotPropertyNames(properties: Record<string,
|
|
114
|
+
export declare function encodeDotPropertyNames(properties: Record<string, SchemaProperties>): Record<string, SchemaProperties>;
|
|
114
115
|
/**
|
|
115
116
|
* Restores original property names by replacing '-dot-' with '.'.
|
|
116
117
|
*
|
|
@@ -118,8 +119,8 @@ export declare function encodeDotPropertyNames(properties: Record<string, ISchem
|
|
|
118
119
|
* that do not allow dots in property names.
|
|
119
120
|
*
|
|
120
121
|
* @param properties - The schema properties with encoded names.
|
|
121
|
-
* @returns {Record<string,
|
|
122
|
+
* @returns {Record<string, SchemaProperties>} The schema properties with restored names.
|
|
122
123
|
*/
|
|
123
124
|
export declare function decodeDotPropertyNames(properties: Record<string, unknown>): Record<string, unknown>;
|
|
124
|
-
export declare function transformActorInputSchemaProperties(input: Readonly<
|
|
125
|
+
export declare function transformActorInputSchemaProperties(input: Readonly<ActorInputSchema>): ActorInputSchemaProperties;
|
|
125
126
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,OAAO,KAAK,EAAE,gBAAgB,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,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAiB5E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAYjI;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,CAS7E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;CAAE,GAAG;IAChF,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;CAClC,CAgBA;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAQrH;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQnG;AAED,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,0BAA0B,CAWjH"}
|
package/dist/tools/utils.js
CHANGED
|
@@ -39,8 +39,8 @@ export function fixedAjvCompile(ajvInstance, schema) {
|
|
|
39
39
|
* For proxy objects (type='object', editor='proxy'), adds 'useApifyProxy' property.
|
|
40
40
|
* For request list sources (type='array', editor='requestListSources'), adds URL structure to items.
|
|
41
41
|
*
|
|
42
|
-
* @param {Record<string,
|
|
43
|
-
* @returns {Record<string,
|
|
42
|
+
* @param {Record<string, SchemaProperties>} properties - The input schema properties
|
|
43
|
+
* @returns {Record<string, SchemaProperties>} Modified properties with nested properties
|
|
44
44
|
*/
|
|
45
45
|
export function buildApifySpecificProperties(properties) {
|
|
46
46
|
const clonedProperties = { ...properties };
|
|
@@ -111,13 +111,13 @@ export function inferArrayItemsTypeIfMissing(properties) {
|
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Marks input properties as required by adding a "REQUIRED" prefix to their descriptions.
|
|
114
|
-
* Takes an
|
|
114
|
+
* Takes an ActorInput object and returns a modified Record of SchemaProperties.
|
|
115
115
|
*
|
|
116
116
|
* This is done for maximum compatibility in case where library or agent framework does not consider
|
|
117
117
|
* required fields and does not handle the JSON schema properly: we are prepending this to the description
|
|
118
118
|
* as a preventive measure.
|
|
119
|
-
* @param {
|
|
120
|
-
* @returns {Record<string,
|
|
119
|
+
* @param {ActorInputSchema} input - Actor input object containing properties and required fields
|
|
120
|
+
* @returns {Record<string, SchemaProperties>} - Modified properties with required fields marked
|
|
121
121
|
*/
|
|
122
122
|
export function markInputPropertiesAsRequired(input) {
|
|
123
123
|
const { required = [], properties } = input;
|
|
@@ -246,14 +246,17 @@ export function addEnumsToDescriptionsWithExamples(properties) {
|
|
|
246
246
|
return properties;
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
-
* Helper function to shorten the enum list
|
|
249
|
+
* Helper function to filter and shorten the enum list.
|
|
250
|
+
* Removes empty strings and truncates if the total character count exceeds the limit.
|
|
250
251
|
*
|
|
251
|
-
* @param {string[]} enumList - The list of enum values to be shortened.
|
|
252
|
-
* @returns {string[] | undefined} - The shortened enum list or undefined if the list is too long.
|
|
252
|
+
* @param {string[]} enumList - The list of enum values to be filtered and shortened.
|
|
253
|
+
* @returns {string[] | undefined} - The filtered and shortened enum list or undefined if the list is too long.
|
|
253
254
|
*/
|
|
254
|
-
export function
|
|
255
|
+
export function filterAndShortenEnum(enumList) {
|
|
255
256
|
let charCount = 0;
|
|
256
257
|
const resultEnumList = enumList.filter((enumValue) => {
|
|
258
|
+
if (enumValue === '')
|
|
259
|
+
return false;
|
|
257
260
|
charCount += enumValue.length;
|
|
258
261
|
return charCount <= ACTOR_ENUM_MAX_LENGTH;
|
|
259
262
|
});
|
|
@@ -272,10 +275,10 @@ export function shortenProperties(properties) {
|
|
|
272
275
|
property.description = `${property.description.slice(0, ACTOR_MAX_DESCRIPTION_LENGTH)}...`;
|
|
273
276
|
}
|
|
274
277
|
if (property.enum && ((_a = property.enum) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
275
|
-
property.enum =
|
|
278
|
+
property.enum = filterAndShortenEnum(property.enum);
|
|
276
279
|
}
|
|
277
280
|
if (((_b = property.items) === null || _b === void 0 ? void 0 : _b.enum) && property.items.enum.length > 0) {
|
|
278
|
-
property.items.enum =
|
|
281
|
+
property.items.enum = filterAndShortenEnum(property.items.enum);
|
|
279
282
|
}
|
|
280
283
|
}
|
|
281
284
|
return properties;
|
|
@@ -286,7 +289,7 @@ export function shortenProperties(properties) {
|
|
|
286
289
|
* Some providers, such as Anthropic, allow only the following characters in property names: `^[a-zA-Z0-9_-]{1,64}$`.
|
|
287
290
|
*
|
|
288
291
|
* @param properties - The schema properties to fix.
|
|
289
|
-
* @returns {Record<string,
|
|
292
|
+
* @returns {Record<string, SchemaProperties>} The schema properties with fixed names.
|
|
290
293
|
*/
|
|
291
294
|
export function encodeDotPropertyNames(properties) {
|
|
292
295
|
const encodedProperties = {};
|
|
@@ -304,7 +307,7 @@ export function encodeDotPropertyNames(properties) {
|
|
|
304
307
|
* that do not allow dots in property names.
|
|
305
308
|
*
|
|
306
309
|
* @param properties - The schema properties with encoded names.
|
|
307
|
-
* @returns {Record<string,
|
|
310
|
+
* @returns {Record<string, SchemaProperties>} The schema properties with restored names.
|
|
308
311
|
*/
|
|
309
312
|
export function decodeDotPropertyNames(properties) {
|
|
310
313
|
const decodedProperties = {};
|
package/dist/tools/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAA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