| 5353 | |
| 5354 | You have the capability to call multiple tools in a single response. Stage and create the commit using a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.`}var bTK,sOY,xTK;var ITK=y(()=>{sm8();uL6();jH6();bTK=["Bash(git add:*)","Bash(git status:*)","Bash(git commit:*)"];sOY={type:"prompt",name:"commit",description:"Create a git commit",allowedTools:bTK,contentLength:0,progressMessage:"creating commit",source:"builtin",async getPromptForCommand(q,K){let _=aOY();return[{type:"text",text:await pQ(_,{...K,getAppState(){let Y=K.getAppState();return{...Y,toolPermissionContext:{...Y.toolPermissionContext,alwaysAllowRules:{...Y.toolPermissionContext.alwaysAllowRules,command:bTK}}}}},"/commit")}]}},xTK=sOY});var UTK={};T8(UTK,{fileExtension:()=>gTK,collectRecentAssistantTexts:()=>BTK,call:()=>OwY});import{mkdir as tOY,writeFile as eOY}from"fs/promises";import{tmpdir as qwY}from"os";import{join as mTK}from"path";function _wY(q){let K=oz.lexer(sq6(q)),_=[];for(let z of K)if(z.type==="code"){let Y=z;_.push({code:Y.text,lang:Y.lang})}return _}function BTK(q){let K=[];for(let _=q.length-1;_>=0&&K.length<KwY;_--){let z=q[_];if(z?.type!=="assistant"||z.isApiErrorMessage)continue;let Y=z.message.content;if(!Array.isArray(Y))continue;let $=L3(Y,` |
| 5355 | |
| 5356 | `);if($)K.push($)}return K}function gTK(q){if(q){let K=q.replace(/[^a-zA-Z0-9]/g,"");if(K&&K!=="plaintext")return`.${K}`}return".txt"}async function FTK(q,K){let _=mTK(uTK,K);return await tOY(uTK,{recursive:!0}),await eOY(_,q,"utf-8"),_}async function mq7(q,K){let _=await XX(q);if(_)process.stdout.write(_);let z=G$(q,` |
| 5357 | `)+1,Y=q.length;try{let $=await FTK(q,K);return`Copied to clipboard (${Y} characters, ${z} lines) |
| 5358 | Also written to ${$}`}catch{return`Copied to clipboard (${Y} characters, ${z} lines)`}}function zwY(q,K){let _=q.split(` |
| 5359 | `)[0]??"";if(O1(_)<=K)return _;let z="",Y=0,$=K-1;for(let A of _){let O=O1(A);if(Y+O>$)break;z+=A,Y+=O}return z+"…"}function YwY(q){let K=z6(33),{fullText:_,codeBlocks:z,messageAge:Y,onDone:$}=q,A=JR.useRef("full"),O=`${_.length} chars, ${G$(_,` |
| 5360 | `)+1} lines`,w;if(K[0]!==O)w={label:"Full response",value:"full",description:O},K[0]=O,K[1]=w;else w=K[1];let j;if(K[2]!==z||K[3]!==w){let S;if(K[5]===Symbol.for("react.memo_cache_sentinel"))S={label:"Always copy full response",value:"always",description:"Skip this picker in the future (revert via /config)"},K[5]=S;else S=K[5];j=[w,...z.map(AwY),S],K[2]=z,K[3]=w,K[4]=j}else j=K[4];let H=j,J;if(K[6]!==z||K[7]!==_)J=function(R){if(R==="full"||R==="always")return{text:_,filename:pTK};let x=z[R];return{text:x.code,filename:`copy${gTK(x.lang)}`,blockIndex:R}},K[6]=z,K[7]=_,K[8]=J;else J=K[8];let M=J,X;if(K[9]!==z.length||K[10]!==M||K[11]!==Y||K[12]!==$)X=async function(R){let x=M(R);if(R==="always"){if(!j8().copyFullResponse)b8($wY);d("tengu_copy",{block_count:z.length,always:!0,message_age:Y});let B=await mq7(x.text,x.filename);$(`${B} |