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 @@
"use strict";var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,b=(e,s)=>{for(var t in s)n(e,t,{get:s[t],enumerable:!0})},T=(e,s,t,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of u(s))!m.call(e,a)&&a!==t&&n(e,a,{get:()=>s[a],enumerable:!(o=d(s,a))||o.enumerable});return e},g=e=>T(n({},"__esModule",{value:!0}),e),f={};b(f,{isCompleteHandler:()=>y,onEventHandler:()=>C}),module.exports=g(f);var c=require("@aws-sdk/client-dynamodb");async function C(e){console.log("Event: %j",{...e,ResponseURL:"..."});let s=new c.DynamoDB({}),t=e.ResourceProperties.TableName,o=e.ResourceProperties.Region,a=e.ResourceProperties.SkipReplicaDeletion==="true",i;if(e.RequestType==="Create"||e.RequestType==="Delete")i=e.RequestType;else{let l=await s.describeTable({TableName:t});console.log("Describe table: %j",l),i=l.Table?.Replicas?.some(p=>p.RegionName===o)?void 0:"Create"}if(i)if(i==="Delete"&&a)console.log("Skipping deleting replica table as replica table is set to retain.");else{let l=await s.updateTable({TableName:t,ReplicaUpdates:[{[i]:{RegionName:o}}]});console.log("Update table: %j",l)}else console.log("Skipping updating Table, as a replica in '%s' already exists",o);return e.RequestType==="Create"||e.RequestType==="Update"?{PhysicalResourceId:`${t}-${o}`}:{}}async function y(e){console.log("Event: %j",{...e,ResponseURL:"..."});let t=await new c.DynamoDB({}).describeTable({TableName:e.ResourceProperties.TableName});console.log("Describe table: %j",t);let o=t.Table?.TableStatus==="ACTIVE",i=(t.Table?.Replicas??[]).find(R=>R.RegionName===e.ResourceProperties.Region),l=i?.ReplicaStatus==="ACTIVE",r=e.ResourceProperties.SkipReplicationCompletedWait==="true",p=e.ResourceProperties.SkipReplicaDeletion==="true";switch(e.RequestType){case"Create":case"Update":return{IsComplete:o&&(l||r)};case"Delete":return p?(console.log("Skipping replica deletion check since replica is set to retain."),{IsComplete:!0}):{IsComplete:o&&i===void 0}}}

View File

@@ -0,0 +1,8 @@
import { Construct } from "constructs";
import * as lambda from "../../../aws-lambda";
export declare class ReplicaOnEventFunction extends lambda.Function {
constructor(scope: Construct, id: string, props?: lambda.FunctionOptions);
}
export declare class ReplicaIsCompleteFunction extends lambda.Function {
constructor(scope: Construct, id: string, props?: lambda.FunctionOptions);
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReplicaIsCompleteFunction=exports.ReplicaOnEventFunction=void 0;const path=require("path"),lambda=require("../../../aws-lambda");class ReplicaOnEventFunction extends lambda.Function{constructor(scope,id,props){super(scope,id,{...props,code:lambda.Code.fromAsset(path.join(__dirname,"replica-handler")),handler:"index.onEventHandler",runtime:lambda.determineLatestNodeRuntime(scope)}),this.node.addMetadata("aws:cdk:is-custom-resource-handler-runtime-family",this.runtime.family)}}exports.ReplicaOnEventFunction=ReplicaOnEventFunction;class ReplicaIsCompleteFunction extends lambda.Function{constructor(scope,id,props){super(scope,id,{...props,code:lambda.Code.fromAsset(path.join(__dirname,"replica-handler")),handler:"index.isCompleteHandler",runtime:lambda.determineLatestNodeRuntime(scope)}),this.node.addMetadata("aws:cdk:is-custom-resource-handler-runtime-family",this.runtime.family)}}exports.ReplicaIsCompleteFunction=ReplicaIsCompleteFunction;