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 @@
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var aws_iam_1=()=>{var tmp=require("../../../aws-iam");return aws_iam_1=()=>tmp,tmp},aws_kms_1=()=>{var tmp=require("../../../aws-kms");return aws_kms_1=()=>tmp,tmp},cfn_key_matcher_1=()=>{var tmp=require("../../../aws-kms/lib/private/cfn-key-matcher");return cfn_key_matcher_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},helpers_internal_1=()=>{var tmp=require("../../../core/lib/helpers-internal");return helpers_internal_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},dynamodb_generated_1=()=>{var tmp=require("../dynamodb.generated");return dynamodb_generated_1=()=>tmp,tmp};class TablePolicyFactory{forResource(resource){if(!dynamodb_generated_1().CfnTable.isCfnTable(resource))throw new(core_1()).ValidationError((0,literal_string_1().lit)`Construct`,`Construct ${resource.node.path} is not of type CfnTable`,resource);return new CfnTableWithPolicy(resource)}}class CfnTableWithPolicy{table;env;policyDocument;constructor(table){this.table=table,this.env=table.env}addToResourcePolicy(statement){if(!this.policyDocument)if(core_1().Token.isResolved(this.table.resourcePolicy))this.policyDocument=aws_iam_1().PolicyDocument.fromJson(this.table.resourcePolicy?.policyDocument??{Statement:[]});else return{statementAdded:!1};return this.policyDocument.addStatements(statement),this.table.resourcePolicy={policyDocument:this.policyDocument.toJSON()},{statementAdded:!0,policyDependable:this.table}}}class EncryptedTableFactory{forResource(resource){if(!dynamodb_generated_1().CfnTable.isCfnTable(resource))throw new(core_1()).ValidationError((0,literal_string_1().lit)`Construct`,`Construct ${resource.node.path} is not of type CfnTable`,resource);return new EncryptedCfnTable(resource)}}class EncryptedCfnTable{table;env;constructor(table){this.table=table,this.env=table.env}grantOnKey(grantee,...actions){const key=tryFindKmsKeyForTable(this.table);return{grant:key?aws_kms_1().KeyGrants.fromKey(key).actions(grantee,...actions):void 0}}}function tryFindKmsKeyForTable(table){const cfnTable=tryFindTableConstruct(table),kmsMasterKeyId=cfnTable?.sseSpecification&&cfnTable.sseSpecification.kmsMasterKeyId;if(kmsMasterKeyId)return helpers_internal_1().ConstructReflection.of(table).findRelatedCfnResource(new(cfn_key_matcher_1()).CfnKeyMatcher(kmsMasterKeyId))}function tryFindTableConstruct(table){return helpers_internal_1().ConstructReflection.of(table).findCfnResource({cfnResourceType:"AWS::DynamoDB::Table",matches:cfn=>table.tableRef==cfn.tableRef})}aws_iam_1().DefaultPolicyFactories.set("AWS::DynamoDB::Table",new TablePolicyFactory),aws_iam_1().DefaultEncryptedResourceFactories.set("AWS::DynamoDB::Table",new EncryptedTableFactory);

View File

@@ -0,0 +1,12 @@
import type { IPrincipal } from '../../../aws-iam';
/**
* Returns true if the principal resolves to a Service principal in the policy document.
* Checks the policyFragment output to handle wrapped principals
* (e.g. PrincipalWithConditions, SessionTagsPrincipal).
*/
export declare function isServicePrincipal(principal: IPrincipal): boolean;
/**
* Returns true if the principal is a service principal whose service name
* is NOT in the known-valid allowlist for DynamoDB resource policies.
*/
export declare function isUnsupportedServicePrincipal(principal: IPrincipal): boolean;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isServicePrincipal=isServicePrincipal,exports.isUnsupportedServicePrincipal=isUnsupportedServicePrincipal;var aws_iam_1=()=>{var tmp=require("../../../aws-iam");return aws_iam_1=()=>tmp,tmp};const KNOWN_DYNAMODB_SERVICE_PRINCIPALS=new Set(["redshift.amazonaws.com","replication.dynamodb.amazonaws.com","glue.amazonaws.com"]);function isServicePrincipal(principal){return"Service"in principal.policyFragment.principalJson}function isUnsupportedServicePrincipal(principal){if(!isServicePrincipal(principal))return!1;const serviceName=extractServiceName(principal);return serviceName===void 0||!KNOWN_DYNAMODB_SERVICE_PRINCIPALS.has(serviceName)}function extractServiceName(principal){if(principal instanceof aws_iam_1().ServicePrincipal)return principal.service;const inner=principal.wrapped;if(inner!=null)return extractServiceName(inner)}