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,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.autoscaling.common"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.AutoScaling.Common"
},
"python": {
"module": "aws_cdk.aws_autoscaling_common"
}
}
}

View File

@@ -0,0 +1,8 @@
# AWS AutoScaling Common Library
This is a sister package to `aws-cdk-lib/aws-autoscaling` and
`aws-cdk-lib/aws-applicationautoscaling`. It contains shared implementation
details between them.
It does not need to be used directly.

View File

@@ -0,0 +1 @@
export * from './lib';

View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.normalizeIntervals=void 0,Object.defineProperty(exports,_noFold="normalizeIntervals",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").normalizeIntervals;return Object.defineProperty(exports,_noFold="normalizeIntervals",{enumerable:!0,configurable:!0,value}),value}}),exports.findAlarmThresholds=void 0,Object.defineProperty(exports,_noFold="findAlarmThresholds",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").findAlarmThresholds;return Object.defineProperty(exports,_noFold="findAlarmThresholds",{enumerable:!0,configurable:!0,value}),value}}),exports.generateArbitraryIntervals=void 0,Object.defineProperty(exports,_noFold="generateArbitraryIntervals",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").generateArbitraryIntervals;return Object.defineProperty(exports,_noFold="generateArbitraryIntervals",{enumerable:!0,configurable:!0,value}),value}});

View File

@@ -0,0 +1,3 @@
export * from './types';
export * from './interval-utils';
export * from './test-utils';

View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.normalizeIntervals=void 0,Object.defineProperty(exports,_noFold="normalizeIntervals",{enumerable:!0,configurable:!0,get:()=>{var value=require("./interval-utils").normalizeIntervals;return Object.defineProperty(exports,_noFold="normalizeIntervals",{enumerable:!0,configurable:!0,value}),value}}),exports.findAlarmThresholds=void 0,Object.defineProperty(exports,_noFold="findAlarmThresholds",{enumerable:!0,configurable:!0,get:()=>{var value=require("./interval-utils").findAlarmThresholds;return Object.defineProperty(exports,_noFold="findAlarmThresholds",{enumerable:!0,configurable:!0,value}),value}}),exports.generateArbitraryIntervals=void 0,Object.defineProperty(exports,_noFold="generateArbitraryIntervals",{enumerable:!0,configurable:!0,get:()=>{var value=require("./test-utils").generateArbitraryIntervals;return Object.defineProperty(exports,_noFold="generateArbitraryIntervals",{enumerable:!0,configurable:!0,value}),value}});

View File

@@ -0,0 +1,21 @@
import type { ScalingInterval } from './types';
export interface CompleteScalingInterval {
readonly lower: number;
readonly upper: number;
readonly change?: number;
}
/**
* Normalize the given interval set to cover the complete number line and make sure it has at most one gap
*/
export declare function normalizeIntervals(intervals: ScalingInterval[], changesAreAbsolute: boolean): CompleteScalingInterval[];
export interface Alarms {
readonly lowerAlarmIntervalIndex?: number;
readonly upperAlarmIntervalIndex?: number;
}
/**
* Locate the intervals that should have the alarm thresholds, by index.
*
* Pick the intervals on either side of the singleton "undefined" interval, or
* pick the middle interval if there's no such interval.
*/
export declare function findAlarmThresholds(intervals: CompleteScalingInterval[]): Alarms;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.normalizeIntervals=normalizeIntervals,exports.findAlarmThresholds=findAlarmThresholds;var 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};function normalizeIntervals(intervals,changesAreAbsolute){const full=orderAndCompleteIntervals(intervals);return makeGapsUndefined(full),changesAreAbsolute||makeZerosUndefined(full),combineUndefineds(full),validateAtMostOneUndefined(full),full}function orderAndCompleteIntervals(intervals){if(intervals.length<2)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`RequireLeastIntervals`,"Require at least 2 intervals");for(const interval of intervals)if(interval.lower===void 0&&interval.upper===void 0)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`SupplyLeastUpperLower`,`Must supply at least one of 'upper' or 'lower', got: ${JSON.stringify(interval)}`);for(intervals=intervals.map(x=>({...x})),intervals.sort(comparatorFromKey(x=>x.lower??x.upper));propagateBounds(intervals););const lastIndex=intervals.length-1;intervals[0].lower===void 0&&(intervals[0]={...intervals[0],lower:0}),intervals[lastIndex].upper===void 0&&(intervals[lastIndex]={...intervals[lastIndex],upper:1/0});for(const interval of intervals)if(interval.lower===void 0||interval.upper===void 0)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CouldDetermineLowerUpper`,`Could not determine the lower and upper bounds for ${JSON.stringify(interval)}`);const completeIntervals=intervals;for(let i=0;i<completeIntervals.length-1;i++)if(overlap(completeIntervals[i],completeIntervals[i+1]))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`IntervalsOverlap`,`Two intervals overlap: ${JSON.stringify(completeIntervals[i])} and ${JSON.stringify(completeIntervals[i+1])}`);return completeIntervals}function makeGapsUndefined(intervals){intervals[0].lower!==0&&intervals.splice(0,0,{lower:0,upper:intervals[0].lower,change:void 0}),last(intervals).upper!==1/0&&intervals.push({lower:last(intervals).upper,upper:1/0,change:void 0});let i=1;for(;i<intervals.length;)intervals[i-1].upper<intervals[i].lower?intervals.splice(i,0,{lower:intervals[i-1].upper,upper:intervals[i].lower,change:void 0}):i++}function makeZerosUndefined(intervals){for(let i=0;i<intervals.length;++i){const interval=intervals[i];interval.change===0&&(intervals[i]={...interval,change:void 0})}}function combineUndefineds(intervals){let i=0;for(;i<intervals.length-1;)intervals[i].change===void 0&&intervals[i+1].change===void 0?(intervals[i]={...intervals[i],upper:intervals[i+1].upper},intervals.splice(i+1,1)):i++}function validateAtMostOneUndefined(intervals){const undef=intervals.filter(x=>x.change===void 0);if(undef.length>1)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MostNoChangeInterval`,`Can have at most one no-change interval, got ${JSON.stringify(undef)}`)}function comparatorFromKey(keyFn){return(a,b)=>{const keyA=keyFn(a),keyB=keyFn(b);return keyA<keyB?-1:keyA===keyB?0:1}}function propagateBounds(intervals){let ret=!1;for(let i=0;i<intervals.length-1;i++)intervals[i].upper!==void 0&&intervals[i+1].lower===void 0&&(intervals[i+1]={...intervals[i+1],lower:intervals[i].upper},ret=!0);for(let i=intervals.length-1;i>=1;i--)intervals[i].lower!==void 0&&intervals[i-1].upper===void 0&&(intervals[i-1]={...intervals[i-1],upper:intervals[i].lower},ret=!0);return ret}function overlap(a,b){return a.lower<b.upper&&a.upper>b.lower}function last(xs){return xs[xs.length-1]}function findAlarmThresholds(intervals){const gapIndex=intervals.findIndex(x=>x.change===void 0);if(gapIndex!==-1)return{lowerAlarmIntervalIndex:gapIndex>0?gapIndex-1:void 0,upperAlarmIntervalIndex:gapIndex<intervals.length-1?gapIndex+1:void 0};if(intervals.length===1)return{upperAlarmIntervalIndex:0};const middleIndex=Math.floor(intervals.length/2);return{lowerAlarmIntervalIndex:middleIndex-1,upperAlarmIntervalIndex:middleIndex}}

