agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,73 @@
import type * as ec2 from '../../../aws-ec2';
import * as sfn from '../../../aws-stepfunctions';
import type { Duration } from '../../../core';
/**
* The overrides that should be sent to a container.
*/
export interface ContainerOverrides {
/**
* The command to send to the container that overrides
* the default command from the Docker image or the job definition.
*
* @default - No command overrides
*/
readonly command?: string[];
/**
* The environment variables to send to the container.
* You can add new environment variables, which are added to the container
* at launch, or you can override the existing environment variables from
* the Docker image or the job definition.
*
* @default - No environment overrides
*/
readonly environment?: {
[key: string]: string;
};
/**
* The instance type to use for a multi-node parallel job.
* This parameter is not valid for single-node container jobs.
*
* @default - No instance type overrides
*/
readonly instanceType?: ec2.InstanceType;
/**
* The number of MiB of memory reserved for the job.
* This value overrides the value set in the job definition.
*
* @default - No memory overrides
*/
readonly memory?: number;
/**
* The number of physical GPUs to reserve for the container.
* The number of GPUs reserved for all containers in a job
* should not exceed the number of available GPUs on the compute
* resource that the job is launched on.
*
* @default - No GPU reservation
*/
readonly gpuCount?: number;
/**
* The number of vCPUs to reserve for the container.
* This value overrides the value set in the job definition.
*
* @default - No vCPUs overrides
*/
readonly vcpus?: number;
}
/**
* An object representing an AWS Batch job dependency.
*/
export interface JobDependency {
/**
* The job ID of the AWS Batch job associated with this dependency.
*
* @default - No jobId
*/
readonly jobId?: string;
/**
* The type of the job dependency.
*
* @default - No type
*/
readonly type?: string;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RunBatchJob=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},sfn=()=>{var tmp=require("../../../aws-stepfunctions");return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},resource_arn_suffix_1=()=>{var tmp=require("../resource-arn-suffix");return resource_arn_suffix_1=()=>tmp,tmp};class RunBatchJob{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.RunBatchJob",version:"2.252.0"};integrationPattern;constructor(props){if(this.props=props,this.integrationPattern=props.integrationPattern||sfn().ServiceIntegrationPattern.SYNC,![sfn().ServiceIntegrationPattern.FIRE_AND_FORGET,sfn().ServiceIntegrationPattern.SYNC].includes(this.integrationPattern))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidServiceIntegrationPattern`,`Invalid Service Integration Pattern: ${this.integrationPattern} is not supported to call RunBatchJob.`);if((0,core_1().withResolved)(props.arraySize,arraySize=>{if(arraySize!==void 0&&(arraySize<2||arraySize>1e4))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeArraysizeBetween`,`arraySize must be between 2 and 10,000. Received ${arraySize}.`)}),props.dependsOn&&props.dependsOn.length>20)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeDependenciesLess`,`dependencies must be 20 or less. Received ${props.dependsOn.length}.`);(0,core_1().withResolved)(props.attempts,attempts=>{if(attempts!==void 0&&(attempts<1||attempts>10))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeAttemptsBetween`,`attempts must be between 1 and 10. Received ${attempts}.`)}),props.timeout!==void 0&&(0,core_1().withResolved)(props.timeout.toSeconds(),timeout=>{if(timeout<60)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeTimeoutGreaterThan`,`timeout must be greater than 60 seconds. Received ${timeout} seconds.`)}),props.containerOverrides?.environment&&Object.keys(props.containerOverrides.environment).forEach(key=>{if(key.match(/^AWS_BATCH/))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidEnvironmentVariableName`,`Invalid environment variable name: ${key}. Environment variable names starting with 'AWS_BATCH' are reserved.`)})}bind(_task){return{resourceArn:(0,resource_arn_suffix_1().getResourceArn)("batch","submitJob",this.integrationPattern),policyStatements:this.configurePolicyStatements(_task),parameters:{JobDefinition:this.props.jobDefinitionArn,JobName:this.props.jobName,JobQueue:this.props.jobQueueArn,Parameters:this.props.payload,ArrayProperties:this.props.arraySize!==void 0?{Size:this.props.arraySize}:void 0,ContainerOverrides:this.props.containerOverrides?this.configureContainerOverrides(this.props.containerOverrides):void 0,DependsOn:this.props.dependsOn?this.props.dependsOn.map(jobDependency=>({JobId:jobDependency.jobId,Type:jobDependency.type})):void 0,RetryStrategy:this.props.attempts!==void 0?{Attempts:this.props.attempts}:void 0,Timeout:this.props.timeout?{AttemptDurationSeconds:this.props.timeout.toSeconds()}:void 0}}}configurePolicyStatements(task){return[new(iam()).PolicyStatement({resources:[core_1().Stack.of(task).formatArn({service:"batch",resource:"job-definition",resourceName:"*"}),this.props.jobQueueArn],actions:["batch:SubmitJob"]}),new(iam()).PolicyStatement({resources:[core_1().Stack.of(task).formatArn({service:"events",resource:"rule/StepFunctionsGetEventsForBatchJobsRule"})],actions:["events:PutTargets","events:PutRule","events:DescribeRule"]})]}configureContainerOverrides(containerOverrides){let environment;containerOverrides.environment&&(environment=Object.entries(containerOverrides.environment).map(([key,value])=>({Name:key,Value:value})));let resources;return containerOverrides.gpuCount&&(resources=[{Type:"GPU",Value:`${containerOverrides.gpuCount}`}]),{Command:containerOverrides.command,Environment:environment,InstanceType:containerOverrides.instanceType?.toString(),Memory:containerOverrides.memory,ResourceRequirements:resources,Vcpus:containerOverrides.vcpus}}}exports.RunBatchJob=RunBatchJob;

View File

@@ -0,0 +1,187 @@
import type { Construct } from 'constructs';
import type * as ec2 from '../../../aws-ec2';
import * as iam from '../../../aws-iam';
import * as sfn from '../../../aws-stepfunctions';
import type { Size } from '../../../core';
/**
* The overrides that should be sent to a container.
*/
export interface BatchContainerOverrides {
/**
* The command to send to the container that overrides
* the default command from the Docker image or the job definition.
*
* @default - No command overrides
*/
readonly command?: string[];
/**
* The environment variables to send to the container.
* You can add new environment variables, which are added to the container
* at launch, or you can override the existing environment variables from
* the Docker image or the job definition.
*
* @default - No environment overrides
*/
readonly environment?: {
[key: string]: string;
};
/**
* The instance type to use for a multi-node parallel job.
* This parameter is not valid for single-node container jobs.
*
* @default - No instance type overrides
*/
readonly instanceType?: ec2.InstanceType;
/**
* Memory reserved for the job.
*
* @default - No memory overrides. The memory supplied in the job definition will be used.
*/
readonly memory?: Size;
/**
* The number of physical GPUs to reserve for the container.
* The number of GPUs reserved for all containers in a job
* should not exceed the number of available GPUs on the compute
* resource that the job is launched on.
*
* @default - No GPU reservation
*/
readonly gpuCount?: number;
/**
* The number of vCPUs to reserve for the container.
* This value overrides the value set in the job definition.
*
* @default - No vCPUs overrides
*/
readonly vcpus?: number;
}
/**
* An object representing an AWS Batch job dependency.
*/
export interface BatchJobDependency {
/**
* The job ID of the AWS Batch job associated with this dependency.
*
* @default - No jobId
*/
readonly jobId?: string;
/**
* The type of the job dependency.
*
* @default - No type
*/
readonly type?: string;
}
interface BatchSubmitJobOptions {
/**
* The arn of the job definition used by this job.
*/
readonly jobDefinitionArn: string;
/**
* The name of the job.
* The first character must be alphanumeric, and up to 128 letters (uppercase and lowercase),
* numbers, hyphens, and underscores are allowed.
*/
readonly jobName: string;
/**
* The arn of the job queue into which the job is submitted.
*/
readonly jobQueueArn: string;
/**
* The array size can be between 2 and 10,000.
* If you specify array properties for a job, it becomes an array job.
* For more information, see Array Jobs in the AWS Batch User Guide.
*
* @default - No array size
*/
readonly arraySize?: number;
/**
* A list of container overrides in JSON format that specify the name of a container
* in the specified job definition and the overrides it should receive.
*
* @see https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitJob.html#Batch-SubmitJob-request-containerOverrides
*
* @default - No container overrides
*/
readonly containerOverrides?: BatchContainerOverrides;
/**
* A list of dependencies for the job.
* A job can depend upon a maximum of 20 jobs.
*
* @see https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitJob.html#Batch-SubmitJob-request-dependsOn
*
* @default - No dependencies
*/
readonly dependsOn?: BatchJobDependency[];
/**
* The payload to be passed as parameters to the batch job
*
* @default - No parameters are passed
*/
readonly payload?: sfn.TaskInput;
/**
* The number of times to move a job to the RUNNABLE status.
* You may specify between 1 and 10 attempts.
* If the value of attempts is greater than one,
* the job is retried on failure the same number of attempts as the value.
*
* @default 1
*/
readonly attempts?: number;
/**
* The tags applied to the job request.
*
* @default {} - no tags
*/
readonly tags?: {
[key: string]: string;
};
}
/**
* Properties for BatchSubmitJob using JSONPath
*/
export interface BatchSubmitJobJsonPathProps extends sfn.TaskStateJsonPathBaseProps, BatchSubmitJobOptions {
}
/**
* Properties for BatchSubmitJob using JSONata
*/
export interface BatchSubmitJobJsonataProps extends sfn.TaskStateJsonataBaseProps, BatchSubmitJobOptions {
}
/**
* Properties for BatchSubmitJob
*/
export interface BatchSubmitJobProps extends sfn.TaskStateBaseProps, BatchSubmitJobOptions {
}
/**
* Task to submits an AWS Batch job from a job definition.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-batch.html
*/
export declare class BatchSubmitJob extends sfn.TaskStateBase {
private readonly props;
/**
* Task to submits an AWS Batch job from a job definition using JSONPath.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-batch.html
*/
static jsonPath(scope: Construct, id: string, props: BatchSubmitJobJsonPathProps): BatchSubmitJob;
/**
* Task to submits an AWS Batch job from a job definition using JSONata.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-batch.html
*/
static jsonata(scope: Construct, id: string, props: BatchSubmitJobJsonataProps): BatchSubmitJob;
private static readonly SUPPORTED_INTEGRATION_PATTERNS;
protected readonly taskMetrics?: sfn.TaskMetricsConfig;
protected readonly taskPolicies?: iam.PolicyStatement[];
private readonly integrationPattern;
constructor(scope: Construct, id: string, props: BatchSubmitJobProps);
/**
* @internal
*/
protected _renderTask(topLevelQueryLanguage?: sfn.QueryLanguage): any;
private configurePolicyStatements;
private configureContainerOverrides;
private validateTags;
}
export {};

File diff suppressed because one or more lines are too long