@anthropic-ai/claude-agent-sdk 0.3.284 → 0.3.285
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bridge.mjs +98 -108
- package/browser-sdk.js +91 -98
- package/core-rf2bg9hj.mjs +33 -0
- package/core-w2yya30y.mjs +40 -0
- package/core.mjs +17 -17
- package/manifest.json +20 -20
- package/manifest.zst.json +24 -24
- package/package.json +12 -12
- package/sdk-tools.d.ts +23 -4
- package/sdk.d.ts +65 -28
- package/sdk.mjs +86 -96
- package/core-3ctbshc7.mjs +0 -40
- package/core-eg2e19h0.mjs +0 -31
package/core-3ctbshc7.mjs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
2
|
-
|
|
3
|
-
// Version: 0.3.284
|
|
4
|
-
|
|
5
|
-
// symbol-dispose-prelude: bun build --banner for every SDK bundle; the build
|
|
6
|
-
// scripts grep for this line's tag. Runs before any module body. bun lowers
|
|
7
|
-
// `using` to a helper that keys disposal on the registry symbol when the
|
|
8
|
-
// well-known one is missing, while disposable objects key on the well-known
|
|
9
|
-
// global directly; on engines without a native `Symbol.dispose` (Safari/iOS,
|
|
10
|
-
// Firefox ESR, `node:vm` contexts on Node <=22 such as Jest's `node`
|
|
11
|
-
// environment and vitest's vm pools, and Node before 18.18 / 20.4) the two
|
|
12
|
-
// disagree and every lowered `using` throws. Registering both symbols first
|
|
13
|
-
// makes the keys agree; a no-op where they are native, and a locked-down
|
|
14
|
-
// `Symbol` (SES lockdown) keeps today's behaviour instead of failing to load.
|
|
15
|
-
if (typeof Symbol.dispose !== 'symbol') {
|
|
16
|
-
try {
|
|
17
|
-
Symbol.dispose = Symbol.for('Symbol.dispose')
|
|
18
|
-
} catch {}
|
|
19
|
-
}
|
|
20
|
-
if (typeof Symbol.asyncDispose !== 'symbol') {
|
|
21
|
-
try {
|
|
22
|
-
Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
|
|
23
|
-
} catch {}
|
|
24
|
-
}
|
|
25
|
-
import{P,vt,p,f,L,h,E,T,g,de,M,pe,fe,d,Ne,Ue,ge,S,K,N,Y,me,U,he,Fe,Se,He,q,F,Te,j,z,a,i,o,re,c,_e,Ee,X,Be,ye,k,x,J,Ke,be,Z,oe,je,y,G,lt,R,n,_,v,u,ve,W,se,Q,pt,ze,we,ke,C,ee,H,Pe,De,ie,Ie,Ge,nt,ft,We,ae,Ce,m,_t,Ye,t,A,B,ot,st,Ae,yt,s,it,e,qe,Xe,Je,O,Le,V,r,le,Me,w,Ct,ne,Re,Rt,Ze,ue,Ot,Tt}from"./core-eg2e19h0.mjs";import{resolve as zG}from"path";var Bf=Object.prototype,Gf=Bf.hasOwnProperty;function jf(l,b,D){var te=l[b];if(!(Gf.call(l,b)&&L(te,D))||D===void 0&&!(b in l))X(l,b,D)}var eo=jf;function Wf(l,b,D,te){if(!g(l))return l;b=k(b,l);var ce=-1,Oe=b.length,xe=Oe-1,$e=l;while($e!=null&&++ce<Oe){var et=x(b[ce]),rt=D;if(et==="__proto__"||et==="constructor"||et==="prototype")return l;if(ce!=xe){var tt=$e[et];if(rt=te?te(tt,et,$e):void 0,rt===void 0)rt=g(tt)?tt:Y(b[ce+1])?[]:{}}eo($e,et,rt),$e=$e[et]}return l}var Ta=Wf;function $f(l,b,D){var te=-1,ce=b.length,Oe={};while(++te<ce){var xe=b[te],$e=J(l,xe);if(D($e,xe))Ta(Oe,k(xe,l),$e)}return Oe}var ur=$f;var Vf=He(Object.getPrototypeOf,Object),to=Vf;var Kf=Object.getOwnPropertySymbols,Yf=!Kf?Ue:function(l){var b=[];while(l)fe(b,ge(l)),l=to(l);return b},pr=Yf;function Xf(l){var b=[];if(l!=null)for(var D in Object(l))b.push(D);return b}var Ra=Xf;var Jf=Object.prototype,Zf=Jf.hasOwnProperty;function qf(l){if(!g(l))return Ra(l);var b=Se(l),D=[];for(var te in l)if(!(te=="constructor"&&(b||!Zf.call(l,te))))D.push(te);return D}var Da=qf;function Qf(l){return q(l)?Fe(l,!0):Da(l)}var mn=Qf;function em(l){return Ne(l,mn,pr)}var no=em;function tm(l,b){if(l==null)return{};var D=ye(no(l),function(te){return[te]});return b=Z(b),ur(l,D,function(te,ce){return b(te,ce[0])})}var fr=tm;import{join as To}from"path";import{dirname as Av}from"path";var Ls={};P(Ls,{AGENT_PROXY_AUTH_TOKEN:()=>Am,ANTHROPIC_API_KEY:()=>cm,ANTHROPIC_AUTH_TOKEN:()=>dm,ANTHROPIC_AWS_API_KEY:()=>fm,ANTHROPIC_FEDERATION_RULE_ID:()=>ag,ANTHROPIC_FOUNDRY_API_KEY:()=>mm,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>gm,ANTHROPIC_ORGANIZATION_ID:()=>cg,ANTHROPIC_PROFILE:()=>ug,ANTHROPIC_WORKSPACE_ID:()=>dg,AWS_BEARER_TOKEN_BEDROCK:()=>pm,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>Sm,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>_m,AWS_ROLE_ARN:()=>Em,AWS_WEB_IDENTITY_TOKEN_FILE:()=>hm,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>fg,CLAUDE_CODE_ACCOUNT_UUID:()=>pg,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>Rm,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>Jm,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>Xm,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>ig,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>km,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>Nm,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>Zm,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>lg,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>Lm,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>Om,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>zm,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>Hm,CLAUDE_CODE_HOST_CREDS_FILE:()=>Fm,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>Ym,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>wm,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>xm,CLAUDE_CODE_OAUTH_SCOPES:()=>vm,CLAUDE_CODE_OAUTH_TOKEN:()=>um,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>Dm,CLAUDE_CODE_ORGANIZATION_UUID:()=>mg,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>qm,CLAUDE_CODE_RATE_LIMIT_TIER:()=>Eg,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>Um,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>Mm,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>Bm,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>ng,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>og,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>sg,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>Qm,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>tg,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>rg,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>eg,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>hg,CLAUDE_CODE_USER_EMAIL:()=>gg,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>Im,CLAUDE_LOCAL_OAUTH_API_BASE:()=>$m,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>Vm,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>Km,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>Pm,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>Gm,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>ym,ENVIRONMENT_SERVICE_KEY:()=>bm,MCP_CLIENT_SECRET:()=>Cm,MCP_XAA_IDP_CLIENT_SECRET:()=>Tm,USE_LOCAL_OAUTH:()=>jm,USE_STAGING_OAUTH:()=>Wm});import{z as en}from"zod/v3";class La{resetters=[];built=[];lazy(l){let b,D=()=>{b=void 0};return this.resetters.push(D),()=>{if(b===void 0)b=l(),this.built.push(D);return b}}builtCount(){return this.built.length}releaseBuiltSince(l){for(let b of this.built.splice(l))b()}reset(){for(let l of this.resetters)l();this.built.length=0}}var nm=new La;function mt(l){return nm.lazy(l)}function om(l){let b=l?.trim();return b?b:void 0}function oo(l){return l===void 0?void 0:String(l)}var rm=mt(()=>en.preprocess(oo,en.string().optional().transform(om))),sm=mt(()=>en.preprocess(oo,en.string().optional())),im=mt(()=>en.preprocess(oo,en.string().optional().transform((l)=>o(l)))),am=mt(()=>en.preprocess(oo,en.string().optional().transform((l)=>{if(o(l))return!0;if(re(l))return!1;return}))),lm=mt(()=>Pa());function Ia(l){if(typeof l==="boolean")return l?"1":"0";return String(l)}var I={str:()=>rm(),rawStr:()=>sm(),bool:()=>im(),triBool:()=>am(),int:(l)=>l?Pa(l):lm(),enum:(l)=>en.preprocess(oo,en.string().optional().transform((b)=>b!==void 0&&l.includes(b.trim())?b.trim():void 0))};function Pa(l){return en.preprocess(oo,en.string().optional().transform((b)=>{if(b===void 0)return;if(l?.digitsOnly&&!/^[+-]?\d+$/.test(b.trim()))return;let D=Ce(b);if(!Number.isFinite(D))return;if(l?.min!==void 0&&D<l.min)return;if(l?.max!==void 0&&D>l.max)return;return D}))}var cm=I.str(),dm=I.str(),um=I.str(),pm=I.str(),fm=I.str(),mm=I.str(),gm=I.str(),hm=I.str(),Em=I.str(),_m=I.str(),Sm=I.str(),ym=I.str(),Om=I.str(),Am=I.str(),bm=I.str(),Cm=I.str(),Tm=I.str(),Rm=I.str(),Dm=I.str(),Lm=I.str(),Im=I.str(),Pm=I.str(),xm=I.str(),wm=I.str(),Nm=I.str(),vm=I.str(),km=I.str(),Mm=I.bool(),Um=I.bool(),Hm=I.int({min:1}),zm=I.str(),Fm=I.str(),Bm=I.str(),Gm=I.str(),jm=I.bool(),Wm=I.bool(),$m=I.str(),Vm=I.str(),Km=I.str(),Ym=I.int({min:0}),Xm=I.int({min:0}),Jm=I.int(),Zm=I.bool(),qm=I.int(),Qm=I.bool(),eg=I.bool(),tg=I.bool(),ng=I.bool(),og=I.bool(),rg=I.bool(),sg=I.bool(),ig=I.int({min:1,max:2147483647}),ag=I.str(),lg=I.str(),cg=I.str(),dg=I.str(),ug=I.str(),pg=I.str(),fg=I.str(),mg=I.str(),gg=I.str(),hg=I.str(),Eg=I.str();var Is={};P(Is,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>Dh,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>yh,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>Oh,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>Ah,ANT_OTEL_LOGS_EXPORTER:()=>bh,ANT_OTEL_METRICS_EXPORTER:()=>Ch,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>Rh,ANT_OTEL_TRACES_EXPORTER:()=>Th,BETA_TRACING_ENDPOINT:()=>Lh,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>kg,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>Gg,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>Fg,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>Bg,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>Og,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>yg,CLAUDE_CODE_DEBUG_REPAINTS:()=>Ag,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>bg,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>Mg,CLAUDE_CODE_FRAME_TIMING_LOG:()=>Ig,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>Pg,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>fh,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>jg,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>Ug,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>zg,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>Hg,CLAUDE_CODE_PERFETTO_TRACE:()=>Dg,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>Lg,CLAUDE_CODE_PROFILE_STARTUP:()=>Rg,CLAUDE_CODE_SESSION_LOG:()=>xg,CLAUDE_CODE_TEE_SDK_STDOUT:()=>vg,CLAUDE_CODE_TERMINAL_RECORDING:()=>Ng,CLAUDE_DEBUG:()=>_g,CLAUDE_PTY_RECORD:()=>wg,DEBUG:()=>Sg,DEBUG_CLAUDE_AGENT_SDK:()=>Cg,DEBUG_SDK:()=>Tg,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>dh,OTEL_EXPORTER_OTLP_ENDPOINT:()=>Kg,OTEL_EXPORTER_OTLP_HEADERS:()=>Yg,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>Jg,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>Zg,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>qg,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>Qg,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>eh,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>th,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>nh,OTEL_EXPORTER_OTLP_PROTOCOL:()=>Xg,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>oh,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>rh,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>sh,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>uh,OTEL_LOGS_EXPORTER:()=>$g,OTEL_LOGS_EXPORT_INTERVAL:()=>ah,OTEL_LOG_ASSISTANT_RESPONSES:()=>gh,OTEL_LOG_MANAGED_SETTINGS:()=>_h,OTEL_LOG_RAW_API_BODIES:()=>Sh,OTEL_LOG_TOOL_CONTENT:()=>hh,OTEL_LOG_TOOL_DETAILS:()=>Eh,OTEL_LOG_USER_PROMPTS:()=>mh,OTEL_METRICS_EXPORTER:()=>Wg,OTEL_METRIC_EXPORT_INTERVAL:()=>ih,OTEL_RESOURCE_ATTRIBUTES:()=>ch,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>ph,OTEL_TRACES_EXPORTER:()=>Vg,OTEL_TRACES_EXPORT_INTERVAL:()=>lh});var _g=I.bool(),Sg=I.str(),yg=I.str(),Og=I.str(),Ag=I.bool(),bg=I.str(),Cg=I.bool(),Tg=I.bool(),Rg=I.bool(),Dg=I.str(),Lg=I.int(),Ig=I.str(),Pg=I.int(),xg=I.str(),wg=I.str(),Ng=I.str(),vg=I.bool(),kg=I.bool(),Mg=I.bool(),Ug=I.int(),Hg=I.int(),zg=I.int(),Fg=I.int({min:1}),Bg=I.int({min:1}),Gg=I.bool(),jg=I.bool(),Wg=I.str(),$g=I.str(),Vg=I.str(),Kg=I.str(),Yg=I.str(),Xg=I.str(),Jg=I.str(),Zg=I.str(),qg=I.str(),Qg=I.str(),eh=I.str(),th=I.str(),nh=I.str(),oh=I.str(),rh=I.str(),sh=I.str(),ih=I.int(),ah=I.int(),lh=I.int(),ch=I.str(),dh=I.int({min:0}),uh=I.int({min:0}),ph=I.int({min:0}),fh=I.int({min:1,digitsOnly:!0}),mh=I.bool(),gh=I.triBool(),hh=I.bool(),Eh=I.bool(),_h=I.bool(),Sh=I.bool(),yh=I.str(),Oh=I.str(),Ah=I.str(),bh=I.str(),Ch=I.str(),Th=I.str(),Rh=I.str(),Dh=I.str(),Lh=I.str();import{constants as wh}from"fs";import{access as Ps,readdir as Nh,readFile as vh,readlink as kh}from"fs/promises";import{homedir as Mh}from"os";import{delimiter as Uh,join as Io,resolve as za}from"path";function xa(l){return!l.isDirectory()&&!l.isFile()&&!l.isSymbolicLink()&&!l.isFIFO()&&!l.isSocket()&&!l.isBlockDevice()&&!l.isCharacterDevice()}import{delimiter as Wj,isAbsolute as Ih}from"path";function Ph(l){let b=process.cwd();return l.filter((D)=>!we(D,b))}function wa(l){return xh(l,Bun.which(l))}function xh(l,b){if(!b||process.platform!=="win32"||Ih(l))return b;return Ph([b])[0]??null}var Na=async(l)=>wa(l),va=wa;function ka(){if(process.platform!=="linux")return!1;return s().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function Ma(){if(process.platform!=="linux")return;try{return s().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function Ua(){if(process.platform!=="linux")return!1;return s().existsSync("/.dockerenv")}function Hh(){if(s().existsSync(Io(m(),".config.json")))return Io(m(),".config.json");return zh()}function zh(){let l=`.claude${Ct()}.json`;return Io(process.env.CLAUDE_CONFIG_DIR||Mh(),l)}async function Fh(){return null}async function ro(l){try{return!!await Na(l)}catch{return!1}}async function Bh(){let l=[];if(await ro("npm"))l.push("npm");if(await ro("yarn"))l.push("yarn");if(await ro("pnpm"))l.push("pnpm");return l}async function Gh(){let l=[];if(await ro("bun"))l.push("bun");if(await ro("deno"))l.push("deno");if(await ro("node"))l.push("node");return l}var Ha=["git","node","npm","npx","yarn","pnpm","bun","deno","tsc","python","python3","py","pip","uv","poetry","ruby","gem","bundle","rake","dotnet","msbuild","nuget","cl","nmake","cmake","ninja","make","gcc","g++","clang","cargo","rustc","go","java","javac","mvn","gradle","docker"],jh=1000;async function Wh(l){try{return/appinstaller/i.test(await kh(l))}catch{return!1}}async function $h(l){if(l===""||pt(l)||ve(l))return!1;return!await st(za(l))}async function Vh(l,b){let D=O()==="windows",te=new Set(l),ce=D?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],Oe=w((process.env.PATH??"").split(Uh).map((xe)=>xe.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(Oe.map(async(xe)=>{if(!await $h(xe))return;let $e;try{$e=await Nh(xe,{withFileTypes:!0})}catch{return}let et=D&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(xe);for(let rt of $e){if(rt.isDirectory())continue;let tt=rt.name;if(D){let ct=tt.toLowerCase(),at=ct.lastIndexOf(".");if(at<=0||!ce.includes(ct.slice(at)))continue;tt=ct.slice(0,at)}if(!te.has(tt)||b.has(tt))continue;if(D){if(et&&await Wh(Io(xe,rt.name)))continue}else{let ct=Io(xe,rt.name);if((rt.isSymbolicLink()||xa(rt))&&await st(za(ct)))continue;try{await Ps(ct,wh.X_OK)}catch{continue}}b.add(tt)}}))}async function Kh(){let l=new Set;try{await v(Vh(Ha,l),jh,"build tool PATH scan timed out")}catch{}return Ha.filter((b)=>l.has(b))}function Yh(l){try{if(!l.isWslEnvironment())return!1;let b=va("npm");if(b===null)return!1;return b.startsWith("/mnt/c/")}catch(b){return!1}}function Xh(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var Fa=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function Jh(l){let b=l.toLowerCase();return b.includes("windsurf")||b.includes("devin.app")||b.includes("devin desktop")||b.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(b)}function Zh(){if(process.env.CURSOR_TRACE_ID)return"cursor";let l=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(l.includes("cursor"))return"cursor";if(Jh(l))return"windsurf";if(l.includes("antigravity"))return"antigravity";let b=process.env.__CFBundleIdentifier?.toLowerCase();if(b?.includes("vscodium"))return"codium";if(b?.includes("windsurf")||b?.includes("devin"))return"windsurf";if(b?.includes("com.google.android.studio"))return"androidstudio";if(b){for(let D of Fa)if(b.includes(D))return D}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")return"pycharm";if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM){if(/^devin([ -]desktop)?$/i.test(process.env.TERM_PROGRAM))return"windsurf";return process.env.TERM_PROGRAM}if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(ja())return"ssh-session";if(process.env.TERM){let D=process.env.TERM;if(D.includes("alacritty"))return"alacritty";if(D.includes("rxvt"))return"rxvt";if(D.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class Ba{sources;globalClaudeFile;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(l){this.sources=l}getGlobalClaudeFile(){return this.globalClaudeFile??=Hh()}seedGlobalClaudeFile(l){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=l,"seeded";return this.globalClaudeFile===l?"unchanged":"conflict"}getPackageManagers(){return this.packageManagers??=Bh()}getRuntimes(){return this.runtimes??=Gh()}getDetectedBuildTools(){return this.detectedBuildTools??=Kh()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=Yh(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=Qh(this)}async prime(){if(this.primedWslInteropExists!==void 0||process.platform!=="linux")return;let[l,b,D]=await Promise.all([Ps("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),vh("/sys/hypervisor/uuid",{encoding:"utf8"}).then((te)=>te.trim().toLowerCase(),()=>{return}),Ps("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=l,this.primedHypervisorUuid=b??"",this.primedDockerenvExists=D,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var qh=new i(()=>new Ba({wslInteropExistsSync:ka,readHypervisorUuidSync:Ma,dockerenvExistsSync:Ua}));function Do(){return qh.of(C().host)}function Ga(){return Do().detectDeploymentEnvironment()}function Qh(l){if(o(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(o(process.env.CODER)||process.env.CODER_WORKSPACE_NAME)return"coder";if(o(process.env.DEVPOD)||process.env.DEVPOD_WORKSPACE_UID)return"devpod";if(process.env.DAYTONA_WS_ID)return"daytona";if(o(process.env.GOOGLE_CLOUD_WORKSTATIONS))return"gcp-cloud-workstations";if(process.env.C9_PID||process.env.C9_USER)return"aws-cloud9";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(o(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(o(process.env.RENDER))return"render";if(o(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(o(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";if(l.hypervisorUuid().startsWith("ec2"))return"aws-ec2";if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(o(process.env.GITHUB_ACTIONS))return"github-actions";if(o(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(o(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";if(l.isDockerenvPresent())return"docker";if(Lo.platform==="darwin")return"unknown-darwin";if(Lo.platform==="linux")return"unknown-linux";if(Lo.platform==="win32")return"unknown-win32";return"unknown"}function ja(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var Lo={probeInternalNetworkAccess:Fh,isCI:o(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:Zh(),isSSH:ja,getPackageManagers(){return Do().getPackageManagers()},getRuntimes(){return Do().getRuntimes()},isRunningWithBun:ae,isWslEnvironment(){return Do().isWslEnvironment()},isNpmFromWindowsPath(){return Do().isNpmFromWindowsPath()},isConductor:Xh,detectDeploymentEnvironment:Ga};var xs={};P(xs,{CLAUDE_AX_PREPARK_MS:()=>nE,CLAUDE_AX_SCREEN_READER:()=>eE,CLAUDE_AX_STARTUP_QUIET_MS:()=>tE,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>oE,CLAUDE_CODE_ACCESSIBILITY:()=>SS,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>yS,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>sE,CLAUDE_CODE_AMBER_ASTROLABE:()=>X_,CLAUDE_CODE_ARTIFACT_ASSETS:()=>WS,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>PS,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>xS,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>NS,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>vS,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>wS,CLAUDE_CODE_ARTIFACT_DB:()=>kS,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>MS,CLAUDE_CODE_ARTIFACT_DELETE:()=>HS,CLAUDE_CODE_ARTIFACT_FRESH_READ:()=>QS,CLAUDE_CODE_ARTIFACT_HOT:()=>VS,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>$S,CLAUDE_CODE_ARTIFACT_OPENING_PREFETCH:()=>ey,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>FS,CLAUDE_CODE_ARTIFACT_PATH_PIN:()=>KS,CLAUDE_CODE_ARTIFACT_PIN:()=>BS,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>jS,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>zS,CLAUDE_CODE_ARTIFACT_QUICKSTART:()=>qS,CLAUDE_CODE_ARTIFACT_REPL:()=>US,CLAUDE_CODE_ARTIFACT_ROOM:()=>GS,CLAUDE_CODE_ARTIFACT_START_KIT:()=>ty,CLAUDE_CODE_ARTIFACT_TEXT_VARIANT:()=>XS,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>YS,CLAUDE_CODE_ARTIFACT_TYPES:()=>JS,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>ZS,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>ny,CLAUDE_CODE_ARTIFACT_VERIFY:()=>oy,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>OS,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>ry,CLAUDE_CODE_AUTO_MODE_SERVER:()=>sy,CLAUDE_CODE_BASALT_COVE:()=>pE,CLAUDE_CODE_BASH_EDIT_DIFF:()=>dE,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>LS,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>iy,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>bE,CLAUDE_CODE_BISON_CAIRN:()=>J_,CLAUDE_CODE_BREEZY_HORIZON:()=>fE,CLAUDE_CODE_BUBBLEWRAP:()=>ay,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>ly,CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECT:()=>cy,CLAUDE_CODE_CHILD_SESSION:()=>dy,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>py,CLAUDE_CODE_COLD_COMPACT:()=>fy,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>CE,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>DE,CLAUDE_CODE_COZY_TEAPOT:()=>uE,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>wE,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>PE,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>NE,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>vE,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>kE,CLAUDE_CODE_DISABLE_ARTIFACT:()=>ME,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>UE,CLAUDE_CODE_DISABLE_ATTRIBUTION_CROSS_REPO:()=>HE,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>zE,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>FE,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>BE,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>jE,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>WE,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>$E,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>VE,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>KE,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>YE,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>XE,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>JE,CLAUDE_CODE_DISABLE_CRON:()=>ZE,CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT:()=>qE,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>QE,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>e_,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>t_,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>n_,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>o_,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>r_,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>GE,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>s_,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>i_,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>a_,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>l_,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>c_,CLAUDE_CODE_DISABLE_MOUSE:()=>p_,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>f_,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>m_,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>g_,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>h_,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>E_,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>__,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>S_,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>y_,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>d_,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>O_,CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY:()=>A_,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>b_,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>C_,CLAUDE_CODE_DISABLE_REFUSAL_RETRY:()=>T_,CLAUDE_CODE_DISABLE_STARTUP_WORK_GATE:()=>I_,CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT:()=>L_,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>P_,CLAUDE_CODE_DISABLE_THINKING:()=>w_,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>N_,CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER:()=>mO,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>v_,CLAUDE_CODE_EDITOR_CODELIVERY:()=>TE,CLAUDE_CODE_ELEGANT_MEADOW:()=>AE,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>M_,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>U_,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>H_,CLAUDE_CODE_ENABLE_CFC:()=>z_,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>F_,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>B_,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>G_,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>j_,CLAUDE_CODE_ENABLE_FUNCTION_HOOKS:()=>EA,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>W_,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>$_,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>nS,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>oS,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>rS,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>sS,CLAUDE_CODE_ENABLE_TASKS:()=>iS,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>aS,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>lS,CLAUDE_CODE_ENABLE_XAA:()=>cS,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>tO,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>my,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>gy,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>V_,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>by,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>yy,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>Oy,CLAUDE_CODE_FORCE_TERMINAL_IMAGES:()=>Ay,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>Ty,CLAUDE_CODE_FORK_SUBAGENT:()=>hy,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>Ry,CLAUDE_CODE_FORWARD_USER_INTENT:()=>RE,CLAUDE_CODE_GATEWAY_HINT_HEADERS:()=>hO,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>K_,CLAUDE_CODE_GENTLE_PARASOL:()=>lE,CLAUDE_CODE_GLOB_HIDDEN:()=>Ey,CLAUDE_CODE_GLOB_NO_IGNORE:()=>_y,CLAUDE_CODE_GORSE_PLOVER:()=>q_,CLAUDE_CODE_HARBOR_KITE:()=>dS,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>pS,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>uS,CLAUDE_CODE_HIDE_CWD:()=>Sy,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>hA,CLAUDE_CODE_HOST_SCHEDULED_RUN:()=>LE,CLAUDE_CODE_HOVER_REST:()=>Y_,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>hE,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>Dy,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>Ly,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>Iy,CLAUDE_CODE_INLINE_TOOLS:()=>Cy,CLAUDE_CODE_INTRO_FRAME:()=>AS,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>tS,CLAUDE_CODE_KB_COHESION_FIXES:()=>_S,CLAUDE_CODE_LANTERN_PRISM:()=>fS,CLAUDE_CODE_LARCH_CISTERN:()=>Z_,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>u_,CLAUDE_CODE_MODEL_CAPABILITIES:()=>bS,CLAUDE_CODE_NANKEEN_KESTREL:()=>xE,CLAUDE_CODE_NATIVE_CURSOR:()=>Py,CLAUDE_CODE_NEW_INIT:()=>xy,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>Ny,CLAUDE_CODE_NO_FLICKER:()=>wy,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>vy,CLAUDE_CODE_PARCHMENT_FERN:()=>Q_,CLAUDE_CODE_PARSED_WILLOW:()=>SE,CLAUDE_CODE_PEWTER_OWL:()=>EO,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>_O,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>ky,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>dO,CLAUDE_CODE_PLUGIN_DIRS:()=>SA,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>_A,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>cO,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>pO,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>uO,CLAUDE_CODE_POLISHED_DEWDROP:()=>mE,CLAUDE_CODE_POLL_EVENTS:()=>My,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>fO,CLAUDE_CODE_PROACTIVE:()=>Uy,CLAUDE_CODE_PROJECTS_SESSION:()=>lO,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>sA,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>gO,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>R_,CLAUDE_CODE_REMOTE_TOOLS_FORWARD:()=>yA,CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGIN:()=>IE,CLAUDE_CODE_REPORT_FINDINGS:()=>D_,CLAUDE_CODE_RUSTLING_PIXEL:()=>gE,CLAUDE_CODE_SEND_FEEDBACK:()=>x_,CLAUDE_CODE_SESSION_ATTENDED:()=>uy,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>TS,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>DS,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>RS,CLAUDE_CODE_SKILL_PROPOSALS:()=>Hy,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>zy,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>Fy,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>By,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>Gy,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>jy,CLAUDE_CODE_SQUISHY_NEWT:()=>OE,CLAUDE_CODE_STELLAR_DRIFT:()=>EE,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>Wy,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>iA,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>$y,CLAUDE_CODE_SYNC_PLUGINS:()=>Ky,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>Vy,CLAUDE_CODE_SYNC_SKILLS:()=>Yy,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>Xy,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>IS,CLAUDE_CODE_THISTLE_GREBE:()=>iE,CLAUDE_CODE_THRIFTY_SONIC:()=>cE,CLAUDE_CODE_TOASTY_THIMBLE:()=>aE,CLAUDE_CODE_TODO_REMINDER_MODE:()=>mS,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>gS,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>ES,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>hS,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>Jy,CLAUDE_CODE_TURN_UPDATES:()=>CS,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>Zy,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>qy,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>Qy,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>eO,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>oO,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>rO,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>sO,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>iO,CLAUDE_CODE_WEB_FETCH_AGENT:()=>nO,CLAUDE_CODE_WEB_SEARCH_FAST_ARG:()=>aO,CLAUDE_CODE_WHIMSICAL_ELEPHANT:()=>yE,CLAUDE_CODE_WILLOW_TERN:()=>eS,CLAUDE_CODE_WISE_COMET:()=>_E,CLAUDE_CODE_WORKFLOWS:()=>k_,CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS:()=>RO,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>TO,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>bO,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>CO,CLAUDE_DISABLE_ADOPT:()=>SO,CLAUDE_IMPORT_CONVERSATIONS:()=>yO,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>OO,CLAUDE_WORKFLOW_NAME_ONLY:()=>AO,DISABLE_AUTOUPDATER:()=>LO,DISABLE_AUTO_COMPACT:()=>DO,DISABLE_BRIEF_MODE_STOP_HOOK:()=>IO,DISABLE_BUG_COMMAND:()=>PO,DISABLE_COST_WARNINGS:()=>xO,DISABLE_DOCTOR_COMMAND:()=>wO,DISABLE_ERROR_REPORTING:()=>NO,DISABLE_EXTRA_USAGE_COMMAND:()=>vO,DISABLE_FEEDBACK_COMMAND:()=>kO,DISABLE_GROWTHBOOK:()=>MO,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>UO,DISABLE_INTERLEAVED_THINKING:()=>HO,DISABLE_LOGIN_COMMAND:()=>zO,DISABLE_LOGOUT_COMMAND:()=>FO,DISABLE_PROMPT_CACHING:()=>BO,DISABLE_PROMPT_CACHING_FABLE:()=>$O,DISABLE_PROMPT_CACHING_HAIKU:()=>GO,DISABLE_PROMPT_CACHING_MYTHOS:()=>VO,DISABLE_PROMPT_CACHING_OPUS:()=>jO,DISABLE_PROMPT_CACHING_SONNET:()=>WO,DISABLE_TELEMETRY:()=>KO,DISABLE_UPDATES:()=>YO,DISABLE_UPGRADE_COMMAND:()=>XO,EMBEDDED_SEARCH_TOOLS:()=>mA,ENABLE_BETA_TRACING_DETAILED:()=>JO,ENABLE_CLAUDEAI_MCP_SERVERS:()=>ZO,ENABLE_ENHANCED_TELEMETRY_BETA:()=>qO,ENABLE_LOCKLESS_UPDATES:()=>QO,ENABLE_LSP_TOOL:()=>eA,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>tA,ENABLE_PID_BASED_VERSION_LOCKING:()=>nA,ENABLE_PROMPT_CACHING_1H:()=>oA,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>rA,ENABLE_SESSION_BACKGROUNDING:()=>aA,ENABLE_SESSION_PERSISTENCE:()=>lA,ENABLE_TOOL_SEARCH:()=>cA,FORCE_AUTOUPDATE_PLUGINS:()=>dA,FORCE_CODE_TERMINAL:()=>uA,FORCE_PROMPT_CACHING_5M:()=>pA,FORCE_VCR:()=>fA,INK_SCREEN_READER:()=>rE,USE_API_CONTEXT_MANAGEMENT:()=>gA});var so=["5m","1h"];var eE=I.triBool(),tE=I.int({min:0}),nE=I.int({min:0}),oE=I.triBool(),rE=I.bool(),sE=I.bool(),iE=I.str(),aE=I.str(),lE=I.str(),cE=I.triBool(),dE=I.triBool(),uE=I.enum(["strict","relaxed"]),pE=I.bool(),fE=I.str(),mE=I.enum(["drop","block","off"]),gE=I.str(),hE=I.triBool(),EE=I.triBool(),_E=I.triBool(),SE=I.triBool(),yE=I.triBool(),OE=I.triBool(),AE=I.triBool(),bE=I.triBool(),CE=I.bool(),TE=I.bool(),RE=I.bool(),DE=I.bool(),LE=I.bool(),IE=I.bool(),PE=I.bool(),xE=I.bool(),wE=I.bool(),NE=I.bool(),vE=I.bool(),kE=I.bool(),ME=I.bool(),UE=I.bool(),HE=I.bool(),zE=I.bool(),FE=I.bool(),BE=I.bool(),GE=I.bool(),jE=I.bool(),WE=I.bool(),$E=I.bool(),VE=I.bool(),KE=I.bool(),YE=I.bool(),XE=I.bool(),JE=I.bool(),ZE=I.bool(),qE=I.bool(),QE=I.bool(),e_=I.bool(),t_=I.bool(),n_=I.bool(),o_=I.triBool(),r_=I.bool(),s_=I.bool(),i_=I.bool(),a_=I.bool(),l_=I.bool(),c_=I.bool(),d_=I.bool(),u_=I.enum(["corroborate","immediate","never"]),p_=I.triBool(),f_=I.triBool(),m_=I.bool(),g_=I.bool(),h_=I.bool(),E_=I.bool(),__=I.bool(),S_=I.bool(),y_=I.bool(),O_=I.bool(),A_=I.bool(),b_=I.bool(),C_=I.bool(),T_=I.bool(),R_=I.triBool(),D_=I.bool(),L_=I.bool(),I_=I.bool(),P_=I.bool(),x_=I.triBool(),w_=I.bool(),N_=I.bool(),v_=I.bool(),k_=I.triBool(),M_=I.bool(),U_=I.bool(),H_=I.bool(),z_=I.triBool(),F_=I.bool(),B_=I.bool(),G_=I.bool(),j_=I.triBool(),W_=I.bool(),$_=I.bool(),V_=I.bool(),K_=I.bool(),Y_=I.triBool(),X_=I.bool(),J_=I.triBool(),Z_=I.bool(),q_=I.bool(),Q_=I.bool(),eS=I.bool(),tS=I.int({min:1,digitsOnly:!0}),nS=I.triBool(),oS=I.bool(),rS=I.triBool(),sS=I.bool(),iS=I.triBool(),aS=I.bool(),lS=I.bool(),cS=I.bool(),dS=I.str(),uS=I.bool(),pS=I.bool(),fS=I.bool(),mS=I.enum(["baseline","off"]),gS=I.str(),hS=I.int(),ES=I.triBool(),_S=I.bool(),SS=I.bool(),yS=I.triBool(),OS=I.triBool(),AS=I.triBool(),bS=I.str(),CS=I.triBool(),TS=I.triBool(),RS=I.int({min:1}),DS=I.str(),LS=I.triBool(),IS=I.triBool(),PS=I.triBool(),xS=I.triBool(),wS=I.triBool(),NS=I.triBool(),vS=I.triBool(),kS=I.triBool(),MS=I.triBool(),US=I.triBool(),HS=I.triBool(),zS=I.triBool(),FS=I.triBool(),BS=I.triBool(),GS=I.triBool(),jS=I.triBool(),WS=I.triBool(),$S=I.triBool(),VS=I.triBool(),KS=I.triBool(),YS=I.triBool(),XS=I.enum(["v0","v1","v2"]),JS=I.triBool(),ZS=I.triBool(),qS=I.triBool(),QS=I.triBool(),ey=I.triBool(),ty=I.triBool(),ny=I.triBool(),oy=I.triBool(),ry=I.triBool(),sy=I.str(),iy=I.bool(),ay=I.bool(),ly=I.bool(),cy=I.bool(),dy=I.bool(),uy=I.triBool(),py=I.bool(),fy=I.bool(),my=I.bool(),gy=I.bool(),hy=I.triBool(),Ey=I.bool(),_y=I.bool(),Sy=I.bool(),yy=I.bool(),Oy=I.bool(),Ay=I.bool(),by=I.bool(),Cy=I.triBool(),Ty=I.str(),Ry=I.bool(),Dy=I.bool(),Ly=I.bool(),Iy=I.bool(),Py=I.bool(),xy=I.bool(),wy=I.triBool(),Ny=I.triBool(),vy=I.bool(),ky=I.bool(),My=I.bool(),Uy=I.bool(),Hy=I.bool(),zy=I.bool(),Fy=I.str(),By=I.bool(),Gy=I.bool(),jy=I.bool(),Wy=I.bool(),$y=I.bool(),Vy=I.bool(),Ky=I.bool(),Yy=I.bool(),Xy=I.bool(),Jy=I.triBool(),Zy=I.bool(),qy=I.bool(),Qy=I.bool(),eO=I.triBool(),tO=I.bool(),nO=I.triBool(),oO=I.int({min:1,digitsOnly:!0}),rO=I.int({min:0,digitsOnly:!0}),sO=I.bool(),iO=I.bool(),aO=I.triBool(),lO=I.bool(),cO=I.bool(),dO=I.bool(),uO=I.bool(),pO=I.bool(),fO=I.bool(),mO=I.bool(),gO=I.bool(),hO=I.triBool(),EO=I.triBool(),_O=I.triBool(),SO=I.bool(),yO=I.bool(),OO=I.bool(),AO=I.bool(),bO=I.int({min:1}),CO=I.int({min:1}),TO=I.int({min:0}),RO=I.int({min:1,max:256,digitsOnly:!0}),DO=I.bool(),LO=I.bool(),IO=I.bool(),PO=I.bool(),xO=I.bool(),wO=I.bool(),NO=I.bool(),vO=I.bool(),kO=I.bool(),MO=I.bool(),UO=I.bool(),HO=I.bool(),zO=I.bool(),FO=I.bool(),BO=I.bool(),GO=I.bool(),jO=I.bool(),WO=I.bool(),$O=I.bool(),VO=I.bool(),KO=I.bool(),YO=I.bool(),XO=I.bool(),JO=I.bool(),ZO=I.triBool(),qO=I.bool(),QO=I.bool(),eA=I.bool(),tA=I.triBool(),nA=I.triBool(),oA=I.bool(),rA=I.bool(),sA=I.enum(so),iA=I.enum(so),aA=I.bool(),lA=I.bool(),cA=I.str(),dA=I.bool(),uA=I.bool(),pA=I.bool(),fA=I.bool(),mA=I.bool(),gA=I.bool(),hA=I.bool(),EA=I.triBool(),_A=I.triBool(),SA=I.str(),yA=I.bool();var ws={};P(ws,{ALACRITTY_LOG:()=>sC,ALLUSERSPROFILE:()=>lb,ANDROID_HOME:()=>Ub,ANDROID_SDK_ROOT:()=>Hb,APPDATA:()=>qA,APP_URL:()=>vT,AWS_CA_BUNDLE:()=>Cb,AWS_EXECUTION_ENV:()=>AT,AWS_LAMBDA_FUNCTION_NAME:()=>OT,AZURE_FUNCTIONS_ENVIRONMENT:()=>NT,BAT_THEME:()=>zT,BROWSER:()=>zA,BUILDKITE:()=>nT,BUN_CHROME_PATH:()=>HT,BUN_INSTALL:()=>UT,CARGO_HTTP_CAINFO:()=>Rb,CDPATH:()=>bA,CF_PAGES:()=>ST,CIRCLECI:()=>tT,CLOUDSDK_CONFIG:()=>PT,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>Ab,CODER:()=>aT,CODER_WORKSPACE_NAME:()=>lT,CODESPACES:()=>iT,COLORFGBG:()=>Gb,COLORTERM:()=>Bb,COMSPEC:()=>PA,CONTAINER_SANDBOX_MOUNT_POINT:()=>JA,CURL_CA_BUNDLE:()=>Ob,CURSOR_TRACE_ID:()=>bC,ComSpec:()=>wA,ConEmuANSI:()=>hC,ConEmuPID:()=>EC,ConEmuTask:()=>_C,DAYTONA_WS_ID:()=>uT,DEMO_VERSION:()=>$T,DENO_CERT:()=>Tb,DENO_DEPLOYMENT_ID:()=>yT,DISPLAY:()=>FA,DO_NOT_TRACK:()=>jb,DYNO:()=>_T,EDITOR:()=>UA,FORCE_COLOR:()=>Fb,GCLOUD_PROJECT:()=>TT,GCM_INTERACTIVE:()=>xC,GH_CONFIG_DIR:()=>vC,GH_ENTERPRISE_TOKEN:()=>zC,GH_HOST:()=>HC,GH_TOKEN:()=>UC,GITHUB_ACTIONS:()=>WC,GITHUB_ACTION_INPUTS:()=>$C,GITHUB_ACTION_PATH:()=>VC,GITHUB_ACTOR:()=>KC,GITHUB_ACTOR_ID:()=>YC,GITHUB_ENTERPRISE_TOKEN:()=>BC,GITHUB_ENV:()=>GC,GITHUB_EVENT_NAME:()=>XC,GITHUB_EVENT_PATH:()=>JC,GITHUB_REPOSITORY:()=>ZC,GITHUB_REPOSITORY_ID:()=>qC,GITHUB_REPOSITORY_OWNER:()=>QC,GITHUB_REPOSITORY_OWNER_ID:()=>eT,GITHUB_TOKEN:()=>FC,GITHUB_WORKSPACE:()=>jC,GITLAB_CI:()=>oT,GITPOD_WORKSPACE_ID:()=>cT,GIT_ASKPASS:()=>PC,GIT_CONFIG_COUNT:()=>wC,GIT_CONFIG_GLOBAL:()=>NC,GIT_CONFIG_NOSYSTEM:()=>wb,GIT_SSH_COMMAND:()=>LC,GIT_SSL_CAINFO:()=>xb,GIT_SSL_CAPATH:()=>Nb,GIT_TERMINAL_PROMPT:()=>IC,GNOME_TERMINAL_SERVICE:()=>oC,GOOGLE_APPLICATION_CREDENTIALS:()=>RT,GOOGLE_CLOUD_PROJECT:()=>CT,GOOGLE_CLOUD_WORKSTATIONS:()=>dT,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>Lb,HEX_CACERTS_PATH:()=>Pb,HISTFILE:()=>gb,HOME:()=>OA,HOMEDRIVE:()=>ob,HOMEPATH:()=>rb,HOMESHARE:()=>sb,HTTPLIB2_CA_CERTS:()=>bb,HUB_CONFIG:()=>kC,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>SC,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>yC,IS_DEMO:()=>WT,IS_SANDBOX:()=>jT,ITERM_SESSION_ID:()=>Qb,JAVA_HOME:()=>kb,JAVA_TOOL_OPTIONS:()=>Mb,KITTY_WINDOW_ID:()=>eC,KONSOLE_VERSION:()=>tC,KUBERNETES_SERVICE_HOST:()=>MT,K_SERVICE:()=>bT,LANG:()=>GA,LC_ALL:()=>jA,LC_TERMINAL:()=>Kb,LC_TIME:()=>WA,LOCALAPPDATA:()=>QA,MSYSTEM:()=>gC,NETLIFY:()=>ET,NIX_SSL_CERT_FILE:()=>Ib,NODE_EXTRA_CA_CERTS:()=>Eb,NODE_OPTIONS:()=>hb,NO_COLOR:()=>zb,NoDefaultCurrentDirectoryInExePath:()=>MA,OneDrive:()=>eb,OneDriveCommercial:()=>nb,OneDriveConsumer:()=>tb,P4PORT:()=>FT,PATH:()=>AA,PATHEXT:()=>kA,PIP_CERT:()=>Db,PLAYWRIGHT_BROWSERS_PATH:()=>BT,PREFIX:()=>TA,PROGRAMDATA:()=>ab,PROJECT_DOMAIN:()=>mT,PWD:()=>CA,ProgramData:()=>ib,ProgramFiles:()=>vA,RENDER:()=>hT,REPL_ID:()=>pT,REPL_SLUG:()=>fT,REQUESTS_CA_BUNDLE:()=>yb,RUNNER_ENVIRONMENT:()=>sT,RUNNER_OS:()=>rT,SAFEUSER:()=>cb,SESSIONNAME:()=>aC,SHELL:()=>IA,SPACE_CREATOR_USER_ID:()=>kT,SSH_AUTH_SOCK:()=>DC,SSH_CLIENT:()=>CC,SSH_CONNECTION:()=>TC,SSH_TTY:()=>RC,SSL_CERT_DIR:()=>Sb,SSL_CERT_FILE:()=>_b,STY:()=>lC,SUDO_GID:()=>KA,SUDO_UID:()=>VA,SUDO_USER:()=>YA,SYSTEMROOT:()=>xA,SystemRoot:()=>NA,TEMP:()=>LA,TERM:()=>Wb,TERMINAL:()=>Yb,TERMINAL_EMULATOR:()=>Xb,TERMINATOR_UUID:()=>Jb,TERMUX_VERSION:()=>Zb,TERM_PROGRAM:()=>$b,TERM_PROGRAM_VERSION:()=>Vb,TILIX_ID:()=>qb,TMP:()=>DA,TMPDIR:()=>RA,TMUX:()=>cC,TMUX_PANE:()=>dC,TRACEPARENT:()=>VT,TRACESTATE:()=>KT,USER:()=>$A,USERNAME:()=>XA,USERPROFILE:()=>ZA,USE_BUILTIN_RIPGREP:()=>GT,UV_THREADPOOL_SIZE:()=>vb,VERCEL:()=>gT,VISUAL:()=>HA,VSCODE_GIT_ASKPASS_MAIN:()=>AC,VTE_VERSION:()=>rC,WAYLAND_DISPLAY:()=>BA,WEBSITE_SITE_NAME:()=>xT,WEBSITE_SKU:()=>wT,WSL_DISTRO_NAME:()=>fC,WSL_INTEROP:()=>mC,WT_SESSION:()=>iC,XDG_CACHE_HOME:()=>fb,XDG_CONFIG_HOME:()=>ub,XDG_DATA_HOME:()=>pb,XDG_RUNTIME_DIR:()=>db,XDG_STATE_HOME:()=>mb,XTERM_VERSION:()=>nC,ZDOTDIR:()=>MC,ZED_TERM:()=>pC,ZELLIJ:()=>uC,__CFBundleIdentifier:()=>OC,gcloud_project:()=>DT,google_application_credentials:()=>IT,google_cloud_project:()=>LT});var OA=I.str(),AA=I.str(),bA=I.str(),CA=I.str(),TA=I.str(),RA=I.str(),DA=I.str(),LA=I.str(),IA=I.str(),PA=I.str(),xA=I.str(),wA=I.str(),NA=I.str(),vA=I.str(),kA=I.str(),MA=I.str(),UA=I.str(),HA=I.str(),zA=I.str(),FA=I.str(),BA=I.str(),GA=I.str(),jA=I.str(),WA=I.str(),$A=I.str(),VA=I.int({min:0,digitsOnly:!0}),KA=I.int({min:0,digitsOnly:!0}),YA=I.str(),XA=I.str(),JA=I.str(),ZA=I.str(),qA=I.str(),QA=I.str(),eb=I.str(),tb=I.str(),nb=I.str(),ob=I.str(),rb=I.str(),sb=I.str(),ib=I.str(),ab=I.str(),lb=I.str(),cb=I.str(),db=I.str(),ub=I.str(),pb=I.str(),fb=I.str(),mb=I.str(),gb=I.str(),hb=I.str(),Eb=I.str(),_b=I.str(),Sb=I.str(),yb=I.str(),Ob=I.str(),Ab=I.str(),bb=I.str(),Cb=I.str(),Tb=I.str(),Rb=I.str(),Db=I.str(),Lb=I.str(),Ib=I.str(),Pb=I.str(),xb=I.str(),wb=I.str(),Nb=I.str(),vb=I.str(),kb=I.str(),Mb=I.str(),Ub=I.str(),Hb=I.str(),zb=I.rawStr(),Fb=I.rawStr(),Bb=I.str(),Gb=I.str(),jb=I.str(),Wb=I.str(),$b=I.str(),Vb=I.str(),Kb=I.str(),Yb=I.str(),Xb=I.str(),Jb=I.str(),Zb=I.str(),qb=I.str(),Qb=I.str(),eC=I.str(),tC=I.str(),nC=I.str(),oC=I.str(),rC=I.str(),sC=I.str(),iC=I.str(),aC=I.str(),lC=I.str(),cC=I.str(),dC=I.str(),uC=I.str(),pC=I.str(),fC=I.str(),mC=I.str(),gC=I.str(),hC=I.str(),EC=I.str(),_C=I.str(),SC=I.str(),yC=I.str(),OC=I.str(),AC=I.str(),bC=I.rawStr(),CC=I.str(),TC=I.str(),RC=I.str(),DC=I.str(),LC=I.str(),IC=I.str(),PC=I.str(),xC=I.str(),wC=I.str(),NC=I.str(),vC=I.str(),kC=I.str(),MC=I.str(),UC=I.str(),HC=I.str(),zC=I.str(),FC=I.str(),BC=I.str(),GC=I.str(),jC=I.str(),WC=I.str(),$C=I.rawStr(),VC=I.str(),KC=I.str(),YC=I.str(),XC=I.str(),JC=I.str(),ZC=I.str(),qC=I.str(),QC=I.str(),eT=I.str(),tT=I.str(),nT=I.str(),oT=I.str(),rT=I.str(),sT=I.str(),iT=I.str(),aT=I.str(),lT=I.str(),cT=I.str(),dT=I.str(),uT=I.str(),pT=I.str(),fT=I.str(),mT=I.str(),gT=I.str(),hT=I.str(),ET=I.str(),_T=I.str(),ST=I.str(),yT=I.str(),OT=I.str(),AT=I.str(),bT=I.str(),CT=I.str(),TT=I.str(),RT=I.str(),DT=I.str(),LT=I.str(),IT=I.str(),PT=I.str(),xT=I.str(),wT=I.str(),NT=I.str(),vT=I.str(),kT=I.str(),MT=I.str(),UT=I.str(),HT=I.str(),zT=I.str(),FT=I.str(),BT=I.str(),GT=I.str(),jT=I.str(),WT=I.str(),$T=I.str(),VT=I.str(),KT=I.str();var Ns={};P(Ns,{AI_AGENT:()=>eI,ALLOW_ANT_COMPUTER_USE_MCP:()=>tI,ANTHROPIC_CONFIG_DIR:()=>YT,BASH_MAX_OUTPUT_LENGTH:()=>DP,CCR_SESSION_PROFILE:()=>nI,CLAUBBIT:()=>oI,CLAUDECODE:()=>rI,CLAUDE_AFK_COUNTDOWN_MS:()=>LP,CLAUDE_AFK_TIMEOUT_MS:()=>IP,CLAUDE_AFTER_LAST_COMPACT:()=>XT,CLAUDE_AGENTS_SELECT:()=>JT,CLAUDE_AGENT_SDK_CLIENT_APP:()=>ZT,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>sI,CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS:()=>iI,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>aI,CLAUDE_AGENT_SDK_VERSION:()=>qT,CLAUDE_ARTIFACT_HOST_GRANT:()=>QT,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>PP,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>eR,CLAUDE_AUTO_BACKGROUND_TASKS:()=>lI,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>cI,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>tR,CLAUDE_BG_BACKEND:()=>nR,CLAUDE_BG_CLAIM_AUTH:()=>oR,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>rR,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>sR,CLAUDE_BG_ISOLATION:()=>iR,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>aR,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>lR,CLAUDE_BG_PTY_AUTH:()=>cR,CLAUDE_BG_RENDEZVOUS_SOCK:()=>dR,CLAUDE_BG_RV_AUTH:()=>uR,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>pR,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>fR,CLAUDE_BG_SOURCE:()=>mR,CLAUDE_BG_STARTUP_WEDGE_MS:()=>xP,CLAUDE_BG_TCC_DISCLAIMED:()=>gR,CLAUDE_BG_WORKSPACE_TRUSTED:()=>hR,CLAUDE_BRIDGE_BASE_URL:()=>ER,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>_R,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>SR,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>dI,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>uI,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>yR,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>OR,CLAUDE_BRIDGE_REATTACH_SEQ:()=>wP,CLAUDE_BRIDGE_REATTACH_SESSION:()=>AR,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>bR,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>CR,CLAUDE_CHROME_PERMISSION_MODE:()=>TR,CLAUDE_CLIENT_PRESENCE_FILE:()=>RR,CLAUDE_CODE_ACTION:()=>DR,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>LR,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>pI,CLAUDE_CODE_ADOPT_UNDERIVABLE_PARKED_PERMISSION:()=>oP,CLAUDE_CODE_AGENT:()=>IR,CLAUDE_CODE_APPEND_PROMPT_HEAD:()=>PR,CLAUDE_CODE_ARTIFACT:()=>xR,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>NR,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>vR,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>kR,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>wR,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>MR,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>UR,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>HR,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>zR,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>BR,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>fI,CLAUDE_CODE_BASE_REF:()=>GR,CLAUDE_CODE_BASE_REFS:()=>jR,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>WR,CLAUDE_CODE_BRIDGE_CHILD_ARTIFACT:()=>hD,CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULT:()=>gD,CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS:()=>ED,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>$R,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>VR,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>KR,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>YR,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>XR,CLAUDE_CODE_BRIEF:()=>mI,CLAUDE_CODE_BRIEF_UPLOAD:()=>gI,CLAUDE_CODE_CCR_SURFACE:()=>QI,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>JR,CLAUDE_CODE_CONTAINER_ID:()=>ZR,CLAUDE_CODE_COORDINATOR_SKILL_GUIDANCE:()=>hI,CLAUDE_CODE_DAEMON_COLD_START:()=>EI,CLAUDE_CODE_DECSTBM:()=>qR,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>QR,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>eD,CLAUDE_CODE_DIR_SYNC_ENGINE:()=>rD,CLAUDE_CODE_DIR_SYNC_FFWD:()=>sD,CLAUDE_CODE_DIR_SYNC_GIT:()=>oD,CLAUDE_CODE_DIR_SYNC_STREAM:()=>iD,CLAUDE_CODE_DISABLE_ATTRIBUTION_BASELINE_REUSE:()=>FR,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>_I,CLAUDE_CODE_DISABLE_DIR_SYNC:()=>nD,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>aD,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>lD,CLAUDE_CODE_DISABLE_TURN_HANDOFF:()=>cD,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>dD,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>uD,CLAUDE_CODE_DONT_INHERIT_ENV:()=>SI,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>pD,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>yI,CLAUDE_CODE_EMIT_STARTUP_TIMING:()=>AI,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>bI,CLAUDE_CODE_ENTRYPOINT:()=>fD,CLAUDE_CODE_ENVIRONMENT_KIND:()=>mD,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>_D,CLAUDE_CODE_EVAL_CONFINED:()=>KI,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>CI,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>NP,CLAUDE_CODE_FLAG_FETCH_WAIT_MS:()=>TI,CLAUDE_CODE_FOOTER_INDICATOR:()=>SD,CLAUDE_CODE_FORCE_BRIDGE:()=>RI,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>DI,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>LI,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>II,CLAUDE_CODE_FORCE_TIP_ID:()=>yD,CLAUDE_CODE_GIT_BASH_PATH:()=>OD,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>vP,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>kP,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>AD,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>aP,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>bD,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>CD,CLAUDE_CODE_HOST_PLATFORM:()=>TD,CLAUDE_CODE_HOST_SESSION_ID:()=>RD,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>DD,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>MP,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>UP,CLAUDE_CODE_IS_COWORK:()=>PI,CLAUDE_CODE_LEGACY_BUNDLE:()=>tD,CLAUDE_CODE_LOOP_KEEPALIVE:()=>xI,CLAUDE_CODE_LOOP_PERSISTENT:()=>wI,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>LD,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>HP,CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH:()=>Ix,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>zP,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>FP,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>ID,CLAUDE_CODE_MCP_APPS_HOST:()=>Lx,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>Tx,CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS:()=>Rx,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>_P,CLAUDE_CODE_MCP_STARTUP_WAIT_MS:()=>Dx,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>Cx,CLAUDE_CODE_MEMORY_SUBAGENT_APPEND:()=>JL,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>NI,CLAUDE_CODE_MOCK_TRIAL:()=>vI,CLAUDE_CODE_OVERRIDE_DATE:()=>PD,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>nP,CLAUDE_CODE_PARKED_RUN_BEFORE_CLEAR:()=>iP,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>sP,CLAUDE_CODE_PERFORCE_MODE:()=>wD,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>BP,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>GP,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>ND,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>vD,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>jP,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>kD,CLAUDE_CODE_POST_TURN_MEMORY:()=>kI,CLAUDE_CODE_POST_TURN_MEMORY_CONFIG:()=>MD,CLAUDE_CODE_POST_TURN_MEMORY_SYNC:()=>MI,CLAUDE_CODE_POWERUP_ONBOARDING:()=>UD,CLAUDE_CODE_PROJECT_DIR_NAME:()=>HD,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>WP,CLAUDE_CODE_QUESTION_EXTENDED:()=>FD,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>BD,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>zD,CLAUDE_CODE_RELAUNCH_HOME_TRUST:()=>GD,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>jD,CLAUDE_CODE_REMOTE:()=>UI,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>WD,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>HI,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>$D,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>VD,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>zI,CLAUDE_CODE_REMOTE_SESSION_ID:()=>KD,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>YD,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>XD,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>$P,CLAUDE_CODE_REPL:()=>FI,CLAUDE_CODE_REPO_CHECKOUTS:()=>JD,CLAUDE_CODE_RESTRICTED:()=>BI,CLAUDE_CODE_RESUME_FROM_SESSION:()=>ZD,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>GI,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>WI,CLAUDE_CODE_RESUME_PROMPT:()=>qD,CLAUDE_CODE_RESUME_REASON:()=>$I,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>jI,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>VP,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>KP,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>rP,CLAUDE_CODE_SAFE_MODE:()=>VI,CLAUDE_CODE_SANDBOXED:()=>YI,CLAUDE_CODE_SCRIPT_CAPS:()=>YP,CLAUDE_CODE_SCROLL_SPEED:()=>QD,CLAUDE_CODE_SDK_READS_SESSION_STATE:()=>OI,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>XP,CLAUDE_CODE_SESSION_ID:()=>eL,CLAUDE_CODE_SESSION_KIND:()=>tL,CLAUDE_CODE_SESSION_NAME:()=>nL,CLAUDE_CODE_SESSION_ORIGIN:()=>oL,CLAUDE_CODE_SESSION_START_ANNOUNCEMENTS_BEFORE_PROMPT:()=>XI,CLAUDE_CODE_SHELL:()=>rL,CLAUDE_CODE_SHELL_PREFIX:()=>sL,CLAUDE_CODE_SIMPLE:()=>JI,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>iL,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>aL,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>JP,CLAUDE_CODE_SSE_PORT:()=>ZP,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>lL,CLAUDE_CODE_STARTUP_FAILURE_RESULTS:()=>xD,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>qP,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>ZI,CLAUDE_CODE_SUPERVISED:()=>qI,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>eP,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>tP,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>ex,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>tx,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>QP,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>nx,CLAUDE_CODE_SYNC_SESSION_REFS:()=>lP,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>ox,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>rx,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>cP,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>cL,CLAUDE_CODE_TAGS:()=>dL,CLAUDE_CODE_TASK_LIST_ID:()=>pL,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>sx,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>uL,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>dP,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>fL,CLAUDE_CODE_TEST_FORCE_DENY:()=>uP,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>pP,CLAUDE_CODE_TEST_NO_PWSH:()=>fP,CLAUDE_CODE_TMPDIR:()=>mL,CLAUDE_CODE_TMUX_PREFIX:()=>gL,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>mP,CLAUDE_CODE_TMUX_SESSION:()=>hL,CLAUDE_CODE_TMUX_TRUECOLOR:()=>gP,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>hP,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>EP,CLAUDE_CODE_TRIGGER_ID:()=>EL,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>SP,CLAUDE_CODE_TUI_TRIAL:()=>yP,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>_L,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>SL,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>ix,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>OP,CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE:()=>yL,CLAUDE_CODE_WORKER_EPOCH:()=>ax,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>OL,CLAUDE_CONFIG_DIR:()=>AL,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>bL,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>CL,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>TL,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>RL,CLAUDE_ENV_FILE:()=>DL,CLAUDE_FORCE_DISPLAY_SURVEY:()=>AP,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>LL,CLAUDE_INTERNAL_FC_OVERRIDES:()=>IL,CLAUDE_JOB_DIR:()=>PL,CLAUDE_MEMORY_STORES:()=>xL,CLAUDE_PROJECT_UUID:()=>wL,CLAUDE_PTY_HEARTBEAT_MS:()=>lx,CLAUDE_PTY_HOST_EXEC:()=>NL,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>cx,CLAUDE_RELAUNCH_SESSION_ADD_DIRS:()=>vL,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>kL,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>ML,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>UL,CLAUDE_RUNNER_ACTIVITY_FD:()=>dx,CLAUDE_RUNNER_FETCH_DEPTH:()=>HL,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>zL,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>ux,CLAUDE_SNIP:()=>FL,CLAUDE_SSH_LOCAL_BINARY:()=>BL,CLAUDE_SSH_VERSION:()=>GL,CLAUDE_STAGE_FILE_ROOT:()=>jL,CLAUDE_TMPDIR:()=>WL,LOCAL_BRIDGE:()=>bP,MCP_CONNECTION_NONBLOCKING:()=>CP,MCP_CONNECT_TIMEOUT_MS:()=>px,MCP_DISCOVERY_CACHE:()=>fx,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>mx,MCP_DISCOVERY_CACHE_STRIKES:()=>gx,MCP_DISCOVERY_CACHE_TTL_S:()=>hx,MCP_OAUTH_CALLBACK_PORT:()=>Ex,MCP_OAUTH_CLIENT_METADATA_URL:()=>$L,MCP_PROTOCOL_NEGOTIATION:()=>_x,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>Sx,MCP_SDK_GENERATION:()=>Ox,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>yx,MCP_TIMEOUT:()=>Ax,MCP_TOOL_TIMEOUT:()=>bx,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>VL,SDK_NATIVE_BIN:()=>KL,SESSION_INGRESS_URL:()=>YL,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>Px,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>XL,TEST_ENABLE_SESSION_PERSISTENCE:()=>TP,ULTRAPLAN_PROMPT_FILE:()=>ZL,VCR_RECORD:()=>RP,VITALS_EMITTER_BIN:()=>qL,VOICE_STREAM_BASE_URL:()=>QL});var YT=I.str(),XT=I.str(),JT=I.str(),ZT=I.str(),qT=I.str(),QT=I.rawStr(),eR=I.str(),tR=I.str(),nR=I.str(),oR=I.str(),rR=I.str(),sR=I.str(),iR=I.str(),aR=I.str(),lR=I.bool(),cR=I.str(),dR=I.str(),uR=I.str(),pR=I.str(),fR=I.str(),mR=I.str(),gR=I.str(),hR=I.bool(),ER=I.str(),_R=I.str(),SR=I.str(),yR=I.str(),OR=I.str(),AR=I.str(),bR=I.str(),CR=I.str(),TR=I.str(),RR=I.str(),DR=I.str(),LR=I.str(),IR=I.str(),PR=I.str(),xR=I.str(),wR=I.str(),NR=I.str(),vR=I.str(),kR=I.str(),MR=I.str(),UR=I.str(),HR=I.str(),zR=I.int({min:0}),FR=I.bool(),BR=I.str(),GR=I.str(),jR=I.str(),WR=I.str(),$R=I.enum(["1","spent"]),VR=I.str(),KR=I.str(),YR=I.str(),XR=I.str(),JR=I.str(),ZR=I.str(),qR=I.str(),QR=I.str(),eD=I.str(),tD=I.bool(),nD=I.bool(),oD=I.bool(),rD=I.str(),sD=I.str(),iD=I.str(),aD=I.bool(),lD=I.bool(),cD=I.bool(),dD=I.bool(),uD=I.bool(),pD=I.str(),fD=I.str(),mD=I.str(),gD=I.bool(),hD=I.bool(),ED=I.bool(),_D=I.str(),SD=I.str(),yD=I.str(),OD=I.str(),AD=I.str(),bD=I.int({min:0}),CD=I.int({min:0}),TD=I.str(),RD=I.str(),DD=I.str(),LD=I.str(),ID=I.str(),PD=I.str(),xD=I.bool(),wD=I.str(),ND=I.str(),vD=I.str(),kD=I.str(),MD=I.str(),UD=I.str(),HD=I.str(),zD=I.str(),FD=I.bool(),BD=I.bool(),GD=I.str(),jD=I.str(),WD=I.str(),$D=I.str(),VD=I.str(),KD=I.str(),YD=I.str(),XD=I.str(),JD=I.str(),ZD=I.str(),qD=I.str(),QD=I.str(),eL=I.str(),tL=I.str(),nL=I.str(),oL=I.enum(["claude_ai_chat"]),rL=I.str(),sL=I.str(),iL=I.str(),aL=I.str(),lL=I.str(),cL=I.str(),dL=I.str(),uL=I.str(),pL=I.str(),fL=I.str(),mL=I.str(),gL=I.str(),hL=I.str(),EL=I.str(),_L=I.str(),SL=I.str(),yL=I.str(),OL=I.str(),AL=I.str(),bL=I.str(),CL=I.str(),TL=I.str(),RL=I.str(),DL=I.str(),LL=I.str(),IL=I.str(),PL=I.str(),xL=I.str(),wL=I.str(),NL=I.str(),vL=I.str(),kL=I.str(),ML=I.str(),UL=I.str(),HL=I.str(),zL=I.str(),FL=I.str(),BL=I.str(),GL=I.str(),jL=I.str(),WL=I.str(),$L=I.str(),VL=I.str(),KL=I.str(),YL=I.str(),XL=I.bool(),JL=I.bool(),ZL=I.str(),qL=I.str(),QL=I.str(),eI=I.bool(),tI=I.bool(),nI=I.bool(),oI=I.bool(),rI=I.bool(),sI=I.bool(),iI=I.bool(),aI=I.bool(),lI=I.bool(),cI=I.bool(),dI=I.bool(),uI=I.bool(),pI=I.bool(),fI=I.bool(),mI=I.bool(),gI=I.bool(),hI=I.bool(),EI=I.bool(),_I=I.bool(),SI=I.bool(),yI=I.bool(),OI=I.bool(),AI=I.bool(),bI=I.bool(),CI=I.bool(),TI=I.int({min:0}),RI=I.bool(),DI=I.bool(),LI=I.bool(),II=I.bool(),PI=I.bool(),xI=I.triBool(),wI=I.bool(),NI=I.str(),vI=I.bool(),kI=I.bool(),MI=I.bool(),UI=I.bool(),HI=I.bool(),zI=I.bool(),FI=I.triBool(),BI=I.bool(),GI=I.bool(),jI=I.str(),WI=I.str(),$I=I.str(),VI=I.bool(),KI=I.bool(),YI=I.bool(),XI=I.bool(),JI=I.bool(),ZI=I.triBool(),qI=I.bool(),QI=I.str(),eP=I.bool(),tP=I.int({min:1}),nP=I.int({min:0}),oP=I.bool(),rP=I.bool(),sP=I.bool(),iP=I.bool(),aP=I.bool(),lP=I.bool(),cP=I.str(),dP=I.bool(),uP=I.rawStr(),pP=I.str(),fP=I.str(),mP=I.bool(),gP=I.rawStr(),hP=I.str(),EP=I.str(),_P=I.str(),SP=I.str(),yP=I.str(),OP=I.bool(),AP=I.bool(),bP=I.bool(),CP=I.triBool(),TP=I.bool(),RP=I.bool(),DP=I.int(),LP=I.int(),IP=I.int(),PP=I.int({min:1,max:2147483647,digitsOnly:!0}),xP=I.int(),wP=I.int(),NP=I.int(),vP=I.int({min:1}),kP=I.int({min:0,max:10080,digitsOnly:!0}),MP=I.int(),UP=I.int(),HP=I.int({min:1,digitsOnly:!0}),zP=I.int({min:1,digitsOnly:!0}),FP=I.int({min:1,digitsOnly:!0}),BP=I.int(),GP=I.int(),jP=I.int(),WP=I.int(),$P=I.int(),VP=I.int(),KP=I.int(),YP=I.int(),XP=I.int({min:1}),JP=I.int(),ZP=I.int(),qP=I.int(),QP=I.int({min:1}),ex=I.int({min:1}),tx=I.int({min:0}),nx=I.int({min:0,max:86400000}),ox=I.int(),rx=I.int(),sx=I.int({min:1000,max:60000}),ix=I.int(),ax=I.int(),lx=I.int({min:1}),cx=I.int({min:1}),dx=I.int({min:3}),ux=I.int({min:1}),px=I.int(),fx=I.triBool(),mx=I.int({min:1}),gx=I.int({min:1}),hx=I.int({min:1}),Ex=I.int({min:1}),_x=I.str(),Sx=I.int({min:1}),yx=I.int({min:1}),Ox=I.str(),Ax=I.int(),bx=I.int({min:1}),Cx=I.int(),Tx=I.int(),Rx=I.int({min:1}),Dx=I.int({min:0}),Lx=I.bool(),Ix=I.int({min:1,digitsOnly:!0}),Px=I.int({min:1});var vs={};P(vs,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>Yx,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>Jx,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>Xx,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>vx,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>Mx,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>kx,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>jx,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>$x,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>Wx,ANTHROPIC_DEFAULT_MODEL:()=>wx,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>Ux,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>zx,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>Hx,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>Fx,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>Gx,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>Bx,ANTHROPIC_MODEL:()=>xx,ANTHROPIC_SMALL_FAST_MODEL:()=>Nx,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>Kx,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>Vx,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>iw,CLAUDE_CODE_AUTO_MODE_MODEL:()=>Qx,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>ew,CLAUDE_CODE_CLIENT_DATA_URL:()=>gw,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>uw,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>ow,CLAUDE_CODE_DISABLE_FAST_MODE:()=>lw,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>rw,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>pw,CLAUDE_CODE_EFFORT_LEVEL:()=>sw,CLAUDE_CODE_MAX_EFFORT_REMINDER:()=>aw,CLAUDE_CODE_MODEL_CATALOG:()=>fw,CLAUDE_CODE_MODEL_CATALOG_URL:()=>mw,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>nw,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>cw,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>dw,CLAUDE_CODE_SUBAGENT_MODEL:()=>Zx,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>qx,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>tw});var xx=I.str(),wx=I.str(),Nx=I.str(),vx=I.str(),kx=I.str(),Mx=I.str(),Ux=I.str(),Hx=I.str(),zx=I.str(),Fx=I.str(),Bx=I.str(),Gx=I.str(),jx=I.str(),Wx=I.str(),$x=I.str(),Vx=I.str(),Kx=I.str(),Yx=I.str(),Xx=I.str(),Jx=I.str(),Zx=I.str(),qx=I.bool(),Qx=I.str(),ew=I.str(),tw=I.str(),nw=I.bool(),ow=I.bool(),rw=I.bool(),sw=I.str(),iw=I.bool(),aw=I.triBool(),lw=I.bool(),cw=I.bool(),dw=I.bool(),uw=I.bool(),pw=I.bool(),fw=I.str(),mw=I.str(),gw=I.str();var ks={};P(ks,{ALL_PROXY:()=>Aw,ANTHROPIC_BETAS:()=>Iw,ANTHROPIC_CUSTOM_HEADERS:()=>Pw,API_FORCE_IDLE_TIMEOUT:()=>Ww,API_TIMEOUT_MS:()=>jw,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>qw,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>Nw,CLAUDE_CODE_CERT_STORE:()=>Lw,CLAUDE_CODE_CLIENT_CERT:()=>Cw,CLAUDE_CODE_CLIENT_KEY:()=>Tw,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>Rw,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>Dw,CLAUDE_CODE_EAGER_FLUSH:()=>nN,CLAUDE_CODE_EXTRA_BODY:()=>xw,CLAUDE_CODE_EXTRA_METADATA:()=>ww,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>Uw,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>oN,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>Xw,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>Yw,CLAUDE_CODE_GZIP_REQUEST_BODY_LEVEL:()=>Jw,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>Mw,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>kw,CLAUDE_CODE_MAX_RETRIES:()=>vw,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>Hw,CLAUDE_CODE_MAX_TURNS:()=>zw,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>iN,CLAUDE_CODE_RETRY_WATCHDOG:()=>tN,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>sN,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>$w,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>Vw,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>Kw,CLAUDE_MOCK_HEADERLESS_429:()=>rN,CLAUDE_SLOW_FIRST_BYTE_MS:()=>eN,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>Qw,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>Zw,HTTPS_PROXY:()=>Ew,HTTP_PROXY:()=>hw,MAX_MCP_OUTPUT_TOKENS:()=>Gw,MAX_STRUCTURED_OUTPUT_RETRIES:()=>Bw,MAX_THINKING_TOKENS:()=>Fw,NO_PROXY:()=>_w,all_proxy:()=>bw,http_proxy:()=>Sw,https_proxy:()=>yw,no_proxy:()=>Ow});var hw=I.str(),Ew=I.str(),_w=I.str(),Sw=I.str(),yw=I.str(),Ow=I.str(),Aw=I.str(),bw=I.str(),Cw=I.str(),Tw=I.str(),Rw=I.str(),Dw=I.bool(),Lw=I.str(),Iw=I.str(),Pw=I.str(),xw=I.str(),ww=I.str(),Nw=I.str(),vw=I.int(),kw=I.int(),Mw=I.int(),Uw=I.int(),Hw=I.int({min:1}),zw=I.str(),Fw=I.int(),Bw=I.int(),Gw=I.int(),jw=I.int(),Ww=I.int(),$w=I.triBool(),Vw=I.bool(),Kw=I.triBool(),Yw=I.triBool(),Xw=I.triBool(),Jw=I.int({min:0,max:9,digitsOnly:!0}),Zw=I.int({min:1}),qw=I.int({min:1}),Qw=I.int({min:1}),eN=I.int({min:1}),tN=I.bool(),nN=I.bool(),oN=I.bool(),rN=I.bool(),sN=I.int(),iN=I.int({min:0});var Ms={};P(Ms,{AGENT_PROXY_URL:()=>hv,ANTHROPIC_AWS_BASE_URL:()=>yN,ANTHROPIC_AWS_WORKSPACE_ID:()=>ON,ANTHROPIC_BASE_URL:()=>fN,ANTHROPIC_BEDROCK_BASE_URL:()=>hN,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>SN,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>EN,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>_N,ANTHROPIC_FOUNDRY_BASE_URL:()=>IN,ANTHROPIC_FOUNDRY_RESOURCE:()=>PN,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>TN,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>bN,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>AN,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>CN,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>GN,ANTHROPIC_UNIX_SOCKET:()=>jN,ANTHROPIC_VERTEX_BASE_URL:()=>RN,ANTHROPIC_VERTEX_PROJECT_ID:()=>DN,AWS_ACCESS_KEY_ID:()=>MN,AWS_CONFIG_FILE:()=>vN,AWS_DEFAULT_REGION:()=>wN,AWS_ENDPOINT_URL:()=>zN,AWS_ENDPOINT_URL_STS:()=>FN,AWS_PROFILE:()=>NN,AWS_REGION:()=>xN,AWS_SECRET_ACCESS_KEY:()=>UN,AWS_SESSION_TOKEN:()=>HN,AWS_SHARED_CREDENTIALS_FILE:()=>kN,AWS_USE_FIPS_ENDPOINT:()=>BN,CCR_AGENT_PROXY_ENABLED:()=>ov,CCR_AGENT_PROXY_FRAME_HOSTS:()=>pv,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>lv,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>uv,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>cv,CCR_AGENT_PROXY_RELAY_MODE:()=>av,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>dv,CCR_ENABLE_BUNDLE:()=>fv,CCR_FORCE_BUNDLE:()=>mv,CCR_ON_BRANCH_DEFAULT_GUARD:()=>gv,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>sv,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>rv,CLAUDE_CODE_AGENT_PROXY_GIT_HOSTS:()=>iv,CLAUDE_CODE_API_BASE_URL:()=>gN,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>QN,CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS:()=>ev,CLAUDE_CODE_GB_BASE_URL:()=>tv,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>nv,CLAUDE_CODE_HOST_GATEWAY_LINEAGE:()=>$N,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>WN,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>KN,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>VN,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>Ev,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>dN,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>uN,CLAUDE_CODE_USE_BEDROCK:()=>aN,CLAUDE_CODE_USE_FOUNDRY:()=>cN,CLAUDE_CODE_USE_GATEWAY:()=>YN,CLAUDE_CODE_USE_MANTLE:()=>pN,CLAUDE_CODE_USE_VERTEX:()=>lN,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>XN,CLAUDE_GATEWAY_DRAIN_TIMEOUT_MS:()=>qN,CLAUDE_GATEWAY_LOG_LEVEL:()=>ZN,CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY:()=>JN,CLOUD_ML_REGION:()=>LN,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>mN});var Wa=["us","eu","apac","jp","au","us-gov","global"],$a=["us","eu","apac","jp","au","global"];var aN=I.bool(),lN=I.bool(),cN=I.bool(),dN=I.bool(),uN=I.bool(),pN=I.bool(),fN=I.str(),mN=I.bool(),gN=I.str(),hN=I.str(),EN=I.enum($a),_N=I.str(),SN=I.str(),yN=I.str(),ON=I.str(),AN=I.str(),bN=I.str(),CN=I.str(),TN=I.str(),RN=I.str(),DN=I.str(),LN=I.str(),IN=I.str(),PN=I.str(),xN=I.str(),wN=I.str(),NN=I.str(),vN=I.str(),kN=I.str(),MN=I.str(),UN=I.str(),HN=I.str(),zN=I.str(),FN=I.str(),BN=I.str(),GN=I.str(),jN=I.str(),WN=I.bool(),$N=I.bool(),VN=I.bool(),KN=I.bool(),YN=I.bool(),XN=I.bool(),JN=I.bool(),ZN=I.str(),qN=I.int({min:1,max:2147000000,digitsOnly:!0}),QN=I.bool(),ev=I.int({min:1,max:2147483647,digitsOnly:!0}),tv=I.str(),nv=I.int(),ov=I.bool(),rv=I.bool(),sv=I.bool(),iv=I.str(),av=I.str(),lv=I.str(),cv=I.bool(),dv=I.bool(),uv=I.bool(),pv=I.str(),fv=I.bool(),mv=I.bool(),gv=I.enum(["enforce","observe","off"]),hv=I.str(),Ev=I.bool();var Sv={...Ls,...Ms,...vs,...xs,...ks,...ws,...Is,...Ns};function Us(l,b){let D=Object.create(b);for(let[te,ce]of Object.entries(l)){let Oe=D,xe;Object.defineProperty(D,te,{get:()=>{let $e=process.env[te];if($e!==Oe)xe=ce.parse($e),Oe=$e;return xe},enumerable:!0,configurable:!0})}return Object.defineProperties(D,{set:{value:(te,ce)=>{process.env[te]=Ia(ce)}},unset:{value:(te)=>{delete process.env[te]}}}),D}var On=Us(Sv,Lo),yv={},xW=Us(yv,null),Ov={},wW=Us(Ov,null);function Ka(){}async function bv(l,b){let D=s();try{await D.appendFile(l,b)}catch{await D.mkdir(Av(l)).catch(Ka),await D.appendFile(l,b)}}class Ya{pendingWrite=Promise.resolve();cleanupRegistered=!1;append(l,b){if(this.pendingWrite=this.pendingWrite.then(bv.bind(null,l,b)).catch(Ka),!this.cleanupRegistered)this.cleanupRegistered=!0,Ye(()=>this.flush())}flush(){return this.pendingWrite}}var Cv=new i(()=>new Ya);function Tv(){return ee(Cv)}function Po(l,b,D){let te=Dv();if(!te)return;let ce;try{ce=Va(l,b,Rv(D))}catch{ce=Va(l,b,{diagnostics_payload_failed:!0})}Tv().append(te,ce)}function Rv(l){try{return(typeof l==="function"?l():l)??{}}catch{return{diagnostics_payload_failed:!0}}}function Va(l,b,D){let te={timestamp:new Date().toISOString(),level:l,event:b,data:D};return t(te)+`
|
|
26
|
-
`}function Dv(){return On.CLAUDE_CODE_DIAGNOSTICS_FILE}import{open as Lv}from"fs/promises";function Iv(l,b,D){mr(l.statSync(b),b,D)}function mr(l,b,D){if(l.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:b});if(!l.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:b});if(D!==void 0&&l.size>D)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:b,size:l.size,maxBytes:D})}function Hs(l,b,D){if(D===void 0)return;if(l>D)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:b,size:l,maxBytes:D})}function Xa(l){return l!=null&&typeof l==="object"&&"code"in l&&l.code==="ERR_FILE_TOO_LARGE"}function Ja(l){if(l.byteLength===0)return"utf8";if(l.byteLength>=2){if(l[0]===255&&l[1]===254)return"utf16le"}if(l.byteLength>=3&&l[0]===239&&l[1]===187&&l[2]===191)return"utf8";return"utf8"}function Pv(l){let{buffer:b,bytesRead:D}=s().readSync(l,{length:4096});return Ja(b.subarray(0,D))}function Za(l){let b=0,D=0;for(let te=0;te<l.length;te++)if(l[te]===`
|
|
27
|
-
`)if(te>0&&l[te-1]==="\r")b++;else D++;return b>D?"CRLF":"LF"}function xv(l,b){let D=s(),{resolvedPath:te,isSymlink:ce}=Ae(D,l);if(ce)e(`Reading through symlink: ${l} -> ${te}`);Iv(D,l,b);let Oe=Pv(l),xe;if(b===void 0)xe=D.readFileSync(l,{encoding:Oe});else{let{buffer:et,bytesRead:rt}=D.readSync(l,{length:b+1});Hs(rt,l,b),xe=et.subarray(0,rt).toString(Oe)}let $e=Za(xe.slice(0,4096));return{content:xe.replaceAll(`\r
|
|
28
|
-
`,`
|
|
29
|
-
`),encoding:Oe,lineEndings:$e}}function vn(l,b){return xv(l,b).content}async function qa(l,b){let xe=[];try{let D=s();let{resolvedPath:te,isSymlink:ce}=Ae(D,l);if(ce)e(`Reading through symlink: ${l} -> ${te}`);mr(await D.stat(l),l,b);const Oe=p(xe,await Lv(l,ot()),1);return await wv(Oe,l,b)}catch($e){var et=$e,rt=1}finally{var tt=f(xe,et,rt);tt&&await tt}}async function wv(l,b,D){mr(await l.stat(),b,D);let te=D===void 0?await l.readFile():await it(l,D+1,"file");Hs(te.length,b,D);let ce=Ja(te.subarray(0,4096)),Oe=te.toString(ce),xe=Za(Oe.slice(0,4096));return{content:Oe.replaceAll(`\r
|
|
30
|
-
`,`
|
|
31
|
-
`),encoding:ce,lineEndings:xe}}var Qa;(function(l){l[l.lineFeed=10]="lineFeed",l[l.carriageReturn=13]="carriageReturn",l[l.space=32]="space",l[l._0=48]="_0",l[l._1=49]="_1",l[l._2=50]="_2",l[l._3=51]="_3",l[l._4=52]="_4",l[l._5=53]="_5",l[l._6=54]="_6",l[l._7=55]="_7",l[l._8=56]="_8",l[l._9=57]="_9",l[l.a=97]="a",l[l.b=98]="b",l[l.c=99]="c",l[l.d=100]="d",l[l.e=101]="e",l[l.f=102]="f",l[l.g=103]="g",l[l.h=104]="h",l[l.i=105]="i",l[l.j=106]="j",l[l.k=107]="k",l[l.l=108]="l",l[l.m=109]="m",l[l.n=110]="n",l[l.o=111]="o",l[l.p=112]="p",l[l.q=113]="q",l[l.r=114]="r",l[l.s=115]="s",l[l.t=116]="t",l[l.u=117]="u",l[l.v=118]="v",l[l.w=119]="w",l[l.x=120]="x",l[l.y=121]="y",l[l.z=122]="z",l[l.A=65]="A",l[l.B=66]="B",l[l.C=67]="C",l[l.D=68]="D",l[l.E=69]="E",l[l.F=70]="F",l[l.G=71]="G",l[l.H=72]="H",l[l.I=73]="I",l[l.J=74]="J",l[l.K=75]="K",l[l.L=76]="L",l[l.M=77]="M",l[l.N=78]="N",l[l.O=79]="O",l[l.P=80]="P",l[l.Q=81]="Q",l[l.R=82]="R",l[l.S=83]="S",l[l.T=84]="T",l[l.U=85]="U",l[l.V=86]="V",l[l.W=87]="W",l[l.X=88]="X",l[l.Y=89]="Y",l[l.Z=90]="Z",l[l.asterisk=42]="asterisk",l[l.backslash=92]="backslash",l[l.closeBrace=125]="closeBrace",l[l.closeBracket=93]="closeBracket",l[l.colon=58]="colon",l[l.comma=44]="comma",l[l.dot=46]="dot",l[l.doubleQuote=34]="doubleQuote",l[l.minus=45]="minus",l[l.openBrace=123]="openBrace",l[l.openBracket=91]="openBracket",l[l.plus=43]="plus",l[l.slash=47]="slash",l[l.formFeed=12]="formFeed",l[l.tab=9]="tab"})(Qa||(Qa={}));var vv=Array(20).fill(0).map((l,b)=>" ".repeat(b));var kv={" ":{"\n":Array(200).fill(0).map((l,b)=>`
|
|
32
|
-
`+" ".repeat(b)),"\r":Array(200).fill(0).map((l,b)=>"\r"+" ".repeat(b)),"\r\n":Array(200).fill(0).map((l,b)=>`\r
|
|
33
|
-
`+" ".repeat(b))},"\t":{"\n":Array(200).fill(0).map((l,b)=>`
|
|
34
|
-
`+"\t".repeat(b)),"\r":Array(200).fill(0).map((l,b)=>"\r"+"\t".repeat(b)),"\r\n":Array(200).fill(0).map((l,b)=>`\r
|
|
35
|
-
`+"\t".repeat(b))}};var tl;(function(l){l.DEFAULT={allowTrailingComma:!1}})(tl||(tl={}));var nl;(function(l){l[l.None=0]="None",l[l.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",l[l.UnexpectedEndOfString=2]="UnexpectedEndOfString",l[l.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",l[l.InvalidUnicode=4]="InvalidUnicode",l[l.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",l[l.InvalidCharacter=6]="InvalidCharacter"})(nl||(nl={}));var ol;(function(l){l[l.OpenBraceToken=1]="OpenBraceToken",l[l.CloseBraceToken=2]="CloseBraceToken",l[l.OpenBracketToken=3]="OpenBracketToken",l[l.CloseBracketToken=4]="CloseBracketToken",l[l.CommaToken=5]="CommaToken",l[l.ColonToken=6]="ColonToken",l[l.NullKeyword=7]="NullKeyword",l[l.TrueKeyword=8]="TrueKeyword",l[l.FalseKeyword=9]="FalseKeyword",l[l.StringLiteral=10]="StringLiteral",l[l.NumericLiteral=11]="NumericLiteral",l[l.LineCommentTrivia=12]="LineCommentTrivia",l[l.BlockCommentTrivia=13]="BlockCommentTrivia",l[l.LineBreakTrivia=14]="LineBreakTrivia",l[l.Trivia=15]="Trivia",l[l.Unknown=16]="Unknown",l[l.EOF=17]="EOF"})(ol||(ol={}));var rl;(function(l){l[l.InvalidSymbol=1]="InvalidSymbol",l[l.InvalidNumberFormat=2]="InvalidNumberFormat",l[l.PropertyNameExpected=3]="PropertyNameExpected",l[l.ValueExpected=4]="ValueExpected",l[l.ColonExpected=5]="ColonExpected",l[l.CommaExpected=6]="CommaExpected",l[l.CloseBraceExpected=7]="CloseBraceExpected",l[l.CloseBracketExpected=8]="CloseBracketExpected",l[l.EndOfFileExpected=9]="EndOfFileExpected",l[l.InvalidCommentToken=10]="InvalidCommentToken",l[l.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",l[l.UnexpectedEndOfString=12]="UnexpectedEndOfString",l[l.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",l[l.InvalidUnicode=14]="InvalidUnicode",l[l.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",l[l.InvalidCharacter=16]="InvalidCharacter"})(rl||(rl={}));var io=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,il=new Set,zs=typeof process==="object"&&!!process?process:{},al=(l,b,D,te)=>{typeof zs.emitWarning==="function"?zs.emitWarning(l,b,D,te):console.error(`[${D}] ${b}: ${l}`)},{AbortController:gr,AbortSignal:sl}=globalThis;if(typeof gr>"u"){sl=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(te,ce){this._onabort.push(ce)}},gr=class{constructor(){b()}signal=new sl;abort(te){if(this.signal.aborted)return;this.signal.reason=te,this.signal.aborted=!0;for(let ce of this.signal._onabort)ce(te);this.signal.onabort?.(te)}};let l=zs.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",b=()=>{if(!l)return;l=!1,al("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",b)}}var Gv=(l)=>!il.has(l),m$=Symbol("type"),Rn=(l)=>l&&l===Math.floor(l)&&l>0&&isFinite(l),ll=(l)=>!Rn(l)?null:l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?xo:null;class xo extends Array{constructor(l){super(l);this.fill(0)}}class ao{heap;length;static#l=!1;static create(l){let b=ll(l);if(!b)return[];ao.#l=!0;let D=new ao(l,b);return ao.#l=!1,D}constructor(l,b){if(!ao.#l)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new b(l),this.length=0}push(l){this.heap[this.length++]=l}pop(){return this.heap[--this.length]}}class hr{#l;#u;#g;#h;#P;#x;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#E;#o;#n;#e;#c;#p;#a;#s;#_;#i;#S;#y;#f;#O;#R;#d;static unsafeExposeInternals(l){return{starts:l.#y,ttls:l.#f,sizes:l.#S,keyMap:l.#o,keyList:l.#n,valList:l.#e,next:l.#c,prev:l.#p,get head(){return l.#a},get tail(){return l.#s},free:l.#_,isBackgroundFetch:(b)=>l.#t(b),backgroundFetch:(b,D,te,ce)=>l.#v(b,D,te,ce),moveToTail:(b)=>l.#I(b),indexes:(b)=>l.#A(b),rindexes:(b)=>l.#b(b),isStale:(b)=>l.#m(b)}}get max(){return this.#l}get maxSize(){return this.#u}get calculatedSize(){return this.#E}get size(){return this.#r}get fetchMethod(){return this.#P}get memoMethod(){return this.#x}get dispose(){return this.#g}get disposeAfter(){return this.#h}constructor(l){let{max:b=0,ttl:D,ttlResolution:te=1,ttlAutopurge:ce,updateAgeOnGet:Oe,updateAgeOnHas:xe,allowStale:$e,dispose:et,disposeAfter:rt,noDisposeOnSet:tt,noUpdateTTL:ct,maxSize:at=0,maxEntrySize:gt=0,sizeCalculation:ht,fetchMethod:Dt,memoMethod:St,noDeleteOnFetchRejection:Pt,noDeleteOnStaleGet:wt,allowStaleOnFetchRejection:It,allowStaleOnFetchAbort:Nt,ignoreFetchAbort:Gt}=l;if(b!==0&&!Rn(b))throw TypeError("max option must be a nonnegative integer");let rn=b?ll(b):Array;if(!rn)throw Error("invalid max value: "+b);if(this.#l=b,this.#u=at,this.maxEntrySize=gt||this.#u,this.sizeCalculation=ht,this.sizeCalculation){if(!this.#u&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(St!==void 0&&typeof St!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#x=St,Dt!==void 0&&typeof Dt!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#P=Dt,this.#R=!!Dt,this.#o=new Map,this.#n=Array(b).fill(void 0),this.#e=Array(b).fill(void 0),this.#c=new rn(b),this.#p=new rn(b),this.#a=0,this.#s=0,this.#_=ao.create(b),this.#r=0,this.#E=0,typeof et==="function")this.#g=et;if(typeof rt==="function")this.#h=rt,this.#i=[];else this.#h=void 0,this.#i=void 0;if(this.#O=!!this.#g,this.#d=!!this.#h,this.noDisposeOnSet=!!tt,this.noUpdateTTL=!!ct,this.noDeleteOnFetchRejection=!!Pt,this.allowStaleOnFetchRejection=!!It,this.allowStaleOnFetchAbort=!!Nt,this.ignoreFetchAbort=!!Gt,this.maxEntrySize!==0){if(this.#u!==0){if(!Rn(this.#u))throw TypeError("maxSize must be a positive integer if specified")}if(!Rn(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!$e,this.noDeleteOnStaleGet=!!wt,this.updateAgeOnGet=!!Oe,this.updateAgeOnHas=!!xe,this.ttlResolution=Rn(te)||te===0?te:1,this.ttlAutopurge=!!ce,this.ttl=D||0,this.ttl){if(!Rn(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#l===0&&this.ttl===0&&this.#u===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#u){if(Gv("LRU_CACHE_UNBOUNDED"))il.add("LRU_CACHE_UNBOUNDED"),al("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",hr)}}getRemainingTTL(l){return this.#o.has(l)?1/0:0}#k(){let l=new xo(this.#l),b=new xo(this.#l);this.#f=l,this.#y=b,this.#M=(ce,Oe,xe=io.now())=>{if(b[ce]=Oe!==0?xe:0,l[ce]=Oe,Oe!==0&&this.ttlAutopurge){let $e=setTimeout(()=>{if(this.#m(ce))this.#C(this.#n[ce],"expire")},Oe+1);if($e.unref)$e.unref()}},this.#D=(ce)=>{b[ce]=l[ce]!==0?io.now():0},this.#T=(ce,Oe)=>{if(l[Oe]){let xe=l[Oe],$e=b[Oe];if(!xe||!$e)return;ce.ttl=xe,ce.start=$e,ce.now=D||te();let et=ce.now-$e;ce.remainingTTL=xe-et}};let D=0,te=()=>{let ce=io.now();if(this.ttlResolution>0){D=ce;let Oe=setTimeout(()=>D=0,this.ttlResolution);if(Oe.unref)Oe.unref()}return ce};this.getRemainingTTL=(ce)=>{let Oe=this.#o.get(ce);if(Oe===void 0)return 0;let xe=l[Oe],$e=b[Oe];if(!xe||!$e)return 1/0;let et=(D||te())-$e;return xe-et},this.#m=(ce)=>{let Oe=b[ce],xe=l[ce];return!!xe&&!!Oe&&(D||te())-Oe>xe}}#D=()=>{};#T=()=>{};#M=()=>{};#m=()=>!1;#B(){let l=new xo(this.#l);this.#E=0,this.#S=l,this.#L=(b)=>{this.#E-=l[b],l[b]=0},this.#U=(b,D,te,ce)=>{if(this.#t(D))return 0;if(!Rn(te))if(ce){if(typeof ce!=="function")throw TypeError("sizeCalculation must be a function");if(te=ce(D,b),!Rn(te))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return te},this.#w=(b,D,te)=>{if(l[b]=D,this.#u){let ce=this.#u-l[b];while(this.#E>ce)this.#N(!0)}if(this.#E+=l[b],te)te.entrySize=D,te.totalCalculatedSize=this.#E}}#L=(l)=>{};#w=(l,b,D)=>{};#U=(l,b,D,te)=>{if(D||te)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:l=this.allowStale}={}){if(this.#r)for(let b=this.#s;;){if(!this.#H(b))break;if(l||!this.#m(b))yield b;if(b===this.#a)break;else b=this.#p[b]}}*#b({allowStale:l=this.allowStale}={}){if(this.#r)for(let b=this.#a;;){if(!this.#H(b))break;if(l||!this.#m(b))yield b;if(b===this.#s)break;else b=this.#c[b]}}#H(l){return l!==void 0&&this.#o.get(this.#n[l])===l}*entries(){for(let l of this.#A())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*rentries(){for(let l of this.#b())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*keys(){for(let l of this.#A()){let b=this.#n[l];if(b!==void 0&&!this.#t(this.#e[l]))yield b}}*rkeys(){for(let l of this.#b()){let b=this.#n[l];if(b!==void 0&&!this.#t(this.#e[l]))yield b}}*values(){for(let l of this.#A())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}*rvalues(){for(let l of this.#b())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(l,b={}){for(let D of this.#A()){let te=this.#e[D],ce=this.#t(te)?te.__staleWhileFetching:te;if(ce===void 0)continue;if(l(ce,this.#n[D],this))return this.get(this.#n[D],b)}}forEach(l,b=this){for(let D of this.#A()){let te=this.#e[D],ce=this.#t(te)?te.__staleWhileFetching:te;if(ce===void 0)continue;l.call(b,ce,this.#n[D],this)}}rforEach(l,b=this){for(let D of this.#b()){let te=this.#e[D],ce=this.#t(te)?te.__staleWhileFetching:te;if(ce===void 0)continue;l.call(b,ce,this.#n[D],this)}}purgeStale(){let l=!1;for(let b of this.#b({allowStale:!0}))if(this.#m(b))this.#C(this.#n[b],"expire"),l=!0;return l}info(l){let b=this.#o.get(l);if(b===void 0)return;let D=this.#e[b],te=this.#t(D)?D.__staleWhileFetching:D;if(te===void 0)return;let ce={value:te};if(this.#f&&this.#y){let Oe=this.#f[b],xe=this.#y[b];if(Oe&&xe){let $e=Oe-(io.now()-xe);ce.ttl=$e,ce.start=Date.now()}}if(this.#S)ce.size=this.#S[b];return ce}dump(){let l=[];for(let b of this.#A({allowStale:!0})){let D=this.#n[b],te=this.#e[b],ce=this.#t(te)?te.__staleWhileFetching:te;if(ce===void 0||D===void 0)continue;let Oe={value:ce};if(this.#f&&this.#y){Oe.ttl=this.#f[b];let xe=io.now()-this.#y[b];Oe.start=Math.floor(Date.now()-xe)}if(this.#S)Oe.size=this.#S[b];l.unshift([D,Oe])}return l}load(l){this.clear();for(let[b,D]of l){if(D.start){let te=Date.now()-D.start;D.start=io.now()-te}this.set(b,D.value,D)}}set(l,b,D={}){if(b===void 0)return this.delete(l),this;let{ttl:te=this.ttl,start:ce,noDisposeOnSet:Oe=this.noDisposeOnSet,sizeCalculation:xe=this.sizeCalculation,status:$e}=D,{noUpdateTTL:et=this.noUpdateTTL}=D,rt=this.#U(l,b,D.size||0,xe);if(this.maxEntrySize&&rt>this.maxEntrySize){if($e)$e.set="miss",$e.maxEntrySizeExceeded=!0;return this.#C(l,"set"),this}let tt=this.#r===0?void 0:this.#o.get(l);if(tt===void 0){if(tt=this.#r===0?this.#s:this.#_.length!==0?this.#_.pop():this.#r===this.#l?this.#N(!1):this.#r,this.#n[tt]=l,this.#e[tt]=b,this.#o.set(l,tt),this.#c[this.#s]=tt,this.#p[tt]=this.#s,this.#s=tt,this.#r++,this.#w(tt,rt,$e),$e)$e.set="add";et=!1}else{this.#I(tt);let ct=this.#e[tt];if(b!==ct){if(this.#R&&this.#t(ct)){ct.__abortController.abort(Error("replaced"));let{__staleWhileFetching:at}=ct;if(at!==void 0&&!Oe){if(this.#O)this.#g?.(at,l,"set");if(this.#d)this.#i?.push([at,l,"set"])}}else if(!Oe){if(this.#O)this.#g?.(ct,l,"set");if(this.#d)this.#i?.push([ct,l,"set"])}if(this.#L(tt),this.#w(tt,rt,$e),this.#e[tt]=b,$e){$e.set="replace";let at=ct&&this.#t(ct)?ct.__staleWhileFetching:ct;if(at!==void 0)$e.oldValue=at}}else if($e)$e.set="update"}if(te!==0&&!this.#f)this.#k();if(this.#f){if(!et)this.#M(tt,te,ce);if($e)this.#T($e,tt)}if(!Oe&&this.#d&&this.#i){let ct=this.#i,at;while(at=ct?.shift())this.#h?.(...at)}return this}pop(){try{while(this.#r){let l=this.#e[this.#a];if(this.#N(!0),this.#t(l)){if(l.__staleWhileFetching)return l.__staleWhileFetching}else if(l!==void 0)return l}}finally{if(this.#d&&this.#i){let l=this.#i,b;while(b=l?.shift())this.#h?.(...b)}}}#N(l){let b=this.#a,D=this.#n[b],te=this.#e[b];if(this.#R&&this.#t(te))te.__abortController.abort(Error("evicted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(te,D,"evict");if(this.#d)this.#i?.push([te,D,"evict"])}if(this.#L(b),l)this.#n[b]=void 0,this.#e[b]=void 0,this.#_.push(b);if(this.#r===1)this.#a=this.#s=0,this.#_.length=0;else this.#a=this.#c[b];return this.#o.delete(D),this.#r--,b}has(l,b={}){let{updateAgeOnHas:D=this.updateAgeOnHas,status:te}=b,ce=this.#o.get(l);if(ce!==void 0){let Oe=this.#e[ce];if(this.#t(Oe)&&Oe.__staleWhileFetching===void 0)return!1;if(!this.#m(ce)){if(D)this.#D(ce);if(te)te.has="hit",this.#T(te,ce);return!0}else if(te)te.has="stale",this.#T(te,ce)}else if(te)te.has="miss";return!1}peek(l,b={}){let{allowStale:D=this.allowStale}=b,te=this.#o.get(l);if(te===void 0||!D&&this.#m(te))return;let ce=this.#e[te];return this.#t(ce)?ce.__staleWhileFetching:ce}#v(l,b,D,te){let ce=b===void 0?void 0:this.#e[b];if(this.#t(ce))return ce;let Oe=new gr,{signal:xe}=D;xe?.addEventListener("abort",()=>Oe.abort(xe.reason),{signal:Oe.signal});let $e={signal:Oe.signal,options:D,context:te},et=(ht,Dt=!1)=>{let{aborted:St}=Oe.signal,Pt=D.ignoreFetchAbort&&ht!==void 0;if(D.status)if(St&&!Dt){if(D.status.fetchAborted=!0,D.status.fetchError=Oe.signal.reason,Pt)D.status.fetchAbortIgnored=!0}else D.status.fetchResolved=!0;if(St&&!Pt&&!Dt)return tt(Oe.signal.reason);let wt=at;if(this.#e[b]===at)if(ht===void 0)if(wt.__staleWhileFetching)this.#e[b]=wt.__staleWhileFetching;else this.#C(l,"fetch");else{if(D.status)D.status.fetchUpdated=!0;this.set(l,ht,$e.options)}return ht},rt=(ht)=>{if(D.status)D.status.fetchRejected=!0,D.status.fetchError=ht;return tt(ht)},tt=(ht)=>{let{aborted:Dt}=Oe.signal,St=Dt&&D.allowStaleOnFetchAbort,Pt=St||D.allowStaleOnFetchRejection,wt=Pt||D.noDeleteOnFetchRejection,It=at;if(this.#e[b]===at){if(!wt||It.__staleWhileFetching===void 0)this.#C(l,"fetch");else if(!St)this.#e[b]=It.__staleWhileFetching}if(Pt){if(D.status&&It.__staleWhileFetching!==void 0)D.status.returnedStale=!0;return It.__staleWhileFetching}else if(It.__returned===It)throw ht},ct=(ht,Dt)=>{let St=this.#P?.(l,ce,$e);if(St&&St instanceof Promise)St.then((Pt)=>ht(Pt===void 0?void 0:Pt),Dt);Oe.signal.addEventListener("abort",()=>{if(!D.ignoreFetchAbort||D.allowStaleOnFetchAbort){if(ht(void 0),D.allowStaleOnFetchAbort)ht=(Pt)=>et(Pt,!0)}})};if(D.status)D.status.fetchDispatched=!0;let at=new Promise(ct).then(et,rt),gt=Object.assign(at,{__abortController:Oe,__staleWhileFetching:ce,__returned:void 0});if(b===void 0)this.set(l,gt,{...$e.options,status:void 0}),b=this.#o.get(l);else this.#e[b]=gt;return gt}#t(l){if(!this.#R)return!1;let b=l;return!!b&&b instanceof Promise&&b.hasOwnProperty("__staleWhileFetching")&&b.__abortController instanceof gr}async fetch(l,b={}){let{allowStale:D=this.allowStale,updateAgeOnGet:te=this.updateAgeOnGet,noDeleteOnStaleGet:ce=this.noDeleteOnStaleGet,ttl:Oe=this.ttl,noDisposeOnSet:xe=this.noDisposeOnSet,size:$e=0,sizeCalculation:et=this.sizeCalculation,noUpdateTTL:rt=this.noUpdateTTL,noDeleteOnFetchRejection:tt=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:ct=this.allowStaleOnFetchRejection,ignoreFetchAbort:at=this.ignoreFetchAbort,allowStaleOnFetchAbort:gt=this.allowStaleOnFetchAbort,context:ht,forceRefresh:Dt=!1,status:St,signal:Pt}=b;if(!this.#R){if(St)St.fetch="get";return this.get(l,{allowStale:D,updateAgeOnGet:te,noDeleteOnStaleGet:ce,status:St})}let wt={allowStale:D,updateAgeOnGet:te,noDeleteOnStaleGet:ce,ttl:Oe,noDisposeOnSet:xe,size:$e,sizeCalculation:et,noUpdateTTL:rt,noDeleteOnFetchRejection:tt,allowStaleOnFetchRejection:ct,allowStaleOnFetchAbort:gt,ignoreFetchAbort:at,status:St,signal:Pt},It=this.#o.get(l);if(It===void 0){if(St)St.fetch="miss";let Nt=this.#v(l,It,wt,ht);return Nt.__returned=Nt}else{let Nt=this.#e[It];if(this.#t(Nt)){let jt=D&&Nt.__staleWhileFetching!==void 0;if(St){if(St.fetch="inflight",jt)St.returnedStale=!0}return jt?Nt.__staleWhileFetching:Nt.__returned=Nt}let Gt=this.#m(It);if(!Dt&&!Gt){if(St)St.fetch="hit";if(this.#I(It),te)this.#D(It);if(St)this.#T(St,It);return Nt}let rn=this.#v(l,It,wt,ht),_n=rn.__staleWhileFetching!==void 0&&D;if(St){if(St.fetch=Gt?"stale":"refresh",_n&&Gt)St.returnedStale=!0}return _n?rn.__staleWhileFetching:rn.__returned=rn}}async forceFetch(l,b={}){let D=await this.fetch(l,b);if(D===void 0)throw Error("fetch() returned undefined");return D}memo(l,b={}){let D=this.#x;if(!D)throw Error("no memoMethod provided to constructor");let{context:te,forceRefresh:ce,...Oe}=b,xe=this.get(l,Oe);if(!ce&&xe!==void 0)return xe;let $e=D(l,xe,{options:Oe,context:te});return this.set(l,$e,Oe),$e}get(l,b={}){let{allowStale:D=this.allowStale,updateAgeOnGet:te=this.updateAgeOnGet,noDeleteOnStaleGet:ce=this.noDeleteOnStaleGet,status:Oe}=b,xe=this.#o.get(l);if(xe!==void 0){let $e=this.#e[xe],et=this.#t($e);if(Oe)this.#T(Oe,xe);if(this.#m(xe)){if(Oe)Oe.get="stale";if(!et){if(!ce)this.#C(l,"expire");if(Oe&&D)Oe.returnedStale=!0;return D?$e:void 0}else{if(Oe&&D&&$e.__staleWhileFetching!==void 0)Oe.returnedStale=!0;return D?$e.__staleWhileFetching:void 0}}else{if(Oe)Oe.get="hit";if(et)return $e.__staleWhileFetching;if(this.#I(xe),te)this.#D(xe);return $e}}else if(Oe)Oe.get="miss"}#z(l,b){this.#p[b]=l,this.#c[l]=b}#I(l){if(l!==this.#s){if(l===this.#a)this.#a=this.#c[l];else this.#z(this.#p[l],this.#c[l]);this.#z(this.#s,l),this.#s=l}}delete(l){return this.#C(l,"delete")}#C(l,b){let D=!1;if(this.#r!==0){let te=this.#o.get(l);if(te!==void 0)if(D=!0,this.#r===1)this.#F(b);else{this.#L(te);let ce=this.#e[te];if(this.#t(ce))ce.__abortController.abort(Error("deleted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(ce,l,b);if(this.#d)this.#i?.push([ce,l,b])}if(this.#o.delete(l),this.#n[te]=void 0,this.#e[te]=void 0,te===this.#s)this.#s=this.#p[te];else if(te===this.#a)this.#a=this.#c[te];else{let Oe=this.#p[te];this.#c[Oe]=this.#c[te];let xe=this.#c[te];this.#p[xe]=this.#p[te]}this.#r--,this.#_.push(te)}}if(this.#d&&this.#i?.length){let te=this.#i,ce;while(ce=te?.shift())this.#h?.(...ce)}return D}clear(){return this.#F("delete")}#F(l){for(let b of this.#b({allowStale:!0})){let D=this.#e[b];if(this.#t(D))D.__abortController.abort(Error("deleted"));else{let te=this.#n[b];if(this.#O)this.#g?.(D,te,l);if(this.#d)this.#i?.push([D,te,l])}}if(this.#o.clear(),this.#e.fill(void 0),this.#n.fill(void 0),this.#f&&this.#y)this.#f.fill(0),this.#y.fill(0);if(this.#S)this.#S.fill(0);if(this.#a=0,this.#s=0,this.#_.length=0,this.#E=0,this.#r=0,this.#d&&this.#i){let b=this.#i,D;while(D=b?.shift())this.#h?.(...D)}}}function Er(l,b,D=100){let te=new hr({max:D}),ce=(...Oe)=>{let xe=b(...Oe),$e=te.get(xe);if($e!==void 0)return $e;let et=l(...Oe);return te.set(xe,et),et};return ce.cache={clear:()=>te.clear(),size:()=>te.size,delete:(Oe)=>te.delete(Oe),get:(Oe)=>te.peek(Oe),has:(Oe)=>te.has(Oe),set:(Oe,xe)=>void te.set(Oe,xe)},ce}var jv=8192;function dl(l,b){try{return{ok:!0,value:JSON.parse(le(l))}}catch(D){if(b)qe(lt(D,`safeParseJSON: invalid JSON (${D instanceof Error?D.constructor.name:typeof D}, ${l.length} bytes)`));return{ok:!1}}}class ul{cached=Er(dl,(l)=>l,50);cache=this.cached.cache;parse(l,b){return this.cached(l,b)}}var cl=new ul;var kn=Object.assign(function(b,D=!0){if(!b)return null;let te=b.length>jv?dl(b,D):cl.parse(b,D);return te.ok?te.value:null},{cache:cl.cache});import{join as Wv}from"path";class pl{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=Vv(),this.managedFilePath}getDropInDir(){return this.dropInDir??=Wv(Mn(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var $v=new pl;function Mn(){return $v.getManagedFilePath()}function Vv(){let l=Kv();if(l!==void 0)return l;switch(O()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function Kv(){return}var wo=["low","medium","high","xhigh","max"];var Dn=mt(()=>[{path:["allowManagedPermissionRulesOnly"],restrictive:!0},{path:["allowManagedHooksOnly"],restrictive:!0},{path:["allowManagedMcpServersOnly"],restrictive:!0},{path:["enforceAvailableModels"],restrictive:!0},{path:["disableAllHooks"],restrictive:!0},{path:["disableClaudeAiConnectors"],restrictive:!0},{path:["disableCommandPluginSources"],restrictive:!0},{path:["disableSideloadFlags"],restrictive:!0},{path:["disableSkillShellExecution"],restrictive:!0},{path:["disableRemoteControl"],restrictive:!0},{path:["disableAgentView"],restrictive:!0},{path:["disableWorkflows"],restrictive:!0},{path:["disableArtifact"],restrictive:!0},{path:["disableBundledSkills"],restrictive:!0},{path:["fastModePerSessionOptIn"],restrictive:!0},{path:["isolatePeerMachines"],restrictive:!0},{path:["strictPluginOnlyCustomization"],restrictive:!0},{path:["disableAutoMode"],restrictive:"disable"},{path:["disableDeepLinkRegistration"],restrictive:"disable"},{path:["permissions","disableBypassPermissionsMode"],restrictive:"disable"},{path:["permissions","disableAutoMode"],restrictive:"disable"},{path:["permissions","blockReadsOutsideWorkingDirectories"],restrictive:!0},{path:["autoMode","classifyAllShell"],restrictive:!0},...[],{path:["worktree","bgIsolation"],restrictive:"worktree"},{path:["enableArtifact"],restrictive:!1},{path:["enableWorkflows"],restrictive:!1},{path:["syncClaudeAiSkills"],restrictive:!1},{path:["syncClaudeAiPlugins"],restrictive:!1},{path:["useAutoModeDuringPlan"],restrictive:!1},{path:["skipDangerousModePermissionPrompt"],restrictive:!1},{path:["skipAutoPermissionPrompt"],restrictive:!1},{path:["enableAllProjectMcpServers"],restrictive:!1},{path:["channelsEnabled"],restrictive:!1},{path:["skipWebFetchPreflight"],restrictive:!1},{path:["skipWorkflowUsageWarning"],restrictive:!1},{path:["autoUploadSessions"],restrictive:!1},{path:["remoteControlAtStartup"],restrictive:!1},{path:["remoteTools","allowUnattendedServing"],restrictive:!1},{path:["autoContinueAtUsageLimit"],restrictive:!1},...[],{path:["attribution","sessionUrl"],restrictive:!1},{path:["crossSessionInbound"],restrictive:["refuse","hold"]},{path:["remoteControl","shareHostProfile"],restrictive:["off","basic"]},{path:["modelProposedGoals"],restrictive:["disabled","alwaysAsk"]},{path:["maxEffortLevel"],restrictive:wo},{path:["feedbackDrafts"],restrictive:"off"},{path:["availableModelsMatch"],restrictive:"exact"},{path:["askUserQuestionTimeout"],restrictive:"never"},{path:["dialogExpiry"],restrictive:"never"},{path:["sandbox","enabled"],restrictive:!0},{path:["sandbox","failIfUnavailable"],restrictive:!0},{path:["sandbox","autoAllowBashIfSandboxed"],restrictive:!1},{path:["sandbox","allowUnsandboxedCommands"],restrictive:!1},{path:["sandbox","enableWeakerNestedSandbox"],restrictive:!1},{path:["sandbox","enableWeakerNetworkIsolation"],restrictive:!1},{path:["sandbox","allowAppleEvents"],restrictive:!1},{path:["sandbox","network","allowManagedDomainsOnly"],restrictive:!0},{path:["sandbox","network","strictAllowlist"],restrictive:!0},{path:["sandbox","network","allowAllUnixSockets"],restrictive:!1},{path:["sandbox","network","allowLocalBinding"],restrictive:!1},{path:["sandbox","filesystem","allowManagedReadPathsOnly"],restrictive:!0},{path:["sandbox","filesystem","disabled"],restrictive:!1},{path:["sandbox","credentials","allowPlaintextInject"],restrictive:!1},{path:["sandbox","credentials","sigv4","streaming"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","presigned"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","sigv4a"],restrictive:"deny"},{path:["isolation","required"],restrictive:!0},{path:["isolation","persistHome"],restrictive:!1}]);function Un(l){return Array.isArray(l)?l:[l]}function cn(l,b){let D=l;for(let te of b){if(D===null||typeof D!=="object")return;D=D[te]}return D}function An(l,b,D){let te=[l],ce=l;for(let xe of b.slice(0,-1)){let $e={...ce[xe]};ce[xe]=$e,ce=$e,te.push(ce)}let Oe=b.at(-1);if(D!==void 0){ce[Oe]=D;return}delete ce[Oe];for(let xe=te.length-1;xe>0;xe--){if(Object.keys(te[xe]).length>0)break;delete te[xe-1][b[xe-1]]}}function _r(l,b){let D=cn(b,l.path);return l.normalize===void 0?D:l.normalize(D)}function Yv(l,b,D){if(D!==void 0&&!L(l[b],D)||D===void 0&&!(b in l))X(l,b,D)}var No=Yv;var yr={};P(yr,{default:()=>vo});var hl=typeof yr=="object"&&yr&&!yr.nodeType&&yr,fl=hl&&typeof Sr=="object"&&Sr&&!Sr.nodeType&&Sr,Xv=fl&&fl.exports===hl,ml=Xv?h.Buffer:void 0,gl=ml?ml.allocUnsafe:void 0;function Jv(l,b){if(b)return l.slice();var D=l.length,te=gl?gl(D):new l.constructor(D);return l.copy(te),te}var vo=Jv;function Zv(l){var b=new l.constructor(l.byteLength);return new pe(b).set(new pe(l)),b}var lo=Zv;function qv(l,b){var D=b?lo(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.length)}var Or=qv;function Qv(l,b){var D=-1,te=l.length;b||(b=Array(te));while(++D<te)b[D]=l[D];return b}var Ar=Qv;var El=Object.create,ek=function(){function l(){}return function(b){if(!g(b))return{};if(El)return El(b);l.prototype=b;var D=new l;return l.prototype=void 0,D}}(),_l=ek;function tk(l){return typeof l.constructor=="function"&&!Se(l)?_l(to(l)):{}}var br=tk;function nk(l){return S(l)&&q(l)}var Sl=nk;var ok="[object Object]",rk=Function.prototype,sk=Object.prototype,yl=rk.toString,ik=sk.hasOwnProperty,ak=yl.call(Object);function lk(l){if(!S(l)||T(l)!=ok)return!1;var b=to(l);if(b===null)return!0;var D=ik.call(b,"constructor")&&b.constructor;return typeof D=="function"&&D instanceof D&&yl.call(D)==ak}var Cr=lk;function ck(l,b){if(b==="constructor"&&typeof l[b]==="function")return;if(b=="__proto__")return;return l[b]}var ko=ck;function dk(l,b,D,te){var ce=!D;D||(D={});var Oe=-1,xe=b.length;while(++Oe<xe){var $e=b[Oe],et=te?te(D[$e],l[$e],$e,D,l):void 0;if(et===void 0)et=l[$e];if(ce)X(D,$e,et);else eo(D,$e,et)}return D}var tn=dk;function uk(l){return tn(l,mn(l))}var Ol=uk;function pk(l,b,D,te,ce,Oe,xe){var $e=ko(l,D),et=ko(b,D),rt=xe.get(et);if(rt){No(l,D,rt);return}var tt=Oe?Oe($e,et,D+"",l,b,xe):void 0,ct=tt===void 0;if(ct){var at=d(et),gt=!at&&N(et),ht=!at&&!gt&&he(et);if(tt=et,at||gt||ht)if(d($e))tt=$e;else if(Sl($e))tt=Ar($e);else if(gt)ct=!1,tt=vo(et,!0);else if(ht)ct=!1,tt=Or(et,!0);else tt=[];else if(Cr(et)||K(et)){if(tt=$e,K($e))tt=Ol($e);else if(!g($e)||de($e))tt=br(et)}else ct=!1}if(ct)xe.set(et,tt),ce(tt,et,te,Oe,xe),xe.delete(et);No(l,D,tt)}var Al=pk;function bl(l,b,D,te,ce){if(l===b)return;Be(b,function(Oe,xe){if(ce||(ce=new M),g(Oe))Al(l,b,xe,D,bl,te,ce);else{var $e=te?te(ko(l,xe),Oe,xe+"",l,b,ce):void 0;if($e===void 0)$e=Oe;No(l,xe,$e)}},mn)}var Cl=bl;function fk(l,b,D){switch(D.length){case 0:return l.call(b);case 1:return l.call(b,D[0]);case 2:return l.call(b,D[0],D[1]);case 3:return l.call(b,D[0],D[1],D[2])}return l.apply(b,D)}var Tl=fk;var Rl=Math.max;function mk(l,b,D){return b=Rl(b===void 0?l.length-1:b,0),function(){var te=arguments,ce=-1,Oe=Rl(te.length-b,0),xe=Array(Oe);while(++ce<Oe)xe[ce]=te[b+ce];ce=-1;var $e=Array(b+1);while(++ce<b)$e[ce]=te[ce];return $e[b]=D(xe),Tl(l,this,$e)}}var Tr=mk;function gk(l){return function(){return l}}var Dl=gk;var hk=!Ee?be:function(l,b){return Ee(l,"toString",{configurable:!0,enumerable:!1,value:Dl(b),writable:!0})},Ll=hk;var Ek=800,_k=16,Sk=Date.now;function yk(l){var b=0,D=0;return function(){var te=Sk(),ce=_k-(te-D);if(D=te,ce>0){if(++b>=Ek)return arguments[0]}else b=0;return l.apply(void 0,arguments)}}var Il=yk;var Ok=Il(Ll),Rr=Ok;function Ak(l,b){return Rr(Tr(l,b,be),l+"")}var Pl=Ak;function bk(l,b,D){if(!g(D))return!1;var te=typeof b;if(te=="number"?q(D)&&Y(b,D.length):te=="string"&&(b in D))return L(D[b],l);return!1}var xl=bk;function Ck(l){return Pl(function(b,D){var te=-1,ce=D.length,Oe=ce>1?D[ce-1]:void 0,xe=ce>2?D[2]:void 0;if(Oe=l.length>3&&typeof Oe=="function"?(ce--,Oe):void 0,xe&&xl(D[0],D[1],xe))Oe=ce<3?void 0:Oe,ce=1;b=Object(b);while(++te<ce){var $e=D[te];if($e)l(b,$e,te,Oe)}return b})}var wl=Ck;var Tk=wl(function(l,b,D,te){Cl(l,b,D,te)}),Xt=Tk;function Rk(l,b){var D=-1,te=l==null?0:l.length;while(++D<te)if(b(l[D],D,l)===!1)break;return l}var Nl=Rk;function Dk(l,b){return l&&tn(b,F(b),l)}var vl=Dk;function Lk(l,b){return l&&tn(b,mn(b),l)}var kl=Lk;function Ik(l,b){return tn(l,ge(l),b)}var Ml=Ik;function Pk(l,b){return tn(l,pr(l),b)}var Ul=Pk;var xk=Object.prototype,wk=xk.hasOwnProperty;function Nk(l){var b=l.length,D=new l.constructor(b);if(b&&typeof l[0]=="string"&&wk.call(l,"index"))D.index=l.index,D.input=l.input;return D}var Hl=Nk;function vk(l,b){var D=b?lo(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.byteLength)}var zl=vk;var kk=/\w*$/;function Mk(l){var b=new l.constructor(l.source,kk.exec(l));return b.lastIndex=l.lastIndex,b}var Fl=Mk;var Bl=E?E.prototype:void 0,Gl=Bl?Bl.valueOf:void 0;function Uk(l){return Gl?Object(Gl.call(l)):{}}var jl=Uk;var Hk="[object Boolean]",zk="[object Date]",Fk="[object Map]",Bk="[object Number]",Gk="[object RegExp]",jk="[object Set]",Wk="[object String]",$k="[object Symbol]",Vk="[object ArrayBuffer]",Kk="[object DataView]",Yk="[object Float32Array]",Xk="[object Float64Array]",Jk="[object Int8Array]",Zk="[object Int16Array]",qk="[object Int32Array]",Qk="[object Uint8Array]",eM="[object Uint8ClampedArray]",tM="[object Uint16Array]",nM="[object Uint32Array]";function oM(l,b,D){var te=l.constructor;switch(b){case Vk:return lo(l);case Hk:case zk:return new te(+l);case Kk:return zl(l,D);case Yk:case Xk:case Jk:case Zk:case qk:case Qk:case eM:case tM:case nM:return Or(l,D);case Fk:return new te;case Bk:case Wk:return new te(l);case Gk:return Fl(l);case jk:return new te;case $k:return jl(l)}}var Wl=oM;var rM="[object Map]";function sM(l){return S(l)&&j(l)==rM}var $l=sM;var Vl=U&&U.isMap,iM=Vl?me(Vl):$l,Kl=iM;var aM="[object Set]";function lM(l){return S(l)&&j(l)==aM}var Yl=lM;var Xl=U&&U.isSet,cM=Xl?me(Xl):Yl,Jl=cM;var dM=1,uM=2,pM=4,Zl="[object Arguments]",fM="[object Array]",mM="[object Boolean]",gM="[object Date]",hM="[object Error]",ql="[object Function]",EM="[object GeneratorFunction]",_M="[object Map]",SM="[object Number]",Ql="[object Object]",yM="[object RegExp]",OM="[object Set]",AM="[object String]",bM="[object Symbol]",CM="[object WeakMap]",TM="[object ArrayBuffer]",RM="[object DataView]",DM="[object Float32Array]",LM="[object Float64Array]",IM="[object Int8Array]",PM="[object Int16Array]",xM="[object Int32Array]",wM="[object Uint8Array]",NM="[object Uint8ClampedArray]",vM="[object Uint16Array]",kM="[object Uint32Array]",zt={};zt[Zl]=zt[fM]=zt[TM]=zt[RM]=zt[mM]=zt[gM]=zt[DM]=zt[LM]=zt[IM]=zt[PM]=zt[xM]=zt[_M]=zt[SM]=zt[Ql]=zt[yM]=zt[OM]=zt[AM]=zt[bM]=zt[wM]=zt[NM]=zt[vM]=zt[kM]=!0;zt[hM]=zt[ql]=zt[CM]=!1;function Dr(l,b,D,te,ce,Oe){var xe,$e=b&dM,et=b&uM,rt=b&pM;if(D)xe=ce?D(l,te,ce,Oe):D(l);if(xe!==void 0)return xe;if(!g(l))return l;var tt=d(l);if(tt){if(xe=Hl(l),!$e)return Ar(l,xe)}else{var ct=j(l),at=ct==ql||ct==EM;if(N(l))return vo(l,$e);if(ct==Ql||ct==Zl||at&&!ce){if(xe=et||at?{}:br(l),!$e)return et?Ul(l,kl(xe,l)):Ml(l,vl(xe,l))}else{if(!zt[ct])return ce?l:{};xe=Wl(l,ct,$e)}}Oe||(Oe=new M);var gt=Oe.get(l);if(gt)return gt;if(Oe.set(l,xe),Jl(l))l.forEach(function(St){xe.add(Dr(St,b,D,St,l,Oe))});else if(Kl(l))l.forEach(function(St,Pt){xe.set(Pt,Dr(St,b,D,Pt,l,Oe))});var ht=rt?et?no:Te:et?mn:F,Dt=tt?void 0:ht(l);return Nl(Dt||l,function(St,Pt){if(Dt)Pt=St,St=l[Pt];eo(xe,Pt,Dr(St,b,D,Pt,l,Oe))}),xe}var ec=Dr;function MM(l){var b=l==null?0:l.length;return b?l[b-1]:void 0}var tc=MM;function UM(l,b,D){var te=-1,ce=l.length;if(b<0)b=-b>ce?0:ce+b;if(D=D>ce?ce:D,D<0)D+=ce;ce=b>D?0:D-b>>>0,b>>>=0;var Oe=Array(ce);while(++te<ce)Oe[te]=l[te+b];return Oe}var nc=UM;function HM(l,b){return b.length<2?l:J(l,nc(b,0,-1))}var oc=HM;var zM=Object.prototype,FM=zM.hasOwnProperty;function BM(l,b){b=k(b,l);var D=-1,te=b.length;if(!te)return!0;while(++D<te){var ce=x(b[D]);if(ce==="__proto__"&&!FM.call(l,"__proto__"))return!1;if((ce==="constructor"||ce==="prototype")&&D<te-1)return!1}var Oe=oc(l,b);return Oe==null||delete Oe[x(tc(b))]}var Lr=BM;function GM(l){return Cr(l)?void 0:l}var rc=GM;var sc=E?E.isConcatSpreadable:void 0;function jM(l){return d(l)||K(l)||!!(sc&&l&&l[sc])}var ic=jM;function ac(l,b,D,te,ce){var Oe=-1,xe=l.length;D||(D=ic),ce||(ce=[]);while(++Oe<xe){var $e=l[Oe];if(b>0&&D($e))if(b>1)ac($e,b-1,D,te,ce);else fe(ce,$e);else if(!te)ce[ce.length]=$e}return ce}var lc=ac;function WM(l){var b=l==null?0:l.length;return b?lc(l,1):[]}var cc=WM;function $M(l){return Rr(Tr(l,void 0,cc),l+"")}var Ir=$M;var VM=1,KM=2,YM=4,XM=Ir(function(l,b){var D={};if(l==null)return D;var te=!1;if(b=ye(b,function(Oe){return Oe=k(Oe,l),te||(te=Oe.length>1),Oe}),tn(l,no(l),D),te)D=ec(D,VM|KM|YM,rc);var ce=b.length;while(ce--)Lr(D,b[ce]);return D}),Mo=XM;function JM(l,b){return ur(l,b,function(D,te){return Ke(l,te)})}var dc=JM;var ZM=Ir(function(l,b){return l==null?{}:dc(l,b)}),co=ZM;function qM(l,b){return l==null?!0:Lr(l,b)}var uc=qM;import{homedir as f0}from"os";import{basename as m0,dirname as da,join as on,resolve as $t}from"path";var QM="Expected a function";function eU(l){if(typeof l!="function")throw TypeError(QM);return function(){var b=arguments;switch(b.length){case 0:return!l.call(this);case 1:return!l.call(this,b[0]);case 2:return!l.call(this,b[0],b[1]);case 3:return!l.call(this,b[0],b[1],b[2])}return!l.apply(this,b)}}var pc=eU;function tU(l,b){return fr(l,pc(Z(b)))}var Hn=tU;import{join as tp}from"path";var fc={cli:!0,mcp:!0,"sdk-cli":!0,"sdk-ts":!0,"sdk-py":!0,bench:!0,"claude-vscode":!0,"claude-code-github-action":!0,"local-agent":!0,local_agent:!0,"claude-desktop":!0,remote:!0,remote_baku:!0,remote_cowork:!0,remote_trigger:!0,remote_cowork_trigger:!0,remote_desktop:!0,remote_mobile:!0,remote_projects:!0,claude_in_slack:!0,"claude-in-slack":!0,"claude-in-teams":!0,"claude-desktop-3p":!0,"claude-security":!0,"ssh-remote":!0,"claude-coworker":!0,"claude-coworker-terminal":!0};var DY=new Set(Object.keys(fc));var oU=new Set(["claude-desktop-3p","local-agent"]);function Fs(){let l=On.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&oU.has(l)}function Pr(){return!1}class mc{entrypoint=void 0;interactive=!1;spawnedByAttendedSession=void 0;childSession=!1;claudecode=!1;coworkFrameArtifacts=!1;hostScheduledRun=!1;setEntrypoint(l){this.entrypoint=l}setInteractive(l){this.interactive=l}setSpawnedByAttendedSession(l){this.spawnedByAttendedSession=l}setChildSession(l){this.childSession=l}setClaudecode(l){this.claudecode=l}setCoworkFrameArtifacts(l){this.coworkFrameArtifacts=l}setHostScheduledRun(l){this.hostScheduledRun=l}}var LY=new i(()=>new mc);import{isAbsolute as gc}from"path";import*as bt from"zod/v4";var rU="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true, values from project settings (.claude/settings.json and .claude/settings.local.json) are ignored.",sU=mt(()=>bt.object({allowedDomains:bt.array(bt.string()).optional(),deniedDomains:bt.array(bt.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),strictAllowlist:bt.boolean().optional().describe("When true, the sandbox runtime deterministically denies hosts not in allowedDomains instead of prompting. "+"Enforced for sandboxed commands only — in-process tools such as WebFetch are not gated by this setting. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),allowManagedDomainsOnly:bt.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:bt.array(bt.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:bt.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:bt.boolean().optional(),allowMachLookup:bt.array(bt.string().refine((l)=>!(l.endsWith("*")?l.slice(0,-1):l).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:bt.number().optional(),socksProxyPort:bt.number().optional(),tlsTerminate:bt.object({caCertPath:bt.string().min(1).optional(),caKeyPath:bt.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. On native Windows an ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a persistent CA managed by the sandbox runtime (set up and trusted via /sandbox install); configured paths are passed to the sandbox runtime verbatim, which rejects a bad or incomplete pair at sandbox initialization. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings "+"(.claude/settings.json and .claude/settings.local.json) are ignored.")}).optional()),iU=mt(()=>bt.object({allowWrite:bt.array(bt.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:bt.array(bt.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:bt.array(bt.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:bt.array(bt.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:bt.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:bt.boolean().optional().describe("macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would "+"withhold every access grant rather than loosen them — filesystem isolation stays on there. "+"Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files deny entries for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.files mask entries (sentinel binds) and credentials.envVars deny/mask are unaffected. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable file. (sandbox.credentials.envVars and credentials.files mask entries "+"do not pin it — env scrubbing and sentinel binds are independent of the filesystem "+"layer and survive this setting.) When unset, filesystem isolation stays on.")}).optional());function hc(l,b,D){if(l.length===0||l.some((te)=>te.length===0))D.addIssue({code:bt.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(b===void 0)D.addIssue({code:bt.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims requires decode — without a decode format there is no token to read claims from. Set decode, or omit maskClaims."})}function Ec(l,b){let D;try{D=new RegExp(l)}catch(ce){b.addIssue({code:bt.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${R(ce)}`});return}if(new RegExp(D.source+"|").exec("").length-1<1)b.addIssue({code:bt.ZodIssueCode.custom,path:["extract"],message:"extract must contain at least one capturing group — "+'group 1 is the credential value to mask (e.g. "token:\\s*(\\S+)").'})}function _c(l){if(typeof l!=="object"||l===null)return l;let b=l;if(b.mode!=="deny")return l;let D={...b};if("extract"in D&&typeof D.extract!=="string")delete D.extract;if("onExtractNoMatch"in D&&D.onExtractNoMatch!=="warn"&&D.onExtractNoMatch!=="deny"&&D.onExtractNoMatch!=="error")delete D.onExtractNoMatch;if("decode"in D&&D.decode!=="jwt")delete D.decode;if("maskClaims"in D&&!(Array.isArray(D.maskClaims)&&D.maskClaims.every((te)=>typeof te==="string")))delete D.maskClaims;if("maskDuplicates"in D&&typeof D.maskDuplicates!=="boolean")delete D.maskDuplicates;if("injectHosts"in D&&!(Array.isArray(D.injectHosts)&&D.injectHosts.every((te)=>typeof te==="string")))delete D.injectHosts;return D}var xr=mt(()=>bt.preprocess(_c,bt.object({path:bt.string().min(1).describe("Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings)."),mode:bt.enum(["deny","mask"]).describe("Access mode for this path. `deny` blocks reads inside the sandbox; `mask` shows sandboxed commands a sentinel-substituted copy (whole-file, or only the spans captured by `extract`) and the "+"host proxy swaps sentinel→real on egress to `injectHosts`. "+"On macOS and Windows `mask` currently degrades to `deny`."),extract:bt.string().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the file; capture group 1 of each match is a credential value, and only those captured spans are replaced "+"with sentinels — the rest of the file is preserved so a tool "+"that parses it (.netrc, JSON, YAML) still succeeds. Without `extract`, the entire file content is replaced with one sentinel (whole-file masking, suited to single-secret files). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),onExtractNoMatch:bt.enum(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the file — or, "+"with `decode`, when no candidate survives verification. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to "+"mode `deny` so the file is unreadable (fail-closed) — under "+"`sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),decode:bt.enum(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: candidates are located with a built-in JWT regex (or the explicit `extract` pattern, if set), verified to actually be JWTs before masking, and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working. If no candidate verifies, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),maskClaims:bt.array(bt.string()).optional().describe("Names of top-level payload claims to mask inside each decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so a tool that decodes the token and reads a non-secret claim keeps working. Requires `decode`. If no named claim matches in any verified token, behavior is governed by `onExtractNoMatch` (default `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),maskDuplicates:bt.boolean().optional().describe("If true, verbatim occurrences of each captured credential value outside the regex-matched spans are also replaced with the "+"corresponding sentinel — for a secret repeated where the regex "+"does not reach (e.g. pasted into a comment). Matches raw substrings, so short or common values may corrupt unrelated content; intended for long, high-entropy secrets. Defaults to false. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),injectHosts:bt.array(bt.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((l,b)=>{if(l.mode==="mask"&&l.path.endsWith("/"))b.addIssue({code:bt.ZodIssueCode.custom,path:["path"],message:'Credential mode "mask" applies to a single file, not a directory. List the specific credential file(s), or use "deny" for the directory.'});if(l.mode==="mask"&&l.extract!==void 0)Ec(l.extract,b);if(l.mode==="mask"&&l.maskClaims!==void 0)hc(l.maskClaims,l.decode,b)}))),uo=()=>bt.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores"),wr=mt(()=>bt.preprocess(_c,bt.object({name:uo().describe("Environment variable name."),mode:bt.enum(["deny","mask"]).describe("Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the "+"host proxy swaps sentinel→real on egress to `injectHosts`."),extract:bt.string().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the value; capture group 1 of each match is a credential value, and only those captured spans are "+"replaced with sentinels — the rest of the value is preserved "+"so a tool that parses it (a `DATABASE_URL` connection string, a composite `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the entire value is replaced with one sentinel (whole-value masking, suited to bare tokens). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the decode path never consults it). Accepted but ignored for `deny`."),onExtractNoMatch:bt.enum(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the value. `warn` (default) emits a stderr warning and lets the variable pass through unmasked (fail-open, for credentials that may be legitimately absent); `deny` unsets the variable inside the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set without `decode`. On a mask entry with `decode`, the runtime takes the decode path and never consults this field, so a fail-closed setting "+"cannot be honored — `deny` and `error` are rejected there; "+"only `warn` is accepted. In all other shapes the field is accepted but ignored."),decode:bt.enum(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole value is verified to actually be a JWT and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working; the proxy swaps the whole fake token on egress. If the value does not verify, the variable is left unmasked with a stderr warning "+"(fail-open). Cannot be combined with `extract` — the decode "+"path never consults it. Accepted but ignored for `deny`."),maskClaims:bt.array(bt.string()).optional().describe("Names of top-level payload claims to mask inside the decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so claim-reading clients keep working. Requires `decode`. If no named claim matches, the variable is left unmasked with a stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),injectHosts:bt.array(bt.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((l,b)=>{if(l.mode==="mask"&&l.extract!==void 0)Ec(l.extract,b);if(l.mode==="mask"&&l.maskClaims!==void 0)hc(l.maskClaims,l.decode,b);if(l.mode==="mask"&&l.decode!==void 0&&l.extract!==void 0)b.addIssue({code:bt.ZodIssueCode.custom,path:["extract"],message:"extract cannot be combined with decode on an env entry — the runtime takes the decode path (whole-value JWT verification) and never consults extract, silently disabling the structured masking. Remove one of the two."});if(l.mode==="mask"&&l.decode!==void 0&&(l.onExtractNoMatch==="deny"||l.onExtractNoMatch==="error"))b.addIssue({code:bt.ZodIssueCode.custom,path:["onExtractNoMatch"],message:"onExtractNoMatch cannot be honored on an env entry with decode — the runtime takes the decode path (which is unconditionally fail-open on verify failure) and never consults extract or onExtractNoMatch. Remove onExtractNoMatch, or drop decode to use extract-based masking (whose no-match handling does honor it)."})}))),Ln=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var Bs="_INVALID_PAIR_",Nr="_PARENT_PAIR_SUPPRESSOR_";var vr=mt(()=>bt.object({accessKeyIdVar:uo().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:uo().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:uo().optional().describe("Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.")}).superRefine((l,b)=>{let D=new Map;for(let[te,ce]of[["accessKeyIdVar",l.accessKeyIdVar],["secretAccessKeyVar",l.secretAccessKeyVar],["sessionTokenVar",l.sessionTokenVar]]){if(ce===void 0)continue;let Oe=D.get(ce);if(Oe!==void 0)b.addIssue({code:bt.ZodIssueCode.custom,path:[te],message:`${te} names the same env var ('${ce}') as ${Oe} — each pair member must be a distinct variable.`});else D.set(ce,te)}})),aU=mt(()=>{let l=bt.enum(["deny","passthrough"]);return bt.object({streaming:l.optional().describe("Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature)."),presigned:l.optional().describe("Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`."),sigv4a:l.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),lU=mt(()=>bt.object({files:bt.array(xr()).optional().describe("Credential files or directories to protect. `deny` blocks reads inside the sandbox; `mask` substitutes a sentinel inside the sandbox (whole-file, or per-`extract` capture) and injects the real value at the proxy. On macOS and Windows `mask` degrades to `deny`."),envVars:bt.array(wr()).optional().describe("Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy."),allowPlaintextInject:bt.boolean().optional().describe("Allow sentinel→real substitution on the plain-HTTP proxy path. "+"Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored."),awsPairs:bt.array(vr()).optional().describe("Explicit groupings of masked env vars into AWS credential pairs for SigV4 re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when masked. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored. A member is only usable when its env var is forwarded as a whole-value `mask` entry (an entry carrying `extract` or `decode` does not "+"qualify — re-signing needs the whole real value). A pair "+"whose key id or secret member is unusable never re-signs: it is dropped, unless it names a conventional AWS variable, in which case it is forwarded as an inert suppressor so implicit auto-pairing stays overridden. A pair whose ONLY unusable member is the session token still re-signs, without an x-amz-security-token (temporary-credential requests fail upstream until the entry is fixed)."),sigv4:aU().optional().describe("Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored.")}).superRefine((l,b)=>{let D=new Set;for(let[te,ce]of(l?.awsPairs??[]).entries()){let Oe=[["accessKeyIdVar",ce.accessKeyIdVar],["secretAccessKeyVar",ce.secretAccessKeyVar],["sessionTokenVar",ce.sessionTokenVar]],xe=new Set;for(let[$e,et]of Oe){if(et===void 0)continue;if(D.has(et))b.addIssue({code:bt.ZodIssueCode.custom,path:["awsPairs",te,$e],message:`"${et}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});xe.add(et)}for(let $e of xe)D.add($e)}}).optional()),Gs=mt(()=>bt.object({enabled:bt.boolean().optional(),failIfUnavailable:bt.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:bt.boolean().optional(),allowUnsandboxedCommands:bt.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:sU(),filesystem:iU(),credentials:lU(),ignoreViolations:bt.record(bt.string(),bt.array(bt.string())).optional(),enableWeakerNestedSandbox:bt.boolean().optional(),enableWeakerNetworkIsolation:bt.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),allowAppleEvents:bt.boolean().optional().describe("macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. "+"**Removes code-execution isolation** — sandboxed commands can launch other applications "+"unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false"),excludedCommands:bt.array(bt.string()).optional().describe("Command patterns (Bash permission-rule syntax) that always run outside the sandbox. A convenience, not a security boundary: excluded commands still go through the permission flow. Merged across settings sources. "+rU),ripgrep:bt.object({command:bt.string(),args:bt.array(bt.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),bwrapPath:bt.preprocess((l)=>typeof l==="string"&&gc(l)?l:void 0,bt.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:bt.preprocess((l)=>typeof l==="string"&&gc(l)?l:void 0,bt.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());var Sc=new Set(["disableAllHooks"]);function yc(l){let b={};for(let tt of Dn()){let{path:ct,restrictive:at}=tt;if(Sc.has(ct[0]))continue;let gt=_r(tt,l);if((typeof gt==="boolean"||typeof gt==="string")&&Un(at).includes(gt))An(b,ct,gt)}if(cn(l,["attribution"])===!1)An(b,["attribution","sessionUrl"],!1);let D=kr(l.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(D)b.permissions={...b.permissions,...D};for(let tt of cU)if(l[tt]!==void 0)b[tt]=l[tt];for(let[tt,ct]of Object.entries(l))if((tt.startsWith("disable")&&(ct===!0||ct==="disable")||tt.startsWith("enable")&&ct===!1)&&!Sc.has(tt))b[tt]=ct;if(l.disableAllHooks===!0)b.allowManagedHooksOnly=!0;if(Array.isArray(l.httpHookAllowedEnvVars)&&l.httpHookAllowedEnvVars.length===0)b.httpHookAllowedEnvVars=[];let te=kr(l.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),ce=kr(l.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),Oe=kr(l.sandbox?.credentials,["files","envVars"])??{},xe=(l.sandbox?.credentials?.awsPairs??[]).flatMap((tt)=>[tt.accessKeyIdVar,tt.secretAccessKeyVar,tt.sessionTokenVar]),$e=Ln.filter((tt)=>xe.includes(tt));if($e.length>0)Oe.awsPairs=$e.map((tt,ct)=>({accessKeyIdVar:tt,secretAccessKeyVar:`${Nr}${ct+1}_`}));let et=l.sandbox?.credentials?.sigv4;if(et){let tt={};for(let[ct,at]of Object.entries(et))if(at==="deny")tt[ct]="deny";if(Object.keys(tt).length>0)Oe.sigv4=tt}let rt=Object.keys(Oe).length>0;if(te||ce||rt){let tt=b.sandbox??{};b.sandbox={...tt,...te&&{filesystem:{...tt.filesystem,...te}},...ce&&{network:{...tt.network,...ce}},...rt&&{credentials:{...tt.credentials,...Oe}}}}return Object.keys(b).length>0?b:null}function kr(l,b){if(!l)return;let D={};for(let te of b)if(l[te]!==void 0)D[te]=l[te];return Object.keys(D).length>0?D:void 0}var cU=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels"];function Ac(l){let b=0,D=l.length;while(b<D&&Oc(l.charCodeAt(b)))b++;while(D>b&&Oc(l.charCodeAt(D-1)))D--;let te=dU(l.slice(b,D));if(te!==-1)return{kind:"line_break",index:js(l,b+te)};for(let ce=b;ce<D;ce++){let Oe=l.charCodeAt(ce);if(Oe===0)return{kind:"nul",index:js(l,ce)};if(Oe>255)return{kind:"non_ascii",index:js(l,ce),codePoint:uU(l,ce)}}return null}function dU(l){let b=l.indexOf(`
|
|
36
|
-
`),D=l.indexOf("\r");if(b===-1)return D;return D===-1?b:Math.min(b,D)}function Oc(l){return l===9||l===32||l===10||l===13}function uU(l,b){return l.codePointAt(b)??l.charCodeAt(b)}function js(l,b){let D=0;for(let te=0;te<b;te++){let ce=l.charCodeAt(te);if(ce>=55296&&ce<=56319&&te+1<l.length&&(l.charCodeAt(te+1)&64512)===56320)te++;D++}return D}var Ws=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_GATEWAY","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_AWS_WORKSPACE_ID","ANTHROPIC_GOOGLE_CLOUD_PROJECT","ANTHROPIC_GOOGLE_CLOUD_LOCATION","ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID","CLOUD_ML_REGION"],bc=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var Cc="OTEL_EXPORTER_OTLP_",Tc=["OTEL_LOG_RAW_API_BODIES","OTEL_LOG_USER_PROMPTS","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOG_MANAGED_SETTINGS","OTEL_LOGS_EXPORTER","ENABLE_BETA_TRACING_DETAILED","BETA_TRACING_ENDPOINT","ANT_OTEL_LOGS_EXPORTER"],Rc=[Cc,`ANT_${Cc}`];var Dc={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...bc,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...bc,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],gcpAuthRefresh:["CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL"]},pU=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var $s=["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL","CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL","CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL","CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL",...pU],fU=[{endpoint:"ANTHROPIC_BASE_URL",companions:["_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_BEDROCK_BASE_URL",selection:"CLAUDE_CODE_USE_BEDROCK",companions:["CLAUDE_CODE_SKIP_BEDROCK_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_VERTEX_BASE_URL",selection:"CLAUDE_CODE_USE_VERTEX",companions:["CLAUDE_CODE_SKIP_VERTEX_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_FOUNDRY_BASE_URL",selection:"CLAUDE_CODE_USE_FOUNDRY",companions:["CLAUDE_CODE_SKIP_FOUNDRY_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_AWS_BASE_URL",selection:"CLAUDE_CODE_USE_ANTHROPIC_AWS",companions:["CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_GOOGLE_CLOUD_BASE_URL",selection:"CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD",companions:["CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_BEDROCK_MANTLE_BASE_URL",selection:"CLAUDE_CODE_USE_MANTLE",companions:["CLAUDE_CODE_SKIP_MANTLE_AUTH","ANTHROPIC_CUSTOM_HEADERS"]}],BY=w(fU.flatMap((l)=>[l.endpoint,...l.companions])),Vs=["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_BEARER_TOKEN_BEDROCK","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_FOUNDRY_AUTH_TOKEN","ANTHROPIC_AWS_API_KEY"],mU=["CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH"],Ks=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT"],Ys=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],gU=["CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR","CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR"],GY=["CLAUDE_CODE_OAUTH_TOKEN",...gU,"CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_SLACK_TAG_TOKEN","CLAUDE_CODE_HFI_BEARER_TOKEN","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_TRUSTED_DEVICE_TOKEN","AGENT_PROXY_AUTH_TOKEN","CLAUDE_CODE_MCP_SERVE_AUTH_TOKEN","CLAUDE_BG_AUTH_SNAPSHOT_PATH","CLAUDE_BG_SOCKET_TOKENS_PATH","CLAUDE_BG_RV_AUTH","CLAUDE_BG_PTY_AUTH","CLAUDE_BG_CLAIM_AUTH"],hU=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],Xs=[...hU,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var Js=["AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","AWS_EC2_METADATA_SERVICE_ENDPOINT","AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_ROLE_ARN"],Zs=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],jY=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...Ws,...$s,...Vs,...mU,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...Xs,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...Zs,...Js,"AWS_REGION","AWS_DEFAULT_REGION",...Ks,"ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_BEDROCK_REGION_PREFIX","CLAUDE_CODE_CERT_STORE","DISABLE_GROWTHBOOK","CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE",...Ys]);var Lc=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],qs=["bwrapPath","ripgrep","socatPath"],Ic=["allowAppleEvents","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],Pc=["required","egress"],EU=new Set(["ANTHROPIC_BEDROCK_REGION_PREFIX","ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_AUTO_MODE","CLAUDE_CODE_ENABLE_DESIGN_SYNC","CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_GATEWAY","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_POWERSHELL_TOOL","CLAUDE_CODE_USE_VERTEX","DISABLE_AUTOUPDATER","DISABLE_BUG_COMMAND","DISABLE_COST_WARNINGS","DISABLE_FEEDBACK_COMMAND","DISABLE_GROWTHBOOK","DISABLE_INSTALLATION_CHECKS","DISABLE_UPDATES","ENABLE_TOOL_SEARCH","MAX_MCP_OUTPUT_TOKENS","MAX_THINKING_TOKENS","MCP_CONNECT_TIMEOUT_MS","MCP_TIMEOUT","MCP_TOOL_TIMEOUT","OTEL_EXPORTER_OTLP_COMPRESSION","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_LOGS_COMPRESSION","OTEL_EXPORTER_OTLP_LOGS_HEADERS","OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_COMPRESSION","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_EXPORTER_OTLP_TRACES_COMPRESSION","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_EXPORTER_OTLP_TRACES_PROTOCOL","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOG_USER_PROMPTS","OTEL_LOGS_EXPORT_INTERVAL","OTEL_LOGS_EXPORTER","OTEL_METRIC_EXPORT_INTERVAL","OTEL_METRICS_EXPORTER","OTEL_METRICS_INCLUDE_ACCOUNT_UUID","OTEL_METRICS_INCLUDE_ENTRYPOINT","OTEL_METRICS_INCLUDE_REPOSITORY","OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES","OTEL_METRICS_INCLUDE_SESSION_ID","OTEL_METRICS_INCLUDE_VERSION","OTEL_RESOURCE_ATTRIBUTES","OTEL_SERVICE_NAME","OTEL_TRACES_EXPORT_INTERVAL","OTEL_TRACES_EXPORTER","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_4_5_OPUS","VERTEX_REGION_CLAUDE_4_6_OPUS","VERTEX_REGION_CLAUDE_4_7_OPUS","VERTEX_REGION_CLAUDE_4_8_OPUS","VERTEX_REGION_CLAUDE_5_OPUS","VERTEX_REGION_CLAUDE_5_5_OPUS","VERTEX_REGION_CLAUDE_FABLE_5","VERTEX_REGION_CLAUDE_FABLE_5_1","VERTEX_REGION_CLAUDE_4_5_SONNET","VERTEX_REGION_CLAUDE_4_6_SONNET","VERTEX_REGION_CLAUDE_5_SONNET","VERTEX_REGION_CLAUDE_5_5_SONNET","VERTEX_REGION_CLAUDE_HAIKU_4_5","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE","CLAUDE_CODE_AUTO_COMPACT_WINDOW","CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT","CLAUDE_CODE_MAX_CONTEXT_TOKENS","DISABLE_AUTO_COMPACT","DISABLE_COMPACT","CLAUDE_CODE_ALWAYS_ENABLE_EFFORT","CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING","CLAUDE_CODE_DISABLE_FAST_MODE","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK","CLAUDE_CODE_DISABLE_THINKING","CLAUDE_CODE_EFFORT_LEVEL","CLAUDE_CODE_MAX_EFFORT_REMINDER","CLAUDE_CODE_PROMPT_CACHE_TTL","CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL","DISABLE_INTERLEAVED_THINKING","DISABLE_PROMPT_CACHING","DISABLE_PROMPT_CACHING_FABLE","DISABLE_PROMPT_CACHING_HAIKU","DISABLE_PROMPT_CACHING_OPUS","DISABLE_PROMPT_CACHING_SONNET","ENABLE_PROMPT_CACHING_1H","ENABLE_PROMPT_CACHING_1H_BEDROCK","FALLBACK_FOR_ALL_PRIMARY_MODELS","FORCE_PROMPT_CACHING_5M","CLAUDE_AUTO_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_ADVISOR_TOOL","CLAUDE_CODE_DISABLE_AGENT_VIEW","CLAUDE_CODE_DISABLE_ARTIFACT","CLAUDE_CODE_DISABLE_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_BUNDLED_SKILLS","CLAUDE_CODE_DISABLE_CRON","CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS","CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY","CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING","CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND","CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE","CLAUDE_CODE_DISABLE_WORKFLOWS","CLAUDE_CODE_ENABLE_AWAY_SUMMARY","CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING","CLAUDE_CODE_ENABLE_FUNCTION_HOOKS","CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION","CLAUDE_CODE_ENABLE_TASKS","CLAUDE_CODE_FORK_SUBAGENT","CLAUDE_CODE_PLAN_MODE_REQUIRED","DISABLE_DOCTOR_COMMAND","DISABLE_EXTRA_USAGE_COMMAND","DISABLE_INSTALL_GITHUB_APP_COMMAND","DISABLE_LOGIN_COMMAND","DISABLE_LOGOUT_COMMAND","DISABLE_UPGRADE_COMMAND","CLAUDE_AX_SCREEN_READER","CLAUDE_CODE_ACCESSIBILITY","CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN","CLAUDE_CODE_DISABLE_MOUSE","CLAUDE_CODE_DISABLE_MOUSE_CLICKS","CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL","CLAUDE_CODE_FORCE_STRIKETHROUGH","CLAUDE_CODE_FORCE_TERMINAL_IMAGES","CLAUDE_CODE_HIDE_CWD","CLAUDE_CODE_NATIVE_CURSOR","CLAUDE_CODE_NO_FLICKER","CLAUDE_CODE_SCROLL_SPEED","CLAUDE_CODE_SYNTAX_HIGHLIGHT","API_TIMEOUT_MS","CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS","CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS","CLAUDE_CODE_GLOB_TIMEOUT_SECONDS","CLAUDE_CODE_MAX_RETRIES","CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS","CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT","CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS","CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS","CLAUDE_STREAM_IDLE_TIMEOUT_MS","MAX_STRUCTURED_OUTPUT_RETRIES","MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE","MCP_SERVER_CONNECTION_BATCH_SIZE","SLASH_COMMAND_TOOL_CHAR_BUDGET","TASK_MAX_OUTPUT_LENGTH","MCP_CONNECTION_NONBLOCKING","CLAUDE_ENABLE_BYTE_WATCHDOG","CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK","CLAUDE_ENABLE_STREAM_WATCHDOG"]),_U=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),SU=new Set(["ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),yU=/auth|key|token|cookie|secret|credential|session|signature|passw|jwt|assertion|cert|oidc|org|tenant|account|project|workspace|user|email|identity|principal|consumer|client|host|url|base|target|upstream|endpoint|proxy|forward|route|fallback|override|apigw|x-goog-|l5d-|bypass|guardrail|amz|x-ms-|azureml|extra-parameters|envoy|helicone|litellm|cf-aig|cf-access|beta|version/;function OU(l){if(/\r(?!\n)/.test(l))return!0;return l.split(/\n|\r\n/).some((b)=>{let D=b.indexOf(":");if(D===-1)return!1;let te=b.slice(0,D).trim();return!AU.test(te)||Ac(b.slice(D+1))!==null||yU.test(te.toLowerCase())})}var AU=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function xc(l,b){let D=l.toUpperCase();return EU.has(D)||_U.has(D)&&o(b)||SU.has(D)&&re(b)||D==="ANTHROPIC_CUSTOM_HEADERS"&&!OU(b)}import{posix as Au,win32 as bu}from"path";import*as Ve from"zod/v4";import*as Uo from"zod/v4";var zn=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],CU=[...zn],wc=CU;function po(l){return l==="manual"?"default":l}var VY=`Cannot set permission mode: must be one of ${zn.join(", ")}`,KY={dangerousRemoval:{bypassImmune:!0,classifierRouted:!0,autoModeDeny:!0,hostPersonOnly:!1,localProjectionOnly:!1},backgroundOperator:{bypassImmune:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1},suspiciousWindowsPath:{bypassImmune:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1},isolatePeerMachines:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1},restrictedMode:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1},outsideReadsBlocked:{bypassImmune:!0,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1},claudeSettingsFile:{bypassImmune:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1},...{},...{}};var Nc=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var vc=["normal","vim"];var kc=["auto","12-hour","24-hour","24-hour-utc"],Mc=["auto","tmux","iterm2","in-process"],TU=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],Uc=["auto",...TU],Hc=["auto","alwaysAsk","disabled"],zc=1e5,Fc=1e6;import*as Bc from"zod/v4";import*as dn from"zod/v4/core";var RU=dn.$ZodType,DU=Bc.ZodType,Qs=dn.$constructor("ZodDeferredOptional",(l,b)=>{RU.init(l,b),DU.init(l,b),l._zod.optin="optional",l._zod.optout="optional",Object.defineProperty(l._zod,"innerType",{get(){let D=b.getter();return Object.defineProperty(l._zod,"innerType",{value:D,configurable:!0}),D},configurable:!0}),l._zod.processJSONSchema=(D,te,ce)=>{let Oe=l._zod.innerType;dn.process(Oe,D,ce),D.seen.get(l).ref=Oe},dn.util.defineLazy(l._zod,"values",()=>{let D=l._zod.innerType._zod.values;return D?new Set([...D,void 0]):void 0}),dn.util.defineLazy(l._zod,"pattern",()=>{let D=l._zod.innerType._zod.pattern;return D?new RegExp(`^(${dn.util.cleanRegex(D.source)})?$`):void 0}),dn.util.defineLazy(l._zod,"propValues",()=>l._zod.innerType._zod.propValues),l._zod.parse=(D,te)=>{if(D.value===void 0)return D;return l._zod.innerType._zod.run(D,te)},l.unwrap=()=>l._zod.innerType});function qt(l){let b;return new Qs({type:"lazy",getter:()=>{if(b===void 0){let te=l();if(te._zod.optin==="optional")throw Error("deferredOptional: the inner schema must not accept undefined itself (.optional()/.catch()/.default())");b=te}return b}})}import*as Et from"zod/v4";var LU=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function Gc(l){return new RegExp(LU).test(l)}var e2=mt(()=>Et.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),t2=mt(()=>Et.enum(["stdio","sse","sse-ide","http","ws","sdk"]));var fo=mt(()=>Et.literal("comms").optional().catch(void 0)),In=mt(()=>Et.number().int().positive()),IU=300000,jc=mt(()=>Et.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function Wc({request_timeout_ms:l,...b}){return{...b,...b.timeout===void 0&&l!==void 0&&{timeout:Math.min(l,IU)}}}var PU=mt(()=>Et.object({type:Et.literal("stdio").optional(),command:Et.string().min(1,"Command cannot be empty"),args:Et.array(Et.string()).default([]),env:Et.record(Et.string(),Et.string()).optional(),timeout:In().optional(),alwaysLoad:Et.boolean().optional(),bareElicitationCapability:Et.boolean().optional(),role:fo()})),xU=mt(()=>Et.boolean()),$c=mt(()=>Et.object({clientId:Et.string().optional(),callbackPort:Et.number().int().positive().optional(),authServerMetadataUrl:Et.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:Et.string().min(1).optional(),xaa:xU().optional()})),Vc=mt(()=>Et.object({name:Et.string(),permission_policy:Et.enum(["always_allow","always_ask","always_deny"]).optional()})),Kc=mt(()=>Et.object({type:Et.literal("sse"),url:Et.string(),headers:Et.record(Et.string(),Et.string()).optional(),headersHelper:Et.string().optional(),oauth:$c().optional(),timeout:In().optional(),request_timeout_ms:jc(),tools:Et.array(Vc()).optional(),alwaysLoad:Et.boolean().optional(),bareElicitationCapability:Et.boolean().optional(),discoveryCache:Et.boolean().optional(),role:fo(),toolPermissions:Et.record(Et.string(),oi()).optional()}).transform(Wc)),wU=mt(()=>Et.object({type:Et.literal("sse-ide"),url:Et.string(),ideName:Et.string(),ideRunningInWindows:Et.boolean().optional(),timeout:In().optional(),alwaysLoad:Et.boolean().optional(),role:fo()})),NU=mt(()=>Et.object({type:Et.literal("ws-ide"),url:Et.string(),ideName:Et.string(),authToken:Et.string().optional(),ideRunningInWindows:Et.boolean().optional(),timeout:In().optional(),alwaysLoad:Et.boolean().optional(),role:fo()})),Yc=mt(()=>Et.object({type:Et.enum(["http","streamable-http"]).transform(()=>"http"),url:Et.string(),headers:Et.record(Et.string(),Et.string()).optional(),headersHelper:Et.string().optional(),oauth:$c().optional(),timeout:In().optional(),request_timeout_ms:jc(),tools:Et.array(Vc()).optional(),alwaysLoad:Et.boolean().optional(),bareElicitationCapability:Et.boolean().optional(),discoveryCache:Et.boolean().optional(),role:fo(),toolPermissions:Et.record(Et.string(),oi()).optional()}).transform(Wc)),vU=["command","args","env","headersHelper"],kU=new Set(["http","streamable-http","sse"]),MU=/[\p{Cc}\p{Cf}\u2028\u2029]/u,UU=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function ei(l){return/^[A-Za-z0-9_-]+$/.test(l)&&l!=="__proto__"&&l!=="constructor"&&l!=="prototype"}function HU(l){try{let b=new URL(l);return b.protocol==="https:"&&b.hostname!==""}catch{return!1}}function Xc(l,b="",D=0){if(typeof l==="string")return[[b,l,!1]];if(D>4||l===null||typeof l!=="object")return[];return Object.entries(l).flatMap(([te,ce])=>{let Oe=te.replace(UU,($e)=>`\\u${$e.codePointAt(0).toString(16).padStart(4,"0")}`),xe=b?`${b}.${Oe}`:Oe;return[[xe,te,!0],...Xc(ce,xe,D+1)]})}var ti=mt(()=>Et.record(Et.string(),Et.unknown()).check((l)=>{let b=(te,ce)=>{l.issues.push({code:"custom",path:te,message:ce,input:l.value})};for(let te of vU)if(Object.hasOwn(l.value,te))b([te],`"${te}" is not allowed in managed settings: only http/sse URL servers can be delivered this way, and a managed settings document must not name a program to run`);if(!kU.has(l.value.type))b(["type"],'managed settings can only deliver "http" or "sse" servers');let D=l.value.url;if(typeof D==="string"&&!HU(D))b(["url"],"managed settings servers must use a valid https:// url");for(let[te,ce,Oe]of Xc(l.value))if(MU.test(ce))b(te.split("."),"contains control or invisible format characters (in a key or a value); a managed settings document must not be able to print escape sequences");else if(!Oe&&Gc(ce))b(te.split("."),"${VAR} references are not expanded in managed settings; use a literal value (a managed settings document must not read the user's environment)")}).pipe(Et.union([Yc(),Kc()]))),ni=`"managedMcpServers" must be an object keyed by server name (the .mcp.json mcpServers shape; Claude Desktop's array form of its same-named key is not accepted here: use the server name as the key and "type" instead of "transport"). No managed MCP servers are installed from it until it is fixed.`;function Mr(l,b){if(l===void 0)return;if(l===null||typeof l!=="object"||Array.isArray(l)){b("",ni);return}let D=Object.create(null);for(let[te,ce]of Object.entries(l)){if(!ei(te)){b("<invalid name>","server names may only contain letters, numbers, hyphens and underscores");continue}let Oe=ti().safeParse(ce);if(Oe.success){D[te]=Oe.data;continue}let xe=Oe.error.issues[0];b(te,xe?[xe.path.join("."),xe.message].filter(Boolean).join(": "):"failed validation")}return D}var zU=mt(()=>Et.object({type:Et.literal("ws"),url:Et.string(),headers:Et.record(Et.string(),Et.string()).optional(),headersHelper:Et.string().optional(),timeout:In().optional(),alwaysLoad:Et.boolean().optional(),bareElicitationCapability:Et.boolean().optional(),role:fo()})),FU=mt(()=>Et.object({type:Et.literal("sdk"),name:Et.string(),timeout:In().optional(),alwaysLoad:Et.boolean().optional()})),oi=mt(()=>Et.enum(["allow","ask","blocked"])),BU=mt(()=>Et.object({type:Et.literal("claudeai-proxy"),url:Et.string(),id:Et.string(),displayName:Et.string().optional(),iconUrl:Et.string().optional(),timeout:In().optional(),alwaysLoad:Et.boolean().optional(),toolPermissions:Et.record(Et.string(),oi()).optional(),stateless:Et.boolean().optional(),cachedInitResponse:Et.record(Et.string(),Et.unknown()).nullish(),discoverSupport:Et.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:Et.record(Et.string(),Et.unknown()).nullish(),eligible:Et.boolean().nullish(),ineligibleReason:Et.string().nullish(),enterpriseManaged:Et.boolean().optional()})),Ur=mt(()=>Et.union([PU(),Kc(),wU(),NU(),Yc(),zU(),FU(),BU()]));var n2=mt(()=>Et.object({mcpServers:Et.record(Et.string(),Ur())}));import*as mo from"zod/v4";import*as go from"zod/v4";var i2=O()==="macos"?"⏺":"●";var jU=new Set(["Claude Preview","Claude Browser"]),WU=new Set(["claude-in-chrome","Claude in Chrome"]),u2=new Set([...WU,...jU]);var $U=["Claude_Browser__"],VU=["claude-in-chrome__","Claude_in_Chrome__"],p2=[...$U,...VU];var A2=mt(()=>go.preprocess(po,go.enum(wc))),b2=mt(()=>go.preprocess(po,go.enum(zn)));import{posix as EH,win32 as _H}from"path";import*as Qe from"zod/v4";var Jc={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var ri=Object.keys(Jc);var XU=`${ri.slice(0,-1).join(", ")} or `+String(ri.at(-1));import{isIPv4 as JU,isIPv6 as ZU}from"net";var qU=new Set(["metadata.google.internal","metadata.goog","metadata","instance-data","instance-data.ec2.internal","ip6-localhost","ip6-loopback","localhost.localdomain","localhost4","localhost4.localdomain4","localhost6","localhost6.localdomain6"]),qc=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function Qc(l,b,D,te){return l===127||l===169&&b===254||l===0}function QU(l){let b=l.indexOf("%"),te=(b>=0?l.slice(0,b):l).toLowerCase().split("::");if(te.length>2)return;let ce=te[0]?te[0].split(":"):[],Oe=te.length===2&&te[1]?te[1].split(":"):[],xe=te.length===2?Oe:ce,$e=[],et=xe.at(-1);if(et!==void 0&&et.includes(".")){let gt=et.split(".").map(Number);if(gt.length!==4||gt.some((ht)=>!Number.isInteger(ht)||ht<0||ht>255))return;$e=gt,xe.pop()}let rt=(gt)=>{let ht=[];for(let Dt of gt){if(!/^[0-9a-f]{1,4}$/.test(Dt))return;let St=parseInt(Dt,16);ht.push(St>>8,St&255)}return ht},tt=rt(te.length===2?ce:[]),ct=rt(xe);if(tt===void 0||ct===void 0)return;let at=tt.length+ct.length+$e.length;if(at>16||te.length===1&&at!==16)return;return[...tt,...Array(16-at).fill(0),...ct,...$e]}function eH(l){return ed(l)&&l[4]===0&&l[5]===1}function ed(l){return l[0]===0&&l[1]===100&&l[2]===255&&l[3]===155}function tH(l){let b=[];if(l[0]===32&&l[1]===2)b.push(l.slice(2,6));let D=l.slice(0,10).every(($e)=>$e===0),te=D&&l[10]===255&&l[11]===255,ce=D&&l[10]===0&&l[11]===0,Oe=ed(l)&&l.slice(4,12).every(($e)=>$e===0),xe=(l[8]===0||l[8]===2)&&l[9]===0&&l[10]===94&&l[11]===254;if(te||ce||Oe||xe)b.push(l.slice(12,16));return b}function td(l){let b=l.toLowerCase().replace(/^\[|\]$/g,"");if(b.endsWith("."))b=b.slice(0,-1);if(b===""||b==="localhost"||b.endsWith(".localhost"))return!0;if(qU.has(b))return!0;if(b.startsWith("instance-data.")&&b.endsWith(".compute.internal"))return!0;if(JU(b)){if(qc.has(b))return!0;let[te=0,ce=0,Oe=0,xe=0]=b.split(".").map(Number);return Qc(te,ce,Oe,xe)}if(!ZU(b))return!1;let D=QU(b);if(D===void 0)return!0;if(eH(D))return!0;if(D.every((te)=>te===0))return!0;if(D.slice(0,15).every((te)=>te===0)&&D[15]===1)return!0;if(b==="fd00:ec2::254")return!0;if(D[0]===254&&(D[1]??0)>=128&&(D[1]??0)<=191)return!0;return tH(D).some((te)=>{let[ce=0,Oe=0,xe=0,$e=0]=te;return Qc(ce,Oe,xe,$e)||qc.has(`${ce}.${Oe}.${xe}.${$e}`)})}var nH=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]|[\uDC00-\uDFFF]/g;function oH(l){return l.replace(nH,(b)=>b.length===2?b:"")}var rH=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}\p{Default_Ignorable_Code_Point}\u2800]|(?!\u0020)\p{Zs}/gu;function nd(l){if(typeof l!=="string")return"";let b=l;for(let D=0;D<64;D++){let te=oH(b).replace(rH,"");if(te===b)return te;b=te}return""}import*as xt from"zod/v4";var od=["bash","powershell"];var Ho=mt(()=>xt.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));function sH(){let l=xt.object({type:xt.literal("command").describe("Shell command hook type"),command:xt.string().describe("Shell command to execute"),args:xt.array(xt.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as "+"an executable and spawned directly with these arguments — no shell. "+"Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:Ho(),shell:xt.enum(od).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:xt.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:xt.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:xt.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:xt.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:xt.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:xt.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".'),cloud:xt.enum(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'device': offer it to the cloud session and run it here even when its script sits where the cloud session can write on this machine or cannot be pinned — the author accepts that the session may have changed files this hook executes. 'skip': never offer it to cloud sessions. Omit for the default: a command hook whose script could be read and pinned and lies outside everything the cloud session can write here is offered; other command hooks are not. Applies to this entry only: the same hook written in another settings scope keeps its own setting. An unrecognised value reads as 'skip' (the file still loads; the hook stays on this machine).")}),b=xt.object({type:xt.literal("prompt").describe("LLM prompt hook type"),prompt:xt.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:Ho(),timeout:xt.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:xt.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),continueOnBlock:xt.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:xt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),D=xt.object({type:xt.literal("mcp_tool").describe("MCP tool hook type"),server:xt.string().describe("Name of an already-configured MCP server to invoke"),tool:xt.string().describe("Name of the tool on that server to call"),input:xt.record(xt.string(),xt.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:Ho(),timeout:xt.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:xt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),te=xt.object({type:xt.literal("http").describe("HTTP hook type"),url:xt.string().url().describe("URL to POST the hook input JSON to"),if:Ho(),timeout:xt.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:xt.record(xt.string(),xt.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:xt.array(xt.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:xt.boolean().optional().describe("If true, hook runs once and is removed after execution"),cloud:xt.enum(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'skip': never offer it to cloud sessions; 'device' or omitted: offered (an HTTP hook has no script to pin). Applies to this entry only. An unrecognised value reads as 'skip' (the file still loads).")}),ce=xt.object({type:xt.literal("agent").describe("Agentic verifier hook type"),prompt:xt.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:Ho(),timeout:xt.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:xt.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:xt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:xt.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:l,PromptHookSchema:b,HttpHookSchema:te,AgentHookSchema:ce,McpToolHookSchema:D}}var Hr=mt(()=>{let{BashCommandHookSchema:l,PromptHookSchema:b,AgentHookSchema:D,HttpHookSchema:te,McpToolHookSchema:ce}=sH();return xt.discriminatedUnion("type",[...[l,b,D,te,ce]])}),si=mt(()=>xt.object({matcher:xt.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:xt.array(Hr()).describe("List of hooks to execute when the matcher matches")})),Gn=mt(()=>xt.partialRecord(xt.enum(H),xt.array(si())));function zr(){return new Set(Hr().options.map((l)=>l.shape.type.value))}function iH(l,b){if(!l||typeof l!=="object"||Array.isArray(l)){let ce=Fn(l);return{problem:`Hook entry must be an object; received ${ce}`,received:ce,aboutType:!1}}let D=l.type;if(typeof D!=="string"){let ce=Fn(D);return{problem:D===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${ce}`,received:ce,aboutType:!0}}if(!b.has(D)){let ce=We(D);return{problem:`Unknown hook type "${ce}"`,received:ce,aboutType:!0}}let te=Hr().safeParse(l);if(!te.success)return{problem:`Invalid ${D} hook (${rd(te.error)})`,received:D,aboutType:!1};return}function rd(l){return l.issues.map((b)=>b.path.length>0?`${b.path.join(".")}: ${b.message}`:b.message).join("; ")}function Fr(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;if(!("matcher"in l)&&Object.keys(l).some((D)=>H.includes(D)))return!1;let b=l.hooks;if(Array.isArray(b))return b.length>0;return!!b&&typeof b==="object"&&(("matcher"in l)||typeof b.type==="string")}function Bn(l,b=3,{matchersCount:D=!0,unscannedKeys:te=aH,inHooksList:ce=!1}={}){if(ad(l))return!0;if(D&&Fr(l))return!0;if(b===0||!l||typeof l!=="object")return!1;if(Array.isArray(l))return l.some((Oe)=>Bn(Oe,b-1,{matchersCount:D,unscannedKeys:te,inHooksList:ce}));if(ce&&typeof l.type==="string")return!1;return Object.entries(l).some(([Oe,xe])=>!te.has(Oe)&&Bn(xe,b-1,{unscannedKeys:te,matchersCount:D&&!H.includes(Oe),inHooksList:Oe==="hooks"&&Array.isArray(xe)}))}function sd(l,b){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return ad(l)||Object.entries(l).some(([D,te])=>D!=="hooks"&&!b.has(D)&&Bn(te,3,{unscannedKeys:b,matchersCount:!H.includes(D)}))}var aH=new Set,id=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),lH=new Set(["metadata","mcpServers","lspServers"]),j2=new Set([...lH,"experimental"]);function ad(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Object.entries(l).some(([b,D])=>zo.has(b)&&D!==null&&D!==void 0&&!(Array.isArray(D)&&D.length===0))}function ii(l){if(Fr(l))return!0;if(Array.isArray(l))return l.some(ii);if(!l||typeof l!=="object")return!1;return Object.entries(l).some(([b,D])=>zo.has(b)&&D!==null&&D!==void 0&&!(Array.isArray(D)&&D.length===0))}var zo=new Set(["PreToolUse","PermissionRequest"]);function ld(l,b){if(!Array.isArray(l))return{stripped:[],unloadableGuards:[]};let D=zo.has(b),te=zr(),ce=si(),Oe=[],xe=[];for(let $e=l.length-1;$e>=0;$e--){let et=l[$e],rt=(gt,ht)=>{if(!D)l.splice($e,1);Oe.push({matcherIndex:$e,hookIndex:void 0,path:`${$e}`,problem:gt,received:ht,aboutType:!1})};if(Bn(et,3,{matchersCount:!1})){(D?Oe:xe).push({matcherIndex:$e,hookIndex:void 0,path:`${$e}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:Fn(et),aboutType:!1});continue}if(!et||typeof et!=="object"||Array.isArray(et)){rt(`Hook matcher must be an object; received ${Fn(et)}`,Fn(et));continue}let tt=et.hooks;if(!Array.isArray(tt)){rt(`Hook matcher "hooks" must be an array of hook entries; received ${Fn(tt)}`,Fn(tt));continue}let ct=[];for(let gt=tt.length-1;gt>=0;gt--){let ht=iH(tt[gt],te);if(ht!==void 0){if(!D)tt.splice(gt,1);ct.push({matcherIndex:$e,hookIndex:gt,path:`${$e}.hooks.${gt}`,...ht})}}let at=ce.safeParse(D?{...et,hooks:[]}:et);if(!at.success){rt(`Invalid hook matcher (${rd(at.error)})`,"matcher");continue}Oe.push(...ct)}return Oe.reverse(),xe.reverse(),D?{stripped:[],unloadableGuards:Oe}:{stripped:Oe,unloadableGuards:xe}}var jn="a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed";function Fn(l){if(l===null||l===void 0)return String(l);if(Array.isArray(l))return"an array";let b=typeof l;return`${b==="object"?"an":"a"} ${b}`}var nn="github.com",V2=[`git@${nn}:`,`ssh://git@${nn}/`],K2=[`https://${nn}`,`https://${nn}/`,nn],Y2=`users.noreply.${nn}`;var cH=/[:/\\?#@\s]/,ud=new Set(["http","https","ws","wss","ftp"]);function Br(l){let b=dd(l.replace(/[\t\n\r]/g,"").toLowerCase());if(b===""||cH.test(b))return b;try{let D=new URL(`https://${b}`);if(D.username!==""||D.password!==""||D.port!==""||D.pathname!=="/"||D.search!==""||D.hash!=="")return b;return dd(D.hostname)}catch{return b}}var pd=Er(function(b){let D=Br(b);while(D.startsWith("www."))D=D.slice(4);return D},(l)=>l,50);function fd(l,b){return pd(l)===b}function Wn(l){return fd(l,nn)}function cd(l){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(l)}function Fo(l){l=l.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let b=l.indexOf("://");if(b===-1)return!1;let D=l.slice(b+3),te=l.slice(0,b).toLowerCase();if(ud.has(te)){let xe=D.match(/^[/\\]+/)?.[0]??"";if(xe.includes("\\"))return!0;D=D.slice(xe.length)}let ce=D.search(/[/?#]/);return(ce===-1?D:D.slice(0,ce)).includes("\\")}function ai(l){if(l.includes("://")){if(Fo(l))return!0;try{let ce=new URL(l);if(ce.protocol==="http:"||ce.protocol==="https:")return!1;return cd(ce.hostname)}catch{return!0}}let b=l.indexOf(":"),D=l.indexOf("@");if(b>=0&&D>b)return!0;let te=l.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return te?cd(te):!1}function dd(l){let b=l.length;while(b>0&&l[b-1]===".")b--;return l.slice(0,b)}function md(l){let b=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(l);return b?{user:b[1],host:b[2],path:b[3]}:null}var gd=/(?<![^\s\p{P}])\p{M}+/gu;function uH(l){return Rt(mH(Ge(l))).replace(/ {2,}/g," ").trim()}var pH=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,fH=4;function mH(l){let b=l;for(let D=0;D<fH;D++){let te=b.replace(pH,"");if(te===b)break;b=te}return b}function li(l,b=160){return gH(uH(hH(l,b)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(gd,""),b)}function gH(l,b=2000){return l.length>b?`${ie(l,b)}…`:l}function hH(l,b){let D=ie(l,b*8);if(D.length===l.length)return D;let te=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(D);if(te===null)return D;let ce=l.slice(te.index);return(ce[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(ce):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(ce))?D.slice(0,te.index):D}var mi=500,SH=32;function Cd(){return{claudeaiPluginId:Qe.string().max(128).optional().catch(void 0),archiveSha256:Yd().optional().catch(void 0)}}function Td(){return{directoryRepositoryKey:Qe.string().max(4096).optional().catch(void 0)}}function gi(l){if(!/^https?:\/\/[^/\\]/i.test(l))return!1;try{let{protocol:b}=new URL(l);return b==="https:"||b==="http:"}catch{return!1}}function Rd(){return{npmVersionSpec:Qe.string().max(256).optional().catch(void 0),npmResolved:Qe.string().max(2048).optional().catch(void 0),npmIntegrity:Qe.string().max(256).optional().catch(void 0),npmRegistry:Qe.string().max(2048).refine(gi).optional().catch(void 0)}}function Dd(){return{sourceCommand:Qe.string().max(mi+20).optional().catch(void 0).describe("The `command`-source command the user accepted at explicit install/update. The once-per-session background re-resolve only runs while the marketplace entry still declares this exact command; a changed command (or an entry that became command-sourced later) is skipped with a warning until the user runs an explicit update."),sourceProducerPath:Qe.string().max(4096).refine(hd,{message:"must be an absolute path"}).optional().catch(void 0).describe("The directory a `command`-source plugin was last resolved to (what its command printed). Served in place in link mode and re-copied every session in copy mode, so the sandbox write-denies it; refreshed on every install/update, including no-op updates that resolve to a new location."),previousProducerPaths:Qe.array(Qe.unknown()).transform((l)=>l.filter((b)=>typeof b==="string"&&b.length<=4096&&hd(b)).slice(-SH)).optional().catch(void 0).describe("Producer directories this installation was resolved to before the current one (most recent last, bounded). A concurrent older session may still serve one of them, so the sandbox keeps write-denying them too.")}}function hd(l){return EH.isAbsolute(l)||_H.isAbsolute(l)}var Ld=/[^\x20-\x7E]| {4,}/;function hi(){return Qe.string().max(mi,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((l)=>!Ld.test(l),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var yH="anthropic-plugin-directory",OH=new Set(["claude-community","claude-plugins-community","healthcare"]),AH=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins","first-party-plugins","claude-tag-plugins"]),bH=new Set([yH,"claude-plugin-directory"]),Id=new Set([...AH,...OH,...bH]);function CH(){return["marketplace","plugins","official"]}var TH=new RegExp(`(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(${CH().join("|")}))`,"i"),RH=/[^\u0020-\u007E]/;function DH(l){if(Id.has(l.toLowerCase()))return!1;if(RH.test(l))return!0;if(TH.test(l))return!0;return!1}var un=mt(()=>Qe.string().startsWith("./")),$n=mt(()=>un().endsWith(".json")),Ed=mt(()=>Qe.union([Qe.literal("."),un()])),_d=mt(()=>Qe.union([un().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),Qe.string().url().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),di=mt(()=>un().endsWith(".md")),ui=mt(()=>Qe.union([di(),un()])),Ei={inline:"--plugin-dir session plugins",builtin:"built-in plugins","skills-dir":"plugins auto-loaded from .claude/skills/",synced:"plugins synced from your claude.ai account","claude-plugin-test":"plugins loaded by claude plugin test",npm:"plugins installed from an npm registry (`<package>@npm`); remove this marketplace and add it again under another name",pip:"plugins installed from a Python package index (reserved; not yet available)",uv:"plugins installed from a Python package index through uv (reserved; not yet available)",cargo:"plugins installed from a Rust crate registry (reserved; not yet available)",github:"plugins installed straight from a GitHub repository (`<owner>/<repo>@github`; reserved; not yet available)",gh:"plugins installed straight from a GitHub repository (reserved; not yet available)"},Pd="npm",LH=["pip","uv","cargo","github","gh"];function xd(l){return Object.hasOwn(Ei,l)}var IH=[Pd,...LH];function wd(l){return IH.includes(l.toLowerCase())}function PH(l,b){let D=l.toLowerCase();if(wd(D)&&xd(D))b.addIssue({code:"custom",message:`Marketplace name "${D}" is reserved for ${Ei[D]}`})}var xH="Marketplace name impersonates an official Anthropic/Claude marketplace",Nd=(l)=>Qe.string().min(1,"Marketplace must have a name").refine((b)=>!b.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((b)=>!Zd.test(b),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((b)=>!b.includes("/")&&!b.includes("\\")&&!b.includes("..")&&b!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((b)=>!l||!DH(b),{message:xH}).superRefine((b,D)=>{let te=b.toLowerCase();if(!xd(te)||wd(te))return;D.addIssue({code:"custom",message:`Marketplace name "${te}" is reserved for ${Ei[te]}`})}),vd=mt(()=>Nd(!0)),wH=mt(()=>Nd(!1)),Gr=mt(()=>Qe.string().min(1,"Plugin name cannot be empty").refine((l)=>!l.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).refine((l)=>!Zd.test(l),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),_i=mt(()=>Qe.object({name:Qe.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:Qe.string().optional().describe("Contact email for support or feedback"),url:Qe.string().optional().describe("Website, GitHub profile, or organization URL")})),NH=mt(()=>Qe.object({$schema:Qe.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Gr().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:Qe.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:Qe.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:Qe.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:_i().optional().describe("Information about the plugin creator or maintainer"),homepage:Qe.string().url().optional().describe("Plugin homepage or documentation URL"),repository:Qe.string().optional().describe("Source code repository URL"),license:Qe.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:Qe.array(Qe.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:Qe.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:Qe.array(Wz()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`),metadata:Qe.preprocess((l)=>r(l)?l:void 0,Qe.record(Qe.string(),Qe.unknown()).optional()).describe("Free-form metadata for the plugin author's own use (e.g. entitlement or catalog fields). Preserved on the parsed manifest but not read by Claude Code.")})),vH=1,kX=mt(()=>Qe.object({$schema:Qe.string().optional().catch(void 0).describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),description:Qe.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:Qe.lazy(()=>Gn()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:Qe.array(Qe.string()).max(vH,{message:"hooks.json `modules` names one hooks module per plugin; a second entry is refused"}).optional().describe(`The hooks module: one path, relative to this hooks.json, of a module exporting register(on). The module, and every file it imports from the plugin, is named like code (${XU}; a file named otherwise is not loaded) and is an ES module whatever its suffix. What it hooks and calls is read from its source before it loads; \`claude plugin validate\` shows the result.`),surface:Qe.never({error:'hooks.json `surface` is gone: name the module in the Client element, `Client({ module: "./board.tsx", key })`, a path relative to the file that builds it'}).optional()}).refine((l)=>l.hooks!==void 0||(l.modules?.length??0)>0,{message:"hooks.json must have `hooks` (the hook matchers) or `modules` (hooks modules), or both"})),kH=mt(()=>Qe.object({hooks:Qe.union([$n().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Qe.lazy(()=>Gn()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),Qe.array(Qe.union([$n().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Qe.lazy(()=>Gn()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),MH=mt(()=>Qe.object({source:ui().optional().describe("Path to command markdown file, relative to plugin root"),content:Qe.string().optional().describe("Inline markdown content for the command"),description:Qe.string().optional().describe("Command description override"),argumentHint:Qe.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:Qe.string().optional().describe("Default model for this command"),allowedTools:Qe.array(Qe.string()).optional().describe("Tools allowed when command runs")}).refine((l)=>l.source&&!l.content||!l.source&&l.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),UH=mt(()=>Qe.object({commands:Qe.union([ui().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both."),Qe.array(ui().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),Qe.record(Qe.string(),MH()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),HH=mt(()=>Qe.object({agents:Qe.union([di().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both."),Qe.array(di().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),zH=mt(()=>Qe.object({skills:Qe.union([Ed().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself). Loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring a specific subdirectory replaces the skills/ scan).'),Qe.array(Ed().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself).')).describe("List of skill directory paths, loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring specific subdirectories replaces the skills/ scan).")])})),FH=mt(()=>Qe.union([Qe.string(),Qe.array(Qe.string())])),kd=mt(()=>Qe.object({outputStyles:Qe.union([un().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both."),Qe.array(un().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),BH=mt(()=>Qe.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),GH=16,jH=mt(()=>Qe.object({id:BH(),remote:Qe.string().max(256).regex(/^(npm:[@a-z0-9/._-]+(@[a-z0-9._+-]+)?|github:[\w.-]+\/[\w.-]+@[\w./-]+#.+\.js)$/,"must be npm:<pkg>[@ver] or github:<owner>/<repo>@<ref>#<path>.js").optional(),integrity:Qe.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),WH=mt(()=>Qe.object({syntaxHighlighting:Qe.object({hljsLanguages:Qe.array(jH()).max(GH)}).strict()})),Md=mt(()=>Qe.object({themes:Qe.union([un().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both."),Qe.array(un().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),$H=mt(()=>Qe.object({})),Sd=mt(()=>Qe.string().min(1)),VH=mt(()=>Qe.string().min(2).refine((l)=>l.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),KH=mt(()=>Qe.object({mcpServers:Qe.union([$n().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),_d().describe("Path or URL to MCPB file containing MCP server configuration"),Qe.record(Qe.string(),Ur()).describe("MCP server configurations keyed by server name"),Qe.array(Qe.union([$n().describe("Path to MCP servers configuration file"),_d().describe("Path or URL to MCPB file"),Qe.record(Qe.string(),Ur()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Ud=mt(()=>Qe.object({type:Qe.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:Qe.string().describe("Human-readable label shown in the config dialog"),description:Qe.string().describe("Help text shown beneath the field in the config dialog"),required:Qe.boolean().optional().describe("If true, validation fails when this field is empty"),default:Qe.union([Qe.string(),Qe.number(),Qe.boolean(),Qe.array(Qe.string())]).optional().describe("Default value used when the user provides nothing"),multiple:Qe.boolean().optional().describe("For string type: allow an array of strings"),sensitive:Qe.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:Qe.number().optional().describe("Minimum value (number type only)"),max:Qe.number().optional().describe("Maximum value (number type only)"),options:Qe.array(Qe.string().min(1,"An option cannot be empty").max(64,"An option can be at most 64 characters").refine((l)=>nd(l)===l,{message:"An option cannot contain control, invisible or bidirectional-formatting characters"}).refine((l)=>l.trim()===l,{message:"An option cannot start or end with a space"})).min(1,"options needs at least one value").refine((l)=>new Set(l.map((b)=>b.toLowerCase())).size===l.length,{message:"options cannot repeat a value (in any letter case)"}).readonly().optional().describe("For string type: the only values the field takes. /config shows the field as a picker over them, and a stored value outside them counts as unset")}).strict().superRefine((l,b)=>{if(l.options===void 0)return;if(l.type!=="string"||l.multiple===!0||l.sensitive===!0){b.addIssue({code:"custom",path:["options"],message:'options is only for a field of type "string" that is neither multiple nor sensitive'});return}if(l.default===void 0){if(l.required!==!0)b.addIssue({code:"custom",path:["default"],message:"a field with options needs a default among them, or required: true"});return}if(typeof l.default!=="string"||!l.options.includes(l.default))b.addIssue({code:"custom",path:["default"],message:`default must be one of the options: ${l.options.join(", ")}`})})),YH=mt(()=>Qe.object({userConfig:Qe.record(Qe.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),Ud()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),XH=mt(()=>Qe.object({channels:Qe.array(Qe.object({server:Qe.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:Qe.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:Qe.record(Qe.string(),Ud()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),yd=mt(()=>Qe.strictObject({command:Qe.string().min(1).refine((l)=>{if(l.includes(" ")&&!l.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:Qe.array(Sd()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:Qe.record(VH(),Sd()).refine((l)=>Object.keys(l).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:Qe.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:Qe.record(Qe.string(),Qe.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:Qe.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:Qe.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:Qe.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:Qe.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:Qe.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:Qe.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:Qe.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:Qe.boolean().optional().describe("Whether to push publishDiagnostics into the agent context after edits. Set to false to keep LSP navigation (goToDefinition, hover, etc.) but suppress automatic diagnostic injection. Defaults to true.")})),JH=mt(()=>Qe.strictObject({name:Qe.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:Qe.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a <task_notification> event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd (the named --project-config-root when a host set one) — prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:Qe.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:Qe.union([Qe.literal("always"),Qe.string().startsWith("on-skill-invoke:").refine((l)=>l.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),ZH=mt(()=>Qe.array(JH()).refine((l)=>new Set(l.map((b)=>b.name)).size===l.length,{message:"Monitor names must be unique within a plugin"})),Hd=mt(()=>Qe.object({monitors:Qe.union([$n().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),ZH()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),qH=mt(()=>Qe.object({lspServers:Qe.union([$n().describe("Path to .lsp.json configuration file relative to plugin root"),Qe.record(Qe.string(),yd()).describe("LSP server configurations keyed by server name"),Qe.array(Qe.union([$n().describe("Path to LSP configuration file"),Qe.record(Qe.string(),yd()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),QH=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,ez=/^[a-z0-9][a-z0-9-._]*$/,tz=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function zd(l){return!l.includes("..")&&!l.includes("//")&&(QH.test(l)||ez.test(l))}var Fd=mt(()=>Qe.string().refine((l)=>!l.includes("..")&&!l.includes("//"),"Package name cannot contain path traversal patterns").refine((l)=>zd(l),"Invalid npm package name format")),nz=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,oz=/^[0-9a-f]{64}$/;var rz=64;var sz=mt(()=>Qe.object({sha256:Qe.string().regex(oz)}));function iz(l){let b=Qe.record(Qe.string(),Qe.unknown()).safeParse(l);if(!b.success)return;let D=Object.create(null),te=0;for(let[ce,Oe]of Object.entries(b.data)){if(te>=rz)break;let xe=sz().safeParse(Oe);if(nz.test(ce)&&xe.success)D[ce]=xe.data,te++}return te>0?D:void 0}var az=mt(()=>Qe.object({binaries:Qe.unknown().transform(iz).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),lz=mt(()=>Qe.object({settings:Qe.record(Qe.string(),Qe.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),cz=mt(()=>Qe.object({types:un().refine((l)=>l.endsWith(".d.ts"),{message:"types must name a TypeScript declaration file ending in '.d.ts'"}).refine((l)=>!l.split(/[\\/]/).includes(".."),{message:"types must stay inside the plugin directory (no '..' segment)"}).optional().describe("Path to the plugin's type contract, relative to the plugin root and starting with ./: a self-contained .d.ts (no import, export-from, require or reference) that exports the types of the noun the plugin's hooks module adds in engine.create at its top level and declares the noun in a `declare module 'claude-code' { interface EngineInterface { ... } }` block, nothing else. /plugin-types copies each enabled plugin's contract to .claude/types/claude-code-plugins/<plugin>.d.ts and indexes them in claude-code-plugins.d.ts for dependents to type against; claude plugin validate checks the file.")})),dz=mt(()=>Qe.object({experimental:Qe.preprocess((l)=>r(l)?l:void 0,Qe.object({...Md().partial().shape,...WH().partial().shape,...Hd().partial().shape,...kd().partial().shape,evals:FH().optional().describe("Directory of eval cases for the plugin evaluation harness, relative to the plugin root (default: evals/). A list is accepted; its first entry is the case directory.")}).passthrough().optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))}));var uz=mt(()=>Qe.object({...NH().shape,...kH().partial().shape,...UH().partial().shape,...HH().partial().shape,...zH().partial().shape,...kd().partial().shape,...Md().partial().shape,...$H().shape,...XH().partial().shape,...KH().partial().shape,...qH().partial().shape,...Hd().partial().shape,...lz().partial().shape,...cz().partial().shape,...YH().partial().shape,...az().partial().shape,...dz().partial().shape})),Bd=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function Gd(l){try{return new RegExp(l),!0}catch{return!1}}function pz(l){return Fo(l)}var jd="ssh.github.com";function Od(l){return Wn(l)||Br(l)===jd}var fz=/^[A-Za-z0-9._-]+$/;function mz(l){return fz.test(l)&&!l.startsWith("-")&&l!=="."&&l!==".."}function Wd(l){if(!l.endsWith("/*"))return null;let b=l.slice(0,-2);return mz(b)?b:null}function gz(l){let b=[];for(let D of l.split("/")){if(D===".")continue;if(D===".."){b.pop();continue}b.push(D)}return b.filter((D)=>D!=="").join("/")}function hz(l){let b=l.length;for(;;){let D=b;while(D>0&&l.charCodeAt(D-1)===47)D--;if(D>=4&&l.startsWith(".git",D-4))D-=4;if(D===b)return b===l.length?l:l.slice(0,b);b=D}}function $d(l){let b=Br(l);return Wn(b)?nn:b}function Ad(l){let b=$d(l);return b===jd?nn:b}function Ez(l,b){if(l.includes("://"))try{let te=new URL(l);te.hostname=Ad(te.hostname),te.username="",te.password="",te.search="",te.hash="";try{te.pathname=decodeURIComponent(te.pathname)}catch{}let ce=gz(te.pathname);return te.pathname=b?.stripDotGit?hz(ce):ce,te.toString()}catch{return l}let D=l.match(/^[^@]+@([^:]+)(:.*)$/s);return D?`${Ad(D[1]??"")}${D[2]}`:l}var _z=new Set(["http:","https:","git:","git+http:","git+https:"]);function Sz(l){if(ai(l))return l;if(l.includes("://"))try{let te=new URL(l);if(te.hostname=$d(te.hostname),_z.has(te.protocol)||Wn(te.hostname))te.username="",te.password="";return te.toString()}catch{return l}let b=md(l);if(!b)return l;let D=b.host.toLowerCase().replace(/\.+$/,"");return Wn(D)?`${nn}:${b.path}`:`${b.user}@${D}:${b.path}`}function Vd(l){if(l.includes("://")){if(pz(l))return!1;let Oe;try{Oe=new URL(l).hostname}catch{return!1}if(!Od(Oe))return!1;if(Ez(l,{stripDotGit:!0}).includes("*"))return!0;let xe=Sz(l);try{let $e=new URL(xe);return $e.hostname.includes("*")||$e.pathname.includes("*")}catch{return xe.includes("*")}}let b=l.match(/^(?:[^@]+@)?([^@:/]+):(.*)$/s),D=b?.[1],te=b?.[2];if(!D||te===void 0||!Od(D))return!1;let ce=te;try{ce=decodeURIComponent(te)}catch{}return ce.includes("*")}function Kd(l){return Qe.discriminatedUnion("source",[Qe.object({source:Qe.literal("url"),url:Qe.string().url().describe("Direct URL to marketplace.json file"),headers:Qe.record(Qe.string(),Qe.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:hi().optional().describe("Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.")}),Qe.object({source:Qe.literal("github"),repo:Qe.string().describe('GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form "owner/*" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value '+"must name a single repository — a wildcard is taken literally and fails to clone."),ref:Qe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Qe.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Qe.array(Qe.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:Qe.boolean().optional().describe("Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.")}),Qe.object({source:Qe.literal("git"),url:Qe.string().describe("Full git repository URL"),ref:Qe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Qe.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Qe.array(Qe.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:Qe.boolean().optional().describe("Has no effect; accepted so existing settings keep working. Claude Code's own git never downloads Git LFS content: LFS-tracked files in the marketplace repository are checked out as pointer files whether or not this is set, and adding or updating the marketplace says how many were. To fetch their content, run `git lfs pull` in the marketplace's checkout under ~/.claude/plugins/marketplaces/.")}),Qe.object({source:Qe.literal("npm"),package:Fd().or(Qe.string().regex(tz,"Invalid npm package name format")).describe('npm package containing marketplace.json (e.g. "@acme/claude-marketplace"). In strictKnownMarketplaces / blockedMarketplaces an entry also governs plugins installed straight from the npm marketplace (`<package>@npm`): an exact package name matches that package, and "@acme/*" matches every package under the scope.'),version:Qe.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:Qe.string().url().refine(gi,"Registry must be an http(s) URL").optional().describe(`Registry URL. When adding a marketplace: a one-off registry override (otherwise your npm configuration decides). In a policy entry: the origin and path prefix the package's RESOLVED tarball URL must fall under (e.g. "https://npm.example.com/api/npm/internal/"); under allowManagedPermissionRulesOnly, an npm marketplace keeps plugin allowed-tools only when both the entry and the registration pin this same registry.`)}),Qe.object({source:Qe.literal("file"),path:Qe.string().describe("Local file path to marketplace.json")}),Qe.object({source:Qe.literal("directory"),path:Qe.string().describe("Local directory containing .claude-plugin/marketplace.json")}),Qe.object({source:Qe.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),Qe.object({source:Qe.literal("hostPattern"),hostPattern:Qe.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),Qe.object({source:Qe.literal("pathPattern"),pathPattern:Qe.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),Qe.object({source:Qe.literal("settings"),name:l?wH().describe("Marketplace name, as stored in known_marketplaces.json. A reserved name is refused per entry at load (revalidateReservedNameEntry); a look-alike name is refused when that marketplace's own catalog is parsed."):vd().refine((b)=>!Id.has(b.toLowerCase()),{message:"Reserved marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:Qe.array(Cz()).describe("Plugin entries declared inline in settings.json"),owner:_i().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])}var Bo=mt(()=>Kd(!1));var Si=String.raw`[\w./+-]`,MX=new RegExp(`^(?:#${Si}*)?$`),UX=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${Si}*)?$`),HX=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${Si}*)?$`);var yz=mt(()=>Kd(!0)),Go=mt(()=>Bo()),ci=mt(()=>Qe.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Yd=mt(()=>Qe.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),Oz="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function Az(l){try{let b=new URL(l);return b.protocol==="https:"&&!td(b.hostname)}catch{return!1}}var bz=mt(()=>Qe.object({source:Qe.literal("archive"),url:Qe.string().url().refine(Az,{message:Oz}).describe("HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive "+"or nested one directory deep — a single wrapping directory is stripped."),sha256:Yd().optional().describe("SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json "+"version, else the entry version, else this digest) — changing only the digest "+"while a version is declared does not trigger an update.")}).describe("Plugin distributed as a zip archive fetched over HTTPS — for hosting on any "+"static file server or artifact repository (S3, GitLab, nginx) with no git or npm on the client. Authentication: the entry's own `headers` / `headersHelper` (bound to this URL), overlaid on the enclosing url-source marketplace's headers (static or `headersHelper`-minted) when the archive shares its origin.")),Xd=mt(()=>Qe.union([Qe.preprocess((l)=>l==="."?"./":l,un()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),Qe.object({source:Qe.literal("npm"),package:Fd().or(Qe.string().refine((l)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(l)||!l.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:Qe.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:Qe.string().url().refine(gi,"Registry must be an http(s) URL").optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),Qe.object({source:Qe.literal("url"),url:Qe.string().describe("Full git repository URL (https:// or git@)"),ref:Qe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:ci().optional().describe("Specific commit SHA to use")}),Qe.object({source:Qe.literal("github"),repo:Qe.string().describe("GitHub repository in owner/repo format"),ref:Qe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:ci().optional().describe("Specific commit SHA to use")}),Qe.object({source:Qe.literal("git-subdir"),url:Qe.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:Qe.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:Qe.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:ci().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),bz(),Qe.object({source:Qe.literal("command"),command:Qe.string().min(1).max(mi,{message:"command must not be longer than the install consent UI can display"}).refine((l)=>!Ld.test(l),{message:"command must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"}).describe("Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment."),timeout:Qe.number().int().positive().max(600).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:Qe.enum(["copy","link"]).optional().describe("copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory "+"in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay "+"valid while Claude Code runs, and a different printed path is what signals new content.")}).describe("Plugin directory produced by a locally installed tool (e.g. an IDE that renders its plugin for the currently selected SDK). Claude Code runs the command, copies the directory it prints, and re-runs it in the background at startup to pick up changes."),Qe.object({source:Qe.literal("unsupported"),error:Qe.string().optional()}).describe("Placeholder for source types this Claude Code version does not recognize, or a known type whose fields failed validation (then `error` "+"holds the reason). Never authored by hand — PluginMarketplaceSchema rewrites "+"unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with an actionable message.")])),Cz=mt(()=>Qe.object({name:Gr().describe("Plugin name as it appears in the target repository"),source:Xd().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against. Under allowManagedPermissionRulesOnly, a settings marketplace keeps its plugins' allowed-tools only when every npm entry here pins a `registry` on a bare package name; unpinned, the package resolves through the member's own npm config, and a non-bare spelling (an `npm:` alias, a `name@range`, a URL or git spec) packs as an "+"exotic spec the pin does not bind — either way the marketplace "+"vouches no tool grants."),description:Qe.string().optional(),version:Qe.string().optional(),strict:Qe.boolean().optional(),headers:Qe.record(Qe.string(),Qe.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:hi().optional().describe("Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.")}).refine((l)=>typeof l.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, archive, command). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine((l)=>typeof l.source==="string"||l.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url, archive, command)."}));var Tz=mt(()=>Qe.object({cli:Qe.array(Qe.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:Qe.array(Qe.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) — exact, case-insensitive match against '+"hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path."),filesRead:Qe.array(Qe.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) — the plugin is relevant when a file Claude has read '+"this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive."),manifestDeps:Qe.array(Qe.object({file:Qe.string().max(256),pattern:Qe.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: "+"`file` matches the manifest filename (package.json, go.mod, requirements.txt, …); "+"`pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:Qe.array(Qe.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) — the plugin is relevant when the '+`session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),Rz=mt(()=>Qe.object({topic:Qe.string().max(64).optional().describe('What the user is working with when this plugin is relevant — fills "Working with {topic}?". '+'Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:Tz().optional().describe("Matchers that determine when the plugin is relevant.")})),Dz=mt(()=>uz().partial().extend({name:Gr().describe("Unique identifier matching the plugin name"),source:Xd().describe("Where to fetch the plugin from"),headers:Qe.record(Qe.string(),Qe.string()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:hi().optional().describe("Command that prints a JSON object of HTTP headers for fetching this plugin's archive (e.g. a short-lived auth token); overrides this entry's `headers` and the marketplace's. Runs only when the user installs or updates this plugin, never during catalog browse. An entry that sets it must be `strict: false` with its manifest inlined here, so consent is informed from the entry alone before the command runs."),category:Qe.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:Qe.array(Qe.string()).optional().describe("Tags for searchability and discovery"),strict:Qe.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:Qe.preprocess((l)=>r(l)?l:void 0,Rz().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),Lz=mt(()=>Qe.object({name:Gr()}));function Iz(l){let b=Dz();return l.flatMap((D,te)=>{let ce=b.safeParse(D);if(ce.success){let $e=ce.data.source;if(typeof $e==="object"&&$e.source==="unsupported"&&$e.error!==void 0)return[{...ce.data,source:{source:"unsupported"}}];return[ce.data]}let Oe=Lz().safeParse(D).data?.name,xe=ce.error.issues.map(($e)=>`${$e.path.join(".")}: ${$e.message}`).join(", ");if(Oe){e(`Stubbing unparseable marketplace plugin entry (${Oe}): ${xe}`,{level:"warn"});let $e=Jd(r(D)?D.source:void 0)?Mz:yi(D)?void 0:xz(ce.error.issues)??jr(ce.error.issues);return[{name:Oe,source:{source:"unsupported",...$e&&{error:$e}},strict:!0}]}return e(`Dropping unparseable marketplace plugin entry (index ${te}): ${xe}`,{level:"warn"}),[]})}var Pz=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function yi(l){if(!l||typeof l!=="object")return!1;let b=l.source;if(!b||typeof b!=="object")return!1;let D=b.source;return typeof D==="string"&&!Pz.has(D)}function xz(l){let b=l.find((te)=>te.path.length===1&&te.path[0]==="source");if(!b||b.code!=="invalid_union")return;let D=b.errors.find((te)=>!te.some((ce)=>ce.path.length===0||ce.code==="invalid_value"&&ce.path[0]==="source"));if(!D||D.length===0)return;return jr(D.map((te)=>({...te,path:["source",...te.path]})))}var wz=/^[A-Za-z0-9_$.-]{1,40}$/;function gn(l){return wz.test(l)?l:"<key>"}var Nz=3,vz=160;function jr(l){let b=l.slice(0,Nz).map((te)=>{let ce=te.path.map(String).map((xe)=>gn(xe)).join("."),Oe=te.code==="unrecognized_keys"?`Unrecognized ${te.keys.length===1?"field":"fields"}: ${te.keys.map(gn).join(", ")}`:li(te.message,vz);return ce?`${ce}: ${Oe}`:Oe}),D=l.length-b.length;return D>0?`${b.join(", ")} (+${D} more)`:b.join(", ")}var kz=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,Mz='Bare source names resolve under metadata.pluginRoot, which this marketplace does not set (or sets to a path outside the marketplace root). Use a "./relative/path" source, or set metadata.pluginRoot to allow bare names.';function Jd(l){return typeof l==="string"&&kz.test(l)&&!l.includes("..")}function Uz(l){if(typeof l!=="string"||l===""||l.startsWith("/")||l.includes("\\")||l.includes(":"))return;let b=l.replace(/^\.\//,"").replace(/\/+$/,"");if(b===""||b===".")return".";if(b.split("/").some((D)=>D===""||D==="."||D===".."))return;return b}function Hz(l,b){if(b===void 0||!r(l)||!Jd(l.source))return l;let D=b==="."?`./${l.source}`:`./${b}/${l.source}`;return{...l,source:D}}function zz(l){if(!r(l)||!Array.isArray(l.plugins))return l;let b=r(l.metadata)?Uz(l.metadata.pluginRoot):void 0;if(b===void 0)return l;return{...l,plugins:l.plugins.map((D)=>Hz(D,b))}}var Fz=mt(()=>Qe.object({$schema:Qe.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:vd().superRefine(PH),version:Qe.string().optional().describe("Marketplace manifest version"),description:Qe.string().optional().describe("Human-readable description of this marketplace"),owner:_i().describe("Marketplace maintainer or curator information"),plugins:Qe.array(Qe.unknown()).transform(Iz).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:Qe.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:Qe.object({pluginRoot:Qe.string().optional().describe('Base directory for bare plugin source names, relative to the marketplace root (e.g. "./plugins" resolves "source": "formatter" as ./plugins/formatter). Sources that already start with "./" are unaffected.'),version:Qe.string().optional().describe("Marketplace version"),description:Qe.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:Qe.array(Qe.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:Qe.record(Qe.string(),Qe.string().nullable()).optional().catch(void 0).describe("Append-only map of old plugin name → current name (or null when removed). The loader follows this on plugin-not-found and migrates user settings to the new name.")})),zX=mt(()=>Qe.preprocess(zz,Fz())),pi="[A-Za-z0-9][-A-Za-z0-9._]*",FX=new RegExp(`^${pi}$`);var Bz=new RegExp(`^${pi}@${pi}$`),bd=`@${Pd}`;function Gz(l){return l.endsWith(bd)&&zd(l.slice(0,-bd.length))}var jo=mt(()=>Qe.string().refine((l)=>Bz.test(l)||Gz(l),"Plugin ID must be in format: plugin@marketplace")),BX=new RegExp(`[@:\\s/\\\\${Re}]`,"u"),GX=new RegExp(`[${Re}]`,"u"),Zd=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,jz=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,Wz=mt(()=>Qe.union([Qe.string().regex(jz,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((l)=>l.replace(/@\^[^@]*$/,"")),Qe.object({name:Qe.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:Qe.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((l)=>l.marketplace?`${l.name}@${l.marketplace}`:l.name)])),$z=mt(()=>Qe.object({version:Qe.string().describe("Currently installed version"),installedAt:Qe.string().describe("ISO 8601 timestamp of installation"),lastUpdated:Qe.string().optional().describe("ISO 8601 timestamp of last update"),installPath:Qe.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:Qe.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:Qe.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:Qe.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs)."),...Cd(),...Td(),...Dd(),...Rd()})),jX=mt(()=>Qe.object({version:Qe.literal(1).describe("Schema version 1"),plugins:Qe.record(jo(),$z()).describe("Map of plugin IDs to their installation metadata")})),Vz=mt(()=>Qe.enum(["managed","user","project","local"])),Kz=mt(()=>Qe.object({scope:Vz().describe("Installation scope"),projectPath:Qe.string().optional().describe("Project path (required for project/local scopes)"),installPath:Qe.string().describe("Absolute path to the versioned plugin directory"),version:Qe.string().optional().describe("Currently installed version"),installedAt:Qe.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:Qe.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:Qe.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:Qe.string().optional().describe("Tag-derived semver this install resolved to"),auto:Qe.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...Cd(),...Td(),...Dd(),...Rd()})),WX=mt(()=>Qe.object({version:Qe.literal(2).describe("Schema version 2"),plugins:Qe.record(jo(),Qe.array(Kz())).describe("Map of plugin IDs to arrays of installation entries")})),$X=mt(()=>Qe.object({version:Qe.literal(2),plugins:Qe.record(Qe.string(),Qe.unknown())}));var Yz=mt(()=>Qe.object({source:yz().describe("Where to fetch the marketplace from"),installLocation:Qe.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:Qe.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:Qe.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),VX=mt(()=>Qe.record(Qe.string(),Yz()));import*as qd from"zod/v4";function Wr(l){return l==="true"?!0:l==="false"?!1:l}var $r=["aspell","hunspell","ispell"];import*as Pn from"zod/v4";var Xz=["autoMode","deepLink","voice","briefView","screenReader"],Oi={},Vr={autoMode:{buildGate:()=>!1,shape:()=>Oi,permissionsShape:()=>Oi,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:Pn.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:Pn.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:Pn.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>Oi}};function ho(){return Xz.filter((l)=>Vr[l].buildGate())}function Qd(l){let b={};for(let D of l)b={...b,...Vr[D].shape()};return b}function eu(l){let b={};for(let D of l)b={...b,...Vr[D].permissionsShape?.()};return b}function Ai(l){let b=[];for(let D of l)b.push(...Vr[D].permissionModes?.()??[]);return b}import*as Eo from"zod/v4";var Jz=64;class Kr{fields;activeWhenAbsent;keys;built=new Map;byPresentKeys=new Map;wholeSchema;constructor(l,b=new Set){this.fields=l;this.activeWhenAbsent=b;this.keys=Object.keys(l).filter((D)=>l[D]!==void 0)}has(l){return Object.hasOwn(this.fields,l)&&this.fields[l]!==void 0}field(l){let b=this.built.get(l);if(b)return b;let D=this.has(l)?this.fields[l]:void 0;if(!D)return;let te=D();return this.built.set(l,te),te}carries(l,b){return this.activeWhenAbsent.has(b)||typeof l==="object"&&l!==null&&b in l}whole(){return this.wholeSchema??=Eo.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(l,b="passthrough"){let D=this.keys.filter(($e)=>this.carries(l,$e));if(D.length===this.keys.length&&b==="passthrough")return this.whole();let te=`${b}
|
|
37
|
-
${D.join(`
|
|
38
|
-
`)}`,ce=this.byPresentKeys.get(te);if(ce)return this.byPresentKeys.delete(te),this.byPresentKeys.set(te,ce),ce;let Oe=this.shapeOf(D),xe=b==="strip"?Eo.preprocess(($e,et)=>{for(let rt of this.wrongDocumentIssues($e,Oe))et.addIssue(rt);return $e},Eo.object(Oe)):Eo.object(Oe).passthrough().check(($e)=>{$e.issues.push(...this.wrongDocumentIssues($e.value,Oe))});if(this.byPresentKeys.size>=Jz)for(let $e of this.byPresentKeys.keys()){this.byPresentKeys.delete($e);break}return this.byPresentKeys.set(te,xe),xe}wrongDocumentIssues(l,b){if(typeof l!=="object"||l===null)return[];let D=[];for(let te of Object.keys(l))if(!Object.hasOwn(b,te)&&this.has(te))D.push({code:"custom",input:l[te],path:[te],message:"This settings schema was built for a document without this key"});return D}shapeOf(l){let b={};for(let D of l){let te=this.field(D);if(te)b[D]=te}return b}}import*as Jr from"zod/v4";var tu={Task:"Agent",KillShell:"TaskStop",KillBash:"TaskStop",ListPeers:"ListAgents",Brief:"SendUserMessage",ListMcpResources:"ListMcpResourcesTool",ReadMcpResource:"ReadMcpResourceTool",ReadMcpResourceDir:"ReadMcpResourceDirTool"};function bi(l){return Object.hasOwn(tu,l)?tu[l]:l}var nu="workspace",tJ=`mcp__${nu}__bash`,nJ=`mcp__${nu}__web_fetch`;function Yr(l){return l.includes("*")}function Zz(l){return l.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function qz(l){return Qz(l).replaceAll("\\\\","\\")}function Qz(l){return l.replaceAll("\\(","(").replaceAll("\\)",")")}function Ci(l){let b=eF(l,"("),D=tF(l,")");if(b===-1&&D===-1)return{kind:"bare"};let te=l.substring(0,b);if(b===-1||D<=b||D!==l.length-1||/[()]/.test(te))return{kind:"malformed"};return{kind:"call",toolName:te,rawContent:l.substring(b+1,D)}}function ou(l){let b=Ci(l);if(b.kind!=="call"||!b.toolName)return{toolName:bi(l)};if(b.rawContent===""||b.rawContent==="*")return{toolName:bi(b.toolName)};let D=qz(b.rawContent);return{toolName:bi(b.toolName),ruleContent:D}}function Vn(l){if(!l.ruleContent)return l.toolName;let b=Zz(l.ruleContent);return`${l.toolName}(${b})`}function eF(l,b){for(let D=0;D<l.length;D++)if(l[D]===b){let te=0,ce=D-1;while(ce>=0&&l[ce]==="\\")te++,ce--;if(te%2===0)return D}return-1}function tF(l,b){for(let D=l.length-1;D>=0;D--)if(l[D]===b){let te=0,ce=D-1;while(ce>=0&&l[ce]==="\\")te++,ce--;if(te%2===0)return D}return-1}function Ti(l){let b=l.split("__"),[D,te,...ce]=b;if(D!=="mcp"||!te)return null;let Oe=ce.length>0?ce.join("__"):void 0;return{serverName:te,toolName:Oe}}var cJ=new RegExp("\x00ESCAPED_STAR\x00","g"),dJ=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var uJ=new RegExp("\x00GLOBSTAR\x00","g");function ru(l){return l.match(/^(.+):\*$/)?.[1]??null}function su(l){let b=l.trimEnd();if(!b.endsWith("*"))return!1;let D=0,te=b.length-2;while(te>=0&&b[te]==="\\")D++,te--;return D%2===0}var Xr={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(l)=>{if(l.includes("*")||l.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(l)=>{if(l.includes("://")||l.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!l.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function Ri(l){return Xr.filePatternTools.includes(l)}function iu(l){return Xr.bashPrefixTools.includes(l)}function au(l){return Object.hasOwn(Xr.customValidation,l)?Xr.customValidation[l]:void 0}function du(l,b){let D=0,te=b-1;while(te>=0&&l[te]==="\\")D++,te--;return D%2!==0}function lu(l,b){let D=0;for(let te=0;te<l.length;te++)if(l[te]===b&&!du(l,te))D++;return D}var nF=/(?:^|[^\\])\\[()]/;function oF(l){return nF.test(l)&&lu(l,"(")!==lu(l,")")}var rF=/^(?:[|&;<>]|\d+[<>])/;function sF(l){return rF.test(l)}function Di(l){for(let b=0;b<l.length;b++)if(l[b]==="*"&&!du(l,b))return!0;return!1}function iF(l){if(l.endsWith(":*"))return;let b=l.trim().split(/\s+/).filter(Boolean),D=b[0];if(b.length<3||D===void 0||Di(D))return;let te=!1;for(let ce of b.slice(1)){if(sF(ce))return;if(Di(ce)){te=!0;continue}if(ce.startsWith("-"))continue;return te?D:void 0}return}function cu(l){if(!Yr(l))return null;let b=Ti(l);if(b&&!Yr(b.serverName))return null;return{valid:!1,error:`Wildcard tool name "${l}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens — globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function Li(l,b){if(!l||l.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let D=Ci(l);if(D.kind==="malformed")return{valid:!1,error:"Malformed Tool(content) rule",suggestion:'Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal'};if(D.kind==="call"&&D.rawContent===""){if(!D.toolName)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${D.toolName}" without parentheses`,examples:[`${D.toolName}`,`${D.toolName}(some-pattern)`]}}let te=ou(l),ce=Ti(te.toolName);if(ce){if(D.kind==="call")return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${te.toolName}" without parentheses, or use "mcp__${ce.serverName}__*" for all tools`,examples:[`mcp__${ce.serverName}`,`mcp__${ce.serverName}__*`,ce.toolName&&ce.toolName!=="*"?`mcp__${ce.serverName}__${ce.toolName}`:void 0].filter(Boolean)};if(b==="allow"){let xe=cu(te.toolName);if(xe)return xe}return{valid:!0}}if(!te.toolName||te.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(b==="allow"){let xe=cu(te.toolName);if(xe)return xe}if(!te.toolName.includes("_")&&te.toolName[0]!==te.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Pe(String(te.toolName))}"`};if(D.kind==="call"&&oF(D.rawContent)){let xe=Ri(te.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:xe?"Write a Windows path with forward slashes, or spell a literal parenthesis as [(] or [)]":'Double a backslash that is a path separator ("\\\\("), and escape literal parentheses in pairs',examples:xe?[`${te.toolName}(C:/Projects/(drafts)/**)`,`${te.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${te.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let Oe=au(te.toolName);if(Oe&&te.ruleContent!==void 0){let xe=Oe(te.ruleContent);if(!xe.valid)return xe}if(iu(te.toolName)&&te.ruleContent!==void 0){let xe=te.ruleContent;if(xe===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(b==="allow"){let et=iF(xe);if(et!==void 0){let rt=et==="git",tt=rt?" For git, options such as -c and --exec-path can run arbitrary commands.":"",ct=rt?" (for example Bash(git status *))":"";return{valid:!0,warning:`${Vn(te)} has a wildcard before the rest of the command, so it also matches any options inserted at that position and approves them without a prompt.${tt} Replace that * with the exact value you mean, or only use * after the subcommand${ct}.`}}}let $e=ru(xe)?.trimEnd();if($e!==void 0){if(Di($e)){let et=su($e),rt=et?"matches only commands containing a literal * at that position":"will likely never match",tt=et?$e:`${$e}*`,ct=b==="allow"?" Replace that * with the exact value you mean.":tt.endsWith(":*")?"":` Use ${Vn({toolName:te.toolName,ruleContent:tt})} for wildcard matching.`;return{valid:!0,warning:`${Vn(te)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${rt}.${ct}`}}}else if(xe.includes(":*")&&!xe.endsWith(":*")){let et=b==="allow"?"Replace that :* with the exact value you mean.":"It already matches as a * wildcard; moving :* to the end would make it a literal prefix and change which commands match.";return{valid:!0,warning:`${Vn(te)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${et}`}}}if(Ri(te.toolName)&&te.ruleContent!==void 0){if(te.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${te.toolName}(*.ts) - matches .ts files`,`${te.toolName}(src/**) - matches all files in src`,`${te.toolName}(**/*.test.ts) - matches test files`]}}if(te.ruleContent!==void 0){let xe=te.toolName==="Write"||te.toolName==="NotebookEdit"||te.toolName==="MultiEdit"?"Edit":te.toolName==="Glob"?"Read":void 0;if(xe!==void 0&&!te.ruleContent.includes(":*"))return{valid:!0,warning:`${Vn(te)} is not matched by file permission checks — only ${xe}(path) rules are. Use ${Vn({toolName:xe,ruleContent:te.ruleContent})} instead (${xe} rules cover all file-${xe==="Edit"?"editing":"reading"} tools).`}}return{valid:!0}}var Ii=mt(()=>pu()),uu=mt(()=>pu("allow"));function pu(l){return Jr.string().superRefine((b,D)=>{let te=Li(b,l);if(!te.valid){let ce=te.error;if(te.suggestion)ce+=`. ${te.suggestion}`;if(te.examples&&te.examples.length>0)ce+=`. Examples: ${te.examples.join(", ")}`;D.addIssue({code:Jr.ZodIssueCode.custom,message:ce,params:{received:b}})}})}var Ko=["accept","hold","refuse"],es=["off","basic","full"],aF=mt(()=>Ve.record(Ve.string(),Ve.coerce.string()));function Cu(l){return Ve.object({allow:Ve.array(uu()).optional().describe("List of permission rules for allowed operations"),deny:Ve.array(Ii()).optional().describe("List of permission rules for denied operations"),ask:Ve.array(Ii()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:Ve.preprocess(po,Ve.enum([...zn,...Ai(l)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:Ve.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:Ve.boolean().optional().describe('Refuse file-tool reads (Read, Grep, Glob, LSP) outside the working directories in every permission mode; true in any settings source wins. Also set when the user picks "block" on the one-time auto-mode prompt for a read outside the working directories.'),...eu(l),additionalDirectories:Ve.array(Ve.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var QJ=mt(()=>Cu(ho())),lF=mt(()=>Ve.union([Ve.string(),Ve.object({}).passthrough().describe('{ id: stable id (letters, digits, ".", "_", "-"; max 64), text: the tip (max 500 characters, one line), cooldownSessions?: sessions to wait before showing it again (default 0), priority?: tie-break weight among never-shown tips (default 0) }')])),cF=mt(()=>Ve.preprocess((l)=>Array.isArray(l)?l.filter((b)=>typeof b==="string"||!!b&&typeof b==="object"&&!Array.isArray(b)):[],Ve.array(lF()))),Mi=mt(()=>Ve.object({source:Bo().describe("Where to fetch the marketplace from"),installLocation:Ve.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:Ve.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Ui=mt(()=>{let l=()=>Ve.number().min(0).max(1e4);return Ve.object({input:l(),output:l(),cacheRead:l(),cacheWrite:l()})}),Hi=mt(()=>Ve.number().gt(0).lte(10).optional()),zi=mt(()=>Ve.object({model:Ve.string().describe('Model to select, taken verbatim: an alias ("opus"), an Anthropic model ID, or a provider-format ID (Vertex, Bedrock, gateway). Same values --model accepts.'),label:Ve.string().optional().describe("Row title. Defaults to the model name."),description:Ve.string().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:Ve.string().optional().describe("For a model this version of Claude Code does not know: the ID of a model it does know "+'(e.g. "claude-opus-4-8") whose client-side handling — prompt profile, capability and effort '+"defaults — applies to it. Changes neither the row's label nor the model ID sent. Without it, "+"a model-catalog row for a model this version does not know is not offered until Claude Code is updated.")})),ts=mt(()=>Ve.object({serverName:Ve.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:Ve.array(Ve.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:Ve.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((l)=>Me([l.serverName!==void 0,l.serverCommand!==void 0,l.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),ns=mt(()=>Ve.object({serverName:Ve.string().min(1,"Server name must be non-empty").refine((l)=>l.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((l)=>l===l.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:Ve.array(Ve.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:Ve.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((l)=>Me([l.serverName!==void 0,l.serverCommand!==void 0,l.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Tu=mt(()=>Ve.object({marketplace:Ve.string(),plugin:Ve.string()})),dF=mt(()=>Ve.preprocess((l)=>{if(typeof l!=="string"||!jo().safeParse(l).success)return l;let b=l.indexOf("@");return{marketplace:l.slice(b+1),plugin:l.slice(0,b)}},Tu())),uF=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function pF(l){let b=l.replaceAll("/","\\");if(W(b))return!1;return/^\\{2}[^\\]/.test(b)}function fF(l){return Q(l)||/^\/network\/servers(\/|$)/i.test(l)||se(l)}function mF(l){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(l)}function gF(l,b,D={}){if(b==="win32"){let te=l.replaceAll("/","\\");if(W(te))return!1;let ce=pF(te);if(D.rejectUnc&&ce)return!1;if(D.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(te)&&!ce&&/^(\\|[A-Za-z]:)/.test(te))return!1}if(bu.normalize(te)!==te)return!1;let Oe=te.split("\\");if(Oe.some(($e)=>$e==="."||$e===".."))return!1;if(Oe.some(($e,et)=>/[. ]$/.test($e)||$e.includes(":")&&!(et===0&&/^[A-Za-z]:$/.test($e))))return!1;let xe=te.startsWith("\\\\")?te.slice(2):te;if(/\\{2}/.test(xe))return!1;return!te.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(te)}if(D.rejectNetworkRoot&&fF(l))return!1;if(D.rejectMagicLinkRoot&&mF(l))return!1;if(Au.normalize(l)!==l)return!1;if(l.split("/").some((te)=>te==="."||te===".."))return!1;if(/\/{2}/.test(l))return!1;return!l.endsWith("/")||l==="/"}var hF=/\.(exe|ps1)$/i;function EF(l){return/\.ps1$/i.test(l)}function _F(l){return EF(l)&&/[[\]`*?]/.test(l)}var SF='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',yF=()=>Ve.string().describe("Absolute path to the helper executable"),xn=(l)=>Ve.preprocess((b)=>b===null?void 0:b,l.optional()).optional(),OF=Le,fu=(l)=>Ve.number().int().min(l).transform((b)=>Math.min(b,OF)),mu=["path","script","defaultSettings"];function Ru(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;let b=l;return mu.some((D)=>b[D]===null)&&mu.every((D)=>b[D]===null||b[D]===void 0)}var gu=64,qr=mt(()=>Ve.object({path:yF(),timeoutMs:xn(fu(1000)),refreshIntervalMs:xn(Ve.union([Ve.literal(0),fu(60000)]))})),Du=()=>Ve.enum(["replace","merge"]).describe("How the helper's managedSettings compose with the settings of the source that delivered this entry: 'replace' (default) — the output is the policy; 'merge' — the output is deep-merged over that source's own settings the way merged managed sources compose (helper scalars win, arrays union, objects merge — except fallbackModel, forceLoginOrgUUID, gatewayInternalNetworks, sandbox.filesystem.allowRead, sandbox.credentials.awsPairs, sandbox.ripgrep and the restriction allowlists such as allowedMcpServers, availableModels and allowedHttpHookUrls, which are the helper's whole value when it emits one; tighten a permission with a deny), so a failed helper costs only the delta");function Lu(l){return l==="continue"||l==="refuse"}var AF=()=>Ve.preprocess((l)=>l===void 0||Lu(l)?l:"refuse",Ve.enum(["continue","refuse"]).describe(`What happens when this entry's helper fails at startup (bad path, missing file or interpreter, non-zero exit, timeout, oversize or invalid output) and no static settings payload (this entry's own, the linux entry's on WSL, or the map's "default") applies in its place: 'refuse' — Claude Code does not start, naming the failure; 'continue' — Claude Code starts without the helper's output, on the delivering source's own settings, with a /status notice. Default: 'refuse' when the entry comes from MDM or the managed settings file, 'continue' when it comes from remote managed settings. Any other value is treated as 'refuse', with a /status notice. The install and update commands start no session and are never refused over a remote entry: they report the refusal in /status. An entry whose other fields fail validation runs no helper; from MDM or the managed settings file, any value but 'continue' on it then refuses to start Claude Code until the entry is fixed, unless a static settings payload (the entry's own, kept when it validates, the linux entry's for a wsl one, or the map's "default") serves in its place. From remote, a non-interactive session runs the helper off settings verified this session without the interactive approval, so 'refuse' there too means the helper ran and failed; a launch whose remote settings could not be verified this session (offline, fetch failed) starts without the helper regardless; and a failure first reached after the session has started (settings verified or approved mid-session, which on a machine that only ever runs non-interactively is every launch) ends a session no person watches (non-interactive, a background session no client is attached to, or a teammate session) as the refused start would have, and leaves a watched interactive one (a terminal, with or without remote control, or an attached background session) running under a /status notice with its next start refused. Background refresh failures always keep the last good output whatever this says`)),bF=5,CF=()=>Ve.number().int().min(0).transform((l)=>Math.min(l,bF)).describe("How many more times to run this entry's helper when a run fails to execute — it could not be launched, exited non-zero, or was stopped at timeoutMs — before that counts as a failure (a non-negative integer; default 0, a single attempt; above 5 is treated as 5). Attempts are separated by a short randomized backoff (from 250 ms, doubling per attempt, at most 4 s each) and each attempt gets the full timeoutMs, so a start that waits on the helper can wait up to (retries + 1) × timeoutMs plus the backoff. Output the helper did produce and that was refused — oversized, not a JSON object, an invalid envelope, or settings that fail validation — is not retried, and neither is an invalid path. Applies alike at startup and on each background refresh; only once the attempts are used up do the entry's failure rules (a static settings payload in its place, onFailure, the refresh notice) apply, naming the last attempt's failure"),TF=(l)=>(l==="windows"?Ve.literal("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):Ve.literal("sh",{message:"interpreter must be 'sh' on macos/linux/wsl"})).describe("Fixed interpreter for `script`: 'sh' (/bin/sh) on macos/linux/wsl entries; 'pwsh' (PowerShell at its fixed install locations, never PATH) on the windows entry"),RF="exactly one of path/script must be configured",DF='"script" and "interpreter" must be configured together',LF="script must be ASCII-only on Windows (PowerShell decodes stdin with the console OEM code page); spell non-ASCII characters as escapes, e.g. [char]0x00E9",IF=(l)=>Ve.string({message:"script must be a string"}).min(1,{message:"script must not be empty"}).max(65536,{message:"script must be at most 65536 characters"}).refine((b)=>!b.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((b)=>Ie(b),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((b)=>l!=="windows"||!/[\u0080-\uffff]/.test(b),{message:LF}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var Vt=["macos","linux","windows","wsl"];function Fi(l){return l==="wsl"?["wsl","linux"]:[l]}function PF(l){return l==="windows"?"win32":"posix"}function xF(l){return{rejectDriveRelative:l==="windows",rejectUnc:l==="windows",rejectNetworkRoot:l!=="windows",rejectMagicLinkRoot:l!=="windows",requireWin32ExecutableSuffix:l==="windows"}}function wF(l){let b=PF(l),D=xF(l);return Ve.string().max(1024,{message:"path must be at most 1024 characters"}).refine((te)=>!uF.test(te),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((te)=>(b==="win32"?bu:Au).isAbsolute(te),{message:"path must be absolute"}).refine((te)=>!(b==="win32"&&D.requireWin32ExecutableSuffix)||hF.test(te),{message:"path must end in .exe or .ps1 on Windows"}).refine((te)=>b!=="win32"||!_F(te),{message:SF}).refine((te)=>gF(te,b,D),{message:b==="win32"?'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, no component ending in "." or a space, no ":" outside the drive letter, no device-namespace (\\\\?\\) prefix, no drive-relative (\\dir or C:name) or UNC (\\\\server\\share) form':'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, and not under a network automount root (/net/<host>, /Network/Servers, or macOS /.vol /.file /.nofollow /.resolve) or a kernel magic-link root (/proc, /dev/fd)'}).describe("Absolute path to the helper executable")}var Bi=[...Vt,"default"],xi=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],Zr=["managedSettings","appendSystemPrompt"],Kn=mt(()=>Ve.record(Ve.string(),Ve.unknown()).superRefine((l,b)=>{for(let D of["policyHelper","policyHelpers"])if(l[D]!==void 0&&l[D]!==null)b.addIssue({code:"custom",message:`must not contain "${D}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let D of xi)if(l[D]!==void 0&&l[D]!==null)b.addIssue({code:"custom",message:`must not contain "${D}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${xi.join("/")}) belong on the per-OS entries (policyHelpers.${Vt.join("/")})`});for(let D of Zr)if(l[D]!==void 0&&l[D]!==null)b.addIssue({code:"custom",message:`must not contain "${D}" — a static payload is the managedSettings SUBTREE, not the helper's stdout envelope; paste the object your helper emits UNDER "managedSettings", not the envelope around it`});for(let D of Bi)if(l[D]!==void 0&&l[D]!==null)b.addIssue({code:"custom",message:`must not contain "${D}" — a static payload is the VALUE of a policyHelpers key (a managed-settings object), never another policyHelpers map; don't paste the map or its "${D}" line inside the slot`})})),NF='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function vF(l){let{path:b,script:D,interpreter:te,defaultSettings:ce}=l;if(b!==void 0&&D!==void 0)return RF;if(D===void 0!==(te===void 0))return DF;if(b===void 0&&D===void 0&&ce===void 0)return NF;return null}function Iu(l,b){return qr().omit({path:!0}).extend({path:xn(wF(l)),script:xn(IF(l)),interpreter:xn(TF(l)),outputBehavior:xn(Du()),onFailure:xn(AF()),retries:xn(CF()),defaultSettings:Ve.preprocess((D)=>D===null?void 0:D,b.optional()).optional()}).check((D)=>{if(D.issues.length>0)return;let te=vF(D.value);if(te!==null)D.issues.push({code:"custom",message:te,input:D.value})})}var e4=mt(()=>Iu("linux",Kn()));function wi(l,b=Kn()){return l==="default"?Kn():Iu(l,b)}var kF=mt(()=>Ve.object(Object.fromEntries(Bi.map((l)=>[l,Ve.preprocess((b)=>{if(b===null)return;if(l!=="default"&&Ru(b))return;return b},wi(l).optional()).optional()])))),Ni=["skills","agents","hooks","mcp"];function Pu(l){return Ve.preprocess((b)=>{if(!Array.isArray(b))return b;let D=b.filter((te)=>Ni.includes(te));if(D.length<b.length)l?.(b.length-D.length);return D},Ve.union([Ve.boolean(),Ve.array(Ve.enum(Ni))]))}function xu(){return Ve.union([Ve.array(Ve.string()),Ve.boolean(),Ve.undefined()])}var hu=Object.freeze({type:"invalid-entry-stripped"}),MF=mt(()=>Ve.union([Ve.object({type:Ve.literal("regex").describe('Config variant. This client understands "regex": matches turn output and builds a URL from named capture groups. Entries with other variants are preserved but skipped at runtime.'),pattern:Ve.string().describe("Regex matched against turn output (tool results and assistant text)"),url:Ve.string().describe("Link target. {name} placeholders are filled from named regex capture groups, e.g. (?<id>...) -> {id}. Values are URL-encoded; the origin must be literal in the template. The scheme must be https, http, or a recognized editor or workspace deep-link scheme: vscode, vscode-insiders, cursor, windsurf, zed, jetbrains, idea, slack, linear, notion, figma."),label:Ve.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),Ve.object({type:Ve.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),UF=()=>Ve.number().int().min(zc).max(Fc).optional().catch(void 0);function wu(l,{strictPolicyHelperKeys:b=!1}={}){function D(ce){return Ve.record(Ve.string(),Mi()).check((Oe)=>{for(let[xe,$e]of Object.entries(Oe.value))if($e.source.source==="settings"&&$e.source.name!==xe)Oe.issues.push({code:"custom",input:$e.source.name,path:[xe,"source","name"],message:`Settings-sourced marketplace name must match its ${ce} key (got key "${xe}" but source.name "${$e.source.name}")`})})}let te=(ce,Oe)=>b?Ve.preprocess((xe)=>{if(xe===null)return;return Oe?Oe(xe):xe},ce):ce.catch(void 0);return{$schema:()=>Ve.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:()=>Ve.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:()=>Ve.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:()=>Ve.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:()=>Ve.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:()=>Ve.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:()=>Ve.string().optional().describe("Corporate launcher argv prefix for the background-agent supervisor, the sessions and workers it hosts, and the other covered background processes listed in the Claude Code corporate-launcher documentation. Equivalent to the CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when set. Honored from managed settings, a --settings/SDK-supplied settings file, and user settings, in that precedence order; project and local settings are ignored."),policyHelper:()=>te(qr().optional(),(ce)=>ce&&typeof ce==="object"&&!Array.isArray(ce)&&ce.path===null?void 0:ce).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:()=>te(kF().optional()).describe(`@internal Per-OS variant of policyHelper, keyed by platform: macos, linux, windows, wsl, plus an optional "default" entry that is a STATIC settings payload (a JSON object of managed settings, not a helper). Each per-OS entry carries a helper — a "path", or an inline "script" + "interpreter" delivered to a fixed interpreter over stdin, either with timeoutMs/refreshIntervalMs — its own static "defaultSettings" payload, or both; an entry may be payload-only. Selection for a platform walks its chain (the platform's own entry; on wsl the linux entry next): the first helper on the chain wins over policyHelper; if no helper is configured — or the selected helper fails at startup or refresh — the first payload applies (the chain's "defaultSettings" in platform-specific-first order, then the top-level "default", applied with no process spawned; unrecognized platforms reach only "default"); with no payload either, policyHelper. Honored from admin-controlled policy sources, and from remote managed settings — a payload of plain policy as delivered, like any other remote key; a helper, or a payload carrying anything the managed-settings approval dialog lists, only once the settings are verified this session and approved there (policyHelper itself is never honored from remote).`),...On.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:()=>Ve.object({issuer:Ve.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:Ve.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:Ve.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:()=>Ve.object({type:Ve.literal("command"),command:Ve.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:()=>Ve.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:()=>Ve.object({enabled:Ve.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:Ve.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 30). Re-fires every interval until you take a break."),breakThresholdMinutes:Ve.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:Ve.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks — just a friendly heads-up."),quietHours:()=>Ve.object({enabled:Ve.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:Ve.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:Ve.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:()=>Ve.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),desktopSessionCleanupPeriodDays:()=>Ve.number().int().nonnegative().optional().describe("Retention ceiling in days for session transcripts created or last written by a desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed because this setting never disables writes — it only bounds an exemption from deletion. The ceiling is a hard cap: it also bounds an active archive grace, so the grace window of a release marker never keeps files past the ceiling. Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below cleanupPeriodDays effectively disables the exemption: those transcripts age out on the regular cleanupPeriodDays schedule, so the effective retention is whichever of the two periods is longer."),syncClaudeAiSkills:()=>Ve.boolean().optional().describe("Set to false to turn off syncing of the skills you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced skills (~/.claude/skills/synced) can no longer be run, are hidden from every session started afterwards, and are moved to ~/.claude/skills/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced skills are blocked and hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored — the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced skills are available in every session, re-synced every 10 minutes, and removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),syncClaudeAiPlugins:()=>Ve.boolean().optional().describe("Set to false to turn off syncing of the plugins you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced plugins (~/.claude/plugins/synced) are hidden from every session started afterwards and moved to ~/.claude/plugins/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced plugins are hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored — the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced plugins load in every session like plugins you installed yourself (a plugin you installed with the same name takes precedence), are re-synced at each launch, and are removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),skillListingMaxDescChars:()=>Ve.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:()=>Ve.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:()=>Ve.boolean().optional().describe("When set to true in either admin-only Windows source — the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:()=>qt(()=>aF()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let ce=Ve.object({commit:Ve.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:Ve.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:Ve.boolean().optional().describe("Whether to append the claude.ai session link to commits and PRs created from web or Remote Control sessions (default: true). Set to false to omit the Claude-Session trailer and PR-body link."),...!1}).passthrough();return Ve.union([Ve.boolean(),ce],{error:(Oe)=>{let xe=(Oe.errors??[]).flat().filter((et)=>et.path.length>0);if(xe.length>0)return xe.map((et)=>`${et.path.join(".")}: ${et.message.replace(/^Invalid input: /,"")}`).join("; ");return`Expected false, true, or an object such as { "commit": "", "pr": "" }, but received ${Array.isArray(Oe.input)?"array":Oe.input===null?"null":typeof Oe.input}`}}).transform((Oe)=>{if(typeof Oe!=="boolean")return Oe;return Oe?{}:{commit:"",pr:"",sessionUrl:!1}}).pipe(ce).optional().describe('Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set. Set to false to hide all attribution, the same as { "commit": "", "pr": "", "sessionUrl": false }. Setting it to true is the same as leaving it out. Older Claude Code versions reject true or false here, so use the object form in settings files shared across versions.')},includeCoAuthoredBy:()=>Ve.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),...!1,...!1,includeGitInstructions:()=>Ve.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:()=>qt(()=>Cu(l)).describe("Tool usage permissions configuration"),model:()=>Ve.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:()=>Ve.array(Ve.string()).optional().describe('Fallback model(s) tried in order when the primary model is overloaded or unavailable. Each element accepts a model name or alias; "default" expands to the default model. CLI --fallback-model takes precedence.'),availableModels:()=>Ve.array(Ve.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows that version and any model ID that extends it, so "claude-opus-5" also allows "claude-opus-5-5"), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),enforceAvailableModels:()=>Ve.boolean().optional().describe("When true and availableModels is a non-empty array, the Default model selection is also constrained: if the default model for the user tier is not in availableModels, Default resolves to the first allowed availableModels entry instead. Has no effect when availableModels is unset or an empty array. Typically set in managed settings by enterprise administrators."),availableModelsMatch:()=>Ve.enum(["prefix","exact"]).optional().describe('How availableModels entries match model IDs. "prefix" (the default) lets an entry also allow any model ID that extends it, so "claude-opus-5" allows "claude-opus-5-5". "exact" keeps that matching but stops a model ID entry from allowing other versions: "claude-opus-5" allows Opus 5 and its dated and -fast IDs, but not Opus 5.5 or a later release until it is listed, and a -latest ID needs a -latest entry. Family aliases ("opus") still allow the whole family; aliases whose model depends on the release or settings (best, opusplan, default) are ignored. With "exact" and a list that names at least one model, the Default option also uses only a listed model; if none can be used, Claude Code will not start. Haiku background models, and hooks and other helper requests that pick their own model, are not restricted (deniedModels covers them; allowManagedHooksOnly limits hooks). Read from managed settings only.'),deniedModels:()=>Ve.array(Ve.string()).optional().describe('Models users cannot select, even when availableModels allows them. A family alias ("opus") blocks that family. A model ID blocks that version in every spelling: dates, -fast and provider prefixes are ignored, so "claude-opus-5-5" blocks every Opus 5.5 ID but not Opus 5. An ID with no minor version ("claude-opus-5") also blocks later minor versions, as it allows them in availableModels. Aliases whose model depends on the release or settings (best, opusplan, default) are ignored. The Default option steps down past a blocked model; if the Default has no allowed model to step down to, Claude Code will not start. Read from managed settings only.'),modelOverrides:()=>Ve.record(Ve.string(),Ve.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),modelPicker:()=>Ve.object({options:Ve.array(zi()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:Ve.boolean().optional().describe("When true, the picker shows only the Default row and these options — the built-in "+"lineup, gateway-discovered models and ANTHROPIC_CUSTOM_MODEL_OPTION are hidden. When false or unset, these options are added after the built-in lineup.")}).optional().describe("Curate the /model picker: an ordered list of models with your own labels, independent of the built-in lineup and of Claude Code releases. availableModels still applies to these rows. Honored from managed, --settings/SDK, and user settings only (not from a project checkout); the highest-precedence of those that defines modelPicker wins outright (no merging across sources). Typically set in managed settings by enterprise administrators."),modelPricing:()=>Ve.object({multiplier:Hi(),overrides:Ve.record(Ve.string(),Ui()).optional()}).optional().describe("Price usage at your organization's contracted rates instead of list price. "+"Affects every spend figure Claude Code reports — /cost, the status line, the SDK total_cost_usd, "+"--max-budget-usd, and the OpenTelemetry cost metric and events — which remain USD estimates, not an invoice "+'(the per-Mtok price labels in /model stay at list). "overrides" maps a model ID to its USD-per-million-token rates (input, output, cacheRead, '+"cacheWrite — all four required, each 0 to 10000; cacheWrite prices both 5-minute and 1-hour cache writes). "+"A matching row is charged exactly as written; fast-mode and US-data-residency surcharges are not added on top. "+'A key Claude Code itself uses for a built-in model — its ID such as "claude-sonnet-4-6", or its '+"first-party, Bedrock (any or no region prefix), Vertex or Foundry ID — covers every dated and provider form "+"of that model; any other key — a gateway model alias, or a spelling Claude Code does not itself use — "+'matches that model ID only (case-insensitive), and such an exact match wins over a built-in row. On Bedrock an application inference profile is matched by its backing model. An invalid row or multiplier is reported and skipped; the rest still apply. "multiplier" in (0, 10] scales every computed cost, overridden or not (0.85 = 85% of the price, 1.2 = 120%). Only honored from managed settings (server-managed, MDM / OS policy, or managed-settings.json), '+"or — when none of those sets it — when supplied by a host application that manages the model "+"provider; ignored in user, project, local and --settings sources."),...!1,enableAllProjectMcpServers:()=>Ve.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:()=>Ve.array(Ve.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:()=>Ve.array(Ve.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:()=>Ve.boolean().optional().describe("When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected. "+"Only gates auto-fetched connectors — a claudeai-proxy server passed explicitly "+"(e.g. via --mcp-config or the SDK mcpServers option) still follows the normal MCP config trust flow. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:()=>Ve.record(Ve.string(),Ve.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),disableBundledSkills:()=>Ve.boolean().optional().describe("Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1."),managedMcpServers:()=>qt(()=>Ve.record(Ve.string().refine(ei,{error:"server names may only contain letters, numbers, hyphens and underscores, and may not be __proto__, constructor or prototype"}),ti(),{error:ni})).describe(`MCP servers the organization provides to every user, keyed by server name, each with the .mcp.json entry shape; only "http" and "sse" servers are accepted (nothing that names a program to run, no \${VAR} references). Honored from managed settings only; users cannot remove them, deniedMcpServers still applies, and they need no allowedMcpServers entry. Not read in Claude Desktop's Code tab on a third-party deployment or in Cowork sessions, where Claude Desktop supplies and locks the session's MCP servers itself.`),allowedMcpServers:()=>qt(()=>Ve.array(ts())).describe("Enterprise allowlist of the MCP servers users may use. Governs servers users add (user, project and local config, --mcp-config, agent frontmatter, plugins, claude.ai connectors); servers the organization itself delivers (managedMcpServers, and managed-mcp.json entries that use no ${VAR} expansion) are allowed without being listed; a managed-mcp.json entry that uses ${VAR} expansion is still checked against this list. If undefined, all servers are allowed. If empty array, users can use no servers of their own. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:()=>qt(()=>Ve.array(ns())).describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:()=>qt(()=>Gn()).describe("Custom commands to run before/after tool executions"),worktree:()=>Ve.object({symlinkDirectories:Ve.array(Ve.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:Ve.array(Ve.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:Ve.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/<default-branch> for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:Ve.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly."),location:Ve.string().optional().catch(void 0).describe("Directory under which Claude Code Desktop creates the worktrees of SSH sessions that run on this machine (an absolute path or one starting with ~/), instead of <project>/.claude/worktrees. Read by the desktop app from the SSH host user settings; a location chosen in the desktop app's SSH connection settings takes precedence. The CLI (--worktree, EnterWorktree, agent isolation) does not read it yet.")}).optional().describe("Git worktree configuration: the CLI --worktree flag, EnterWorktree and agent isolation, plus the location Claude Code Desktop uses for SSH-session worktrees on this machine."),disableAllHooks:()=>Ve.boolean().optional().describe("Disable all hooks and statusLine execution: the hooks defined in settings files and by installed plugins. Features built into Claude Code are not hooks in this sense and keep working; each has its own switch."),disableAgentView:()=>Ve.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:()=>Ve.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:()=>Ve.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),disableArtifact:()=>Ve.boolean().optional().describe("Deprecated: use enableArtifact: false. Still honored — true disables the Artifact tool; false is ignored."),enableArtifact:()=>Ve.boolean().optional().describe("Turn the Artifact tool on or off. Off in any of managed, --settings, or user settings wins; project and local settings can only turn it off. Unset defaults to on once the feature is available."),enableWorkflows:()=>Ve.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:()=>Ve.enum(["unrestricted","small","medium","large"]).optional().describe('Advisory size guideline for the dynamic workflows Claude writes: "small" aims for fewer than 5 agents, "medium" fewer than 10, "large" fewer than 50, and "unrestricted" sends no guideline. Unset defaults to "medium", or "small" on Pro plans. A value here — including from managed settings — takes precedence over the "Dynamic workflow size" choice in /config, and that /config row is hidden while a settings file provides the key. This is a guideline, not an enforced limit.'),workflowKeywordTriggerEnabled:()=>Ve.boolean().optional().describe('Enable the "ultracode" keyword trigger: including the keyword in a prompt opts that turn into the Workflow tool. Set to false to disable the trigger. Default: true.'),disableSkillShellExecution:()=>Ve.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:()=>Ve.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashEditDiffEnabled:()=>Ve.boolean().optional().describe("Whether the Bash tool shows a diff of the files a Bash command changed (PostToolUse Bash hooks get the changed-file list in tool_response). Set to false to turn that off. Default: on when the Bash tool handles file edits. Only user, flag or policy settings can turn it on outside auto and bypassPermissions modes."),bashOutputMaxChars:()=>Ve.number().int().positive().optional().catch(void 0).describe("How many characters of a successful Bash or PowerShell command's output Claude receives inline (default 30000; values clamp to 4000-128000). Output past this is saved to a file and Claude receives a short preview plus the path. When set, this also replaces BASH_MAX_OUTPUT_LENGTH, which on its own only sizes the read-back window."),taskOutputMaxChars:()=>Ve.number().int().positive().optional().catch(void 0).describe("Deprecated: no longer has any effect (the TaskOutput tool was removed). Read a background task's output file with the Read tool instead."),respondToBashCommands:()=>Ve.boolean().optional().describe("Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true."),allowManagedHooksOnly:()=>Ve.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings and from plugins that managed settings enable run. User, project, and local hooks and the hooks of plugins the user installed are ignored. Features built into Claude Code are not hooks in this sense and keep working."),allowedHttpHookUrls:()=>Ve.array(Ve.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:()=>Ve.array(Ve.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:()=>Ve.boolean().optional().describe("When true (and set in managed settings), permission rules from user, project, local, and --settings files and allow rules from --allowedTools are ignored; only managed settings can add allow rules through settings. "+"The allowed-tools frontmatter of skills and custom commands from user, project, and --add-dir sources, and of plugins no managed setting vouches for, is ignored too. Plugins keep theirs only on an admin-backed channel: host-delivered --plugin-dir plugins, the official marketplace registered from its unpinned anthropics source, claude.ai-synced plugins Anthropic attests, the saved login organization's claude.ai-hosted marketplaces, marketplaces whose registered source managed extraKnownMarketplaces declares or an exact or owner-pinned (owner/*) strictKnownMarketplaces entry names at the path it pins (an npm marketplace source only when the registration and the declared entry pin the same registry, and a settings marketplace source only when every nested npm plugin entry pins one on a bare package name — unpinned, the package resolves through the member's own npm config, and a non-bare spelling packs as an exotic spec the pin does not bind, so nothing an entry names is what was fetched), and npm-direct (package@npm) plugins whose recorded resolution a registry-pinned managed npm strictKnownMarketplaces entry names (host and path patterns and enabledPlugins ids do not vouch); managed and bundled skills keep theirs. "+"--disallowedTools, skill disallowed-tools, and other deny and ask rules from the command line or the current session still apply."),allowManagedMcpServersOnly:()=>Ve.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:()=>Ve.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),allowClaudeInChromeWithManagedMcp:()=>Ve.boolean().optional().describe("When true (and set in device managed settings: MDM, the managed-settings.json file, or a policy helper those configure), the built-in Claude in Chrome MCP server can run alongside managed-mcp.json instead of being blocked by its exclusive-control lockdown. deniedMcpServers and the organization's Claude in Chrome setting still block it. Default off preserves the lockdown."),strictPluginOnlyCustomization:()=>Pu().optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:()=>Ve.object({type:Ve.literal("command"),command:Ve.string(),padding:Ve.number().optional(),refreshInterval:Ve.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:Ve.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:()=>Ve.string().optional().describe('URL template for PR links in the footer link badges and inline messages. The detected git PR is rendered as the first footer-link badge. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),footerLinksRegexes:()=>Ve.array(MF().catch(hu)).transform((ce)=>ce.filter((Oe)=>Oe!==hu)).optional().catch(void 0).describe("Extra clickable footer badges that appear when a regex matches turn output (tool results and assistant responses). Read from user, flag, and managed settings only; ignored in project .claude/settings.json and local .claude/settings.local.json. At most 5 badges render; the oldest is displaced by newer matches and /clear removes them. Use to surface IDs printed by project CLIs as session links."),subagentStatusLine:()=>Ve.object({type:Ve.literal("command"),command:Ve.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:()=>Ve.record(Ve.string(),xu()).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json — setting false in ~/.claude/settings.json is overridden by the project.'),prependPlugins:()=>Ve.array(Ve.string()).optional().catch(void 0).describe("Managed plugins (plugin@marketplace ids that managed enabledPlugins sets true) whose hooks run first, outermost, in the listed order: the first id listed sees every event before any other plugin and every result after it. Managed plugins not listed here or in appendPlugins follow the listed ones; user, project and marketplace plugins come after those; then appendPlugins; then the built-in plugins. The bundled sec-default@builtin seats itself outermost (on a machine with managed settings and for Team and Enterprise organizations) unless this list is set, in which case list sec-default@builtin where it should sit or leave it out. Any other id that is not an enabled managed plugin is skipped; an id listed in both keys is prepended. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources."),appendPlugins:()=>Ve.array(Ve.string()).optional().catch(void 0).describe("Managed plugins (plugin@marketplace ids that managed enabledPlugins sets true) whose hooks run last among plugins, innermost, in the listed order: the last id listed sits just above the built-in plugins and sees each event as every other plugin left it. Only honored from managed settings (or, on a machine with none, from user settings for your own plugins); ignored in project, local and --settings sources."),extraKnownMarketplaces:()=>qt(()=>D("extraKnownMarketplaces")).describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),additionalMarketplaces:()=>qt(()=>D("additionalMarketplaces")).describe("Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled "+"extraKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored "+"with a warning. Claude Code may rewrite this key as extraKnownMarketplaces when it updates the file. Clients older than this alias ignore it, so prefer extraKnownMarketplaces while older Claude Code versions still share the same settings."),strictKnownMarketplaces:()=>qt(()=>Ve.array(Go())).describe('Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these sources can be added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to allow every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem. '+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),allowedMarketplaces:()=>qt(()=>Ve.array(Go())).describe("Alias for strictKnownMarketplaces (managed settings only): this key is read exactly as if it "+"were spelled strictKnownMarketplaces. Do not set both in one file — if both appear, this key "+"is ignored with a warning. Clients older than this alias ignore it, so keep using strictKnownMarketplaces when the allowlist must also bind older Claude Code versions."),blockedMarketplaces:()=>qt(()=>Ve.array(Go())).describe('Enterprise blocklist of marketplace sources. When set in managed settings, these sources are blocked from being added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to block every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem.'),disableCommandPluginSources:()=>Ve.boolean().optional().describe("Controls the `command` plugin source, whose plugin directory is produced by running a marketplace-declared command on this machine. true: command-sourced plugins are never installed, updated, or re-resolved (the command never runs). false: explicitly allowed. "+"Unset: follows allowManagedHooksOnly — an org that restricts hook execution to managed "+"settings gets command sources disabled too. Only honored from managed settings."),...!1,disableSideloadFlags:()=>Ve.boolean().optional().describe("When true (and set in managed settings), rejects the --plugin-dir, --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for per-server MCP control; this setting does not gate other MCP entry points (SDK setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the CLI with these flags internally (see settings documentation). Only honored from managed settings; ignored in user/project/local settings."),pluginSuggestionMarketplaces:()=>Ve.array(Ve.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source."),forceLoginMethod:()=>Ve.enum(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:()=>Ve.string().min(1).optional().catch(void 0).describe('Cloud gateway URL to pre-fill and auto-connect to during login, alongside forceLoginMethod: "gateway". Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.'),gatewayInternalNetworks:()=>Ve.array(Ve.string()).optional().catch([vu]).meta({default:void 0}).describe("IPv4 CIDR blocks (at most 4, each /8 to /32, not overlapping) your Cloud gateway sits in: the public block your organization numbers its internal network from, which lets /login reach a gateway there. A block must lie entirely outside private space, where /login accepts a gateway without this key. /login accepts a gateway inside a listed block over a direct connection only, and only when this machine's own address on that connection is inside the same block, so /login must happen from a machine whose own address is inside the block (not through a proxy, VPN pool, container or NAT segment outside it). A bar against copied settings files, not proof of location. Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings."),parentSettingsBehavior:()=>Ve.enum(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (the default, except in a gateway session Claude Desktop's Code `+'tab launched, where "merge" is): parent is dropped — admin tiers '+`are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),managedSourcesBehavior:()=>Ve.enum(["first-wins","merge"]).optional().describe('Controls how the managed settings sources compose. "first-wins" (default): the highest-priority source present (server-managed > MDM (managed plist / HKLM) > managed-settings.json) is the managed tier alone. "merge": every present source deep-merges with fixed '+"precedence server-managed > MDM > managed-settings.json — scalars "+"take the highest source's value (a restrictive boolean or enum — "+"the allowManaged*Only locks, the disable* switches, the sandbox "+"lock family — takes the strictest value any source sets) and "+"arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod, forceLoginGatewayUrl and gatewayInternalNetworks, the credential helpers apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, parentSettingsBehavior and the policyHelper configuration (env keeps its own per-key union). Honored only from the highest-priority source present; enable it only when every lower source is admin-controlled, since lower sources then contribute entries such as permissions.allow. HKCU and --managed-settings never take part in the merge."),forceLoginOrgUUID:()=>Ve.union([Ve.string(),Ve.array(Ve.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:()=>Ve.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:()=>Ve.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:()=>Ve.string().optional().describe("Controls the output style for assistant responses"),viewMode:()=>Ve.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:()=>Ve.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:()=>Ve.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:()=>qt(()=>Gs()),...!1,feedbackSurveyRate:()=>Ve.number().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),feedbackDrafts:()=>Ve.enum(["notify","quiet","off"]).optional().describe('Model-drafted feedback (the SendFeedback tool). "notify" (default) shows a one-line notice when a draft is queued; "quiet" shows only the footer counter; "off" disables the tool entirely so drafts are never queued.'),spinnerTipsEnabled:()=>Ve.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:()=>Ve.object({mode:Ve.enum(["append","replace"]),verbs:Ve.array(Ve.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:()=>Ve.object({excludeDefault:Ve.boolean().optional().catch(void 0),tips:cF().optional(),tipsFile:Ve.string().optional().catch(void 0).describe("Absolute or ~/ local path to a JSON file holding an array of tips (same shapes as `tips`); honored from user, --settings and on-disk managed settings only. Read once per CLI process (restart to pick up edits)."),label:Ve.string().optional().catch(void 0).describe('Prefix shown before your tips in the spinner (default "Tip")')}).passthrough().optional().catch(void 0).describe("Add your organization's own tips to the spinner tip rotation. tips: strings or {id, text, cooldownSessions?, priority?} objects; tipsFile: a JSON file of the same; label: prefix shown before your tips; excludeDefault: if true, only show your tips (default: false)."),syntaxHighlightingDisabled:()=>Ve.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),maxProseWidth:()=>Ve.number().int().min(40).optional().catch(void 0).describe("Maximum width, in terminal columns, of the prose in Claude's responses (paragraphs, headings, lists, blockquotes). In a wider terminal the prose wraps at this width while tables and code blocks keep the full width; only the display wraps, the response text itself gains no line breaks. Minimum 40. Unset (the default) uses the full terminal width."),spellcheck:()=>Ve.object({enabled:Ve.boolean().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:Ve.string().optional().catch(void 0).describe(`Which spell checker to run: ${$r.map((ce)=>`"${ce}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:Ve.string().optional().catch(void 0).describe(`Dictionary to use, passed to the checker as-is (aspell --lang, hunspell -d, ispell -d), e.g. "en_GB"; names are checker-specific (letters, digits and _ - . , only). Default: the checker's own default`),color:Ve.string().optional().catch(void 0).describe(`Color of misspelled words (they are also underlined): a terminal color name such as "red" or "magenta", "#rrggbb", "rgb(r,g,b)", "ansi256(n)" or "ansi:<name>". Default: the theme's error color`)}).passthrough().optional().catch(void 0).describe(`Underline misspelled words in the prompt input as you type, using an installed ${$r.slice(0,-1).join(", ")} or ${$r.at(-1)} (off unless "enabled" is true; does nothing if none is installed). Read from user, flag and managed settings only (the whole block from the highest-precedence of those applies); ignored in project .claude/settings.json and .claude/settings.local.json.`),terminalTitleFromRename:()=>Ve.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:()=>Ve.enum(so).optional().catch(void 0).describe('Prompt cache TTL for the main conversation (interactive, -p and SDK turns, plus the helpers that run inline with it): "5m" or "1h". Unset = automatic: 1 hour on a Claude subscription within its usage limits, 5 minutes on an API key, Bedrock, Vertex or Foundry. 1-hour cache writes are billed at a higher rate; the cache stays warm across longer breaks. The CLAUDE_CODE_PROMPT_CACHE_TTL environment variable takes precedence.'),subagentPromptCacheTtl:()=>Ve.enum(so).optional().catch(void 0).describe("Prompt cache TTL for everything outside the main conversation — subagents, workflows, background and helper requests: "+'"5m" or "1h". Unset = automatic (5 minutes unless ENABLE_PROMPT_CACHING_1H=1). The CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL environment variable takes precedence.'),alwaysThinkingEnabled:()=>Ve.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:()=>Ve.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:()=>Ve.enum(wo).optional().catch(void 0).describe("Maximum effort level. Anything above it (an /effort or /model pick, --effort, CLAUDE_CODE_EFFORT_LEVEL, a model default) is clamped to it, on every provider including Bedrock, Vertex and Foundry. Combines with an organization's per-model effort cap by taking the lower of the two; across settings files the lowest value wins, and modelSettings.<model>.maxEffortLevel replaces it per model. Enforced client-side: an effort supplied through CLAUDE_CODE_EXTRA_BODY is not clamped."),modelSettings:()=>Ve.preprocess((ce)=>typeof ce==="object"&&ce!==null&&!Array.isArray(ce)?Hn(ce,(Oe,xe)=>Object.hasOwn(Object.prototype,xe)):ce,Ve.record(Ve.string(),Ve.object({effortLevel:Ve.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:Ve.enum(wo).optional().catch(void 0).describe('Maximum effort level for this model. Within one settings file it replaces the top-level maxEffortLevel for the model ("max" exempts it); across settings files the lowest applicable value wins. Keyed like effortLevel: the canonical model name also matches its dated, [1m], Bedrock and Vertex spellings.')}).passthrough().optional().catch(void 0))).optional().catch(void 0).describe("Per-model settings keyed by canonical model name."),ultracode:()=>Ve.boolean().optional().catch(void 0).describe("Enable ultracode for the session: standing dynamic-workflow orchestration at any effort level. "+"Session-scoped — typically provided via --settings or the apply_flag_settings control request; "+"interactive toggles never persist it. Requires workflows to be enabled and a model that supports ultracode."),autoCompactWindow:()=>UF().describe("Auto-compact window size"),...!1,advisorModel:()=>Ve.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:()=>Ve.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:()=>Ve.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:()=>Ve.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:()=>Ve.boolean().optional().describe("When false, the :emoji: shortcode typeahead (the suggestion popup and the :name: inline replacement) is disabled. When absent or true, it is enabled."),awaySummaryEnabled:()=>Ve.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:()=>Ve.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:()=>Ve.enum(["60s","5m","10m","never"]).optional().catch(void 0).describe("Idle time before Claude's questions auto-continue with any answers "+"selected so far. Defaults to never — auto-continue only runs "+"when explicitly set to 60s/5m/10m."),dialogExpiry:()=>Ve.enum(["60s","5m","10m","never"]).optional().catch(void 0).describe('Max time a permission/user dialog forwarded to a remote client stays parked awaiting an answer, and how long a HELD cross-session message awaits approval, before either resolves to its safe no-action default (cancelled / dropped-with-denial). Defaults to 5m to match the long-standing remote-dialog deadline; "never" disables the deadline. Local-only permission prompts (no remote client) are unaffected. The CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS env var, when set, overrides this. Read from trusted sources only (never a checked-in repo settings file).'),agent:()=>Ve.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),modelProposedGoals:()=>Ve.enum(Hc).optional().catch(void 0).describe("@internal Controls the ProposeGoal tool (model-proposed session goals). 'auto' (the default when absent) lets the model choose per proposal whether to ask for approval via its ask_user parameter; 'alwaysAsk' routes every model-proposed goal through the approval dialog; 'disabled' turns the tool off. A typed /goal is unaffected. Consent-affecting, so it is read "+"from trusted sources only (user/policy/flag) — "+"workspace-resident project and local settings are ignored."),companyAnnouncements:()=>Ve.array(Ve.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:()=>Ve.record(Ve.string(),Ve.object({mcpServers:Ve.record(Ve.string(),Ve.record(Ve.string(),Ve.union([Ve.string(),Ve.number(),Ve.boolean(),Ve.array(Ve.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:Ve.record(Ve.string(),Ve.union([Ve.string(),Ve.number(),Ve.boolean(),Ve.array(Ve.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(Ve.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:()=>Ve.object({defaultEnvironmentId:Ve.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:()=>Ve.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:()=>Ve.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:()=>Ve.string().optional().describe("Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup with instructions to update. Only enforced from managed (policy) settings."),requiredMaximumVersion:()=>Ve.string().optional().describe("Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. Only enforced from managed (policy) settings."),plansDirectory:()=>Ve.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:()=>Ve.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),...!1,voice:()=>Ve.object({enabled:Ve.boolean().optional(),mode:Ve.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:Ve.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:()=>Ve.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:()=>Ve.array(Tu()).optional().describe("Managed-org allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:()=>Ve.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:()=>Ve.union([Ve.enum(kc),Ve.string()]).optional().describe('Clock format for times shown in the UI: "auto" (default, follows the locale), "12-hour", "24-hour", "24-hour-utc" ("18:05Z"), or a strftime pattern such as "%H:%M" (any value containing "%"; other values read as "auto"). A pattern replaces the time everywhere; message timestamps show only the pattern, so include %Y-%m-%d for the date. /config offers the presets; a pattern is set here.'),timeZone:()=>Ve.string().optional().describe('IANA time zone for times shown in the UI, e.g. "UTC" or "Europe/Dublin". Default: the system time zone. An unknown name falls back to the system time zone.'),doneMeansMerged:()=>Ve.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),totalTokensReminder:()=>Ve.enum(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn "+"is on — task-budget semantics). Defaults to padded-countdown. "+"Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:()=>Ve.number().int().positive().optional().describe("@internal Starting budget (tokens) for totalTokensReminder 'padded-countdown' mode. Defaults to 15000000. Server-controlled via GrowthBook; env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET overrides."),totalTokensReminderAfterUserTurn:()=>Ve.boolean().optional().describe("@internal When true, emit the totalTokensReminder block after each regular user prompt and (for 'padded-countdown') re-anchor the task budget to the full configured value at the start of each user turn. When false, the reminder appears only in the system prompt and after each tool-result batch, and 'padded-countdown' counts down over the whole session. Defaults to on. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN overrides; server-controlled via GrowthBook tengu_lapis_anchor_user_turn."),autoMemoryEnabled:()=>Ve.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:()=>Ve.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),...!1,autoDreamEnabled:()=>Ve.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:()=>Ve.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:()=>Ve.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:()=>Ve.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:()=>Ve.enum(["disable"]).optional().describe("Disable auto mode"),remoteTools:()=>Ve.object({allowUnattendedServing:Ve.boolean().optional().describe("@internal When false in managed or user settings, a cloud session in auto mode may not run commands on this computer without a person approving each one, whatever consent the computer has given; a project, local or --settings value is ignored. Default: true.")}).optional().describe("@internal How this computer serves tool calls to cloud sessions"),sshConfigs:()=>Ve.array(Ve.object({id:Ve.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:Ve.string().describe("Display name for the SSH connection"),sshHost:Ve.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:Ve.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:Ve.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:Ve.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:()=>Ve.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:()=>Ve.array(Ve.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:()=>Ve.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:()=>Ve.union([Ve.enum(Uc),Ve.string().startsWith("custom:").transform((ce)=>ce)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>Ve.enum(vc).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:()=>Ve.enum(["classic","readline"]).optional().catch(void 0).describe("Deprecated: no longer has any effect. The prompt's word-editing keys always follow Bash (readline) conventions."),vimInsertModeRemaps:()=>Ve.record(Ve.string(),Ve.unknown()).optional().catch(void 0).describe('Vim INSERT-mode key-sequence remaps, e.g. {"jj": "<Esc>"}. Each key is exactly two printable characters typed in sequence; "<Esc>" (return to NORMAL mode) is the only supported target. Applies when editorMode is "vim".'),verbose:()=>Ve.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:()=>Ve.enum(Nc).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:()=>Ve.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:()=>Ve.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),switchModelsOnFlag:()=>Ve.boolean().optional().describe("When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead."),autoContinueAtUsageLimit:()=>Ve.boolean().optional().describe("When a claude.ai usage limit stops your session, wait for the limit to reset and continue the task automatically. When off, the limit dialog offers the wait as a choice instead."),autoScrollEnabled:()=>Ve.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:()=>Ve.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:()=>Ve.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:()=>Ve.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:()=>Ve.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:()=>Ve.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:()=>Ve.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:()=>Ve.enum(Mc).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:()=>Ve.boolean().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:()=>Ve.object({shareHostProfile:Ve.enum(es).optional().catch(void 0).describe("@internal What a Remote Control environment reports about this machine when it registers: 'off' reports nothing, 'basic' the OS, architecture and detected developer tools, 'full' also the names of MCP servers configured on this machine (never a repository's .mcp.json). When unset, the level comes from the feature rollout, which may be any of the three. Managed, --settings and user settings choose the level (the most restrictive wins); project and local settings can only lower it, never raise it. Read when Remote Control starts; lowering it later applies from the next registration, raising it from the next start.")}).optional().describe("@internal Remote Control (`claude remote-control`) options"),isolatePeerMachines:()=>Ve.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:()=>Ve.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),crossSessionInbound:()=>Ve.enum(Ko).optional().catch(void 0).describe("Inbound cross-session peer messages (SendMessage from your other sessions): 'accept' delivers them, 'hold' parks them for your review without letting Claude act, 'refuse' opts this session out. An explicit value always wins. Unset (mode parity): a message auto-delivers only when the sending session's permission-mode class matches yours (bypass↔bypass or prompting↔prompting); a mismatched sender's message is held for your approval; a sender that asserts no class is held only while this session bypasses permission prompts."),autoUploadSessions:()=>Ve.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:()=>Ve.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:()=>Ve.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...oe(Qd(l),(ce)=>()=>ce)}}function Gi(l,b={}){let D=wu(l,b);return new Kr(D).whole()}var HF=new Set,zF=new Set,os=mt(()=>new Kr(wu(ho()),HF)),FF=mt(()=>os().whole());function rs(l){return os().forDocument(l)}var Eu=Object.freeze({serverName:"invalid-entry-stripped"});function Nu(l){for(let b of l){let D=b.path.length>0?`${b.path.map(String).join(".")}: `:"";if(b.code==="invalid_union"){for(let te of b.errors){let ce=Nu(te);if(ce!==null)return`${D}${ce}`}if("note"in b&&typeof b.note==="string"&&b.note!=="")return`${D}${b.note}`}if(b.message!=="")return`${D}${b.message}`}return null}var ji=mt(()=>{let l=os();return Dn().flatMap(({path:b,restrictive:D})=>{if(b.length!==1||b[0]==="strictPluginOnlyCustomization"||b[0]==="disableAllHooks"||typeof D!=="boolean"&&typeof D!=="string")return[];let te=b[0],ce=l.field(te);if(ce===void 0||ce instanceof Ve.ZodCatch)return[];return[{key:te,restrictive:D,field:ce}]})}),ss=mt(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...ji().map((l)=>l.key)]),Yn=["managedSourcesBehavior","wslInheritsWindowsSettings"];function Yo(l){return r(l)&&Object.values(l).every(Yo)}function Wi(l){let b=l.wslInheritsWindowsSettings;if(b===void 0||b===null)return"disarmed";let D=Wr(b);return D===!0?"armed":D===!1?"disarmed":"unreadable"}function $i(l){let b=l.source==="hostPattern"?l.hostPattern:l.source==="pathPattern"?l.pathPattern:null;if(b!==null&&!Gd(b))return`${l.source}: regex does not compile; the entry cannot be enforced`;if(l.source==="github"&&l.repo.includes("*")&&Wd(l.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(l.source==="git"&&Vd(l.url))return'git: wildcards are only supported in github-form entries, as "<owner>/*"; the entry cannot be enforced';if((l.source==="github"||l.source==="git")&&l.ref!==void 0&&l.ref.includes("*"))return`${l.source}: ref contains "*", which git does not allow in ref names; the entry cannot be enforced`;return null}function _u(l,b){return Ve.union([Ve.null().transform(()=>{return}),Ve.array(Ve.unknown()).transform((D)=>{let te=[];for(let[ce,Oe]of D.entries()){let xe=Go().safeParse(Oe);if(xe.success){let $e=$i(xe.data);if($e!==null){if(l==="blockedMarketplaces")b({path:`${l}[${ce}]`,message:`Unenforceable entry was kept: ${$e}; it can never match a marketplace source, but marketplace restrictions stay active`}),te.push(xe.data);else b({path:`${l}[${ce}]`,message:`Invalid entry was ignored: ${$e}`});continue}te.push(xe.data)}else b({path:`${l}[${ce}]`,message:`Invalid entry was ignored: ${Nu(xe.error.issues)??"failed validation"}`})}if(l==="blockedMarketplaces"&&D.length>0&&te.length===0)b({path:l,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return te})]).optional()}function Su(l,b,D){return Ve.array(b.catch((te)=>(D({path:`${l}[]`,message:`Invalid entry was ignored: ${te.issues[0]?.message??"failed validation"}`}),Eu))).transform((te)=>te.filter((ce)=>ce!==Eu)).optional()}var vu="(unreadable)";function Pi(l,b,D,te,ce){return Ve.array(Ve.unknown()).transform((Oe)=>{let xe=[];for(let[$e,et]of Oe.entries()){let rt=b.safeParse(et);if(rt.success){xe.push(rt.data);let tt=ce?.(et,rt.data);if(tt!==void 0)D({path:`${l}[${$e}]`,message:tt,statusOnly:!0})}else{let tt=rt.error.issues[0],ct=tt===void 0?"failed validation":tt.path.length?`${tt.path.join(".")}: ${tt.message}`:tt.message;D({path:`${l}[${$e}]`,message:`Invalid entry was ignored: ${ct}`})}}if(Oe.length>0&&xe.length===0)D({path:l,message:`Every entry of "${l}" was invalid; enforcing an empty allowlist (${te}) until it is fixed.`});return xe}).optional().catch(()=>(D({path:l,message:`"${l}" was present but invalid; enforcing an empty allowlist (${te}) until it is fixed.`}),[]))}var _o=mt(()=>new Map(Dn().flatMap(({path:l,restrictive:b})=>l.length>1?[[l.join("."),Un(b)[0]]]:[]))),BF=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:["soft_deny","hard_deny","deny"],grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),is=new Map([["permissions.defaultMode",{read:(l)=>{let b=po(l);return[...zn,...Ai(ho())].find((D)=>D===b)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function Vi(l,b,D,te){let ce=[],Oe=BF.get(l);if(Oe===void 0)return ce;let xe=Oe.restrictions.flatMap((et)=>{switch(D(et)){case"unreadable":return[`"${et}"`];case"trimmed":return Oe.withholdOnEntryDrop?[`an entry of "${et}"`]:[];case void 0:return[]}});if(xe.length===0)return ce;let $e=xe.join(" and ");for(let et of Oe.grants){let rt=is.get(`${l}.${et}`),tt=rt===void 0?b[et]:rt.read(b[et]);if(tt===void 0||rt?.inert.has(tt)===!0)continue;if(rt===void 0)delete b[et];else b[et]=rt.floor,ce.push(et);te({path:`${l}.${et}`,message:rt===void 0?`"${et}" was withheld because ${$e} in the same block could not be read; it takes effect again once that is fixed.`:`"${et}" was withheld because ${$e} in the same block could not be read; treating it as ${Vo(rt.floor)} until that is fixed.`,...rt!==void 0&&{substituted:!0}})}return ce}function Qr(l){for(let b of _o().keys())if(b.startsWith(`${l}.`))return!0;return!1}function as(l){return l!=="sandbox.credentials"&&!l.startsWith("sandbox.credentials.")&&Qr(l)}function Ki(l){let b=l;while(b instanceof Ve.ZodOptional||b instanceof Qs||b instanceof Ve.ZodPipe)b=b instanceof Ve.ZodPipe?b.out:b.unwrap();return b instanceof Ve.ZodObject?b:void 0}var yu=new Set(["remoteTools","remoteControl"]);function ku(l,b){return typeof b==="object"&&b!==null&&l.has(b)}function Mu(l,b,D){let te={};for(let[ce,Oe]of Object.entries(b.shape)){let xe=`${l}.${ce}`;if(D?.has(xe))continue;let $e=_o().get(xe),et=Ki(Oe);if($e!==void 0)te[ce]=$e;else if(et!==void 0&&Qr(xe))te[ce]=Mu(xe,et,D)}return te}function Ou(l,b){return{path:l,message:`"${b}" was null, which is read as key removal; this source does not set it.`,statusOnly:!0,removal:!0}}function Vo(l){return typeof l==="string"?`"${l}"`:String(l)}function $o(l,b=0){let D=l===void 0||l.input===void 0?"failed validation":l.code==="custom"&&l.message!==void 0?l.message:("expected"in l)&&typeof l.expected==="string"?`expected ${l.expected}`:("values"in l)&&Array.isArray(l.values)?`expected ${l.values.map(Vo).join(" or ")}`:"failed validation",te=(l?.path??[]).slice(b);if(te.length===0)return D;return te.every((ce)=>typeof ce==="number")?`${te.join(".")}: ${D}`:`nested value: ${D}`}function Uu(l){return l===!1||l==="false"}function Yi(l,b){if(b===null)return!0;return(l.includes(".")?_o().get(l):ji().find((te)=>te.key===l)?.restrictive)==="disable"&&Uu(b)}function vi(l,b,D,te){let ce=l.slice(l.lastIndexOf(".")+1);if(typeof b==="boolean")return Ve.preprocess((Oe)=>{let xe=Wr(Oe);if(xe!==Oe)te({path:l,message:`"${ce}" holds the string "${String(xe)}" where a boolean belongs; reading it as ${String(xe)}. Write it without quotes.`,statusOnly:!0});return xe},D);if(b==="disable")return Ve.preprocess((Oe)=>{if(Uu(Oe)){te({path:l,message:`"${ce}" was set to false; reading it as absent (the key's only value is "disable"). Remove the key instead.`,statusOnly:!0,removal:!0});return}return Oe},D);return D}function GF(l,b,D,te,ce,Oe,xe){let $e=l.slice(l.lastIndexOf(".")+1),et=_o().get(l),rt=xe?void 0:et,tt=is.get(l),ct=b instanceof Ve.ZodCatch?b.unwrap():void 0,at=ct instanceof Ve.ZodType?ct:b;return vi(l,et,at,D).catch((ht)=>{if(rt!==void 0)return D({path:l,message:`"${$e}" was present but invalid (${$o(ht.issues[0])}); treating it as ${Vo(rt)}, its restrictive value, until it is fixed.`,substituted:!0}),te.add($e),rt;if(tt!==void 0)return D({path:l,message:`"${$e}" was present but invalid (${$o(ht.issues[0])}); treating it as ${Vo(tt.floor)} until it is fixed.`,substituted:!0}),te.add($e),tt.floor;if(at.safeParse([]).success){let Dt=ht.value;if(Array.isArray(Dt)){let St=new Map;for(let wt of ht.issues){let It=wt.path?.[0];if(typeof It==="number"&&!St.has(It))St.set(It,$o(wt,1))}let Pt=at.safeParse(Dt.filter((wt,It)=>!St.has(It)));if(St.size>0&&St.size<Dt.length&&Pt.success){for(let[wt,It]of St)D({path:`${l}[${wt}]`,message:`Invalid entry was ignored (${It}); it cannot take effect until it is fixed.`});return Oe.add($e),Pt.data}}}D({path:l,message:et===void 0?`"${$e}" was present but invalid (${$o(ht.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${$e}" was present but invalid (${$o(ht.issues[0])}) and was ignored, not treated as ${Vo(et)}; it cannot take effect until it is fixed.`}),ce.add($e);return})}function ki(l,b,D,te={}){let ce=l.slice(l.lastIndexOf(".")+1),Oe=new Set,xe=new Set,$e=new Set,et={};for(let[ct,at]of Object.entries(b.shape)){let gt=`${l}.${ct}`,ht=Ki(at);et[ct]=te.override?.[gt]??(ht!==void 0&&Qr(gt)?ki(gt,ht,D,{...te,strictField:at}):GF(gt,at,D,Oe,xe,$e,te.neverSubstitute?.has(gt)===!0))}let rt=new Set([...te.skeletonExclude??[],...te.neverSubstitute??[]]),tt=b.safeExtend(et);return Ve.unknown().transform((ct)=>{if(ct===null){D(Ou(l,ce));return}Oe.clear(),xe.clear(),$e.clear();let at=r(ct)||te.strictField===void 0?void 0:te.strictField.safeParse(ct),gt=at?.success===!0&&r(at.data)?at.data:ct,ht=r(gt)?tt.safeParse(Hn(gt,(wt)=>wt===null||wt===void 0)):void 0;if(!r(gt)||ht?.success!==!0){let wt=Mu(l,b,rt),It=Object.keys(wt);if(D({path:l,message:It.length>0?`"${ce}" was present but not an object; treating its locks as their restrictive values (${It.join(", ")}) until it is fixed.`:`"${ce}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...It.length>0&&{substituted:!0}}),It.length===0)return;if(!yu.has(l))te.synthesized?.add(wt);return wt}for(let[wt,It]of Object.entries(gt)){let Nt=`${l}.${wt}`;if(It===null&&(_o().has(Nt)||Qr(Nt)))D(Ou(Nt,wt))}let Dt={...ht.data};for(let wt of Vi(l,Dt,(It)=>xe.has(It)?"unreadable":$e.has(It)?"trimmed":void 0,D))Oe.add(wt);let St=Hn(Dt,(wt)=>wt===void 0);if(Object.keys(St).length===0)return Object.entries(gt).some(([wt,It])=>It!==void 0&&Object.hasOwn(b.shape,wt))?void 0:St;let Pt=te.synthesized;if(Pt!==void 0&&!yu.has(l)&&Object.entries(St).every(([wt,It])=>Oe.has(wt)||ku(Pt,It)||Yo(It)))Pt.add(St);return St}).optional()}function Xi(l,b,D){let te=os(),ce=(ut)=>zF.has(ut)||te.carries(D,ut),Oe=(ut)=>{let dt=te.field(ut);if(!dt)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return dt},xe=new Map,$e=(ut,dt)=>{xe.set(ut,dt)};for(let ut of["prependPlugins","appendPlugins"])if(te.has(ut))$e(ut,()=>Ve.array(Ve.string()).optional().catch((dt)=>{l({path:ut,message:`${dt.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));$e("wslInheritsWindowsSettings",()=>Ve.union([Ve.null().transform(()=>{return}),Ve.preprocess((ut)=>{let dt=Wr(ut);if(dt!==ut)l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(dt)}" where a boolean belongs; reading it as ${String(dt)}. Write it without quotes.`,statusOnly:!0});return dt},Oe("wslInheritsWindowsSettings"))]).optional().catch(()=>{l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" was present but invalid (it takes true or false), so this source's WSL opt-in cannot be read until it is fixed. WSL fails it closed: in an administrator source it arms the Windows policy chain with no user-writable source (/etc/claude-code, HKCU) read beneath it; in HKCU it leaves HKCU unapplied.`});return})),$e("strictKnownMarketplaces",()=>_u("strictKnownMarketplaces",l).catch(()=>(l({path:"strictKnownMarketplaces",message:'"strictKnownMarketplaces" was present but invalid; enforcing an empty allowlist (no marketplaces admitted) until it is fixed.'}),[]))),$e("blockedMarketplaces",()=>_u("blockedMarketplaces",l).catch(()=>{l({path:"blockedMarketplaces",message:'"blockedMarketplaces" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),$e("allowedMcpServers",()=>Su("allowedMcpServers",ts(),l).catch(()=>(l({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[]))),$e("deniedMcpServers",()=>Su("deniedMcpServers",ns(),l).catch(()=>{l({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),$e("managedMcpServers",()=>Ve.unknown().transform((ut)=>Mr(ut,(dt,At)=>l({path:dt?`managedMcpServers.${dt}`:"managedMcpServers",message:dt?`Managed MCP server was ignored: ${At}`:At,statusOnly:!0}))).optional());let et=new Set;for(let{key:ut,restrictive:dt,field:At}of ji()){let Lt=typeof dt==="string"?`"${dt}"`:String(dt);$e(ut,()=>Ve.union([Ve.null().transform(()=>{return}),vi(ut,dt,At,l)]).optional().catch(()=>(l({path:ut,message:`"${ut}" was present but invalid; treating it as ${Lt} (its restrictive value) until it is fixed.`,substituted:!0}),et.add(ut),dt)))}$e("strictPluginOnlyCustomization",()=>Ve.union([Ve.null().transform(()=>{return}),Pu((ut)=>l({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${ut} ${De(ut,"entry","entries")} this version does not recognize as a surface (known: ${Ni.join(", ")}); an unrecognized entry locks nothing, so check it for a typo.`,statusOnly:!0}))]).optional().catch(()=>(l({path:"strictPluginOnlyCustomization",message:'"strictPluginOnlyCustomization" was present but invalid; treating it as true (skills, agents, hooks and MCP servers load from managed settings and plugins only) until it is fixed.',substituted:!0}),et.add("strictPluginOnlyCustomization"),!0))),$e("enabledPlugins",()=>{let ut=xu();return Ve.record(Ve.string(),Ve.unknown()).transform((dt)=>{let At=[],Lt=0;for(let[kt,Mt]of Object.entries(dt)){let Ht=ut.safeParse(Mt);if(Ht.success){At.push([kt,Ht.data]);continue}Lt++,l({path:jo().safeParse(kt).success?`enabledPlugins.${kt}`:"enabledPlugins.<invalid id>",message:"Invalid entry was ignored: the value must be true, false, or a list of version constraints. This plugin is neither force-enabled nor blocked until it is fixed."})}if(Lt>0&&At.length===0){l({path:"enabledPlugins",message:'Every entry of "enabledPlugins" was invalid; no plugin is force-enabled or blocked by it until it is fixed.'});return}return Object.fromEntries(At)}).optional().catch(()=>{l({path:"enabledPlugins",message:'"enabledPlugins" was present but invalid (not a map of plugin ids) and was ignored; no plugin is force-enabled or blocked by it until it is fixed.'});return})}),$e("availableModels",()=>Ve.array(Ve.unknown()).transform((ut,dt)=>{let At=[];for(let Lt of ut)if(typeof Lt==="string")At.push(Lt);else l({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(Lt)}); the entry was ignored.`});return At}).optional().catch(()=>(l({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[]))),$e("deniedModels",()=>Ve.array(Ve.unknown()).transform((ut)=>{let dt=[];for(let At of ut)if(typeof At==="string")dt.push(At);else l({path:"deniedModels",message:`"deniedModels" contained a non-string entry (${At===null?"null":typeof At}); the entry was ignored.`});return dt}).optional().catch(()=>{l({path:"deniedModels",message:'"deniedModels" was present but is not a list of model names, so it was ignored and blocks no models until it is fixed.'});return})),$e("allowedHttpHookUrls",()=>Pi("allowedHttpHookUrls",Ve.string(),l,"no HTTP hooks may run")),$e("httpHookAllowedEnvVars",()=>Pi("httpHookAllowedEnvVars",Ve.string(),l,"no environment variables may be interpolated into HTTP hook headers")),$e("allowedChannelPlugins",()=>Pi("allowedChannelPlugins",dF(),l,"no channel plugins admitted",(ut,dt)=>typeof ut==="string"?`"allowedChannelPlugins" entry "${ut}" was accepted; prefer the documented object form {"plugin": "${dt.plugin}", "marketplace": "${dt.marketplace}"}.`:void 0)),$e("gatewayInternalNetworks",()=>Ve.array(Ve.string()).optional().catch(()=>(l({path:"gatewayInternalNetworks",message:'"gatewayInternalNetworks" was present but invalid; gateway sign-in governed by this source is refused until it is fixed.'}),[vu]))),$e("forceLoginOrgUUID",()=>Oe("forceLoginOrgUUID").catch(()=>(l({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[])));let rt=!1,tt=(ut,dt)=>{let At=ut.safeParse(dt);if(At.success)return;return At.error.issues.slice(0,3).map((Lt)=>Lt.path.length?`${Lt.path.join(".")}: ${Lt.message}`:Lt.message).join("; ")},ct;$e("policyHelper",()=>Ve.preprocess((ut)=>{if(rt=!1,ct=ut,ut&&typeof ut==="object"&&!Array.isArray(ut)){let dt=ut;for(let At of["defaultSettings","default",...Zr])if(dt[At]!==void 0&&dt[At]!==null)l({path:"policyHelper",message:`"${At}" on the singular policyHelper is ignored — static fallback payloads belong on the policyHelpers per-OS entries ("defaultSettings") or the map's "default" key. The intended fallback will NOT apply from here.`,statusOnly:!0});for(let At of["policyHelper","policyHelpers"])if(dt[At]!==void 0&&dt[At]!==null)l({path:"policyHelper",message:`"${At}" inside the singular policyHelper is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside the singular entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let At of Vt)if(dt[At]!==void 0&&dt[At]!==null)l({path:"policyHelper",message:`"${At}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${At}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(dt.claudeMd!==void 0&&dt.claudeMd!==null)l({path:"policyHelper",message:`"claudeMd" on the singular policyHelper is ignored — "claudeMd" is a managed-settings key: put it at the settings top level or inside a static payload, or emit it from the helper's stdout envelope. The intended instructions will NOT apply from here.`,statusOnly:!0});if(dt.outputBehavior!==void 0&&dt.outputBehavior!==null)l({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Vt.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(dt.onFailure!==void 0&&dt.onFailure!==null)l({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Vt.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(dt.retries!==void 0&&dt.retries!==null)l({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Vt.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(dt.path===null||dt.path===void 0)rt=!0}return ut===null?void 0:ut},qr().optional()).catch((ut)=>{l({path:"policyHelper",message:`${ut.issues[0]?.message??tt(qr(),ct)??"Failed schema validation"}. This field was ignored.`,...rt&&{statusOnly:!0}});return}));let at=(ut,dt)=>{l({path:ut,message:`"${ut}" is not a valid static settings payload: ${dt??"failed validation"}. When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0})},gt=[],ht=(ut)=>{let dt=!1,At,Lt=wi(ut,Kn().optional().catch((kt)=>{dt=!0,at(`policyHelpers.${ut}.defaultSettings`,kt.issues[0]?.message??tt(Kn(),At&&typeof At==="object"&&!Array.isArray(At)?At.defaultSettings:void 0));return}));return Ve.preprocess((kt)=>{if(dt=!1,At=kt,ut!=="default"&&kt&&typeof kt==="object"&&!Array.isArray(kt)){let Mt=kt;for(let Ut of[...Zr,"claudeMd"])if(Mt[Ut]!==void 0&&Mt[Ut]!==null)l({path:`policyHelpers.${ut}`,message:`"${Ut}" on the policyHelpers.${ut} entry is ignored — helper output cannot be pre-seeded on an entry; a static fallback payload goes under this entry's "defaultSettings" (a managed-settings object). The intended content will NOT apply from here.`,statusOnly:!0});for(let Ut of["policyHelper","policyHelpers"])if(Mt[Ut]!==void 0&&Mt[Ut]!==null)l({path:`policyHelpers.${ut}`,message:`"${Ut}" on the policyHelpers.${ut} entry is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside an entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let Ut of Vt)if(Mt[Ut]!==void 0&&Mt[Ut]!==null)l({path:`policyHelpers.${ut}`,message:`"${Ut}" on the policyHelpers.${ut} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${Ut} config will NOT apply from here.`,statusOnly:!0});if(Mt.default!==void 0&&Mt.default!==null)l({path:`policyHelpers.${ut}`,message:`"default" on the policyHelpers.${ut} entry is ignored — the per-entry static payload field is spelled "defaultSettings"; "default" is the MAP's any-platform catch-all key (a sibling of the OS entries). The intended fallback will NOT apply from here.`,statusOnly:!0});let Ht=Mt.onFailure;if(Ht!==void 0&&Ht!==null&&!Lu(Ht)){let Ut;if(typeof Ht==="string"){let Jt=Ht.replace(/[^\x20-\x7e]/gu,"?");Ut=JSON.stringify(Jt.length>gu?`${Jt.slice(0,gu-1)}…`:Jt)}else if(typeof Ht==="number"||typeof Ht==="boolean")Ut=String(Ht);else Ut=`a non-string value (${Array.isArray(Ht)?"array":typeof Ht})`;l({path:`policyHelpers.${ut}.onFailure`,message:`"onFailure": ${Ut} on the policyHelpers.${ut} entry is not a recognized value ("continue" or "refuse"); it is treated as "refuse" — a startup failure of this entry's helper with no static payload in its place will not start Claude Code.`,statusOnly:!0})}if(Ru(kt))return}return kt===null?void 0:kt},Lt.optional()).catch((kt)=>{if(ut==="default"){at("policyHelpers.default",kt.issues[0]?.message??tt(Kn(),At));return}if(dt)return;let Mt=tt(wi(ut),At)??"failed validation",Ht=At,Ut=Ht&&typeof Ht==="object"&&!Array.isArray(Ht)?Ht:null,Jt=Ut?.onFailure,sn=Jt!==void 0&&Jt!==null&&Jt!=="continue",an=(Wt)=>{let Zt=`policyHelpers.${ut}`;if(sn)gt.push({entryKey:ut,message:Wt});else l({path:Zt,message:Wt,statusOnly:!0})};if(Ut){let Wt=Ut.defaultSettings;if(Wt!==void 0&&Wt!==null){let Zt=Kn().safeParse(Wt);if(Zt.success){let Yt=Ut.outputBehavior,ln=Yt===void 0||Yt===null?null:Du().safeParse(Yt);if(ln&&!ln.success){an(`Invalid entry was ignored: ${Mt}. Its "defaultSettings" static payload was NOT kept: "outputBehavior" is unrecognized, so whether the payload replaces or merges over this source's settings is unknown. No policy helper runs on ${ut} from this entry.`);return}return l({path:`policyHelpers.${ut}`,message:`Invalid entry: its helper fields were ignored (${Mt}), but its "defaultSettings" static payload was kept. No policy helper runs on ${ut} from this entry.`,statusOnly:!0}),{defaultSettings:Zt.data,...ln&&{outputBehavior:ln.data}}}}}an(`Invalid entry was ignored: ${Mt}. No policy helper runs on ${ut} from this entry.`);return})};$e("policyHelpers",()=>Ve.preprocess((ut)=>{if(gt=[],ut&&typeof ut==="object"&&!Array.isArray(ut)){let dt=ut;for(let At of["defaultSettings",...Zr,"claudeMd"])if(dt[At]!==void 0&&dt[At]!==null)l({path:"policyHelpers",message:`"${At}" directly on the policyHelpers map is ignored — static fallback payloads go on a per-OS entry's "defaultSettings" or the map's "default" key (a managed-settings object), and helper-output keys come from the helper's stdout. The intended content will NOT apply from here.`,statusOnly:!0});for(let At of["policyHelper","policyHelpers"])if(dt[At]!==void 0&&dt[At]!==null)l({path:"policyHelpers",message:`"${At}" inside the policyHelpers map is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; the map's keys are the per-OS entries and "default". The nested config will NOT apply from here.`,statusOnly:!0});for(let At of xi.filter((Lt)=>Lt!=="defaultSettings"))if(dt[At]!==void 0&&dt[At]!==null){let Lt=At==="script"||At==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":At==="outputBehavior"||At==="onFailure"||At==="retries"?"":", or on the singular policyHelper key";l({path:"policyHelpers",message:`"${At}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${Vt.join("/")})${Lt}. No helper runs from this field here.`,statusOnly:!0})}}return ut===null?void 0:ut},Ve.object(Object.fromEntries(Bi.map((ut)=>[ut,ht(ut)]))).transform((ut)=>{for(let dt of Object.keys(ut))if(ut[dt]===void 0)delete ut[dt];for(let{entryKey:dt,message:At}of gt){let Lt=`policyHelpers.${dt}`,kt=Fi(dt).find((Ht)=>ut[Ht]?.defaultSettings!==void 0&&ut[Ht]?.defaultSettings!==null),Mt=kt!==void 0?`${kt}.defaultSettings`:ut.default!==void 0?"default":null;l(Mt!==null?{path:Lt,message:`${At} Its "onFailure" requires the helper; the "policyHelpers.${Mt}" static payload serves in its place.`,statusOnly:!0}:{path:Lt,message:`${At} Its "onFailure" requires the helper, so when delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0})}return gt=[],ut}).optional().catch((ut)=>(l({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${Vt.join(", ")}) to helper entries, plus an optional "default" settings payload (${ut.issues[0]?.message??"failed schema validation"}). When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0}),{}))));let Dt=new WeakSet;for(let ut of te.keys){if(ut==="sandbox"||!as(ut))continue;$e(ut,()=>{let dt=Oe(ut),At=Ki(dt);if(At===void 0)return dt.catch((Lt)=>{l({path:ut,message:`${Lt.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return ki(ut,At,l,{synthesized:Dt,strictField:dt})})}let St=Object.freeze({mode:"deny"}),Pt=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),wt=0,It=[],Nt=new Set,Gt=new Set,rn=b===void 0?"":`${[...b].reduce((ut,dt)=>Math.imul(ut^dt.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,pn=(ut,dt)=>{if(typeof ut!=="object"||ut===null)return;let At=(Bt)=>dt.some((fn)=>fn.path?.includes(Bt)),Lt=(Bt)=>{let fn=ut[Bt];if(typeof fn==="string")return fn;return At(Bt)?"":void 0},kt=Lt("accessKeyIdVar"),Mt=Lt("secretAccessKeyVar"),Ht=Lt("sessionTokenVar"),Ut=Ln;if(![kt,Mt,Ht].some((Bt)=>Bt!==void 0&&Ut.includes(Bt)))return;let Jt=(Bt)=>Bt!==void 0&&uo().safeParse(Bt).success;wt+=1;let sn=(Bt)=>`${Bs}${Bt}_${rn}${wt}_`,an=Jt(kt)?kt:sn("ACCESS_KEY_ID"),Wt=Jt(Mt)&&Mt!==an?Mt:sn("SECRET_ACCESS_KEY"),Zt=Ht===void 0?void 0:Jt(Ht)&&Ht!==an&&Ht!==Wt?Ht:sn("SESSION_TOKEN"),Yt=(Bt)=>Bt.startsWith(Bs);if(!Yt(an)&&!Yt(Wt)){let Bt=Ut.includes(Wt)?Wt:void 0;if(Wt=sn("SECRET_ACCESS_KEY"),Bt!==void 0){let fn=pn({accessKeyIdVar:Bt},[]);if(fn!==void 0)It.push(fn)}}let ln=vr().safeParse({accessKeyIdVar:an,secretAccessKeyVar:Wt,...Zt!==void 0&&{sessionTokenVar:Zt}});return ln.success?ln.data:void 0},_n=(ut,dt,At)=>Ve.array(dt.catch((Lt)=>{let kt=At(Lt.value);if(kt!==void 0)return l({path:`sandbox.credentials.${ut}[]`,message:`Invalid entry was degraded to mode "deny": ${Lt.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${ut==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),kt;return l({path:`sandbox.credentials.${ut}[]`,message:`Invalid entry was ignored: ${Lt.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),St})).transform((Lt)=>{let kt=Lt.filter((Mt)=>Mt!==St);if(Lt.length>0&&kt.length===0)Nt.add(ut);return kt}).optional().catch((Lt)=>{if(typeof Lt.value==="object"&&Lt.value!==null&&!Array.isArray(Lt.value)){let kt=dt.safeParse(Lt.value);if(kt.success)return l({path:`sandbox.credentials.${ut}`,message:`"${ut}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[kt.data];let Mt=At(Lt.value);if(Mt!==void 0)return l({path:`sandbox.credentials.${ut}`,message:`"${ut}" must be an array; its lone entry object was invalid and was degraded to mode "deny". The credential stays blocked (not masked) until it is fixed.`,substituted:!0}),[Mt]}return l({path:`sandbox.credentials.${ut}`,message:`${Lt.issues[0]?.message??"Invalid value"}. "${ut}" was ignored; these credential entries are NOT protected until it is fixed.`}),Nt.add(ut),[]});$e("sandbox",()=>{let ut=Ve.object({files:_n("files",xr(),(dt)=>{if(typeof dt!=="object"||dt===null||!("mode"in dt)||dt.mode!=="mask"&&dt.mode!=="deny"||!("path"in dt)||typeof dt.path!=="string")return;let At=xr().safeParse({path:dt.path,mode:"deny"});return At.success?At.data:void 0}),envVars:_n("envVars",wr(),(dt)=>{if(typeof dt!=="object"||dt===null||!("mode"in dt)||dt.mode!=="mask"&&dt.mode!=="deny"||!("name"in dt)||typeof dt.name!=="string")return;let At=wr().safeParse({name:dt.name,mode:"deny"});return At.success?At.data:void 0}),allowPlaintextInject:vi("sandbox.credentials.allowPlaintextInject",_o().get("sandbox.credentials.allowPlaintextInject"),Ve.boolean().optional(),l).catch((dt)=>(l({path:"sandbox.credentials.allowPlaintextInject",message:`${dt.issues[0]?.message??"Invalid value"}. "allowPlaintextInject" was degraded to an explicit false; plaintext credential injection stays disabled (lower-precedence values cannot enable it) until it is fixed.`,substituted:!0}),Nt.add("allowPlaintextInject"),!1)),awsPairs:Ve.array(vr().catch((dt)=>{let At=pn(dt.value,dt.issues);if(At!==void 0)return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${dt.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),At;return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${dt.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),Pt})).transform((dt)=>{let At=dt.filter((Lt)=>Lt!==Pt);if(It.length>0)At.push(...It),It.length=0;if(dt.length>0&&At.length===0)Nt.add("awsPairs");return At}).optional().catch((dt)=>{let At=typeof dt.value==="object"&&dt.value!==null?pn(dt.value,[]):void 0,Lt=typeof dt.value==="object"&&dt.value!==null&&(("accessKeyIdVar"in dt.value)||("secretAccessKeyVar"in dt.value)||("sessionTokenVar"in dt.value));if(At===void 0&&Lt)return It.length=0,l({path:"sandbox.credentials.awsPairs",message:`${dt.issues[0]?.message??"Invalid value"}. "awsPairs" must be an array; its lone pair-shaped entry claimed no conventional AWS name and was ignored. SigV4 re-signing stays unconfigured until it is fixed.`}),Nt.add("awsPairs"),[];let kt=At!==void 0?[At]:Ln.flatMap((Mt)=>{let Ht=pn({accessKeyIdVar:Mt},[]);return Ht!==void 0?[Ht]:[]});if(It.length>0)kt.push(...It),It.length=0;if(At===void 0)Nt.add("awsPairs");return l({path:"sandbox.credentials.awsPairs",message:`${dt.issues[0]?.message??"Invalid value"}. "awsPairs" was degraded to non-functional suppressor pair(s); implicit AWS auto-pairing stays suppressed but nothing re-signs until it is fixed.`,substituted:!0}),kt}),sigv4:Ve.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((dt)=>[dt,Ve.enum(["deny","passthrough"]).optional().catch((At)=>(l({path:`sandbox.credentials.sigv4.${dt}`,message:`${At.issues[0]?.message??"Invalid value"}. "${dt}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),Gt.add(dt),"deny"))]))).transform((dt)=>{let At=Object.entries(dt).filter(([,Lt])=>Lt!==void 0);if(At.length>0&&At.every(([Lt])=>Gt.has(Lt)))Nt.add("sigv4");return Gt.clear(),dt}).optional().catch((dt)=>(l({path:"sandbox.credentials.sigv4",message:`${dt.issues[0]?.message??"Invalid value"}. "sigv4" was degraded to an all-deny block (all shapes stay denied, and lower-precedence sigv4 values cannot take effect) until it is fixed.`,substituted:!0}),Gt.clear(),Nt.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((dt)=>{let At=Object.entries(dt).filter(([,Lt])=>Lt!==void 0);if(At.length>0&&At.every(([Lt])=>Nt.has(Lt)))Dt.add(dt);return Nt.clear(),dt}).optional().catch((dt)=>{l({path:"sandbox.credentials",message:`${dt.issues[0]?.message??"Failed schema validation"}. The credentials block was degraded to a fail-closed skeleton (all-deny sigv4, implicit AWS auto-pairing suppressed, no masking) until it is fixed.`,substituted:!0});let At=Ln.flatMap((kt)=>{let Mt=pn({accessKeyIdVar:kt},[]);return Mt!==void 0?[Mt]:[]});It.length=0,Nt.clear(),Gt.clear();let Lt={allowPlaintextInject:!1,awsPairs:At,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return Dt.add(Lt),Lt});return ki("sandbox",Gs(),l,{override:{"sandbox.credentials":ut},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:Dt})});let jt={};for(let ut of te.keys){if(!ce(ut))continue;let dt=xe.get(ut);jt[ut]=dt?dt():Oe(ut).catch((At)=>{l({path:ut,message:`${At.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[ut,dt]of xe)if(!(ut in jt)&&ce(ut))jt[ut]=dt();return Ve.object(jt).passthrough().check((ut)=>{ut.issues.push(...te.wrongDocumentIssues(ut.value,jt))}).transform((ut)=>{for(let Lt of Object.keys(ut))if(ut[Lt]===void 0)delete ut[Lt];let dt=Object.keys(ut).filter((Lt)=>!Yn.some((kt)=>kt===Lt)&&!Yo(ut[Lt])),At=dt.length>0&&dt.every((Lt)=>et.has(Lt)||ku(Dt,ut[Lt]));if(et.clear(),At)for(let Lt of dt)l({path:Lt,message:`"${Lt}" holds nothing that could be applied as written and is this source's only policy content; its fail-closed reading binds (beside a lower managed settings source's policy, when one supplies it) until it is fixed.`,statusOnly:!0,onlySubstitutes:!0});return ut})}function jF(){let l=Xe();return l!==void 0&&Je(l)}function Hu(){let l=O(),b=l==="wsl"&&!jF()?"linux":l;switch(b){case"unknown":return{platform:b,chain:[]};default:return{platform:b,chain:Fi(b)}}}var So=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function zu(l,b,D){if(!r(l))return[];let te=[];for(let{alias:ce,canonical:Oe}of So){if(!(ce in l))continue;if(l[ce]===null){if(!(Oe in l)&&D?.loneNullAlias==="rename")l[Oe]=null;delete l[ce];continue}if(Oe in l&&l[Oe]!==null)te.push({file:b,path:ce,message:`"${ce}" is an alias for "${Oe}" and this file sets both; the "${ce}" value was ignored. Use only "${Oe}".`,severity:"warning",alias:ce,canonical:Oe});else l[Oe]=l[ce];delete l[ce]}return te}function Ji(l){if(typeof l!=="object"||l===null)return!1;let b=Object.getPrototypeOf(l);return b===Object.prototype||b===null}function ls(l){if(Array.isArray(l))return l.map(ls);if(l!==null&&typeof l==="object"){let b={};for(let D of Object.keys(l).sort())b[D]=ls(l[D]);return b}return l}var VF=["enabled","enabledPlatforms"],Xo="network.allowedDomains",KF=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function Gu(l){if(!l)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let b=ju(l),D=YF(l);XF([b,...D.map(([,xe])=>xe)]);let te={};for(let[xe,$e]of D){let et={shellSettings:$e.hasHooks?{...$e.shellSettings,hooks:wn($e.hooks)}:$e.shellSettings,envVars:$e.envVars,sandboxSettings:$e.sandboxSettings,isolationSettings:$e.isolationSettings};if(Vu(et))te[xe]=et}let{sandboxSwitches:ce,...Oe}=b;return{...Oe,payloadSlots:te}}function ju(l){let b={},D;for(let ct of Lc){let at=l[ct];if(ct==="policyHelpers"){if(at!==null&&typeof at==="object")for(let ht of Vt){let Dt=oB(at[ht]);if(Dt){if(b[`policyHelpers.${ht}`]=Dt.command,Dt.scriptSize)D??={},D[`policyHelpers.${ht}`]=Dt.scriptSize}}continue}let gt;if(typeof at==="string")gt=at;else if(at!==null&&typeof at==="object"&&"command"in at&&typeof at.command==="string")gt=at.command;if(gt!==void 0&>.length>0)b[ct]=gt}let te=cB(l);if(te&&typeof te==="object")for(let[ct,at]of Object.entries(te)){let gt=at?.source;if(!gt||typeof gt!=="object")continue;if(gt.source==="url"&&typeof gt.headersHelper==="string"&>.headersHelper.length>0)b[`extraKnownMarketplaces[${t(ct)}].source.headersHelper`]=Bu(gt.headersHelper,"url",gt.url);if(gt.source==="settings"&&Array.isArray(gt.plugins)){let ht=new Map;for(let Dt of gt.plugins){let St=t(Dt?.name),Pt=ht.get(St)??0;ht.set(St,Pt+1);let wt=Dt?.source;if(wt!==null&&typeof wt==="object"&&"source"in wt&&wt.source==="command"&&"command"in wt&&typeof wt.command==="string"&&wt.command.length>0)b[`extraKnownMarketplaces[${t(ct)}].plugins[${t(Dt.name)}][${Pt}].source.command`]=wt.command;if(typeof Dt?.headersHelper==="string"&&Dt.headersHelper.length>0){let It=Dt.source,Nt=It!==null&&typeof It==="object";b[`extraKnownMarketplaces[${t(ct)}].plugins[${t(Dt.name)}][${Pt}].headersHelper`]=Bu(Dt.headersHelper,Nt&&"source"in It?It.source:void 0,Nt&&"url"in It?It.url:void 0)}}}}let ce=l.sandbox,Oe={},xe={enabled:yo(ce,"enabled"),enabledPlatforms:yo(ce,"enabledPlatforms"),[Xo]:yo(ce,Xo)};if(ce!==null&&typeof ce==="object"){let ct={enabled:xe.enabled,enabledPlatforms:xe.enabledPlatforms};for(let at of qs){let gt=iB(ce[at]);if(gt)b[`sandbox.${at}`]=wn({value:gt,...ct})}for(let at of Ic){let gt=yo(ce,at);if(JF(at,gt))Oe[`sandbox.${at}`]=wn({value:gt,...ct,...Ku.has(at)&&{allowedDomains:Yu(xe[Xo])}})}}let $e=l.isolation,et={};for(let ct of Pc){let at=yo($e,ct);if(ZF(ct,at))et[`isolation.${ct}`]=wn({value:at})}let rt={};if(l.env&&typeof l.env==="object")for(let[ct,at]of Object.entries(l.env)){if(at===void 0)continue;let gt=String(at);if(gt.length>0&&!KF.has(ct.toUpperCase())&&!xc(ct,gt))rt[ct]=gt}let tt=l.hooks!==void 0&&l.hooks!==null&&typeof l.hooks==="object"&&Object.keys(l.hooks).length>0;return{shellSettings:b,inlineHelperScriptSizes:D,envVars:rt,sandboxSettings:Oe,isolationSettings:et,hasHooks:tt,hooks:tt?l.hooks:void 0,sandboxSwitches:xe}}function YF(l){return qi(l).map(([b,D])=>[b,ju(D)])}function qi(l){let b=[];for(let D of $u){let te=`policyHelpers.${D}`,ce=yo(l,te);if(!Ji(ce))continue;let{policyHelper:Oe,policyHelpers:xe,...$e}=ce;b.push([te,$e])}return b}function Wu(l){return Vt.find((b)=>l===`policyHelpers.${b}.defaultSettings`)}function XF(l){let b=l.map((te)=>Object.keys(te.sandboxSettings).length>0||qs.some((ce)=>te.shellSettings[`sandbox.${ce}`]!==void 0)),D=l.map((te)=>[...Ku].some((ce)=>te.sandboxSettings[`sandbox.${ce}`]!==void 0));l.forEach((te,ce)=>{if(b.some((Oe,xe)=>Oe&&xe!==ce))for(let Oe of VF){let xe=te.sandboxSwitches[Oe];if(xe!==void 0)te.sandboxSettings[`sandbox.${Oe}`]=wn({value:xe})}if(D.some((Oe,xe)=>Oe&&xe!==ce)){let Oe=te.sandboxSwitches[Xo];if(Oe!==void 0)te.sandboxSettings[`sandbox.${Xo}`]=wn({value:Yu(Oe)??Oe})}})}var $u=[...Vt.map((l)=>`${l}.defaultSettings`),"default"];function Zi(l){let b=[];for(let D of $u){let te=`policyHelpers.${D}`,ce=l.payloadSlots[te];if(ce!==void 0&&Vu(ce))b.push([te,ce])}return b}function Vu(l){return Object.keys(l.shellSettings).length>0||Object.keys(l.envVars).length>0||Object.keys(l.sandboxSettings).length>0||Object.keys(l.isolationSettings).length>0}var Ku=new Set(["credentials","network.tlsTerminate"]);function Yu(l){return Array.isArray(l)?w(l.filter((b)=>typeof b==="string")).sort():void 0}function yo(l,b){let D=l;for(let te of b.split(".")){if(D===null||typeof D!=="object")return;D=D[te]}return D}function JF(l,b){if(b===void 0||b===null||b===!1)return!1;if(Array.isArray(b)&&b.length===0)return!1;return!(l==="credentials"&&QF(b))}function ZF(l,b){if(b===void 0||b===null)return!1;switch(l){case"required":return b!==!1;case"egress":return!Ji(b)||Object.entries(b).some(([D,te])=>qF.has(D)?te!==void 0&&te!==null&&!(Array.isArray(te)&&te.length===0):te!==void 0)}}var qF=new Set(["allowedHosts","deniedHosts"]);function QF(l){if(typeof l!=="object"||l===null)return!1;return Object.entries(l).every(([b,D])=>{if(D===void 0)return!0;if(b==="files"||b==="envVars")return Array.isArray(D)&&D.every((te)=>typeof te==="object"&&te!==null&&te.mode==="deny");if(b==="sigv4")return typeof D==="object"&&D!==null&&Object.values(D).every((te)=>te===void 0||te==="deny");return b==="allowPlaintextInject"&&D===!1})}function eB(l){return Object.keys(l.shellSettings).some(tB)}function tB(l){return Vt.some((b)=>l===`policyHelpers.${b}`)}function Xu(l){return eB(l)||Object.keys(l.shellSettings).some((b)=>b.startsWith("extraKnownMarketplaces["))||Zi(l).length>0}function nB(l){return l==="sh"||l==="pwsh"}function oB(l){if(l===null||typeof l!=="object")return;let{path:b,script:D,interpreter:te,timeoutMs:ce,refreshIntervalMs:Oe}=l,xe,$e;if(typeof b==="string"&&b)xe=b;else if(typeof D==="string"&&D&&nB(te))xe={interpreter:te,script:sB(D)},$e=rB(D);else return;return{command:t([xe,ce??null,Oe??null]),scriptSize:$e}}function rB(l){return{bytes:Buffer.byteLength(l,"utf8"),lines:ft(l,`
|
|
39
|
-
`)+(l.endsWith(`
|
|
40
|
-
`)?0:1)}}function sB(l){return Ze(t(l))}function iB(l){if(typeof l==="string")return l||void 0;if(l===null||typeof l!=="object"||!("command"in l)||typeof l.command!=="string"||!l.command)return;let b="args"in l&&Array.isArray(l.args)?l.args.map(String):[];return t([l.command,...b])}function aB(l){return wn(Ju(l))}function Ju(l){return{shellSettings:l.shellSettings,envVars:l.envVars,sandboxSettings:Object.keys(l.sandboxSettings).length>0?l.sandboxSettings:void 0,...Fu(l),hooks:l.hooks,payloadSlots:Zi(l).length>0?Object.fromEntries(Zi(l).map(([b,D])=>{let{isolationSettings:te,...ce}=D;return[b,{...ce,...Fu(D)}]})):void 0}}function Fu(l){return Object.keys(l.isolationSettings).length>0?{isolationSettings:l.isolationSettings}:{}}function wn(l){return t(ls(l))}function Zu(l){return Ze(aB(l))}function qu(l,b,D){if(Zu(b)===l)return!0;return typeof D==="string"&&D.length>0&&Ze(wn({...Ju(b),claudeMd:D}))===l}function Bu(l,b,D){return t([l,typeof b==="string"?b:null,typeof D==="string"?D:null])}var lB=new Set(["dns","unix","ipv4","ipv6"]),M4=new Set([...lB,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function Qu(l){return l.replace(/[^\x20-\x7e]/gu,"?")}function cB(l){let b=l.extraKnownMarketplaces;if(b!==void 0&&b!==null)return b;let D=l;for(let{alias:te,canonical:ce}of So){if(ce!=="extraKnownMarketplaces")continue;let Oe=D[te];if(Oe!==void 0&&Oe!==null&&typeof Oe==="object")return Oe}return}var uB="remote-settings.json";var np="remote-settings-helper-consent";function pB(){return tp(m(),np)}function fB(l){let b=Gu(l);return Xu(b)?b:void 0}function mB(l){return Hn(l,(b,D)=>D.startsWith("$")&&D!=="$schema")}class op{sessionCache=null;eligible=void 0;eligibilityMemo=void 0;ineligibleReason=void 0;evalPolicySnapshotOnly=!1;lastLoadStatus=void 0;lastLoadStatusChanged=c();policySettingsNotified=!1;verifiedPayload=null;unverifiedView=null;projectedView=null;consentedPayload=null;deferredPayload=null;resetEpoch=0;backendView=void 0;replaceSessionCache(l,b){if(this.sessionCache=l,b?.verified){if(this.verifiedPayload=l,b.consentDeferred)this.deferredPayload=l}}seedFromDisk(l){this.sessionCache=l;let b=fB(l);if(b!==void 0){let D=OB();if(D===void 0||!qu(D,b,l.claudeMd))return}this.consentedPayload??=l}markConsented(l){this.consentedPayload=l}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(l,b){if(this.eligible=l,b.memoize)this.eligibilityMemo=l,this.ineligibleReason=l?void 0:b.ineligibleReason}resetListener=null;registerResetListener(l){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=l}reset(){this.sessionCache=null,this.eligible=void 0,this.eligibilityMemo=void 0,this.ineligibleReason=void 0,this.evalPolicySnapshotOnly=!1,this.lastLoadStatus=void 0,this.policySettingsNotified=!1,this.verifiedPayload=null,this.unverifiedView=null,this.projectedView=null,this.consentedPayload=null,this.deferredPayload=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(l){try{this.lastLoadStatusChanged.emit(l)}catch(b){e(`Remote settings: load-status listener threw: ${R(b)}`,{level:"error"})}}}var gB=new i(()=>new op);function Xn(){return gB.of(C().host)}function rp(){return Xn().lastLoadStatus}function Jo(){return}function sp(){return Xn().evalPolicySnapshotOnly}function ip(l){return l!==null&&Xn().projectedView?.view===l}function hB(l){return l&&sp()?{...yc(l),managedSourcesBehavior:"merge"}:l}function EB(){return Jo()===void 0&&Pr()}function _B(){return Jo()??tp(m(),uB)}var ap=8388608;function SB(){if(EB())return null;try{let l=AB();if(l===null)return null;let b=A(le(l));if(!b||typeof b!=="object"||Array.isArray(b))return null;return mB(b)}catch(l){if(Xa(l))e(`Remote settings: Disk cache exceeds ${ap} bytes; ignoring it as if absent`);return null}}var yB=4096;function OB(){let l=Qi();if(l!==void 0)return l.attestation;try{return vn(pB(),yB).trim()||void 0}catch{return}}function AB(){let l=Qi();if(l!==void 0)return l.content;return vn(_B(),ap)}function Qi(){let l=Xn().backendView;if(!a()||l===void 0||!l.ready||l.stoodDown||Jo()!==void 0)return;if(!_t(l.configHome)){l.standDown("config home changed");return}return l}var dZ=ne.state("remote-settings"),uZ=ne.state(np);var bB=new Set(["HTTPS_PROXY","HTTP_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","ALL_PROXY","NODE_OPTIONS","NODE_TLS_REJECT_UNAUTHORIZED",...Ws,...$s,"AWS_ENDPOINT_URL_STS","AWS_ENDPOINT_URL","AWS_ENDPOINT_URL_SSO","AWS_ENDPOINT_URL_SSO_OIDC","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL_BEDROCK_RUNTIME",...Xs,...Js,...Zs,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...Vs,"CLAUDE_CODE_API_BASE_URL","CLAUDE_CODE_OAUTH_REFRESH_TOKEN","CLAUDE_CODE_OAUTH_SCOPES","CLAUDE_CODE_OAUTH_CLIENT_ID","CLAUDE_CODE_SESSION_ACCESS_TOKEN","CLAUDE_SESSION_INGRESS_TOKEN_FILE","CLAUDE_CODE_ENVIRONMENT_KIND","CLAUDE_CODE_REMOTE_SESSION_ID","ANTHROPIC_FEDERATION_RULE_ID","ANTHROPIC_ORGANIZATION_ID","ANTHROPIC_WORKSPACE_ID","ANTHROPIC_SERVICE_ACCOUNT_ID","ANTHROPIC_IDENTITY_TOKEN","ANTHROPIC_IDENTITY_TOKEN_FILE","ANTHROPIC_SCOPE","ANTHROPIC_PROFILE","ANTHROPIC_CONFIG_DIR","CLAUDE_CODE_FEDERATION_CACHE_DIR","HOME","XDG_CONFIG_HOME","APPDATA","USERPROFILE","HOMEDRIVE","HOMEPATH","PROGRAMDATA","ANTHROPIC_CUSTOM_HEADERS","CLAUDE_CODE_HOST_CREDS_FILE","CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST","CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CONFIG_DIR","CLAUDE_SECURESTORAGE_CONFIG_DIR","CLAUDE_CODE_REMOTE_SETTINGS_PATH","CLAUDE_CODE_MANAGED_SETTINGS_PATH","CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION","CLAUDE_CODE_MOCK_REMOTE_SETTINGS","USE_LOCAL_OAUTH","USE_STAGING_OAUTH","CLAUDE_LOCAL_OAUTH_API_BASE","CLAUDE_LOCAL_OAUTH_APPS_BASE","CLAUDE_LOCAL_OAUTH_CONSOLE_BASE","CLAUDE_BRIDGE_BASE_URL","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_BRIDGE_SESSION_INGRESS_URL","CLAUDE_REMOTE_TOOLS_BRIDGE_URL","CLAUDE_CODE_GB_BASE_URL"].map((l)=>l.toUpperCase()));function CB(l){if(!l||!l.env&&!("managedMcpServers"in l))return l;let{managedMcpServers:b,...D}=l;return l.env?{...D,env:Hn(l.env,(te,ce)=>bB.has(ce.toUpperCase()))}:D}function lp(){let l=dp();if(l===null||cp(Xn(),l))return!1;if(ep(l))return!0;let b=qi(l);if(b.length===0)return!1;let{chain:D}=Hu();return b.some(([te,ce])=>{let Oe=Wu(te);return(Oe===void 0||D.includes(Oe))&&ep(ce)})}function ep(l){let b=l.managedMcpServers;return r(b)&&Object.keys(b).length>0}function cp(l,b){return b===l.verifiedPayload||Boolean(Jo())}function dp(){let l=Xn();if(!Jo()&&l.eligible!==!0)return null;if(l.sessionCache)return l.sessionCache;let b=Qi()!==void 0,D=SB();if(D){if(l.seedFromDisk(D),b)ue().invalidatePolicyLayer();else Ot();return D}return null}function up(){let l=dp(),b=Xn(),D=cp(b,l)?l:TB(b,l);if(D===null||!sp())return D;if(b.projectedView?.raw!==D)b.projectedView={raw:D,view:hB(D)};return b.projectedView.view}function TB(l,b){if(b===null)return null;if(l.unverifiedView?.raw!==b)l.unverifiedView={raw:b,view:CB(b)};return l.unverifiedView.view}var RB=process.platform==="darwin"?16777216:process.platform==="linux"||process.platform==="android"?524288:0,fZ=process.platform==="darwin"?536870912:0,mZ=process.platform==="linux"||process.platform==="android"?2097152:0;var IZ=je({noFollowAny:"untried",localVolumes:void 0},(l)=>{l.noFollowAny="untried",l.localVolumes=void 0});var PZ=Symbol("no procfs"),xZ=Symbol("descriptor path unreadable");function pp(l,b){if(l===b)return 0;let D=l.length,te=b.length,ce=Array.from({length:D+1},(Oe,xe)=>Array.from({length:te+1},($e,et)=>xe===0?et:et===0?xe:0));for(let Oe=1;Oe<=D;Oe++)for(let xe=1;xe<=te;xe++){let $e=l[Oe-1]===b[xe-1]?0:1;if(ce[Oe][xe]=Math.min(ce[Oe-1][xe]+1,ce[Oe][xe-1]+1,ce[Oe-1][xe-1]+$e),Oe>1&&xe>1&&l[Oe-1]===b[xe-2]&&l[Oe-2]===b[xe-1])ce[Oe][xe]=Math.min(ce[Oe][xe],ce[Oe-2][xe-2]+1)}return ce[D][te]}var fp=["claude-3-5-haiku","claude-3-5-sonnet","claude-3-7-sonnet","claude-fable-5","claude-fable-5-1","claude-haiku-4-5","claude-mythos-5","claude-mythos-5-1","claude-opus-4-0","claude-opus-4-1","claude-opus-4-5","claude-opus-4-6","claude-opus-4-7","claude-opus-4-8","claude-opus-5","claude-opus-5-5","claude-sonnet-4-0","claude-sonnet-4-5","claude-sonnet-4-6","claude-sonnet-5","claude-sonnet-5-5"],mp=["sonnet","opus","haiku","fable","best","sonnet[1m]","opus[1m]","fable[1m]","opusplan"],Nn=["sonnet","opus","haiku","fable"];function cs(l){return mp.includes(l)}function ea(l){return l.replace(/\[1m\]$/i,"")}function gp(l){return l.replace(/\[(1|2)m\]/gi,"")}function Jn(l){return Nn.includes(l)}function bn(l){let b=l.trim().toLowerCase();if(b===""||/\s/.test(b))return null;b=b.replace(/\[[12]m\]$/,"");let D=b.lastIndexOf("/");if(D!==-1)b=b.slice(D+1);let te=/^(?:([a-z-]+)\.)?anthropic\.(claude-.*)$/.exec(b);if(te){let[,$e,et=""]=te;if($e!==void 0&&!Wa.includes($e))return null;b=et}let ce=LB(b);if(!ce)return null;let Oe=b.slice(ce.base.length);if(Oe!==""&&!/^[-@]/.test(Oe))return null;let xe={family:ce.family,major:ce.major,legacyVersionFirst:ce.legacyVersionFirst,base:ce.base};if(ce.minor!==void 0)xe.minor=ce.minor;if(!DB(Oe))xe.trailer=Oe;else{let $e=/(?:-v\d+@|[-@])(\d{8})/.exec(Oe)?.[1];if($e!==void 0)xe.date=$e}return xe}function DB(l){return/^(?:-fast|-latest)?(?:-v\d{1,3}@\d{8}|[-@]\d{8})?(?:-v\d{1,3}(?::\d{1,3})?)?$/.test(l)}function hp(l,b){return l.major-b.major||(l.minor??0)-(b.minor??0)}function LB(l){let b=/^claude-([a-z]+)-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?/.exec(l);if(b){let[te,ce="",Oe="",xe]=b;return{family:ce,major:Number(Oe),minor:xe===void 0?void 0:Number(xe),legacyVersionFirst:!1,base:te}}let D=/^claude-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?-([a-z]+)/.exec(l);if(D){let[te,ce="",Oe,xe=""]=D;return{family:xe,major:Number(ce),minor:Oe===void 0?void 0:Number(Oe),legacyVersionFirst:!0,base:te}}return null}function Qt(l){let b=l.replace(/[\u0000-\u001f\u007f-\u009f]/g,"?");return b.length>128?`${b.slice(0,128)}…`:b}function IB(){let l=[...Nn],b=l.pop();return l.length===0?b??"":`${l.join(", ")} or ${b}`}function ds(l){return l.charAt(0).toUpperCase()+l.slice(1)}function Ep(l){let b=l.trim().toLowerCase(),D=gp(b).trim(),te=D!==b?" Context-size tags such as [1m] are ignored: the entry blocks the model at every context size.":"";if(D==="")return{entry:null,warning:"An empty deniedModels entry was ignored."};if(Jn(D))return{entry:{kind:"family",family:D},...te!==""&&{warning:`"${Qt(l)}" blocks every ${ds(D)} model.${te}`}};if(cs(D)||D==="default")return{entry:null,warning:`"${Qt(l)}" was ignored: it names a different model depending on the release and settings. Name the model instead, for example "claude-opus-5-5".`};let ce=bn(D),Oe=ce!==null||D.startsWith("claude-")?D:`claude-${D}`,xe=ce??(Oe!==D?bn(Oe):null);if(xe){let $e=Oe.lastIndexOf(xe.base),et=$e===-1?"":Oe.slice($e+xe.base.length),rt=xe.trailer===void 0&&et!==""?` "${Qt(et)}" is ignored.`:"";return{entry:{kind:"model",id:xe},...(te!==""||rt!=="")&&{warning:`"${Qt(l)}" blocks ${PB(xe)}.${rt}${te}`}}}return{entry:{kind:"literal",value:D},warning:xB(l,D)}}function PB(l){let b=ds(l.family);return l.minor===void 0?`every ${b} ${l.major}.x model`:`${b} ${l.major}.${l.minor} in every spelling and snapshot`}function xB(l,b){let D=`"${Qt(l)}" blocks only the exact model name "${Qt(b)}"; other spellings of the same model are not blocked.`,te=b.replace(/(\d)\.(\d)/g,"$1-$2");if(te!==b){let Oe=te.startsWith("claude-")?te:`claude-${te}`;if(bn(Oe)!==null)return`${D} To block a version, write it with a hyphen: "${Qt(Oe)}".`}let ce=new RegExp(`^(${Nn.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(b);if(ce){let[,Oe,xe,$e]=ce;return $e!==void 0?`${D} To block a version, write its model ID, for example "claude-${Oe}-${xe}-${$e}".`:`${D} To block only version ${xe}, write "claude-${Oe}-${xe}-0"; "claude-${Oe}-${xe}" blocks every ${ds(Oe)} ${xe}.x model.`}if(/^[a-z]+$/.test(b)){let Oe=Nn.find((xe)=>pp(b,xe)===1);return Oe!==void 0?`${D} If you meant the ${ds(Oe)} family, write "${Oe}".`:`${D} To block a model family other than ${IB()}, list its versioned IDs.`}return D}function _p(l){let b=ea(l.trim().toLowerCase());if(b==="")return{kind:"ignored"};if(Jn(b))return{kind:"family",family:b};let D=b.startsWith("claude-")?b.slice(7):"";if(Jn(D))return{kind:"family",family:D};if(cs(b)||b==="default")return{kind:"ignored"};let te=bn(b)!==null||b.startsWith("claude-")?b:`claude-${b}`,ce=bn(te);return ce!==null?{kind:"model",id:ce,latest:NB(te,ce),spelling:te}:{kind:"literal",value:b}}function wB(l,b){let D=l.toLowerCase(),te=D.lastIndexOf(b.base);return te===-1?"":D.slice(te+b.base.length)}function NB(l,b){return b.trailer===void 0&&wB(l,b).startsWith("-latest")}function vB(l,b){for(let D of b){if(Jn(D))continue;let te=D.indexOf(l);if(te===-1)continue;let ce=te+l.length;if(ce===D.length||D[ce]==="-")return!0}return!1}function kB(l){return l.charAt(0).toUpperCase()+l.slice(1)}function Sp(l){let b;for(let D of fp){let te=bn(D);if(te!==null&&te.family===l&&!te.legacyVersionFirst&&(b===void 0||hp(te,b)>0))b=te}return b?.base}function yp(l,b){let D=_p(l);switch(D.kind){case"ignored":{if(l.trim()==="")return"An empty availableModels entry was ignored.";let te=Sp("opus");return`"${Qt(l)}" in availableModels was ignored, because "availableModelsMatch" is "exact" and this name means a different model depending on the release and settings. List the model IDs you want to allow instead${te===void 0?"":`, for example "${te}"`}.`}case"family":{let te=b.filter((Oe)=>_p(Oe).kind!=="ignored").map((Oe)=>ea(Oe.trim().toLowerCase()));if(Jn(l.trim().toLowerCase())&&vB(D.family,te))return;let ce=Sp(D.family);return`"${Qt(l)}" in availableModels allows every ${kB(D.family)} model, including future releases, even though "availableModelsMatch" is "exact". To allow only some versions, list their model IDs instead${ce===void 0?"":`, for example "${ce}"`}.`}case"model":return;case"literal":return MB(l,D.value)}}function MB(l,b){let D=`"${Qt(l)}" in availableModels allows only a model named exactly "${Qt(b)}".`,te=b.replace(/(\d)\.(\d)/g,"$1-$2");if(te!==b){let Oe=te.startsWith("claude-")?te:`claude-${te}`;if(bn(Oe)!==null)return`${D} To allow a version, write it with a hyphen: "${Qt(Oe)}".`}let ce=new RegExp(`^(${Nn.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(b);if(ce){let[,Oe,xe,$e]=ce;return`${D} To allow a version, write its model ID, for example "claude-${Oe}-${xe}${$e!==void 0?`-${$e}`:""}".`}return}function UB(l){return l!==void 0&&(l.commit!==void 0||l.pr!==void 0)}function Op(l,b){let D=l?.commitTrailers;if(typeof D==="boolean")return D?"explicit-enabled":"disabled";if(l!==void 0&&UB(l))return l.commit===""?"disabled":"implicit-enabled";if(b!==void 0)return b?"implicit-enabled":"disabled";return}var HB=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function us({slot:l,adminTiers:b}){return l?.allowManagedMcpServersOnly===!0||b.some((D)=>D.allowManagedMcpServersOnly===!0)}function ta({slot:l,adminTiers:b}){return l?.allowedMcpServers??b.find((D)=>D.allowedMcpServers!==void 0)?.allowedMcpServers}function Ap(l,b){return HB.filter((D)=>l[D]!==void 0&&!zB(D,l,b))}function zB(l,b,D){let te=D.slot??{};switch(l){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return b.allowManagedMcpServersOnly===us(D);case"disableClaudeAiConnectors":return b.disableClaudeAiConnectors===(te.disableClaudeAiConnectors===!0||D.adminTiers.some((ce)=>ce.disableClaudeAiConnectors===!0));case"allowedMcpServers":return z(b.allowedMcpServers,us(D)?ta(D):te.allowedMcpServers);case"disabledMcpjsonServers":return(b.disabledMcpjsonServers??[]).every((ce)=>te.disabledMcpjsonServers?.includes(ce)===!0);case"enabledMcpjsonServers":return(b.enabledMcpjsonServers??[]).every((ce)=>te.enabledMcpjsonServers?.includes(ce)===!0);case"enableAllProjectMcpServers":return(b.enableAllProjectMcpServers??!1)===(te.enableAllProjectMcpServers??!1);case"managedMcpServers":{let ce=te.managedMcpServers??{};return Object.entries(b.managedMcpServers??{}).every(([Oe,xe])=>Object.hasOwn(ce,Oe)&&z(ce[Oe],xe))}}}import{userInfo as FB}from"os";var bp="com.anthropic.claudecode",ps="HKLM\\SOFTWARE\\Policies\\ClaudeCode",fs="HKCU\\SOFTWARE\\Policies\\ClaudeCode",Zo="Settings",na="/usr/bin/plutil",Cp=["-convert","json","-o","-","--"],Tp=["-lint","-s","--"],Rp=5000,ms=2097152,Dp="/mnt/c/Windows/System32/reg.exe",Cn="/mnt/c/Program Files/ClaudeCode";function qo(){if(process.platform!=="linux")return!1;if(process.env.WSL_DISTRO_NAME)return!0;try{let l=vt("fs").readFileSync("/proc/version","utf8").toLowerCase();return l.includes("microsoft")||l.includes("wsl")}catch{return!1}}function Lp(){let l="";try{l=FB().username}catch{}let b=[];if(l)b.push({path:`/Library/Managed Preferences/${l}/${bp}.plist`,label:"per-user managed preferences"});return b.push({path:`/Library/Managed Preferences/${bp}.plist`,label:"device-level managed preferences"}),b}var Ip=512;function oa(l){return l.map(BB)}function BB(l){let{file:b,severity:D,docLink:te,statusOnly:ce,startupFatal:Oe,errorClass:xe,preserveOnWrite:$e,mcpErrorMetadata:et,userWritable:rt,wslIgnored:tt,substituted:ct,onlySubstitutes:at,removal:gt,path:ht,message:Dt,expected:St,suggestion:Pt,invalidValue:wt,...It}=l,Nt=It;return{file:b,severity:D,docLink:te,statusOnly:ce,startupFatal:Oe,errorClass:xe,preserveOnWrite:$e,mcpErrorMetadata:et,userWritable:rt,wslIgnored:tt,substituted:ct,onlySubstitutes:at,removal:gt,path:Qo(ht),message:Qo(Dt),expected:St===void 0?void 0:Qo(St),suggestion:Pt===void 0?void 0:Qo(Pt),invalidValue:typeof wt==="string"?Qo(wt):void 0}}function Qo(l){let b=Qu(l.replace(/\s+/gu," "));return b.length>Ip?`${b.slice(0,Ip-1)}…`:b}import{globalRegistry as r5,toJSONSchema as s5}from"zod/v4";import{$ZodLazy as a5}from"zod/v4/core";var Tn="https://code.claude.com/docs/en",GB=[{matches:(l)=>l.path==="permissions.defaultMode"&&l.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${Tn}/iam#permission-modes`}},{matches:(l)=>l.path==="apiKeyHelper"&&l.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(l)=>l.path==="cleanupPeriodDays"&&l.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:(l)=>l.path.startsWith("env.")&&l.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${Tn}/settings#environment-variables`}},{matches:(l)=>(l.path==="permissions.allow"||l.path==="permissions.deny")&&l.code==="invalid_type"&&l.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(l)=>l.path.startsWith("hooks.")&&l.code==="invalid_key",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${Tn}/hooks`}},{matches:(l)=>/\.hooks\.\d+\.command$/.test(l.path)&&l.code==="invalid_type"&&l.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${Tn}/hooks#exec-form-and-shell-form`}},{matches:(l)=>l.path.includes("hooks")&&l.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(l)=>l.code==="invalid_type"&&l.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(l)=>l.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${Tn}/settings`}},{matches:(l)=>l.code==="invalid_value"&&l.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(l)=>l.code==="invalid_type"&&l.expected==="object"&&l.received===null&&l.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(l)=>l.path==="permissions.additionalDirectories"&&l.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${Tn}/iam#working-directories`}}],jB={permissions:`${Tn}/iam#configuring-permissions`,env:`${Tn}/settings#environment-variables`,hooks:`${Tn}/hooks`};function Pp(l){let b=GB.find((te)=>te.matches(l));if(!b)return null;let D={...b.tip};if(l.code==="invalid_value"&&l.enumValues&&!D.suggestion)D.suggestion=`Valid values: ${l.enumValues.map((te)=>`"${te}"`).join(", ")}`;if(!D.docLink&&l.path)D.docLink=jB[nt(l.path,".")];return D}var H5=mt(()=>Gi(ho(),{strictPolicyHelperKeys:!0}).strict());function xp(l){return l.code==="invalid_type"}function wp(l){return l.code==="invalid_value"}function WB(l){return l.code==="unrecognized_keys"}function Np(l){return l.code==="too_small"}function Kt(l){if(l===null)return"null";if(l===void 0)return"undefined";if(Array.isArray(l))return"array";return typeof l}function vp(l){let b=l.match(/received (\w+)/);return b?b[1]:void 0}function er(l,b){return l.issues.flatMap((te)=>{if(te.code!=="invalid_union"||te.path.join(".")!=="attribution")return[te];let ce=te.errors.flat().filter((Oe)=>Oe.path.length>0);return ce.length>0?ce.map((Oe)=>({...Oe,path:[...te.path,...Oe.path]})):[te]}).map((te)=>{let ce=te.path.map(String).join("."),Oe=te.message,xe,$e,et,rt,tt;if(wp(te))$e=te.values.map((at)=>String(at)),et=$e.join(" | "),rt=void 0,tt=void 0;else if(xp(te)){et=te.expected;let at=vp(te.message);rt=at??Kt(te.input),tt=at??Kt(te.input)}else if(Np(te))et=String(te.minimum);else if(te.code==="custom"&&"params"in te)rt=te.params.received,tt=rt;let ct=Pp({path:ce,code:te.code,expected:et,received:rt,enumValues:$e,message:te.message,value:rt});if(wp(te))xe=$e?.map((at)=>`"${at}"`).join(", "),Oe=`Invalid value. Expected one of: ${xe}`;else if(xp(te)){let at=vp(te.message)??Kt(te.input);if(te.expected==="object"&&at==="null"&&ce==="")Oe="Invalid or malformed JSON";else Oe=`Expected ${te.expected}, but received ${at}`}else if(WB(te)){let at=te.keys.join(", ");Oe=`Unrecognized ${De(te.keys.length,"field")}: ${at}`}else if(Np(te))Oe=`Number must be greater than or equal to ${te.minimum}`,xe=String(te.minimum);return{file:b,path:ce,message:Oe,expected:xe,invalidValue:tt,suggestion:ct?.suggestion,docLink:ct?.docLink}})}function $B(l,b,D){if(!l||typeof l!=="object")return[];let te=l;if(!te.permissions||typeof te.permissions!=="object")return[];let ce=te.permissions,Oe=[],xe=new Map;for(let $e of["allow","deny","ask"]){let et=ce[$e];if(!Array.isArray(et))continue;let rt=et.filter((tt)=>{if(typeof tt!=="string")return Oe.push({file:b,path:`permissions.${$e}`,message:`Non-string value in ${$e} array was removed`,severity:"warning",invalidValue:tt}),!1;let ct=Li(tt,$e);if(!ct.valid){let at=`Invalid permission rule "${tt}" was skipped: ${ct.error}`;if(ct.suggestion)at+=`. ${ct.suggestion}`;return Oe.push({file:b,path:`permissions.${$e}`,message:at,severity:"warning",invalidValue:tt}),!1}return!0});if(D?.policySource&&$e!=="allow"&&et.length>0&&rt.length===0){if(!D.strictParseFollows)continue;xe.set($e,"unreadable")}else if(rt.length<et.length)xe.set($e,"trimmed");ce[$e]=rt}return Vi("permissions",ce,($e)=>xe.get($e),($e)=>Oe.push({file:b,path:$e.path,message:$e.message,severity:"warning",...$e.substituted&&{substituted:$e.substituted}})),Oe}var VB=new Set(H);function KB(l,b){if(!l||typeof l!=="object")return[];return[...sd(l,id)?[{file:b,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${jn}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...YB(l,b)]}function YB(l,b){if(!("hooks"in l))return[];if(l.hooks===null||typeof l.hooks!=="object"||Array.isArray(l.hooks)){let ce=Kt(l.hooks);if(Array.isArray(l.hooks)&&(l.hooks.some(r)||ii(l.hooks)))return[{file:b,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${ce} — ${jn}.`,invalidValue:ce,docLink:"https://code.claude.com/docs/en/hooks"}];return delete l.hooks,[{file:b,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${ce}. This field was ignored.`,severity:"warning",invalidValue:ce,docLink:"https://code.claude.com/docs/en/hooks"}]}let D=l.hooks;if(Fr(D))return[{file:b,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${jn}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let te=[];for(let ce of Object.keys(D)){let Oe=We(ce);if(!VB.has(ce)){if(Bn(D[ce],3,{matchersCount:!Array.isArray(D[ce])})){te.push({file:b,path:`hooks.${Oe}`,message:`"${Oe}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${jn}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete D[ce],te.push({file:b,path:`hooks.${Oe}`,message:`Unknown hook event "${Oe}" was ignored. Valid events: ${H.join(", ")}`,severity:"warning",invalidValue:Oe,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(D[ce])){let xe=D[ce],$e=Kt(xe);if(zo.has(ce)&&xe!==null||Bn(xe,3,{matchersCount:!1})){te.push({file:b,path:`hooks.${Oe}`,message:`Hook event "${Oe}" must be an array of matchers; received ${$e} — ${jn}.`,invalidValue:$e,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete D[ce],te.push({file:b,path:`hooks.${Oe}`,message:`Hook event "${Oe}" must be an array of matchers; received ${$e}. This entry was ignored.`,severity:"warning",invalidValue:$e,docLink:"https://code.claude.com/docs/en/hooks",...xe!==null&&{preserveOnWrite:!0}})}}for(let[ce,Oe]of Object.entries(D)){let{stripped:xe,unloadableGuards:$e}=ld(Oe,ce);for(let et of $e)te.push({file:b,path:et.aboutType?`hooks.${ce}.${et.path}.type`:`hooks.${ce}.${et.path}`,message:`${et.problem} — ${jn}.${et.aboutType?` Valid types: ${[...zr()].join(", ")}`:""}`,severity:"fatal",invalidValue:et.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let et of xe)te.push({file:b,path:et.aboutType?`hooks.${ce}.${et.path}.type`:`hooks.${ce}.${et.path}`,message:et.aboutType?`${et.problem}; entry ignored. Valid types: ${[...zr()].join(", ")}`:`${et.problem}; ${et.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:et.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(te.length>0&&Object.keys(D).length===0)delete l.hooks;return te}var XB=[{key:"allowedMcpServers",schema:ts},{key:"deniedMcpServers",schema:ns}];function JB(l,b,D){if(!l||typeof l!=="object")return[];let te=l,ce=[];for(let{key:Oe,schema:xe}of XB){if(!(Oe in te))continue;if(!Array.isArray(te[Oe])){if(D?.keepWholeFieldInvalid)continue;let rt=te[Oe];delete te[Oe],ce.push({file:b,path:Oe,message:`"${Oe}" must be an array; received ${Kt(rt)}. This field was ignored.`,severity:"warning",invalidValue:rt});continue}let $e=te[Oe],et=[];for(let rt=0;rt<$e.length;rt++){let tt=xe().safeParse($e[rt]);if(tt.success)et.push($e[rt]);else ce.push({file:b,path:`${Oe}[${rt}]`,message:`Invalid entry was ignored: ${tt.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:$e[rt]})}if(et.length<$e.length)te[Oe]=et}return ce}var ZB=["strictKnownMarketplaces","blockedMarketplaces"];function qB(l){if(!r(l))return;for(let b of ss())if(l[b]===null)delete l[b]}function QB(l,b,D){if(!r(l))return[];let te=[];for(let ce of ZB){let Oe=l[ce];if(!Array.isArray(Oe))continue;let xe=[],$e=[];for(let et=0;et<Oe.length;et++){let rt=Bo().safeParse(Oe[et]);if(!rt.success){xe.push(Oe[et]),$e.push(et);continue}let tt=$i(rt.data);if(tt===null){xe.push(Oe[et]),$e.push(et);continue}if(ce==="blockedMarketplaces"){xe.push(Oe[et]),$e.push(et),te.push({file:b,path:`${ce}[${et}]`,message:`Unenforceable entry was kept: ${tt}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}te.push({file:b,path:`${ce}[${et}]`,message:`Invalid entry was ignored: ${tt}`,severity:"warning"})}if(xe.length<Oe.length)l[ce]=xe,D?.set(ce,$e)}return te}function e0(l,b){if(!r(l)||l.managedMcpServers===void 0)return[];let te=[],ce=Mr(l.managedMcpServers,(Oe,xe)=>te.push({file:b,path:Oe?`managedMcpServers.${Oe}`:"managedMcpServers",message:Oe?`Managed MCP server was ignored: ${xe}`:xe,severity:"warning"}));if(ce===void 0)delete l.managedMcpServers;else l.managedMcpServers=ce;return te}function t0(l){if(!l||typeof l!=="object")return;let b=l.source;if(!b||typeof b!=="object")return;let D=b.source;return typeof D==="string"?D:void 0}function n0(l){if(!l||typeof l!=="object")return!1;let b=l.source;if(!b||typeof b!=="object")return!1;let D=b.plugins;return Array.isArray(D)&&D.some(yi)}function o0(l,b){if(!l||typeof l!=="object")return[];let D=l,te="extraKnownMarketplaces";if(!(te in D))return[];let ce=D[te];if(!ce||typeof ce!=="object"||Array.isArray(ce)){let $e=Kt(ce);return delete D[te],[{file:b,path:te,message:`"${te}" must be an object mapping marketplace names to declarations; received ${$e}. This field was ignored.`,severity:"warning",invalidValue:$e}]}let Oe=ce,xe=[];for(let $e of Object.keys(Oe)){let et=Mi().safeParse(Oe[$e]),rt,tt=!1;if(!et.success){let ct=t0(Oe[$e]);if(ct!==void 0&&!Bd.has(ct)||n0(Oe[$e]))continue;rt=jr(et.error.issues)}else if(et.data.source.source==="settings"&&et.data.source.name!==$e)rt=`key "${gn($e)}" must match the settings source name "${gn(et.data.source.name)}"`;if(rt!==void 0)xe.push({file:b,path:`${te}.${gn($e)}`,message:tt?"Marketplace entry was ignored: its name reads like an official Anthropic or Claude marketplace. It stays in this file: rename it (the key and the source's name) to use it, or delete it.":`Invalid marketplace entry was ignored: ${rt}`,severity:"warning",...tt&&{preserveOnWrite:!0}}),delete Oe[$e]}return xe}function r0(l,b){if(!l||typeof l!=="object")return[];let D=l,te="modelPicker";if(!(te in D))return[];let ce=D[te];if(!r(ce)||!Array.isArray(ce.options)){let et=r(ce)?`options: ${Kt(ce.options)}`:Kt(ce);return delete D[te],[{file:b,path:te,message:`"${te}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${et}. This field was ignored.`,severity:"warning",invalidValue:et}]}let Oe=[];if("replaceBuiltInOptions"in ce&&typeof ce.replaceBuiltInOptions!=="boolean"){let et=Kt(ce.replaceBuiltInOptions);delete ce.replaceBuiltInOptions,Oe.push({file:b,path:`${te}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${et}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:et})}let xe=ce.options,$e=[];for(let et=0;et<xe.length;et++){let rt=zi().safeParse(xe[et]);if(rt.success){$e.push(xe[et]);continue}Oe.push({file:b,path:`${te}.options.${et}`,message:`${i0(rt.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:Kt(xe[et])})}if($e.length!==xe.length)ce.options=$e;return Oe}function s0(l,b){if(!l||typeof l!=="object"||Array.isArray(l))return[];let D=l;if(!("modelPricing"in D)||D.modelPricing===void 0)return[];let te=D.modelPricing;if(!te||typeof te!=="object"||Array.isArray(te))return delete D.modelPricing,[{file:b,path:"modelPricing",message:`"modelPricing" must be an object; received ${Kt(te)}. It was ignored.`,severity:"warning"}];let ce=te,Oe=[];if(ce.multiplier!==void 0&&!Hi().safeParse(ce.multiplier).success)Oe.push({file:b,path:"modelPricing.multiplier",message:'"multiplier" must be a number greater than 0 and at most 10. It was ignored.',severity:"warning",invalidValue:ce.multiplier}),delete ce.multiplier;if(ce.overrides!==void 0){let xe=ce.overrides;if(!xe||typeof xe!=="object"||Array.isArray(xe))Oe.push({file:b,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${Kt(xe)}. It was ignored.`,severity:"warning"}),delete ce.overrides;else{let $e=xe;for(let et of Object.keys($e)){let rt=Ui().safeParse($e[et]);if(rt.success&&et!=="constructor"&&et!=="__proto__")continue;let tt=rt.success?void 0:rt.error.issues[0];Oe.push({file:b,path:`modelPricing.overrides.${gn(et)}`,message:`Invalid pricing row was ignored (${tt?`${tt.path.join(".")||"row"}: ${tt.message}`:"not a model ID"}).`,severity:"warning",invalidValue:$e[et]}),delete $e[et]}}}return Oe}function i0(l){if(!l)return"Invalid modelPicker row";return`modelPicker row ${l.path.length>0?`"${l.path.join(".")}" `:""}${l.message}`.trim()}function a0(l,b,D){if(!l||typeof l!=="object"||Array.isArray(l))return[];let te=l,ce=te.crossSessionInbound;if(ce===void 0||l0(ce))return[];if(D?.policySource)te.crossSessionInbound="refuse";else delete te.crossSessionInbound;return[u0(ce,b,D?.policySource===!0)]}function l0(l){return typeof l==="string"&&Ko.includes(l)}var c0="crossSessionInbound";function d0(l){let b=Ko.map((te)=>`"${te}"`).join(", "),D=typeof l==="string"?`"${gn(l).replace(/^<key>$/,"<value>")}"`:Kt(l);return`must be one of ${b}; received ${D}`}function u0(l,b,D=!1){let te=Ko.map((Oe)=>`"${Oe}"`).join(", "),ce=D?'In managed settings an unrecognized value is treated as "refuse" (the most restrictive): cross-session messages to this session are turned away until an administrator fixes it.':"This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.";return{file:b,path:c0,message:`"crossSessionInbound" ${d0(l)}. ${ce}`,severity:"warning",expected:te,...D&&{statusOnly:!0}}}var kp="remoteControl.shareHostProfile";function p0(l,b,D){if(!r(l)||l.remoteControl===void 0)return[];let te=D?.policySource===!0,ce=es.map((at)=>`"${at}"`).join(", "),Oe=te?'In managed settings this is treated as "off" (the most restrictive): Remote Control environments report nothing about this machine until an administrator fixes it.':"While it is present, Remote Control environments report nothing about this machine.",xe=(at)=>({file:b,path:kp,message:`${at}. ${Oe}`,severity:"warning",expected:ce,...te?{statusOnly:!0}:{preserveOnWrite:!0}}),$e=(at)=>typeof at==="string"?`"${gn(at).replace(/^<key>$/,"<value>")}"`:Kt(at),et=l.remoteControl;if(!r(et)){if(te)l.remoteControl={shareHostProfile:"off"};else delete l.remoteControl;return[xe(`"remoteControl" must be an object like { "shareHostProfile": ${ce.replace(/, /g," | ")} }; received ${$e(et)}`)]}let rt=[],tt=Object.keys(et).filter((at)=>at!=="shareHostProfile");if(tt.length>0){if(te)et.shareHostProfile="off";rt.push(xe(`"remoteControl" has an unrecognized key ${tt.map((at)=>`"${gn(at)}"`).join(", ")} (its only key is "shareHostProfile")`))}let ct=et.shareHostProfile;if(ct!==void 0&&!(typeof ct==="string"&&es.includes(ct))){if(te)et.shareHostProfile="off";else delete et.shareHostProfile;rt.push(xe(`"${kp}" must be one of ${ce}; received ${$e(ct)}`))}return rt}function tr(l,b,D){let te=[...zu(l,b)];return qB(l),te.push(...$B(l,b,{policySource:D?.policySource,strictParseFollows:D?.mcpServerEntrySalvageOnly}),...KB(l,b),...o0(l,b),...r0(l,b),...s0(l,b),...a0(l,b,{policySource:D?.policySource}),...p0(l,b,{policySource:D?.policySource}),...D?.skipMcpServerEntryFilter?[]:JB(l,b,{keepWholeFieldInvalid:D?.mcpServerEntrySalvageOnly}),...D?.mcpServerEntrySalvageOnly?e0(l,b):[],...D?.mcpServerEntrySalvageOnly?QB(l,b,D.marketplacePatternIndexMapOut):[]),te}function ua(l){let b=new Set(l.allowedSources);return b.add("flagSettings"),b.add("policySettings"),Tt.filter((D)=>b.has(D))}function g0(){return on(Mn(),"managed-settings.json")}function Kp(l){if(O()==="wsl"){let b=Ao(fa(l));if(l.wslInherits?.()){let D=ra(Cn,l.store);if(Ao(D)||b)return D;let te=ra(Mn(),l.store);return{...te,errors:[...D.errors,...te.errors],loadState:En(D.loadState,te.loadState)}}if(b)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"}}return ra(Mn(),l.store)}function Mp(l,b,D){D.push(...b.errors);let{settings:te}=b;if(!te||Object.keys(te).length===0)return;for(let[ce,Oe]of is){let xe=ce.split(".");if(cn(te,xe)===void 0)continue;let $e=b.errors.find((tt)=>tt.substituted&&tt.path===ce),et=$e!==void 0,rt=cn(l.merged,xe);if(et&&rt!==void 0&&!l.floors.has(ce)){let tt=xe.at(-1);if(Oe.inert.has(Oe.read(rt))){uc(te,xe),D.push({file:$e.file,path:ce,message:`That substitute is not applied: "${tt}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}D.push({file:$e.file,path:ce,message:`That substitute also displaces the wider "${tt}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(et)l.floors.add(ce);else l.floors.delete(ce)}if(l.merged=Xt(l.merged,te,hn),l.found=!0,lr(te)&&!b.errors.some((ce)=>ce.onlySubstitutes))l.authored=!0}function pa(l){return l.endsWith(".json")&&!l.startsWith(".")}function h0(l){return(l.isFile()||l.isSymbolicLink())&&pa(l.name)}function ra(l,b){let D=[],te={merged:{},found:!1,authored:!1,floors:new Set},ce=!1,Oe="absent",xe=Oo(on(l,"managed-settings.json"),b,void 0,!0);Mp(te,xe,D),ce||=rr(xe),Oe=En(Oe,sr(xe));let $e=on(l,"managed-settings.d");try{let rt=b.folderListingForPolicyWalk($e),tt;if(rt!==void 0)tt=rt;else tt=s().readdirSync($e).filter(h0).map((ct)=>ct.name).sort(),b.noteWalkListing($e,tt);for(let ct of tt){let at=Oo(on($e,ct),b,void 0,!0);Mp(te,at,D),ce||=rr(at),Oe=En(Oe,sr(at))}}catch(rt){let tt=n(rt);if(tt!=="ENOENT"&&tt!=="ENOTDIR")e(`managed-settings.d read failed: ${rt}`,{level:"error"}),D.push(ir($e,rt,"directory")),Oe="didNotLoad"}let et=te.found&&bo(te.merged)?te.merged:null;return{settings:et,errors:D,documentHasPolicyContent:ce,loadState:Oe,...et!==null&&!te.authored&&lr(et)&&{onlySubstitutes:!0}}}function E0(l,b){if(_(l))T0(b);else e(`settings file read failed at ${b}: ${l}`,{level:"error"})}function Oo(l,b,D,te){let ce=D!==void 0?`${l}\x00pinned`:l,Oe=b.parsedFiles.get(ce);if(Oe)return{...Oe,settings:Oe.settings?B(Oe.settings):null};let xe=A0(l,D,te);return b.parsedFiles.set(ce,xe),{...xe,settings:xe.settings?B(xe.settings):null}}function fa(l){let b=l.mdm?.();if(!b)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};return{settings:b.settings&&Object.keys(b.settings).length>0?b.settings:null,errors:L0(b.errors,()=>ma(l)),documentHasPolicyContent:rr(b),loadState:sr(b),...b.onlySubstitutes&&{onlySubstitutes:b.onlySubstitutes}}}function Ss(l,b){let D=Hp.get(l),te=D?.get(b);if(te)return Up(te);let ce=_0(l,b);if(D)D.set(b,ce);else Hp.set(l,new Map([[b,ce]]));return Up(ce)}function Up(l){return{settings:l.settings&&B(l.settings),errors:l.errors.map((b)=>({...b})),documentHasPolicyContent:l.documentHasPolicyContent,loadState:l.loadState,removed:l.removed,...l.onlySubstitutes&&{onlySubstitutes:l.onlySubstitutes}}}var Hp=new WeakMap;function _0(l,b){let D=B(l),te=tr(D,b,{skipMcpServerEntryFilter:!0,policySource:!0}),ce=[],Oe=Xi(Zp(b,ce),b,D).safeParse(D);if(!Oe.success)return{settings:null,errors:[...te,...er(Oe.error,b)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let xe=[...te,...ce],$e=l,et=Object.keys(Oe.data).length>0?Oe.data:null;return{settings:et,errors:xe,documentHasPolicyContent:lf(l,Oe.data),loadState:"loaded",removed:Object.keys($e).filter((rt)=>Yp(rt,$e[rt])&&Oe.data[rt]===void 0&&xe.every((tt)=>tt.statusOnly||tt.path!==rt&&!tt.path.startsWith(`${rt}.`))),...et!==null&&ce.some((rt)=>rt.onlySubstitutes)&&{onlySubstitutes:!0}}}function Yp(l,b){let D=ss();return D.includes(l)||So.some(({alias:te,canonical:ce})=>te===l&&D.includes(ce))?Yi(l,b):as(l)&&Xp(l,b)}function Xp(l,b){return b===null||r(b)&&Object.keys(b).length>0&&Object.entries(b).every(([D,te])=>{let ce=`${l}.${D}`;return Yi(ce,te)||as(ce)&&Xp(ce,te)})}function Qn(l){return Fs()&&(l==="managedMcpServers"||l.startsWith("managedMcpServers."))}var ys=["managedMcpServers","isolation"],S0=[...ys,"deniedModels","availableModelsMatch"];function Jp(l,b){if(!r(l))return[];let D=[];for(let te of S0){if(!(te in l))continue;if(delete l[te],!Qn(te))D.push({file:b,path:te,message:`"${te}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return D}function Zp(l,b){return(D)=>{if(Qn(D.path))return;if(b.push({file:l,path:D.path,message:D.message,severity:"warning",...D.statusOnly&&{statusOnly:D.statusOnly},...D.startupFatal&&{startupFatal:D.startupFatal},...D.substituted&&{substituted:D.substituted},...D.onlySubstitutes&&{onlySubstitutes:D.onlySubstitutes},...D.removal&&{removal:D.removal}}),D.statusOnly||D.startupFatal)e(`${l}: ${D.path}: ${D.message}`,{level:D.startupFatal?"error":"warn"})}}function ma(l){let b=l?.remote?l.remote():up(),D=!l?.remote&&!Qn("managedMcpServers")&&lp()?[{file:"remote managed settings",path:"managedMcpServers",message:"The organization's MCP servers in the cached remote settings are withheld until the server confirms them this session; they connect as soon as it does.",severity:"warning",statusOnly:!0}]:[],te=l?.remote?void 0:rp(),ce=(te?.state==="stale_cache"||te?.state==="failed")&&te.failure.errorKind==="ruled_empty"?oa(te.failure.rulings??[]):[];if(!b||Object.keys(b).length===0)return{settings:null,errors:[...D,...ce],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:Oe,errors:xe,documentHasPolicyContent:$e,onlySubstitutes:et}=Ss(b,"remote managed settings");return{settings:Oe,errors:[...D,...ce,...oa(xe)],servedSnapshot:ip(b),documentHasPolicyContent:$e,...et&&{onlySubstitutes:et}}}var zp="parent managed settings";function y0(l){let b=l.parentManaged;if(!b||Object.keys(b).length===0)return{settings:null,errors:[]};let D=Ss(b,zp);for(let te of ys)if(D.settings?.[te]!==void 0&&!Qn(te))D.errors.push({file:zp,path:te,message:`"${te}" is only honored from the organization's managed settings sources (server-managed, MDM, managed-settings.json), not from settings a host passes in, and was ignored here.`,severity:"warning",statusOnly:!0});return D}function qp(l){let b=l.flagInline;if(!b)return{settings:null,errors:[]};let D=Fs(),te=l.store.inlineFlagParse;if(te?.inline!==b||te.desktopSupplied!==D)te={inline:b,desktopSupplied:D,parsed:O0(b)},l.store.inlineFlagParse=te;let{settings:ce,errors:Oe}=te.parsed;return{settings:ce&&B(ce),errors:Oe.map((xe)=>({...xe}))}}function O0(l){let b=B(l),D=[...Jp(b,"SDK inline settings"),...tr(b,"SDK inline settings")],te=rs(b).safeParse(b);if(!te.success)return{settings:null,errors:[...D,...er(te.error,"SDK inline settings")]};if(D.some((ce)=>ce.severity==="fatal"))return{settings:null,errors:D};return{settings:te.data,errors:D}}var Os=2097152;function A0(l,b,D){try{let te;if(b!==void 0)te=b;else{let ce=D||b0(l)?Ae(s(),l):yt(s(),l);te=vn(ce.resolvedPath,Os)}return ga(te,l,D)}catch(te){return D0(te,l)}}function ga(l,b,D){if(l.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let te=kn(l,!1);if(D){if(!r(te))return{settings:null,errors:[As(b)],loadState:"didNotLoad"};let $e=B(te),et=tr($e,b,{skipMcpServerEntryFilter:!0,policySource:!0}),rt=[],tt=Xi(Zp(b,rt),b,$e).safeParse($e);if(!tt.success)return{settings:null,errors:[...et,...er(tt.error,b)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:tt.data,errors:[...et,...rt],documentHasPolicyContent:lf(te,tt.data),loadState:"loaded"}}let ce=B(te),Oe=[...Jp(ce,b),...tr(ce,b)],xe=rs(ce).safeParse(ce);if(!xe.success){let $e=er(xe.error,b);return{settings:null,errors:[...Oe,...$e]}}if(Oe.some(($e)=>$e.severity==="fatal"))return{settings:null,errors:Oe};return{settings:xe.data,errors:Oe}}function As(l,{userWritable:b=!1}={}){return b?{file:l,path:"",message:`Managed settings document (${l}) could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.`,severity:"warning",statusOnly:!0,userWritable:!0}:{file:l,path:"",message:"Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",startupFatal:!0}}function b0(l){let b=u(da($t(l))),D=$t(m());return b===u(D)||b===C0(D)}var sa;function C0(l){if(sa?.lexical!==l){let b=da(l);sa={lexical:l,physical:u(on(ze(b)??b,m0(l)))}}return sa.physical}function T0(l){e(`Broken symlink or missing file encountered for settings.json at path: ${l}`)}function R0(){return{settings:null,errors:[],loadState:"absent"}}function D0(l,b){if(E0(l,b),_(l))return R0();return{settings:null,errors:[ir(b,l)],loadState:"didNotLoad"}}function ir(l,b,D="file"){return{file:l,path:"",message:`${D==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${b instanceof Error?b.message:String(b)}`,severity:"fatal",errorClass:"unreadable"}}function Qp(l){return{file:l,path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" in ${l} holds a value that cannot be read (it takes true or false) and no Windows administrator policy is deployed beside it (HKLM or ${Cn}), so whether WSL inherits Windows policy is unknown: no Windows or managed-file policy is in effect (/etc/claude-code is not read beneath it), and unless server-managed settings supply the policy — they apply regardless — sign-in and policy enforcement fail closed until the flag is fixed.`,severity:"fatal",statusOnly:!0}}function Fp(l){return l.path==="wslInheritsWindowsSettings"&&l.severity==="fatal"}function L0(l,b){if(!l.some(Fp))return l;if(!Es(b()))return l;return l.map((D)=>Fp(D)?{...D,severity:"warning"}:D)}function Bp(l,b){switch(l){case"userSettings":return $t(m());case"policySettings":return $t(gs(b));case"projectSettings":return $t(b.projectConfigDir??gs(b));case"localSettings":{if(b.projectConfigDir!==void 0)return $t(b.projectConfigDir);return ef(gs(b),b.canonicalGitRoot)}case"flagSettings":return b.flagPath?da($t(b.flagPath)):$t(gs(b))}}function gs(l){if(l.cwd===null)throw new ke;return l.cwd}function ef(l,b){let D=I0(l,b);if(D.decided!==void 0)return D.decided;if(!N0(D.root))return D.cwdResolved;return D.root}function I0(l,b){let D=b?.(l);if(!D)return{decided:$t(l)};let te=$t(D),ce=$t(l);if(te===ce)return{decided:te};let Oe;try{Oe=v0()}catch{return{decided:ce}}if(te===Oe)return{decided:ce};return{decided:void 0,root:te,cwdResolved:ce}}function P0(l){return ue().localStoreProbes.canonicalRootOwnerUids(l,x0)}function x0(l){let b=s(),D=null;try{D=b.lstatSync(on(l,".claude")).uid}catch(te){if(!_(te))throw te}return{rootUid:b.statSync(l).uid,gitEntryUid:w0(l),claudeEntryUid:D}}function w0(l){let b=s();try{return b.lstatSync(on(l,".git")).uid}catch(D){throw D}}function N0(l){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return e(`localSettings: not canonicalizing the consent store to ${l} — this platform has no uid semantics to verify directory ownership with, so the store stays at the session cwd (canonicalization is POSIX-only)`,{level:"warn"}),!1;let b=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:D,gitEntryUid:te,claudeEntryUid:ce}=P0(l);if(D===b&&te===b&&(ce===null||ce===b))return!0;return e(`localSettings: not canonicalizing the consent store to ${l} — it (uid ${D}), its .git entry (uid ${te}), or its .claude entry (uid ${ce??"absent"}) is not owned by the current user (uid ${b}); the store stays at the session cwd (the pre-canonicalization behavior). If you own this repo, chown it (including .git and .claude) or run from a directory you own.`,{level:"warn"}),!1}catch(D){return e(`localSettings: not canonicalizing the consent store to ${l} — its ownership could not be verified (${D instanceof Error?D.message:String(D)}); the store stays at the session cwd`,{level:"warn"}),!1}}function v0(){return ue().localStoreProbes.normalizedRealHomeDir(k0)}function k0(){let l=ze(f0());if(l===null)throw Error("home directory realpath unavailable");return u(l)}var Gp={default:"settings.json",cowork:"cowork_settings.json"};function M0(l){if(l.coworkPlugins||On.CLAUDE_CODE_USE_COWORK_PLUGINS)return Gp.cowork;return Gp.default}function ar(l,b){switch(l){case"userSettings":return on(Bp(l,b),M0(b));case"projectSettings":case"localSettings":{if(b.cwd===null&&b.projectConfigDir===void 0)return;return on(Bp(l,b),tf(l))}case"policySettings":return g0();case"flagSettings":return b.flagPath}}function tf(l){switch(l){case"projectSettings":return on(".claude","settings.json");case"localSettings":return on(".claude","settings.local.json")}}function nf(l){if(l.cwd===null||ef(l.cwd,l.canonicalGitRoot)===$t(l.cwd))return;if(l.projectConfigDir!==void 0)return;return on($t(l.cwd),tf("localSettings"))}function of(l,b){let D=b.store.perSource.get(l);if(D!==void 0)return D;let te=dG(l,b),ce=te&&nr(l,te,b);return b.store.perSource.set(l,ce),ce}function rf(l){return(l.parentSettingsBehavior??(Pr()?"merge":"first-wins"))==="merge"}function U0(l,b=!1){return!l||rf(l)||b}var H0=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function z0(l){let b={};for(let{path:D,restrictive:te}of Dn()){let ce=cn(l,D);if(D[0]==="sandbox"&&Un(te).includes(ce))An(b,D,ce)}return b.sandbox??{}}var F0=/^(?:Read|Edit)\((?:\.\/)?!/;function B0(l,b){let D={};if(l.allowManagedHooksOnly===!0)D.allowManagedHooksOnly=!0;if(l.disableCommandPluginSources===!0)D.disableCommandPluginSources=!0;if(l.allowManagedMcpServersOnly===!0)D.allowManagedMcpServersOnly=!0;if(l.disableClaudeAiConnectors===!0)D.disableClaudeAiConnectors=!0;if(l.syncClaudeAiSkills===!1)D.syncClaudeAiSkills=!1;if(l.syncClaudeAiPlugins===!1)D.syncClaudeAiPlugins=!1;if(l.remoteTools?.allowUnattendedServing===!1)D.remoteTools={...D.remoteTools,allowUnattendedServing:!1};if(l.allowManagedPermissionRulesOnly===!0)D.allowManagedPermissionRulesOnly=!0;if(l.disableAutoMode==="disable")D.disableAutoMode="disable";let te=l.remoteControl?.shareHostProfile;if(te==="off"||te==="basic")D.remoteControl={...D.remoteControl,shareHostProfile:te};if(Op(l.attribution,l.includeCoAuthoredBy)==="disabled")D.attribution={...D.attribution,commitTrailers:!1};if(l.attribution?.sessionUrl===!1)D.attribution={...D.attribution,sessionUrl:!1};let ce=l.strictPluginOnlyCustomization;if(ce===!0||Array.isArray(ce)&&ce.length>0)D.strictPluginOnlyCustomization=ce;if(l.deniedMcpServers)D.deniedMcpServers=l.deniedMcpServers;if(l.blockedMarketplaces?.length)D.blockedMarketplaces=l.blockedMarketplaces;if(l.deniedModels&&l.deniedModels.length>0)D.deniedModels=l.deniedModels;if(b.forceLoginOrgUUID===void 0&&l.forceLoginOrgUUID)D.forceLoginOrgUUID=l.forceLoginOrgUUID;for(let Oe of la)if(b[Oe]===void 0&&l[Oe])Object.assign(D,{[Oe]:l[Oe]});if(l.enforceAvailableModels===!0)D.enforceAvailableModels=!0;if(l.availableModelsMatch==="exact")D.availableModelsMatch="exact";if(l.permissions){let Oe=co(l.permissions,["deny","ask"]);for(let xe of["deny","ask"]){let $e=Oe[xe];if($e!==void 0)Oe[xe]=$e.filter((et)=>{if(!F0.test(et))return!0;return e(`Ignoring ${xe} rule "${et}" from the parent process's managed settings: a rule starting with "!" removes paths from the rules listed before it instead of restricting anything, so it is not merged into the policy rules. Spell the deny without the exception instead.`,{level:"warn"}),!1})}if(l.permissions.disableBypassPermissionsMode==="disable")Oe.disableBypassPermissionsMode="disable";if(l.permissions.disableAutoMode==="disable")Oe.disableAutoMode="disable";if(l.permissions.blockReadsOutsideWorkingDirectories===!0)Oe.blockReadsOutsideWorkingDirectories=!0;if(b.allowManagedPermissionRulesOnly!==!0){let{allow:xe,additionalDirectories:$e}=l.permissions;if(xe&&b.sandbox?.network?.allowManagedDomainsOnly!==!0)Oe.allow=xe;if($e)Oe.additionalDirectories=$e}if(Object.keys(Oe).length>0)D.permissions=Oe}if(l.sandbox){let{network:Oe,filesystem:xe,credentials:$e}=l.sandbox,et={},rt=Oe?co(Oe,["deniedDomains"]):{},tt=xe?co(xe,["denyRead","denyWrite"]):{};if(Oe){if(b.sandbox?.network?.allowManagedDomainsOnly!==!0&&Oe.allowedDomains)rt.allowedDomains=Oe.allowedDomains}if(Object.keys(rt).length>0)et.network=rt;if(xe){if(b.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&xe.allowRead)tt.allowRead=xe.allowRead}if(Object.keys(tt).length>0)et.filesystem=tt;if($e){let ct=($e.files??[]).map((ht)=>ht.mode==="deny"?{path:ht.path,mode:"deny"}:{path:ht.path,mode:"mask",injectHosts:[]}),at=($e.envVars??[]).filter((ht)=>ht.mode==="deny").map((ht)=>({name:ht.name,mode:"deny"})),gt={...ct.length>0&&{files:ct},...at.length>0&&{envVars:at}};if($e.sigv4){let ht={};for(let Dt of["streaming","presigned","sigv4a"])if($e.sigv4[Dt]==="deny")ht[Dt]="deny";gt.sigv4=ht}{let ht=sf($e.awsPairs??[],[]);if(ht.length>0)gt.awsPairs=ht}if(Object.keys(gt).length>0)et.credentials=gt}if(Xt(et,z0(l)),Object.keys(et).length>0)D.sandbox=et}return D}function sf(l,b){let D=Ln,te=new Set(b.flatMap(jp));return w(l.flatMap(jp)).filter((ce)=>D.includes(ce)&&!te.has(ce)).map((ce,Oe)=>({accessKeyIdVar:ce,secretAccessKeyVar:`${Nr}${Oe+1}_`}))}function jp(l){if(!r(l))return[];return[l.accessKeyIdVar,l.secretAccessKeyVar,l.sessionTokenVar].filter((b)=>typeof b==="string")}var G0=new Set([...[...Ks].filter((l)=>l!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...Ys,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function j0(l,b){if(!b||!l)return null;let D={};if(l.model!==void 0)D.model=l.model;if(l.availableModels!==void 0)D.availableModels=l.availableModels;if(l.availableModelsMatch==="exact"||l.availableModelsMatch!==void 0&&l.availableModels!==void 0)D.availableModelsMatch=l.availableModelsMatch;if(l.enforceAvailableModels!==void 0)D.enforceAvailableModels=l.enforceAvailableModels;if(l.deniedModels!==void 0&&l.deniedModels.length>0)D.deniedModels=l.deniedModels;if(l.fallbackModel!==void 0)D.fallbackModel=l.fallbackModel;if(l.modelPicker!==void 0)D.modelPicker=l.modelPicker;return Object.keys(D).length>0?D:null}function W0(l){let b=[];for(let D of l?.deniedModels??[]){let{warning:te}=Ep(D);if(te!==void 0)b.push({file:"managed settings",path:"deniedModels",message:te,severity:"warning",statusOnly:!0})}return b}function $0(l){if(l?.availableModelsMatch!=="exact")return[];let b=l.availableModels??[];return b.flatMap((D)=>{let te=yp(D,b);return te===void 0?[]:[{file:"managed settings",path:"availableModels",message:te,severity:"warning",statusOnly:!0}]})}function Wp(l,b){let D=l.deniedModels;if(Object.assign(l,b),D!==void 0&&b.deniedModels!==void 0)l.deniedModels=w([...D,...b.deniedModels])}function hs(l){if(delete l.model,delete l.fallbackModel,delete l.modelPicker,delete l.modelOverrides,l.env){let b={};for(let[D,te]of Object.entries(l.env))if(!G0.has(D.toUpperCase()))b[D]=te;l.env=b}}function qn(){return O()==="macos"?"plist":"hklm"}function af(l){let b=bs(l);if(b.composes==="tier")return"helper";let D=or(l);if(b.composes==="remoteSlot"||D.present.remote)return"remote";if(D.present.mdm)return qn();if(D.present.file)return"file";if(D.parentSlice||D.hostModelOverlay)return"parent";let te=l.hkcu?.();return te&&Object.keys(te.settings).length>0?"hkcu":null}function or(l){let b=[],D=ma(l),{settings:te,servedSnapshot:ce}=D;b.push(...D.errors);let Oe=bs(l),xe=Oe.composes==="remoteSlot"?Oe.helper:ia(te),$e=fa(l),et=$e.settings;b.push(...$e.errors);let rt=ia(et),tt=l.file?.()??Kp(l),ct=tt.settings;b.push(...tt.errors);let at=ia(ct),gt=Oe.composes==="remoteSlot"?xe!==null:Es(D),ht=Es($e),Dt=Es(tt),St=aa(xe,gt),Pt=aa(rt,ht),wt=aa(at,Dt),It=xe!==null&&St>=Math.max(Pt,wt),Nt=rt!==null&&Pt>=wt,Gt=[[te,It],[et,Nt],[ct,at!==null]],pn=(Oe.composes==="remoteSlot"?Oe.helper:Gt.find(([Ft,Sn])=>Ft!==null&&(Ft===te&&ce?Sn:Ft.managedSourcesBehavior!==void 0||Sn))?.[0])?.managedSourcesBehavior,_n=xe!==null&&!It,jt=_n?null:xe,Cs=rt!==null&&!Nt&&jt===null,ut=Cs?null:rt,dt=[],At=[[_n,"remote",xe],[Cs,qn(),rt]];for(let[Ft,Sn,yn]of At){if(!Ft||yn===null)continue;if(dt.push([yn,Sn]),!lr(yn))continue;let Ro=Sn==="remote"&&ht?qn():"file";b.push({file:Zn[Sn],path:Object.keys(yn).find((dr)=>!Yn.includes(dr))??"",message:`${Zn[Sn]} holds only values that could not be applied as written, so ${Zn[Ro]} supplies the managed settings while that fail-closed reading still binds beside it (the most restrictive value of each such key applies), until it is fixed.`,severity:"warning",statusOnly:!0})}let{settings:Lt,errors:kt}=y0(l);b.push(...kt);let Mt=(ht?ut:null)??(Dt?at:null),Ht=Lt!==null&&(Mt===null||rf(Mt)),Ut=[J0(jt,ce&&Oe.composes!=="remoteSlot",[ut,at,...Ht?[co(Lt,la)]:[]]),ut,at,...dt.map(([Ft])=>Ft)].filter((Ft)=>Ft!==null),Jt=[...jt!==null?["remote"]:[],...ut!==null?[qn()]:[],...at!==null?["file"]:[],...dt.map(([,Ft])=>Ft)],sn=jt!==null&&ce&&Oe.composes!=="remoteSlot",{admin:an,merged:Wt}=V0(Ut,pn,sn,dt.length),Zt=an===null?[D,$e,tt].find(rr):void 0,Yt=an??(Zt?{}:null),ln={remote:jt!==null||Zt===D,mdm:ut!==null||Zt===$e,file:at!==null||Zt===tt},Bt=!(jt!==null&>&&!sn)&&!(ut!==null&&ht)&&!Dt,fn=[];if(Wt){let Ft=ln.remote?"remote":ln.mdm?qn():"file",Sn=[[ut,qn()],[at,"file"]];for(let[yn,Ro]of Sn){if(yn===null||yn===Ut[0]||sn&&yn===Ut[1])continue;let dr=ha.filter((Ds)=>Object.values(yn[Ds]??{}).some((Ca)=>Ca!==void 0&&Ca!==null)),[ba]=dr;if(ba===void 0)continue;fn.push(Ro),b.push({file:Zn[Ro],path:ba,message:`${dr.map((Ds)=>`"${Ds}"`).join(" and ")} in ${Zn[Ro]} ignored: policy helper configuration is read from the highest managed settings source only (${Zn[Ft]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let Ts=(Ft)=>Ft!==null&&(Ft===Ut[0]||Object.keys(Mo(Ft,gf())).length>0),Uf={remote:Ts(jt),mdm:Ts(ut),file:Ts(at)},Hf={allowManagedPermissionRulesOnly:Ut.some((Ft)=>Ft.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:Yt?.forceLoginOrgUUID,...co(Yt??{},la),allowedMcpServers:us({slot:Yt,adminTiers:Ut})||Lt?.allowManagedMcpServersOnly===!0&&Yt?.allowManagedMcpServersOnly!==!1?ta({slot:Yt,adminTiers:Ut}):Yt?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:Ut.some((Ft)=>Ft.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:Ut.some((Ft)=>Ft.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},Aa=U0(an,Bt),Rs=Lt&&Aa?B0(Lt,Hf):null,zf=Rs&&Object.keys(Rs).length>0?Rs:null,Ff=j0(Lt,l.hostManagedProvider);return{tiers:Ut,tierSources:Jt,admin:Yt,parentSlice:zf,hostModelOverlay:Ff,errors:b,present:ln,mode:pn,merged:Wt,composed:Uf,snapshotFirst:sn,parentNeverShutOut:Bt,shadowedHelperSources:fn,parentIncluded:Aa,heldEmpty:Zt!==void 0}}function V0(l,b,D,te){let ce=l[0];if(!ce)return{admin:null,merged:!1};let{managedSourcesBehavior:Oe,...xe}=ce,$e=b==="merge"&&l.length>=2;if(!$e&&te===0)return{admin:Oe===void 0?ce:xe,merged:!1};let et=l.slice($e?1:l.length-te).map((tt,ct)=>{let at=$e&&D&&ct===0,gt=at?{...tt}:Mo(tt,gf());if(!at){for(let Dt of H0)if(cn(gt,Dt)!==void 0)An(gt,Dt,void 0)}let ht=cn(gt.sandbox,["enabledPlatforms"]);if(Array.isArray(ht)&&ht.includes(O()))An(gt,["sandbox","enabledPlatforms"],void 0);else if(ht!==void 0)delete gt.sandbox;return gt});if(!$e)return $p(xe,[ce,...et]),{admin:xe,merged:!1};let rt={};for(let tt of[...et].reverse())Xt(rt,tt,ca);return Xt(rt,xe,D?Z0:ca),$p(rt,[ce,...et]),K0(rt,[ce,...et],D),{admin:rt,merged:!0}}var ha=["policyHelper","policyHelpers"],Zn={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function bo(l){return Object.keys(l).some((b)=>!Yn.includes(b))}function lr(l){return Object.entries(l).some(([b,D])=>!Yn.includes(b)&&!Yo(D))}function ia(l){return l&&bo(l)?l:null}function Es(l){return l.settings!==null&&lr(l.settings)&&!l.onlySubstitutes}function aa(l,b){if(l===null)return-1;if(b)return 2;return lr(l)?1:0}function lf(l,b){return Object.entries(l).some(([D,te])=>te!==null&&!Yp(D,te)&&!Yn.includes(D))||b!==null&&bo(b)}function rr(l){return l.documentHasPolicyContent??(l.settings!==null&&bo(l.settings))}function sr(l){return l.loadState??(l.settings!==null?"loaded":"absent")}function En(l,b){if(l==="didNotLoad"||b==="didNotLoad")return"didNotLoad";return l==="loaded"||b==="loaded"?"loaded":"absent"}function Ao(l){return l.userWritable!==!0&&(rr(l)||l.loadState==="didNotLoad")}function K0(l,b,D){let te=b.findIndex((Oe)=>Oe.availableModels!==void 0),ce=b.findIndex((Oe)=>Oe.modelOverrides!==void 0);if(ce!==-1&&(te===-1||ce<=te||D&&te===0))l.modelOverrides={...b[ce].modelOverrides};else delete l.modelOverrides}var cf=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins"],Y0=["awsPairs","ripgrep"];function df(l,b,D){if(b===void 0)return l;if(Array.isArray(b))return D==="awsPairs"&&Array.isArray(l)?[...b,...sf(l,b)]:[...b];if(!r(b))return b;return oe(b,(te)=>Array.isArray(te)?[...te]:te)}var X0=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],la=["allowedMcpServers","availableModels","strictKnownMarketplaces"];function J0(l,b,D){if(l===null||!b)return l;let te=X0.filter((ce)=>D.some((Oe)=>Oe?.[ce]!==void 0));return te.length===0?l:Mo(l,te)}function ca(l,b,D){if(D!==void 0&&(cf.includes(D)||Y0.includes(D)))return df(l,b,D);return uf(l,b,D)}function Z0(l,b,D){if(D!==void 0&&cf.includes(D))return df(l,b,D);return uf(l,b,D)}function uf(l,b,D){if(Array.isArray(l)&&Array.isArray(b)&&D!=="fallbackModel")return w([...b,...l]);return hn(l,b,D)}function $p(l,b){let D=b[0],te=l;for(let ce of Dn()){let{path:Oe,restrictive:xe}=ce,$e=Un(xe),et=Math.min(...b.map((rt)=>$e.indexOf(_r(ce,rt))).filter((rt)=>rt!==-1));if(Number.isFinite(et))An(te,Oe,$e[et]);else if(cn(D,Oe)===void 0&&cn(l,Oe)!==void 0)An(te,Oe,void 0)}if(l.strictPluginOnlyCustomization!==!0){let ce=w(b.flatMap((Oe)=>Array.isArray(Oe.strictPluginOnlyCustomization)?Oe.strictPluginOnlyCustomization:[]));if(ce.length>0)l.strictPluginOnlyCustomization=ce;else if(D?.strictPluginOnlyCustomization===void 0)delete l.strictPluginOnlyCustomization}}function bs(l){let b=l.helper?.()??null;if(!b)return{composes:"none"};let D=l.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(l.helperMergesOutput?.()!==!0)return{composes:D,helper:b,mergedOver:null};if(!l.store.policy.mergedHelper){let{base:te,mergedOver:ce}=D==="remoteSlot"?{base:ma(l).settings,mergedOver:"remote"}:pf(l);l.store.policy.mergedHelper={helper:tG(te,b),mergedOver:Object.keys(ff(te)).length>0?ce:null}}return{composes:D,...l.store.policy.mergedHelper}}function pf(l){let b=fa(l);if(or({...l,helper:void 0}).present.mdm)return{base:b.settings,mergedOver:qn(),errors:b.errors};let D=l.file?.()??Kp(l);return{base:D.settings,mergedOver:"file",errors:[...b.errors,...D.errors]}}function ff(l){return Mo(l??{},ha)}function q0(l,b){let D=new Map;for(let[ce,Oe]of Object.entries(b)){let xe=ce.toUpperCase();if(!D.has(xe))D.set(xe,Oe)}let te={};for(let[ce,Oe]of Object.entries(l))te[ce]=D.get(ce.toUpperCase())??Oe;return Object.assign(te,b)}var Q0=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function eG(l,b,D){let te=D!==void 0&&b!==void 0&&Q0.includes(D)?b:ca(l,b,D);return te===b&&Array.isArray(te)?[...te]:te}function tG(l,b){let D=ff(l),te=Xt({},D,b,eG);if(D.env&&b.env)te.env=q0(D.env,b.env);return te}function nG(l,b,D){let te={slot:D,adminTiers:l};return l.flatMap((ce,Oe)=>{let xe=b[Oe],$e=Ap(ce,te);return xe!==void 0&&$e.length>0?[{source:xe,keys:$e}]:[]})}var mf=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var _s=[...mf,"otelHeadersHelper","proxyAuthHelper"];function nr(l,b,D){let te=_s.some(($e)=>b[$e]!==void 0);if(!te&&l!=="policySettings")return b;let ce=D.credentialHelperKeysFrom(l);if(ce==="as_read")return b;let Oe=l==="policySettings"&&ce==="machine_admin"?oG(D):{};if(!te&&Object.keys(Oe).length===0)return b;let xe={...b};for(let $e of _s)delete xe[$e];return Object.assign(xe,Oe)}function oG(l){let b=rG(l),D={};for(let te of _s){let ce=b?.[te];if(ce!==void 0)D[te]=ce}return D}function rG(l){let b=l.helperArmedFromRemote?.()===!1&&l.helperArmedFromUserWritableBase?.()===!1,D={...l,store:new _e,remote:()=>null,helper:b?l.helper:()=>null,...l.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}},te=bs(D);return te.composes==="tier"?te.helper:or(D).admin}var sG=[..._s,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","parentSettingsBehavior","env","modelPicker",...ha,...Yn];function gf(){return sG}function iG(l){return Rc.some((b)=>l.startsWith(b))||Tc.includes(l)}function aG(l,b,D,te=0){let ce=new Map,Oe=new Map,xe=!1;for(let[$e,et]of l.entries()){let rt=new Set,tt=b?.[$e]===!0;for(let[ct,at]of Object.entries(et??{})){let gt=ct.toUpperCase(),ht=iG(gt);if(ht&&at.trim()==="")continue;if(ht&&xe)continue;if(ht&&$e>te&&b?.[$e]===!0)continue;let Dt=ce.get(gt);if(Dt!==void 0){if(rt.has(gt))Oe.set(ct,at);else if(!Oe.has(ct))Oe.set(ct,Dt);continue}if($e>te&&D?.[$e]?.has(gt))continue;if(Oe.set(ct,at),rt.add(gt),ce.set(gt,at),ht)tt=!0}if(tt)xe=!0}return Object.fromEntries(Oe)}var lG="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function Vp(l){if(!l)return;let b={};for(let[D,te]of Object.entries(l))if(D.toUpperCase()!==lG)b[D]=te;return b}function cG(l,b){let D=Object.entries(l??{}),te=b??{};return D.length===Object.keys(te).length&&D.every(([ce,Oe])=>te[ce]===Oe)}function hf(l){let b=bs(l),D=(l.helperWarnings?.()??[]).filter((St)=>!Qn(St.path));if(b.composes==="tier"){let{helper:St}=b;l.store.lastPolicyEnvComposition=null;let Pt=l.hostManagedProvider?{...St}:St;if(l.hostManagedProvider)hs(Pt);l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&St.availableModels!==void 0?St.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?St.modelOverrides:void 0};let wt=l.store.policy.helperBaseStatusNotices??=[...l.helperMergesOutput?.()===!0?pf(l).errors.filter((It)=>!It.statusOnly):[],...or(l).errors.filter((It)=>It.statusOnly)];return{settings:Pt,errors:[...wt,...D]}}let{tiers:te,tierSources:ce,admin:Oe,parentSlice:xe,hostModelOverlay:$e,errors:et,present:rt,snapshotFirst:tt}=or(l);if(et.push(...D),!Oe&&!xe){l.store.lastPolicyEnvComposition=null,l.store.policy.pairedModelOverrides={value:void 0},l.store.policy.deniedModelsOverrides={value:void 0};let St=l.hkcu?.();if(St&&Object.keys(St.settings).length>0){let Pt=l.hostManagedProvider?{...St.settings}:St.settings;if(l.hostManagedProvider){if(hs(Pt),$e)Wp(Pt,$e)}return{settings:Pt,errors:[...et,...St.errors]}}if($e)return{settings:{...$e},errors:[...et,...St?.errors??[]]};return{settings:null,errors:[...et,...St?.errors??[]]}}let ct=Xt({},xe??{},Oe??{},hn);if(xe?.availableModelsMatch==="exact")ct.availableModelsMatch="exact";if(te.some((St)=>St.forceRemoteSettingsRefresh===!0))ct.forceRemoteSettingsRefresh=!0;let at=On.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0,gt=ct.env;if(!at){let St=aG(te.map((Pt)=>Pt.env),te.map((Pt)=>(Pt.otelHeadersHelper??"").trim()!==""),te.map((Pt)=>{let wt=new Set;for(let It of mf){let Nt=Pt[It];if(typeof Nt==="string"&&Nt.trim()!=="")for(let Gt of Dc[It])wt.add(Gt)}return wt.size>0?wt:void 0}),tt?1:0);if(Object.keys(St).length>0)ct.env=St;else delete ct.env}if(ct.env){let St=Vp(ct.env);if(St&&Object.keys(St).length>0)ct.env=St;else delete ct.env}if(l.hostManagedProvider){if(hs(ct),$e)Wp(ct,$e)}let ht={env:Vp(gt)};if(l.hostManagedProvider)hs(ht);let Dt=!at&&!cG(ct.env,ht.env);l.store.lastPolicyEnvComposition={unionOptedOut:at,unionChangedEnv:Dt,remoteTierPresent:rt.remote,mdmTierPresent:rt.mdm,fileTierPresent:rt.file,adminTierCount:te.length,tiersWithEnv:Me(te,(St)=>Object.keys(St.env??{}).length>0)},l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&Oe?.availableModels!==void 0&&Oe.modelOverrides!==void 0&&$e?.availableModels===void 0?Oe.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?Oe?.modelOverrides:void 0};for(let{source:St,keys:Pt}of nG(te,ce,ct)){let[wt]=Pt;if(wt===void 0)continue;let It=Zn[St],Nt=Pt.length===1;et.push({file:It,path:wt,message:`${Pt.map((Gt)=>`"${Gt}"`).join(" and ")} in ${It} ${Nt?"is":"are"} not applied: ${It} is not the managed settings source that applies for ${Nt?"this key":"these keys"} (/status lists the setting sources). Remove ${Nt?"it":"them"} from ${It}, or set ${Nt?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:ct,errors:et}}function dG(l,b,{includeLegacyLocalSettings:D=!0}={}){if(l==="policySettings")return hf(b).settings;let te=ar(l,b),{settings:ce}=te?Oo(te,b.store,l==="flagSettings"?b.flagExpectedContent:void 0):{settings:null};if(l==="flagSettings"){let{settings:Oe}=qp(b);if(Oe)return Xt(ce||{},Oe,hn)}if(l==="localSettings"&&D){let Oe=nf(b);if(Oe){let{settings:xe}=Oo(Oe,b.store);if(xe)return b.onLegacyLocalSettingsRead?.("per_source"),Xt(xe,ce||{},hn)}}return ce}function uG(l,b){return{...l,...b}}function hn(l,b,D){if(D==="modelPicker"&&b!==void 0)return Ef(b);if(Array.isArray(l)&&Array.isArray(b)){if(D==="fallbackModel")return b;return w([...l,...b])}if((D==="extraKnownMarketplaces"||D==="managedMcpServers")&&r(l)&&r(b))return uG(l,b);return}function Ef(l){if(!r(l))return l;let b=l.options;return{...l,...Array.isArray(b)&&{options:b.map((D)=>r(D)?{...D}:D)}}}function pG(l){if(l.store.isLoadingFromDisk)return{settings:{},errors:[]};let b=Date.now();Po("info","settings_load_started"),l.store.isLoadingFromDisk=!0;try{let D=l.store.pluginBase,te={};if(D)te=Xt(te,D,hn);let ce=[],Oe=new Set,xe=new Set,$e=(tt)=>{for(let ct of tt){let at=`${ct.file}:${ct.path}:${ct.message}`;if(!Oe.has(at))Oe.add(at),ce.push(ct)}},et=null;for(let tt of ua(l)){if(tt==="policySettings"){let{settings:at,errors:gt}=hf(l);if(et=at,$e(W0(at)),$e($0(at)),at)te=Xt(te,nr(tt,at,l),hn);$e(gt);continue}if(tt==="localSettings"){let at=nf(l);if(at&&!xe.has($t(at))){xe.add($t(at));let{settings:gt,errors:ht}=Oo(at,l.store);if($e(ht),gt)l.onLegacyLocalSettingsRead?.("cascade"),te=Xt(te,nr(tt,gt,l),hn)}}let ct=ar(tt,l);if(ct){let at=$t(ct),gt=tt==="flagSettings"&&l.flagExpectedContent!==void 0;if(!xe.has(at)||gt){xe.add(at);let{settings:ht,errors:Dt}=Oo(ct,l.store,tt==="flagSettings"?l.flagExpectedContent:void 0);if($e(Dt),ht)te=Xt(te,nr(tt,ht,l),hn)}}if(tt==="flagSettings"){let{settings:at,errors:gt}=qp(l);if($e(gt),at)te=Xt(te,nr(tt,at,l),hn)}}if(et){if(et.availableModels!==void 0)te.availableModels=[...et.availableModels];if(et.enforceAvailableModels!==void 0)te.enforceAvailableModels=et.enforceAvailableModels;if(et.modelPicker!==void 0)te.modelPicker=Ef(et.modelPicker)}let rt=et?.deniedModels;if(rt!==void 0)te.deniedModels=[...rt];else delete te.deniedModels;return Po("info","settings_load_completed",{duration_ms:Date.now()-b,source_count:xe.size,error_count:ce.length}),{settings:te,errors:ce}}finally{l.store.isLoadingFromDisk=!1}}function fG(l){let b=l.store.mergedSettings;if(b!==null)return b;let D=pG(l);return l.store.mergedSettings=D,D}function mG(l){let{settings:b}=fG(l);return b||{}}function _f(l){l.store.invalidateAll();let b=[];for(let D of ua(l)){let te=of(D,l);if(te&&Object.keys(te).length>0)b.push({source:D,settings:te})}return{effective:mG(l),sources:b}}function Sf(l,b){let D=ua(b);for(let te=D.length-1;te>=0;te--){let ce=D[te];if(of(ce,b)?.[l]!==void 0)return ce}return null}import{execFile as gG}from"child_process";import{accessSync as hG,closeSync as EG,constants as _G,openSync as SG,readSync as yG}from"fs";class bf{promise=null;start(){if(this.promise)return;this.promise=_a()}reset(){this.promise=null}}var OG=new bf;function AG(l){if(!l)return{status:"ok",exitCode:0,errno:null,signal:null};let b=l,D=typeof b.signal==="string"&&b.signal?b.signal:null;if(typeof b.code==="string")return{status:"spawn_error",exitCode:null,errno:b.code,signal:null};if(b.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:D};if(D)return{status:"killed",exitCode:null,errno:null,signal:D};return{status:"exited",exitCode:typeof b.code==="number"?b.code:null,errno:null,signal:null}}function Ea(l,b,D){let te=Date.now();return new Promise((ce)=>{try{gG(l,b,{encoding:"utf-8",timeout:Rp,windowsHide:!0,...D!==void 0&&{maxBuffer:D}},(Oe,xe)=>{ce({stdout:xe??"",...AG(Oe),durationMs:Date.now()-te})})}catch(Oe){let xe=Oe.code;ce({stdout:"",status:"spawn_error",exitCode:null,errno:typeof xe==="string"?xe:null,signal:null,durationMs:Date.now()-te})}})}function yf(l){return{status:l.status,exitCode:l.exitCode,errno:l.errno,signal:l.signal,durationMs:l.durationMs}}function Of(l){return l.status==="ok"||l.status==="exited"&&l.exitCode!==null}function bG(l){return l.status==="spawn_error"&&l.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function CG(l){let b;try{return b=SG(l,"r"),yG(b,Buffer.alloc(1),0,1,0),null}catch(D){return{code:D&&typeof D==="object"&&"code"in D?D.code:void 0,message:D instanceof Error?D.message:String(D)}}finally{if(b!==void 0)try{EG(b)}catch{}}}function _a(){return(async()=>{if(process.platform==="darwin"){let l=Lp(),D=(await Promise.all(l.map(async({path:ce,...Oe})=>{try{hG(ce,_G.R_OK)}catch(rt){let tt=rt&&typeof rt==="object"&&"code"in rt?rt.code:void 0;if(tt==="ENOENT"||tt==="ENOTDIR")return null;return{stdout:null,unreadReason:rt instanceof Error?rt.message:String(rt),...Oe}}let xe=await Ea(na,[...Cp,ce],ms);if(!Of(xe))return{stdout:null,unreadReason:"plutil did not finish converting it",...Oe};if(xe.status==="ok")return{stdout:xe.stdout,...Oe};let $e=await Ea(na,[...Tp,ce]);if(!Of($e))return{stdout:null,unreadReason:"plutil did not finish checking it",...Oe};if($e.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",...Oe};let et=CG(ce);if(et!==null){if(et.code==="ENOENT"||et.code==="ENOTDIR")return null;return{stdout:null,unreadReason:et.message,...Oe}}return{stdout:"",...Oe}}))).filter((ce)=>ce!==null),te=D.findIndex((ce)=>ce.stdout!==null);return{plistStdouts:te===-1?D:D.slice(0,te+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let b=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`;return Af(b)}if(qo())return Af(Dp);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function Af(l){let b=(ce)=>Ea(l,["query",ce,"/v",Zo],ms),[D,te]=await Promise.all([b(ps),b(fs)]);return{plistStdouts:null,hklmStdout:D.status==="ok"?D.stdout:null,...bG(D)&&{hklmUnreadReason:`the value exceeds ${ms/1048576} MiB`},hkcuStdout:te.status==="ok"?te.stdout:null,outcomes:{hklm:yf(D),hkcu:yf(te)}}}function Cf(){return OG.promise}var TG=Object.freeze({settings:{},errors:[],loadState:"absent"}),Co=Object.freeze({settings:{},errors:[]});class Pf{mdm=null;hkcu=null;wslInherits=!1;loadPromise=null;startLoad(l){if(this.loadPromise)return;this.loadPromise=(async()=>{let b=Date.now(),te=await(Cf()??_a()),{mdm:ce,hkcu:Oe,wslInherits:xe}=await MG(te,l);this.replace(ce,Oe,xe);let $e=Date.now()-b;e(`MDM settings load completed in ${$e}ms`);try{V("tengu_managed_settings_os_read",kG(te,$e))}catch{}if(Object.keys(ce.settings).length>0){e(`MDM settings found: ${Object.keys(ce.settings).join(", ")}`);try{Po("info","mdm_settings_loaded",{duration_ms:$e,key_count:Object.keys(ce.settings).length,error_count:ce.errors.length})}catch{}}})()}replace(l,b,D){this.mdm=l,this.hkcu=b,this.wslInherits=D}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.loadPromise=null}}var Tf="@builtin",RG=["prependPlugins","appendPlugins"];function DG(l){return typeof l==="object"&&l!==null&&!Array.isArray(l)}var LG=new i(()=>new Pf);function cr(){return LG.of(C().host)}function IG(l){cr().startLoad(l)}async function xf(){let l=cr();if(!l.loadPromise)IG();await l.loadPromise}function wf(){return cr().mdm??TG}function Nf(){return cr().hkcu??Co}function vf(){return cr().wslInherits}function Sa(l,b,{userWritable:D=!1}={}){let te=kn(l,!1);if(!r(te))return{settings:{},errors:[As(b,{userWritable:D})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let ce=[],Oe=te;for(let at of D?ys:[]){if(!(at in Oe))continue;if(Oe=Oe===te?{...te}:Oe,delete Oe[at],!Qn(at))ce.push({file:b,path:at,message:`"${at}" is only honored from administrator-controlled managed settings and was ignored in ${b}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(D){for(let gt of RG){if(!(gt in Oe))continue;Oe=Oe===te?{...te}:Oe,delete Oe[gt],ce.push({file:b,path:gt,message:`"${gt}" is only honored from administrator-controlled managed settings and was ignored in ${b}, which the user account can write.`,severity:"warning",statusOnly:!0})}let at=Oe.enabledPlugins;if(DG(at)){if(Object.entries(at).filter(([ht,Dt])=>ht.endsWith(Tf)||Dt!==!1).length>0){Oe=Oe===te?{...te}:Oe;let ht=fr(at,(Dt,St)=>!St.endsWith(Tf)&&Dt===!1);if(Object.keys(ht).length>0)Oe.enabledPlugins=ht;else delete Oe.enabledPlugins;ce.push({file:b,path:"enabledPlugins",message:`"enabledPlugins" entries that enable a plugin, or name a built-in, are only honored from administrator-controlled managed settings and were ignored in ${b}, which the user account can write.`,severity:"warning",statusOnly:!0})}}}let{settings:xe,errors:$e,documentHasPolicyContent:et,loadState:rt,onlySubstitutes:tt}=Ss(Oe,b),ct=[...ce,...$e];return{settings:xe??{},errors:D?ct.map((at)=>({...at.severity==="warning"&&!at.startupFatal?at:{...PG(at),severity:"warning",statusOnly:!0},userWritable:!0})):ct,documentHasPolicyContent:et,loadState:rt,...tt&&{onlySubstitutes:tt}}}function PG({startupFatal:l,...b}){return b}function Rf(l,b,D){return{file:l,path:"",message:`Managed settings document (${l}) could not be read: ${b}; none of its settings are in effect.`,severity:D?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...D&&{userWritable:!0}}}function Df(l,b="Settings"){let D=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),te=new RegExp(`^[ \\t]+${D}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),ce=l.match(te)?.[1]?.trimEnd();return ce?ce:null}var xG=new Map([["ENOENT",y("ENOENT")],["EACCES",y("EACCES")],["EPERM",y("EPERM")],["ENOEXEC",y("ENOEXEC")],["EAGAIN",y("EAGAIN")],["EMFILE",y("EMFILE")],["ENOMEM",y("ENOMEM")],["ETIMEDOUT",y("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",y("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),wG=new Map([["SIGTERM",y("SIGTERM")],["SIGKILL",y("SIGKILL")],["SIGINT",y("SIGINT")]]);function NG(l){if(!l)return;return xG.get(l)??y("other")}function vG(l){if(!l)return;return wG.get(l)??y("other")}function Lf(l,b){if(!b)return{};return{[`${l}_status`]:G(b.status),[`${l}_exit_code`]:b.exitCode??void 0,[`${l}_errno`]:NG(b.errno),[`${l}_signal`]:vG(b.signal),[`${l}_duration_ms`]:b.durationMs}}function kG(l,b){return{is_wsl:qo(),await_ms:b,...Lf("hklm",l.outcomes.hklm),...Lf("hkcu",l.outcomes.hkcu)}}async function MG(l,b){let D=[],te=!1,ce="absent";for(let ht of l.plistStdouts??[]){let{label:Dt,userWritable:St}=ht;if(St&&te)continue;let Pt=ht.stdout===null?{settings:{},errors:[Rf(Dt,ht.unreadReason,St)],documentHasPolicyContent:!1,loadState:"didNotLoad",...St&&{userWritable:St}}:{...Sa(ht.stdout,Dt,{userWritable:St}),...St&&{userWritable:St}};if(St?bo(Pt.settings):Pt.documentHasPolicyContent)return{mdm:{...Pt,errors:[...D,...Pt.errors],documentHasPolicyContent:!0},hkcu:Co,wslInherits:!1};if(te||=Ao(Pt),D.push(...Pt.errors),!St)ce=En(ce,Pt.loadState)}let Oe=`Registry: ${ps}\\${Zo}`,xe=null,$e="disarmed";if(l.hklmStdout!==null){let ht=Df(l.hklmStdout)??"";xe=Sa(ht,Oe);let Dt=kn(ht,!1);if(r(Dt))$e=Wi(Dt)}else if(l.hklmUnreadReason!==void 0)xe={settings:{},errors:[Rf(Oe,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"};let et=xe!==null&&Ao(xe);if(xe)D.push(...xe.errors),ce=En(ce,xe.loadState);let rt=qo(),tt="disarmed",ct=Oe;if(rt){if(tt=$e,tt!=="armed"){let ht=await HG(b);if(ht.flag==="armed"||tt==="disarmed")tt=ht.flag,ct=ht.unreadableFlagPath??Cn;if(tt==="disarmed")D.push(...ht.records),ce=En(ce,ht.loadState)}}let at=tt!=="disarmed",gt={settings:{},errors:D,loadState:ce};if(rt&&!at){let ht=new Set(xe?.errors.filter((Dt)=>Dt.severity==="warning"));return{mdm:{...gt,errors:gt.errors.map((Dt)=>ht.has(Dt)?{...Dt,wslIgnored:!0}:Dt)},hkcu:Co,wslInherits:!1}}if(xe&&et)return{mdm:xe,hkcu:Co,wslInherits:at};if(tt==="unreadable"){let ht=await Oa(Cn,b);return{mdm:{...gt,errors:ht?gt.errors:[...gt.errors,Qp(ct)],documentHasPolicyContent:!0,loadState:En(gt.loadState,"loaded")},hkcu:Co,wslInherits:at}}if(l.hkcuStdout!==null&&!await UG(at,b)){let ht=Sa(Df(l.hkcuStdout)??"",`Registry: ${fs}\\${Zo}`,{userWritable:!0});if(!rt||ht.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:Dt,managedSourcesBehavior:St,...Pt}=ht.settings;return{mdm:gt,hkcu:{settings:Pt,errors:ht.errors},wslInherits:at}}if(ht.errors.length>0)return{mdm:gt,hkcu:{settings:{},errors:ht.errors},wslInherits:at}}return{mdm:gt,hkcu:Co,wslInherits:at}}async function kf(l,b){if(a()&&b!==void 0)return(await qa(l,Os)).content;return vn(l,Os)}async function UG(l,b){if(l&&await Oa(Cn,b))return!0;return Oa(Mn(),b)}async function If(l,b){let D;try{D=await kf(l,b)}catch(te){return!_(te)}try{let te=ga(D,l,!0);return Ao({...te,loadState:sr(te)})}catch{return!0}}function ya(l){let b=n(l);return b==="ENOENT"||b==="ENOTDIR"}async function HG(l){let b=[],D="absent";async function te(rt){let tt;try{tt=await kf(rt,l)}catch(at){if(!ya(at))b.push(ir(rt,at)),D="didNotLoad";return"disarmed"}if(tt.trim()==="")return D=En(D,"loaded"),"disarmed";let ct=kn(tt,!1);if(!r(ct))return b.push(As(rt)),D="didNotLoad","disarmed";return D=En(D,"loaded"),Wi(ct)}let ce=To(Cn,"managed-settings.json"),Oe=await te(ce);if(Oe==="armed")return{flag:Oe,records:b,loadState:D};let xe=Oe==="unreadable"?ce:void 0,$e=To(Cn,"managed-settings.d"),et;try{et=await s().readdir($e)}catch(rt){if(!ya(rt))b.push(ir($e,rt,"directory")),D="didNotLoad";return{flag:Oe,unreadableFlagPath:xe,records:b,loadState:D}}for(let rt of et){if(!(rt.isFile()||rt.isSymbolicLink())||!rt.name.endsWith(".json")||rt.name.startsWith("."))continue;let tt=To($e,rt.name),ct=await te(tt);if(ct==="armed")return{flag:ct,records:b,loadState:D};if(ct==="unreadable")Oe=ct,xe??=tt}return{flag:Oe,unreadableFlagPath:xe,records:b,loadState:D}}async function Oa(l,b){if(await If(To(l,"managed-settings.json"),b))return!0;let D=To(l,"managed-settings.d"),te;try{te=await s().readdir(D)}catch(ce){return!ya(ce)}for(let ce of te)if((ce.isFile()||ce.isSymbolicLink())&&pa(ce.name)&&await If(To(D,ce.name),b))return!0;return!1}var FG={user:"userSettings",project:"projectSettings",local:"localSettings"},Mf={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},BG=["user","project","local"];async function a6(l={}){await xf();let b={store:new _e,cwd:zG(l.cwd??s().cwd()),allowedSources:(l.settingSources??BG).map(($e)=>FG[$e]),parentManaged:l.managedSettings??null,flagInline:null,flagPath:void 0,mdm:wf,hkcu:Nf,wslInherits:vf,credentialHelperKeysFrom:()=>"as_read",...l.serverManagedSettings!==void 0&&{remote:()=>l.serverManagedSettings}},{effective:D,sources:te}=_f(b),ce=af(b)??void 0,Oe=te.map(({source:$e,settings:et})=>({source:Mf[$e],settings:et,path:$e==="policySettings"?void 0:ar($e,b),...$e==="policySettings"&&{policyOrigin:ce}})),xe={};for(let $e of Object.keys(D)){let et=Sf($e,b);if(et)xe[$e]={source:Mf[et],path:et==="policySettings"?void 0:ar(et,b),...et==="policySettings"&&{policyOrigin:ce}}}return{effective:D,provenance:xe,sources:Oe}}export{a6 as resolveSettingsForSdk};
|