View File

@@ -0,0 +1,21 @@
import type * as appscaling from '../lib';
/**
* Arbitrary (valid) array of intervals
*
* There are many invalid combinations of interval arrays, so we have
* to be very specific about generating arrays that are valid. We do this
* by taking a full, valid interval schedule and progressively stripping parts
* away from it.
*
* Some of the changes may change its meaning, but we take care to never leave
* a schedule with insufficient information so that the parser will error out.
*/
export declare function generateArbitraryIntervals(mrng: IRandomGenerator): ArbitraryIntervals;
export interface IRandomGenerator {
nextBoolean(): boolean;
nextInt(min: number, max: number): number;
}
export interface ArbitraryIntervals {
readonly absolute: boolean;
readonly intervals: appscaling.ScalingInterval[];
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateArbitraryIntervals=generateArbitraryIntervals;function generateArbitraryIntervals(mrng){const ret=new Array,absolute=mrng.nextBoolean(),factor=(mrng.nextBoolean()?1:-1)*(absolute?10:1),bias=absolute?50:0;ret.push({lower:0,upper:10,change:-2*factor+bias}),ret.push({lower:10,upper:20,change:-1*factor+bias}),ret.push({lower:20,upper:60,change:0+bias}),ret.push({lower:60,upper:80,change:0+bias}),ret.push({lower:80,upper:90,change:1*factor+bias}),ret.push({lower:90,upper:1/0,change:2*factor+bias});const noChanges=ret.filter(x=>x.change===bias);if(absolute?mrng.nextBoolean()?(ret.splice(ret.indexOf(noChanges[0]),1),ret.splice(ret.indexOf(noChanges[1]),1)):(noChanges[0]={...noChanges[0],change:-1*factor+bias},noChanges[1]={...noChanges[1],change:1*factor+bias}):(mrng.nextBoolean()&&(mrng.nextBoolean()?ret.splice(ret.indexOf(noChanges[0]),1):noChanges[0]={...noChanges[0],change:-1*factor+bias}),mrng.nextBoolean()&&(mrng.nextBoolean()?ret.splice(ret.indexOf(noChanges[1]),1):noChanges[1]={...noChanges[1],change:1*factor+bias})),mrng.nextInt(0,2)===0){const signToStrip=mrng.nextBoolean()?-1:1;let ix=ret.findIndex(x=>Math.sign(x.change-bias)===signToStrip);for(;ix>=0;)ret.splice(ix,1),ix=ret.findIndex(x=>Math.sign(x.change-bias)===signToStrip)}const iterations=mrng.nextInt(0,10);for(let iter=0;iter<iterations;iter++){const i=mrng.nextInt(0,ret.length-1);mrng.nextBoolean()?ret[i].upper!==void 0&&(i===0||ret[i-1].upper!==void 0)&&(ret[i]={...ret[i],lower:void 0}):ret[i].lower!==void 0&&(i===ret.length-1||ret[i+1].lower!==void 0)&&(ret[i]={...ret[i],upper:void 0})}return{absolute,intervals:ret}}

View File

@@ -0,0 +1,34 @@
/**
* A range of metric values in which to apply a certain scaling operation
*/
export interface ScalingInterval {
/**
* The lower bound of the interval.
*
* The scaling adjustment will be applied if the metric is higher than this value.
*
* @default Threshold automatically derived from neighbouring intervals
*/
readonly lower?: number;
/**
* The upper bound of the interval.
*
* The scaling adjustment will be applied if the metric is lower than this value.
*
* @default Threshold automatically derived from neighbouring intervals
*/
readonly upper?: number;
/**
* The capacity adjustment to apply in this interval
*
* The number is interpreted differently based on AdjustmentType:
*
* - ChangeInCapacity: add the adjustment to the current capacity.
* The number can be positive or negative.
* - PercentChangeInCapacity: add or remove the given percentage of the current
* capacity to itself. The number can be in the range [-100..100].
* - ExactCapacity: set the capacity to this number. The number must
* be positive.
*/
readonly change: number;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});