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,26 @@
from constructs import Construct
from aws_cdk import (
Duration,
Stack,
aws_iam as iam,
aws_sqs as sqs,
aws_sns as sns,
aws_sns_subscriptions as subs,
)
class %name.PascalCased%Stack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
queue = sqs.Queue(
self, "%name.PascalCased%Queue",
visibility_timeout=Duration.seconds(300),
)
topic = sns.Topic(
self, "%name.PascalCased%Topic"
)
topic.add_subscription(subs.SqsSubscription(queue))

View File

@@ -0,0 +1,22 @@
*.swp
package-lock.json
.pytest_cache
*.egg-info
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# CDK Context & Staging files
.cdk.staging/
cdk.out/

View File

@@ -0,0 +1,65 @@
# Welcome to your CDK Python project!
You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`%name.PythonModule%_stack`)
which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.
The `cdk.json` file tells the CDK Toolkit how to execute your app.
This project is set up like a standard Python project. The initialization process also creates
a virtualenv within this project, stored under the .venv directory. To create the virtualenv
it assumes that there is a `python3` executable in your path with access to the `venv` package.
If for any reason the automatic creation of the virtualenv fails, you can create the virtualenv
manually once the init process completes.
To manually create a virtualenv on MacOS and Linux:
```
$ %python-executable% -m venv .venv
```
After the init process completes and the virtualenv is created, you can use the following
step to activate your virtualenv.
```
$ source .venv/bin/activate
```
If you are a Windows platform, you would activate the virtualenv like this:
```
% .venv\Scripts\activate.bat
```
Once the virtualenv is activated, you can install the required dependencies.
```
$ pip install -r requirements.txt
```
At this point you can now synthesize the CloudFormation template for this code.
```
$ cdk synth
```
You can now begin exploring the source code, contained in the hello directory.
There is also a very trivial test included that can be run like this:
```
$ pytest
```
To add additional dependencies, for example other CDK libraries, just add to
your requirements.txt file and rerun the `pip install -r requirements.txt`
command.
## Useful commands
* `cdk ls` list all stacks in the app
* `cdk synth` emits the synthesized CloudFormation template
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk docs` open CDK documentation
Enjoy!

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env python3
import aws_cdk as cdk
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack
app = cdk.App()
%name.PascalCased%Stack(app, "%stackname%")
app.synth()

View File

@@ -0,0 +1,15 @@
{
"app": "%python-executable% app.py",
"watch": {
"include": ["**"],
"exclude": [
"README.md",
"cdk*.json",
"requirements*.txt",
"source.bat",
"**/__init__.py",
"python/__pycache__",
"tests"
]
}
}

View File

@@ -0,0 +1 @@
pytest==8.4.2

View File

@@ -0,0 +1,2 @@
aws-cdk-lib%cdk-version%
constructs%constructs-version%

View File

@@ -0,0 +1,13 @@
@echo off
rem The sole purpose of this script is to make the command
rem
rem source .venv/bin/activate
rem
rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows.
rem On Windows, this command just runs this batch file (the argument is ignored).
rem
rem Now we don't need to document a Windows command for activating a virtualenv.
echo Executing .venv\Scripts\activate.bat for you
.venv\Scripts\activate.bat

View File

@@ -0,0 +1,21 @@
import aws_cdk as core
import aws_cdk.assertions as assertions
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack
def test_sqs_queue_created():
app = core.App()
stack = %name.PascalCased%Stack(app, "%name.StackName%")
template = assertions.Template.from_stack(stack)
template.has_resource_properties("AWS::SQS::Queue", {
"VisibilityTimeout": 300
})
def test_sns_topic_created():
app = core.App()
stack = %name.PascalCased%Stack(app, "%name.StackName%")
template = assertions.Template.from_stack(stack)
template.resource_count_is("AWS::SNS::Topic", 1)