[BUG] claude code subagent path-extract (Extract any file paths that this command reads or modifies) , use all bash output and not TRUNCATED, Causing a large amount of token fees

Status Fixed / completed
Reported on v2.0.76
Maintainer reply None cached
Activity 5 comments · opened Jan 6, 2026 · closed Jan 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

claude code subagent path-extract (Extract any file paths that this command reads or modifies) , use all bash output and not TRUNCATED, Causing a large amount of token fees
cli.js :
async function Q89(A,Q,B,G){let Y=(await jK({systemPrompt:[`Extract any file paths that this command reads or modifies. For commands like "git diff" and "cat", include the paths of files being shown. Use paths verbatim -- don't add any slashes or try to resolve them. Do not try to infer paths that were not explicitly listed in the command output.

IMPORTANT: Commands that do not display the contents of the files should not return any filepaths. For eg. "ls", pwd", "find". Even more complicated commands that don't display the contents should not be considered: eg "find . -type f -exec ls -la {} + | sort -k5 -nr | head -5"

First, determine if the command displays the contents of the files. If it does, then <is_displaying_contents> tag should be true. If it does not, then <is_displaying_contents> tag should be false.

Format your response as:
<is_displaying_contents>
true
</is_displaying_contents>

<filepaths>
path/to/file1
path/to/file2
</filepaths>

If no files are read or modified, return empty filepaths tags:
<filepaths>
</filepaths>

Do not include any other text in your response.],userPrompt:Command: ${A}
Output: ${Q}` .....

What Should Happen?

Q should TRUNCATED

Error Messages/Logs

Steps to Reproduce

  1. open nodejs\node_modules\@anthropic-ai\claude-code in terminal
  2. open claude code
  3. let claude bash run grep -B5 \"async function EdB\" cli.js | head -10 , not use search tool

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

5 Comments

caozhiyuan · 9 months ago

logs in ubuntu

 request message [{"role":"user","content":[{"type":"text","text":"Command: grep -B5 \"async function EdB\" cli.js | head -10\nOutput: `).map(oT3).join(`\n`)}function Yz({content:A,verbose:Q,isError:B,isWarning:G}){let{columns:Z}=KB(),Y=rmB.useMemo(()=>{if(Q)return J91(omB(A));else return J91(amB(omB(A),Z))},[A,Q,Z]);return XBA.createElement(k0,null,XBA.createElement(C,{color:B?\"error\":G?\"warning\":void 0},XBA.createElement(_3,null,Y)))}function J91(A){return A.replace(/\\^[\\[([0-9]+;)*4(;[0-9]+)*m|\\^[\\[4(;[0-9]+)*m|\\^[\\[([0-9]+;)*4m/g,\"\")}var XBA,rmB;var GIA=O(()=>{bA();k4();c4();vu();XBA=l(JA(),1),rmB=l(JA(),1)});function X91(A){return A.replace(/<sandbox_violations>[\\s\\S]*?<\\/sandbox_violations>/g,\"\")}function o3({result:A,verbose:Q}){let B;if(typeof A!==\"string\")B=\"Tool execution failed\";else{let Z=Q9(A,\"tool_use_error\")??A,J=X91(Z).trim();if(!Q&&J.includes(\"InputValidationError: \"))B=\"Invalid tool parameters\";else if(J.startsWith(\"Error: \"))B=J;else B=`Error: ${J}`}let G=B.split(`\n`).length-a00;return UF.createElement(k0,null,UF.createElement(T,{flexDirection:\"column\"},UF.createElement(C,{color:\"error\"},J91(Q?B:B.split(`\n`).slice(0,a00).join(`\n`))),!Q&&B.split(`\n`).length>a00&&UF.createElement(T,null,UF.createElement(C,{dimColor:!0},\"… +\",G,\" \",G===1?\"line\":\"lines\",\" (\"),UF.createElement(C,{dimColor:!0,bold:!0},\"ctrl+o\"),UF.createElement(C,null,\" \"),UF.createElement(C,{dimColor:!0},\"to see all)\"))))}var UF,a00=10;var TK=O(()=>{bA();k4();EB();GIA();UF=l(JA(),1)});import{randomBytes as rT3}from\"crypto\";function sT3(A){return rT3(4).readUInt32BE(0)%A}function o00(A){return A[sT3(A.length)]}function AdB(){let A=o00(smB),Q=o00(emB),B=o00(tmB);return`${A}-${Q}-${B}`}var smB,tmB,emB,FiG;var QdB=O(()=>{smB=[\"abundant\",\"ancient\",\"bright\",\"calm\",\"cheerful\",\"clever\",\"cozy\",\"curious\",\"dapper\",\"dazzling\",\"deep\",\"delightful\",\"eager\",\"elegant\",\"enchanted\",\"fancy\",\"fluffy\",\"gentle\",\"gleaming\",\"golden\",\"graceful\",\"happy\",\"hidden\",\"humble\",\"jolly\",\"joyful\",\"keen\",\"kind\",\"lively\",\"lovely\",\"lucky\",\"luminous\",\"magical\",\"majestic\",\"mellow\",\"merry\",\"mighty\",\"misty\",\"noble\",\"peaceful\",\"playful\",\"polished\",\"precious\",\"proud\",\"quiet\",\"quirky\",\"radiant\",\"rosy\",\"serene\",\"shiny\",\"silly\",\"sleepy\",\"smooth\",\"snazzy\",\"snug\",\"snuggly\",\"soft\",\"sparkling\",\"spicy\",\"splendid\",\"sprightly\",\"starry\",\"steady\",\"sunny\",\"swift\",\"tender\",\"tidy\",\"toasty\",\"tranquil\",\"twinkly\",\"valiant\",\"vast\",\"velvet\",\"vivid\",\"warm\",\"whimsical\",\"wild\",\"wise\",\"witty\",\"wondrous\",\"zany\",\"zesty\",\"zippy\",\"breezy\",\"bubbly\",\"buzzing\",\"cheeky\",\"cosmic\",\"cozy\",\"crispy\",\"crystalline\",\"cuddly\",\"drifting\",\"dreamy\",\"effervescent\",\"ethereal\",\"fizzy\",\"flickering\",\"floating\",\"floofy\",\"fluttering\",\"foamy\",\"frolicking\",\"fuzzy\",\"giggly\",\"glimmering\",\"glistening\",\"glittery\",\"glowing\",\"goofy\",\"groovy\",\"harmonic\",\"hazy\",\"humming\",\"iridescent\",\"jaunty\",\"jazzy\",\"jiggly\",\"melodic\",\"moonlit\",\"mossy\",\"nifty\",\"peppy\",\"prancy\",\"purrfect\",\"purring\",\"quizzical\",\"rippling\",\"rustling\",\"shimmering\",\"shimmying\",\"snappy\",\"snoopy\",\"squishy\",\"swirling\",\"ticklish\",\"tingly\",\"twinkling\",\"velvety\",\"wiggly\",\"wobbly\",\"woolly\",\"zazzy\",\"abstract\",\"adaptive\",\"agile\",\"async\",\"atomic\",\"binary\",\"cached\",\"compiled\",\"composed\",\"compressed\",\"concurrent\",\"cryptic\",\"curried\",\"declarative\",\"delegated\",\"distributed\",\"dynamic\",\"eager\",\"elegant\",\"encapsulated\",\"enumerated\",\"eventual\",\"expressive\",\"federated\",\"functional\",\"generic\",\"greedy\",\"hashed\",\"idempotent\",\"immutable\",\"imperative\",\"indexed\",\"inherited\",\"iterative\",\"lazy\",\"lexical\",\"linear\",\"linked\",\"logical\",\"memoized\",\"modular\",\"mutable\",\"nested\",\"optimized\",\"parallel\",\"parsed\",\"partitioned\",\"piped\",\"polymorphic\",\"pure\",\"reactive\",\"recursive\",\"refactored\",\"reflective\",\"replicated\",\"resilient\",\"robust\",\"scalable\",\"sequential\",\"serialized\",\"sharded\",\"sorted\",\"staged\",\"stateful\",\"stateless\",\"streamed\",\"structured\",\"synchronous\",\"synthetic\",\"temporal\",\"transient\",\"typed\",\"unified\",\"validated\",\"vectorized\",\"virtual\"],tmB=[\"aurora\",\"avalanche\",\"blossom\",\"breeze\",\"brook\",\"bubble\",\"canyon\",\"cascade\",\"cloud\",\"clover\",\"comet\",\"coral\",\"cosmos\",\"creek\",\"crescent\",\"crystal\",\"dawn\",\"dewdrop\",\"dusk\",\"eclipse\",\"ember\",\"feather\",\"fern\",\"firefly\",\"flame\",\"flurry\",\"fog\",\"forest\",\"frost\",\"galaxy\",\"garden\",\"glacier\",\"glade\",\"grove\",\"harbor\",\"horizon\",\"island\",\"lagoon\",\"lake\",\"leaf\",\"lightning\",\"meadow\",\"meteor\",\"mist\",\"moon\",\"moonbeam\",\"mountain\",\"nebula\",\"nova\",\"ocean\",\"orbit\",\"pebble\",\"petal\",\"pine\",\"planet\",\"pond\",\"puddle\",\"quasar\",\"rain\",\"rainbow\",\"reef\",\"ripple\",\"river\",\"shore\",\"sky\",\"snowflake\",\"spark\",\"spring\",\"star\",\"stardust\",\"starlight\",\"storm\",\"stream\",\"summit\",\"sun\",\"sunbeam\",\"sunrise\",\"sunset\",\"thunder\",\"tide\",\"twilight\",\"valley\",\"volcano\",\"waterfall\",\"wave\",\"willow\",\"wind\",\"alpaca\",\"axolotl\",\"badger\",\"bear\",\"beaver\",\"bee\",\"bird\",\"bumblebee\",\"bunny\",\"cat\",\"chipmunk\",\"crab\",\"crane\",\"deer\",\"dolphin\",\"dove\",\"dragon\",\"dragonfly\",\"duckling\",\"eagle\",\"elephant\",\"falcon\",\"finch\",\"flamingo\",\"fox\",\"frog\",\"giraffe\",\"goose\",\"hamster\",\"hare\",\"hedgehog\",\"hippo\",\"hummingbird\",\"jellyfish\",\"kitten\",\"koala\",\"ladybug\",\"lark\",\"lemur\",\"llama\",\"lobster\",\"lynx\",\"manatee\",\"meerkat\",\"moth\",\"narwhal\",\"newt\",\"octopus\",\"otter\",\"owl\",\"panda\",\"parrot\",\"peacock\",\"pelican\",\"penguin\",\"phoenix\",\"piglet\",\"platypus\",\"pony\",\"porcupine\",\"puffin\",\"puppy\",\"quail\",\"quokka\",\"rabbit\",\"raccoon\",\"raven\",\"robin\",\"salamander\",\"seahorse\",\"seal\",\"sloth\",\"snail\",\"sparrow\",\"sphinx\",\"squid\",\"squirrel\",\"starfish\",\"swan\",\"tiger\",\"toucan\",\"turtle\",\"unicorn\",\"walrus\",\"whale\",\"wolf\",\"wombat\",\"wren\",\"yeti\",\"zebra\",\"acorn\",\"anchor\",\"balloon\",\"beacon\",\"biscuit\",\"blanket\",\"bonbon\",\"book\",\"boot\",\"cake\",\"candle\",\"candy\",\"castle\",\"charm\",\"clock\",\"cocoa\",\"cookie\",\"crayon\",\"crown\",\"cupcake\",\"donut\",\"dream\",\"fairy\",\"fiddle\",\"flask\",\"flute\",\"fountain\",\"gadget\",\"gem\",\"gizmo\",\"globe\",\"goblet\",\"hammock\",\"harp\",\"haven\",\"hearth\",\"honey\",\"journal\",\"kazoo\",\"kettle\",\"key\",\"kite\",\"lantern\",\"lemon\",\"lighthouse\",\"locket\",\"lollipop\",\"mango\",\"map\",\"marble\",\"marshmallow\",\"melody\",\"mitten\",\"mochi\",\"muffin\",\"music\",\"nest\",\"noodle\",\"oasis\",\"origami\",\"pancake\",\"parasol\",\"peach\",\"pearl\",\"pebble\",\"pie\",\"pillow\",\"pinwheel\",\"pixel\",\"pizza\",\"plum\",\"popcorn\",\"pretzel\",\"prism\",\"pudding\",\"pumpkin\",\"puzzle\",\"quiche\",\"quill\",\"quilt\",\"riddle\",\"rocket\",\"rose\",\"scone\",\"scroll\",\"shell\",\"sketch\",\"snowglobe\",\"sonnet\",\"sparkle\",\"spindle\",\"sprout\",\"sundae\",\"swing\",\"taco\",\"teacup\",\"teapot\",\"thimble\",\"toast\",\"token\",\"tome\",\"tower\",\"treasure\",\"treehouse\",\"trinket\",\"truffle\",\"tulip\",\"umbrella\",\"waffle\",\"wand\",\"whisper\",\"whistle\",\"widget\",\"wreath\",\"zephyr\",\"abelson\",\"adleman\",\"aho\",\"allen\",\"babbage\",\"bachman\",\"backus\",\"barto\",\"bengio\",\"bentley\",\"blum\",\"boole\",\"brooks\",\"catmull\",\"cerf\",\"cherny\",\"church\",\"clarke\",\"cocke\",\"codd\",\"conway\",\"cook\",\"corbato\",\"cray\",\"curry\",\"dahl\",\"diffie\",\"dijkstra\",\"dongarra\",\"eich\",\"emerson\",\"engelbart\",\"feigenbaum\",\"floyd\",\"gosling\",\"graham\",\"gray\",\"hamming\",\"hanrahan\",\"hartmanis\",\"hejlsberg\",\"hellman\",\"hennessy\",\"hickey\",\"hinton\",\"hoare\",\"hollerith\",\"hopcroft\",\"hopper\",\"iverson\",\"kahan\",\"kahn\",\"karp\",\"kay\",\"kernighan\",\"knuth\",\"kurzweil\",\"lamport\",\"lampson\",\"lecun\",\"lerdorf\",\"liskov\",\"lovelace\",\"matsumoto\",\"mccarthy\",\"metcalfe\",\"micali\",\"milner\",\"minsky\",\"moler\",\"moore\",\"naur\",\"neumann\",\"newell\",\"nygaard\",\"papert\",\"parnas\",\"pascal\",\"patterson\",\"pearl\",\"perlis\",\"pike\",\"pnueli\",\"rabin\",\"reddy\",\"ritchie\",\"rivest\",\"rossum\",\"russell\",\"scott\",\"sedgewick\",\"shamir\",\"shannon\",\"sifakis\",\"simon\",\"stallman\",\"stearns\",\"steele\",\"stonebraker\",\"stroustrup\",\"sutherland\",\"sutton\",\"tarjan\",\"thacker\",\"thompson\",\"torvalds\",\"turing\",\"ullman\",\"valiant\",\"wadler\",\"wall\",\"wigderson\",\"wilkes\",\"wilkinson\",\"wirth\",\"wozniak\",\"yao\"],emB=[\"baking\",\"beaming\",\"booping\",\"bouncing\",\"brewing\",\"bubbling\",\"chasing\",\"churning\",\"coalescing\",\"conjuring\",\"cooking\",\"crafting\",\"crunching\",\"cuddling\",\"dancing\",\"dazzling\",\"discovering\",\"doodling\",\"dreaming\",\"drifting\",\"enchanting\",\"exploring\",\"finding\",\"floating\",\"fluttering\",\"foraging\",\"forging\",\"frolicking\",\"gathering\",\"giggling\",\"gliding\",\"greeting\",\"growing\",\"hatching\",\"herding\",\"honking\",\"hopping\",\"hugging\",\"humming\",\"imagining\",\"inventing\",\"jingling\",\"juggling\",\"jumping\",\"kindling\",\"knitting\",\"launching\",\"leaping\",\"mapping\",\"marinating\",\"meandering\",\"mixing\",\"moseying\",\"munching\",\"napping\",\"nibbling\",\"noodling\",\"orbiting\",\"painting\",\"percolating\",\"petting\",\"plotting\",\"pondering\",\"popping\",\"prancing\",\"purring\",\"puzzling\",\"questing\",\"riding\",\"roaming\",\"rolling\",\"sauteeing\",\"scribbling\",\"seeking\",\"shimmying\",\"singing\",\"skipping\",\"sleeping\",\"snacking\",\"sniffing\",\"snuggling\",\"soaring\",\"sparking\",\"spinning\",\"splashing\",\"sprouting\",\"squishing\",\"stargazing\",\"stirring\",\"strolling\",\"swimming\",\"swinging\",\"tickling\",\"tinkering\",\"toasting\",\"tumbling\",\"twirling\",\"waddling\",\"wandering\",\"watching\",\"weaving\",\"whistling\",\"wibbling\",\"wiggling\",\"wishing\",\"wobbling\",\"wondering\",\"yawning\",\"zooming\"];FiG=smB.length*emB.length*tmB.length});import{join as I_A}from\"path\";function eT3(A){let Q=A??h0(),B=PEA(),G=B.get(Q);if(!G){let Z=Hw();for(let Y=0;Y<tT3;Y++){G=AdB();let J=I_A(Z,`${G}.md`);if(!jA().existsSync(J))break}B.set(Q,G)}return G}function AP3(A,Q){PEA().set(A,Q)}function Hw(){let A=I_A(vQ(),\"plans\");if(!jA().existsSync(A))try{jA().mkdirSync(A)}catch(Q){t(Q instanceof Error?Q:Error(String(Q)))}return A}function rC(A){let Q=eT3(h0());if(!A)return I_A(Hw(),`${Q}.md`);return I_A(Hw(),`${Q}-agent-${A}.md`)}function Jz(A){let Q=rC(A);if(!jA().existsSync(Q))return null;try{return jA().readFileSync(Q,{encoding:\"utf-8\"})}catch(B){return t(B instanceof Error?B:Error(String(B))),null}}function I91(A){let Q=A.messages.find((G)=>G.slug)?.slug;if(!Q)return!1;AP3(h0(),Q);let B=I_A(Hw(),`${Q}.md`);return jA().existsSync(B)}var tT3=10;var sC=O(()=>{o0();HQ();AB();c1();QdB()});import{readFileSync as BdB,writeFileSync as QP3,appendFileSync as BP3,unlinkSync as GP3,mkdirSync as GdB,existsSync as ZIA,statSync as ZP3,readdirSync as YP3}from\"fs\";import{dirname as JP3,join as r00}from\"path\";function W_A(){return r00(W91(),\"tasks\")}function ZdB(){let A=W_A();if(!ZIA(A))GdB(A,{recursive:!0})}function Dw(A){return r00(W_A(),`${A}.output`)}function ku(A,Q){try{ZdB();let B=Dw(A),G=JP3(B);if(!ZIA(G))GdB(G,{recursive:!0});BP3(B,Q,\"utf8\")}catch(B){t(B instanceof Error?B:Error(String(B)))}}function s00(A,Q){try{let B=Dw(A);if(!ZIA(B))return{content:\"\",newOffset:Q};let Z=ZP3(B).size;if(Z<=Q)return{content:\"\",newOffset:Q};return{content:BdB(B,\"utf8\").slice(Q),newOffset:Z}}catch(B){return t(B instanceof Error?B:Error(String(B))),{content:\"\",newOffset:Q}}}function YIA(A){try{let Q=Dw(A);if(!ZIA(Q))return\"\";return BdB(Q,\"utf8\")}catch(Q){return t(Q instanceof Error?Q:Error(String(Q))),\"\"}}function bu(A){ZdB();let Q=Dw(A);if(!ZIA(Q))QP3(Q,\"\",\"utf8\");return Q}function YdB(){try{let A=W_A();if(!ZIA(A))return;let Q=YP3(A);for(let B of Q)if(B.endsWith(\".output\"))try{GP3(r00(A,B))}catch{}}catch{}}var Fw=O(()=>{c1();NY()});function JIA(A){let Q=`${W_A()}/`,B=\".output\";if(A.startsWith(Q)&&A.endsWith(\".output\")){let G=A.slice(Q.length,-7);if(G.length>0&&G.length<=20&&/^[a-zA-Z0-9_-]+$/.test(G))return G}return null}function JdB({file_path:A,offset:Q,limit:B},{verbose:G}){if(!A)return null;if(JIA(A))return\"\";let Z=r3(A);if(G&&(Q||B)){let Y=Q??1,J=B?`lines ${Y}-${Y+B-1}`:`from line ${Y}`;return`${Z} · ${J}`}return Z}function XdB({file_path:A}){let Q=A?JIA(A):null;if(!Q)return null;return j5.createElement(T,{flexWrap:\"nowrap\",marginLeft:1},j5.createElement(C,{dimColor:!0},Q))}function IdB(){return null}function WdB(A){switch(A.type){case\"image\":{let{originalSize:Q}=A.file,B=HI(Q);return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read image (\",B,\")\"))}case\"notebook\":{let{cells:Q}=A.file;if(!Q||Q.length<1)return j5.createElement(C,{color:\"error\"},\"No cells found in notebook\");return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read \",j5.createElement(C,{bold:!0},Q.length),\" cells\"))}case\"pdf\":{let{originalSize:Q}=A.file,B=HI(Q);return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read PDF (\",B,\")\"))}case\"text\":{let{numLines:Q}=A.file;return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read \",j5.createElement(C,{bold:!0},Q),\" \",Q===1?\"line\":\"lines\"))}}}function KdB(){return j5.createElement(t5,null)}function VdB(A,{verbose:Q}){if(!Q&&typeof A===\"string\"&&Q9(A,\"tool_use_error\"))return j5.createElement(k0,null,j5.createElement(C,{color:\"error\"},\"Error reading file\"));return j5.createElement(o3,{result:A,verbose:Q})}function HdB(A){if(A?.file_path?.startsWith(Hw()))return\"Reading Plan\";if(A?.file_path&&JIA(A.file_path))return\"Read agent output\";return\"Read\"}function DdB(A){if(!A?.file_path)return null;let Q=JIA(A.file_path);if(Q)return Q;return r3(A.file_path)}var j5;var t00=O(()=>{bA();lH();TK();k4();i9();EB();sC();Fw();j5=l(JA(),1)});import{createHash as FdB}from\"crypto\";function XP3(A){return FdB(\"sha256\").update(A).digest(\"hex\").slice(0,16)}function IP3(A){return FdB(\"sha256\").update(A).digest(\"hex\")}function ev(A){let Q={operation:A.operation,tool:A.tool,filePathHash:XP3(A.filePath)};if(A.content!==void 0&&A.content.length<=WP3)Q.contentHash=IP3(A.content);if(A.type!==void 0)Q.type=A.type;n(\"tengu_file_operation\",Q)}var WP3=102400;var K91=O(()=>{N0()});import*as e00 from\"path\";async function EdB(A,Q,{maxSizeBytes:B=K_A,maxTokens:G=QQ0}){if(!V91.has(Q)&&A.length>B)throw Error(AQ0(A.length,B));let Z=iG(A);if(!Z||Z<=G/4)return;let Y=await mmB(A);if(Y&&Y>G)throw new D91(Y,G)}function H91(A,Q,B,G){return{type:\"image\",file:{base64:A.toString(\"base64\"),type:`image/${Q}`,originalSize:B,dimensions:G}}}async function zP3(A,Q){let G=jA().statSync(A).size,Z=jA().readFileBytesSync(A),Y=BA1(Z);try{let J=await _DB(Z,Q,Y);return{type:\"image\",file:{base64:J.base64,type:J.mediaType,originalSize:G}}}catch(J){t(J);try{let X=await Promise.resolve().then(() => l(qi1(),1)),W=await(X.default||X)(Z).resize(400,400,{fit:\"inside\",withoutEnlargement:!0}).jpeg({quality:20}).toBuffer();return H91(W,\"jpeg\",G)}catch(X){t(X);let I=Y.split(\"/\")[1]||\"png\";return H91(Z,I,G)}}}async function CP3(A,Q){let G=jA().statSync(A).size;if(G===0)throw Error(`Image file is empty: ${A}`);let Z=jA().readFileBytesSync(A),J=BA1(Z).split(\"/\")[1]||\"png\";try{let X=await fYA(Z,G,J);return H91(X.buffer,X.mediaType,G,X.dimensions)}catch(X){return t(X),H91(Z,J,G)}}async function BQ0(A,Q=QQ0,B=A.split(\".\").pop()?.toLowerCase()||\"png\"){let G=await CP3(A,B);if(Math.ceil(G.file.base64.length*0.125)>Q)return await zP3(A,Q);return G}var KP3,QQ0=25000,D91,V91,VP3,HP3,DP3,FP3,W3,EP3=`\n\n"}]}]
caozhiyuan · 9 months ago

This is just a simple example. In real scenarios, if the bash output is very long (length greater than 100k), it can only be dumped into the prompt.

caozhiyuan · 9 months ago

log in windows.

{
	"model": "",
	"messages": [{
		"role": "user",
		"content": [{
			"type": "text",
			"text": "Command: grep -B30 \"zdB(W,K,B)\" cli.js | head -40\nOutput:           $result = New-Object -TypeName PSObject\n          $result | Add-Member -MemberType NoteProperty -Name ExpiresOn -Value $token.ExpiresOn\n          if ($useSecureString) {\n            $result | Add-Member -MemberType NoteProperty -Name Token -Value (ConvertFrom-SecureString -AsPlainText $token.Token)\n          } else {\n            $result | Add-Member -MemberType NoteProperty -Name Token -Value $token.Token\n          }\n\n          Write-Output (ConvertTo-Json $result)\n          `]]))[0];return LT3(Y)}throw Error(\"Unable to execute PowerShell. Ensure that it is installed in your system\")}async getToken(A,Q={}){return iJ.withSpan(`${this.constructor.name}.getToken`,Q,async()=>{let B=gC(this.tenantId,Q,this.additionallyAllowedTenantIds),G=typeof A===\"string\"?A:A[0];if(B)Qw(Su,B);try{eXA(G,Su),Su.getToken.info(`Using the scope ${G}`);let Z=t21(G),Y=await this.getAzurePowerShellAccessToken(Z,B,this.timeout);return Su.getToken.info(cH(A)),{token:Y.Token,expiresOnTimestamp:new Date(Y.ExpiresOn).getTime(),tokenType:\"Bearer\"}}catch(Z){if(NT3(Z)){let J=new F4(T00.installed);throw Su.getToken.info(UG(G,J)),J}else if(qT3(Z)){let J=new F4(T00.login);throw Su.getToken.info(UG(G,J)),J}let Y=new F4(`${Z}. ${T00.troubleshoot}`);throw Su.getToken.info(UG(G,Y)),Y}})}}async function LT3(A){let Q=/{[^{}]*}/g,B=A.match(Q),G=A;if(B)try{for(let Z of B)try{let Y=JSON.parse(Z);if(Y===null||Y===void 0?void 0:Y.Token){if(G=G.replace(Z,\"\"),G)Su.getToken.warning(G);return Y}}catch(Y){continue}}catch(Z){throw Error(`Unable to parse the output of PowerShell. Received output: ${A}`)}throw Error(`No access token found in the output. Received output: ${A}`)}var Su,FmB,zmB,T00,qT3=(A)=>A.message.match(`(.*)${zmB.login}(.*)`),NT3=(A)=>A.message.match(zmB.installed),P00;var CmB=O(()=>{bT();HW();AIA();hC();HmB();dN();Su=h7(\"AzurePowerShellCredential\"),FmB=process.platform===\"win32\";zmB={login:\"Run Connect-AzAccount to login\",installed:\"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory\"},T00={login:\"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.\",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: \"Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force\".`,troubleshoot:\"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot.\"},P00=[EmB(\"pwsh\")];if(FmB)P00.push(EmB(\"powershell\"))});class y00{constructor(...A){this._sources=[],this._sources=A}async getToken(A,Q={}){let{token:B}=await this.getTokenInternal(A,Q);return B}async getTokenInternal(A,Q={}){let B=null,G,Z=[];return iJ.withSpan(\"ChainedTokenCredential.getToken\",Q,async(Y)=>{for(let J=0;J<this._sources.length&&B===null;J++)try{B=await this._sources[J].getToken(A,Y),G=this._sources[J]}catch(X){if(X.name===\"CredentialUnavailableError\"||X.name===\"AuthenticationRequiredError\")Z.push(X);else throw x00.getToken.info(UG(A,X)),X}if(!B&&Z.length>0){let J=new _t1(Z,\"ChainedTokenCredential authentication failed.\");throw x00.getToken.info(UG(A,J)),J}if(x00.getToken.info(`Result for ${G.constructor.name}: ${cH(A)}`),B===null)throw new F4(\"Failed to retrieve a valid token\");return{token:B,successfulCredential:G}})}}var x00;var $mB=O(()=>{hC();HW();dN();x00=h7(\"ChainedTokenCredential\")});import{createHash as UmB,createPrivateKey as OT3}from\"node:crypto\";import{readFile as MT3}from\"node:fs/promises\";class v00{constructor(A,Q,B,G={}){if(!A||!Q)throw Error(`${Y_A}: tenantId and clientId are required parameters.`);this.tenantId=A,this.additionallyAllowedTenantIds=Bw(G===null||G===void 0?void 0:G.additionallyAllowedTenants),this.sendCertificateChain=G.sendCertificateChain,this.certificateConfiguration=Object.assign({},typeof B===\"string\"?{certificatePath:B}:B);let Z=this.certificateConfiguration.certificate,Y=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(Z||Y))throw Error(`${Y_A}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(Z&&Y)throw Error(`${Y_A}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=Za(Q,A,Object.assign(Object.assign({},G),{logger:wmB,tokenCredentialOptions:G}))}async getToken(A,Q={}){return iJ.withSpan(`${Y_A}.getToken`,Q,async(B)=>{B.tenantId=gC(this.tenantId,B,this.additionallyAllowedTenantIds,wmB);let G=Array.isArray(A)?A:[A],Z=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(G,Z,B)})}async buildClientCertificate(){var A;let Q=await RT3(this.certificateConfiguration,(A=this.sendCertificateChain)!==null&&A!==void 0?A:!1),B;if(this.certificateConfiguration.certificatePassword!==void 0)B=OT3({key:Q.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:\"pem\"}).export({format:\"pem\",type:\"pkcs8\"}).toString();else B=Q.certificateContents;return{thumbprint:Q.thumbprint,thumbprintSha256:Q.thumbprintSha256,privateKey:B,x5c:Q.x5c}}}async function RT3(A,Q){let{certificate:B,certificatePath:G}=A,Z=B||await MT3(G,\"utf8\"),Y=Q?Z:void 0,J=/(-+BEGIN CERTIFICATE-+)(\\n\\r?|\\r\\n?)([A-Za-z0-9+/\\n\\r]+=*)(\\n\\r?|\\r\\n?)(-+END CERTIFICATE-+)/g,X=[],I;do if(I=J.exec(Z),I)X.push(I[3]);while(I);if(X.length===0)throw Error(\"The file at the specified path does not contain a PEM-encoded certificate.\");let W=UmB(\"sha1\").update(Buffer.from(X[0],\"base64\")).digest(\"hex\").toUpperCase(),K=UmB(\"sha256\").update(Buffer.from(X[0],\"base64\")).digest(\"hex\").toUpperCase();return{certificateContents:Z,thumbprintSha256:K,thumbprint:W,x5c:Y}}var Y_A=\"ClientCertificateCredential\",wmB;var qmB=O(()=>{G_A();bT();HW();dN();wmB=h7(Y_A)});class k00{constructor(A,Q,B,G={}){if(!A)throw new F4(\"ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.\");if(!Q)throw new F4(\"ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.\");if(!B)throw new F4(\"ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.\");this.clientSecret=B,this.tenantId=A,this.additionallyAllowedTenantIds=Bw(G===null||G===void 0?void 0:G.additionallyAllowedTenants),this.msalClient=Za(Q,A,Object.assign(Object.assign({},G),{logger:NmB,tokenCredentialOptions:G}))}async getToken(A,Q={}){return iJ.withSpan(`${this.constructor.name}.getToken`,Q,async(B)=>{B.tenantId=gC(this.tenantId,B,this.additionallyAllowedTenantIds,NmB);let G=s21(A);return this.msalClient.getTokenByClientSecret(G,this.clientSecret,B)})}}var NmB;var LmB=O(()=>{G_A();bT();hC();HW();AIA();dN();NmB=h7(\"ClientSecretCredential\")});class b00{constructor(A,Q,B,G,Z={}){if(!A)throw new F4(\"UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.\");if(!Q)throw new F4(\"UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.\");if(!B)throw new F4(\"UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.\");if(!G)throw new F4(\"UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.\");this.tenantId=A,this.additionallyAllowedTenantIds=Bw(Z===null||Z===void 0?void 0:Z.additionallyAllowedTenants),this.username=B,this.password=G,this.msalClient=Za(Q,this.tenantId,Object.assign(Object.assign({},Z),{tokenCredentialOptions:Z!==null&&Z!==void 0?Z:{}}))}async getToken(A,Q={}){return iJ.withSpan(`${this.constructor.name}.getToken`,Q,async(B)=>{B.tenantId=gC(this.tenantId,B,this.additionallyAllowedTenantIds,_T3);let G=s21(A);return this.msalClient.getTokenByUsernamePassword(G,this.username,this.password,B)})}}var _T3;var OmB=O(()=>{G_A();bT();hC();HW();AIA();dN();_T3=h7(\"UsernamePasswordCredential\")});function TT3(){var A;return((A=process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS)!==null&&A!==void 0?A:\"\").split(\";\")}function PT3(){var A;let Q=((A=process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN)!==null&&A!==void 0?A:\"\").toLowerCase(),B=Q===\"true\"||Q===\"1\";return xu.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${B}`),B}class f00{constructor(A){this._credential=void 0;let Q=uQ1(jT3).assigned.join(\", \");xu.info(`Found the following environment variables: ${Q}`);let B=process.env.AZURE_TENANT_ID,G=process.env.AZURE_CLIENT_ID,Z=process.env.AZURE_CLIENT_SECRET,Y=TT3(),J=PT3(),X=Object.assign(Object.assign({},A),{additionallyAllowedTenantIds:Y,sendCertificateChain:J});if(B)Qw(xu,B);if(B&&G&&Z){xu.info(`Invoking ClientSecretCredential with tenant ID: ${B}, clientId: ${G} and clientSecret: [REDACTED]`),this._credential=new k00(B,G,Z,X);return}let I=process.env.AZURE_CLIENT_CERTIFICATE_PATH,W=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(B&&G&&I){xu.info(`Invoking ClientCertificateCredential with tenant ID: ${B}, clientId: ${G} and certificatePath: ${I}`),this._credential=new v00(B,G,{certificatePath:I,certificatePassword:W},X);return}let K=process.env.AZURE_USERNAME,V=process.env.AZURE_PASSWORD;if(B&&G&&K&&V)xu.info(`Invoking UsernamePasswordCredential with tenant ID: ${B}, clientId: ${G} and username: ${K}`),xu.warning(\"Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa.\"),this._credential=new b00(B,G,K,V,X)}async getToken(A,Q={}){return iJ.withSpan(`${e21}.getToken`,Q,async(B)=>{if(this._credential)try{let G=await this._credential.getToken(A,B);return xu.getToken.info(cH(A)),G}catch(G){let Z=new GMA(400,{error:`${e21} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:G.message.toString().split(\"More details:\").join(\"\")});throw xu.getToken.info(UG(A,Z)),Z}throw new F4(`${e21} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}}var jT3,e21=\"EnvironmentCredential\",xu;var MmB=O(()=>{hC();HW();qmB();LmB();OmB();bT();dN();jT3=[\"AZURE_TENANT_ID\",\"AZURE_CLIENT_ID\",\"AZURE_CLIENT_SECRET\",\"AZURE_CLIENT_CERTIFICATE_PATH\",\"AZURE_CLIENT_CERTIFICATE_PASSWORD\",\"AZURE_USERNAME\",\"AZURE_PASSWORD\",\"AZURE_ADDITIONALLY_ALLOWED_TENANTS\",\"AZURE_CLIENT_SEND_CERTIFICATE_CHAIN\"];xu=h7(e21)});function ST3(A={}){var Q,B,G,Z;(Q=A.retryOptions)!==null&&Q!==void 0||(A.retryOptions={maxRetries:5,retryDelayInMs:800});let Y=(B=A===null||A===void 0?void 0:A.managedIdentityClientId)!==null&&B!==void 0?B:process.env.AZURE_CLIENT_ID,J=(G=A===null||A===void 0?void 0:A.workloadIdentityClientId)!==null&&G!==void 0?G:Y,X=A===null||A===void 0?void 0:A.managedIdentityResourceId,I=process.env.AZURE_FEDERATED_TOKEN_FILE,W=(Z=A===null||A===void 0?void 0:A.tenantId)!==null&&Z!==void 0?Z:process.env.AZURE_TENANT_ID;if(X){let K=Object.assign(Object.assign({},A),{resourceId:X});return new tXA(K)}if(I&&J){let K=Object.assign(Object.assign({},A),{tenantId:W});return new tXA(J,K)}if(Y){let K=Object.assign(Object.assign({},A),{clientId:Y});return new tXA(K)}return new tXA(A)}function xT3(A){var Q,B,G;let Z=(Q=A===null||A===void 0?void 0:A.managedIdentityClientId)!==null&&Q!==void 0?Q:process.env.AZURE_CLIENT_ID,Y=(B=A===null||A===void 0?void 0:A.workloadIdentityClientId)!==null&&B!==void 0?B:Z,J=process.env.AZURE_FEDERATED_TOKEN_FILE,X=(G=A===null||A===void 0?void 0:A.tenantId)!==null&&G!==void 0?G:process.env.AZURE_TENANT_ID;if(J&&Y){let I=Object.assign(Object.assign({},A),{tenantId:X,clientId:Y,tokenFilePath:J});return new GBA(I)}if(X){let I=Object.assign(Object.assign({},A),{tenantId:X});return new GBA(I)}return new GBA(A)}function yT3(A={}){let Q=A.processTimeoutInMs;return new j00(Object.assign({processTimeoutInMs:Q},A))}function vT3(A={}){let Q=A.processTimeoutInMs;return new _00(Object.assign({processTimeoutInMs:Q},A))}function kT3(A={}){let Q=A.processTimeoutInMs;return new S00(Object.assign({processTimeoutInMs:Q},A))}function bT3(A={}){return new f00(A)}class RmB{constructor(A,Q){this.credentialName=A,this.credentialUnavailableErrorMessage=Q}getToken(){return h00.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}}var h00,A91;var _mB=O(()=>{ZmB();XmB();WmB();CmB();$mB();MmB();O00();HW();h00=h7(\"DefaultAzureCredential\");A91=class A91 extends y00{constructor(A){let Q=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,B=[vT3,kT3,yT3],G=[bT3,xT3,ST3],Z=[];if(Q)switch(Q){case\"dev\":Z=B;break;case\"prod\":Z=G;break;default:{let J=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev'.`;throw h00.warning(J),Error(J)}}else Z=[...G,...B];let Y=Z.map((J)=>{try{return J(A)}catch(X){return h00.warning(`Skipped ${J.name} because of an error creating the credential: ${X}`),new RmB(J.name,X.message)}});super(...Y)}}});function g00(A,Q,B){let{abortSignal:G,tracingOptions:Z}=B||{},Y=HMA();Y.addPolicy($MA({credential:A,scopes:Q}));async function J(){var X;let W=(X=(await Y.sendRequest({sendRequest:(K)=>Promise.resolve({request:K,status:200,headers:K.headers})},gT({url:\"https://example.com\",abortSignal:G,tracingOptions:Z}))).headers.get(\"authorization\"))===null||X===void 0?void 0:X.split(\" \")[1];if(!W)throw Error(\"Failed to get access token\");return W}return J}var jmB=O(()=>{Wu()});var TmB=O(()=>{_mB();jmB();yvB()});function Q91(){return{error:(A,...Q)=>console.error(\"[Anthropic SDK ERROR]\",A,...Q),warn:(A,...Q)=>console.error(\"[Anthropic SDK WARN]\",A,...Q),info:(A,...Q)=>console.error(\"[Anthropic SDK INFO]\",A,...Q),debug:(A,...Q)=>console.error(\"[Anthropic SDK DEBUG]\",A,...Q)}}async function oC({apiKey:A,maxRetries:Q,model:B,fetchOverride:G}){let Z=process.env.CLAUDE_CODE_CONTAINER_ID,Y=process.env.CLAUDE_CODE_REMOTE_SESSION_ID,J={\"x-app\":\"cli\",\"User-Agent\":Yi(),...hT3(),...Z?{\"x-claude-remote-container-id\":Z}:{},...Y?{\"x-claude-remote-session-id\":Y}:{}};if(F0(process.env.CLAUDE_CODE_ADDITIONAL_PROTECTION))J[\"x-anthropic-additional-protection\"]=\"true\";if(await Vg(),!zB())fT3(J,q9());let I={defaultHeaders:J,maxRetries:Q,timeout:parseInt(process.env.API_TIMEOUT_MS||String(600000),10),dangerouslyAllowBrowser:!0,fetchOptions:FZA(),...G&&{fetch:G}};if(F0(process.env.CLAUDE_CODE_USE_BEDROCK)){let K=B===UK()&&process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION?process.env.ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:bt(),V={...I,awsRegion:K,...F0(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&{skipAuth:!0},...Lx()&&{logger:Q91()}};if(process.env.AWS_BEARER_TOKEN_BEDROCK)V.skipAuth=!0,V.defaultHeaders={...V.defaultHeaders,Authorization:`Bearer ${process.env.AWS_BEARER_TOKEN_BEDROCK}`};else if(!F0(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)){let H=await X1A();if(H)V.awsAccessKey=H.accessKeyId,V.awsSecretKey=H.secretAccessKey,V.awsSessionToken=H.sessionToken}return new k01(V)}if(F0(process.env.CLAUDE_CODE_USE_FOUNDRY)){let K;if(!process.env.ANTHROPIC_FOUNDRY_API_KEY)if(F0(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH))K=()=>Promise.resolve(\"\");else K=g00(new A91,\"https://cognitiveservices.azure.com/.default\");let V={...I,...K&&{azureADTokenProvider:K},...Lx()&&{logger:Q91()}};return new g01(V)}if(F0(process.env.CLAUDE_CODE_USE_VERTEX)){let K=process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project,V=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials,H=F0(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)?{getClient:()=>({getRequestHeaders:()=>({})})}:new PmB.GoogleAuth({scopes:[\"https://www.googleapis.com/auth/cloud-platform\"],...K||V?{}:{projectId:process.env.ANTHROPIC_VERTEX_PROJECT_ID}}),D={...I,region:ofA(B),googleAuth:H,...Lx()&&{logger:Q91()}};return new yQ1(D)}let W={apiKey:zB()?null:A||eq(),authToken:zB()?d6()?.accessToken:void 0,...{},...I,...Lx()&&{logger:Q91()}};return new OT(W)}function fT3(A,Q){let B=process.env.ANTHROPIC_AUTH_TOKEN||vqA(Q);if(B)A.Authorization=`Bearer ${B}`}function hT3(){let A={},Q=process.env.ANTHROPIC_CUSTOM_HEADERS;if(!Q)return A;let B=Q.split(/\\n|\\r\\n/);for(let G of B){if(!G.trim())continue;let Z=G.match(/^\\s*(.*?)\\s*:\\s*(.*?)\\s*$/);if(Z){let[,Y,J]=Z;if(Y&&J!==void 0)A[Y]=J}}return A}var PmB;var ZBA=O(()=>{NOB();jOB();jv();TSB();TmB();V2();o0();dE();AB();Bi();cY();Q0();J9();PmB=l(Ht1(),1)});import{createHash as ymB}from\"crypto\";import{dirname as B91,join as vmB}from\"path\";import*as kmB from\"path\";function u00(){return!1}async function gT3(A,Q,B){if(!u00())return await B();let G=ymB(\"sha1\").update(JSON.stringify(A)).digest(\"hex\").slice(0,12),Z=vmB(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT??t1(),`fixtures/${Q}-${G}.json`);if(jA().existsSync(Z))return JSON.parse(jA().readFileSync(Z,{encoding:\"utf8\"}));if(DQ.isCI)throw Error(`Fixture missing: ${Z}. Re-run npm test locally, then commit the result.`);let Y=await B();if(!jA().existsSync(B91(Z)))jA().mkdirSync(B91(Z));return jA().writeFileSync(Z,JSON.stringify(Y,null,2),{encoding:\"utf8\",flush:!1}),Y}async function m00(A,Q){if(!u00())return await Q();let B=GJ(A.filter((J)=>{if(J.type!==\"user\")return!0;if(J.isMeta)return!1;return!0})),G=mT3(B.map((J)=>J.message.content),xmB),Z=vmB(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT??t1(),`fixtures/${G.map((J)=>ymB(\"sha1\").update(JSON.stringify(J)).digest(\"hex\").slice(0,6)).join(\"-\")}.json`);if(jA().existsSync(Z)){let J=JSON.parse(jA().readFileSync(Z,{encoding:\"utf8\"}));return J.output.forEach(uT3),J.output.map((X,I)=>SmB(X,pT3,I))}if(DQ.isCI)throw Error(`Anthropic API fixture missing: ${Z}. Re-run npm test locally, then commit the result. Input messages:\n${JSON.stringify(G,null,2)}`);let Y=await Q();if(DQ.isCI)return Y;if(!jA().existsSync(B91(Z)))jA().mkdirSync(B91(Z));return jA().writeFileSync(Z,JSON.stringify({input:G,output:Y.map((J,X)=>SmB(J,xmB,X))},null,2),{encoding:\"utf8\",flush:!1}),Y}function uT3(A){if(A.type===\"stream_event\")return;let Q=A.message.model,B=A.message.usage,G=zrA(Q,B);HrA(G,B,Q)}function mT3(A,Q){return A.map((B)=>{if(typeof B===\"string\")return Q(B);return B.map((G)=>{switch(G.type){case\"tool_result\":if(typeof G.content===\"string\")return{...G,content:Q(G.content)};if(Array.isArray(G.content))return{...G,content:G.content.map((Z)=>{switch(Z.type){case\"text\":return{...Z,text:Q(Z.text)};case\"image\":return Z;default:return}})};return G;case\"text\":return{...G,text:Q(G.text)};case\"tool_use\":return{...G,input:G91(G.input,Q)};case\"image\":return G;default:return}})})}function G91(A,Q){return Ye(A,(B,G)=>{if(Array.isArray(B))return B.map((Z)=>G91(Z,Q));if(k8A(B))return G91(B,Q);return Q(B,G,A)})}function dT3(A,Q,B){return{uuid:`UUID-${B}`,requestId:\"REQUEST_ID\",timestamp:A.timestamp,message:{...A.message,content:A.message.content.map((G)=>{switch(G.type){case\"text\":return{...G,text:Q(G.text),citations:G.citations||[]};case\"tool_use\":return{...G,input:G91(G.input,Q)};default:return G}}).filter(Boolean)},type:\"assistant\"}}function SmB(A,Q,B){if(A.type===\"assistant\")return dT3(A,Q,B);else return A}function xmB(A){if(typeof A!==\"string\")return A;let Q=A.replace(/num_files=\"\\d+\"/g,'num_files=\"[NUM]\"').replace(/duration_ms=\"\\d+\"/g,'duration_ms=\"[DURATION]\"').replace(/cost_usd=\"\\d+\"/g,'cost_usd=\"[COST]\"').replace(/\\//g,kmB.sep).replaceAll(vQ(),\"[CONFIG_HOME]\").replaceAll(t1(),\"[CWD]\").replace(/Available commands:.+/,\"Available commands: [COMMANDS]\");if(Q.includes(\"Files modified by user:\"))return\"Files modified by user: [FILES]\";return Q}function pT3(A){if(typeof A!==\"string\")return A;return A.replaceAll(\"[NUM]\",\"1\").replaceAll(\"[DURATION]\",\"100\").replaceAll(\"[CONFIG_HOME]\",vQ()).replaceAll(\"[CWD]\",t1())}async function*d00(A,Q){if(!u00())return yield*Q();let B=[],G=await m00(A,async()=>{for await(let Z of Q())B.push(Z);return B});if(G.length>0){yield*G;return}yield*B}async function bmB(A,Q,B){return(await gT3({messages:A,tools:Q},\"token-count\",async()=>({tokenCount:await B()}))).tokenCount}var p00=O(()=>{n5();K2();AB();HQ();YgA();fuA();EB();CrA();zM()});var fmB={};M5(fmB,{isToolSearchEnabled:()=>rv,isToolReferenceBlock:()=>Ya,getMcpMode:()=>cT3,getExternalMcpMode:()=>QIA});function cT3(){if(F0(process.env.ENABLE_TOOL_SEARCH))return\"tst\";if(F0(process.env.ENABLE_MCP_CLI))return\"mcp-cli\";if(AI(process.env.ENABLE_MCP_CLI))return\"standard\";if(AI(process.env.ENABLE_TOOL_SEARCH))return\"standard\";return\"tst\"}function QIA(){if(F0(process.env.ENABLE_TOOL_SEARCH))return\"tst\";if(F0(process.env.ENABLE_EXPERIMENTAL_MCP_CLI))return\"mcp-cli\";if(AI(process.env.ENABLE_TOOL_SEARCH))return\"standard\";if(AI(process.env.ENABLE_EXPERIMENTAL_MCP_CLI))return\"standard\";if(!YW())try{if($M(\"tengu_mcp_tool_search\",!1))return\"tst\"}catch{}return\"standard\"}function rv(){return QIA()===\"tst\"}function Ya(A){return typeof A===\"object\"&&A!==null&&\"type\"in A&&A.type===\"tool_reference\"}var yu=O(()=>{wY();Ki();AB()});function umB(A){for(let Q of A)if(Q.role===\"assistant\"&&Array.isArray(Q.content)){for(let B of Q.content)if(typeof B===\"object\"&&B!==null&&\"type\"in B&&(B.type===\"thinking\"||B.type===\"redacted_thinking\"))return!0}return!1}function lT3(A){return A.map((Q)=>{if(!Array.isArray(Q.content))return Q;let B=Q.content.map((G)=>{if(G.type===\"tool_use\"){let Z=G;return{type:\"tool_use\",id:Z.id,name:Z.name,input:Z.input}}if(G.type===\"tool_result\"){let Z=G;if(Array.isArray(Z.content)){let Y=Z.content.filter((J)=>!Ya(J));if(Y.length===0)return{...Z,content:[{type:\"text\",text:\"[tool references]\"}]};if(Y.length!==Z.content.length)return{...Z,content:Y}}}return G});return{...Q,content:B}})}async function mmB(A){if(!A)return 0;return J_A([{role:\"user\",content:A}],[])}async function J_A(A,Q){return bmB(A,Q,async()=>{try{let B=p3(),G=qC(B),Z=umB(A);if(x4()===\"bedrock\")return iT3({model:Jg(B),messages:A,tools:Q,betas:G,containsThinking:Z});let Y=await oC({maxRetries:1,model:B}),J=x4()===\"vertex\"?G.filter((I)=>CIQ.has(I)):G,X=await Y.beta.messages.countTokens({model:Jg(B),messages:A.length>0?A:[{role:\"user\",content:\"foo\"}],tools:Q,...J.length>0?{betas:J}:{},...Z?{thinking:{type:\"enabled\",budget_tokens:c00}}:{}});if(typeof X.input_tokens!==\"number\")return null;return X.input_tokens}catch(B){return t(B),null}})}function iG(A){return Math.round(A.length/4)}async function dmB(A,Q){let B=umB(A),G=F0(process.env.CLAUDE_CODE_USE_VERTEX)&&ofA(UK())===\"global\",Z=F0(process.env.CLAUDE_CODE_USE_BEDROCK)&&B,Y=F0(process.env.CLAUDE_CODE_USE_VERTEX)&&B,J=G||Z||Y?CM():UqA(),X=await oC({maxRetries:1,model:J}),I=lT3(A),W=I.length>0?I:[{role:\"user\",content:\"count\"}],K=qC(J),H=(await X.beta.messages.create({model:Jg(J),max_tokens:B?gmB:1,messages:W,tools:Q.length>0?Q:void 0,...K.length>0?{betas:K}:{},metadata:Ja(),...Z91(),...B?{thinking:{type:\"enabled\",budget_tokens:c00}}:{}})).usage,D=H.input_tokens,F=H.cache_creation_input_tokens||0,E=H.cache_read_input_tokens||0;return D+F+E}function pmB(A){if(A.type!==\"assistant\"||!A.message?.content)return 0;let Q=\"\";if(typeof A.message.content===\"string\")Q=A.message.content;else if(Array.isArray(A.message.content))Q=A.message.content.filter((B)=>B.type===\"text\").map((B)=>B.text||\"\").join(`\n`);return iG(Q)}async function iT3({model:A,messages:Q,tools:B,betas:G,containsThinking:Z}){try{let Y=await hlQ(),J=glQ(A)?A:await IrA(A);if(!J)return null;let X={anthropic_version:\"bedrock-2023-05-31\",messages:Q.length>0?Q:[{role:\"user\",content:\"foo\"}],max_tokens:Z?gmB:1,...B.length>0?{tools:B}:{},...G.length>0?{anthropic_beta:G}:{},...Z?{thinking:{type:\"enabled\",budget_tokens:c00}}:{}},I={modelId:J,input:{invokeModel:{body:new TextEncoder().encode(JSON.stringify(X))}}};return(await Y.send(new hmB.CountTokensCommand(I))).inputTokens??null}catch(Y){return t(Y),null}}var hmB,c00=1024,gmB=2048;var FR=O(()=>{ZBA();c1();J9();pj();tCA();CZ();AB();p00();WK();WrA();yu();hmB=l(LaA(),1)});function tv(){return sv.createElement(sv.Fragment,null,sv.createElement(C,{color:\"error\"},\"Interrupted \"),sv.createElement(C,{dimColor:!0},\"· What should Claude do instead?\"))}var sv;var BIA=O(()=>{bA();sv=l(JA(),1)});function t5(){return X_A.createElement(k0,{height:1},X_A.createElement(tv,null))}var X_A;var lH=O(()=>{k4();BIA();X_A=l(JA(),1)});function KB(){let A=cmB.useContext(nNA);if(!A)throw Error(\"useTerminalSize must be used within an Ink App component\");return A}var cmB;var c4=O(()=>{XeA();cmB=l(JA(),1)});function M0({shortcut:A,action:Q,parens:B=!1,bold:G=!1}){let Z=G?Y91.default.createElement(C,{bold:!0},A):A;if(B)return Y91.default.createElement(C,null,\"(\",Z,\" to \",Q,\")\");return Y91.default.createElement(C,null,Z,\" to \",Q)}var Y91;var J6=O(()=>{bA();Y91=l(JA(),1)});function l00({children:A}){return YBA.default.createElement(lmB.Provider,{value:!0},A)}function nT(){if(YBA.useContext(lmB))return null;return YBA.default.createElement(C,{dimColor:!0},YBA.default.createElement(M0,{shortcut:\"ctrl+o\",action:\"expand\",parens:!0}))}function imB(){return V1.dim(\"(ctrl+o to expand)\")}var YBA,lmB;var JBA=O(()=>{bA();m6();J6();YBA=l(JA(),1),lmB=YBA.default.createContext(!1)});function n00(A){if(F0(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))return;if(process.platform===\"win32\")process.title=A?`✳ ${A}`:A;else process.stdout.write(`\\x1B]0;${A?`✳ ${A}`:\"\"}\\x07`)}async function nmB(A){if(A.startsWith(\"<local-command-stdout>\"))return;let Q=\"{\";try{let B=await jK({systemPrompt:[\"Analyze if this message indicates a new conversation topic. If it does, extract a 2-3 word title that captures the new topic. Format your response as a JSON object with two fields: 'isNewTopic' (boolean) and 'title' (string, or null if isNewTopic is false). Only include these fields, no other text. ONLY generate the JSON object, no other text (eg. no markdown).\"],userPrompt:A,assistantPrompt:Q,signal:new AbortController().signal,options:{querySource:\"terminal_update_title\",agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),G=Q+B.message.content.filter((Y)=>Y.type===\"text\").map((Y)=>Y.text).join(\"\"),Z=R5(G);if(Z&&typeof Z===\"object\"&&\"isNewTopic\"in Z&&\"title\"in Z){if(Z.isNewTopic&&Z.title)n00(Z.title)}}catch(B){t(B)}}function $I(){return new Promise((A)=>{process.stdout.write(\"\\x1B[2J\\x1B[3J\\x1B[H\",()=>{A()})})}function aT3(A,Q){let B=A.split(`\n`),G=[];for(let Y of B){let J=R3(Y);if(J<=Q)G.push(Y.trimEnd());else{let X=0;while(X<J){let I=gNA(Y,X,X+Q);G.push(I.trimEnd()),X+=Q}}}let Z=G.length-i00;if(Z===1)return{aboveTheFold:G.slice(0,i00+1).join(`\n`).trimEnd(),remainingLines:0};return{aboveTheFold:G.slice(0,i00).join(`\n`).trimEnd(),remainingLines:Math.max(0,Z)}}function amB(A,Q){let B=A.trimEnd();if(!B)return\"\";let{aboveTheFold:G,remainingLines:Z}=aT3(B,Math.max(Q-nT3,10));return[G,Z>0?V1.dim(`… +${Z} lines ${imB()}`):\"\"].filter(Boolean).join(`\n`)}var i00=3,nT3=9;var vu=O(()=>{CZ();rI();c1();m6();JBA();AB();Xl1();Ng()});function oT3(A){try{let Q=JSON.parse(A),B=JSON.stringify(Q),G=A.replace(/\\s+/g,\"\"),Z=B.replace(/\\s+/g,\"\");if(G!==Z)return A;return JSON.stringify(Q,null,2)}catch{return A}}function omB(A){return A.split(`\n`).map(oT3).join(`\n`)}function Yz({content:A,verbose:Q,isError:B,isWarning:G}){let{columns:Z}=KB(),Y=rmB.useMemo(()=>{if(Q)return J91(omB(A));else return J91(amB(omB(A),Z))},[A,Q,Z]);return XBA.createElement(k0,null,XBA.createElement(C,{color:B?\"error\":G?\"warning\":void 0},XBA.createElement(_3,null,Y)))}function J91(A){return A.replace(/\\^[\\[([0-9]+;)*4(;[0-9]+)*m|\\^[\\[4(;[0-9]+)*m|\\^[\\[([0-9]+;)*4m/g,\"\")}var XBA,rmB;var GIA=O(()=>{bA();k4();c4();vu();XBA=l(JA(),1),rmB=l(JA(),1)});function X91(A){return A.replace(/<sandbox_violations>[\\s\\S]*?<\\/sandbox_violations>/g,\"\")}function o3({result:A,verbose:Q}){let B;if(typeof A!==\"string\")B=\"Tool execution failed\";else{let Z=Q9(A,\"tool_use_error\")??A,J=X91(Z).trim();if(!Q&&J.includes(\"InputValidationError: \"))B=\"Invalid tool parameters\";else if(J.startsWith(\"Error: \"))B=J;else B=`Error: ${J}`}let G=B.split(`\n`).length-a00;return UF.createElement(k0,null,UF.createElement(T,{flexDirection:\"column\"},UF.createElement(C,{color:\"error\"},J91(Q?B:B.split(`\n`).slice(0,a00).join(`\n`))),!Q&&B.split(`\n`).length>a00&&UF.createElement(T,null,UF.createElement(C,{dimColor:!0},\"… +\",G,\" \",G===1?\"line\":\"lines\",\" (\"),UF.createElement(C,{dimColor:!0,bold:!0},\"ctrl+o\"),UF.createElement(C,null,\" \"),UF.createElement(C,{dimColor:!0},\"to see all)\"))))}var UF,a00=10;var TK=O(()=>{bA();k4();EB();GIA();UF=l(JA(),1)});import{randomBytes as rT3}from\"crypto\";function sT3(A){return rT3(4).readUInt32BE(0)%A}function o00(A){return A[sT3(A.length)]}function AdB(){let A=o00(smB),Q=o00(emB),B=o00(tmB);return`${A}-${Q}-${B}`}var smB,tmB,emB,FiG;var QdB=O(()=>{smB=[\"abundant\",\"ancient\",\"bright\",\"calm\",\"cheerful\",\"clever\",\"cozy\",\"curious\",\"dapper\",\"dazzling\",\"deep\",\"delightful\",\"eager\",\"elegant\",\"enchanted\",\"fancy\",\"fluffy\",\"gentle\",\"gleaming\",\"golden\",\"graceful\",\"happy\",\"hidden\",\"humble\",\"jolly\",\"joyful\",\"keen\",\"kind\",\"lively\",\"lovely\",\"lucky\",\"luminous\",\"magical\",\"majestic\",\"mellow\",\"merry\",\"mighty\",\"misty\",\"noble\",\"peaceful\",\"playful\",\"polished\",\"precious\",\"proud\",\"quiet\",\"quirky\",\"radiant\",\"rosy\",\"serene\",\"shiny\",\"silly\",\"sleepy\",\"smooth\",\"snazzy\",\"snug\",\"snuggly\",\"soft\",\"sparkling\",\"spicy\",\"splendid\",\"sprightly\",\"starry\",\"steady\",\"sunny\",\"swift\",\"tender\",\"tidy\",\"toasty\",\"tranquil\",\"twinkly\",\"valiant\",\"vast\",\"velvet\",\"vivid\",\"warm\",\"whimsical\",\"wild\",\"wise\",\"witty\",\"wondrous\",\"zany\",\"zesty\",\"zippy\",\"breezy\",\"bubbly\",\"buzzing\",\"cheeky\",\"cosmic\",\"cozy\",\"crispy\",\"crystalline\",\"cuddly\",\"drifting\",\"dreamy\",\"effervescent\",\"ethereal\",\"fizzy\",\"flickering\",\"floating\",\"floofy\",\"fluttering\",\"foamy\",\"frolicking\",\"fuzzy\",\"giggly\",\"glimmering\",\"glistening\",\"glittery\",\"glowing\",\"goofy\",\"groovy\",\"harmonic\",\"hazy\",\"humming\",\"iridescent\",\"jaunty\",\"jazzy\",\"jiggly\",\"melodic\",\"moonlit\",\"mossy\",\"nifty\",\"peppy\",\"prancy\",\"purrfect\",\"purring\",\"quizzical\",\"rippling\",\"rustling\",\"shimmering\",\"shimmying\",\"snappy\",\"snoopy\",\"squishy\",\"swirling\",\"ticklish\",\"tingly\",\"twinkling\",\"velvety\",\"wiggly\",\"wobbly\",\"woolly\",\"zazzy\",\"abstract\",\"adaptive\",\"agile\",\"async\",\"atomic\",\"binary\",\"cached\",\"compiled\",\"composed\",\"compressed\",\"concurrent\",\"cryptic\",\"curried\",\"declarative\",\"delegated\",\"distributed\",\"dynamic\",\"eager\",\"elegant\",\"encapsulated\",\"enumerated\",\"eventual\",\"expressive\",\"federated\",\"functional\",\"generic\",\"greedy\",\"hashed\",\"idempotent\",\"immutable\",\"imperative\",\"indexed\",\"inherited\",\"iterative\",\"lazy\",\"lexical\",\"linear\",\"linked\",\"logical\",\"memoized\",\"modular\",\"mutable\",\"nested\",\"optimized\",\"parallel\",\"parsed\",\"partitioned\",\"piped\",\"polymorphic\",\"pure\",\"reactive\",\"recursive\",\"refactored\",\"reflective\",\"replicated\",\"resilient\",\"robust\",\"scalable\",\"sequential\",\"serialized\",\"sharded\",\"sorted\",\"staged\",\"stateful\",\"stateless\",\"streamed\",\"structured\",\"synchronous\",\"synthetic\",\"temporal\",\"transient\",\"typed\",\"unified\",\"validated\",\"vectorized\",\"virtual\"],tmB=[\"aurora\",\"avalanche\",\"blossom\",\"breeze\",\"brook\",\"bubble\",\"canyon\",\"cascade\",\"cloud\",\"clover\",\"comet\",\"coral\",\"cosmos\",\"creek\",\"crescent\",\"crystal\",\"dawn\",\"dewdrop\",\"dusk\",\"eclipse\",\"ember\",\"feather\",\"fern\",\"firefly\",\"flame\",\"flurry\",\"fog\",\"forest\",\"frost\",\"galaxy\",\"garden\",\"glacier\",\"glade\",\"grove\",\"harbor\",\"horizon\",\"island\",\"lagoon\",\"lake\",\"leaf\",\"lightning\",\"meadow\",\"meteor\",\"mist\",\"moon\",\"moonbeam\",\"mountain\",\"nebula\",\"nova\",\"ocean\",\"orbit\",\"pebble\",\"petal\",\"pine\",\"planet\",\"pond\",\"puddle\",\"quasar\",\"rain\",\"rainbow\",\"reef\",\"ripple\",\"river\",\"shore\",\"sky\",\"snowflake\",\"spark\",\"spring\",\"star\",\"stardust\",\"starlight\",\"storm\",\"stream\",\"summit\",\"sun\",\"sunbeam\",\"sunrise\",\"sunset\",\"thunder\",\"tide\",\"twilight\",\"valley\",\"volcano\",\"waterfall\",\"wave\",\"willow\",\"wind\",\"alpaca\",\"axolotl\",\"badger\",\"bear\",\"beaver\",\"bee\",\"bird\",\"bumblebee\",\"bunny\",\"cat\",\"chipmunk\",\"crab\",\"crane\",\"deer\",\"dolphin\",\"dove\",\"dragon\",\"dragonfly\",\"duckling\",\"eagle\",\"elephant\",\"falcon\",\"finch\",\"flamingo\",\"fox\",\"frog\",\"giraffe\",\"goose\",\"hamster\",\"hare\",\"hedgehog\",\"hippo\",\"hummingbird\",\"jellyfish\",\"kitten\",\"koala\",\"ladybug\",\"lark\",\"lemur\",\"llama\",\"lobster\",\"lynx\",\"manatee\",\"meerkat\",\"moth\",\"narwhal\",\"newt\",\"octopus\",\"otter\",\"owl\",\"panda\",\"parrot\",\"peacock\",\"pelican\",\"penguin\",\"phoenix\",\"piglet\",\"platypus\",\"pony\",\"porcupine\",\"puffin\",\"puppy\",\"quail\",\"quokka\",\"rabbit\",\"raccoon\",\"raven\",\"robin\",\"salamander\",\"seahorse\",\"seal\",\"sloth\",\"snail\",\"sparrow\",\"sphinx\",\"squid\",\"squirrel\",\"starfish\",\"swan\",\"tiger\",\"toucan\",\"turtle\",\"unicorn\",\"walrus\",\"whale\",\"wolf\",\"wombat\",\"wren\",\"yeti\",\"zebra\",\"acorn\",\"anchor\",\"balloon\",\"beacon\",\"biscuit\",\"blanket\",\"bonbon\",\"book\",\"boot\",\"cake\",\"candle\",\"candy\",\"castle\",\"charm\",\"clock\",\"cocoa\",\"cookie\",\"crayon\",\"crown\",\"cupcake\",\"donut\",\"dream\",\"fairy\",\"fiddle\",\"flask\",\"flute\",\"fountain\",\"gadget\",\"gem\",\"gizmo\",\"globe\",\"goblet\",\"hammock\",\"harp\",\"haven\",\"hearth\",\"honey\",\"journal\",\"kazoo\",\"kettle\",\"key\",\"kite\",\"lantern\",\"lemon\",\"lighthouse\",\"locket\",\"lollipop\",\"mango\",\"map\",\"marble\",\"marshmallow\",\"melody\",\"mitten\",\"mochi\",\"muffin\",\"music\",\"nest\",\"noodle\",\"oasis\",\"origami\",\"pancake\",\"parasol\",\"peach\",\"pearl\",\"pebble\",\"pie\",\"pillow\",\"pinwheel\",\"pixel\",\"pizza\",\"plum\",\"popcorn\",\"pretzel\",\"prism\",\"pudding\",\"pumpkin\",\"puzzle\",\"quiche\",\"quill\",\"quilt\",\"riddle\",\"rocket\",\"rose\",\"scone\",\"scroll\",\"shell\",\"sketch\",\"snowglobe\",\"sonnet\",\"sparkle\",\"spindle\",\"sprout\",\"sundae\",\"swing\",\"taco\",\"teacup\",\"teapot\",\"thimble\",\"toast\",\"token\",\"tome\",\"tower\",\"treasure\",\"treehouse\",\"trinket\",\"truffle\",\"tulip\",\"umbrella\",\"waffle\",\"wand\",\"whisper\",\"whistle\",\"widget\",\"wreath\",\"zephyr\",\"abelson\",\"adleman\",\"aho\",\"allen\",\"babbage\",\"bachman\",\"backus\",\"barto\",\"bengio\",\"bentley\",\"blum\",\"boole\",\"brooks\",\"catmull\",\"cerf\",\"cherny\",\"church\",\"clarke\",\"cocke\",\"codd\",\"conway\",\"cook\",\"corbato\",\"cray\",\"curry\",\"dahl\",\"diffie\",\"dijkstra\",\"dongarra\",\"eich\",\"emerson\",\"engelbart\",\"feigenbaum\",\"floyd\",\"gosling\",\"graham\",\"gray\",\"hamming\",\"hanrahan\",\"hartmanis\",\"hejlsberg\",\"hellman\",\"hennessy\",\"hickey\",\"hinton\",\"hoare\",\"hollerith\",\"hopcroft\",\"hopper\",\"iverson\",\"kahan\",\"kahn\",\"karp\",\"kay\",\"kernighan\",\"knuth\",\"kurzweil\",\"lamport\",\"lampson\",\"lecun\",\"lerdorf\",\"liskov\",\"lovelace\",\"matsumoto\",\"mccarthy\",\"metcalfe\",\"micali\",\"milner\",\"minsky\",\"moler\",\"moore\",\"naur\",\"neumann\",\"newell\",\"nygaard\",\"papert\",\"parnas\",\"pascal\",\"patterson\",\"pearl\",\"perlis\",\"pike\",\"pnueli\",\"rabin\",\"reddy\",\"ritchie\",\"rivest\",\"rossum\",\"russell\",\"scott\",\"sedgewick\",\"shamir\",\"shannon\",\"sifakis\",\"simon\",\"stallman\",\"stearns\",\"steele\",\"stonebraker\",\"stroustrup\",\"sutherland\",\"sutton\",\"tarjan\",\"thacker\",\"thompson\",\"torvalds\",\"turing\",\"ullman\",\"valiant\",\"wadler\",\"wall\",\"wigderson\",\"wilkes\",\"wilkinson\",\"wirth\",\"wozniak\",\"yao\"],emB=[\"baking\",\"beaming\",\"booping\",\"bouncing\",\"brewing\",\"bubbling\",\"chasing\",\"churning\",\"coalescing\",\"conjuring\",\"cooking\",\"crafting\",\"crunching\",\"cuddling\",\"dancing\",\"dazzling\",\"discovering\",\"doodling\",\"dreaming\",\"drifting\",\"enchanting\",\"exploring\",\"finding\",\"floating\",\"fluttering\",\"foraging\",\"forging\",\"frolicking\",\"gathering\",\"giggling\",\"gliding\",\"greeting\",\"growing\",\"hatching\",\"herding\",\"honking\",\"hopping\",\"hugging\",\"humming\",\"imagining\",\"inventing\",\"jingling\",\"juggling\",\"jumping\",\"kindling\",\"knitting\",\"launching\",\"leaping\",\"mapping\",\"marinating\",\"meandering\",\"mixing\",\"moseying\",\"munching\",\"napping\",\"nibbling\",\"noodling\",\"orbiting\",\"painting\",\"percolating\",\"petting\",\"plotting\",\"pondering\",\"popping\",\"prancing\",\"purring\",\"puzzling\",\"questing\",\"riding\",\"roaming\",\"rolling\",\"sauteeing\",\"scribbling\",\"seeking\",\"shimmying\",\"singing\",\"skipping\",\"sleeping\",\"snacking\",\"sniffing\",\"snuggling\",\"soaring\",\"sparking\",\"spinning\",\"splashing\",\"sprouting\",\"squishing\",\"stargazing\",\"stirring\",\"strolling\",\"swimming\",\"swinging\",\"tickling\",\"tinkering\",\"toasting\",\"tumbling\",\"twirling\",\"waddling\",\"wandering\",\"watching\",\"weaving\",\"whistling\",\"wibbling\",\"wiggling\",\"wishing\",\"wobbling\",\"wondering\",\"yawning\",\"zooming\"];FiG=smB.length*emB.length*tmB.length});import{join as I_A}from\"path\";function eT3(A){let Q=A??h0(),B=PEA(),G=B.get(Q);if(!G){let Z=Hw();for(let Y=0;Y<tT3;Y++){G=AdB();let J=I_A(Z,`${G}.md`);if(!jA().existsSync(J))break}B.set(Q,G)}return G}function AP3(A,Q){PEA().set(A,Q)}function Hw(){let A=I_A(vQ(),\"plans\");if(!jA().existsSync(A))try{jA().mkdirSync(A)}catch(Q){t(Q instanceof Error?Q:Error(String(Q)))}return A}function rC(A){let Q=eT3(h0());if(!A)return I_A(Hw(),`${Q}.md`);return I_A(Hw(),`${Q}-agent-${A}.md`)}function Jz(A){let Q=rC(A);if(!jA().existsSync(Q))return null;try{return jA().readFileSync(Q,{encoding:\"utf-8\"})}catch(B){return t(B instanceof Error?B:Error(String(B))),null}}function I91(A){let Q=A.messages.find((G)=>G.slug)?.slug;if(!Q)return!1;AP3(h0(),Q);let B=I_A(Hw(),`${Q}.md`);return jA().existsSync(B)}var tT3=10;var sC=O(()=>{o0();HQ();AB();c1();QdB()});import{readFileSync as BdB,writeFileSync as QP3,appendFileSync as BP3,unlinkSync as GP3,mkdirSync as GdB,existsSync as ZIA,statSync as ZP3,readdirSync as YP3}from\"fs\";import{dirname as JP3,join as r00}from\"path\";function W_A(){return r00(W91(),\"tasks\")}function ZdB(){let A=W_A();if(!ZIA(A))GdB(A,{recursive:!0})}function Dw(A){return r00(W_A(),`${A}.output`)}function ku(A,Q){try{ZdB();let B=Dw(A),G=JP3(B);if(!ZIA(G))GdB(G,{recursive:!0});BP3(B,Q,\"utf8\")}catch(B){t(B instanceof Error?B:Error(String(B)))}}function s00(A,Q){try{let B=Dw(A);if(!ZIA(B))return{content:\"\",newOffset:Q};let Z=ZP3(B).size;if(Z<=Q)return{content:\"\",newOffset:Q};return{content:BdB(B,\"utf8\").slice(Q),newOffset:Z}}catch(B){return t(B instanceof Error?B:Error(String(B))),{content:\"\",newOffset:Q}}}function YIA(A){try{let Q=Dw(A);if(!ZIA(Q))return\"\";return BdB(Q,\"utf8\")}catch(Q){return t(Q instanceof Error?Q:Error(String(Q))),\"\"}}function bu(A){ZdB();let Q=Dw(A);if(!ZIA(Q))QP3(Q,\"\",\"utf8\");return Q}function YdB(){try{let A=W_A();if(!ZIA(A))return;let Q=YP3(A);for(let B of Q)if(B.endsWith(\".output\"))try{GP3(r00(A,B))}catch{}}catch{}}var Fw=O(()=>{c1();NY()});function JIA(A){let Q=`${W_A()}/`,B=\".output\";if(A.startsWith(Q)&&A.endsWith(\".output\")){let G=A.slice(Q.length,-7);if(G.length>0&&G.length<=20&&/^[a-zA-Z0-9_-]+$/.test(G))return G}return null}function JdB({file_path:A,offset:Q,limit:B},{verbose:G}){if(!A)return null;if(JIA(A))return\"\";let Z=r3(A);if(G&&(Q||B)){let Y=Q??1,J=B?`lines ${Y}-${Y+B-1}`:`from line ${Y}`;return`${Z} · ${J}`}return Z}function XdB({file_path:A}){let Q=A?JIA(A):null;if(!Q)return null;return j5.createElement(T,{flexWrap:\"nowrap\",marginLeft:1},j5.createElement(C,{dimColor:!0},Q))}function IdB(){return null}function WdB(A){switch(A.type){case\"image\":{let{originalSize:Q}=A.file,B=HI(Q);return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read image (\",B,\")\"))}case\"notebook\":{let{cells:Q}=A.file;if(!Q||Q.length<1)return j5.createElement(C,{color:\"error\"},\"No cells found in notebook\");return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read \",j5.createElement(C,{bold:!0},Q.length),\" cells\"))}case\"pdf\":{let{originalSize:Q}=A.file,B=HI(Q);return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read PDF (\",B,\")\"))}case\"text\":{let{numLines:Q}=A.file;return j5.createElement(k0,{height:1},j5.createElement(C,null,\"Read \",j5.createElement(C,{bold:!0},Q),\" \",Q===1?\"line\":\"lines\"))}}}function KdB(){return j5.createElement(t5,null)}function VdB(A,{verbose:Q}){if(!Q&&typeof A===\"string\"&&Q9(A,\"tool_use_error\"))return j5.createElement(k0,null,j5.createElement(C,{color:\"error\"},\"Error reading file\"));return j5.createElement(o3,{result:A,verbose:Q})}function HdB(A){if(A?.file_path?.startsWith(Hw()))return\"Reading Plan\";if(A?.file_path&&JIA(A.file_path))return\"Read agent output\";return\"Read\"}function DdB(A){if(!A?.file_path)return null;let Q=JIA(A.file_path);if(Q)return Q;return r3(A.file_path)}var j5;var t00=O(()=>{bA();lH();TK();k4();i9();EB();sC();Fw();j5=l(JA(),1)});import{createHash as FdB}from\"crypto\";function XP3(A){return FdB(\"sha256\").update(A).digest(\"hex\").slice(0,16)}function IP3(A){return FdB(\"sha256\").update(A).digest(\"hex\")}function ev(A){let Q={operation:A.operation,tool:A.tool,filePathHash:XP3(A.filePath)};if(A.content!==void 0&&A.content.length<=WP3)Q.contentHash=IP3(A.content);if(A.type!==void 0)Q.type=A.type;n(\"tengu_file_operation\",Q)}var WP3=102400;var K91=O(()=>{N0()});import*as e00 from\"path\";async function EdB(A,Q,{maxSizeBytes:B=K_A,maxTokens:G=QQ0}){if(!V91.has(Q)&&A.length>B)throw Error(AQ0(A.length,B));let Z=iG(A);if(!Z||Z<=G/4)return;let Y=await mmB(A);if(Y&&Y>G)throw new D91(Y,G)}function H91(A,Q,B,G){return{type:\"image\",file:{base64:A.toString(\"base64\"),type:`image/${Q}`,originalSize:B,dimensions:G}}}async function zP3(A,Q){let G=jA().statSync(A).size,Z=jA().readFileBytesSync(A),Y=BA1(Z);try{let J=await _DB(Z,Q,Y);return{type:\"image\",file:{base64:J.base64,type:J.mediaType,originalSize:G}}}catch(J){t(J);try{let X=await Promise.resolve().then(() => l(qi1(),1)),W=await(X.default||X)(Z).resize(400,400,{fit:\"inside\",withoutEnlargement:!0}).jpeg({quality:20}).toBuffer();return H91(W,\"jpeg\",G)}catch(X){t(X);let I=Y.split(\"/\")[1]||\"png\";return H91(Z,I,G)}}}async function CP3(A,Q){let G=jA().statSync(A).size;if(G===0)throw Error(`Image file is empty: ${A}`);let Z=jA().readFileBytesSync(A),J=BA1(Z).split(\"/\")[1]||\"png\";try{let X=await fYA(Z,G,J);return H91(X.buffer,X.mediaType,G,X.dimensions)}catch(X){return t(X),H91(Z,J,G)}}async function BQ0(A,Q=QQ0,B=A.split(\".\").pop()?.toLowerCase()||\"png\"){let G=await CP3(A,B);if(Math.ceil(G.file.base64.length*0.125)>Q)return await zP3(A,Q);return G}var KP3,QQ0=25000,D91,V91,VP3,HP3,DP3,FP3,W3,EP3=`\n\n<system-reminder>\nWhenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.\n</system-reminder>\n`,AQ0=(A,Q=K_A)=>`File content (${HI(A)}) exceeds maximum allowed size (${HI(Q)}). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.`;var aN=O(()=>{o2();K2();o0();J0A();DLA();i9();U11();c1();wV();NY();Cn1();EB();FR();HQ();t00();K91();i9();KP3=[];D91=class D91 extends Error{tokenCount;maxTokens;constructor(A,Q){super(`File content (${A} tokens) exceeds maximum allowed tokens (${Q}). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.`);this.tokenCount=A;this.maxTokens=Q;this.name=\"MaxFileReadTokenExceededError\"}};V91=new Set([\"png\",\"jpg\",\"jpeg\",\"gif\",\"webp\"]),VP3=new Set([\"mp3\",\"wav\",\"flac\",\"ogg\",\"aac\",\"m4a\",\"wma\",\"aiff\",\"opus\",\"mp4\",\"avi\",\"mov\",\"wmv\",\"flv\",\"mkv\",\"webm\",\"m4v\",\"mpeg\",\"mpg\",\"zip\",\"rar\",\"tar\",\"gz\",\"bz2\",\"7z\",\"xz\",\"z\",\"tgz\",\"iso\",\"exe\",\"dll\",\"so\",\"dylib\",\"app\",\"msi\",\"deb\",\"rpm\",\"bin\",\"dat\",\"db\",\"sqlite\",\"sqlite3\",\"mdb\",\"idx\",\"doc\",\"docx\",\"xls\",\"xlsx\",\"ppt\",\"pptx\",\"odt\",\"ods\",\"odp\",\"ttf\",\"otf\",\"woff\",\"woff2\",\"eot\",\"psd\",\"ai\",\"eps\",\"sketch\",\"fig\",\"xd\",\"blend\",\"obj\",\"3ds\",\"max\",\"class\",\"jar\",\"war\",\"pyc\",\"pyo\",\"rlib\",\"swf\",\"fla\"]),HP3=m.strictObject({file_path:m.string().describe(\"The absolute path to the file to read\"),offset:m.number().optional().describe(\"The line number to start reading from. Only provide if the file is too large to read at once\"),limit:m.number().optional().describe(\"The number of lines to read. Only provide if the file is too large to read at once.\")}),DP3=m.enum([\"image/jpeg\",\"image/png\",\"image/gif\",\"image/webp\"]),FP3=m.discriminatedUnion(\"type\",[m.object({type:m.literal(\"text\"),file:m.object({filePath:m.string().describe(\"The path to the file that was read\"),content:m.string().describe(\"The content of the file\"),numLines:m.number().describe(\"Number of lines in the returned content\"),startLine:m.number().describe(\"The starting line number\"),totalLines:m.number().describe(\"Total number of lines in the file\")})}),m.object({type:m.literal(\"image\"),file:m.object({base64:m.string().describe(\"Base64-encoded image data\"),type:DP3.describe(\"The MIME type of the image\"),originalSize:m.number().describe(\"Original file size in bytes\"),dimensions:m.object({originalWidth:m.number().optional().describe(\"Original image width in pixels\"),originalHeight:m.number().optional().describe(\"Original image height in pixels\"),displayWidth:m.number().optional().describe(\"Displayed image width in pixels (after resizing)\"),displayHeight:m.number().optional().describe(\"Displayed image height in pixels (after resizing)\")}).optional().describe(\"Image dimension info for coordinate mapping\")})}),m.object({type:m.literal(\"notebook\"),file:m.object({filePath:m.string().describe(\"The path to the notebook file\"),cells:m.array(m.any()).describe(\"Array of notebook cells\")})}),m.object({type:m.literal(\"pdf\"),file:m.object({filePath:m.string().describe(\"The path to the PDF file\"),base64:m.string().describe(\"Base64-encoded PDF data\"),originalSize:m.number().describe(\"Original file size in bytes\")})})]),W3={name:T3,strict:!0,input_examples:[{file_path:\"/Users/username/project/src/index.ts\"},{file_path:\"/Users/username/project/README.md\",limit:100,offset:0}],async description(){return IzB},async prompt(){return WzB},inputSchema:HP3,outputSchema:FP3,userFacingName:HdB,getToolUseSummary:DdB,isEnabled(){return!0},isConcurrencySafe(){return!0},isReadOnly(){return!0},isSearchOrReadCommand(){return{isSearch:!1,isRead:!0}},getPath({file_path:A}){return A||t1()},async checkPermissions(A,Q){let B=await Q.getAppState();return Ia(W3,A,B.toolPermissionContext)},renderToolUseMessage:JdB,renderToolUseTag:XdB,renderToolUseProgressMessage:IdB,renderToolResultMessage:WdB,renderToolUseRejectedMessage:KdB,renderToolUseErrorMessage:VdB,async validateInput({file_path:A,offset:Q,limit:B},G){let Z=jA(),Y=Xa(A),J=await G.getAppState();if(wF(Y,J.toolPermissionContext,\"read\",\"deny\")!==null)return{result:!1,message:\"File is in a directory that is denied by your permission settings.\",errorCode:1};if(Y.startsWith(\"\\\\\\\\\")||Y.startsWith(\"//\"))return{result:!0};if(!Z.existsSync(Y)){let F=F91(Y),E=\"File does not exist.\",z=t1(),$=nQ();if(z!==$)E+=` Current working directory: ${z}`;if(F)E+=` Did you mean ${F}?`;return{result:!1,message:E,errorCode:2}}let W=e00.extname(Y).toLowerCase();if(VP3.has(W.slice(1))&&!(VJA()&&lA1(W)))return{result:!1,message:`This tool cannot read binary files. The file appears to be a binary ${W} file. Please use appropriate tools for binary file analysis.`,errorCode:4};let V=Z.statSync(Y).size;if(V===0){if(V91.has(W.slice(1)))return{result:!1,message:\"Empty image files cannot be processed.\",errorCode:5}}let H=W===\".ipynb\",D=VJA()&&lA1(W);if(!V91.has(W.slice(1))&&!H&&!D){if(!E91(Y)&&!Q&&!B)return{result:!1,message:AQ0(V),meta:{fileSize:V},errorCode:6}}return{result:!0}},async call({file_path:A,offset:Q=1,limit:B=void 0},G){let{readFileState:Z,fileReadingLimits:Y}=G,J=K_A,X=Y?.maxTokens??QQ0,I=e00.extname(A).toLowerCase().slice(1),W=Xa(A);if(I===\"ipynb\"){let E=MCB(W),z=JSON.stringify(E);if(z.length>J)throw Error(`Notebook content (${HI(z.length)}) exceeds maximum allowed size (${HI(J)}). Use ${O4} with jq to read specific portions:\n  cat \"${A}\" | jq '.cells[:20]' # First 20 cells\n  cat \"${A}\" | jq '.cells[100:120]' # Cells 100-120\n  cat \"${A}\" | jq '.cells | length' # Count total cells\n  cat \"${A}\" | jq '.cells[] | select(.cell_type==\"code\") | .source' # All code sources`);await EdB(z,I,{maxSizeBytes:J,maxTokens:X}),Z.set(W,{content:z,timestamp:Ew(W),offset:Q,limit:B}),G.nestedMemoryAttachmentTriggers?.add(W);let $={type:\"notebook\",file:{filePath:A,cells:E}};return ev({operation:\"read\",tool:\"FileReadTool\",filePath:W,content:z}),{data:$}}if(V91.has(I)){let E=await BQ0(W,X,I);G.nestedMemoryAttachmentTriggers?.add(W),ev({operation:\"read\",tool:\"FileReadTool\",filePath:W,content:E.file.base64});let z=E.file.dimensions?HLA(E.file.dimensions):null;return{data:E,...z&&{newMessages:[f0({content:z,isMeta:!0})]}}}if(VJA()&&lA1(I)){let E=await XzB(W);return ev({operation:\"read\",tool:\"FileReadTool\",filePath:W,content:E.file.base64}),{data:E,newMessages:[f0({content:[{type:\"document\",source:{type:\"base64\",media_type:\"application/pdf\",data:E.file.base64}}],isMeta:!0})]}}let K=Q===0?0:Q-1,{content:V,lineCount:H,totalLines:D}=zdB(W,K,B);if(V.length>J)throw Error(AQ0(V.length,J));await EdB(V,I,{maxSizeBytes:J,maxTokens:X}),Z.set(W,{content:V,timestamp:Ew(W),offset:Q,limit:B}),G.nestedMemoryAttachmentTriggers?.add(W);for(let E of KP3)E(W,V);let F={type:\"text\",file:{filePath:A,content:V,numLines:H,startLine:Q,totalLines:D}};return ev({operation:\"read\",tool:\"FileReadTool\",filePath:W,content:V}),{data:F}},mapToolResultToToolResultBlockParam(A,Q){switch(A.type){case\"image\":return{tool_use_id:Q,type:\"tool_result\",content:[{type:\"image\",source:{type:\"base64\",data:A.file.base64,media_type:A.file.type}}]};case\"notebook\":return RCB(A.file.cells,Q);case\"pdf\":return{tool_use_id:Q,type:\"tool_result\",content:`PDF file read: ${A.file.filePath} (${HI(A.file.originalSize)})`};case\"text\":{let B;if(A.file.content)B=Wa(A.file)+EP3;else B=A.file.totalLines===0?\"<system-reminder>Warning: the file exists but the contents are empty.</system-reminder>\":`<system-reminder>Warning: the file exists but is shorter than the provided offset (${A.file.startLine}). The file has ${A.file.totalLines} lines.</system-reminder>`;return{tool_use_id:Q,type:\"tool_result\",content:B}}}}}});function aT(){}function CdB(A,Q,B,G,Z){var Y=[],J;while(Q)Y.push(Q),J=Q.previousComponent,delete Q.previousComponent,Q=J;Y.reverse();var X=0,I=Y.length,W=0,K=0;for(;X<I;X++){var V=Y[X];if(!V.removed){if(!V.added&&Z){var H=B.slice(W,W+V.count);H=H.map(function(D,F){var E=G[K+F];return E.length>D.length?E:D}),V.value=A.join(H)}else V.value=A.join(B.slice(W,W+V.count));if(W+=V.count,!V.added)K+=V.count}else V.value=A.join(G.slice(K,K+V.count)),K+=V.count}return Y}function $dB(A,Q){var B;for(B=0;B<A.length&&B<Q.length;B++)if(A[B]!=Q[B])return A.slice(0,B);return A.slice(0,B)}function UdB(A,Q){var B;if(!A||!Q||A[A.length-1]!=Q[Q.length-1])return\"\";for(B=0;B<A.length&&B<Q.length;B++)if(A[A.length-(B+1)]!=Q[Q.length-(B+1)])return A.slice(-B);return A.slice(-B)}function ZQ0(A,Q,B){if(A.slice(0,Q.length)!=Q)throw Error(\"string \".concat(JSON.stringify(A),\" doesn't start with prefix \").concat(JSON.stringify(Q),\"; this is a bug\"));return B+A.slice(Q.length)}function YQ0(A,Q,B){if(!Q)return A+B;if(A.slice(-Q.length)!=Q)throw Error(\"string \".concat(JSON.stringify(A),\" doesn't end with suffix \").concat(JSON.stringify(Q),\"; this is a bug\"));return A.slice(0,-Q.length)+B}function V_A(A,Q){return ZQ0(A,Q,\"\")}function z91(A,Q){return YQ0(A,Q,\"\")}function wdB(A,Q){return Q.slice(0,$P3(A,Q))}function $P3(A,Q){var B=0;if(A.length>Q.length)B=A.length-Q.length;var G=Q.length;if(A.length<Q.length)G=A.length;var Z=Array(G),Y=0;Z[0]=0;for(var J=1;J<G;J++){if(Q[J]==Q[Y])Z[J]=Z[Y];else Z[J]=Y;while(Y>0&&Q[J]!=Q[Y])Y=Z[Y];if(Q[J]==Q[Y])Y++}Y=0;for(var X=B;X<A.length;X++){while(Y>0&&A[X]!=Q[Y])Y=Z[Y];if(A[X]==Q[Y])Y++}return Y}function qdB(A,Q,B,G){if(Q&&B){var Z=Q.value.match(/^\\s*/)[0],Y=Q.value.match(/\\s*$/)[0],J=B.value.match(/^\\s*/)[0],X=B.value.match(/\\s*$/)[0];if(A){var I=$dB(Z,J);A.value=YQ0(A.value,J,I),Q.value=V_A(Q.value,I),B.value=V_A(B.value,I)}if(G){var W=UdB(Y,X);G.value=ZQ0(G.value,X,W),Q.value=z91(Q.value,W),B.value=z91(B.value,W)}}else if(B){if(A)B.value=B.value.replace(/^\\s*/,\"\");if(G)G.value=G.value.replace(/^\\s*/,\"\")}else if(A&&G){var K=G.value.match(/^\\s*/)[0],V=Q.value.match(/^\\s*/)[0],H=Q.value.match(/\\s*$/)[0],D=$dB(K,V);Q.value=V_A(Q.value,D);var F=UdB(V_A(K,D),H);Q.value=z91(Q.value,F),G.value=ZQ0(G.value,K,F),A.value=YQ0(A.value,K,K.slice(0,K.length-F.length))}else if(G){var E=G.value.match(/^\\s*/)[0],z=Q.value.match(/\\s*$/)[0],$=wdB(z,E);Q.value=z91(Q.value,$)}else if(A){var L=A.value.match(/\\s*$/)[0],N=Q.value.match(/^\\s*/)[0],M=wdB(L,N);Q.value=V_A(Q.value,M)}}function MdB(A,Q,B){return OdB.diff(A,Q,B)}function $91(A,Q,B){return w91.diff(A,Q,B)}function NdB(A,Q){var B=Object.keys(A);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(A);Q&&(G=G.filter(function(Z){return Object.getOwnPropertyDescriptor(A,Z).enumerable})),B.push.apply(B,G)}return B}function LdB(A){for(var Q=1;Q<arguments.length;Q++){var B=arguments[Q]!=null?arguments[Q]:{};Q%2?NdB(Object(B),!0).forEach(function(G){OP3(A,G,B[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(B)):NdB(Object(B)).forEach(function(G){Object.defineProperty(A,G,Object.getOwnPropertyDescriptor(B,G))})}return A}function NP3(A,Q){if(typeof A!=\"object\"||!A)return A;var B=A[Symbol.toPrimitive];if(B!==void 0){var G=B.call(A,Q||\"default\");if(typeof G!=\"object\")return G;throw TypeError(\"@@toPrimitive must return a primitive value.\")}return(Q===\"string\"?String:Number)(A)}function LP3(A){var Q=NP3(A,\"string\");return typeof Q==\"symbol\"?Q:Q+\"\"}function JQ0(A){return JQ0=typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol==\"function\"&&Q.constructor===Symbol&&Q!==Symbol.prototype?\"symbol\":typeof Q},JQ0(A)}function OP3(A,Q,B){if(Q=LP3(Q),Q in A)Object.defineProperty(A,Q,{value:B,enumerable:!0,configurable:!0,writable:!0});else A[Q]=B;return A}function GQ0(A){return MP3(A)||RP3(A)||_P3(A)||jP3()}function MP3(A){if(Array.isArray(A))return XQ0(A)}function RP3(A){if(typeof Symbol<\"u\"&&A[Symbol.iterator]!=null||A[\"@@iterator\"]!=null)return Array.from(A)}function _P3(A,Q){if(!A)return;if(typeof A===\"string\")return XQ0(A,Q);var B=Object.prototype.toString.call(A).slice(8,-1);if(B===\"Object\"&&A.constructor)B=A.constructor.name;if(B===\"Map\"||B===\"Set\")return Array.from(A);if(B===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B))return XQ0(A,Q)}function XQ0(A,Q){if(Q==null||Q>A.length)Q=A.length;for(var B=0,G=Array(Q);B<Q;B++)G[B]=A[B];return G}function jP3(){throw TypeError(`Invalid attempt to spread non-iterable instance.\r\n\r\n"
		}]
	}],
	"system": [{
		"type": "text",
		"text": "You are Claude Code, Anthropic's official CLI for Claude."
	}, {
		"type": "text",
		"text": "Extract any file paths that this command reads or modifies. For commands like \"git diff\" and \"cat\", include the paths of files being shown. Use paths verbatim -- don't add any slashes or try to resolve them. Do not try to infer paths that were not explicitly listed in the command output.\n\nIMPORTANT: Commands that do not display the contents of the files should not return any filepaths. For eg. \"ls\", pwd\", \"find\". Even more complicated commands that don't display the contents should not be considered: eg \"find . -type f -exec ls -la {} + | sort -k5 -nr | head -5\"\n\nFirst, determine if the command displays the contents of the files. If it does, then <is_displaying_contents> tag should be true. If it does not, then <is_displaying_contents> tag should be false.\n\nFormat your response as:\n<is_displaying_contents>\ntrue\n</is_displaying_contents>\n\n<filepaths>\npath/to/file1\npath/to/file2\n</filepaths>\n\nIf no files are read or modified, return empty filepaths tags:\n<filepaths>\n</filepaths>\n\nDo not include any other text in your response."
	}],
	"tools": [],
	"metadata": {
		"user_id": "uxxx"
	},
	"max_tokens": 32000,
	"stream": true
}
caozhiyuan · 9 months ago

fixed in 2.1.1

github-actions[bot] · 9 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.