mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-25 15:03:46 +00:00
Rebuilt all 4 versions from scratch: - v0.2.x: 1,049 classes, 13,869 functions, 3,375 RVF vectors - v1.0.x: 1,390 classes, 16,593 functions, 4,669 RVF vectors - v2.0.x: 1,612 classes, 20,395 functions, 5,712 RVF vectors - v2.1.x: 1,632 classes, 19,906 functions, 9,058 RVF vectors Structure: source/ (17 JS modules in subfolders) + rvf/ (9 containers) - Zero mixing: no JS in rvf dirs, no RVF in source dirs - 100% code coverage: uncategorized/ catches everything - 17 modules: core/3, tools/3, permissions/1, config/3, telemetry/1, ui/2, types/1, uncategorized/1 - 9 RVF containers per version (1 master + 8 per-category) Co-Authored-By: claude-flow <ruv@ruv.net>
529 lines
No EOL
170 KiB
JavaScript
529 lines
No EOL
170 KiB
JavaScript
// ===================================================================
|
||
// Module: commands
|
||
// Source: @anthropic-ai/claude-code@2.1.91
|
||
// Confidence: 0.133
|
||
// Fragments: 80
|
||
// Extracted: 2026-04-03T03:17:18.030Z
|
||
// ===================================================================
|
||
|
||
return Object.assign(q,{tls:$??!0,endpoint:_?JH8.normalizeProvider(typeof _==="string"?Y(_):_):()=>uA3({...q,useDualstackEndpoint:K,useFipsEndpoint:z}),isCustomEndpoint:!!_,useDualstackEndpoint:K})},ys7="AWS_REGION",Es7="region",pA3={environmentVariableSelector:(q)=>q[ys7],configFileSelector:(q)=>q[Es7],default:()=>{throw Error("Region is missing")}},BA3={preferredFile:"credentials"},Gs7=new Set,gA3=(q,K=RA3.isValidHostLabel)=>{if(!Gs7.has(q)&&!K(q))if(q==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw Error(`Region not accepted: region="${q}" is not a valid hostname component.`);else Gs7.add(q)},Ls7=(q)=>typeof q==="string"&&(q.startsWith("fips-")||q.endsWith("-fips")),FA3=(q)=>Ls7(q)?["fips-aws-global","aws-fips"].includes(q)?"us-east-1":q.replace(/fips-(dkr-|prod-)?|-fips/,""):q,UA3=(q)=>{let{region:K,useFipsEndpoint:_}=q;if(!K)throw Error("Region is missing");return Object.assign(q,{region:async()=>{let z=typeof K==="function"?await K():K,Y=FA3(z);return gA3(Y),Y},useFipsEndpoint:async()=>{let z=typeof K==="string"?K:await K();if(Ls7(z))return!0;return typeof _!=="function"?Promise.resolve(!!_):_()}})},vs7=(q=[],{useFipsEndpoint:K,useDualstackEndpoint:_})=>q.find(({tags:z})=>K===z.includes("fips")&&_===z.includes("dualstack"))?.hostname,QA3=(q,{regionHostname:K,partitionHostname:_})=>K?K:_?_.replace("{region}",q):void 0,dA3=(q,{partitionHash:K})=>Object.keys(K||{}).find((_)=>K[_].regions.includes(q))??"aws",cA3=(q,{signingRegion:K,regionRegex:_,useFipsEndpoint:z})=>{if(K)return K;else if(z){let Y=_.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),$=q.match(Y);
|
||
|
||
var fH8=B((ji$,nJ3)=>{nJ3.exports={name:"@aws-sdk/nested-clients",version:"3.936.0",description:"Nested clients for AWS SDK packages.",main:"./dist-cjs/index.js",module:"./dist-es/index.js",types:"./dist-types/index.d.ts",scripts:{build:"yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo",lint:"node ../../scripts/validation/submodules-linter.js --pkg nested-clients",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},engines:{node:">=18.0.0"},sideEffects:!1,author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.936.0","@aws-sdk/middleware-host-header":"3.936.0","@aws-sdk/middleware-logger":"3.936.0","@aws-sdk/middleware-recursion-detection":"3.936.0","@aws-sdk/middleware-user-agent":"3.936.0","@aws-sdk/region-config-resolver":"3.936.0","@aws-sdk/types":"3.936.0","@aws-sdk/util-endpoints":"3.936.0","@aws-sdk/util-user-agent-browser":"3.936.0","@aws-sdk/util-user-agent-node":"3.936.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sts.d.ts","./sts.js","dist-*/**"],browser:{"./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"}}}});
|
||
|
||
var O8q=B((ui$,Pf3)=>{Pf3.exports={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.936.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.936.0","@aws-sdk/middleware-host-header":"3.936.0","@aws-sdk/middleware-logger":"3.936.0","@aws-sdk/middleware-recursion-detection":"3.936.0","@aws-sdk/middleware-user-agent":"3.936.0","@aws-sdk/region-config-resolver":"3.936.0","@aws-sdk/types":"3.936.0","@aws-sdk/util-endpoints":"3.936.0","@aws-sdk/util-user-agent-browser":"3.936.0","@aws-sdk/util-user-agent-node":"3.936.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}}});
|
||
|
||
NZ6.TypeRegistry.for(Dw).registerError(P03,A1q);var W03=[-3,Dw,dZ3,{[xH8]:bH8,[uH8]:401},[pH8],[0]];NZ6.TypeRegistry.for(Dw).registerError(W03,w1q);var D03="unit",f03=[-3,P1q,"SSOServiceException",0,[],[]];NZ6.TypeRegistry.for(P1q).registerError(f03,yZ6);var Z03=[1,Dw,kZ3,0,()=>_03],G03=[1,Dw,BZ3,0,()=>X03],v03=[9,Dw,NZ3,{[IH8]:["GET","/federation/credentials",200]},()=>z03,()=>Y03],T03=[9,Dw,IZ3,{[IH8]:["GET","/assignment/roles",200]},()=>O03,()=>A03],k03=[9,Dw,RZ3,{[IH8]:["GET","/assignment/accounts",200]},()=>w03,()=>j03],V03=[9,Dw,hZ3,{[IH8]:["POST","/logout",200]},()=>H03,()=>D03];class cw1 extends oI.Command.classBuilder().ep(RH8).m(function(q,K,_,z){return[oF6.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").sc(v03).build(){}class UH8 extends oI.Command.classBuilder().ep(RH8).m(function(q,K,_,z){return[oF6.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccountRoles",{}).n("SSOClient","ListAccountRolesCommand").sc(T03).build(){}class QH8 extends oI.Command.classBuilder().ep(RH8).m(function(q,K,_,z){return[oF6.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccounts",{}).n("SSOClient","ListAccountsCommand").sc(k03).build(){}class lw1 extends oI.Command.classBuilder().ep(RH8).m(function(q,K,_,z){return[oF6.getEndpointPlugin(_,q.getEndpointParameterInstructions())]}).s("SWBPortalService","Logout",{}).n("SSOClient","LogoutCommand").sc(V03).build(){}var N03={GetRoleCredentialsCommand:cw1,ListAccountRolesCommand:UH8,ListAccountsCommand:QH8,LogoutCommand:lw1};class nw1 extends aF6{}oI.createAggregatedClient(N03,nw1);var y03=rF6.createPaginator(aF6,UH8,"nextToken","nextToken","maxResults"),E03=rF6.createPaginator(aF6,QH8,"nextToken","nextToken","maxResults");Object.defineProperty(iw1,"$Command",{enumerable:!0,get:function(){return oI.Command}});Object.defineProperty(iw1,"__Client",{enumerable:!0,get:function(){return oI.Client}});
|
||
|
||
var m4q=B((br$,Zy3)=>{Zy3.exports={name:"@aws-sdk/client-bedrock",description:"AWS SDK for JavaScript Bedrock Client for Node.js, Browser and React Native",version:"3.936.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-bedrock","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo bedrock"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.936.0","@aws-sdk/credential-provider-node":"3.936.0","@aws-sdk/middleware-host-header":"3.936.0","@aws-sdk/middleware-logger":"3.936.0","@aws-sdk/middleware-recursion-detection":"3.936.0","@aws-sdk/middleware-user-agent":"3.936.0","@aws-sdk/region-config-resolver":"3.936.0","@aws-sdk/token-providers":"3.936.0","@aws-sdk/types":"3.936.0","@aws-sdk/util-endpoints":"3.936.0","@aws-sdk/util-user-agent-browser":"3.936.0","@aws-sdk/util-user-agent-node":"3.936.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-bedrock"}}});
|
||
|
||
var Tzq=B((vo$,S99)=>{S99.exports={name:"@aws-sdk/client-bedrock-runtime",description:"AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",version:"3.936.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-bedrock-runtime","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo bedrock-runtime"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.936.0","@aws-sdk/credential-provider-node":"3.936.0","@aws-sdk/eventstream-handler-node":"3.936.0","@aws-sdk/middleware-eventstream":"3.936.0","@aws-sdk/middleware-host-header":"3.936.0","@aws-sdk/middleware-logger":"3.936.0","@aws-sdk/middleware-recursion-detection":"3.936.0","@aws-sdk/middleware-user-agent":"3.936.0","@aws-sdk/middleware-websocket":"3.936.0","@aws-sdk/region-config-resolver":"3.936.0","@aws-sdk/token-providers":"3.936.0","@aws-sdk/types":"3.936.0","@aws-sdk/util-endpoints":"3.936.0","@aws-sdk/util-user-agent-browser":"3.936.0","@aws-sdk/util-user-agent-node":"3.936.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/eventstream-serde-browser":"^4.2.5","@smithy/eventstream-serde-config-resolver":"^4.3.5","@smithy/eventstream-serde-node":"^4.2.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-stream":"^4.5.6","@smithy/util-utf8":"^4.2.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock-runtime",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-bedrock-runtime"}}});
|
||
|
||
var QOq=B((ga$,kP9)=>{kP9.exports={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",version:"3.936.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.936.0","@aws-sdk/credential-provider-node":"3.936.0","@aws-sdk/middleware-host-header":"3.936.0","@aws-sdk/middleware-logger":"3.936.0","@aws-sdk/middleware-recursion-detection":"3.936.0","@aws-sdk/middleware-user-agent":"3.936.0","@aws-sdk/region-config-resolver":"3.936.0","@aws-sdk/types":"3.936.0","@aws-sdk/util-endpoints":"3.936.0","@aws-sdk/util-user-agent-browser":"3.936.0","@aws-sdk/util-user-agent-node":"3.936.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}}});
|
||
|
||
var awq=B((Os$,zG9)=>{zG9.exports={name:"@aws-sdk/client-cognito-identity",description:"AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native",version:"3.936.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cognito-identity","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cognito-identity","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts --mode development","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.936.0","@aws-sdk/credential-provider-node":"3.936.0","@aws-sdk/middleware-host-header":"3.936.0","@aws-sdk/middleware-logger":"3.936.0","@aws-sdk/middleware-recursion-detection":"3.936.0","@aws-sdk/middleware-user-agent":"3.936.0","@aws-sdk/region-config-resolver":"3.936.0","@aws-sdk/types":"3.936.0","@aws-sdk/util-endpoints":"3.936.0","@aws-sdk/util-user-agent-browser":"3.936.0","@aws-sdk/util-user-agent-node":"3.936.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/client-iam":"3.936.0","@tsconfig/node18":"18.2.4","@types/chai":"^4.2.11","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cognito-identity"}}});
|
||
|
||
throw new mq(`Failed to get token from azureADTokenProvider: ${K.message}`,{cause:K})}if(typeof q!=="string"||!q)throw new mq(`Expected azureADTokenProvider function argument to return a string but it returned ${q}`);return Tf1([{Authorization:`Bearer ${q}`}])}if(typeof this._options.apiKey==="string")return Tf1([{"x-api-key":this.apiKey}]);return}validateHeaders(){return}}});var Wfq={};v8(Wfq,{default:()=>kf1,BaseAnthropic:()=>uY,AnthropicFoundry:()=>kf1});var Dfq=L(()=>{Vf1();Vf1()});var pP8="4.10.1",CY6="04b07795-8ddb-461a-bbee-02f9e1bf7b46",ffq="common",wF,kQ6,Zfq="login.microsoftonline.com",Gfq,vfq="cae",Tfq="nocae",kfq="msal.cache";var jF=L(()=>{(function(q){q.AzureChina="https://login.chinacloudapi.cn",q.AzureGermany="https://login.microsoftonline.de",q.AzureGovernment="https://login.microsoftonline.us",q.AzurePublicCloud="https://login.microsoftonline.com"})(wF||(wF={}));kQ6=wF.AzurePublicCloud,Gfq=["*"]});function vI9(q){var K,_,z,Y,$,O,A;let w={cache:{},broker:{isEnabled:(_=(K=q.brokerOptions)===null||K===void 0?void 0:K.enabled)!==null&&_!==void 0?_:!1,enableMsaPassthrough:(Y=(z=q.brokerOptions)===null||z===void 0?void 0:z.legacyEnableMsaPassthrough)!==null&&Y!==void 0?Y:!1,parentWindowHandle:($=q.brokerOptions)===null||$===void 0?void 0:$.parentWindowHandle}};if((O=q.tokenCachePersistenceOptions)===null||O===void 0?void 0:O.enabled){if(BP8===void 0)throw Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let j=q.tokenCachePersistenceOptions.name||kfq;
|
||
|
||
var Q1,K9,SG,uZ1,q2,$N,pY6,r86,WW8,B06,DF,ON,BY6,Xi,xO,cQ6="appmetadata",VGq="client_info",o86="1",g06,RT,gP,Vz,fF,lQ6,nQ6,gY6,DW8,fw,F06=300,jZ;var K2=L(()=>{/*! @azure/msal-common v15.13.1 2025-10-29 */Q1={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;
|
||
|
||
this.executeCallback(K.logLevel,Y,K.containsPii||!1)}executeCallback(q,K,_){if(this.localCallback)this.localCallback(q,K,_)}error(q,K){this.logMessage(q,{logLevel:vH.Error,containsPii:!1,correlationId:K||Q1.EMPTY_STRING})}errorPii(q,K){this.logMessage(q,{logLevel:vH.Error,containsPii:!0,correlationId:K||Q1.EMPTY_STRING})}warning(q,K){this.logMessage(q,{logLevel:vH.Warning,containsPii:!1,correlationId:K||Q1.EMPTY_STRING})}warningPii(q,K){this.logMessage(q,{logLevel:vH.Warning,containsPii:!0,correlationId:K||Q1.EMPTY_STRING})}info(q,K){this.logMessage(q,{logLevel:vH.Info,containsPii:!1,correlationId:K||Q1.EMPTY_STRING})}infoPii(q,K){this.logMessage(q,{logLevel:vH.Info,containsPii:!0,correlationId:K||Q1.EMPTY_STRING})}verbose(q,K){this.logMessage(q,{logLevel:vH.Verbose,containsPii:!1,correlationId:K||Q1.EMPTY_STRING})}verbosePii(q,K){this.logMessage(q,{logLevel:vH.Verbose,containsPii:!0,correlationId:K||Q1.EMPTY_STRING})}trace(q,K){this.logMessage(q,{logLevel:vH.Trace,containsPii:!1,correlationId:K||Q1.EMPTY_STRING})}tracePii(q,K){this.logMessage(q,{logLevel:vH.Trace,containsPii:!0,correlationId:K||Q1.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}var vH;var ZW8=L(()=>{K2();/*! @azure/msal-common v15.13.1 2025-10-29 */(function(q){q[q.Error=0]="Error",q[q.Warning=1]="Warning",q[q.Info=2]="Info",q[q.Verbose=3]="Verbose",q[q.Trace=4]="Trace"})(vH||(vH={}))});var GW8="@azure/msal-common",d06="15.13.1";var vW8=L(()=>{/*! @azure/msal-common v15.13.1 2025-10-29 */});var Zi;var TW8=L(()=>{/*! @azure/msal-common v15.13.1 2025-10-29 */Zi={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"}});var c06={};
|
||
|
||
/*! @azure/msal-common v15.13.1 2025-10-29 */RGq={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},nZ1=RGq.endpointMetadata,iZ1=RGq.instanceDiscoveryMetadata,rZ1=new Set;
|
||
|
||
/*! @azure/msal-node v3.8.1 2025-10-29 */wG1=`https://login.microsoftonline.com/${pp9}/`,wN={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},SX={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},D3={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},m3={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},TH={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},h2={GET:"get",POST:"post"},YD8={SUCCESS_RANGE_START:K9.SUCCESS_RANGE_START,SUCCESS_RANGE_END:K9.SUCCESS_RANGE_END,SERVER_ERROR:K9.SERVER_ERROR},Jvq={SHA256:"sha256"},$D8={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},jG1={KEY_SEPARATOR:"-"},uT={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",AUTHORIZATION_PENDING:"authorization_pending",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},Li={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByCode:871,acquireTokenByRefreshToken:872},FS={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},OD8={INTERVAL_MS:100,TIMEOUT_MS:5000}});
|
||
|
||
if(_.headers[wN.METADATA_HEADER_NAME]="true",_.queryParameters[SX.API_VERSION]=Tl9,_.queryParameters[SX.RESOURCE]=q,K.idType!==TH.SYSTEM_ASSIGNED)_.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(K.idType,!0)]=K.id;return _.retryPolicy=new m$6,_}}});var kl9="2019-07-01-preview",p$6;var vyq=L(()=>{x$6();b$6();R2();/*! @azure/msal-node v3.8.1 2025-10-29 */p$6=class p$6 extends JN{constructor(q,K,_,z,Y,$,O){super(q,K,_,z,Y);this.identityEndpoint=$,this.identityHeader=O}static getEnvironmentVariables(){let q=process.env[D3.IDENTITY_ENDPOINT],K=process.env[D3.IDENTITY_HEADER],_=process.env[D3.IDENTITY_SERVER_THUMBPRINT];return[q,K,_]}static tryCreate(q,K,_,z,Y,$){let[O,A,w]=p$6.getEnvironmentVariables();if(!O||!A||!w)return q.info(`[Managed Identity] ${m3.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${D3.IDENTITY_HEADER}', '${D3.IDENTITY_ENDPOINT}' or '${D3.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`),null;let j=p$6.getValidatedEnvVariableUrlString(D3.IDENTITY_ENDPOINT,O,m3.SERVICE_FABRIC,q);if(q.info(`[Managed Identity] Environment variables validation passed for ${m3.SERVICE_FABRIC} managed identity. Endpoint URI: ${j}. Creating ${m3.SERVICE_FABRIC} managed identity.`),$.idType!==TH.SYSTEM_ASSIGNED)q.warning(`[Managed Identity] ${m3.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`);return new p$6(q,K,_,z,Y,O,A)}createRequest(q,K){let _=new PL(h2.GET,this.identityEndpoint);if(_.headers[wN.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,_.queryParameters[SX.API_VERSION]=kl9,_.queryParameters[SX.RESOURCE]=q,K.idType!==TH.SYSTEM_ASSIGNED)_.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(K.idType)]=K.id;return _}}});var Vl9="2017-09-01",Nl9,B$6;var Tyq=L(()=>{b$6();R2();x$6();
|
||
|
||
if(!q.message)throw new ak1("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=q.code,this.errorMessage=q.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1000)}}Zbq.ExecutableResponse=Dbq;class li extends Error{constructor(q){super(q);Object.setPrototypeOf(this,new.target.prototype)}}Zbq.ExecutableResponseError=li;class nk1 extends li{}Zbq.InvalidVersionFieldError=nk1;class ik1 extends li{}Zbq.InvalidSuccessFieldError=ik1;class fbq extends li{}Zbq.InvalidExpirationTimeFieldError=fbq;class rk1 extends li{}Zbq.InvalidTokenTypeFieldError=rk1;class ok1 extends li{}Zbq.InvalidCodeFieldError=ok1;class ak1 extends li{}Zbq.InvalidMessageFieldError=ak1;class cf8 extends li{}Zbq.InvalidSubjectTokenError=cf8});var kbq=B((vbq)=>{Object.defineProperty(vbq,"__esModule",{value:!0});vbq.PluggableAuthHandler=void 0;var r6_=lf8(),r$6=sk1(),o6_=U6("child_process"),tk1=U6("fs");class ek1{constructor(q){if(!q.command)throw Error("No command provided.");if(this.commandComponents=ek1.parseCommand(q.command),this.timeoutMillis=q.timeoutMillis,!this.timeoutMillis)throw Error("No timeoutMillis provided.");this.outputFile=q.outputFile}retrieveResponseFromExecutable(q){return new Promise((K,_)=>{let z=o6_.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(q)}}),Y="";z.stdout.on("data",(O)=>{Y+=O}),z.stderr.on("data",(O)=>{Y+=O});let $=setTimeout(()=>{return z.removeAllListeners(),z.kill(),_(Error("The executable failed to finish within the timeout specified."))},this.timeoutMillis);z.on("close",(O)=>{if(clearTimeout($),O===0)try{let A=JSON.parse(Y),w=new r$6.ExecutableResponse(A);return K(w)}catch(A){if(A instanceof r$6.ExecutableResponseError)return _(A);
|
||
|
||
return _(new r$6.ExecutableResponseError(`The executable returned an invalid response: ${Y}`))}else return _(new r6_.ExecutableError(Y,O.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let q;try{q=await tk1.promises.realpath(this.outputFile)}catch(_){return}if(!(await tk1.promises.lstat(q)).isFile())return;let K=await tk1.promises.readFile(q,{encoding:"utf8"});if(K==="")return;try{let _=JSON.parse(K);if(new r$6.ExecutableResponse(_).isValid())return new r$6.ExecutableResponse(_);return}catch(_){if(_ instanceof r$6.ExecutableResponseError)throw _;throw new r$6.ExecutableResponseError(`The output file contained an invalid response: ${K}`)}}static parseCommand(q){let K=q.match(/(?:[^\s"]+|"[^"]*")+/g);if(!K)throw Error(`Provided command: "${q}" could not be parsed.`);for(let _=0;_<K.length;_++)if(K[_][0]==='"'&&K[_].slice(-1)==='"')K[_]=K[_].slice(1,-1);return K}}vbq.PluggableAuthHandler=ek1});var lf8=B((Lbq)=>{Object.defineProperty(Lbq,"__esModule",{value:!0});Lbq.PluggableAuthClient=Lbq.ExecutableError=void 0;var a6_=S16(),s6_=sk1(),t6_=kbq();class qV1 extends Error{constructor(q,K){super(`The executable failed with exit code: ${K} and error message: ${q}.`);this.code=K,Object.setPrototypeOf(this,new.target.prototype)}}Lbq.ExecutableError=qV1;var e6_=30000,Vbq=5000,Nbq=120000,q8_="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",ybq=1;class Ebq extends a6_.BaseExternalAccountClient{constructor(q,K){super(q,K);if(!q.credential_source.executable)throw Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=q.credential_source.executable.command,!this.command)throw Error('No valid Pluggable Auth "credential_source" provided.');if(q.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=e6_;else if(this.timeoutMillis=q.credential_source.executable.timeout_millis,this.timeoutMillis<Vbq||this.timeoutMillis>Nbq)throw Error(`Timeout must be between ${Vbq} and ${Nbq} milliseconds.`);
|
||
|
||
if(WZ8&&Date.now()-HIq<K)return WZ8;if(GIq()){if(!KO())return{}}try{let _=pR(q,{timeout:30000})?.toString().trim();if(!_)throw Error("otelHeadersHelper did not return a valid value");let z=l8(_);if(typeof z!=="object"||z===null||Array.isArray(z))throw Error("otelHeadersHelper must return a JSON object with string key-value pairs");for(let[Y,$]of Object.entries(z))if(typeof $!=="string")throw Error(`otelHeadersHelper returned non-string value for key "${Y}": ${typeof $}`);return WZ8=z,HIq=Date.now(),WZ8}catch(_){throw j6(Error(`Error getting OpenTelemetry headers from otelHeadersHelper (in settings): ${F6(_)}`)),_}}function S7_(q){return q==="max"||q==="pro"}function Zl6(){let q=jK();return i7()&&q!==null&&S7_(q)}function $v6(){if(Dq()!=="firstParty")return;let{source:K}=kS(),_={};if(K==="CLAUDE_CODE_OAUTH_TOKEN"||K==="CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR")_.tokenSource=K;else if(i7())_.subscription=ZZ8();else _.tokenSource=K;let{key:z,source:Y}=XA();if(z)_.apiKeySource=Y;if(K==="claude.ai"||Y==="/login managed key"){let O=o_()?.organizationName;if(O)_.organization=O}let $=o_()?.emailAddress;if((K==="claude.ai"||Y==="/login managed key")&&$)_.email=$;return _}async function ri(){if(process.env.ANTHROPIC_UNIX_SOCKET)return{valid:!0};if(!yJ())return{valid:!0};let q=V1("policySettings")?.forceLoginOrgUUID;if(q===void 0)return{valid:!0};let K=typeof q==="string"?[q]:q;if(K.length===0)return{valid:!1,message:`forceLoginOrgUUID in managed settings is set to an empty array.
|
||
No organizations are permitted. This is almost certainly a misconfiguration.
|
||
Contact your administrator.`};let _=K.length===1?`organization ${K[0]}`:`one of these organizations: ${K.join(", ")}`;await PY();let z=t7();if(!z)return{valid:!0};let{source:Y}=kS(),$=Y==="CLAUDE_CODE_OAUTH_TOKEN"||Y==="CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR",O=await sg(z.accessToken);
|
||
|
||
if(!O)return{valid:!1,message:`Unable to verify organization for the current authentication token.
|
||
This machine requires ${_} but the profile could not be fetched.
|
||
This may be a network error, or the token may lack the user:profile scope required for
|
||
verification (tokens from 'claude setup-token' do not include this scope).
|
||
Try again, or obtain a full-scope token via 'claude auth login'.`};let A=O.organization.uuid;if(K.includes(A))return{valid:!0};if($)return{valid:!1,message:`The ${Y==="CLAUDE_CODE_OAUTH_TOKEN"?"CLAUDE_CODE_OAUTH_TOKEN":"CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR"} environment variable provides a token for a
|
||
different organization than required by this machine's managed settings.
|
||
|
||
Required: ${_}
|
||
Token organization: ${A}
|
||
|
||
Remove the environment variable or obtain a token for a permitted organization.`};return{valid:!1,message:`Your authentication token belongs to organization ${A},
|
||
but this machine requires ${_}.
|
||
|
||
Please log in with a permitted organization: claude auth login`}}var P7_=300000,TL=null,ii=null,qv6=0,D7_=3600000,Z7_=180000,tn,v7_=5000,T7_=3600000,V7_=180000,Ol6,Kv6,t7,jIq=0,FV1,Ml6=null,WZ8=null,HIq=0,R7_=1740000,vIq;var T7=L(()=>{I3();c4();z3();k8();en();P_();T8();pX1();$D();sZ6();lX1();cU6();pW1();NX8();BG();k1();_8();d8();E8();PK();h8();Kg();AT();F16();gV1();GY6();i1();r8();PZ8();tn=jB6(async()=>{let q=await f7_(),K=await G7_();if(q||K)await vHq();return K},D7_);Ol6=jB6(async()=>{return await k7_()},T7_);Kv6=$1(()=>{if(f9())return null;if(process.platform==="darwin"){let K=$Iq();if(K){if(K.stdout)return{key:K.stdout,source:"/login managed key"}}else{let _=OL();try{let z=pR(`security find-generic-password -a $USER -w -s "${_}"`);if(z)return{key:z,source:"/login managed key"}}catch(z){j6(z)}}}let q=w8();if(!q.primaryApiKey)return null;return{key:q.primaryApiKey,source:"/login managed key"}});t7=$1(()=>{if(f9())return null;
|
||
|
||
for(let _ of I94()){let z=LC(_,"vendor","seccomp",K,"apply-seccomp");if(NA6.existsSync(z))return j7(`[SeccompFilter] Found apply-seccomp binary in global install: ${z} (${K})`),z}return j7(`[SeccompFilter] apply-seccomp binary not found in any expected location (${K})`),null}function m94(q){let K=lC1(q);if(K)return j7("[SeccompFilter] Using pre-generated BPF filter"),K;return j7("[SeccompFilter] Pre-generated BPF filter not available for this architecture. Only x64 and arm64 are supported.",{level:"error"}),null}function nC1(q){}var UC1,QC1,dC1=null;var p94=L(()=>{UC1=new Map,QC1=new Map});import{randomBytes as cI_}from"node:crypto";import*as BO from"fs";import{spawn as B94}from"node:child_process";import{tmpdir as iC1}from"node:os";import pX,{join as g94}from"node:path";function lI_(q,K){let _=q.split(pX.sep),z="";for(let Y of _){if(!Y)continue;let $=z+pX.sep+Y;try{if(BO.lstatSync($).isSymbolicLink()){if(K.some((w)=>$.startsWith(w+"/")||$===w))return $}}catch{break}z=$}return null}function nI_(q){let K=q.split(pX.sep),_="";for(let z of K){if(!z)continue;let Y=_+pX.sep+z;try{let $=BO.statSync(Y);if($.isFile()||$.isSymbolicLink())return!0}catch{break}_=Y}return!1}function iI_(q){let K=q.split(pX.sep),_="";for(let z of K){if(!z)continue;let Y=_+pX.sep+z;if(!BO.existsSync(Y))return Y;_=Y}return q}async function rI_(q={command:"rg"},K=aC1,_=!1,z){let Y=process.cwd(),$=new AbortController,O=z??$.signal,A=Xk8(),w=[...ri6.map((X)=>pX.resolve(Y,X)),...A.map((X)=>pX.resolve(Y,X))],j=pX.resolve(Y,".git"),H=!1;try{H=BO.statSync(j).isDirectory()}catch{}if(H){if(w.push(pX.resolve(Y,".git/hooks")),!_)w.push(pX.resolve(Y,".git/config"))}let J=[];for(let X of ri6)J.push("--iglob",X);for(let X of A)J.push("--iglob",`**/${X}/**`);if(J.push("--iglob","**/.git/hooks/**"),!_)J.push("--iglob","**/.git/config");let M=[];try{M=await C94(["--files","--hidden","--max-depth",String(K),...J,"-g","!**/node_modules/**"],Y,O,q)}catch(X){j7(`[Sandbox] ripgrep scan failed: ${X}`)}for(let X of M){let P=pX.resolve(Y,X),W=!1;
|
||
|
||
if(Z.push(...b.flatMap((I)=>{let m=I.indexOf("="),p=I.slice(0,m),C=I.slice(m+1);return["--setenv",p,C]})),$!==void 0)Z.push("--setenv","CLAUDE_CODE_HOST_HTTP_PROXY_PORT",String($));if(O!==void 0)Z.push("--setenv","CLAUDE_CODE_HOST_SOCKS_PROXY_PORT",String(O))}}let k=await aI_(A,w,M,X,P,D);if(Z.push(...k),Z.push("--dev","/dev"),Z.push("--unshare-pid"),!j)Z.push("--proc","/proc");else Z.push("--unshare-user","--bind","/proc","/proc");let V=J||"bash",y=Ur(V);if(!y)throw Error(`Shell '${V}' not found in PATH`);if(Z.push("--",y,"-c"),_&&z&&Y){let b=oI_(z,Y,K,v,y,W?.applyPath);Z.push(b)}else if(v){let b=si6(W?.applyPath);if(!b)throw Error("apply-seccomp binary not found. This should have been caught earlier. Ensure vendor/seccomp/{x64,arm64}/apply-seccomp binaries are included in the package.");let I=yA6.default.quote([b,v,y,"-c",K]);Z.push(I)}else Z.push(K);let E=yA6.default.quote(["bwrap",...Z]),R=[];if(_)R.push("network");if(f||G)R.push("filesystem");if(v)R.push("seccomp(unix-block)");return j7(`[Sandbox Linux] Wrapped command with bwrap (${R.join(", ")} restrictions)`),E}catch(k){if(g76>0)g76--;if(v&&!v.includes("/vendor/seccomp/")){rC1.delete(v);try{nC1(v)}catch(V){j7(`[Sandbox Linux] Failed to clean up seccomp filter on error: ${V}`,{level:"error"})}}throw k}}var yA6,aC1=3,rC1,Dk8,g76=0,F94=!1;var c94=L(()=>{ii6();b94();zk6();p94();yA6=w6(BC1(),1);rC1=new Set,Dk8=new Set});import{spawn as sI_}from"child_process";import*as dr from"path";function tI_(q=!1){let K=process.cwd(),_=[];for(let z of ri6)_.push(dr.resolve(K,z)),_.push(`**/${z}`);for(let z of Xk8())_.push(dr.resolve(K,z)),_.push(`**/${z}/**`);if(_.push(dr.resolve(K,".git/hooks")),_.push("**/.git/hooks/**"),!q)_.push(dr.resolve(K,".git/config")),_.push("**/.git/config");return[...new Set(_)]}function eI_(q){return`CMD64_${Wk8(q)}_END_${i94}`}function l94(q){let K=[],_=dr.dirname(q);while(_!=="/"&&_!=="."){K.push(_);let z=dr.dirname(_);if(z===_)break;_=z}return K}function r94(q,K){let _=[];for(let z of q){let Y=RN(z);if(iG(Y)){let $=VA6(Y);
|
||
|
||
mN8=$1(async(q)=>{return`Execute a skill within the main conversation
|
||
|
||
When users ask you to perform tasks, check if any of the available skills match. Skills provide specialized capabilities and domain knowledge.
|
||
|
||
When users reference a "slash command" or "/<something>" (e.g., "/commit", "/review-pr"), they are referring to a skill. Use this tool to invoke it.
|
||
|
||
How to invoke:
|
||
- Use this tool with the skill name and optional arguments
|
||
- Examples:
|
||
- \`skill: "pdf"\` - invoke the pdf skill
|
||
- \`skill: "commit", args: "-m 'Fix bug'"\` - invoke with arguments
|
||
- \`skill: "review-pr", args: "123"\` - invoke with arguments
|
||
- \`skill: "ms-office-suite:pdf"\` - invoke using fully qualified name
|
||
|
||
Important:
|
||
- Available skills are listed in system-reminder messages in the conversation
|
||
- When a skill matches the user's request, this is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about the task
|
||
- NEVER mention a skill without actually calling this tool
|
||
- Do not invoke a skill that is already running
|
||
- Do not use this tool for built-in CLI commands (like /help, /clear, etc.)
|
||
- If you see a <${zG}> tag in the current conversation turn, the skill has ALREADY been loaded - follow the instructions directly instead of calling this tool again
|
||
`})});var WV6=5242880,UL=3932160,RU=2000,SU=2000,DV6=20971520,FJ4=100,UJ4=3145728,mu1=104857600,Hw6=20,pN8=10,QJ4=100,dJ4=600,cJ4=20;function on_(q){return Math.max(0,Math.floor((Date.now()-q)/86400000))}function pu1(q){let K=on_(q);if(K<=1)return"";return`This memory is ${K} days old. `+"Memories are point-in-time observations, not live state — "+"claims about code behavior or file:line citations may be outdated. Verify against current code before asserting as fact."}function lJ4(q){let K=pu1(q);if(!K)return"";return`<system-reminder>${K}</system-reminder>
|
||
`}var tP="ToolSearch";var Bu1={};v8(Bu1,{isDeferredTool:()=>oC,getPrompt:()=>BN8,formatDeferredToolLine:()=>vo6,TOOL_SEARCH_TOOL_NAME:()=>tP});
|
||
|
||
while(K&&z<_){if(K instanceof Error&&"code"in K&&typeof K.code==="string"){let Y=K.code,$=fo_.has(Y);return{code:Y,message:K.message,isSSLError:$}}if(K instanceof Error&&"cause"in K&&K.cause!==K)K=K.cause,z++;else break}return null}function Iq6(q){let K=xq6(q);if(!K?.isSSLError)return null;return`SSL certificate error (${K.code}). If you are behind a corporate proxy or TLS-intercepting firewall, set NODE_EXTRA_CA_CERTS to your CA bundle path, or ask IT to allowlist *.anthropic.com. Run /doctor for details.`}function Vm1(q){if(q.includes("<!DOCTYPE html")||q.includes("<html")){let K=q.match(/<title>([^<]+)<\/title>/);if(K&&K[1])return K[1].trim();return""}return q}function Zo_(q){let K=q.message;if(!K)return"";return Vm1(K)}function Go_(q){return typeof q==="object"&&q!==null&&"error"in q&&typeof q.error==="object"&&q.error!==null}function vo_(q){if(!Go_(q))return null;let _=q.error,z=_?.error?.message;if(typeof z==="string"&&z.length>0){let $=Vm1(z);if($.length>0)return $}let Y=_?.message;if(typeof Y==="string"&&Y.length>0){let $=Vm1(Y);if($.length>0)return $}return null}function xV6(q){let K=xq6(q);if(K){let{code:z,isSSLError:Y}=K;if(z==="ETIMEDOUT")return"Request timed out. Check your internet connection and proxy settings";if(Y)switch(z){case"UNABLE_TO_VERIFY_LEAF_SIGNATURE":case"UNABLE_TO_GET_ISSUER_CERT":case"UNABLE_TO_GET_ISSUER_CERT_LOCALLY":return"Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates";case"CERT_HAS_EXPIRED":return"Unable to connect to API: SSL certificate has expired";case"CERT_REVOKED":return"Unable to connect to API: SSL certificate has been revoked";case"DEPTH_ZERO_SELF_SIGNED_CERT":case"SELF_SIGNED_CERT_IN_CHAIN":return"Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates";case"ERR_TLS_CERT_ALTNAME_INVALID":case"HOSTNAME_MISMATCH":return"Unable to connect to API: SSL certificate hostname mismatch";
|
||
|
||
:<>=]/,contains:[{beginKeywords:"final class struct"},q.TITLE_MODE]}]),exports:{preprocessor:H,strings:w,keywords:P}}}function z7z(q){let K={keyword:"boolean byte word String",built_in:"KeyboardController MouseController SoftwareSerial EthernetServer EthernetClient LiquidCrystal RobotControl GSMVoiceCall EthernetUDP EsploraTFT HttpClient RobotMotor WiFiClient GSMScanner FileSystem Scheduler GSMServer YunClient YunServer IPAddress GSMClient GSMModem Keyboard Ethernet Console GSMBand Esplora Stepper Process WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage Client Server GSMPIN FileIO Bridge Serial EEPROM Stream Mouse Audio Servo File Task GPRS WiFi Wire TFT GSM SPI SD ",_:"setup loop runShellCommandAsynchronously analogWriteResolution retrieveCallingNumber printFirmwareVersion analogReadResolution sendDigitalPortPair noListenOnLocalhost readJoystickButton setFirmwareVersion readJoystickSwitch scrollDisplayRight getVoiceCallStatus scrollDisplayLeft writeMicroseconds delayMicroseconds beginTransmission getSignalStrength runAsynchronously getAsynchronously listenOnLocalhost getCurrentCarrier readAccelerometer messageAvailable sendDigitalPorts lineFollowConfig countryNameWrite runShellCommand readStringUntil rewindDirectory readTemperature setClockDivider readLightSensor endTransmission analogReference detachInterrupt countryNameRead attachInterrupt encryptionType readBytesUntil robotNameWrite readMicrophone robotNameRead cityNameWrite userNameWrite readJoystickY readJoystickX mouseReleased openNextFile scanNetworks noInterrupts digitalWrite beginSpeaker mousePressed isActionDone mouseDragged displayLogos noAutoscroll addParameter remoteNumber getModifiers keyboardRead userNameRead waitContinue processInput parseCommand printVersion readNetworks writeMessage blinkVersion cityNameRead readMessage setDataMode parsePacket isListening setBitOrder beginPacket isDirectory motorsWrite drawCompass digitalRead clearScreen serialEvent rightToLeft setTextSize leftToRight requestFrom keyReleased compassRead analogWrite interrupts WiFiServer disconnect playMelody parseFloat autoscroll getPINUsed setPINUsed setTimeout sendAnalog readSlider analogRead beginWrite createChar motorsStop keyPressed tempoWrite readButton subnetMask debugPrint macAddress writeGreen randomSeed attachGPRS readString sendString remotePort releaseAll mouseMoved background getXChange getYChange answerCall getResult voiceCall endPacket constrain getSocket writeJSON getButton available connected findUntil readBytes exitValue readGreen writeBlue startLoop IPAddress isPressed sendSysex pauseMode gatewayIP setCursor getOemKey tuneWrite noDisplay loadImage switchPIN onRequest onReceive changePIN playFile noBuffer parseInt overflow checkPIN knobRead beginTFT bitClear updateIR bitWrite position writeRGB highByte writeRed setSpeed readBlue noStroke remoteIP transfer shutdown hangCall beginSMS endWrite attached maintain noCursor checkReg checkPUK shiftOut isValid shiftIn pulseIn connect println localIP pinMode getIMEI display noBlink process getBand running beginSD drawBMP lowByte setBand release bitRead prepare pointTo readRed setMode noFill remove listen stroke detach attach noTone exists buffer height bitSet circle config cursor random IRread setDNS endSMS getKey micros millis begin print write ready flush width isPIN blink clear press mkdir rmdir close point yield image BSSID click delay read text move peek beep rect line open seek fill size turn stop home find step tone sqrt RSSI SSID end bit tan cos sin pow map abs max min get run put",literal:"DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL DEFAULT OUTPUT INPUT HIGH LOW"},_=_7z(q),z=_.keywords;
|
||
|
||
return q.source}function AN6(q){return hw("(?=",q,")")}function hw(...q){return q.map((_)=>XN4(_)).join("")}function Xk(...q){return"("+q.map((_)=>XN4(_)).join("|")+")"}var OB1=(q)=>hw(/\b/,q,/\w$/.test(q)?/\b/:/\B/),HN4=["Protocol","Type"].map(OB1),_B1=["init","self"].map(OB1),r5z=["Any","Self"],zB1=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],JN4=["false","nil","true"],o5z=["assignment","associativity","higherThan","left","lowerThan","none","right"],a5z=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],MN4=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],PN4=Xk(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),WN4=Xk(PN4,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),YB1=hw(PN4,WN4,"*"),DN4=Xk(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),HE8=Xk(DN4,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Xo=hw(DN4,HE8,"*"),$B1=hw(/[A-Z]/,HE8,"*"),s5z=["autoclosure",hw(/convention\(/,Xk("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",hw(/objc\(/,Xo,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],t5z=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];
|
||
|
||
ZN6=new Set(["?","$","@","*","#","-","!","_"]),B$z=new Set(["export","declare","typeset","readonly","local"]),iB1=new Set(["if","then","elif","else","fi","while","until","for","in","do","done","case","esac","function","select"]);WOz={"=":2,"+=":2,"-=":2,"*=":2,"/=":2,"%=":2,"<<=":2,">>=":2,"&=":2,"^=":2,"|=":2,"||":4,"&&":5,"|":6,"^":7,"&":8,"==":9,"!=":9,"<":10,">":10,"<=":10,">=":10,"<<":11,">>":11,"+":12,"-":12,"*":13,"/":13,"%":13,"**":14},DOz=new Set(["=","+=","-=","*=","/=","%=","<<=",">>=","&=","^=","|=","**"])});var mL4={};v8(mL4,{parseCommandRaw:()=>ga6,parseCommand:()=>tB1,findCommandNode:()=>GN6,extractCommandArguments:()=>Fa6,PARSE_ABORTED:()=>oq6});async function tB1(q){if(!q||q.length>uL4)return null;try{let K=ko().parse(q);if(!K)return null;let _=GN6(K,null),z=kOz(_);return{rootNode:K,envVars:z,commandNode:_,originalCommand:q}}catch{return null}}async function ga6(q){if(!q)return null;if(q.length>uL4)return d("tengu_tree_sitter_parse_abort",{cmdLength:q.length,panic:!1}),oq6;try{let K=ko().parse(q);if(K===null)return d("tengu_tree_sitter_parse_abort",{cmdLength:q.length,panic:!1}),oq6;return K}catch{return d("tengu_tree_sitter_parse_abort",{cmdLength:q.length,panic:!0}),oq6}}function GN6(q,K){let{type:_,children:z}=q;if(aB1.has(_))return q;if(_==="variable_assignment"&&K)return K.children.find((Y)=>aB1.has(Y.type)&&Y.startIndex>q.startIndex)??null;if(_==="pipeline"){for(let Y of z){let $=GN6(Y,q);if($)return $}return null}if(_==="redirected_statement")return z.find((Y)=>aB1.has(Y.type))??null;for(let Y of z){let $=GN6(Y,q);if($)return $}return null}function kOz(q){if(!q||q.type!=="command")return[];let K=[];for(let _ of q.children)if(_.type==="variable_assignment")K.push(_.text);else if(_.type==="command_name"||_.type==="word")break;return K}function Fa6(q){if(q.type==="declaration_command"){let z=q.children[0];return z&&vOz.has(z.text)?[z.text]:[]}let K=[],_=!1;for(let z of q.children){if(z.type==="variable_assignment")continue;if(z.type==="command_name"||!_&&z.type==="word"){_=!0;
|
||
|
||
return super.setRequestHandler(q,O)}if($==="sampling/createMessage"){let O=async(A,w)=>{let j=KT(D71,A);if(!j.success){let W=j.error instanceof Error?j.error.message:String(j.error);throw new GK(z5.InvalidParams,`Invalid sampling request: ${W}`)}let{params:H}=j.data,J=await Promise.resolve(K(A,w));if(H.task){let W=KT(Ul,J);if(!W.success){let D=W.error instanceof Error?W.error.message:String(W.error);throw new GK(z5.InvalidParams,`Invalid task creation result: ${D}`)}return W.data}let X=H.tools||H.toolChoice?cm6:f_6,P=KT(X,J);if(!P.success){let W=P.error instanceof Error?P.error.message:String(P.error);throw new GK(z5.InvalidParams,`Invalid sampling result: ${W}`)}return P.data};return super.setRequestHandler(q,O)}return super.setRequestHandler(q,K)}assertCapability(q,K){if(!this._serverCapabilities?.[q])throw Error(`Server does not support ${q} (required for ${K})`)}async connect(q,K){if(await super.connect(q),q.sessionId!==void 0)return;try{let _=await this.request({method:"initialize",params:{protocolVersion:Ue,capabilities:this._capabilities,clientInfo:this._clientInfo}},O71,K);if(_===void 0)throw Error(`Server sent invalid initialize result: ${_}`);if(!hY8.includes(_.protocolVersion))throw Error(`Server's protocol version is not supported: ${_.protocolVersion}`);if(this._serverCapabilities=_.capabilities,this._serverVersion=_.serverInfo,q.setProtocolVersion)q.setProtocolVersion(_.protocolVersion);if(this._instructions=_.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig)this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0}catch(_){throw this.close(),_}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(q){switch(q){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw Error(`Server does not support logging (required for ${q})`);break;
|
||
|
||
case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw Error(`Server does not support prompts (required for ${q})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw Error(`Server does not support resources (required for ${q})`);if(q==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw Error(`Server does not support resource subscriptions (required for ${q})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw Error(`Server does not support tools (required for ${q})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw Error(`Server does not support completions (required for ${q})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(q){switch(q){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw Error(`Client does not support roots list changed notifications (required for ${q})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(q){if(!this._capabilities)return;switch(q){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Client does not support sampling capability (required for ${q})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw Error(`Client does not support elicitation capability (required for ${q})`);break;case"roots/list":if(!this._capabilities.roots)throw Error(`Client does not support roots capability (required for ${q})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Client does not support tasks capability (required for ${q})`);break;case"ping":break}}assertTaskCapability(q){S$8(this._serverCapabilities?.tasks?.requests,q,"Server")}assertTaskHandlerCapability(q){if(!this._capabilities)return;
|
||
|
||
j=j+" · /doctor for details",z({key:"keybinding-config-warning",text:j,color:A>0?"error":"warning",priority:A>0?"immediate":"high",timeoutMs:60000})},_[0]=z,_[1]=Y,_[2]=q,_[3]=$;else $=_[3];let O;if(_[4]!==z||_[5]!==K||_[6]!==Y||_[7]!==q)O=[q,K,z,Y],_[4]=z,_[5]=K,_[6]=Y,_[7]=q,_[8]=O;else O=_[8];rX.useEffect($,O)}function sDz(q){return q.severity==="warning"}function tDz(q){return q.severity==="error"}function hM({children:q}){let[{bindings:K,warnings:_},z]=rX.useState(()=>{let D=Ts6();return N(`[keybindings] KeybindingSetup initialized with ${D.bindings.length} bindings, ${D.warnings.length} warnings`),D}),[Y,$]=rX.useState(!1);aDz(_,Y);let O=rX.useRef(null),[A,w]=rX.useState(null),j=rX.useRef(null),H=rX.useRef(new Map),J=rX.useRef(new Set),M=rX.useCallback((D)=>{J.current.add(D)},[]),X=rX.useCallback((D)=>{J.current.delete(D)},[]),P=rX.useCallback(()=>{if(j.current)clearTimeout(j.current),j.current=null},[]),W=rX.useCallback((D)=>{if(P(),D!==null)j.current=setTimeout((f,G)=>{N("[keybindings] Chord timeout - cancelling"),f.current=null,G(null)},oDz,O,w);O.current=D,w(D)},[P]);return rX.useEffect(()=>{_S4();let D=zS4((f)=>{$(!0),z(f),N(`[keybindings] Reloaded: ${f.bindings.length} bindings, ${f.warnings.length} warnings`)});return()=>{D(),P()}},[P]),rX.default.createElement(tL8,{bindings:K,pendingChordRef:O,pendingChord:A,setPendingChord:W,activeContexts:J.current,registerActiveContext:M,unregisterActiveContext:X,handlerRegistryRef:H},rX.default.createElement(eDz,{bindings:K,pendingChordRef:O,setPendingChord:W,activeContexts:J.current,handlerRegistryRef:H}),q)}function eDz(q){let K=Y6(6),{bindings:_,pendingChordRef:z,setPendingChord:Y,activeContexts:$,handlerRegistryRef:O}=q,A;if(K[0]!==$||K[1]!==_||K[2]!==O||K[3]!==z||K[4]!==Y)A=(j,H,J)=>{if((H.wheelUp||H.wheelDown)&&z.current===null)return;let M=O.current,X=new Set;if(M)for(let f of M.values())for(let G of f)X.add(G.context);let P=[...X,...$,"Global"],W=z.current!==null,D=sL8(j,H,P,_,z.current);
|
||
|
||
var Lc1=B((MIA,iVz)=>{iVz.exports={name:"@grpc/grpc-js",version:"1.14.0",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto","copy-protos":"node ./copy-protos"},dependencies:{"@grpc/proto-loader":"^0.8.0","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/**/*.proto","proto/**/LICENSE","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});
|
||
|
||
let _=K?K:q==="stable"?"stable":"latest",z=await x7("npm",["install",`${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.PACKAGE_URL}@${_}`],{cwd:bb8(),maxBuffer:1e6});if(z.code!==0){let Y=Error(`Failed to install Claude CLI package: ${z.stderr}`);return j6(Y),z.code===190?"in_progress":"install_failed"}return S8((Y)=>({...Y,installMethod:"local"})),"success"}catch(_){return j6(_),"install_failed"}}async function Yj6(){try{return await cpz(te6(bb8(),"node_modules",".bin","claude")),!0}catch{return!1}}function UE6(){let q=process.env.SHELL||"";if(q.includes("zsh"))return"zsh";if(q.includes("bash"))return"bash";if(q.includes("fish"))return"fish";return"unknown"}var $j6=L(()=>{k1();d8();E8();PK();e7();h8();r8()});import{open as rpz,readFile as opz,stat as apz}from"fs/promises";import{homedir as r8K}from"os";import{join as Ui1}from"path";function vK6(q){let K=q?.homedir??r8K(),z=(q?.env??process.env).ZDOTDIR||K;return{zsh:Ui1(z,".zshrc"),bash:Ui1(K,".bashrc"),fish:Ui1(K,".config/fish/config.fish")}}function xb8(q){let K=!1;return{filtered:q.filter((z)=>{if(o8K.test(z)){let Y=z.match(/alias\s+claude\s*=\s*["']([^"']+)["']/);if(!Y)Y=z.match(/alias\s+claude\s*=\s*([^#\n]+)/);if(Y&&Y[1]){if(Y[1].trim()===n8K())return K=!0,!1}}return!0}),hadAlias:K}}async function q68(q){try{return(await opz(q,{encoding:"utf8"})).split(`
|
||
`)}catch(K){if(S9(K))return null;throw K}}async function Ib8(q,K){let _=await rpz(q,"w");try{await _.writeFile(K.join(`
|
||
`),{encoding:"utf8"}),await _.datasync()}finally{await _.close()}}async function Qi1(q){let K=vK6(q);for(let _ of Object.values(K)){let z=await q68(_);if(!z)continue;for(let Y of z)if(o8K.test(Y)){let $=Y.match(/alias\s+claude=["']?([^"'\s]+)/);if($&&$[1])return $[1]}}return null}async function a8K(q){let K=await Qi1(q);if(!K)return null;
|
||
|
||
process.stderr.write(`Login failed: ${F6(H)}
|
||
${J?J+`
|
||
`:""}`),process.exit(1)}finally{j.cleanup()}}async function oBz(q){let{source:K,hasToken:_}=kS(),{source:z}=XA(),Y=!!process.env.ANTHROPIC_API_KEY&&!iv(),$=o_(),O=jK(),A=U16(),w=_||z!=="none"||Y||A,j="none";if(A)j="third_party";else if(K==="claude.ai")j="claude.ai";else if(K==="apiKeyHelper")j="api_key_helper";else if(K!=="none")j="oauth_token";else if(z==="ANTHROPIC_API_KEY"||Y)j="api_key";else if(z==="/login managed key")j="claude.ai";if(q.text){let H=[...Kx8(),..._x8()],J=!1;for(let M of H){let X=typeof M.value==="string"?M.value:Array.isArray(M.value)?M.value.join(", "):null;if(X===null||X==="none")continue;if(J=!0,M.label)process.stdout.write(`${M.label}: ${X}
|
||
`);else process.stdout.write(`${X}
|
||
`)}if(!J&&Y)process.stdout.write(`API key: ANTHROPIC_API_KEY
|
||
`);if(!w)process.stdout.write(`Not logged in. Run claude auth login to authenticate.
|
||
`)}else{let H=Dq(),J=z!=="none"?z:Y?"ANTHROPIC_API_KEY":null,M={loggedIn:w,authMethod:j,apiProvider:H};if(J)M.apiKeySource=J;if(j==="claude.ai")M.email=$?.emailAddress??null,M.orgId=$?.organizationUuid??null,M.orgName=$?.organizationName??null,M.subscriptionType=O??null;process.stdout.write(g6(M,null,2)+`
|
||
`)}process.exit(w?0:1)}async function aBz(){try{await ae6({clearOnboarding:!1})}catch{process.stderr.write(`Failed to log out.
|
||
`),process.exit(1)}process.stdout.write(`Successfully logged out from your Anthropic account.
|
||
`),process.exit(0)}var cE6=L(()=>{Bi1();k8();Yo();B8K();$D();sZ6();se6();T7();k1();_8();d8();E8();h8();P_();i1();r8();Ar1()});var J68=B((eBz)=>{function sBz(q,K,_){if(_===void 0)_=Array.prototype;if(q&&typeof _.find==="function")return _.find.call(q,K);for(var z=0;z<q.length;z++)if(Object.prototype.hasOwnProperty.call(q,z)){var Y=q[z];if(K.call(void 0,Y,z,q))return Y}}function wr1(q,K){if(K===void 0)K=Object;return K&&typeof K.freeze==="function"?K.freeze(q):q}function tBz(q,K){if(q===null||typeof q!=="object")throw TypeError("target is not an object");
|
||
|
||
if(q===void 0)throw Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let K=await YD();if(!K)throw Error("Unable to get organization UUID");return{accessToken:q,orgUUID:K}}async function so1(){let{accessToken:q,orgUUID:K}=await dH(),_=`${m7().BASE_API_URL}/v1/sessions`;try{let z={...eY(q),"anthropic-beta":"ccr-byoc-2025-07-29","x-organization-uuid":K},Y=await CI8(_,{headers:z});if(Y.status!==200)throw Error(`Failed to fetch code sessions: ${Y.statusText}`);return Y.data.data.map((O)=>{let A=O.session_context.sources.find((j)=>j.type==="git_repository"),w=null;if(A?.url){let j=Kz6(A.url);if(j){let[H,J]=j.split("/");if(H&&J)w={name:J,owner:{login:H},default_branch:A.revision||void 0}}}return{id:O.id,title:O.title||"Untitled",description:"",status:O.session_status,repo:w,turns:[],created_at:O.created_at,updated_at:O.updated_at}})}catch(z){let Y=m1(z);throw j6(Y),z}}function eY(q){return{Authorization:`Bearer ${q}`,"Content-Type":"application/json","anthropic-version":"2023-06-01"}}async function pK6(q){let{accessToken:K,orgUUID:_}=await dH(),z=`${m7().BASE_API_URL}/v1/sessions/${q}`,Y={...eY(K),"anthropic-beta":"ccr-byoc-2025-07-29","x-organization-uuid":_},$=await O1.get(z,{headers:Y,timeout:15000,validateStatus:(O)=>O<500});if($.status!==200){let A=$.data?.error?.message;if($.status===404)throw Error(`Session not found: ${q}`);if($.status===401)throw Error("Session expired. Please run /login to sign in again.");
|
||
|
||
return S5K.default.createElement(CL6,{startingMessage:"Starting new login following /extra-usage. Exit with Ctrl-C to use existing account.",onDone:(z)=>{K.onChangeAPIKey(),q(z?"Login successful":"Login interrupted")}})}var S5K;var _a1=L(()=>{RI8();qa1();S5K=w6(D6(),1)});var b5K={};v8(b5K,{call:()=>ndz});async function ndz(){let q=await uI8();if(q.type==="message")return{type:"text",value:q.value};return{type:"text",value:q.opened?`Browser opened to manage extra usage. If it didn't open, visit: ${q.url}`:`Please visit ${q.url} to manage extra usage.`}}var x5K=L(()=>{qa1()});function I5K(){if(c6(process.env.DISABLE_EXTRA_USAGE_COMMAND))return!1;return zv6()}var BK6,u5K;var M88=L(()=>{T8();T7();d8();BK6={type:"local-jsx",name:"extra-usage",description:"Configure extra usage to keep working when limits are hit",isEnabled:()=>I5K()&&!g7(),load:()=>Promise.resolve().then(() => (_a1(),C5K))},u5K={type:"local",name:"extra-usage",supportsNonInteractive:!0,description:"Configure extra usage to keep working when limits are hit",isEnabled:()=>I5K()&&g7(),get isHidden(){return!g7()},load:()=>Promise.resolve().then(() => (x5K(),b5K))}});function gK6(){let[q,K]=mI8.useState({...Zk});return mI8.useEffect(()=>{let _=(z)=>{K({...z})};return tq6.add(_),()=>{tq6.delete(_)}},[]),q}var mI8;var X88=L(()=>{YQ();mI8=w6(D6(),1)});function idz({shouldShowUpsell:q,isMax20x:K,isExtraUsageCommandEnabled:_,shouldAutoOpenRateLimitOptionsMenu:z,isTeamOrEnterprise:Y,hasBillingAccess:$,serverHidesUpgrade:O}){if(!q)return null;if(K){if(_)return"/extra-usage to finish what you’re working on.";return"/login to switch to an API usage-billed account."}if(z)return"Opening your options…";if(Y){if(!_)return null;if($)return"/extra-usage to finish what you’re working on.";return"/extra-usage to request more usage from your admin."}if(O){if(_)return"/extra-usage to finish what you’re working on.";return null}if(!_)return"/upgrade to increase your usage limit.";
|
||
|
||
return z}function g5K(q){let K=Y6(57),{param:_,addMargin:z,shouldShowDot:Y,verbose:$,onOpenRateLimitOptions:O,messageUuid:A}=q,{text:w}=_,j=w9.useContext(bo),H=w9.useContext(E26),J=Tm4(),M=km4(),X=J===A,P=Fy6(A),[W,D]=w9.useState(null);if(sN6(w))return null;if(jh4(w)){let f;if(K[0]!==O||K[1]!==w)f=w9.default.createElement(m5K,{text:w,onOpenRateLimitOptions:O}),K[0]=O,K[1]=w,K[2]=f;else f=K[2];return f}switch(w){case Fj6:return null;case Dp:{let f;if(K[3]===Symbol.for("react.memo_cache_sentinel"))f=gy6("warning"),K[3]=f;else f=K[3];let G=f,Z;if(K[4]===Symbol.for("react.memo_cache_sentinel"))Z=w9.default.createElement(_1,{height:1},w9.default.createElement(T,{color:"error"},"Context limit reached · /compact or /clear to continue",G?` · ${G}`:"")),K[4]=Z;else Z=K[4];return Z}case FI8:{let f;if(K[5]===Symbol.for("react.memo_cache_sentinel"))f=w9.default.createElement(_1,{height:1},w9.default.createElement(T,{color:"error"},"Credit balance too low · Add funds: https://platform.claude.com/settings/billing")),K[5]=f;else f=K[5];return f}case UI8:{let f;if(K[6]===Symbol.for("react.memo_cache_sentinel"))f=w9.default.createElement(rdz,null),K[6]=f;else f=K[6];return f}case pI8:{let f;if(K[7]===Symbol.for("react.memo_cache_sentinel"))f=w9.default.createElement(_1,{height:1},w9.default.createElement(T,{color:"error"},pI8)),K[7]=f;else f=K[7];return f}case Ya1:case za1:{let f;if(K[8]!==w)f=w9.default.createElement(_1,null,w9.default.createElement(T,{color:"error"},w)),K[8]=w,K[9]=f;else f=K[9];return f}case BI8:{let f;if(K[10]===Symbol.for("react.memo_cache_sentinel"))f=w9.default.createElement(_1,{height:1},w9.default.createElement(T,{color:"error"},BI8)),K[10]=f;else f=K[10];return f}case gI8:{let f;if(K[11]===Symbol.for("react.memo_cache_sentinel"))f=w9.default.createElement(_1,{height:1},w9.default.createElement(T,{color:"error"},gI8,process.env.API_TIMEOUT_MS&&w9.default.createElement(w9.default.Fragment,null," ","(API_TIMEOUT_MS=",process.env.API_TIMEOUT_MS,"ms, try increasing it)"))),K[11]=f;else f=K[11];
|
||
|
||
if(H.status===401)throw a8("error","teleport_events_bad_token"),Error("Your session has expired. Please run /login to sign in again.");if(H.status!==200)return j6(Error(`Teleport events returned ${H.status}: ${g6(H.data)}`)),a8("error","teleport_events_bad_status"),null;let{data:J,next_cursor:M}=H.data;if(!Array.isArray(J))return j6(Error(`Teleport events invalid response shape: ${g6(H.data)}`)),a8("error","teleport_events_invalid_shape"),null;for(let X of J)if(X.payload!==null)$.push(X.payload);if(A++,M==null)break;O=M}if(A>=w)j6(Error(`Teleport events hit page cap (${w}) for ${q}`)),a8("warn","teleport_events_page_cap");return N(`[teleport] Fetched ${$.length} events over ${A} page(s) for ${q}`),$}async function pa1(q,K,_){try{let z=await O1.get(K,{headers:_,timeout:20000,validateStatus:(Y)=>Y<500,params:c6(process.env.CLAUDE_AFTER_LAST_COMPACT)?{after_last_compact:!0}:void 0});if(z.status===200){let Y=z.data;if(!Y||typeof Y!=="object"||!Array.isArray(Y.loglines))return j6(Error(`Invalid session logs response format: ${g6(Y)}`)),a8("error","session_get_fail_invalid_response"),null;let $=Y.loglines;return N(`Fetched ${$.length} session logs for session ${q}`),$}if(z.status===404)return N(`No existing logs for session ${q}`),a8("warn","session_get_no_logs_for_session"),[];if(z.status===401)throw N("Auth token expired or invalid"),a8("error","session_get_fail_bad_token"),Error("Your session has expired. Please run /login to sign in again.");return N(`Failed to fetch session logs: ${z.status} ${z.statusText}`),a8("error","session_get_fail_status",{status:z.status}),null}catch(z){if(!O1.isAxiosError(z))throw z;return j6(Error(`Error fetching session logs: ${z.message}`)),a8("error","session_get_fail_status",{status:z.status}),null}}function slz(q){if(!q)return;let K=q.findLast((_)=>("uuid"in _)&&_.uuid);return K&&"uuid"in K?K.uuid:void 0}function M_K(){_H6.clear(),ma1.clear()}var _H6,Tu8=10,rlz=500,ma1;var ku8=L(()=>{VK();z3();_8();w$();d8();E8();h8();tL();r8();mM();_H6=new Map,ma1=new Map});
|
||
|
||
return q.trim()}function n88(q,K){return[...Fu8(q),Kiz(),qiz(K)]}async function i88(q){try{let K=await lu8();if(N(`Current branch before teleport: '${K}'`),q){N(`Switching to branch '${q}'...`),await Yiz(q),await Oiz(q);let z=await lu8();N(`Branch after checkout: '${z}'`)}else N("No branch specified, staying on current branch");return{branchName:await lu8(),branchError:null}}catch(K){let _=await lu8(),z=m1(K);return{branchName:_,branchError:z}}}async function iu8(q){let K=await gR(),_=K?`${K.owner}/${K.name}`:null,z=q.session_context.sources.find((j)=>j.type==="git_repository");if(!z?.url)return N(_?"Session has no associated repository, proceeding without validation":"Session has no repo requirement and not in git directory, proceeding"),{status:"no_repo_required"};let Y=qz6(z.url),$=Y?`${Y.owner}/${Y.name}`:Kz6(z.url);if(!$)return{status:"no_repo_required"};if(N(`Session is for repository: ${$}, current repo: ${_??"none"}`),!_)return{status:"not_in_repo",sessionRepo:$,sessionHost:Y?.host,currentRepo:null};let O=(j)=>j.replace(/:\d+$/,""),A=_.toLowerCase()===$.toLowerCase(),w=!K||!Y||O(K.host.toLowerCase())===O(Y.host.toLowerCase());if(A&&w)return{status:"match",sessionRepo:$,currentRepo:_};return{status:"mismatch",sessionRepo:$,currentRepo:_,sessionHost:Y?.host,currentHost:K?.host}}async function AH6(q,K){if(!G$("allow_remote_sessions"))throw Error("Remote sessions are disabled by your organization's policy.");N(`Resuming code session ID: ${q}`);try{let _=t7()?.accessToken;if(!_)throw d("tengu_teleport_resume_error",{error_type:"no_access_token"}),Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let z=await YD();if(!z)throw d("tengu_teleport_resume_error",{error_type:"no_org_uuid"}),Error("Unable to get organization UUID for constructing session URL");K?.("validating");let Y=await pK6(q),$=await iu8(Y);
|
||
|
||
mA();h8();a1();dq();t4();i1();r8();mM();iL6();a_K();nu8=w6(D6(),1)});function jiz(q){return wiz.includes(q??"")}async function Jiz(q){try{await fs1(q.taskId,q)}catch(K){N(`persistRemoteAgentMetadata failed: ${String(K)}`)}}async function oa(q){try{await o88(q)}catch(K){N(`removeRemoteAgentMetadata failed: ${String(K)}`)}}async function ru8({skipBundle:q=!1}={}){let K=await Y_K({skipBundle:q});if(K.length>0)return{eligible:!1,errors:K};return{eligible:!0}}function ou8(q){switch(q.type){case"not_logged_in":return"Please run /login and sign in with your Claude.ai account (not Console).";case"no_remote_environment":return"No cloud environment available. Set one up at https://claude.ai/code/onboarding?magic=env-setup";case"not_in_git_repo":return"Background tasks require a git repository. Initialize git or run from a git repository.";case"no_git_remote":return"Background tasks require a GitHub remote. Add one with `git remote add origin REPO_URL`.";case"github_app_not_installed":return`The Claude GitHub app must be installed on this repository first.
|
||
https://github.com/apps/claude/installations/new`;case"policy_blocked":return"Remote sessions are disabled by your organization's policy. Contact your organization admin to enable them."}}function Ps1(q,K,_,z,Y){if(!Ws1(q,z))return;let $=_==="completed"?"completed successfully":_==="failed"?"failed":"was stopped",O=Y?`
|
||
<${IR}>${Y}</${IR}>`:"",A=aY(q),w=`<${Pw}>
|
||
<${YG}>${q}</${YG}>${O}
|
||
<${O66}>remote_agent</${O66}>
|
||
<${uR}>${A}</${uR}>
|
||
<${qM}>${_}</${qM}>
|
||
<${MH}>Remote task "${K}" ${$}</${MH}>
|
||
</${Pw}>`;UO({value:w,mode:"task-notification"})}function Ws1(q,K){let _=!1;return w3(q,K,(z)=>{if(z.notified)return z;return _=!0,{...z,notified:!0}}),_}function Miz(q){for(let Y=q.length-1;Y>=0;Y--){let $=q[Y];if($?.type==="system"&&($.subtype==="hook_progress"||$.subtype==="hook_response")){let O=qK($.stdout,U_6);if(O?.trim())return O.trim()}}for(let Y=q.length-1;Y>=0;Y--){let $=q[Y];if($?.type!=="assistant")continue;let O=Z3($.message.content,`
|
||
`),A=qK(O,U_6);
|
||
|
||
q.set(W,G),G.onRequest("workspace/configuration",(Z)=>{return N(`LSP: Received workspace/configuration request from ${W}`),Z.items.map(()=>null)})}catch(f){j6(Error(`Failed to initialize LSP server ${W}: ${f.message}`))}N(`LSP manager initialized with ${q.size} servers`)}async function Y(){let P=Array.from(q.entries()).filter(([,f])=>f.state==="running"||f.state==="error"),W=await Promise.allSettled(P.map(([,f])=>f.stop()));q.clear(),K.clear(),_.clear();let D=W.map((f,G)=>f.status==="rejected"?`${P[G][0]}: ${F6(f.reason)}`:null).filter((f)=>f!==null);if(D.length>0){let f=Error(`Failed to stop ${D.length} LSP server(s): ${D.join("; ")}`);throw j6(f),f}}function $(P){let W=ta.extname(P).toLowerCase(),D=K.get(W);if(!D||D.length===0)return;let f=D[0];if(!f)return;return q.get(f)}async function O(P){let W=$(P);if(!W)return;if(W.state==="stopped"||W.state==="error")try{await W.start()}catch(D){throw j6(Error(`Failed to start LSP server for file ${P}: ${D.message}`)),D}return W}async function A(P,W,D){let f=await O(P);if(!f)return;try{return await f.sendRequest(W,D)}catch(G){throw j6(Error(`LSP request failed for file ${P}, method '${W}': ${G.message}`)),G}}function w(){return q}async function j(P,W){let D=await O(P);if(!D)return;let f=z18(ta.resolve(P)).href;if(_.get(f)===D.name){N(`LSP: File already open, skipping didOpen for ${P}`);return}let G=ta.extname(P).toLowerCase(),Z=D.config.extensionToLanguage[G]||"plaintext";try{await D.sendNotification("textDocument/didOpen",{textDocument:{uri:f,languageId:Z,version:1,text:W}}),_.set(f,D.name),N(`LSP: Sent didOpen for ${P} (languageId: ${Z})`)}catch(v){let k=Error(`Failed to sync file open ${P}: ${F6(v)}`);throw j6(k),k}}async function H(P,W){let D=$(P);if(!D||D.state!=="running")return j(P,W);let f=z18(ta.resolve(P)).href;if(_.get(f)!==D.name)return j(P,W);try{await D.sendNotification("textDocument/didChange",{textDocument:{uri:f,version:1},contentChanges:[{text:W}]}),N(`LSP: Sent didChange for ${P}`)}catch(G){let Z=Error(`Failed to sync file change ${P}: ${F6(G)}`);
|
||
|
||
z+=`
|
||
echo ' alias rg='"'${$}'" >> "$SNAPSHOT_FILE"
|
||
`}z+=`
|
||
echo "fi" >> "$SNAPSHOT_FILE"
|
||
`;let Y=aoz();if(Y!==null)z+=`
|
||
# Shadow find/grep with embedded bfs/ugrep (ant-native only)
|
||
echo "# Shadow find/grep with embedded bfs/ugrep" >> "$SNAPSHOT_FILE"
|
||
cat >> "$SNAPSHOT_FILE" << 'FIND_GREP_FUNC_END'
|
||
${Y}
|
||
FIND_GREP_FUNC_END
|
||
`;return z+=`
|
||
|
||
# Add PATH to the file
|
||
echo "export PATH=${hK([q||""])}" >> "$SNAPSHOT_FILE"
|
||
`,z}async function eoz(q,K,_){let z=wt1(q),Y=z.endsWith(".zshrc"),$=_?soz(z):!Y?'echo "shopt -s expand_aliases" >> "$SNAPSHOT_FILE"':"",O=await toz();return`SNAPSHOT_FILE=${hK([K])}
|
||
${_?`source "${z}" < /dev/null`:"# No user config file to source"}
|
||
|
||
# First, create/clear the snapshot file
|
||
echo "# Snapshot file" >| "$SNAPSHOT_FILE"
|
||
|
||
# When this file is sourced, we first unalias to avoid conflicts
|
||
# This is necessary because aliases get "frozen" inside function definitions at definition time,
|
||
# which can cause unexpected behavior when functions use commands that conflict with aliases
|
||
echo "# Unset all aliases to avoid conflicts with functions" >> "$SNAPSHOT_FILE"
|
||
echo "unalias -a 2>/dev/null || true" >> "$SNAPSHOT_FILE"
|
||
|
||
${$}
|
||
|
||
${O}
|
||
|
||
# Exit silently on success, only report errors
|
||
if [ ! -f "$SNAPSHOT_FILE" ]; then
|
||
echo "Error: Snapshot file was not created at $SNAPSHOT_FILE" >&2
|
||
exit 1
|
||
fi
|
||
`}var $t1="\\",Q$K=1e4,ooz,d$K=async(q)=>{let K=q.includes("zsh")?"zsh":q.includes("bash")?"bash":"sh";return N(`Creating shell snapshot for ${K} (${q})`),new Promise(async(_)=>{try{let z=wt1(q);N(`Looking for shell config file: ${z}`);let Y=await u5(z);if(!Y)N(`Shell config file not found: ${z}, creating snapshot with Claude Code defaults only`);let $=Date.now(),O=Math.random().toString(36).substring(2,8),A=Ot1(q7(),"shell-snapshots");N(`Snapshots directory: ${A}`);let w=Ot1(A,`snapshot-${K}-${$}-${O}.sh`);await noz(A,{recursive:!0});let j=await eoz(q,w,Y);
|
||
|
||
function DWK(){return`
|
||
# TeamCreate
|
||
|
||
## When to Use
|
||
|
||
Use this tool proactively whenever:
|
||
- The user explicitly asks to use a team, swarm, or group of agents
|
||
- The user mentions wanting agents to work together, coordinate, or collaborate
|
||
- A task is complex enough that it would benefit from parallel work by multiple agents (e.g., building a full-stack feature with frontend and backend work, refactoring a codebase while keeping tests passing, implementing a multi-step project with research, planning, and coding phases)
|
||
|
||
When in doubt about whether a task warrants a team, prefer spawning a team.
|
||
|
||
## Choosing Agent Types for Teammates
|
||
|
||
When spawning teammates via the Agent tool, choose the \`subagent_type\` based on what tools the agent needs for its task. Each agent type has a different set of available tools — match the agent to the work:
|
||
|
||
- **Read-only agents** (e.g., Explore, Plan) cannot edit or write files. Only assign them research, search, or planning tasks. Never assign them implementation work.
|
||
- **Full-capability agents** (e.g., general-purpose) have access to all tools including file editing, writing, and bash. Use these for tasks that require making changes.
|
||
- **Custom agents** defined in \`.claude/agents/\` may have their own tool restrictions. Check their descriptions to understand what they can and cannot do.
|
||
|
||
Always review the agent type descriptions and their available tools listed in the Agent tool prompt before selecting a \`subagent_type\` for a teammate.
|
||
|
||
Create a new team to coordinate multiple agents working on a project. Teams have a 1:1 correspondence with task lists (Team = TaskList).
|
||
|
||
\`\`\`
|
||
{
|
||
"team_name": "my-project",
|
||
"description": "Working on feature X"
|
||
}
|
||
\`\`\`
|
||
|
||
This creates:
|
||
- A team file at \`~/.claude/teams/{team-name}/config.json\`
|
||
- A corresponding task list directory at \`~/.claude/tasks/{team-name}/\`
|
||
|
||
## Team Workflow
|
||
|
||
1. **Create a team** with TeamCreate - this creates both the team and its task list
|
||
2. **Create tasks** using the Task tools (TaskCreate, TaskList, etc.) - they automatically use the team's task list
|
||
3. **Spawn teammates** using the Agent tool with \`team_name\` and \`name\` parameters to create teammates that join the team
|
||
4. **Assign tasks** using TaskUpdate with \`owner\` to give tasks to idle teammates
|
||
5. **Teammates work on assigned tasks** and mark them completed via TaskUpdate
|
||
6. **Teammates go idle between turns** - after each turn, teammates automatically go idle and send a notification. IMPORTANT: Be patient with idle teammates! Don't comment on their idleness until it actually impacts your work.
|
||
7. **Shutdown your team** - when the task is completed, gracefully shut down your teammates via SendMessage with \`message: {type: "shutdown_request"}\`.
|
||
|
||
## Task Ownership
|
||
|
||
Tasks are assigned using TaskUpdate with the \`owner\` parameter. Any agent can set or change task ownership via TaskUpdate.
|
||
|
||
## Automatic Message Delivery
|
||
|
||
**IMPORTANT**: Messages from teammates are automatically delivered to you. You do NOT need to manually check your inbox.
|
||
|
||
When you spawn teammates:
|
||
- They will send you messages when they complete tasks or need help
|
||
- These messages appear automatically as new conversation turns (like user messages)
|
||
- If you're busy (mid-turn), messages are queued and delivered when your turn ends
|
||
- The UI shows a brief notification with the sender's name when messages are waiting
|
||
|
||
Messages will be delivered automatically.
|
||
|
||
When reporting on teammate messages, you do NOT need to quote the original message—it's already rendered to the user.
|
||
|
||
## Teammate Idle State
|
||
|
||
Teammates go idle after every turn—this is completely normal and expected. A teammate going idle immediately after sending you a message does NOT mean they are done or unavailable. Idle simply means they are waiting for input.
|
||
|
||
- **Idle teammates can receive messages.** Sending a message to an idle teammate wakes them up and they will process it normally.
|
||
- **Idle notifications are automatic.** The system sends an idle notification whenever a teammate's turn ends. You do not need to react to idle notifications unless you want to assign new work or send a follow-up message.
|
||
- **Do not treat idle as an error.** A teammate sending a message and then going idle is the normal flow—they sent their message and are now waiting for a response.
|
||
- **Peer DM visibility.** When a teammate sends a DM to another teammate, a brief summary is included in their idle notification. This gives you visibility into peer collaboration without the full message content. You do not need to respond to these summaries — they are informational.
|
||
|
||
## Discovering Team Members
|
||
|
||
Teammates can read the team config file to discover other team members:
|
||
- **Team config location**: \`~/.claude/teams/{team-name}/config.json\`
|
||
|
||
The config file contains a \`members\` array with each teammate's:
|
||
- \`name\`: Human-readable name (**always use this** for messaging and task assignment)
|
||
- \`agentId\`: Unique identifier (for reference only - do not use for communication)
|
||
- \`agentType\`: Role/type of the agent
|
||
|
||
**IMPORTANT**: Always refer to teammates by their NAME (e.g., "team-lead", "researcher", "tester"). Names are used for:
|
||
- \`to\` when sending messages
|
||
- Identifying task owners
|
||
|
||
Example of reading team config:
|
||
\`\`\`
|
||
Use the Read tool to read ~/.claude/teams/{team-name}/config.json
|
||
\`\`\`
|
||
|
||
## Task List Coordination
|
||
|
||
Teams share a task list that all teammates can access at \`~/.claude/tasks/{team-name}/\`.
|
||
|
||
Teammates should:
|
||
1. Check TaskList periodically, **especially after completing each task**, to find available work or see newly unblocked tasks
|
||
2. Claim unassigned, unblocked tasks with TaskUpdate (set \`owner\` to your name). **Prefer tasks in ID order** (lowest ID first) when multiple tasks are available, as earlier tasks often set up context for later ones
|
||
3. Create new tasks with \`TaskCreate\` when identifying additional work
|
||
4. Mark tasks as completed with \`TaskUpdate\` when done, then check TaskList for next work
|
||
5. Coordinate with other teammates by reading the task list status
|
||
6. If all available tasks are blocked, notify the team lead or help resolve blocking tasks
|
||
|
||
**IMPORTANT notes for communication with your team**:
|
||
- Do not use terminal tools to view your team's activity;
|
||
|
||
break}for(let j of w.children)if(j)A(j)}return A(K),{hasCommandSubstitution:_,hasProcessSubstitution:z,hasParameterExpansion:Y,hasHeredoc:$,hasComment:O}}function DfK(q,K){return{quoteContext:DzY(q,K),compoundStructure:fzY(q,K),hasActualOperatorNodes:ZzY(q),dangerousPatterns:GzY(q)}}function U17(q,K){K(q);for(let _ of q.children)U17(_,K)}function vzY(q){let K=[];return U17(q,(_)=>{if(_.type==="pipeline"){for(let z of _.children)if(z.type==="|")K.push(z.startIndex)}}),K.sort((_,z)=>_-z)}function TzY(q){let K=[];return U17(q,(_)=>{if(_.type==="file_redirect"){let z=_.children,Y=z.find((O)=>O.type===">"||O.type===">>"),$=z.find((O)=>O.type==="word");if(Y&&$)K.push({startIndex:_.startIndex,endIndex:_.endIndex,target:$.text,operator:Y.type})}}),K}class ZfK{originalCommand;commandBytes;pipePositions;redirectionNodes;treeSitterAnalysis;constructor(q,K,_,z){this.originalCommand=q,this.commandBytes=Buffer.from(q,"utf8"),this.pipePositions=K,this.redirectionNodes=_,this.treeSitterAnalysis=z}toString(){return this.originalCommand}getPipeSegments(){if(this.pipePositions.length===0)return[this.originalCommand];let q=[],K=0;for(let z of this.pipePositions){let Y=this.commandBytes.subarray(K,z).toString("utf8").trim();if(Y)q.push(Y);K=z+1}let _=this.commandBytes.subarray(K).toString("utf8").trim();if(_)q.push(_);return q}withoutOutputRedirections(){if(this.redirectionNodes.length===0)return this.originalCommand;let q=[...this.redirectionNodes].sort((_,z)=>z.startIndex-_.startIndex),K=this.commandBytes;for(let _ of q)K=Buffer.concat([K.subarray(0,_.startIndex),K.subarray(_.endIndex)]);return K.toString("utf8").trim().replace(/\s+/g," ")}getOutputRedirections(){return this.redirectionNodes.map(({target:q,operator:K})=>({target:q,operator:K}))}getTreeSitterAnalysis(){return this.treeSitterAnalysis}}function Q17(q,K){let _=vzY(K),z=TzY(K),Y=DfK(K,q);return new ZfK(q,_,z,Y)}async function kzY(q){if(!q)return null;try{let{parseCommand:K}=await Promise.resolve().then(() => (gw6(),mL4)),_=await K(q);
|
||
|
||
let K=q.map(({processId:_,response:z,hookName:Y,hookEvent:$,toolName:O,pluginId:A,stdout:w,stderr:j,exitCode:H})=>{return N(`Hooks: Creating attachment for ${_} (${Y}): ${g6(z)}`),{type:"async_hook_response",processId:_,hookName:Y,hookEvent:$,toolName:O,response:z,stdout:w,stderr:j,exitCode:H}});if(q.length>0){let _=q.map((z)=>z.processId);WGK(_),N(`Hooks: Removed ${_.length} delivered hooks from registry`)}return N(`Hooks: getAsyncHookResponseAttachments found ${K.length} attachments`),K}async function DAY(q){if(!oq())return[];return[]}function fAY(q){let K=Y9(),_=dP(),z=f_();if(!K||!_)return[];if(q.some((w)=>w.type==="assistant"))return[];let $=q7(),O=`${$}/teams/${K}/config.json`,A=`${$}/tasks/${K}/`;return[{type:"team_context",agentId:_,agentName:z||_,teamName:K,teamConfigPath:O,taskListPath:A}]}function ZAY(q,K,_){if(!c6(process.env.CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT))return[];let z=Sd(K,_),Y=cN(q);return[{type:"token_usage",used:Y,total:z,remaining:z-Y}]}function GAY(){return[]}function vAY(q){if(q===void 0)return[];let K=sJ(),_=q-K;return[{type:"budget_usd",used:K,total:q,remaining:_}]}function TAY(q){let K=0;for(let _=q.length-1;_>=0;_--){let z=q[_];if(z&&_J6(z))K++;if(z?.type==="attachment"&&z.attachment.type==="plan_mode_exit")return K}return 0}async function kAY(q,K){return[]}function YS6(q,K){return EH(q,K,"read","deny")!==null}var NGK,WF8,DF8,ZGK,GGK,fq7=200,vGK=4096,NOY,yOY,LOY,qAY,Gq7,ZF8=!1;var qP=L(()=>{k8();aq();hd();oR6();i_();e7();cj();lH();i2();GM();F7();hL6();h8();_8();E8();oj6();i1();kH6();zb();FO();Xm();T8();ww6();jD();ZY();Aq7();jk();l2();E8();yK();sP();UY();X17();lj();T7();yV();Nz();mD();Fj();wW();T8();eC();$GK();Rm();_r();XF8();$h6();_8();a1();d8();CN();CZ();mb();l1();B$();r8();Q08();XV6();Oq7();_O();fGK();Tw();Jm();uJ();fY();gG();eD();cj();OS1();
|
||
|
||
if(q instanceof Error&&q.message.includes("Your credit balance is too low"))return U9({content:FI8,error:"billing_error"});if(q instanceof nq&&q.status===400&&q.message.toLowerCase().includes("organization has been disabled")){let{source:z}=XA();if(z==="ANTHROPIC_API_KEY"&&process.env.ANTHROPIC_API_KEY&&!i7()){let Y=t7()?.accessToken!=null;return U9({error:"invalid_request",content:Y?za1:Ya1})}}if(q instanceof Error&&q.message.toLowerCase().includes("x-api-key")){if(MTK())return U9({error:"authentication_failed",content:JTK});let{source:z}=XA();return U9({error:"authentication_failed",content:z==="ANTHROPIC_API_KEY"||z==="apiKeyHelper"?pI8:UI8})}if(q instanceof nq&&q.status===403&&q.message.includes("OAuth token has been revoked"))return U9({error:"authentication_failed",content:E2Y()});if(q instanceof nq&&(q.status===401||q.status===403)&&q.message.includes("OAuth authentication is currently not allowed for this organization"))return U9({error:"authentication_failed",content:L2Y()});if(q instanceof nq&&(q.status===401||q.status===403)){if(MTK())return U9({error:"authentication_failed",content:JTK});return U9({error:"authentication_failed",content:g7()?`Failed to authenticate. ${MW}: ${q.message}`:`Please run /login · ${MW}: ${q.message}`})}if(c6(process.env.CLAUDE_CODE_USE_BEDROCK)&&q instanceof Error&&q.message.toLowerCase().includes("model id")){let z=g7()?"--model":"/model",Y=XTK(K);return U9({content:Y?`${MW} (${K}): ${q.message}. Try ${z} to switch to ${Y}.`:`${MW} (${K}): ${q.message}. Run ${z} to pick a different model.`,error:"invalid_request"})}if(q instanceof nq&&q.status===404){let z=g7()?"--model":"/model",Y=XTK(K);return U9({content:Y?`The model ${K} is not available on your ${Dq()} deployment. Try ${z} to switch to ${Y}, or ask your admin to enable this model.`:`There's an issue with the selected model (${K}). It may not exist or you may not have access to it. Run ${z} to pick a different model.`,error:"invalid_request"})}if(q instanceof mf)return U9({content:`${MW}: ${xV6(q)}`,error:"unknown"});
|
||
|
||
function iF8(q,K){let{addNotification:_}=JK(),z=NS6.useRef(q),Y=NS6.useRef(0),$=NS6.useRef(null);NS6.useEffect(()=>{let O=z.current;if(z.current=q,!K||!q||O)return;if($.current)clearTimeout($.current);return $.current=setTimeout(async(A,w,j)=>{A.current=null;let H=Date.now();if(H-w.current<YjY)return;if(await Cx4())w.current=H,j({key:_jY,text:`Image in clipboard · ${bH("chat:imagePaste","Chat","ctrl+v")} to paste`,priority:"immediate",timeoutMs:8000})},zjY,$,Y,_),()=>{if($.current)clearTimeout($.current),$.current=null}},[q,K,_])}var NS6,_jY="clipboard-image-hint",zjY=1000,YjY=30000;var I47=L(()=>{Z$();Lm();Ey6();NS6=w6(D6(),1)});function cTK(q,K){switch(K){case"bash":return`!${q}`;default:return q}}function Lh(q){if(q.startsWith("!"))return"bash";return"prompt"}function cp(q){if(Lh(q)==="prompt")return q;return q.slice(1)}function lTK(q){return q==="!"}import{join as $jY}from"path";function u47(){let q=M8().existsSync($jY(Z8(),"CLAUDE.md")),K=oh7(Z8());return[{key:"workspace",text:"Ask Claude to create a new app or clone a repository",isComplete:!1,isCompletable:!0,isEnabled:K},{key:"claudemd",text:"Run /init to create a CLAUDE.md file with instructions for Claude",isComplete:q,isCompletable:!0,isEnabled:!K}]}function nTK(){return u47().filter(({isCompletable:q,isEnabled:K})=>q&&K).every(({isComplete:q})=>q)}function yS6(){if(kw().hasCompletedProjectOnboarding)return;if(nTK())Vw((q)=>({...q,hasCompletedProjectOnboarding:!0}))}function rTK(){Vw((q)=>({...q,projectOnboardingSeenCount:q.projectOnboardingSeenCount+1}))}var iTK;var Tq8=L(()=>{c4();k1();F7();yK();e7();iTK=$1(()=>{let q=kw();if(q.hasCompletedProjectOnboarding||q.projectOnboardingSeenCount>=4||process.env.IS_DEMO)return!1;return!nTK()})});import{stat as oTK}from"fs/promises";import{homedir as OjY}from"os";import{join as AjY}from"path";function wjY(q){S8((K)=>({...K,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:q}))}function ES6(){S8((q)=>({...q,appleTerminalSetupInProgress:!1}))}function jjY(){let q=w8();
|
||
|
||
if(K[5]===Symbol.for("react.memo_cache_sentinel"))E={label:"Always copy full response",value:"always",description:"Skip this picker in the future (revert via /config)"},K[5]=E;else E=K[5];j=[w,...z.map(HJY),E],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:pVK};let b=z[R];return{text:b.code,filename:`copy${gVK(b.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 b=M(R);if(R==="always"){if(!w8().copyFullResponse)S8(jJY);d("tengu_copy",{block_count:z.length,always:!0,message_age:Y});let m=await pK7(b.text,b.filename);$(`${m}
|
||
Preference saved. Use /config to change copyFullResponse`);return}d("tengu_copy",{selected_block:b.blockIndex,block_count:z.length,message_age:Y});let I=await pK7(b.text,b.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 E=async function(b){let I=M(b);d("tengu_copy",{selected_block:I.blockIndex,block_count:z.length,message_age:Y,write_shortcut:!0});try{let m=await FVK(I.text,I.filename);$(`Written to ${m}`)}catch(m){let p=m;$(`Failed to write file: ${p instanceof Error?p.message:p}`)}};W=function(b){if(b.key==="w"&&!b.ctrl&&!b.meta)b.preventDefault(),E(O.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=Rh.default.createElement(T,{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=(E)=>{O.current=E},K[20]=G;else G=K[20];let Z;if(K[21]!==P)Z=(E)=>{P(E)},K[21]=P,K[22]=Z;else Z=K[22];let v;if(K[23]!==$)v=()=>{$("Copy cancelled",{display:"system"})},K[23]=$,K[24]=v;else v=K[24];let k;if(K[25]!==H||K[26]!==v||K[27]!==Z)k=Rh.default.createElement(j1,{options:H,hideIndexes:!1,onFocus:G,onChange:Z,onCancel:v}),K[25]=H,K[26]=v,K[27]=Z,K[28]=k;else k=K[28];let V;
|
||
|
||
let Y=z.callTokens+z.resultTokens,$=Y/q.rawMaxTokens*100,O=z.resultTokens/q.rawMaxTokens*100;if($>=DyK&&Y>=f57)return;if(O>=xXY&&z.resultTokens>=f57)K.push({severity:"info",title:`File reads using ${X3(z.resultTokens)} tokens (${O.toFixed(0)}%)`,detail:"If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.",savingsTokens:Math.floor(z.resultTokens*0.3)})}function FXY(q,K){let _=q.memoryFiles.reduce((Y,$)=>Y+$.tokens,0),z=_/q.rawMaxTokens*100;if(z>=IXY&&_>=uXY){let Y=[...q.memoryFiles].sort(($,O)=>O.tokens-$.tokens).slice(0,3).map(($)=>{return`${m5($.path)} (${X3($.tokens)})`}).join(", ");K.push({severity:"info",title:`Memory files using ${X3(_)} tokens (${z.toFixed(0)}%)`,detail:`Largest: ${Y}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(_*0.3)})}}function UXY(q,K){if(!q.isAutoCompactEnabled&&q.percentage>=50&&q.percentage<fyK)K.push({severity:"info",title:"Autocompact is disabled",detail:"Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually."})}var DyK=15,f57=1e4,xXY=5,fyK=80,IXY=5,uXY=5000;var GyK=L(()=>{ZY();bX();yK();I7()});function od(q){let K=Y6(5),{status:_,withSpace:z}=q,Y=z===void 0?!1:z,$=QXY[_],O=!$.color,A=Y&&" ",w;if(K[0]!==$.color||K[1]!==$.icon||K[2]!==O||K[3]!==A)w=vyK.default.createElement(T,{color:$.color,dimColor:O},$.icon,A),K[0]=$.color,K[1]=$.icon,K[2]=O,K[3]=A,K[4]=w;else w=K[4];return w}var vyK,QXY;var iq8=L(()=>{t6();Iq();i6();vyK=w6(D6(),1),QXY={success:{icon:o6.tick,color:"success"},error:{icon:o6.cross,color:"error"},warning:{icon:o6.warning,color:"warning"},info:{icon:o6.info,color:"suggestion"},pending:{icon:o6.circle,color:void 0},loading:{icon:"…",color:void 0}}});function TyK(q){let K=Y6(5),{suggestions:_}=q;if(_.length===0)return null;let z;if(K[0]===Symbol.for("react.memo_cache_sentinel"))z=vW.createElement(T,{bold:!0},"Suggestions"),K[0]=z;else z=K[0];let Y;if(K[1]!==_)Y=_.map(dXY),K[1]=_,K[2]=Y;else Y=K[2];let $;
|
||
|
||
if(K[61]!==M6||K[62]!==J)E=J.length>0&&B1.createElement(u,{flexDirection:"column",marginTop:1},B1.createElement(u,null,B1.createElement(T,{bold:!0},"MCP tools"),B1.createElement(T,{dimColor:!0}," ","· /mcp",M6?" (loaded on-demand)":"")),J.some(zPY)&&B1.createElement(u,{flexDirection:"column",marginTop:1},B1.createElement(T,{dimColor:!0},"Loaded"),J.filter(_PY).map(KPY)),M6&&J.some(qPY)&&B1.createElement(u,{flexDirection:"column",marginTop:1},B1.createElement(T,{dimColor:!0},"Available"),J.filter(eXY).map(tXY)),!M6&&J.map(sXY)),K[61]=M6,K[62]=J,K[63]=E;else E=K[63];R=(X&&X.length>0||J6)&&!1,K[0]=O,K[1]=z,K[2]=w,K[3]=J,K[4]=j,K[5]=A,K[6]=$,K[7]=X,K[8]=M,K[9]=Y,K[10]=G,K[11]=Z,K[12]=v,K[13]=k,K[14]=V,K[15]=y,K[16]=E,K[17]=R,K[18]=b,K[19]=I,K[20]=m}else G=K[10],Z=K[11],v=K[12],k=K[13],V=K[14],y=K[15],E=K[16],R=K[17],b=K[18],I=K[19],m=K[20];let p;if(K[64]!==P)p=P&&P.length>0&&!1,K[64]=P,K[65]=p;else p=K[65];let C;if(K[66]!==W)C=W.length>0&&B1.createElement(u,{flexDirection:"column",marginTop:1},B1.createElement(u,null,B1.createElement(T,{bold:!0},"Custom agents"),B1.createElement(T,{dimColor:!0}," · /agents")),Array.from(VyK(W).entries()).map(oXY)),K[66]=W,K[67]=C;else C=K[67];let g;if(K[68]!==H)g=H.length>0&&B1.createElement(u,{flexDirection:"column",marginTop:1},B1.createElement(u,null,B1.createElement(T,{bold:!0},"Memory files"),B1.createElement(T,{dimColor:!0}," · /memory")),H.map(rXY)),K[68]=H,K[69]=g;else g=K[69];let F;if(K[70]!==D)F=D&&D.tokens>0&&B1.createElement(u,{flexDirection:"column",marginTop:1},B1.createElement(u,null,B1.createElement(T,{bold:!0},"Skills"),B1.createElement(T,{dimColor:!0}," · /skills")),Array.from(VyK(D.skillFrontmatter).entries()).map(nXY)),K[70]=D,K[71]=F;else F=K[71];let U;if(K[72]!==f)U=f&&!1,K[72]=f,K[73]=U;else U=K[73];let c;
|
||
|
||
return VW.createElement(h1,{title:"Memory",onCancel:_,color:"remember"},VW.createElement(u,{flexDirection:"column"},VW.createElement(VW.Suspense,{fallback:null},VW.createElement(VEK,{onSelect:K,onCancel:_})),VW.createElement(u,{marginTop:1},VW.createElement(T,{dimColor:!0},"Learn more: ",VW.createElement(Sq,{url:"https://code.claude.com/docs/en/memory"})))))}var VW,KDY=async(q)=>{return QN(),await RH(),VW.createElement(qDY,{onDone:q})};var CEK=L(()=>{x4();NEK();EEK();i6();GM();d8();E8();h8();Ih();VW=w6(D6(),1)});var _DY,bEK;var xEK=L(()=>{_DY={type:"local-jsx",name:"memory",description:"Edit Claude memory files",load:()=>Promise.resolve().then(() => (CEK(),SEK))},bEK=_DY});var IEK={};v8(IEK,{call:()=>zDY});var zDY=async()=>{let q=!SB();return Uo8(q),d("tengu_memory_toggled",{toggled_off:q}),{type:"text",value:q?`Automemory disabled for this session · this conversation will not write or read new memories, and previously-loaded memory content should not be referenced.
|
||
|
||
Run /toggle-memory again to re-enable.`:"Automemory re-enabled · memory content may be referenced and new memories can be saved."}};var uEK=L(()=>{T8();k8()});var YDY,mEK;var pEK=L(()=>{T8();Tw();YDY={type:"local",name:"toggle-memory",description:"Toggle automemory off/on for this session",isEnabled:()=>!1,isHidden:!1,supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (uEK(),IEK)),userFacingName(){return"toggle-memory"}},mEK=YDY});function S57(q){let K=Y6(14),{commands:_,maxHeight:z,columns:Y,title:$,onCancel:O,emptyMessage:A}=q,{headerFocused:w,focusHeader:j}=hv(),H=Math.max(1,Y-10),J=Math.max(1,Math.floor((z-10)/2)),M;if(K[0]!==_||K[1]!==H){let W=new Set,D;if(K[3]!==H)D=(f)=>({label:`/${f.name}`,value:f.name,description:i5(NJ6(f),H,!0)}),K[3]=H,K[4]=D;else D=K[4];M=_.filter((f)=>{if(W.has(f.name))return!1;return W.add(f.name),!0}).sort($DY).map(D),K[0]=_,K[1]=H,K[2]=M}else M=K[2];let X=M,P;
|
||
|
||
v8(lEK,{call:()=>ADY});var b57,ADY=async(q,{options:{commands:K}})=>{return b57.createElement(dEK,{commands:K,onClose:q})};var nEK=L(()=>{cEK();b57=w6(D6(),1)});var wDY,x57;var iEK=L(()=>{wDY={type:"local-jsx",name:"help",description:"Show help and available commands",load:()=>Promise.resolve().then(() => (nEK(),lEK))},x57=wDY});function rEK(q){let K=Y6(9),{onComplete:_}=q,z;if(K[0]!==_)z=async(H)=>{let J=H==="yes";S8((M)=>({...M,autoConnectIde:J,hasIdeAutoConnectDialogBeenShown:!0})),_()},K[0]=_,K[1]=z;else z=K[1];let Y=z,$;if(K[2]===Symbol.for("react.memo_cache_sentinel"))$=[{label:"Yes",value:"yes"},{label:"No",value:"no"}],K[2]=$;else $=K[2];let O=$,A;if(K[3]!==Y)A=dS6.default.createElement(j1,{options:O,onChange:Y,defaultValue:"yes"}),K[3]=Y,K[4]=A;else A=K[4];let w;if(K[5]===Symbol.for("react.memo_cache_sentinel"))w=dS6.default.createElement(T,{dimColor:!0},"You can also configure this in /config or with the --ide flag"),K[5]=w;else w=K[5];let j;if(K[6]!==_||K[7]!==A)j=dS6.default.createElement(h1,{title:"Do you wish to enable auto-connect to IDE?",color:"ide",onCancel:_},A,w),K[6]=_,K[7]=A,K[8]=j;else j=K[8];return j}function oEK(){let q=w8();return!OW()&&q.autoConnectIde!==!0&&q.hasIdeAutoConnectDialogBeenShown!==!0}function aEK(q){let K=Y6(10),{onComplete:_}=q,z;if(K[0]!==_)z=(J)=>{let M=J==="yes";if(M)S8(jDY);_(M)},K[0]=_,K[1]=z;else z=K[1];let Y=z,$;if(K[2]!==_)$=()=>{_(!1)},K[2]=_,K[3]=$;else $=K[3];let O=$,A;if(K[4]===Symbol.for("react.memo_cache_sentinel"))A=[{label:"No",value:"no"},{label:"Yes",value:"yes"}],K[4]=A;else A=K[4];let w=A,j;if(K[5]!==Y)j=dS6.default.createElement(j1,{options:w,onChange:Y,defaultValue:"no"}),K[5]=Y,K[6]=j;else j=K[6];let H;if(K[7]!==O||K[8]!==j)H=dS6.default.createElement(h1,{title:"Do you wish to disable auto-connect to IDE?",subtitle:"You can also configure this in /config",onCancel:O,color:"ide"},j),K[7]=O,K[8]=j,K[9]=H;else H=K[9];return H}function jDY(q){return{...q,autoConnectIde:!1}}function sEK(){let q=w8();return!OW()&&q.autoConnectIde===!0}var dS6;
|
||
|
||
if(K[24]!==_)V=_.length!==0&&_.some(MDY)&&V_.default.createElement(u,{marginTop:1},V_.default.createElement(T,{color:"warning"},"Note: Only one Claude Code instance can be connected to VS Code at a time.")),K[24]=_,K[25]=V;else V=K[25];let y;if(K[26]!==_.length)y=_.length!==0&&!OW()&&V_.default.createElement(u,{marginTop:1},V_.default.createElement(T,{dimColor:!0},"Tip: You can enable auto-connect to IDE in /config or with the --ide flag")),K[26]=_.length,K[27]=y;else y=K[27];let E;if(K[28]!==z)E=z.length>0&&V_.default.createElement(u,{marginTop:1,flexDirection:"column"},V_.default.createElement(T,{dimColor:!0},"Found ",z.length," other running IDE(s). However, their workspace/project directories do not match the current cwd."),V_.default.createElement(u,{marginTop:1,flexDirection:"column"},z.map(JDY))),K[28]=z,K[29]=E;else E=K[29];let R;if(K[30]!==v||K[31]!==k||K[32]!==V||K[33]!==y||K[34]!==E)R=V_.default.createElement(u,{flexDirection:"column"},v,k,V,y,E),K[30]=v,K[31]=k,K[32]=V,K[33]=y,K[34]=E,K[35]=R;else R=K[35];let b;if(K[36]!==$||K[37]!==R)b=V_.default.createElement(h1,{title:"Select IDE",subtitle:"Connect to an IDE for integrated development features.",onCancel:$,color:"ide"},R),K[36]=$,K[37]=R,K[38]=b;else b=K[38];return b}function JDY(q,K){return V_.default.createElement(u,{key:K,paddingLeft:3},V_.default.createElement(T,{dimColor:!0},"• ",q.name,": ",I57(q.workspaceFolders)))}function MDY(q){return q.name==="VS Code"||q.name==="Visual Studio Code"}function XDY(q,K){return q[K.name]=(q[K.name]||0)+1,q}async function PDY(q,K){let _=K?.ide;if(!_||_.type!=="sse-ide"&&_.type!=="ws-ide")return null;for(let z of q)if(z.url===_.url)return z;return null}function WDY(q){let K=Y6(18),{availableIDEs:_,onSelectIDE:z,onDone:Y}=q,$;if(K[0]!==_[0]?.port)$=_[0]?.port?.toString()??"",K[0]=_[0]?.port,K[1]=$;else $=K[1];let[O,A]=V_.useState($),w;if(K[2]!==_||K[3]!==z)w=(f)=>{let G=_.find((Z)=>Z.port===parseInt(f));z(G)},K[2]=_,K[3]=z,K[4]=w;else w=K[4];let j=w,H;if(K[5]!==_)H=_.map(DDY),K[5]=_,K[6]=H;else H=K[6];let J=H,M;
|
||
|
||
return W6}function oDY(q){return q.sourceAgents}function aDY(q){return q.client.type==="failed"}function sDY(q,K){return q.name.localeCompare(K.name)}function tDY(q,K){return q.name.localeCompare(K.name)}function eDY(q){return q.client.config.type==="claudeai-proxy"}function qfY(q){return q.client.config.type!=="claudeai-proxy"}var N9,OhK;var g57=L(()=>{t6();Iq();i6();Kq();yM();_8();q3();IK();x4();dK();T57();N9=w6(D6(),1),OhK=["project","local","user","enterprise"]});var whK={};v8(whK,{isChannelsEnabled:()=>yJ6,isChannelAllowlisted:()=>F57,getChannelAllowlist:()=>MQ8});function MQ8(){let q=L8("tengu_harbor_ledger",[]),K=KfY().safeParse(q);return K.success?K.data:[]}function yJ6(){return L8("tengu_harbor",!1)}function F57(q){if(!q)return!1;let{name:K,marketplace:_}=T4(q);if(!_)return!1;return MQ8().some((z)=>z.plugin===K&&z.marketplace===_)}var KfY;var q48=L(()=>{u7();oP();l1();KfY=p6(()=>h.array(h.object({marketplace:h.string(),plugin:h.string()})))});function _48(q,K,_){let z=Object.entries(_??{}).filter(([Y])=>_fY.test(Y)).map(([Y,$])=>` ${Y}="${z_($)}"`).join("");return`<${YD6} source="${z_(q)}"${z}>
|
||
${K}
|
||
</${YD6}>`}function Q57(q,K){if((q==="team"||q==="enterprise")&&K)return{entries:K,source:"org"};return{entries:MQ8(),source:"ledger"}}function EJ6(q,K){let _=q.split(":");return K.find((z)=>z.kind==="server"?q===z.name:_[0]==="plugin"&&_[1]===z.name)}function z48(q,K,_){if(!K?.experimental?.["claude/channel"])return{action:"skip",kind:"capability",reason:"server did not declare claude/channel capability"};if(!yJ6())return{action:"skip",kind:"disabled",reason:"channels feature is not currently available"};if(!t7()?.accessToken)return{action:"skip",kind:"auth",reason:"channels requires claude.ai authentication (run /login)"};let z=jK(),Y=z==="team"||z==="enterprise",$=Y?V1("policySettings"):void 0;if(Y&&$?.channelsEnabled!==!0)return{action:"skip",kind:"policy",reason:"channels not enabled by org policy (set channelsEnabled: true in managed settings)"};let O=EJ6(q,wJ());
|
||
|
||
let b=y.kind==="disabled"?"Channels are not currently available":y.kind==="auth"?"Channels require claude.ai authentication · run /login":y.kind==="policy"?"Channels are not enabled for your org · have an administrator set channelsEnabled: true in managed settings":y.reason;j({key:`channels-blocked-${y.kind}`,priority:"high",text:b,color:"warning",timeoutMs:12000})}break}}if(Z.capabilities?.tools?.listChanged)Z.client.setNotificationHandler(Qm6,async()=>{m8(Z.name,"Received tools/list_changed notification, refreshing tools");try{let y=eL.cache.get(Z.name);eL.cache.delete(Z.name);let E=await eL(Z),R=E.length;if(y)y.then((b)=>{d("tengu_mcp_list_changed",{type:"tools",previousCount:b.length,newCount:R})},()=>{d("tengu_mcp_list_changed",{type:"tools",newCount:R})});else d("tengu_mcp_list_changed",{type:"tools",newCount:R});P({...Z,tools:E})}catch(y){oz(Z.name,`Failed to refresh tools after list_changed notification: ${F6(y)}`)}});if(Z.capabilities?.prompts?.listChanged)Z.client.setNotificationHandler(Fm6,async()=>{m8(Z.name,"Received prompts/list_changed notification, refreshing prompts"),d("tengu_mcp_list_changed",{type:"prompts"});try{v26.cache.delete(Z.name);let[y,E]=await Promise.all([v26(Z),Promise.resolve([])]);P({...Z,commands:[...y,...E]}),$fY?.()}catch(y){oz(Z.name,`Failed to refresh prompts after list_changed notification: ${F6(y)}`)}});if(Z.capabilities?.resources?.listChanged)Z.client.setNotificationHandler(Bm6,async()=>{m8(Z.name,"Received resources/list_changed notification, refreshing resources"),d("tengu_mcp_list_changed",{type:"resources"});try{uo.cache.delete(Z.name);{let y=await uo(Z);P({...Z,resources:y})}}catch(y){oz(Z.name,`Failed to refresh resources after list_changed notification: ${F6(y)}`)}});break}case"needs-auth":case"failed":case"pending":case"disabled":break}},[P]),D=N8();k0.useEffect(()=>{async function Z(){let{servers:v,errors:k}=K?{servers:{},errors:[]}:await X26(q),V={...v,...q};ZhK($,k),$((y)=>{let{stale:E,...R}=UC4(y.mcp,V);for(let m of E){let p=O.current.get(m.name);
|
||
|
||
if(H.length===0&&X.length===0)_("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.")},Z=[H.length,W.length,X.length,_],K[10]=X.length,K[11]=W.length,K[12]=_,K[13]=H.length,K[14]=G,K[15]=Z;else G=K[14],Z=K[15];switch(Px.useEffect(G,Z),A.type){case"list":{let v,k;if(K[16]===Symbol.for("react.memo_cache_sentinel"))k=(y)=>w({type:"server-menu",server:y}),v=(y)=>w({type:"agent-server-menu",agentServer:y}),K[16]=v,K[17]=k;else v=K[16],k=K[17];let V;if(K[18]!==X||K[19]!==_||K[20]!==H||K[21]!==A.defaultTab)V=Px.default.createElement(B57,{servers:H,agentServers:X,onSelectServer:k,onSelectAgentServer:v,onComplete:_,defaultTab:A.defaultTab}),K[18]=X,K[19]=_,K[20]=H,K[21]=A.defaultTab,K[22]=V;else V=K[22];return V}case"server-menu":{let v;if(K[23]!==z.tools||K[24]!==A.server.name)v=XQ(z.tools,A.server.name),K[23]=z.tools,K[24]=A.server.name,K[25]=v;else v=K[25];let k=v,V=A.server.transport==="claudeai-proxy"?"claude.ai":"Claude Code";if(A.server.transport==="stdio"){let y;if(K[26]!==A.server)y=()=>w({type:"server-tools",server:A.server}),K[26]=A.server,K[27]=y;else y=K[27];let E;if(K[28]!==V)E=()=>w({type:"list",defaultTab:V}),K[28]=V,K[29]=E;else E=K[29];let R;if(K[30]!==_||K[31]!==k.length||K[32]!==y||K[33]!==E||K[34]!==A.server)R=Px.default.createElement(A48,{server:A.server,serverToolsCount:k.length,onViewTools:y,onCancel:E,onComplete:_}),K[30]=_,K[31]=k.length,K[32]=y,K[33]=E,K[34]=A.server,K[35]=R;else R=K[35];return R}else{let y;if(K[36]!==A.server)y=()=>w({type:"server-tools",server:A.server}),K[36]=A.server,K[37]=y;else y=K[37];let E;if(K[38]!==V)E=()=>w({type:"list",defaultTab:V}),K[38]=V,K[39]=E;else E=K[39];let R;if(K[40]!==_||K[41]!==k.length||K[42]!==y||K[43]!==E||K[44]!==A.server)R=Px.default.createElement(hJ6,{server:A.server,serverToolsCount:k.length,onViewTools:y,onCancel:E,onComplete:_}),K[40]=_,K[41]=k.length,K[42]=y,K[43]=E,K[44]=A.server,K[45]=R;else R=K[45];
|
||
|
||
if(q[6]!==j||q[7]!==O)P=XO.createElement(T,{color:"error"},j," ignored (",O,")"),q[6]=j,q[7]=O,q[8]=P;else P=q[8];let W;if(q[9]===Symbol.for("react.memo_cache_sentinel"))W=XO.createElement(T,{dimColor:!0},"Channels require claude.ai authentication · run /login, then restart"),q[9]=W;else W=q[9];let D;if(q[10]!==P)D=XO.createElement(u,{paddingLeft:2,flexDirection:"column"},P,W),q[10]=P,q[11]=D;else D=q[11];return D}if($){let P;if(q[12]!==j||q[13]!==O)P=XO.createElement(T,{color:"error"},j," blocked by org policy (",O,")"),q[12]=j,q[13]=O,q[14]=P;else P=q[14];let W,D;if(q[15]===Symbol.for("react.memo_cache_sentinel"))W=XO.createElement(T,{dimColor:!0},"Inbound messages will be silently dropped"),D=XO.createElement(T,{dimColor:!0},"Have an administrator set channelsEnabled: true in managed settings to enable"),q[15]=W,q[16]=D;else W=q[15],D=q[16];let f;if(q[17]!==A)f=A.map(wVY),q[17]=A,q[18]=f;else f=q[18];let G;if(q[19]!==P||q[20]!==f)G=XO.createElement(u,{paddingLeft:2,flexDirection:"column"},P,W,D,f),q[19]=P,q[20]=f,q[21]=G;else G=q[21];return G}let H;if(q[22]!==O)H=XO.createElement(T,{color:"error"},"Listening for channel messages from: ",O),q[22]=O,q[23]=H;else H=q[23];let J;if(q[24]!==j)J=XO.createElement(T,{dimColor:!0},"Experimental · inbound messages will be pushed into this session, this carries prompt injection risks. Restart Claude Code without ",j," to disable."),q[24]=j,q[25]=J;else J=q[25];let M;if(q[26]!==A)M=A.map(AVY),q[26]=A,q[27]=M;else M=q[27];let X;if(q[28]!==H||q[29]!==J||q[30]!==M)X=XO.createElement(u,{paddingLeft:2,flexDirection:"column"},H,J,M),q[28]=H,q[29]=J,q[30]=M,q[31]=X;else X=q[31];return X}function AVY(q){return XO.createElement(T,{key:`${x48(q.entry)}:${q.why}`,color:"warning"},x48(q.entry)," · ",q.why)}function wVY(q){return XO.createElement(T,{key:`${x48(q.entry)}:${q.why}`,color:"warning"},x48(q.entry)," · ",q.why)}function jVY(q){return!q.dev}function HVY(){let q=wJ();if(q.length===0)return{channels:q,disabled:!1,noAuth:!1,policyBlocked:!1,list:"",unmatched:[]};
|
||
|
||
return SK.createElement(u,{key:_.path,flexDirection:"row"},SK.createElement(T,{color:"warning"},o6.warning),SK.createElement(T,{color:"warning"},"Large ",SK.createElement(T,{bold:!0},z)," will impact performance (",pK(_.content.length)," chars >"," ",pK(mU),")",SK.createElement(T,{dimColor:!0}," · /memory to edit")))}))}},LVY={id:"claude-ai-external-token",type:"warning",isActive:()=>{let q=kS();return i7()&&(q.source==="ANTHROPIC_AUTH_TOKEN"||q.source==="apiKeyHelper")},render:()=>{let q=kS();return SK.createElement(u,{flexDirection:"row",marginTop:1},SK.createElement(T,{color:"warning"},o6.warning),SK.createElement(T,{color:"warning"},"Auth conflict: Using ",q.source," instead of Claude account subscription token. Either unset ",q.source,", or run `claude /logout`."))}},hVY={id:"api-key-conflict",type:"warning",isActive:()=>{let{source:q}=XA({skipRetrievingKeyFromApiKeyHelper:!0});return!!Kv6()&&(q==="ANTHROPIC_API_KEY"||q==="apiKeyHelper")},render:()=>{let{source:q}=XA({skipRetrievingKeyFromApiKeyHelper:!0});return SK.createElement(u,{flexDirection:"row",marginTop:1},SK.createElement(T,{color:"warning"},o6.warning),SK.createElement(T,{color:"warning"},"Auth conflict: Using ",q," instead of Anthropic Console key. Either unset ",q,", or run `claude /logout`."))}},RVY={id:"both-auth-methods",type:"warning",isActive:()=>{let{source:q}=XA({skipRetrievingKeyFromApiKeyHelper:!0}),K=kS();return q!=="none"&&K.source!=="none"&&!(q==="apiKeyHelper"&&K.source==="apiKeyHelper")},render:()=>{let{source:q}=XA({skipRetrievingKeyFromApiKeyHelper:!0}),K=kS();
|
||
|
||
return SK.createElement(u,{flexDirection:"column",marginTop:1},SK.createElement(u,{flexDirection:"row"},SK.createElement(T,{color:"warning"},o6.warning),SK.createElement(T,{color:"warning"},"Auth conflict: Both a token (",K.source,") and an API key (",q,") are set. This may lead to unexpected behavior.")),SK.createElement(u,{flexDirection:"column",marginLeft:3},SK.createElement(T,{color:"warning"},"· Trying to use"," ",K.source==="claude.ai"?"claude.ai":K.source,"?"," ",q==="ANTHROPIC_API_KEY"?'Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.':q==="apiKeyHelper"?"Unset the apiKeyHelper setting.":"claude /logout"),SK.createElement(T,{color:"warning"},"· Trying to use ",q,"?"," ",K.source==="claude.ai"?"claude /logout to sign out of claude.ai.":`Unset the ${K.source} environment variable.`)))}},SVY={id:"large-agent-descriptions",type:"warning",isActive:(q)=>{return tq8(q.agentDefinitions)>VJ6},render:(q)=>{let K=tq8(q.agentDefinitions);return SK.createElement(u,{flexDirection:"row"},SK.createElement(T,{color:"warning"},o6.warning),SK.createElement(T,{color:"warning"},"Large cumulative agent descriptions will impact performance (~",pK(K)," tokens >"," ",pK(VJ6),")",SK.createElement(T,{dimColor:!0}," · /agents to manage")))}},CVY={id:"jetbrains-plugin-install",type:"info",isActive:(q)=>{if(!Ty6())return!1;if(!(q.config.autoInstallIdeExtension??!0))return!1;let _=Gy6();return _!==null&&!ob4(_)},render:()=>{let q=Gy6(),K=dj(q);return SK.createElement(u,{flexDirection:"row",gap:1,marginLeft:1},SK.createElement(T,{color:"ide"},o6.arrowUp),SK.createElement(T,null,"Install the ",SK.createElement(T,{color:"ide"},K)," plugin from the JetBrains Marketplace:"," ",SK.createElement(T,{bold:!0},"https://docs.claude.com/s/claude-code-jetbrains")))}},bVY=[EVY,SVY,LVY,hVY,RVY,CVY]});function MxK(q){let K=Y6(4),{agentDefinitions:_}=q===void 0?{}:q,z=w8(),Y;if(K[0]===Symbol.for("react.memo_cache_sentinel"))Y=RH(),K[0]=Y;else Y=K[0];
|
||
|
||
function kd8(q){return typeof q==="object"&&q!==null&&"type"in q&&q.type==="local_agent"}function z_7(q){return{...q,retain:!1,messages:void 0,diskLoaded:!1,evictAfter:Lo(q.status)?Date.now()+OyY:void 0}}function Zx(q,K){d("tengu_transcript_view_enter",{}),K((_)=>{let z=_.tasks[q],Y=_.viewingAgentTaskId,$=Y!==void 0?_.tasks[Y]:void 0,O=Y!==void 0&&Y!==q&&kd8($)&&$.retain,A=kd8(z)&&(!z.retain||z.evictAfter!==void 0),w=_.viewingAgentTaskId!==q||_.viewSelectionMode!=="viewing-agent";if(!A&&!w&&!O)return _;let j=_.tasks;if(O||A){if(j={..._.tasks},O)j[Y]=z_7($);if(A)j[q]={...z,retain:!0,evictAfter:void 0}}return{..._,viewingAgentTaskId:q,viewSelectionMode:"viewing-agent",tasks:j}})}function E0(q){d("tengu_transcript_view_exit",{}),q((K)=>{let _=K.viewingAgentTaskId,z={...K,viewingAgentTaskId:void 0,viewSelectionMode:"none"};if(_===void 0)return K.viewSelectionMode==="none"?K:z;let Y=K.tasks[_];if(!kd8(Y)||!Y.retain)return z;return{...z,tasks:{...K.tasks,[_]:z_7(Y)}}})}function IIK(q,K){K((_)=>{let z=_.tasks[q];if(!kd8(z))return _;if(z.status==="running")return z.abortController?.abort(),_;if(z.evictAfter===0)return _;let Y=_.viewingAgentTaskId===q;return{..._,tasks:{..._.tasks,[q]:{...z_7(z),evictAfter:0}},...Y&&{viewingAgentTaskId:void 0,viewSelectionMode:"none"}}})}var OyY=30000;var T36=L(()=>{k8();tN()});var uIK={};v8(uIK,{REMOTE_CONTROL_DISCONNECTED_MSG:()=>F48,DEFAULT_SESSION_TIMEOUT_MS:()=>Y_7,BRIDGE_LOGIN_INSTRUCTION:()=>VC6,BRIDGE_LOGIN_ERROR:()=>Vd8});var Y_7=86400000,VC6="Remote Control is only available with claude.ai subscriptions. Please use `/login` to sign in with your claude.ai account.",Vd8="Error: You must be logged in to use Remote Control.\n\nRemote Control is only available with claude.ai subscriptions. Please use `/login` to sign in with your claude.ai account.",F48="Remote Control disconnected.";class pIK{exitPlanCalls=[];results=new Map;rejectedIds=new Set;terminated=null;rescanAfterRejection=!1;everSeenPending=!1;
|
||
|
||
return X+Object.values(P.hooksConfig).reduce((W,D)=>W+(D?.reduce((f,G)=>f+G.hooks.length,0)??0),0)},0);return N(`refreshActivePlugins: ${Y.length} enabled, ${_.length} commands, ${z.allAgents.length} agents, ${M} hooks, ${j} MCP, ${H} LSP`),{enabled_count:Y.length,disabled_count:$.length,command_count:_.length,agent_count:z.allAgents.length,hook_count:M,mcp_count:j,lsp_count:H,error_count:O.length+(J?1:0),agentDefinitions:z,pluginCommands:_}}function ghY(q,K){let _=q.filter(($)=>$.source==="lsp-manager"||$.source.startsWith("plugin:")),z=new Set(K.map(LBK));return[..._.filter(($)=>!z.has(LBK($))),...K]}function LBK(q){return q.type==="generic-error"?`generic-error:${q.source}:${q.error}`:`${q.type}:${q.source}`}var $c8=L(()=>{T8();Zd();sP();_8();E8();h8();Ck();By();s78();$H6();zm8();zy6();b18();g2()});var hBK={};v8(hBK,{call:()=>FhY});function sJ6(q,K){return`${q} ${H7(q,K)}`}var FhY=async(q,K)=>{let _=await aJ6(K.setAppState),Y=`Reloaded: ${[sJ6(_.enabled_count,"plugin"),sJ6(_.command_count,"skill"),sJ6(_.agent_count,"agent"),sJ6(_.hook_count,"hook"),sJ6(_.mcp_count,"plugin MCP server"),sJ6(_.lsp_count,"plugin LSP server")].join(" · ")}`;if(_.error_count>0)Y+=`
|
||
${sJ6(_.error_count,"error")} during load. Run /doctor for details.`;return{type:"text",value:Y}};var RBK=L(()=>{T8();zz7();d8();$c8();wU()});var UhY,SBK;var CBK=L(()=>{UhY={type:"local",name:"reload-plugins",description:"Activate pending plugin changes in the current session",supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (RBK(),hBK))},SBK=UhY});var bBK={};v8(bBK,{call:()=>QhY});async function QhY(q,K){if(K.openMessageSelector)K.openMessageSelector();return{type:"skip"}}var dhY,xBK;var IBK=L(()=>{dhY={description:"Restore the code and/or conversation to a previous point",name:"rewind",aliases:["checkpoint"],argumentHint:"",type:"local",supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => bBK)},xBK=dhY});import{createWriteStream as chY,writeFileSync as lhY}from"fs";
|
||
|
||
if(z?.subscriptionType&&z?.rateLimitTier)Y=z.subscriptionType==="max"&&z.rateLimitTier==="default_claude_max_20x";else if(z?.accessToken){let $=await sg(z.accessToken);Y=$?.organization?.organization_type==="claude_max"&&$?.organization?.rate_limit_tier==="default_claude_max_20x"}if(Y)return setTimeout(q,0,"You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account."),null}return await p3("https://claude.ai/upgrade/max"),Gz7.createElement(CL6,{startingMessage:"Starting new login following /upgrade. Exit with Ctrl-C to use existing account.",onDone:(z)=>{K.onChangeAPIKey(),q(z?"Login successful":"Login interrupted")}})}catch(_){j6(_),setTimeout(q,0,"Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.")}return null}var Gz7;var Tz7=L(()=>{sZ6();T7();xH();h8();RI8();Gz7=w6(D6(),1)});var lSY,eJ6;var kz7=L(()=>{T7();d8();lSY={type:"local-jsx",name:"upgrade",description:"Upgrade to Max for higher rate limits and more Opus",availability:["claude-ai"],isEnabled:()=>!c6(process.env.DISABLE_UPGRADE_COMMAND)&&jK()!=="enterprise",load:()=>Promise.resolve().then(() => (Tz7(),ZFK))},eJ6=lSY});var GFK={};v8(GFK,{call:()=>iSY});function nSY(q){let K=Y6(26),{onDone:_,context:z}=q,[Y,$]=pC6.useState(null),O=gK6(),A;if(K[0]===Symbol.for("react.memo_cache_sentinel"))A=jK(),K[0]=A;else A=K[0];let w=A,j;if(K[1]===Symbol.for("react.memo_cache_sentinel"))j=xF(),K[1]=j;else j=K[1];let H=j,J=o_()?.hasExtraUsageEnabled===!0,X=w==="max"&&H==="default_claude_max_20x",P=w==="team"||w==="enterprise",W=L8("tengu_jade_anvil_4",!1),D=O.upgradePaths,f;q:{let R;if(K[2]!==O.overageDisabledReason||K[3]!==O.overageStatus||K[4]!==D){R=[];let p=D!==void 0;if(BK6.isEnabled()){let g=ag(),F=P&&!g,U;if(p)U=D.includes("overage");else{let c=O.overageDisabledReason==="out_of_credits"||O.overageDisabledReason==="org_level_disabled_until"||O.overageDisabledReason==="org_service_zero_credit_limit";
|
||
|
||
return}if(!_6){N("[voice] Failed to connect to voice_stream (no OAuth token?)"),H.current?.("Voice mode requires a Claude.ai account. Please run /login to sign in."),t.length=0,g(),C("idle");return}if(O.current!=="recording"){t.length=0,_6.close();return}})};Lz7().then(H6)}let K6=o$.useCallback((o=xCY)=>{if(!_||!l87())return;if(W.current)return;if(z&&f.current){N("[voice] Re-arming focus recording after silence timeout"),f.current=!1,W.current=!0,c(),U();return}let q6=O.current;if(q6==="processing")return;if(q6==="idle")N("[voice] handleKeyEvent: idle, starting recording session immediately"),c(),P.current=setTimeout((t,n,z6,M6,J6)=>{if(t.current=null,n.current==="recording"&&!z6.current)N("[voice] No auto-repeat seen, arming release timer via fallback"),z6.current=!0,M6.current=setTimeout((G6,H6,e)=>{if(G6.current=null,H6.current==="recording")e()},Rz7,M6,n,J6)},o,P,O,X,M,F);else if(q6==="recording"){if(X.current=!0,P.current)clearTimeout(P.current),P.current=null}if(M.current)clearTimeout(M.current);if(O.current==="recording"&&X.current)M.current=setTimeout((t,n,z6)=>{if(t.current=null,n.current==="recording")z6()},Rz7,M,O,F)},[_,z,g]);return o$.useEffect(()=>{if(!_&&O.current!=="idle")g(),C("idle");return()=>{g()}},[_,g]),{state:Y,handleKeyEvent:K6}}var o$,hz7="en",bCY,eFK,Ot=null,Rz7=200,xCY=600,ICY=2000,uCY=5000,mCY=16;var Sz7=L(()=>{AA6();rn6();k8();tFK();rB8();_8();E8();tv();h8();i1();
|
||
|
||
if(process.platform==="win32")D="Settings → Privacy → Microphone";else if(process.platform==="linux")D="your system's audio settings";else D="System Settings → Privacy & Security → Microphone";return{type:"text",value:`Microphone access is denied. To enable it, go to ${D}, then run /voice again.`}}if(P7("userSettings",{voiceEnabled:!0}).error)return{type:"text",value:"Failed to update settings. Check your settings file for syntax errors."};uX.notifyChange("userSettings"),d("tengu_voice_toggled",{enabled:!0});let j=bH("voice:pushToTalk","Chat","Space"),H=wK8(q.language),J=w8(),M=J.voiceLangHintLastLanguage!==H.code,X=M?0:J.voiceLangHintShownCount??0,P=!H.fellBackFrom&&X<BCY,W="";if(H.fellBackFrom)W=` Note: "${H.fellBackFrom}" is not a supported dictation language; using English. Change it via /config.`;else if(P)W=` Dictation language: ${H.code} (/config to change).`;if(M||P)S8((D)=>({...D,voiceLangHintShownCount:X+(P?1:0),voiceLangHintLastLanguage:H.code}));return{type:"text",value:`Voice mode enabled. Hold ${j} to record.${W}`}};var zUK=L(()=>{Sz7();Lm();k8();T7();k1();wU();i1();y56()});var YUK={};v8(YUK,{default:()=>UCY});var FCY,UCY;var $UK=L(()=>{y56();FCY={type:"local",name:"voice",description:"Toggle voice mode",availability:["claude-ai"],isEnabled:()=>N56(),get isHidden(){return!mH6()},supportsNonInteractive:!1,load:()=>Promise.resolve().then(() => (zUK(),_UK))},UCY=FCY});async function Xc8(){if(!await uA("gh"))return"not_installed";let{exitCode:K}=await Yg("gh",["auth","token"],{stdout:"ignore",stderr:"ignore",timeout:5000,reject:!1});return K===0?"authenticated":"not_authenticated"}var Cz7=L(()=>{AT();VV()});async function OUK(q){let K,_;try{({accessToken:K,orgUUID:_}=await dH())}catch{return{ok:!1,error:{kind:"not_signed_in"}}}let z=`${m7().BASE_API_URL}/v1/code/github/import-token`,Y={...eY(K),"anthropic-beta":QCY,"x-organization-uuid":_};try{let $=await O1.post(z,{token:q.reveal()},{headers:Y,timeout:15000,validateStatus:()=>!0});if($.status===200)return{ok:!0,result:$.data};
|
||
|
||
return{status:"has_gh_token",token:new bz7(_)}}function lCY(q,K){switch(q.kind){case"not_signed_in":return`Login failed. Please visit ${K} and login using the GitHub App`;case"invalid_token":return"GitHub rejected that token. Run `gh auth login` and try again.";case"server":return`Server error (${q.status}). Try again in a moment.`;case"network":return"Couldn't reach the server. Check your connection."}}function nCY({onDone:q}){let[K,_]=Wc8.useState({name:"checking"});Wc8.useEffect(()=>{d("tengu_remote_setup_started",{}),cCY().then(async(O)=>{switch(O.status){case"not_signed_in":d("tengu_remote_setup_result",{result:"not_signed_in"}),q("Not signed in to Claude. Run /login first.");return;case"gh_not_installed":case"gh_not_authenticated":{let A=`${Pc8()}/onboarding?step=alt-auth`;await p3(A),d("tengu_remote_setup_result",{result:O.status}),q(O.status==="gh_not_installed"?`GitHub CLI not found. Install it via https://cli.github.com/, then run \`gh auth login\`, or connect GitHub on the web: ${A}`:`GitHub CLI not authenticated. Run \`gh auth login\` and try again, or connect GitHub on the web: ${A}`);return}case"has_gh_token":_({name:"confirm",token:O.token})}})},[]);let z=()=>{d("tengu_remote_setup_result",{result:"cancelled"}),q()},Y=async(O)=>{_({name:"uploading"});let A=await OUK(O);if(!A.ok){d("tengu_remote_setup_result",{result:"import_failed",error_kind:A.error.kind}),q(lCY(A.error,Pc8()));return}await AUK();let w=Pc8();await p3(w),d("tengu_remote_setup_result",{result:"success"}),q(`Connected as ${A.result.github_username}. Opened ${w}`)};if(K.name==="checking")return x0.createElement(Hx,{message:"Checking login status…"});if(K.name==="uploading")return x0.createElement(Hx,{message:"Connecting GitHub to Claude…"});let $=K.token;
|
||
|
||
return["# System",...mp(q)].join(`
|
||
`)}function juY(){let q=[`Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.`,"Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.","Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is what the task actually requires—no speculative abstractions, but no half-finished implementations either. Three similar lines of code is better than a premature abstraction.",...[]],K=["/help: Get help with using Claude Code",`To give feedback, users should ${{ISSUES_EXPLAINER:"report the issue at https://github.com/anthropics/claude-code/issues",PACKAGE_URL:"@anthropic-ai/claude-code",README_URL:"https://code.claude.com/docs/en/overview",VERSION:"2.1.91",FEEDBACK_CHANNEL:"https://github.com/anthropics/claude-code/issues",BUILD_TIME:"2026-04-02T21:58:41Z"}.ISSUES_EXPLAINER}`],_=['The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change "methodName" to snake case, do not reply with just "method_name", instead find the method in the code and modify the code.',"You are highly capable and often allow users to complete ambitious tasks that would otherwise be too complex or take too long. You should defer to user judgement about whether a task is too large to attempt.",...[],"In general, do not propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications.","Do not create files unless they're absolutely necessary for achieving your goal. Generally prefer editing an existing file to creating a new one, as this prevents file bloat and builds on existing work more effectively.","Avoid giving time estimates or predictions for how long tasks will take, whether for your own work or for users planning projects. Focus on what needs to be done, not how long it might take.",`If an approach fails, diagnose why before switching tactics—read the error, check your assumptions, try a focused fix. Don't retry the identical action blindly, but don't abandon a viable approach after a single failure either. Escalate to the user with ${OO} only when you're genuinely stuck after investigation, not as a first response to friction.`,"Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it. Prioritize writing safe, secure, and correct code.",...q,"Avoid backwards-compatibility hacks like renaming unused _vars, re-exporting types, adding // removed comments for removed code, etc. If you are certain that something is unused, you can delete it completely.",...[],...[],"If the user asks for help or wants to give feedback inform them of the following:",K];
|
||
|
||
if(A._hidden=!!(Y.noHelp||Y.hidden),A._executableFile=Y.executableFile||null,O)A.arguments(O);if(this._registerCommand(A),A.parent=this,A.copyInheritedSettings(this),z)return this;return A}createCommand(q){return new W$7(q)}createHelp(){return Object.assign(new upY,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,q),this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,K){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
|
||
- specify the name in Command constructor or using .name()`);if(K=K||{},K.isDefault)this._defaultCommandName=q._name;if(K.noHelp||K.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,K){return new xpY(q,K)}argument(q,K,_,z){let Y=this.createArgument(q,K);if(typeof _==="function")Y.default(z).argParser(_);else Y.default(_);return this.addArgument(Y),this}arguments(q){return q.trim().split(/ +/).forEach((K)=>{this.argument(K)}),this}addArgument(q){let K=this.registeredArguments.slice(-1)[0];if(K&&K.variadic)throw Error(`only the last argument can be variadic '${K.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,K){if(typeof q==="boolean")return this._addImplicitHelpCommand=q,this;q=q??"help [command]";let[,_,z]=q.match(/([^ ]+) *(.*)/),Y=K??"display help for command",$=this.createCommand(_);if($.helpOption(!1),z)$.arguments(z);if(Y)$.description(Y);return this._addImplicitHelpCommand=!0,this._helpCommand=$,this}addHelpCommand(q,K){if(typeof q!=="object")return this.helpCommand(q,K),this;
|
||
|
||
return this._addImplicitHelpCommand=!0,this._helpCommand=q,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,K){let _=["preSubcommand","preAction","postAction"];if(!_.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'.
|
||
Expecting one of '${_.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(K);else this._lifeCycleHooks[q]=[K];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(K)=>{if(K.code!=="commander.executeSubCommandAsync")throw K};return this}_exit(q,K,_){if(this._exitCallback)this._exitCallback(new P$7(q,K,_));cJ.exit(q)}action(q){let K=(_)=>{let z=this.registeredArguments.length,Y=_.slice(0,z);if(this._storeOptionsAsProperties)Y[z]=this;else Y[z]=this.opts();return Y.push(this),q.apply(this,Y)};return this._actionHandler=K,this}createOption(q,K){return new gcK(q,K)}_callParseArg(q,K,_,z){try{return q.parseArg(K,_)}catch(Y){if(Y.code==="commander.invalidArgument"){let $=`${z} ${Y.message}`;this.error($,{exitCode:Y.exitCode,code:Y.code})}throw Y}}_registerOption(q){let K=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(K){let _=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${_}'
|
||
- already used by option '${K.flags}'`)}this.options.push(q)}_registerCommand(q){let K=(z)=>{return[z.name()].concat(z.aliases())},_=K(q).find((z)=>this._findCommand(z));if(_){let z=K(this._findCommand(_)).join("|"),Y=K(q).join("|");throw Error(`cannot add command '${Y}' as already have command '${z}'`)}this.commands.push(q)}addOption(q){this._registerOption(q);let K=q.name(),_=q.attributeName();if(q.negate){let Y=q.long.replace(/^--no-/,"--");
|
||
|
||
switch(K.from){case void 0:case"node":this._scriptPath=q[1],_=q.slice(2);break;case"electron":if(cJ.defaultApp)this._scriptPath=q[1],_=q.slice(2);else _=q.slice(1);break;case"user":_=q.slice(0);break;case"eval":_=q.slice(1);break;default:throw Error(`unexpected parse option { from: '${K.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",_}parse(q,K){let _=this._prepareUserArgs(q,K);return this._parseCommand([],_),this}async parseAsync(q,K){let _=this._prepareUserArgs(q,K);return await this._parseCommand([],_),this}_executeSubCommand(q,K){K=K.slice();let _=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function Y(j,H){let J=Xt.resolve(j,H);if(X$7.existsSync(J))return J;if(z.includes(Xt.extname(H)))return;let M=z.find((X)=>X$7.existsSync(`${J}${X}`));if(M)return`${J}${M}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let $=q._executableFile||`${this._name}-${q._name}`,O=this._executableDir||"";if(this._scriptPath){let j;try{j=X$7.realpathSync(this._scriptPath)}catch(H){j=this._scriptPath}O=Xt.resolve(Xt.dirname(j),O)}if(O){let j=Y(O,$);if(!j&&!q._executableFile&&this._scriptPath){let H=Xt.basename(this._scriptPath,Xt.extname(this._scriptPath));if(H!==this._name)j=Y(O,`${H}-${q._name}`)}$=j||$}_=z.includes(Xt.extname($));let A;if(cJ.platform!=="win32")if(_)K.unshift($),K=UcK(cJ.execArgv).concat(K),A=M$7.spawn(cJ.argv[0],K,{stdio:"inherit"});else A=M$7.spawn($,K,{stdio:"inherit"});else K.unshift($),K=UcK(cJ.execArgv).concat(K),A=M$7.spawn(cJ.execPath,K,{stdio:"inherit"});if(!A.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((H)=>{cJ.on(H,()=>{if(A.killed===!1&&A.exitCode===null)A.kill(H)})});let w=this._exitCallback;A.on("close",(j)=>{if(j=j??1,!w)cJ.exit(j);
|
||
|
||
else w(new P$7(j,"commander.executeSubCommandAsync","(close)"))}),A.on("error",(j)=>{if(j.code==="ENOENT"){let H=O?`searched for local subcommand relative to directory '${O}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",J=`'${$}' does not exist
|
||
- if '${q._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
||
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
||
- ${H}`;throw Error(J)}else if(j.code==="EACCES")throw Error(`'${$}' not executable`);if(!w)cJ.exit(1);else{let H=new P$7(1,"commander.executeSubCommandAsync","(error)");H.nestedError=j,w(H)}}),this.runningCommand=A}_dispatchSubcommand(q,K,_){let z=this._findCommand(q);if(!z)this.help({error:!0});let Y;return Y=this._chainOrCallSubCommandHook(Y,z,"preSubcommand"),Y=this._chainOrCall(Y,()=>{if(z._executableHandler)this._executeSubCommand(z,K.concat(_));else return z._parseCommand(K,_)}),Y}_dispatchHelpCommand(q){if(!q)this.help();let K=this._findCommand(q);if(K&&!K._executableHandler)K.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,K)=>{if(q.required&&this.args[K]==null)this.missingArgument(q.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let q=(_,z,Y)=>{let $=z;if(z!==null&&_.parseArg){let O=`error: command-argument value '${z}' is invalid for argument '${_.name()}'.`;$=this._callParseArg(_,z,Y,O)}return $};this._checkNumberOfArguments();let K=[];this.registeredArguments.forEach((_,z)=>{let Y=_.defaultValue;
|
||
|
||
if(_.variadic){if(z<this.args.length){if(Y=this.args.slice(z),_.parseArg)Y=Y.reduce(($,O)=>{return q(_,O,$)},_.defaultValue)}else if(Y===void 0)Y=[]}else if(z<this.args.length){if(Y=this.args[z],_.parseArg)Y=q(_,Y,_.defaultValue)}K[z]=Y}),this.processedArgs=K}_chainOrCall(q,K){if(q&&q.then&&typeof q.then==="function")return q.then(()=>K());return K()}_chainOrCallHooks(q,K){let _=q,z=[];if(this._getCommandAndAncestors().reverse().filter((Y)=>Y._lifeCycleHooks[K]!==void 0).forEach((Y)=>{Y._lifeCycleHooks[K].forEach(($)=>{z.push({hookedCommand:Y,callback:$})})}),K==="postAction")z.reverse();return z.forEach((Y)=>{_=this._chainOrCall(_,()=>{return Y.callback(Y.hookedCommand,this)})}),_}_chainOrCallSubCommandHook(q,K,_){let z=q;if(this._lifeCycleHooks[_]!==void 0)this._lifeCycleHooks[_].forEach((Y)=>{z=this._chainOrCall(z,()=>{return Y(this,K)})});return z}_parseCommand(q,K){let _=this.parseOptions(K);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(_.operands),K=_.unknown,this.args=q.concat(K),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),K);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(K),this._dispatchSubcommand(this._defaultCommandName,q,K);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(_.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=()=>{if(_.unknown.length>0)this.unknownOption(_.unknown[0])},Y=`command:${this.name()}`;if(this._actionHandler){z(),this._processArguments();let $;if($=this._chainOrCallHooks($,"preAction"),$=this._chainOrCall($,()=>this._actionHandler(this.processedArgs)),this.parent)$=this._chainOrCall($,()=>{this.parent.emit(Y,q,K)});return $=this._chainOrCallHooks($,"postAction"),$}if(this.parent&&this.parent.listenerCount(Y))z(),this._processArguments(),this.parent.emit(Y,q,K);
|
||
|
||
if(await Lt6(),!G$("allow_remote_control"))return cy("policy_denied","[bridge:repl] Skipping: allow_remote_control policy not allowed"),A?.("failed","disabled by your organization's policy"),null;if(!PR6()){let o=w8();if(o.bridgeOauthDeadExpiresAt!=null&&(o.bridgeOauthDeadFailCount??0)>=3&&t7()?.expiresAt===o.bridgeOauthDeadExpiresAt)return N(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${o.bridgeOauthDeadFailCount} times)`),null;await PY();let q6=t7();if(q6&&q6.expiresAt!==null&&q6.expiresAt<=Date.now()){cy("oauth_expired_unrefreshable","[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)"),A?.("failed","/login");let t=q6.expiresAt;return S8((n)=>({...n,bridgeOauthDeadExpiresAt:t,bridgeOauthDeadFailCount:n.bridgeOauthDeadExpiresAt===t?(n.bridgeOauthDeadFailCount??0)+1:1})),null}}let G=K78(),Z=`remote-control-${V_K()}`,v=!1,k=!1;if(J)Z=J,v=!0,k=!0;else{let o=N8(),q6=o?oZ(o):void 0;if(q6)Z=q6,v=!0,k=!0;else if(w&&w.length>0)for(let t=w.length-1;t>=0;t--){let n=w[t];if(n.type!=="user"||n.isMeta||n.toolUseResult||n.isCompactSummary||n.origin&&n.origin.kind!=="human"||gH6(n))continue;let z6=Hd(n.message.content);if(!z6)continue;let M6=LnK(z6);if(!M6)continue;Z=M6,v=!0;break}}let V=0,y,E=0,R=(o,q6,t)=>{v=!0,Z=o,N(`[bridge:repl] derived title from message ${t}: ${o}`),G97(q6,o,{baseUrl:G,getAccessToken:bk}).catch(()=>{})},b=(o,q6)=>{let t=++E,n=V;f36(o,AbortSignal.timeout(15000)).then((z6)=>{if(z6&&t===E&&y===q6&&!oZ(N8()))R(z6,q6,n)})},I=(o,q6)=>{if(k||oZ(N8()))return!0;if(y!==void 0&&y!==q6)V=0;if(y=q6,V++,V===1&&!v){let t=LnK(o);if(t)R(t,q6,V);b(o,q6)}else if(V===3){let t=j?.(),n=t?iQ8(e2(t)):o;b(n,q6)}return V>=3},m=fN("tengu_bridge_initial_history_cap",200,300000),p=await YD();if(!p)return cy("no_org_uuid","[bridge:repl] Skipping: no org UUID"),A?.("failed","/login"),null;if(DJ6()&&!M){let o=await OK8();if(o)return cy("version_too_old",`[bridge:repl] Skipping: ${o}`,!0),A?.("failed","run `claude update` to upgrade"),null;
|
||
|
||
K((Y)=>{if(z==="normal")return Y===null?Y:null;return{heapUsed:_,status:z}})},1e4),q}var YoK,cQY=1610612736,lQY=2684354560;var OoK=L(()=>{NN();YoK=w6(D6(),1)});function AoK(){return null}var w58;var woK=L(()=>{OoK();i6();I7();w58=w6(D6(),1)});function HoK(){return joK.useSyncExternalStore(ko6.subscribe,ko6.getState)}var joK;var JoK=L(()=>{QN8();joK=w6(D6(),1)});function XoK(q){let K=Y6(14),{tokenUsage:_,model:z}=q,Y=H8(iQY),$;if(K[0]!==Y||K[1]!==z||K[2]!==_)$=oH6(_,z,Y),K[0]=Y,K[1]=z,K[2]=_,K[3]=$;else $=K[3];let{percentLeft:O,isAboveWarningThreshold:A,isAboveErrorThreshold:w}=$,j=HoK();if(!A||j)return null;let H;if(K[4]===Symbol.for("react.memo_cache_sentinel"))H=f0(),K[4]=H;else H=K[4];let J=H,M;if(K[5]===Symbol.for("react.memo_cache_sentinel"))M=gy6("warning"),K[5]=M;else M=K[5];let X=M,P=O,W=!1,D=!1;if(W||D){let Z=Sd(z,Y),v;if(K[6]!==Z||K[7]!==_)v=Math.round((Z-_)/Z*100),K[6]=Z,K[7]=_,K[8]=v;else v=K[8];P=Math.max(0,v)}let f=W?`${100-P}% context used`:`${P}% until auto-compact`,G;if(K[10]!==f||K[11]!==w||K[12]!==O)G=VM6.createElement(u,{flexDirection:"row"},J?VM6.createElement(T,{dimColor:!0,wrap:"truncate"},X?`${f} · ${X}`:f):VM6.createElement(T,{color:w?"error":"warning",wrap:"truncate"},X?`Context low (${O}% remaining) · ${X}`:`Context low (${O}% remaining) · Run /compact to compact & continue`)),K[10]=f,K[11]=w,K[12]=O,K[13]=G;else G=K[13];return G}function iQY(q){return q.autoCompactWindow}var VM6,nQY;var PoK=L(()=>{t6();i6();l1();mb();JoK();E7();sR8();VM6=w6(D6(),1),nQY=w6(D6(),1)});function WoK(){let q=Y6(6),[K,_]=yb6.useState(0),z=yb6.useRef(null),Y=$5("app:toggleTranscript","Global","ctrl+o"),$,O;if(q[0]===Symbol.for("react.memo_cache_sentinel"))$=()=>{if(!W7.isSandboxingEnabled())return;let j=W7.getSandboxViolationStore(),H=j.getTotalCount(),J=j.subscribe(()=>{let M=j.getTotalCount(),X=M-H;if(X>0){if(_(X),H=M,z.current)clearTimeout(z.current);z.current=setTimeout(_,5000,0)}});return()=>{if(J(),z.current)clearTimeout(z.current)}},O=[],q[0]=$,q[1]=O;else $=q[0],O=q[1];
|
||
|
||
return lK.createElement(lK.Fragment,null,lK.createElement(_oK,{ideSelection:q,mcpClients:K}),_.current&&("jsx"in _.current?lK.createElement(T,{wrap:"truncate",key:_.current.key},_.current.jsx):lK.createElement(T,{color:_.current.color,dimColor:!_.current.color,wrap:"truncate"},_.current.text)),z&&!Y&&lK.createElement(u,null,lK.createElement(T,{dimColor:!0,wrap:"truncate"},"Now using extra usage")),D&&lK.createElement(u,null,lK.createElement(T,{color:"warning",wrap:"truncate"},"apiKeyHelper is taking a while"," "),lK.createElement(T,{dimColor:!0,wrap:"truncate"},"(",D,")")),($==="invalid"||$==="missing")&&lK.createElement(u,null,lK.createElement(T,{color:"error",wrap:"truncate"},c6(process.env.CLAUDE_CODE_REMOTE)?"Authentication error · Try again":"Not logged in · Run /login")),O&&lK.createElement(u,null,lK.createElement(T,{color:"warning",wrap:"truncate"},"Debug mode")),$!=="invalid"&&$!=="missing"&&A&&lK.createElement(u,null,lK.createElement(T,{dimColor:!0,wrap:"truncate"},w," tokens")),!k&&lK.createElement(XoK,{tokenUsage:w,model:j}),H&&lK.createElement(qoK,{verbose:A,onAutoUpdaterResult:P,autoUpdaterResult:J,isUpdating:M,onChangeIsUpdating:W,showSuccessMessage:!X}),Z&&v&&lK.createElement(u,null,lK.createElement(T,{color:"error",wrap:"truncate"},v)),lK.createElement(AoK,null),lK.createElement(WoK,null))}var lK,Eb6,KdY,qn8=5000;var _n8=L(()=>{t6();Z$();k8();E7();AA6();sl8();Pp();tl8();i6();X88();mb();T7();sd();d8();I7();F88();i2();a1();CZ();KoK();q3();zoK();woK();lI8();PoK();DoK();lK=w6(D6(),1),Eb6=w6(D6(),1),KdY=(SO7(),hq(foK)).VoiceIndicator});async function OdY(q,K){let _=Math.ceil(q/ZoK)*ZoK;if(yM6&&zn8>=_&&CO7===K)return yM6;if(yM6)await yM6;zn8=_,CO7=K,yM6=(async()=>{let z=[],Y=0;for await(let $ of KU8()){if(K){if(Lh($.display)!==K)continue}if(z.push($),Y++,Y>=zn8)break}return z})();
|
||
|
||
return!(Y7.terminal==="Apple_Terminal"?q.optionAsMetaKeyInstalled:q.shiftEnterKeyBindingInstalled)}},{id:"memory-command",content:async()=>"Use /memory to view and manage Claude memory",cooldownSessions:15,async isRelevant(){return w8().memoryUsageCount<=0}},{id:"theme-command",content:async()=>"Use /theme to change the color theme",cooldownSessions:20,isRelevant:async()=>!0},{id:"colorterm-truecolor",content:async()=>"Try setting environment variable COLORTERM=truecolor for richer colors",cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&$8.level<3},{id:"powershell-tool-env",content:async()=>"Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)",cooldownSessions:10,isRelevant:async()=>v1()==="windows"&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:"status-line",content:async()=>"Use /statusline to set up a custom status line that will display beneath the input box",cooldownSessions:25,isRelevant:async()=>k7().statusLine===void 0},{id:"prompt-queue",content:async()=>"Hit Enter to queue up additional messages while Claude is working.",cooldownSessions:5,async isRelevant(){return w8().promptQueueUseCount<=3}},{id:"enter-to-steer-in-relatime",content:async()=>"Send messages to Claude while it works to steer Claude in real-time",cooldownSessions:20,isRelevant:async()=>!0},{id:"todo-list",content:async()=>"Ask Claude to create a todo list when working on complex tasks to track progress and remain on track",cooldownSessions:20,isRelevant:async()=>!0},{id:"vscode-command-install",content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${Y7.terminal==="vscode"?"code":Y7.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!ss6())return!1;if(v1()!=="macos")return!1;switch(Y7.terminal){case"vscode":return!await Wx4();case"cursor":return!await Xx4();case"windsurf":return!await Px4();
|
||
|
||
return{key:"opus-pro-update",text:K?"Model updated to Opus 4.6 · Set CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP=1 to opt out":"Model updated to Opus 4.6",color:"suggestion",priority:"high",timeoutMs:K?8000:3000}}]});function z15(){Cx(PaY)}async function PaY(){if((w8().subscriptionNoticeCount??0)>=XaY)return null;let q=await DaY();if(q===null)return null;return S8(WaY),d("tengu_switch_to_subscription_notice_shown",{}),{key:"switch-to-subscription",jsx:c58.createElement(T,{color:"suggestion"},"Use your existing Claude ",q," plan with Claude Code",c58.createElement(T,{color:"text",dimColor:!0}," ","· /login to activate")),priority:"low"}}function WaY(q){return{...q,subscriptionNoticeCount:(q.subscriptionNoticeCount??0)+1}}async function DaY(){if(i7())return null;let q=await vOq();if(!q)return null;if(q.account.has_claude_max)return"Max";if(q.account.has_claude_pro)return"Pro";return null}var c58,XaY=3;var Y15=L(()=>{sZ6();T7();i6();k8();k1();nM6();c58=w6(D6(),1)});function $15(q){if(!("text"in q))return 1;let K=q.text.match(/^(\d+)/);return K?.[1]?parseInt(K[1],10):1}function faY(q,K){return O15($15(q)+1)}function O15(q){return{key:"teammate-spawn",text:q===1?"1 agent spawned":`${q} agents spawned`,priority:"low",timeoutMs:5000,fold:faY}}function ZaY(q,K){return A15($15(q)+1)}function A15(q){return{key:"teammate-shutdown",text:q===1?"1 agent shut down":`${q} agents shut down`,priority:"low",timeoutMs:5000,fold:ZaY}}function w15(){let q=H8((Y)=>Y.tasks),{addNotification:K}=JK(),_=l58.useRef(new Set),z=l58.useRef(new Set);l58.useEffect(()=>{if(_5())return;for(let[Y,$]of Object.entries(q)){if(!gH($))continue;if($.status==="running"&&!_.current.has(Y))_.current.add(Y),K(O15(1));if($.status==="completed"&&!z.current.has(Y))z.current.add(Y),K(A15(1))}},[q,K])}var l58;var j15=L(()=>{T8();Z$();E7();l58=w6(D6(),1)});function X15(){let q=Y6(13),{addNotification:K}=JK(),_=H8(kaY),z=c7(),Y,$;if(q[0]!==K||q[1]!==_||q[2]!==z)Y=()=>{if(_5())return;if(!gK())return;
|
||
|
||
yq({key:"idle-return-hint",jsx:XK==="hint_v2"?y8.createElement(y8.Fragment,null,y8.createElement(T,{dimColor:!0},"new task? "),y8.createElement(T,{color:"suggestion"},"/clear"),y8.createElement(T,{dimColor:!0}," to save "),y8.createElement(T,{color:"suggestion"},l5," tokens")):y8.createElement(T,{color:"warning"},"new task? /clear to save ",l5," tokens"),priority:"medium",timeoutMs:2147483647}),fK.current=XK,d("tengu_idle_return_action",{action:"hint_shown",variant:XK,idleMinutes:Math.round($J),messageCount:p4.current.length,totalInputTokens:NO})},Math.max(0,y7),IW,S6,n7,j8,Oz);return()=>{clearTimeout(bq),q8("idle-return-hint"),Oz.current=!1}},[IW,AK,S6,q8]);let oc=z1.useCallback((j8,x8)=>{if(S5.isActive)return!1;if(nf4().some((y7)=>y7.mode==="prompt"||y7.mode==="bash"))return!1;let F8=A3();E_(F8);let f7=n8({content:j8,isMeta:x8?.isMeta?!0:void 0});return lx([f7],F8,!0,[],W6),!0},[lx,W6,x6]),qV=LsY({setInputValueRaw:t3,inputValueRef:F_,insertTextRef:Hw});z65({enabled:oq(),isLoading:AK,focusedInputDialog:U_,onSubmitMessage:oc}),meK({isLoading:AK,onSubmitMessage:oc});{let j8=x6.getState().kairosEnabled;IsY({isLoading:AK,assistantMode:j8,setMessages:A4})}z1.useEffect(()=>{if(n.some((j8)=>j8.priority==="now"))GO.current?.abort("interrupt")},[n]),z1.useEffect(()=>{return Q_(),()=>{Qa.shutdown()}},[]);let{internal_eventEmitter:dt}=uu(),[Hx6,T38]=z1.useState(0);z1.useEffect(()=>{let j8=()=>{process.stdout.write(`
|
||
Claude Code has been suspended. Run \`fg\` to bring Claude Code back.
|
||
Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input.
|
||
`)},x8=()=>{T38((F8)=>F8+1)};return dt?.on("suspend",j8),dt?.on("resume",x8),()=>{dt?.off("suspend",j8),dt?.off("resume",x8)}},[dt]);let GB=z1.useMemo(()=>{if(!AK)return null;let j8=K5.filter((p4)=>p4.type==="progress"&&p4.data.type==="hook_progress"&&(p4.data.hookEvent==="Stop"||p4.data.hookEvent==="SubagentStop"));if(j8.length===0)return null;let x8=j8.at(-1)?.toolUseID;if(!x8)return null;
|
||
|
||
rc.current("/compact",{setCursorOffset:()=>{},clearBuffer:()=>{},resetHistory:()=>{}},void 0,{modelOverride:F8()})}}}),U_==="ide-onboarding"&&y8.createElement(vU1,{onDone:()=>N7(!1),installationStatus:_7}),!1,!1,U_==="effort-callout"&&y8.createElement(G65,{model:W6,onDone:(j8)=>{if(O7(!1),j8!=="dismiss")O6((x8)=>({...x8,effortValue:j8}))}}),U_==="remote-callout"&&y8.createElement(QFK,{onDone:(j8)=>{O6((x8)=>{if(!x8.showRemoteCallout)return x8;return{...x8,showRemoteCallout:!1,...j8==="enable"&&{replBridgeEnabled:!0,replBridgeExplicit:!0,replBridgeOutboundOnly:!1}}})}}),H38,U_==="plugin-hint"&&C3&&y8.createElement(b85,{pluginName:C3.pluginName,pluginDescription:C3.pluginDescription,marketplaceName:C3.marketplaceName,sourceCommand:C3.sourceCommand,onResponse:P9}),U_==="lsp-recommendation"&&N5&&y8.createElement(h85,{pluginName:N5.pluginName,pluginDescription:N5.pluginDescription,fileExtension:N5.fileExtension,onResponse:gz}),U_==="desktop-upsell"&&y8.createElement(o65,{onDone:()=>S3(!1)}),U_==="ultraplan-choice"&&l&&y8.createElement(X65,{plan:l.plan,sessionId:l.sessionId,taskId:l.taskId,setMessages:A4,readFileState:_R.current,memorySelector:cx.current,getAppState:()=>x6.getState(),setConversationId:vP}),U_==="ultraplan-launch"&&i&&y8.createElement(W65,{onChoice:(j8,x8)=>{let F8=i.blurb;if(O6((yq)=>yq.ultraplanLaunchPending?{...yq,ultraplanLaunchPending:void 0}:yq),j8==="cancel"){if(F8)D9(F8);return}A4((yq)=>[...yq,Qb(cL6("ultraplan",F8))]);let f7=(yq)=>Qb(`<${iW}>${UZ(yq)}</${iW}>`),y7,bq=(yq)=>{let p4=f7(yq);A4((XK)=>{let fK=y7?XK.findIndex((l5)=>l5.uuid===y7):-1;if(fK===-1)return[...XK,p4];let NO=[...XK];return NO[fK]=p4,NO})},L7=(yq)=>{if(!S5.isActive){bq(yq);return}let p4=S5.subscribe(()=>{if(S5.isActive)return;if(p4(),!x6.getState().ultraplanSessionUrl)return;bq(yq)})};d48({blurb:F8,promptIdentifier:x8?.promptIdentifier,getAppState:()=>x6.getState(),setAppState:O6,signal:A3().signal,disconnectedBridge:x8?.disconnectedBridge,onSessionReady:L7}).then((yq)=>{let p4=f7(yq);
|
||
|
||
stY={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:[{context:"Chat",bindings:{"ctrl+e":"chat:externalEditor"}}]},ttY={context:"Chat",bindings:{"ctrl+s":null}},etY={context:"Chat",bindings:{"ctrl+g":null,"ctrl+e":"chat:externalEditor"}},qeY={context:"Global",bindings:{"ctrl+k ctrl+t":"app:toggleTodos"}},KeY=["# Keybindings Skill","","Create or modify `~/.claude/keybindings.json` to customize keyboard shortcuts.","","## CRITICAL: Read Before Write","","**Always read `~/.claude/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings — never replace the entire file.","","- Use **Edit** tool for modifications to existing files","- Use **Write** tool only if the file does not exist yet"].join(`
|
||
`),_eY=["## File Format","","```json",g6(stY,null,2),"```","","Always include the `$schema` and `$docs` fields."].join(`
|
||
`),zeY=["## Keystroke Syntax","","**Modifiers** (combine with `+`):","- `ctrl` (alias: `control`)","- `alt` (aliases: `opt`, `option`) — note: `alt` and `meta` are identical in terminals","- `shift`","- `meta` (aliases: `cmd`, `command`)","","**Special keys**: `escape`/`esc`, `enter`/`return`, `tab`, `space`, `backspace`, `delete`, `up`, `down`, `left`, `right`","","**Chords**: Space-separated keystrokes, e.g. `ctrl+k ctrl+s` (1-second timeout between keystrokes)","","**Examples**: `ctrl+shift+p`, `alt+enter`, `ctrl+k ctrl+n`"].join(`
|
||
`),YeY=["## Unbinding Default Shortcuts","","Set a key to `null` to remove its default binding:","","```json",g6(ttY,null,2),"```"].join(`
|
||
`),$eY=["## How User Bindings Interact with Defaults","","- User bindings are **additive** — they are appended after the default bindings","- To **move** a binding to a different key: unbind the old key (`null`) AND add the new binding","- A context only needs to appear in the user's file if they want to change something in that context"].join(`
|
||
`),OeY=["## Common Patterns","","### Rebind a key","To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",g6(etY,null,2),"```","","### Add a chord binding","```json",g6(qeY,null,2),"```"].join(`
|
||
`),AeY=["## Behavioral Rules","","1. Only include contexts the user wants to change (minimal overrides)","2. Validate that actions and contexts are from the known lists below","3. Warn the user proactively if they choose a key that conflicts with reserved shortcuts or common tools like tmux (`ctrl+b`) and screen (`ctrl+a`)","4. When adding a new binding for an existing action, the new binding is additive (existing default still works unless explicitly unbound)","5. To fully replace a default binding, unbind the old key AND add the new one"].join(`
|
||
`),weY=["## Validation with /doctor","",'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claude/keybindings.json`.',"","### Common Issues and Fixes","",Y27(["Issue","Cause","Fix"],[['`keybindings.json must have a "bindings" array`',"Missing wrapper object",'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',"Typo or invalid context name","Use exact context names from the Available Contexts table"],['`Duplicate key "X" in Y bindings`',"Same key defined twice in one context","Remove the duplicate;
|
||
|
||
JSON uses only the last value"],['`"X" may not work: ...`',"Key conflicts with terminal/OS reserved shortcut","Choose a different key (see Reserved Shortcuts section)"],['`Could not parse keystroke "X"`',"Invalid key syntax","Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',"Action value is not a string or null",'Actions must be strings like `"app:help"` or `null` to unbind']]),"","### Example /doctor Output","","```","Keybinding Configuration Issues","Location: ~/.claude/keybindings.json",' └ [Error] Unknown context "chat"'," → Valid contexts: Global, Chat, Autocomplete, ...",' └ [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)',"```","","**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work."].join(`
|
||
`)});function Uq5(q){let K=0,_="";while(K<q){let z=10+Math.floor(Math.random()*11),Y=0;for(let $=0;$<z&&K<q;$++){let O=Fq5[Math.floor(Math.random()*Fq5.length)];if(_+=O,K++,Y++,$===z-1||K>=q)_+=". ";else _+=" "}if(Y>0&&Math.random()<0.2&&K<q)_+=`
|
||
|
||
`}return _.trim()}function Qq5(){return}var Fq5;var dq5=L(()=>{pv();
|
||
|
||
don't FAIL the
|
||
change for verifier rot.
|
||
- **\`.claude/skills/run-*/\`** — knows how to build and launch. Use its
|
||
primitives as your handle.
|
||
- **Neither** — cold start from README/package.json/Makefile. Timebox
|
||
~15min. Stuck → BLOCKED with exactly where, plus a filled-in
|
||
\`/run-skill-generator\` prompt. Got through → mention
|
||
\`/init-verifiers\` in your report so next time is faster.
|
||
|
||
## Drive it
|
||
|
||
Smallest path that makes the changed code execute:
|
||
|
||
- Changed a flag? Run with it.
|
||
- Changed a handler? Hit that route.
|
||
- Changed error handling? Trigger the error.
|
||
- Changed an internal function? Find the CLI command / request / render
|
||
that reaches it. Run that.
|
||
|
||
**Read your plan back before running.** If every step is build /
|
||
typecheck / run test file — you've planned a CI rerun, not a
|
||
verification. Find a step that reaches the surface or report BLOCKED.
|
||
|
||
Once the claim checks out, keep going: break it (empty input, huge
|
||
input, interrupt mid-op), combine it (new thing + old thing), wander
|
||
(what's adjacent? what looked off?). The PR description is what the
|
||
author intended. Your job includes what they didn't.
|
||
|
||
**The verdict is table stakes. Your observations are the signal.**
|
||
A PASS with three sharp "hey, I noticed…" lines is worth more than a
|
||
bare PASS. You're the only reviewer who actually *ran* the thing —
|
||
anything that made you pause, work around, or go "huh" is information
|
||
the author doesn't have. Don't filter for "is this a bug." Filter for
|
||
"would I mention this if they were sitting next to me."
|
||
|
||
**End-to-end, through the real interface.** Pieces passing in
|
||
isolation doesn't mean the flow works — seams are where bugs hide.
|
||
If users click buttons, test by clicking buttons, not by curling the
|
||
API underneath.
|
||
|
||
## Capture
|
||
|
||
Stdout, response bodies, screenshots, pane dumps. Captured output is
|
||
evidence;
|
||
|
||
await fs.promises.writeFile(outputPath, fileBytes);
|
||
console.log(\`Saved: \${outputPath}\`);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
\`\`\`
|
||
|
||
### Container Reuse
|
||
|
||
\`\`\`typescript
|
||
// First request: set up environment
|
||
const response1 = await client.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
messages: [
|
||
{
|
||
role: "user",
|
||
content: "Install tabulate and create data.json with sample user data",
|
||
},
|
||
],
|
||
tools: [{ type: "code_execution_20260120", name: "code_execution" }],
|
||
});
|
||
|
||
// Reuse container
|
||
// container is nullable — set only when using server-side code execution
|
||
const containerId = response1.container!.id;
|
||
|
||
const response2 = await client.messages.create({
|
||
container: containerId,
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
messages: [
|
||
{
|
||
role: "user",
|
||
content: "Read data.json and display as a formatted table",
|
||
},
|
||
],
|
||
tools: [{ type: "code_execution_20260120", name: "code_execution" }],
|
||
});
|
||
\`\`\`
|
||
|
||
---
|
||
|
||
## Memory Tool
|
||
|
||
### Basic Usage
|
||
|
||
\`\`\`typescript
|
||
const response = await client.messages.create({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
messages: [
|
||
{
|
||
role: "user",
|
||
content: "Remember that my preferred language is TypeScript.",
|
||
},
|
||
],
|
||
tools: [{ type: "memory_20250818", name: "memory" }],
|
||
});
|
||
\`\`\`
|
||
|
||
### SDK Memory Helper
|
||
|
||
Use \`betaMemoryTool\` with a \`MemoryToolHandlers\` implementation:
|
||
|
||
\`\`\`typescript
|
||
import {
|
||
betaMemoryTool,
|
||
type MemoryToolHandlers,
|
||
} from "@anthropic-ai/sdk/helpers/beta/memory";
|
||
|
||
const handlers: MemoryToolHandlers = {
|
||
async view(command) { ... },
|
||
async create(command) { ... },
|
||
async str_replace(command) { ... },
|
||
async insert(command) { ... },
|
||
async delete(command) { ... },
|
||
async rename(command) { ... },
|
||
};
|
||
|
||
const memory = betaMemoryTool(handlers);
|
||
|
||
const runner = client.beta.messages.toolRunner({
|
||
model: "{{OPUS_ID}}",
|
||
max_tokens: 16000,
|
||
tools: [memory],
|
||
messages: [{ role: "user", content: "Remember my preferences" }],
|
||
});
|
||
|
||
if(X1){if(N(`[AdvisorTool] --advisor ${X1}`),!y26(N$))process.stderr.write($8.red(`Error: The model "${N$}" does not support the advisor tool.
|
||
`)),process.exit(1);let B7=AZ(Y5(X1));if(!By6(B7))process.stderr.write($8.red(`Error: The model "${X1}" cannot be used as an advisor.
|
||
`)),process.exit(1)}if(Pz=g46()?X1??eu4():X1,Pz)N(`[AdvisorTool] Advisor model: ${Pz}`)}if(oq()&&_6?.agentId&&_6?.agentName&&_6?.teamName&&_6?.agentType){let X1=E9.activeAgents.find((B7)=>B7.agentType===_6.agentType);if(X1){let B7;if(X1.source==="built-in")N(`[teammate] Built-in agent ${_6.agentType} - skipping custom prompt (not supported)`);else B7=X1.getSystemPrompt();if(X1.memory)d("tengu_agent_memory_loaded",{...!1,scope:X1.memory,source:"teammate"});if(B7){let O4=`
|
||
# Custom Agent Instructions
|
||
${B7}`;I6=I6?`${I6}
|
||
|
||
${O4}`:O4}}else N(`[teammate] Custom agent ${_6.agentType} not found in available agents`)}if(qr8(H),!g7()&&!GE()&&v7().defaultView==="chat"){let{isBriefEntitled:X1}=(Ed(),hq(v56));if(X1())CB(!0)}let L9,V4,jq,bA=!1;if(!N6){let X1=Kq5(!1);V4=X1.getFpsMetrics,jq=X1.stats;let{createRoot:B7}=await Promise.resolve().then(() => (i6(),zi6));L9=await B7(X1.renderOptions),d("tengu_timer",{event:"startup",durationMs:Math.round(process.uptime()*1000)}),N("[STARTUP] Running showSetupScreens()...");let O4=Date.now();if(bA=await qq5(L9,l6,D,N5,f8,L6),N(`[STARTUP] showSetupScreens() completed in ${Date.now()-O4}ms`),v6!==void 0){let{getBridgeDisabledReason:W4}=await Promise.resolve().then(() => (ip(),eK7)),rK=await W4();if(x6=rK===null,rK)process.stderr.write($8.yellow(`${rK}
|
||
--rc flag ignored.
|
||
`))}if(bA&&j?.trim().toLowerCase()==="/login")j="";if(bA)JS8(),ht6(),Ov6(),LO6(),Promise.resolve().then(() => (L26(),Vm4)).then((W4)=>{return W4.clearTrustedDeviceToken(),W4.enrollTrustedDevice()});let Hq=await ri();if(!Hq.valid)await uc(L9,Hq.message)}if(process.exitCode!==void 0){N("Graceful shutdown initiated, skipping further initialization");return}if(as1(),!N6){let{errors:X1}=Jz6(),B7=X1.filter((O4)=>!O4.mcpErrorMetadata)
|