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,126 @@
import type { Construct } from 'constructs';
import type * as events from '../../../aws-events';
import * as iam from '../../../aws-iam';
import * as sfn from '../../../aws-stepfunctions';
/**
* The style used when applying URL encoding to array values.
*/
export declare enum URLEncodingFormat {
/**
* Encode arrays using brackets. For example, {'array': ['a','b','c']} encodes to 'array[]=a&array[]=b&array[]=c'
*/
BRACKETS = "BRACKETS",
/**
* Encode arrays using commas. For example, {'array': ['a','b','c']} encodes to 'array=a,b,c,d'
*/
COMMAS = "COMMAS",
/**
* Apply the default URL encoding style (INDICES).
*/
DEFAULT = "DEFAULT",
/**
* Encode arrays using the index value. For example, {'array': ['a','b','c']} encodes to 'array[0]=a&array[1]=b&array[2]=c'
*/
INDICES = "INDICES",
/**
* Do not apply URL encoding.
*/
NONE = "NONE",
/**
* Repeat key for each item in the array. For example, {'array': ['a','b','c']} encodes to 'array[]=a&array[]=b&array[]=c'
*/
REPEAT = "REPEAT"
}
interface HttpInvokeOptions {
/**
* Permissions are granted to call all resources under this path.
*
* @example 'https://api.example.com'
*/
readonly apiRoot: string;
/**
* The API endpoint to call, relative to `apiRoot`.
* @example sfn.TaskInput.fromText('path/to/resource')
*/
readonly apiEndpoint: sfn.TaskInput;
/**
* The HTTP method to use.
*
* @example sfn.TaskInput.fromText('GET')
*/
readonly method: sfn.TaskInput;
/**
* The EventBridge Connection to use for authentication.
*/
readonly connection: events.IConnection;
/**
* The body to send to the HTTP endpoint.
*
* @default - No body is sent with the request.
*/
readonly body?: sfn.TaskInput;
/**
* The headers to send to the HTTP endpoint.
*
* @example sfn.TaskInput.fromObject({ 'Content-Type': 'application/json' })
*
* @default - No additional headers are added to the request.
*/
readonly headers?: sfn.TaskInput;
/**
* The query string parameters to send to the HTTP endpoint.
* @default - No query string parameters are sent in the request.
*/
readonly queryStringParameters?: sfn.TaskInput;
/**
* Determines whether to apply URL encoding to the request body, and which array encoding format to use.
*
* `URLEncodingFormat.NONE` passes the JSON-serialized `RequestBody` field as the HTTP request body.
* Otherwise, the HTTP request body is the URL-encoded form data of the `RequestBody` field using the
* specified array encoding format, and the `Content-Type` header is set to `application/x-www-form-urlencoded`.
*
* @default - URLEncodingFormat.NONE
*/
readonly urlEncodingFormat?: URLEncodingFormat;
}
/**
* Properties for calling an external HTTP endpoint with HttpInvoke using JSONPath.
*/
export interface HttpInvokeJsonPathProps extends sfn.TaskStateJsonPathBaseProps, HttpInvokeOptions {
}
/**
* Properties for calling an external HTTP endpoint with HttpInvoke using JSONata.
*/
export interface HttpInvokeJsonataProps extends sfn.TaskStateJsonataBaseProps, HttpInvokeOptions {
}
/**
* Properties for calling an external HTTP endpoint with HttpInvoke.
*/
export interface HttpInvokeProps extends sfn.TaskStateBaseProps, HttpInvokeOptions {
}
/**
* A Step Functions Task to call a public third-party API.
*/
export declare class HttpInvoke extends sfn.TaskStateBase {
private readonly props;
/**
* A Step Functions Task to call a public third-party API using JSONPath.
*/
static jsonPath(scope: Construct, id: string, props: HttpInvokeJsonPathProps): HttpInvoke;
/**
* A Step Functions Task to call a public third-party API using JSONata.
*/
static jsonata(scope: Construct, id: string, props: HttpInvokeJsonataProps): HttpInvoke;
protected readonly taskMetrics?: sfn.TaskMetricsConfig;
protected readonly taskPolicies?: iam.PolicyStatement[];
constructor(scope: Construct, id: string, props: HttpInvokeProps);
/**
* Provides the HTTP Invoke service integration task configuration.
*
* @internal
*/
protected _renderTask(topLevelQueryLanguage?: sfn.QueryLanguage): any;
protected buildTaskPolicyStatements(): iam.PolicyStatement[];
private buildTaskParameters;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpInvoke=exports.URLEncodingFormat=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};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},jsonata_1=()=>{var tmp=require("../../../aws-stepfunctions/lib/private/jsonata");return jsonata_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},cxapi=()=>{var tmp=require("../../../cx-api");return cxapi=()=>tmp,tmp},task_utils_1=()=>{var tmp=require("../private/task-utils");return task_utils_1=()=>tmp,tmp},URLEncodingFormat;(function(URLEncodingFormat2){URLEncodingFormat2.BRACKETS="BRACKETS",URLEncodingFormat2.COMMAS="COMMAS",URLEncodingFormat2.DEFAULT="DEFAULT",URLEncodingFormat2.INDICES="INDICES",URLEncodingFormat2.NONE="NONE",URLEncodingFormat2.REPEAT="REPEAT"})(URLEncodingFormat||(exports.URLEncodingFormat=URLEncodingFormat={}));class HttpInvoke extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.HttpInvoke",version:"2.252.0"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_HttpInvokeJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new HttpInvoke(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_HttpInvokeJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new HttpInvoke(scope,id,{...props,queryLanguage:sfn().QueryLanguage.JSONATA})}taskMetrics;taskPolicies;constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_HttpInvokeProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,HttpInvoke),error}this.taskPolicies=this.buildTaskPolicyStatements()}_renderTask(topLevelQueryLanguage){const queryLanguage=sfn()._getActualQueryLanguage(topLevelQueryLanguage,this.props.queryLanguage);return{Resource:(0,task_utils_1().integrationResourceArn)("http","invoke"),...this._renderParametersOrArguments(this.buildTaskParameters(),queryLanguage)}}buildTaskPolicyStatements(){return[new(iam()).PolicyStatement({actions:["events:RetrieveConnectionCredentials"],resources:[this.props.connection.connectionArn]}),new(iam()).PolicyStatement({actions:["secretsmanager:GetSecretValue","secretsmanager:DescribeSecret"],resources:[this.props.connection.connectionSecretArn]}),new(iam()).PolicyStatement({actions:["states:InvokeHTTPEndpoint"],resources:["*"],conditions:{StringLike:{"states:HTTPEndpoint":`${(0,jsonata_1().isValidJsonataExpression)(this.props.apiRoot)?"":this.props.apiRoot}*`}}})]}buildTaskParameters(){const unJsonata=v=>v.replace(/^{%/,"").replace(/%}$/,"").trim(),useJsonata=this.queryLanguage===sfn().QueryLanguage.JSONATA,getStringValue=v=>useJsonata&&!(0,jsonata_1().isValidJsonataExpression)(v)?`'${v}'`:unJsonata(v),parameters={ApiEndpoint:useJsonata?`{% ${getStringValue(this.props.apiRoot)} & '/' & ${getStringValue(this.props.apiEndpoint.value)} %}`:core_1().FeatureFlags.of(this).isEnabled(cxapi().STEPFUNCTIONS_TASKS_HTTPINVOKE_DYNAMIC_JSONPATH_ENDPOINT)?sfn().JsonPath.format("{}/{}",this.props.apiRoot,this.props.apiEndpoint.value):`${this.props.apiRoot}/${this.props.apiEndpoint.value}`,Authentication:{ConnectionArn:this.props.connection.connectionArn},Method:this.props.method.value,Headers:this.props.headers?.value,RequestBody:this.props.body?.value,QueryParameters:this.props.queryStringParameters?.value};return this.props.urlEncodingFormat!=null&&this.props.urlEncodingFormat!==URLEncodingFormat.NONE&&(parameters.Headers={...parameters.Headers,"Content-Type":"application/x-www-form-urlencoded"},parameters.Transform={RequestBodyEncoding:"URL_ENCODED"},this.props.urlEncodingFormat!==URLEncodingFormat.DEFAULT&&(parameters.Transform.RequestEncodingOptions={ArrayFormat:this.props.urlEncodingFormat})),parameters}}exports.HttpInvoke=HttpInvoke;