@apify/actors-mcp-server 0.16.1-beta.3 → 0.16.1-beta.5
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 +3 -1
- 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/index_internals.d.ts +2 -0
- package/dist/index_internals.d.ts.map +1 -1
- package/dist/mcp/tool_call_engine.d.ts.map +1 -1
- package/dist/mcp/tool_call_engine.js +2 -1
- package/dist/mcp/tool_call_engine.js.map +1 -1
- package/dist/payments/const.d.ts.map +1 -1
- package/dist/payments/const.js +1 -0
- package/dist/payments/const.js.map +1 -1
- package/dist/test_kit/tsconfig.tsbuildinfo +1 -1
- package/dist/tools/builds/build_actor.d.ts +7 -0
- package/dist/tools/builds/build_actor.d.ts.map +1 -0
- package/dist/tools/builds/build_actor.js +97 -0
- package/dist/tools/builds/build_actor.js.map +1 -0
- package/dist/tools/builds/build_helpers.d.ts +35 -7
- package/dist/tools/builds/build_helpers.d.ts.map +1 -1
- package/dist/tools/builds/build_helpers.js +61 -7
- package/dist/tools/builds/build_helpers.js.map +1 -1
- package/dist/tools/builds/get_actor_build_list.d.ts +9 -0
- package/dist/tools/builds/get_actor_build_list.d.ts.map +1 -0
- package/dist/tools/builds/get_actor_build_list.js +119 -0
- package/dist/tools/builds/get_actor_build_list.js.map +1 -0
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +3 -1
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/runs/get_actor_run_list.d.ts.map +1 -1
- package/dist/tools/runs/get_actor_run_list.js +1 -1
- package/dist/tools/runs/get_actor_run_list.js.map +1 -1
- package/dist/tools/structured_output_schemas.d.ts +77 -4
- package/dist/tools/structured_output_schemas.d.ts.map +1 -1
- package/dist/tools/structured_output_schemas.js +28 -11
- package/dist/tools/structured_output_schemas.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build_actor.d.ts","sourceRoot":"","sources":["../../../src/tools/builds/build_actor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA4C,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AA+C3G;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,SAuDd,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HELPER_TOOLS } from '../../const.js';
|
|
3
|
+
import { ALL_TOOLS_PRESENT, TOOL_TYPE } from '../../types.js';
|
|
4
|
+
import { compileSchema, fixZodSchemaRequired } from '../../utils/ajv.js';
|
|
5
|
+
import { getConsoleLinkContext } from '../../utils/console_link.js';
|
|
6
|
+
import { respondAborted, respondUserError } from '../../utils/mcp.js';
|
|
7
|
+
import { ABORT } from '../actors/actor_run_response.js';
|
|
8
|
+
import { buildActorToolOutputSchema } from '../structured_output_schemas.js';
|
|
9
|
+
import { buildNextStepForBuild, buildWaitSecsField, listVersionNumbers, respondWithBuild, startBuild, toBuildResult, } from './build_helpers.js';
|
|
10
|
+
const buildActorArgs = z.object({
|
|
11
|
+
actor: z.string().min(1).describe('Actor ID or username/name'),
|
|
12
|
+
// Format is not enforced by a regex: AJV here drops `pattern`, and the lookup against the Actor's
|
|
13
|
+
// versions below rejects anything that is not an existing MAJOR.MINOR version with a soft fail.
|
|
14
|
+
versionNumber: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Version to build in MAJOR.MINOR form; defaults to the only version when the Actor has exactly one'),
|
|
18
|
+
tag: z.string().optional().describe('Build tag to assign, for example latest'),
|
|
19
|
+
useCache: z.boolean().default(true).describe('Reuse the Docker layer cache from the previous build'),
|
|
20
|
+
waitSecs: buildWaitSecsField('0 starts the build and returns right away.'),
|
|
21
|
+
});
|
|
22
|
+
function buildDescription({ hasTool }) {
|
|
23
|
+
return `Build an Actor version on the Apify platform and wait a bounded time for the build to finish.
|
|
24
|
+
Returns the build (id, actorId, buildNumber, status, startedAt, finishedAt) and a summary with one next step.
|
|
25
|
+
Use after the Actor's source changed so runs pick up the new code.${hasTool(HELPER_TOOLS.ACTOR_BUILD_GET)
|
|
26
|
+
? ` If the build is still running when the wait ends, check it with ${HELPER_TOOLS.ACTOR_BUILD_GET}.`
|
|
27
|
+
: ''}
|
|
28
|
+
|
|
29
|
+
USAGE:
|
|
30
|
+
- Use to rebuild an Actor after changing its source.
|
|
31
|
+
- Use to build a specific version and tag it, for example as latest.
|
|
32
|
+
|
|
33
|
+
USAGE EXAMPLES:
|
|
34
|
+
- user_input: Rebuild my-actor
|
|
35
|
+
- user_input: Build version 0.2 of john/my-actor and tag it latest`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* https://docs.apify.com/api/v2/actors-builds-post
|
|
39
|
+
* /v2/acts/{actorId}/builds
|
|
40
|
+
*/
|
|
41
|
+
export const buildActor = Object.freeze({
|
|
42
|
+
type: TOOL_TYPE.INTERNAL,
|
|
43
|
+
name: HELPER_TOOLS.ACTOR_BUILD,
|
|
44
|
+
title: 'Build Actor',
|
|
45
|
+
description: buildDescription(ALL_TOOLS_PRESENT),
|
|
46
|
+
buildDescription,
|
|
47
|
+
// `fixZodSchemaRequired` strips `useCache` and `waitSecs` from `required` because they have defaults.
|
|
48
|
+
inputSchema: fixZodSchemaRequired(z.toJSONSchema(buildActorArgs)),
|
|
49
|
+
outputSchema: buildActorToolOutputSchema,
|
|
50
|
+
ajvValidate: compileSchema(z.toJSONSchema(buildActorArgs)),
|
|
51
|
+
paymentRequired: true,
|
|
52
|
+
annotations: {
|
|
53
|
+
title: 'Build Actor',
|
|
54
|
+
readOnlyHint: false,
|
|
55
|
+
// `tag` re-points an existing tag, `latest` included, to this build, which changes what runs by default.
|
|
56
|
+
destructiveHint: true,
|
|
57
|
+
idempotentHint: false,
|
|
58
|
+
openWorldHint: true,
|
|
59
|
+
},
|
|
60
|
+
call: async (toolArgs) => {
|
|
61
|
+
var _a;
|
|
62
|
+
const { args, apifyClient: client, apifyToken, loadedToolNames, signal, progressTracker } = toolArgs;
|
|
63
|
+
const parsed = buildActorArgs.parse(args);
|
|
64
|
+
const actor = await client.actor(parsed.actor).get();
|
|
65
|
+
if (!actor) {
|
|
66
|
+
return respondUserError(`Actor '${parsed.actor}' not found.`);
|
|
67
|
+
}
|
|
68
|
+
const versionNumbers = listVersionNumbers(actor);
|
|
69
|
+
if (versionNumbers.length === 0) {
|
|
70
|
+
return respondUserError(`Actor '${parsed.actor}' has no versions to build.`);
|
|
71
|
+
}
|
|
72
|
+
if (parsed.versionNumber !== undefined && !versionNumbers.includes(parsed.versionNumber)) {
|
|
73
|
+
return respondUserError(`Actor '${parsed.actor}' has no version ${parsed.versionNumber}; available versions: ${versionNumbers.join(', ')}.`);
|
|
74
|
+
}
|
|
75
|
+
if (parsed.versionNumber === undefined && versionNumbers.length !== 1) {
|
|
76
|
+
return respondUserError(`Specify versionNumber; this Actor has versions: ${versionNumbers.join(', ')}.`);
|
|
77
|
+
}
|
|
78
|
+
const versionNumber = (_a = parsed.versionNumber) !== null && _a !== void 0 ? _a : versionNumbers[0];
|
|
79
|
+
// Race the wait against the request signal so a cancelled call returns promptly instead of
|
|
80
|
+
// blocking up to `waitSecs`. Per MCP spec, receivers SHOULD NOT respond to a cancelled request.
|
|
81
|
+
const build = await startBuild(client, actor.id, versionNumber, {
|
|
82
|
+
tag: parsed.tag,
|
|
83
|
+
useCache: parsed.useCache,
|
|
84
|
+
waitSecs: parsed.waitSecs,
|
|
85
|
+
signal,
|
|
86
|
+
progressTracker,
|
|
87
|
+
});
|
|
88
|
+
if (build === ABORT)
|
|
89
|
+
return respondAborted();
|
|
90
|
+
const linkContext = await getConsoleLinkContext(apifyToken, client);
|
|
91
|
+
const structuredContent = { build: toBuildResult(build, linkContext) };
|
|
92
|
+
const summary = `Started build ${build.buildNumber} of Actor ${build.actId} (version ${versionNumber}); status ${build.status}.`;
|
|
93
|
+
const nextStep = buildNextStepForBuild(build, { loadedToolNames });
|
|
94
|
+
return respondWithBuild({ structuredContent, summary, nextStep });
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=build_actor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build_actor.js","sourceRoot":"","sources":["../../../src/tools/builds/build_actor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EACH,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,aAAa,GAChB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC9D,kGAAkG;IAClG,gGAAgG;IAChG,aAAa,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,mGAAmG,CAAC;IAClH,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC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AAI,KAAK,KAAK,KAAK;YAAE,OAAO,cAAc,EAAE,CAAC;QAC7C,MAAM,WAAW,GAAG,MAAM,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACpE,MAAM,iBAAiB,GAAG,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG,iBAAiB,KAAK,CAAC,WAAW,aAAa,KAAK,CAAC,KAAK,aAAa,aAAa,aAAa,KAAK,CAAC,MAAM,GAAG,CAAC;QACjI,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;QACnE,OAAO,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtE,CAAC;CACK,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { Build } from 'apify-client';
|
|
1
|
+
import type { Actor, Build } from 'apify-client';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { ApifyClient } from '../../apify_client.js';
|
|
4
4
|
import type { ConsoleLinkContext } from '../../types.js';
|
|
5
5
|
import type { ToolResponse } from '../../utils/mcp.js';
|
|
6
6
|
import type { ProgressTracker } from '../../utils/progress.js';
|
|
7
7
|
import { ABORT } from '../actors/actor_run_response.js';
|
|
8
|
+
/** The MAJOR.MINOR numbers of the Actor's versions; a version document without one is skipped. */
|
|
9
|
+
export declare function listVersionNumbers(actor: Pick<Actor, 'versions'>): string[];
|
|
8
10
|
/** The build tools wait this long by default, the same as `get-actor-run` and `call-actor`, so a loop of build and run calls behaves alike. */
|
|
9
11
|
export declare const BUILD_WAIT_SECS_DEFAULT = 30;
|
|
10
12
|
/**
|
|
@@ -14,27 +16,53 @@ export declare const BUILD_WAIT_SECS_DEFAULT = 30;
|
|
|
14
16
|
export declare function buildWaitSecsField(zeroMeans: string): z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
15
17
|
/**
|
|
16
18
|
* The build subset returned by the build tools. Allowlisted so internal fields on the API
|
|
17
|
-
* document (userId, meta, options, inspectorId) never reach the client.
|
|
18
|
-
*
|
|
19
|
+
* document (userId, meta, options, inspectorId) never reach the client. get-actor-build-list returns
|
|
20
|
+
* it as is; get-actor-build and build-actor add the Console link (`toBuildResult`).
|
|
19
21
|
*/
|
|
20
|
-
export declare function
|
|
22
|
+
export declare function toBuildItem(build: Pick<Build, 'id' | 'actId' | 'buildNumber' | 'status' | 'startedAt' | 'finishedAt'>): {
|
|
21
23
|
id: string;
|
|
22
24
|
actorId: string;
|
|
23
25
|
buildNumber: string;
|
|
24
26
|
status: "SUCCEEDED" | "FAILED" | "ABORTED" | "TIMED-OUT";
|
|
25
27
|
startedAt: string | null;
|
|
26
28
|
finishedAt: string | null;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* `toBuildItem` plus `apifyConsoleUrl`, which is set only for Console UI token sessions
|
|
32
|
+
* (see `getConsoleLinkContext`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function toBuildResult(build: Build, linkContext: ConsoleLinkContext | undefined): {
|
|
27
35
|
apifyConsoleUrl: string | undefined;
|
|
36
|
+
id: string;
|
|
37
|
+
actorId: string;
|
|
38
|
+
buildNumber: string;
|
|
39
|
+
status: "SUCCEEDED" | "FAILED" | "ABORTED" | "TIMED-OUT";
|
|
40
|
+
startedAt: string | null;
|
|
41
|
+
finishedAt: string | null;
|
|
28
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Starts a build of an Actor version and waits up to `waitSecs` for it to finish, reporting progress
|
|
45
|
+
* meanwhile. The wait is raced against `signal`; a cancelled request aborts the build it started and
|
|
46
|
+
* resolves to {@link ABORT}, so a build nobody waits for does not run on, the same as `call-actor`
|
|
47
|
+
* does with its run.
|
|
48
|
+
*/
|
|
49
|
+
export declare function startBuild(client: ApifyClient, actorId: string, versionNumber: string, options: {
|
|
50
|
+
tag?: string;
|
|
51
|
+
useCache: boolean;
|
|
52
|
+
waitSecs: number;
|
|
53
|
+
signal?: AbortSignal;
|
|
54
|
+
progressTracker?: ProgressTracker | null;
|
|
55
|
+
}): Promise<Build | typeof ABORT>;
|
|
29
56
|
/**
|
|
30
57
|
* The one next step after a build reaches `status`, shared by every tool that reports a build.
|
|
31
58
|
* Sibling tools are named only when the session was served them (`loadedToolNames`), and each hint
|
|
32
|
-
* keeps a fallback so the text is never a dead end.
|
|
33
|
-
* because only the calling tool may name
|
|
59
|
+
* keeps a fallback so the text is never a dead end. A still-running build points at get-actor-build;
|
|
60
|
+
* only get-actor-build itself passes `nonTerminalNextStep`, because only the calling tool may name
|
|
61
|
+
* itself ("call this tool again").
|
|
34
62
|
*/
|
|
35
63
|
export declare function buildNextStepForBuild(build: Pick<Build, 'id' | 'buildNumber' | 'status'>, options: {
|
|
36
64
|
loadedToolNames: readonly string[];
|
|
37
|
-
nonTerminalNextStep
|
|
65
|
+
nonTerminalNextStep?: string;
|
|
38
66
|
}): string;
|
|
39
67
|
/**
|
|
40
68
|
* The response every tool that reports a build returns: the JSON first, then the summary with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_helpers.d.ts","sourceRoot":"","sources":["../../../src/tools/builds/build_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"build_helpers.d.ts","sourceRoot":"","sources":["../../../src/tools/builds/build_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAqB,KAAK,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,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AM,CAgBR;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACrC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,KAAK,CAAC,EAAE;YAAE,eAAe,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB,GAAG,YAAY,CAOf;AAOD;;;;GAIG;AACH,wBAAsB,YAAY,CAC9B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;CAAE,GAC9F,OAAO,CAAC,KAAK,GAAG,OAAO,KAAK,CAAC,CAiB/B"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { HELPER_TOOLS } from '../../const.js';
|
|
3
3
|
import { buildConsoleBuildUrl } from '../../utils/console_link.js';
|
|
4
|
+
import { logHttpError } from '../../utils/logging.js';
|
|
4
5
|
import { respondOk } from '../../utils/mcp.js';
|
|
5
6
|
import { formatBuildStatusMessage, TERMINAL_RUN_STATUSES } from '../../utils/progress.js';
|
|
6
7
|
import { ABORT, raceAbort, toIsoString, WAIT_SECS_MAX } from '../actors/actor_run_response.js';
|
|
7
8
|
import { apifyConsoleLinkText } from '../storage/storage_helpers.js';
|
|
9
|
+
/** The MAJOR.MINOR numbers of the Actor's versions; a version document without one is skipped. */
|
|
10
|
+
export function listVersionNumbers(actor) {
|
|
11
|
+
return actor.versions.flatMap((version) => { var _a; return (_a = version.versionNumber) !== null && _a !== void 0 ? _a : []; });
|
|
12
|
+
}
|
|
8
13
|
/** The build tools wait this long by default, the same as `get-actor-run` and `call-actor`, so a loop of build and run calls behaves alike. */
|
|
9
14
|
export const BUILD_WAIT_SECS_DEFAULT = 30;
|
|
10
15
|
/**
|
|
@@ -23,10 +28,10 @@ export function buildWaitSecsField(zeroMeans) {
|
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* The build subset returned by the build tools. Allowlisted so internal fields on the API
|
|
26
|
-
* document (userId, meta, options, inspectorId) never reach the client.
|
|
27
|
-
*
|
|
31
|
+
* document (userId, meta, options, inspectorId) never reach the client. get-actor-build-list returns
|
|
32
|
+
* it as is; get-actor-build and build-actor add the Console link (`toBuildResult`).
|
|
28
33
|
*/
|
|
29
|
-
export function
|
|
34
|
+
export function toBuildItem(build) {
|
|
30
35
|
var _a, _b;
|
|
31
36
|
return {
|
|
32
37
|
id: build.id,
|
|
@@ -36,17 +41,62 @@ export function toBuildResult(build, linkContext) {
|
|
|
36
41
|
// Normalized because the client parses these into `Date` objects; the output schema promises strings.
|
|
37
42
|
startedAt: (_a = toIsoString(build.startedAt)) !== null && _a !== void 0 ? _a : null,
|
|
38
43
|
finishedAt: (_b = toIsoString(build.finishedAt)) !== null && _b !== void 0 ? _b : null,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `toBuildItem` plus `apifyConsoleUrl`, which is set only for Console UI token sessions
|
|
48
|
+
* (see `getConsoleLinkContext`).
|
|
49
|
+
*/
|
|
50
|
+
export function toBuildResult(build, linkContext) {
|
|
51
|
+
return {
|
|
52
|
+
...toBuildItem(build),
|
|
39
53
|
apifyConsoleUrl: buildConsoleBuildUrl(linkContext, build.actId, build.buildNumber),
|
|
40
54
|
};
|
|
41
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Aborts a build the tool started when the client cancels the request, the way `call-actor` aborts its
|
|
58
|
+
* run. Failures are logged and swallowed so a transient API error does not override the cancellation.
|
|
59
|
+
*/
|
|
60
|
+
async function abortBuildOnSignal(buildId, client) {
|
|
61
|
+
await client
|
|
62
|
+
.build(buildId)
|
|
63
|
+
.abort()
|
|
64
|
+
.catch((error) => {
|
|
65
|
+
logHttpError(error, 'Error aborting Actor build', { buildId });
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Starts a build of an Actor version and waits up to `waitSecs` for it to finish, reporting progress
|
|
70
|
+
* meanwhile. The wait is raced against `signal`; a cancelled request aborts the build it started and
|
|
71
|
+
* resolves to {@link ABORT}, so a build nobody waits for does not run on, the same as `call-actor`
|
|
72
|
+
* does with its run.
|
|
73
|
+
*/
|
|
74
|
+
export async function startBuild(client, actorId, versionNumber, options) {
|
|
75
|
+
const { tag, useCache, waitSecs, signal, progressTracker } = options;
|
|
76
|
+
const started = await client
|
|
77
|
+
.actor(actorId)
|
|
78
|
+
.build(versionNumber, { ...(tag !== undefined && { tag }), useCache });
|
|
79
|
+
// The cancel can arrive while the start call is in flight; the build exists by then.
|
|
80
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
81
|
+
await abortBuildOnSignal(started.id, client);
|
|
82
|
+
return ABORT;
|
|
83
|
+
}
|
|
84
|
+
if (waitSecs === 0)
|
|
85
|
+
return started;
|
|
86
|
+
const finished = await waitForBuild(client, started, { waitSecs, signal, progressTracker });
|
|
87
|
+
if (finished === ABORT)
|
|
88
|
+
await abortBuildOnSignal(started.id, client);
|
|
89
|
+
return finished;
|
|
90
|
+
}
|
|
42
91
|
/**
|
|
43
92
|
* The one next step after a build reaches `status`, shared by every tool that reports a build.
|
|
44
93
|
* Sibling tools are named only when the session was served them (`loadedToolNames`), and each hint
|
|
45
|
-
* keeps a fallback so the text is never a dead end.
|
|
46
|
-
* because only the calling tool may name
|
|
94
|
+
* keeps a fallback so the text is never a dead end. A still-running build points at get-actor-build;
|
|
95
|
+
* only get-actor-build itself passes `nonTerminalNextStep`, because only the calling tool may name
|
|
96
|
+
* itself ("call this tool again").
|
|
47
97
|
*/
|
|
48
98
|
export function buildNextStepForBuild(build, options) {
|
|
49
|
-
const { loadedToolNames
|
|
99
|
+
const { loadedToolNames } = options;
|
|
50
100
|
if (build.status === 'SUCCEEDED') {
|
|
51
101
|
return loadedToolNames.includes(HELPER_TOOLS.ACTOR_CALL)
|
|
52
102
|
? `Run the Actor with ${HELPER_TOOLS.ACTOR_CALL} and set callOptions.build to ${build.buildNumber}.`
|
|
@@ -57,7 +107,11 @@ export function buildNextStepForBuild(build, options) {
|
|
|
57
107
|
? `Read the build log with ${HELPER_TOOLS.ACTOR_BUILD_LOG} using buildId ${build.id}; pass lines 0 for the whole log.`
|
|
58
108
|
: 'Read the build log for the error, fix the source, and build again.';
|
|
59
109
|
}
|
|
60
|
-
|
|
110
|
+
if (options.nonTerminalNextStep !== undefined)
|
|
111
|
+
return options.nonTerminalNextStep;
|
|
112
|
+
return loadedToolNames.includes(HELPER_TOOLS.ACTOR_BUILD_GET)
|
|
113
|
+
? `Check progress with ${HELPER_TOOLS.ACTOR_BUILD_GET} using buildId ${build.id} (it waits up to ${WAIT_SECS_MAX} seconds per call).`
|
|
114
|
+
: 'The build is still running; check its status again in a few seconds.';
|
|
61
115
|
}
|
|
62
116
|
/**
|
|
63
117
|
* The response every tool that reports a build returns: the JSON first, then the summary with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_helpers.js","sourceRoot":"","sources":["../../../src/tools/builds/build_helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"build_helpers.js","sourceRoot":"","sources":["../../../src/tools/builds/build_helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAA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QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,KAAK,CAAC;QAClC,MAAM,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,cAAc,CAAC,wBAAwB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA,CAAC;QAChF,OAAO,OAAO,CAAC;IACnB,CAAC;YAAS,CAAC;QACP,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolEntry } from '../../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* https://docs.apify.com/api/v2/actor-builds-get (all builds of the user)
|
|
4
|
+
* https://docs.apify.com/api/v2/act-builds-get (builds of one Actor, when `actorId` is given)
|
|
5
|
+
*
|
|
6
|
+
* Mirrors get-actor-run-list: `actorId` is an optional filter, not a required argument.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getActorBuildList: ToolEntry;
|
|
9
|
+
//# sourceMappingURL=get_actor_build_list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_actor_build_list.d.ts","sourceRoot":"","sources":["../../../src/tools/builds/get_actor_build_list.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA4C,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAuF3G;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SA4CrB,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HELPER_TOOLS } from '../../const.js';
|
|
3
|
+
import { ALL_TOOLS_PRESENT, TOOL_TYPE } from '../../types.js';
|
|
4
|
+
import { compileSchema, fixZodSchemaRequired } from '../../utils/ajv.js';
|
|
5
|
+
import { respondOk, respondUserError } from '../../utils/mcp.js';
|
|
6
|
+
import { catchNotFound } from '../storage/storage_helpers.js';
|
|
7
|
+
import { getActorBuildListToolOutputSchema } from '../structured_output_schemas.js';
|
|
8
|
+
import { toBuildItem } from './build_helpers.js';
|
|
9
|
+
const getActorBuildListArgs = z.object({
|
|
10
|
+
actorId: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Only list builds of this Actor: its ID, or its full name as username/name or username~name. A name without the username is not enough.'),
|
|
15
|
+
offset: z.number().int().min(0).describe('Number of builds to skip at the start. Default: 0.').default(0),
|
|
16
|
+
limit: z
|
|
17
|
+
.number()
|
|
18
|
+
.int()
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(20)
|
|
21
|
+
.describe('Maximum number of builds to return. Default is 10. Maximum is 20.')
|
|
22
|
+
.default(10),
|
|
23
|
+
// Newest first by default, unlike get-actor-run-list, because the build a caller looks for is
|
|
24
|
+
// usually the latest one (#1407).
|
|
25
|
+
desc: z
|
|
26
|
+
.boolean()
|
|
27
|
+
.describe('If true, the builds are sorted by startedAt, newest first; false sorts oldest first. Default: true.')
|
|
28
|
+
.default(true),
|
|
29
|
+
});
|
|
30
|
+
/** Statuses of a build that ended without succeeding; the next step points at the newest one's log. */
|
|
31
|
+
const FAILED_BUILD_STATUSES = new Set(['FAILED', 'TIMED-OUT', 'ABORTED']);
|
|
32
|
+
/**
|
|
33
|
+
* The one next step after a page of builds. A failed build is the usual reason to list builds, so the
|
|
34
|
+
* newest failed build on the page wins. Sibling tools are named only when the session was served them.
|
|
35
|
+
*/
|
|
36
|
+
function buildNextStepForBuildList(builds, desc, loadedToolNames) {
|
|
37
|
+
const failedBuilds = builds.filter((build) => FAILED_BUILD_STATUSES.has(build.status));
|
|
38
|
+
// The API sorts by startedAt, so the newest failed build leads a descending page and ends an ascending one.
|
|
39
|
+
const newestFailedBuild = desc ? failedBuilds[0] : failedBuilds.at(-1);
|
|
40
|
+
if (newestFailedBuild) {
|
|
41
|
+
return loadedToolNames.includes(HELPER_TOOLS.ACTOR_BUILD_LOG)
|
|
42
|
+
? `Read why build ${newestFailedBuild.buildNumber} failed with ${HELPER_TOOLS.ACTOR_BUILD_LOG} using buildId ${newestFailedBuild.id}.`
|
|
43
|
+
: `Read the log of build ${newestFailedBuild.buildNumber} (ID ${newestFailedBuild.id}) to see why it failed.`;
|
|
44
|
+
}
|
|
45
|
+
// An empty page has no build to check.
|
|
46
|
+
if (builds.length > 0 && loadedToolNames.includes(HELPER_TOOLS.ACTOR_BUILD_GET)) {
|
|
47
|
+
return `Check a build with ${HELPER_TOOLS.ACTOR_BUILD_GET} using its buildId.`;
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
function buildDescription({ hasTool }) {
|
|
52
|
+
return `List the Actor builds of the account, newest first by default. Pass actorId to list only the builds of one Actor, for example to find why its latest build failed. Lists builds in every status; there is no status filter.
|
|
53
|
+
Read-only. Returns total, count, offset, limit, desc and items (id, actorId, buildNumber, status, startedAt, finishedAt)
|
|
54
|
+
and a summary with at most one next step.${hasTool(HELPER_TOOLS.ACTOR_BUILD_GET)
|
|
55
|
+
? ` Check a build with ${HELPER_TOOLS.ACTOR_BUILD_GET} by passing its id as buildId.`
|
|
56
|
+
: ''}${hasTool(HELPER_TOOLS.ACTOR_BUILD_LOG)
|
|
57
|
+
? ` Read why a build failed with ${HELPER_TOOLS.ACTOR_BUILD_LOG} by passing its id as buildId.`
|
|
58
|
+
: ''}
|
|
59
|
+
|
|
60
|
+
USAGE:
|
|
61
|
+
- Use to find the ID of a build that failed or that no run references.
|
|
62
|
+
- Use to see recent builds and their statuses, of one Actor or across the account.
|
|
63
|
+
|
|
64
|
+
USAGE EXAMPLES:
|
|
65
|
+
- user_input: Why did the last build of my-actor fail?
|
|
66
|
+
- user_input: List the builds of john/my-actor`;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* https://docs.apify.com/api/v2/actor-builds-get (all builds of the user)
|
|
70
|
+
* https://docs.apify.com/api/v2/act-builds-get (builds of one Actor, when `actorId` is given)
|
|
71
|
+
*
|
|
72
|
+
* Mirrors get-actor-run-list: `actorId` is an optional filter, not a required argument.
|
|
73
|
+
*/
|
|
74
|
+
export const getActorBuildList = Object.freeze({
|
|
75
|
+
type: TOOL_TYPE.INTERNAL,
|
|
76
|
+
name: HELPER_TOOLS.ACTOR_BUILD_LIST_GET,
|
|
77
|
+
title: 'Get Actor build list',
|
|
78
|
+
description: buildDescription(ALL_TOOLS_PRESENT),
|
|
79
|
+
buildDescription,
|
|
80
|
+
// `fixZodSchemaRequired` strips `offset`, `limit` and `desc` from `required` because they have defaults; no field is required.
|
|
81
|
+
inputSchema: fixZodSchemaRequired(z.toJSONSchema(getActorBuildListArgs)),
|
|
82
|
+
outputSchema: getActorBuildListToolOutputSchema,
|
|
83
|
+
ajvValidate: compileSchema(z.toJSONSchema(getActorBuildListArgs)),
|
|
84
|
+
annotations: {
|
|
85
|
+
title: 'Get Actor build list',
|
|
86
|
+
readOnlyHint: true,
|
|
87
|
+
destructiveHint: false,
|
|
88
|
+
idempotentHint: true,
|
|
89
|
+
openWorldHint: false,
|
|
90
|
+
},
|
|
91
|
+
call: async (toolArgs) => {
|
|
92
|
+
const { args, apifyClient: client, loadedToolNames } = toolArgs;
|
|
93
|
+
const parsed = getActorBuildListArgs.parse(args);
|
|
94
|
+
const listOptions = { offset: parsed.offset, limit: parsed.limit, desc: parsed.desc };
|
|
95
|
+
const builds = parsed.actorId
|
|
96
|
+
? await catchNotFound(client.actor(parsed.actorId).builds().list(listOptions))
|
|
97
|
+
: await client.builds().list(listOptions);
|
|
98
|
+
if (!builds) {
|
|
99
|
+
return respondUserError(`Actor '${parsed.actorId}' not found.`);
|
|
100
|
+
}
|
|
101
|
+
// Cast because the client's item type omits fields the API returns (see `BuildListItem`).
|
|
102
|
+
const items = builds.items;
|
|
103
|
+
const structuredContent = {
|
|
104
|
+
total: builds.total,
|
|
105
|
+
count: builds.count,
|
|
106
|
+
offset: builds.offset,
|
|
107
|
+
limit: builds.limit,
|
|
108
|
+
desc: builds.desc,
|
|
109
|
+
items: items.map(toBuildItem),
|
|
110
|
+
};
|
|
111
|
+
const owner = parsed.actorId ? `Actor ${parsed.actorId}` : 'Your account';
|
|
112
|
+
const summary = `${owner} has ${builds.total} ${builds.total === 1 ? 'build' : 'builds'}; showing ${builds.count} from offset ${builds.offset}.`;
|
|
113
|
+
const nextStep = buildNextStepForBuildList(items, builds.desc, loadedToolNames);
|
|
114
|
+
return respondOk([JSON.stringify(structuredContent), nextStep ? `${summary}\n${nextStep}` : summary], {
|
|
115
|
+
structuredContent,
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=get_actor_build_list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_actor_build_list.js","sourceRoot":"","sources":["../../../src/tools/builds/get_actor_build_list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACL,wIAAwI,CAC3I;IACL,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC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gB,MAAM,CAAC,MAAM,GAAG,CAAC;QACjJ,MAAM,QAAQ,GAAG,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAChF,OAAO,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;YAClG,iBAAiB;SACpB,CAAC,CAAC;IACP,CAAC;CACK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAqC1C,kEAAkE;AAClE,eAAO,MAAM,cAAc;;;;;;;;;CAkBY,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,cAAc,EAAkC,CAAC,MAAM,OAAO,cAAc,CAAC,EAAE,CAAC;AAE7F,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAmC,CAAC;AAEtF,mEAAmE;AACnE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAEnF,0IAA0I;AAC1I,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,WAAiC,GAAG,eAAe,CAE1F;AAED,eAAO,MAAM,8BAA8B,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,EAAuB,CAAC;AAEpG,wHAAwH;AACxH,eAAO,MAAM,gBAAgB,EAAE,SAAS,SAAS,EAKhD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,cAAc,EAAE,SAAS,CAGrE,CAAC"}
|
package/dist/tools/registry.js
CHANGED
|
@@ -19,7 +19,9 @@ import { SERVER_MODE } from '../types.js';
|
|
|
19
19
|
import { callActor } from './actors/call_actor.js';
|
|
20
20
|
import { fetchActorDetails } from './actors/fetch_actor_details.js';
|
|
21
21
|
import { searchActors } from './actors/search_actors.js';
|
|
22
|
+
import { buildActor } from './builds/build_actor.js';
|
|
22
23
|
import { getActorBuild } from './builds/get_actor_build.js';
|
|
24
|
+
import { getActorBuildList } from './builds/get_actor_build_list.js';
|
|
23
25
|
import { getActorBuildLog } from './builds/get_actor_build_log.js';
|
|
24
26
|
import { reportProblem } from './dev/report_problem.js';
|
|
25
27
|
import { fetchApifyDocs } from './docs/fetch_apify_docs.js';
|
|
@@ -66,7 +68,7 @@ export const toolCategories = {
|
|
|
66
68
|
],
|
|
67
69
|
tasks: [createActorTask, getActorTask, updateActorTask, publishActorTask, unpublishActorTask],
|
|
68
70
|
schedules: [createSchedule, getSchedule, updateSchedule, deleteSchedule],
|
|
69
|
-
builds: [getActorBuild, getActorBuildLog],
|
|
71
|
+
builds: [getActorBuild, getActorBuildLog, getActorBuildList, buildActor],
|
|
70
72
|
dev: [reportProblem],
|
|
71
73
|
};
|
|
72
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"A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AE,cAAc,EAAE,cAAc,CAAC;IACxE,MAAM,EAAE,CAAC,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,CAAC;IACxE,GAAG,EAAE,CAAC,aAAa,CAAC;CACe,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAoC,CAAC;AAE7F,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAS,cAAc,CAAC,CAAC;AAKtF,0IAA0I;AAC1I,MAAM,UAAU,gBAAgB,CAAC,QAAqB,WAAW,CAAC,OAAO;IACrE,OAAO,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAoB,CAAC;AAClH,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAsC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAEpG,wHAAwH;AACxH,MAAM,CAAC,MAAM,gBAAgB,GAAyB;IAClD,kBAAkB;IAClB,uBAAuB;IACvB,eAAe;IACf,iBAAiB;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA2C,IAAI,GAAG,CAAC;IAC/E,CAAC,YAAY,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC/C,CAAC,YAAY,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;CAC5D,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_actor_run_list.d.ts","sourceRoot":"","sources":["../../../src/tools/runs/get_actor_run_list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,SAAS,EAAmB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"get_actor_run_list.d.ts","sourceRoot":"","sources":["../../../src/tools/runs/get_actor_run_list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAoB,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAoCnF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SA8CnB,CAAC"}
|
|
@@ -10,7 +10,7 @@ const getUserRunsListArgs = z.object({
|
|
|
10
10
|
.string()
|
|
11
11
|
.min(1)
|
|
12
12
|
.optional()
|
|
13
|
-
.describe('Only list runs of this Actor
|
|
13
|
+
.describe('Only list runs of this Actor: its ID, or its full name as username/name or username~name. A name without the username is not enough.'),
|
|
14
14
|
offset: z
|
|
15
15
|
.number()
|
|
16
16
|
.describe('Number of array elements that should be skipped at the start. The default value is 0.')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_actor_run_list.js","sourceRoot":"","sources":["../../../src/tools/runs/get_actor_run_list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,
|
|
1
|
+
{"version":3,"file":"get_actor_run_list.js","sourceRoot":"","sources":["../../../src/tools/runs/get_actor_run_list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA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