`):String(e.content);me.startGroup("bash output"),e.is_error?me.warning(n):me.info(n),me.endGroup(),hC.delete(r)}else if(e.is_error){let n=typeof e.content=="string"?e.content:String(e.content);me.warning(`Tool error: ${n}`)}}}},result:async t=>{t.subtype==="success"?await me.summaryTable([[{data:"Cost",header:!0},{data:"Input Tokens",header:!0},{data:"Output Tokens",header:!0}],[`$${t.total_cost_usd?.toFixed(4)||"0.0000"}`,String(t.usage?.input_tokens||0),String(t.usage?.output_tokens||0)]]):t.subtype==="error_max_turns"?me.error(`Max turns reached: ${JSON.stringify(t)}`):t.subtype==="error_during_execution"?me.error(`Execution error: ${JSON.stringify(t)}`):me.error(`Failed: ${JSON.stringify(t)}`)},system:()=>{},stream_event:()=>{}};var Bc=require("node:child_process");function ek(){me.info("\u{1F527} Setting up git configuration..."),(0,Bc.execSync)('git config user.email "
[email protected]"',{stdio:"inherit"}),(0,Bc.execSync)('git config user.name "Pullfrog Action"',{stdio:"inherit"})}function tk(t,e){me.info("\u{1F510} Setting up git authentication...");try{(0,Bc.execSync)("git config --unset-all http.https://github.com/.extraheader",{stdio:"inherit"}),me.info("\u2713 Removed existing authentication headers")}catch{me.info("No existing authentication headers to remove")}let r=`https://x-access-token:${t}@github.com/${e.owner}/${e.name}.git`;(0,Bc.execSync)(`git remote set-url origin "${r}"`,{stdio:"inherit"}),me.info("\u2713 Updated remote URL with authentication token")}var rk=uc({prompt:"string","anthropic_api_key?":"string | undefined"});async function Ak(t){try{me.info("Starting agent run..."),ek();let e=await KD(),r=Ic();tk(e,r);let A=zD(e);me.debug(`\u{1F4CB} MCP Config: ${JSON.stringify(A,null,2)}`),me.info("Running Claude Agent SDK..."),me.box(t.prompt,{title:"Prompt"});let n=await XD.run({prompt:t.prompt,mcpServers:A,githubInstallationToken:e,apiKey:t.anthropic_api_key});return n.success?(me.success("Task complete."),await me.writeSummary(),{success:!0,output:n.output||""}):{success:!1,error:n.error||"Agent execution failed",output:n.output}}catch(e){let r=e instanceof Error?e.message:"Unknown error occurred";return me.error(r),await me.writeSummary(),{success:!1,error:r}}}var nk={name:"@pullfrog/action",version:"0.0.73",type:"module",files:["index.js","index.cjs","index.d.ts","index.d.cts","agents","utils","main.js","main.d.ts"],scripts:{test:'echo "Error: no test specified" && exit 1',typecheck:"tsc --noEmit",build:"node esbuild.config.js",play:"node play.ts",upDeps:"pnpm up --latest",lock:"pnpm --ignore-workspace install",prepare:"husky"},dependencies:{"@actions/core":"^1.11.1","@anthropic-ai/claude-agent-sdk":"^0.1.26","@ark/fs":"0.53.0","@ark/util":"0.53.0","@octokit/rest":"^22.0.0","@octokit/webhooks-types":"^7.6.1","@standard-schema/spec":"1.0.0",arktype:"2.1.25",dotenv:"^17.2.3",execa:"^9.6.0",fastmcp:"^3.20.0",table:"^6.9.0"},devDependencies:{"@types/node":"^24.7.2",arg:"^5.0.2",esbuild:"^0.25.9",husky:"^9.0.0",typescript:"^5.9.3"},repository:{type:"git",url:"git+https://github.com/pullfrog/action.git"},keywords:[],author:"",license:"MIT",bugs:{url:"https://github.com/pullfrog/action/issues"},homepage:"https://github.com/pullfrog/action#readme",zshy:{exports:"./index.ts"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.cts",exports:{".":{types:"./dist/index.d.cts",import:"./dist/index.js",require:"./dist/index.cjs"}}};async function V9(){try{me.info(`\u{1F438} Running pullfrog/action@${nk.version}...`);let t=process.env.INPUTS_JSON;if(!t)throw new Error("INPUTS_JSON environment variable not found");let e=uc("string.json.parse").assert(t),r=rk.assert(e),A=await Ak(r);if(!A.success)throw new Error(A.error||"Agent execution failed")}catch(t){let e=t instanceof Error?t.message:"Unknown error occurred";sk.setFailed(`Action failed: ${e}`)}}(async()=>await V9())();
0 commit comments