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 __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var appsync_js_pipeline_exports={};__export(appsync_js_pipeline_exports,{request:()=>request,response:()=>response});module.exports=__toCommonJS(appsync_js_pipeline_exports);function request(...args){return{}}function response(ctx){return ctx.prev.result}0&&(module.exports={request,response});

View File

@@ -0,0 +1 @@
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var appsync_js_resolver_exports={};__export(appsync_js_resolver_exports,{request:()=>request,response:()=>response});module.exports=__toCommonJS(appsync_js_resolver_exports);var import_utils=require("@aws-appsync/utils");function request(ctx){const id=import_utils.util.autoId(),name=ctx.args.name;return ctx.args.input={id,name},{version:"2018-05-29",operation:"PutItem",key:{id:import_utils.util.dynamodb.toDynamoDB(ctx.args.input.id)},attributeValues:import_utils.util.dynamodb.toMapValues(ctx.args.input)}}function response(ctx){return ctx.result}0&&(module.exports={request,response});

View File

@@ -0,0 +1,6 @@
"use strict";exports.handler=async function(event){console.log(event);let myHeaders=new Headers;myHeaders.append("x-api-key",event.apiKey),myHeaders.append("Content-Type","application/json");const query=JSON.stringify({query:`mutation MyMutation {
addTest(name: "123") {
id
name
}
}`,variables:{}}),requestOptions={method:"POST",headers:myHeaders,body:query,redirect:"follow"};return await fetch(event.hostname,requestOptions).then(response2=>response2.json())};

View File

@@ -0,0 +1 @@
"use strict";exports.handler=async context=>{if(context.info.operation==="PUBLISH")return{events:context.events.map(ev=>({id:ev.id,payload:{...ev.payload,with:`hello world from ${ev.id}`}}))};if(context.info.operation!=="SUBSCRIBE")throw new Error("Unknown operation")};

View File

@@ -0,0 +1 @@
"use strict";exports.handler=async(event,context)=>{console.log("Do something with the events!"),console.log(event)};

View File

@@ -0,0 +1,6 @@
"use strict";require("isomorphic-fetch");const AWS=require("aws-sdk/global"),gql=require("graphql-tag"),appsync=require("aws-appsync"),config={url:process.env.APPSYNC_ENDPOINT,region:process.env.AWS_REGION,auth:{type:appsync.AUTH_TYPE.AWS_IAM,credentials:AWS.config.credentials},disableOffline:!0},getTests=`query getTests {
getTests {
id
version
}
}`,client=new appsync.AWSAppSyncClient(config);exports.handler=(event,context,callback)=>{(async()=>{try{const result=await client.query({query:gql(getTests)});console.log(result.data),callback(null,result.data)}catch(e){console.warn("Error sending mutation: ",e),callback(Error(e))}})()};

View File

@@ -0,0 +1 @@
"use strict";exports.handler=(event,context,callback)=>{console.log("Received event {}",JSON.stringify(event,3));var posts={1:{id:"1",title:"First book",author:"Author1",url:"https://amazon.com/",content:"SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1 SAMPLE TEXT AUTHOR 1",ups:"100",downs:"10"},2:{id:"2",title:"Second book",author:"Author2",url:"https://amazon.com",content:"SAMPLE TEXT AUTHOR 2 SAMPLE TEXT AUTHOR 2 SAMPLE TEXT",ups:"100",downs:"10"},3:{id:"3",title:"Third book",author:"Author3",url:null,content:null,ups:null,downs:null},4:{id:"4",title:"Fourth book",author:"Author4",url:"https://www.amazon.com/",content:"SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4 SAMPLE TEXT AUTHOR 4",ups:"1000",downs:"0"},5:{id:"5",title:"Fifth book",author:"Author5",url:"https://www.amazon.com/",content:"SAMPLE TEXT AUTHOR 5 SAMPLE TEXT AUTHOR 5 SAMPLE TEXT AUTHOR 5 SAMPLE TEXT AUTHOR 5 SAMPLE TEXT",ups:"50",downs:"0"}},relatedPosts={1:[posts[4]],2:[posts[3],posts[5]],3:[posts[2],posts[1]],4:[posts[2],posts[1]],5:[]};if(Array.isArray(event)){console.log("Got an BatchInvoke Request. The payload has %d items to resolve.",event.length);const field=event[0].field;switch(field){case"relatedPostsMaxBatchSize":case"relatedPosts":for(var results=[],i=0;i<event.length;i++)console.log("post {}",JSON.stringify(event[i].source)),results.push(relatedPosts[event[i].source.id]);console.log("results {}",JSON.stringify(results)),callback(null,results);break;default:callback("Unknown field, unable to resolve"+field,null);break}}else switch(console.log("Got an Invoke Request."),event.field){case"getPost":var id=event.arguments.id;callback(null,posts[id]);break;case"allPosts":var values=[];for(var d in posts)values.push(posts[d]);callback(null,values);break;case"addPost":callback(null,event.arguments);break;case"addPostErrorWithData":var id=event.arguments.id,result=posts[id];result.errorMessage="Error with the mutation, data has changed",result.errorType="MUTATION_ERROR",callback(null,result);break;default:callback("Unknown field, unable to resolve"+event.field,null);break}};