(q,K)
| 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} |
| 5361 | Preference saved. Use /config to change copyFullResponse`);return}d("tengu_copy",{selected_block:x.blockIndex,block_count:z.length,message_age:Y});let I=await mq7(x.text,x.filename);$(I)},K[9]=z.length,K[10]=M,K[11]=Y,K[12]=$,K[13]=X;else X=K[13];let P=X,W;if(K[14]!==z.length||K[15]!==M||K[16]!==Y||K[17]!==$){let S=async function(x){let I=M(x);d("tengu_copy",{selected_block:I.blockIndex,block_count:z.length,message_age:Y,write_shortcut:!0});try{let B=await FTK(I.text,I.filename);$(`Written to ${B}`)}catch(B){let p=B;$(`Failed to write file: ${p instanceof Error?p.message:p}`)}};W=function(x){if(x.key==="w")x.preventDefault(),S(A.current)},K[14]=z.length,K[15]=M,K[16]=Y,K[17]=$,K[18]=W}else W=K[18];let D=W,f;if(K[19]===Symbol.for("react.memo_cache_sentinel"))f=JR.default.createElement(k,{dimColor:!0},"Select content to copy:"),K[19]=f;else f=K[19];let G;if(K[20]===Symbol.for("react.memo_cache_sentinel"))G=(S)=>{A.current=S},K[20]=G;else G=K[20];let Z;if(K[21]!==P)Z=(S)=>{P(S)},K[21]=P,K[22]=Z;else Z=K[22];let T;if(K[23]!==$)T=()=>{$("Copy cancelled",{display:"system"})},K[23]=$,K[24]=T;else T=K[24];let v;if(K[25]!==H||K[26]!==T||K[27]!==Z)v=JR.default.createElement(H1,{options:H,hideIndexes:!1,onFocus:G,onChange:Z,onCancel:T}),K[25]=H,K[26]=T,K[27]=Z,K[28]=v;else v=K[28];let V;if(K[29]===Symbol.for("react.memo_cache_sentinel"))V=JR.default.createElement(k,{dimColor:!0},JR.default.createElement(I1,null,JR.default.createElement(t8,{shortcut:"enter",action:"copy"}),JR.default.createElement(t8,{shortcut:"w",action:"write to file"}),JR.default.createElement(t8,{shortcut:"esc",action:"cancel"}))),K[29]=V;else V=K[29];let E;if(K[30]!==D||K[31]!==v)E=JR.default.createElement(Q_,null,JR.default.createElement(u,{flexDirection:"column",gap:1,tabIndex:0,autoFocus:!0,onKeyDown:D},f,v,V)),K[30]=D,K[31]=v,K[32]=E;else E=K[32];return E}function $wY(q){return{...q,copyFullResponse:!0}}function AwY(q,K){let _=G$(q.code,` |
| 5362 | `)+1;return{label:zwY(q.code,60),value:K,description:[q.lang,_>1?`${_} lines`:void 0].filter(Boolean).join(", ")||void 0}}var JR,uTK,pTK="response.md",KwY=20,OwY=async(q,K,_)=>{let z=BTK(K.messages);if(z.length===0)return q("No assistant message to copy"),null;let Y=0,$=_?.trim();if($){let j=Number($);if(!Number.isInteger(j)||j<1)return q(`Usage: /copy [N] where N is 1 (latest), 2, 3, … Got: ${$}`),null;if(j>z.length)return q(`Only ${z.length} assistant ${z.length===1?"message":"messages"} available to copy`),null;Y=j-1}let A=z[Y],O=_wY(A),w=j8();if(O.length===0||w.copyFullResponse){d("tengu_copy",{always:w.copyFullResponse,block_count:O.length,message_age:Y});let j=await mq7(A,pTK);return q(j),null}return JR.default.createElement(YwY,{fullText:A,codeBlocks:O,messageAge:Y,onDone:q})};var QTK=y(()=>{q8();Or6();p3();QK();rK();pP();Q5();YM();s6();k8();V1();i1();JR=O6(D6(),1),uTK=mTK(qwY(),"claude")});var wwY,pq7;var dTK=y(()=>{wwY={type:"local-jsx",name:"copy",description:"Copy Claude's last response to clipboard (or /copy N for the Nth-latest)",load:()=>Promise.resolve().then(() => (QTK(),UTK))},pq7=wwY});import{readdir as jwY}from"fs/promises";import{join as HwY}from"path";function Bq7(){let q=[process.argv[1]||"",process.execPath||""],K=["/build-ant/","/build-ant-native/","/build-external/","/build-external-native/"];return q.some((_)=>K.some((z)=>_.includes(z)))}function MwY(q){let K=Bq7()?"claude-dev":"claude",_=new URL(`${K}://resume`);return _.searchParams.set("session",q),_.searchParams.set("cwd",Z8()),_.toString()}async function cTK(){if(Bq7())return!0;let q=process.platform;if(q==="darwin")return u5("/Applications/Claude.app");else if(q==="linux"){let{code:K,stdout:_}=await a8("xdg-mime",["query","default","x-scheme-handler/claude"]);return K===0&&_.trim().length>0}else if(q==="win32"){let{code:K}=await a8("reg",["query","HKEY_CLASSES_ROOT\\claude","/ve"]);return K===0}return!1}async function XwY(){let q=process.platform;if(q==="darwin"){let{code:K,stdout:_}=await a8("defaults",["read","/Applications/Claude.app/Contents/Info.plist","CFBundleShortVersionString"]);if(K!==0)return null;let z=_.trim();return z.length>0?z:null}else if(q==="win32"){let K=process.env.LOCALAPPDATA;if(!K)return null;let _=HwY(K,"AnthropicClaude");try{let Y=(await jwY(_)).filter(($)=>$.startsWith("app-")).map(($)=>$.slice(4)).filter(($)=>M78.coerce($)!==null).sort(($,A)=>{let O=M78.coerce($),w=M78.coerce(A);return O.compare(w)});return Y.length>0?Y[Y.length-1]:null}catch{return null}}return null}async function lTK(){if(!await cTK())return{status:"not-installed"};let K;try{K=await XwY()}catch{return{status:"ready",version:"unknown"}}if(!K)return{status:"ready",version:"unknown"};let _=M78.coerce(K);if(!_||!yP(_.version,JwY))return{status:"version-too-old",version:K};return{status:"ready",version:K}}async function PwY(q){let K=process.platform;if(N(`Opening deep link: ${q}`),K==="darwin"){if(Bq7()){let{code:z}=await a8("osascript",["-e",`tell application "Electron" to open location "${q}"`]);return z===0}let{code:_}=await a8("open",[q]);return _===0}else if(K==="linux"){let{code:_}=await a8("xdg-open",[q]);return _===0}else if(K==="win32"){let{code:_}=await a8("cmd",["/c","start","",q]);return _===0}return!1}async function nTK(){let q=N8();if(!await cTK())return{success:!1,error:"Claude Desktop is not installed. Install it from https://claude.ai/download"};let _=MwY(q);if(!await PwY(_))return{success:!1,error:"Failed to open Claude Desktop. Please try opening it manually.",deepLinkUrl:_};return{success:!0,deepLinkUrl:_}}var M78,JwY="1.1.2396";var iTK=y(()=>{v8();I7();_8();XK();bK();M78=O6(RT6(),1)});function pb(q){let K=z6(10),{message:_,bold:z,dimColor:Y,subtitle:$}=q,A=z===void 0?!1:z,O=Y===void 0?!1:Y,w;if(K[0]===Symbol.for("react.memo_cache_sentinel"))w=mh6.default.createElement(IK,null),K[0]=w;else w=K[0];let j;if(K[1]!==A||K[2]!==O||K[3]!==_)j=mh6.default.createElement(u,{flexDirection:"row"},w,mh6.default.createElement(k,{bold:A,dimColor:O}," ",_)),K[1]=A,K[2]=O,K[3]=_,K[4]=j;else j=K[4];let H;if(K[5]!==$)H=$&&mh6.default.createElement(k,{dimColor:!0},$),K[5]=$,K[6]=H;else H=K[6];let J;if(K[7]!==j||K[8]!==H)J=mh6.default.createElement(u,{flexDirection:"column"},j,H),K[7]=j,K[8]=H,K[9]=J;else J=K[9];return J}var mh6;var IH6=y(()=>{q8();s6();Q2();mh6=O6(D6(),1)});function WwY(){switch(process.platform){case"win32":return"https://claude.ai/api/desktop/win32/x64/exe/latest/redirect";default:return"https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect"}}function Tg8(q){let K=z6(20),{onDone:_}=q,[z,Y]=Py.useState("checking"),[$,A]=Py.useState(null),[O,w]=Py.useState(""),j;if(K[0]!==$||K[1]!==_||K[2]!==z)j=(D)=>{if(z==="error"){_($??"Unknown error",{display:"system"});return}if(z==="prompt-download"){if(D==="y"||D==="Y")m3(WwY()).catch(fwY),_(`Starting download. Re-run /desktop once you’ve installed the app. |
| 5363 | Learn more at ${rTK}`,{display:"system"});else if(D==="n"||D==="N")_(`The desktop app is required for /desktop. Learn more at ${rTK}`,{display:"system"})}},K[0]=$,K[1]=_,K[2]=z,K[3]=j;else j=K[3];k4(j);let H,J;if(K[4]!==_)H=()=>{(async function(){Y("checking");let G=await lTK();if(G.status==="not-installed"){w("Claude Desktop is not installed."),Y("prompt-download");return}if(G.status==="version-too-old"){w(`Claude Desktop needs to be updated (found v${G.version}, need v1.1.2396+).`),Y("prompt-download");return}Y("flushing"),await Hd(),Y("opening");let Z=await nTK();if(!Z.success){A(Z.error??"Failed to open Claude Desktop"),Y("error");return}Y("success"),setTimeout(DwY,500,_)})().catch((f)=>{A(d6(f)),Y("error")})},J=[_],K[4]=_,K[5]=H,K[6]=J;else H=K[5],J=K[6];if(Py.useEffect(H,J),z==="error"){let D;if(K[7]!==$)D=Py.default.createElement(k,{color:"error"},"Error: ",$),K[7]=$,K[8]=D;else D=K[8];let f;if(K[9]===Symbol.for("react.memo_cache_sentinel"))f=Py.default.createElement(k,{dimColor:!0},"Press any key to continue…"),K[9]=f;else f=K[9];let G;if(K[10]!==D)G=Py.default.createElement(u,{flexDirection:"column",paddingX:2},D,f),K[10]=D,K[11]=G;else G=K[11];return G}if(z==="prompt-download"){let D;if(K[12]!==O)D=Py.default.createElement(k,null,O),K[12]=O,K[13]=D;else D=K[13];let f;if(K[14]===Symbol.for("react.memo_cache_sentinel"))f=Py.default.createElement(k,null,"Download now? (y/n)"),K[14]=f;else f=K[14];let G;if(K[15]!==D)G=Py.default.createElement(u,{flexDirection:"column",paddingX:2},D,f),K[15]=D,K[16]=G;else G=K[16];return G}let M;if(K[17]===Symbol.for("react.memo_cache_sentinel"))M={checking:"Checking for Claude Desktop…",flushing:"Saving session…",opening:"Opening Claude Desktop…",success:"Opening in Claude Desktop…"},K[17]=M;else M=K[17];let P=M[z],W;if(K[18]!==P)W=Py.default.createElement(pb,{message:P}),K[18]=P,K[19]=W;else W=K[19];return W}async function DwY(q){q("Session transferred to Claude Desktop",{display:"system"}),await xK(0,"other")}function fwY(){}var Py,rTK="https://clau.de/desktop";var gq7=y(()=>{q8();s6();hH();iTK();y8();RA();_K();IH6();Py=O6(D6(),1)});var aTK={};T8(aTK,{call:()=>ZwY});async function ZwY(q){return oTK.default.createElement(Tg8,{onDone:q})}var oTK;var sTK=y(()=>{gq7();oTK=O6(D6(),1)});function tTK(){if(process.platform==="darwin")return!0;if(process.platform==="win32"&&process.arch==="x64")return!0;return!1}var GwY,eTK;var qvK=y(()=>{GwY={type:"local-jsx",name:"desktop",aliases:["app"],description:"Continue the current session in Claude Desktop",availability:["claude-ai"],isEnabled:tTK,get isHidden(){return!tTK()},load:()=>Promise.resolve().then(() => (sTK(),aTK))},eTK=GwY});function _vK(q,K){let{commit:_,pr:z}=dR6(),Y=K??z,$=process.env.SAFEUSER||"",A=process.env.USER||"",O="",w=" and `--reviewer anthropics/claude-code`",j=" (and add `--add-reviewer anthropics/claude-code`)",H=` |
| 5364 | |
| 5365 | ## Changelog |
| 5366 | <!-- CHANGELOG:START --> |
| 5367 | [If this PR contains user-facing changes, add a changelog entry here. Otherwise, remove this section.] |
| 5368 | <!-- CHANGELOG:END -->`,J=` |
| 5369 | |
| 5370 | 5. After creating/updating the PR, check if the user's CLAUDE.md mentions posting to Slack channels. If it does, use ToolSearch to search for "slack send message" tools. If ToolSearch finds a Slack tool, ask the user if they'd like you to post the PR URL to the relevant Slack channel. Only post if the user confirms. If ToolSearch returns no results or errors, skip this step silently—do not mention the failure, do not attempt workarounds, and do not try alternative approaches.`;return`${O}## Context |
| 5371 | |
| 5372 | - \`SAFEUSER\`: ${$} |
| 5373 | - \`whoami\`: ${A} |
| 5374 | - \`git status\`: !\`git status\` |
| 5375 | - \`git diff HEAD\`: !\`git diff HEAD\` |
| 5376 | - \`git branch --show-current\`: !\`git branch --show-current\` |
| 5377 | - \`git diff ${q}...HEAD\`: !\`git diff ${q}...HEAD\` |
| 5378 | - \`gh pr view --json number 2>/dev/null || true\`: !\`gh pr view --json number 2>/dev/null || true\` |
| 5379 | |
| 5380 | ## Git Safety Protocol |
| 5381 | |
| 5382 | - NEVER update the git config |
| 5383 | - NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them |
| 5384 | - NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it |
| 5385 | - NEVER run force push to main/master, warn the user if they request it |
| 5386 | - Do not commit files that likely contain secrets (.env, credentials.json, etc) |
| 5387 | - Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported |
| 5388 | |
| 5389 | ## Your task |
| 5390 | |
| 5391 | Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request from the git diff ${q}...HEAD output above). |
| 5392 | |
| 5393 | Based on the above changes: |
| 5394 | 1. Create a new branch if on ${q} (use SAFEUSER from context above for the branch name prefix, falling back to whoami if SAFEUSER is empty, e.g., \`username/feature-name\`) |
| 5395 | 2. Create a single commit with an appropriate message using heredoc syntax${_?", ending with the attribution text shown in the example below":""}: |
| 5396 | \`\`\` |
| 5397 | git commit -m "$(cat <<'EOF' |
| 5398 | Commit message here.${_?` |
| 5399 | |
| 5400 | ${_}`:""} |
| 5401 | EOF |
| 5402 | )" |
| 5403 | \`\`\` |
| 5404 | 3. Push the branch to origin |
| 5405 | 4. If a PR already exists for this branch (check the gh pr view output above), update the PR title and body using \`gh pr edit\` to reflect the current diff${j}. Otherwise, create a pull request using \`gh pr create\` with heredoc syntax for the body${w}. |
| 5406 | - IMPORTANT: Keep PR titles short (under 70 characters). Use the body for details. |
| 5407 | \`\`\` |
| 5408 | gh pr create --title "Short, descriptive title" --body "$(cat <<'EOF' |
| 5409 | ## Summary |
| 5410 | <1-3 bullet points> |
| 5411 | |
| 5412 | ## Test plan |
| 5413 | [Bulleted markdown checklist of TODOs for testing the pull request...]${H}${Y?` |
| 5414 | |
| 5415 | ${Y}`:""} |
| 5416 | EOF |
| 5417 | )" |
| 5418 | \`\`\` |
| 5419 |
no test coverage detected