@anthropic-ai/claude-agent-sdk 0.3.325 → 0.3.327

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.
@@ -0,0 +1,42 @@
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.327
4
+
5
+ //! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
6
+ if (typeof Symbol.dispose !== 'symbol') {
7
+ try {
8
+ Symbol.dispose = Symbol.for('Symbol.dispose')
9
+ } catch {}
10
+ }
11
+ if (typeof Symbol.asyncDispose !== 'symbol') {
12
+ try {
13
+ Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
14
+ } catch {}
15
+ }
16
+ import{K,Qn,y,b,d,Q,p,Ie,f,u,s,C,mn,hn,lt,ge,a,k,ee,_n,h,r,_,me,F,he,E,We,te,ne,bn,V,Y,H,Me,re,dt,ze,$e,_e,Bt,A,q,Cn,An,Rn,On,g,Kt,Gt,Tn,X,Ve,oe,jt,Se,Oe,wn,Ye,ut,Dn,pt,v,zt,qe,se,$t,Ne,gt,G,R,Ee,vn,_t,Xe,O,o,S,M,St,Vt,j,Ue,Yt,Fe,Et,ye,Je,l,yt,qt,Ln,Mn,W,Ze,He,ie,Be,Qe,Nn,t,P,we,ae,n,be,Qt,Hn,N,ce,an,Vn,Yn,ln}from"./core-9a7zb9bm.mjs";import{ue,at,ve,m,pe}from"./core-eqz9ara6.mjs";import{fn}from"./core-esw7xtkz.mjs";import{je,e}from"./core-25bstexa.mjs";import{Xn,Jn,Ae,kt,dn,De,J,Zn,L,ot,Dt,xt}from"./core-kag24kjr.mjs";import"./core-ae73vzp2.mjs";import"./core-nfa6p2rw.mjs";var Qi={};K(Qi,{default:()=>eo});var ta={};K(ta,{default:()=>ho});var yc={};K(yc,{AGENT_PROXY_AUTH_TOKEN:()=>FD,ANTHROPIC_API_KEY:()=>TD,ANTHROPIC_AUTH_TOKEN:()=>DD,ANTHROPIC_AWS_API_KEY:()=>wD,ANTHROPIC_FEDERATION_RULE_ID:()=>wL,ANTHROPIC_FOUNDRY_API_KEY:()=>PD,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>xD,ANTHROPIC_ORGANIZATION_ID:()=>xL,ANTHROPIC_PROFILE:()=>vL,ANTHROPIC_WORKSPACE_ID:()=>NL,AWS_BEARER_TOKEN_BEDROCK:()=>ID,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>MD,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>kD,AWS_ROLE_ARN:()=>vD,AWS_WEB_IDENTITY_TOKEN_FILE:()=>ND,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>ML,CLAUDE_CODE_ACCOUNT_UUID:()=>kL,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>WD,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>SL,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>EL,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>IL,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>QD,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>ZD,CLAUDE_CODE_DISABLE_LAUNCHER_SIGN_IN:()=>oL,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>yL,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>PL,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>jD,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>HD,CLAUDE_CODE_HOST_AUTH_ASK_AT_START:()=>iL,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>lL,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>aL,CLAUDE_CODE_HOST_CREDS_FILE:()=>cL,CLAUDE_CODE_LAUNCHER_RUNS_API_KEY_HELPER:()=>rL,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>hL,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>JD,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>XD,CLAUDE_CODE_OAUTH_SCOPES:()=>qD,CLAUDE_CODE_OAUTH_TOKEN:()=>LD,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>KD,CLAUDE_CODE_ORGANIZATION_UUID:()=>UL,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>OL,CLAUDE_CODE_RATE_LIMIT_TIER:()=>BL,CLAUDE_CODE_RUNNER_MODEL_SOCKET:()=>YD,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>sL,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>eL,CLAUDE_CODE_SDK_HAS_SESSIONS_OAUTH_REFRESH:()=>tL,CLAUDE_CODE_SESSIONS_OAUTH_TOKEN:()=>nL,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>dL,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>RL,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>TL,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>LL,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>AL,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>bL,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>DL,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>CL,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>FL,CLAUDE_CODE_USER_EMAIL:()=>HL,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>$D,CLAUDE_LOCAL_OAUTH_API_BASE:()=>mL,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>gL,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>_L,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>VD,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>uL,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>UD,ENVIRONMENT_SERVICE_KEY:()=>BD,MCP_CLIENT_SECRET:()=>zD,MCP_XAA_IDP_CLIENT_SECRET:()=>GD,USE_LOCAL_OAUTH:()=>pL,USE_STAGING_OAUTH:()=>fL});var Oc={};K(Oc,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>nw,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>XI,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>JI,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>ZI,ANT_OTEL_LOGS_EXPORTER:()=>qI,ANT_OTEL_METRICS_EXPORTER:()=>QI,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>tw,ANT_OTEL_TRACES_EXPORTER:()=>ew,BETA_TRACING_ENDPOINT:()=>ow,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>rI,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>pI,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>dI,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>uI,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>KL,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>WL,CLAUDE_CODE_DEBUG_REPAINTS:()=>jL,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>$L,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>iI,CLAUDE_CODE_FRAME_TIMING_LOG:()=>qL,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>QL,CLAUDE_CODE_NORMALIZE_PREFIX_CACHE_VERIFY:()=>sI,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>GI,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>fI,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>aI,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>cI,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>lI,CLAUDE_CODE_PERFETTO_TRACE:()=>JL,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>ZL,CLAUDE_CODE_PROFILE_STARTUP:()=>XL,CLAUDE_CODE_SESSION_LOG:()=>eI,CLAUDE_CODE_TEE_SDK_STDOUT:()=>oI,CLAUDE_CODE_TERMINAL_RECORDING:()=>nI,CLAUDE_DEBUG:()=>zL,CLAUDE_PTY_RECORD:()=>tI,DEBUG:()=>GL,DEBUG_CLAUDE_AGENT_SDK:()=>VL,DEBUG_SDK:()=>YL,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>FI,OTEL_EXPORTER_OTLP_ENDPOINT:()=>hI,OTEL_EXPORTER_OTLP_HEADERS:()=>EI,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>bI,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>RI,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>TI,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:()=>OI,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>DI,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>LI,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>II,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>wI,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:()=>AI,OTEL_EXPORTER_OTLP_PROTOCOL:()=>SI,OTEL_EXPORTER_OTLP_TIMEOUT:()=>yI,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>PI,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>xI,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>NI,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:()=>CI,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>BI,OTEL_LOGS_EXPORTER:()=>gI,OTEL_LOGS_EXPORT_INTERVAL:()=>kI,OTEL_LOG_ASSISTANT_RESPONSES:()=>KI,OTEL_LOG_MANAGED_SETTINGS:()=>VI,OTEL_LOG_RAW_API_BODIES:()=>YI,OTEL_LOG_TOOL_CONTENT:()=>jI,OTEL_LOG_TOOL_DETAILS:()=>$I,OTEL_LOG_USER_PROMPTS:()=>WI,OTEL_METRICS_EXPORTER:()=>mI,OTEL_METRIC_EXPORT_INTERVAL:()=>vI,OTEL_RESOURCE_ATTRIBUTES:()=>UI,OTEL_RESOURCE_INCLUDE_HOST:()=>HI,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>zI,OTEL_TRACES_EXPORTER:()=>_I,OTEL_TRACES_EXPORT_INTERVAL:()=>MI});var Cc={};K(Cc,{CLAUDE_AX_ANNOUNCEMENT_HOLD_MS:()=>vw,CLAUDE_AX_PREPARK_MS:()=>Nw,CLAUDE_AX_REWRITE_HELD_ANNOUNCEMENT:()=>kw,CLAUDE_AX_SCREEN_READER:()=>Pw,CLAUDE_AX_STARTUP_QUIET_MS:()=>xw,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>Mw,CLAUDE_CODE_ACCESSIBILITY:()=>JN,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>ZN,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>Hw,CLAUDE_CODE_AMBER_ASTROLABE:()=>hN,CLAUDE_CODE_ARTIFACT_ASK_FIRST:()=>Bv,CLAUDE_CODE_ARTIFACT_ASSETS:()=>Lv,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>lv,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>cv,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>uv,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>pv,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>dv,CLAUDE_CODE_ARTIFACT_DB:()=>fv,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>mv,CLAUDE_CODE_ARTIFACT_DELETE:()=>_v,CLAUDE_CODE_ARTIFACT_FRESH_READ:()=>Uv,CLAUDE_CODE_ARTIFACT_HOT:()=>wv,CLAUDE_CODE_ARTIFACT_LIVE_WATCH:()=>Dv,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>Iv,CLAUDE_CODE_ARTIFACT_OPENING_PREFETCH:()=>Hv,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>Sv,CLAUDE_CODE_ARTIFACT_PATH_PIN:()=>Pv,CLAUDE_CODE_ARTIFACT_PIN:()=>yv,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>Tv,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>hv,CLAUDE_CODE_ARTIFACT_PREVIEW_EMULATOR:()=>Ev,CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS:()=>xv,CLAUDE_CODE_ARTIFACT_QUICKSTART:()=>Mv,CLAUDE_CODE_ARTIFACT_REPL:()=>gv,CLAUDE_CODE_ARTIFACT_ROOM:()=>Rv,CLAUDE_CODE_ARTIFACT_SHARE:()=>Ov,CLAUDE_CODE_ARTIFACT_SHARE_PROBE_REUSE_MS:()=>Av,CLAUDE_CODE_ARTIFACT_START_KIT:()=>Fv,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>Nv,CLAUDE_CODE_ARTIFACT_TYPES:()=>vv,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>kv,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>zv,CLAUDE_CODE_ARTIFACT_VERIFY:()=>Gv,CLAUDE_CODE_ARTIFACT_VERSIONS:()=>bv,CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA:()=>uk,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>qN,CLAUDE_CODE_AUTOUPDATER_DISABLED_BY_HOST:()=>vU,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>Wv,CLAUDE_CODE_AUTO_MODE_FULL_CONTEXT:()=>Kv,CLAUDE_CODE_AUTO_MODE_SERVER:()=>jv,CLAUDE_CODE_BASALT_COVE:()=>Vw,CLAUDE_CODE_BASH_EDIT_DIFF:()=>Kw,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>sv,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>$v,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>cP,CLAUDE_CODE_BISON_CAIRN:()=>EN,CLAUDE_CODE_BREEZY_HORIZON:()=>Yw,CLAUDE_CODE_BUBBLEWRAP:()=>Vv,CLAUDE_CODE_CALM_MOCHI:()=>WN,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>Yv,CLAUDE_CODE_CCR_EARLY_PLUGINS_SYNC:()=>ok,CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECT:()=>Xv,CLAUDE_CODE_CCR_EARLY_SKILLS_SYNC:()=>rk,CLAUDE_CODE_CCR_EARLY_SYNC_AFTER_SETTINGS_REFUSAL:()=>sk,CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCAN:()=>ik,CLAUDE_CODE_CCR_LONG_POLL:()=>qv,CLAUDE_CODE_CCR_ONE_PLUGIN_LOAD_PER_RELOAD:()=>ak,CLAUDE_CODE_CCR_OWN_CONNECTION_POOL:()=>Zv,CLAUDE_CODE_CCR_SKIP_FRESH_MIGRATIONS:()=>dk,CLAUDE_CODE_CCR_SKIP_NEEDLESS_STARTUP_READS:()=>lk,CLAUDE_CODE_CCR_WORKER_SOCKET:()=>Jv,CLAUDE_CODE_CHILD_SESSION:()=>fk,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>_k,CLAUDE_CODE_COLD_COMPACT:()=>hk,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>dP,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>fP,CLAUDE_CODE_COWORK_PLUGIN_SKILL:()=>Ek,CLAUDE_CODE_COZY_TEAPOT:()=>jw,CLAUDE_CODE_CRYPTIC_HORIZON:()=>iP,CLAUDE_CODE_CURRIED_TRINKET:()=>$w,CLAUDE_CODE_DAPPER_CUPCAKE:()=>aP,CLAUDE_CODE_DEEP_TWILIGHT:()=>rP,CLAUDE_CODE_DESKTOP_CONNECTOR_NAMES:()=>_P,CLAUDE_CODE_DESKTOP_MESSAGE_CARD:()=>SP,CLAUDE_CODE_DESKTOP_MODE_FROM_RECORD:()=>EP,CLAUDE_CODE_DESKTOP_PLUGIN_INSTALL_FRAMES:()=>OP,CLAUDE_CODE_DESKTOP_RESULT_FIRST:()=>yP,CLAUDE_CODE_DESKTOP_SKILL_SWITCHES:()=>gP,CLAUDE_CODE_DESKTOP_WORKFLOW_LIMIT_WAIT:()=>hP,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>DP,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>RP,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>LP,CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES:()=>IP,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>wP,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>PP,CLAUDE_CODE_DISABLE_ARTIFACT:()=>xP,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>NP,CLAUDE_CODE_DISABLE_ATTRIBUTION_CROSS_REPO:()=>vP,CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK:()=>kP,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>MP,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>UP,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>HP,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>WP,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>KP,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>jP,CLAUDE_CODE_DISABLE_BG_STABLE_PATH:()=>$P,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>VP,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>YP,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>XP,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>JP,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>ZP,CLAUDE_CODE_DISABLE_CRON:()=>qP,CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT:()=>QP,CLAUDE_CODE_DISABLE_EARLY_KEY_GUARD:()=>Sx,CLAUDE_CODE_DISABLE_EMPTY_CLASSIC_DISPATCH_SKIP:()=>nx,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>ex,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>ox,CLAUDE_CODE_DISABLE_EXPORTED_VARIABLE_PROMPT:()=>jx,CLAUDE_CODE_DISABLE_FEATURE_FLAGS:()=>rx,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>sx,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>ax,CLAUDE_CODE_DISABLE_FILE_MENTIONS:()=>lx,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>cx,CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT:()=>zx,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>dx,CLAUDE_CODE_DISABLE_LAYOUT_CHECK:()=>BP,CLAUDE_CODE_DISABLE_LONE_SEC_DEFAULT_SHORTCUT:()=>ux,CLAUDE_CODE_DISABLE_MCP_INDEX_ROOM_COUNT:()=>GP,CLAUDE_CODE_DISABLE_MCP_TASKS:()=>zP,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>FP,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>px,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>fx,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>mx,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>gx,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>_x,CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT:()=>Kx,CLAUDE_CODE_DISABLE_MOUSE:()=>yx,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>Ox,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>Ax,CLAUDE_CODE_DISABLE_NESTED_SESSION_ID:()=>mk,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>Cx,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>bx,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>Rx,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>Tx,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>Dx,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>Lx,CLAUDE_CODE_DISABLE_OTEL_EVENT_SKIP:()=>Ix,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>hx,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>wx,CLAUDE_CODE_DISABLE_POWERSHELL_ALIAS_SHADOW_CHECK:()=>Bx,CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY:()=>Px,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>xx,CLAUDE_CODE_DISABLE_PROACTIVITY:()=>Nx,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>vx,CLAUDE_CODE_DISABLE_REFUSAL_RETRY:()=>kx,CLAUDE_CODE_DISABLE_RESPONSE_COMPARISON:()=>ix,CLAUDE_CODE_DISABLE_RESUME_LOAD_GOODBYE_SKIP:()=>Mx,CLAUDE_CODE_DISABLE_SHELL_HEAD_START:()=>Gx,CLAUDE_CODE_DISABLE_STARTUP_WORK_GATE:()=>Yx,CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS:()=>tx,CLAUDE_CODE_DISABLE_SUBAGENT_HANDBACK:()=>yk,CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT:()=>Fx,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>Xx,CLAUDE_CODE_DISABLE_THINKING:()=>Zx,CLAUDE_CODE_DISABLE_TRANSCRIPT_READ_AHEAD:()=>qx,CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK:()=>Vx,CLAUDE_CODE_DISABLE_ULTRATHINK:()=>Qx,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>eN,CLAUDE_CODE_DISABLE_WEB_FETCH:()=>tN,CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER:()=>vM,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>nN,CLAUDE_CODE_EDITOR_CODELIVERY:()=>uP,CLAUDE_CODE_ELEGANT_MEADOW:()=>lP,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>rN,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>sN,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>iN,CLAUDE_CODE_ENABLE_CFC:()=>aN,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>lN,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>cN,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>dN,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>uN,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>pN,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>fN,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>bN,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>RN,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>TN,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>DN,CLAUDE_CODE_ENABLE_SHARE_BUNDLE:()=>LN,CLAUDE_CODE_ENABLE_TASKS:()=>IN,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>wN,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>PN,CLAUDE_CODE_ENABLE_WRAP_UP:()=>xN,CLAUDE_CODE_ENABLE_XAA:()=>NN,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>yM,CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS:()=>$x,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>Ok,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>Ak,CLAUDE_CODE_FEATURE_FLAGS_KICK_FROM_INIT:()=>Qv,CLAUDE_CODE_FEATURE_FLAGS_KICK_ON_WARM_CACHE:()=>ek,CLAUDE_CODE_FIRST_CALL_THINKING_TITLES:()=>av,CLAUDE_CODE_FIZZY_GROVE:()=>Zw,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>mN,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>wk,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>Dk,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>Lk,CLAUDE_CODE_FORCE_TERMINAL_IMAGES:()=>Ik,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>xk,CLAUDE_CODE_FORK_SUBAGENT:()=>Ck,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>Nk,CLAUDE_CODE_FORWARD_USER_INTENT:()=>pP,CLAUDE_CODE_GATEWAY_HINT_HEADERS:()=>MM,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>gN,CLAUDE_CODE_GENTLE_PARASOL:()=>Gw,CLAUDE_CODE_GLOB_HIDDEN:()=>bk,CLAUDE_CODE_GLOB_NO_IGNORE:()=>Rk,CLAUDE_CODE_GORSE_PLOVER:()=>yN,CLAUDE_CODE_GROWTHBOOK_KICK_FROM_INIT:()=>tk,CLAUDE_CODE_GROWTHBOOK_KICK_ON_WARM_CACHE:()=>nk,CLAUDE_CODE_HARBOR_KITE:()=>vN,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>MN,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>kN,CLAUDE_CODE_HARMONIC_RIDDLE:()=>GN,CLAUDE_CODE_HIDE_CWD:()=>Tk,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>BU,CLAUDE_CODE_HOST_ARTIFACT_TYPE_COMMANDS:()=>Sk,CLAUDE_CODE_HOST_GUARDS_ARTIFACTS_MCP:()=>Cv,CLAUDE_CODE_HOST_SCHEDULED_RUN:()=>mP,CLAUDE_CODE_HOVER_REST:()=>_N,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>eP,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>vk,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>kk,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>Mk,CLAUDE_CODE_INLINE_TOOLS:()=>Pk,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>CN,CLAUDE_CODE_KB_COHESION_FIXES:()=>XN,CLAUDE_CODE_LANTERN_PRISM:()=>UN,CLAUDE_CODE_LARCH_CISTERN:()=>SN,CLAUDE_CODE_MANAGED_CONFIG_PREFETCH:()=>pk,CLAUDE_CODE_MCP_REGISTRY_FETCH_AT_STARTUP:()=>ck,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>Ex,CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL:()=>IU,CLAUDE_CODE_MODEL_CAPABILITIES:()=>QN,CLAUDE_CODE_NANKEEN_KESTREL:()=>TP,CLAUDE_CODE_NATIVE_APP_BUNDLE:()=>Uk,CLAUDE_CODE_NATIVE_CURSOR:()=>Hk,CLAUDE_CODE_NEW_INIT:()=>zk,CLAUDE_CODE_NEW_RENDERER:()=>Fk,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>Wk,CLAUDE_CODE_NORMALIZE_PREFIX_CACHE:()=>Kk,CLAUDE_CODE_NO_FLICKER:()=>Gk,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>jk,CLAUDE_CODE_PARSED_WILLOW:()=>oP,CLAUDE_CODE_PEWTER_OWL:()=>UM,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>HM,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>$k,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>wM,CLAUDE_CODE_PLUGIN_DIRS:()=>GU,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>zU,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>IM,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>xM,CLAUDE_CODE_PLUGIN_REMOTE_MCP_REACHABLE_HOSTS_HINT:()=>rM,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>PM,CLAUDE_CODE_POLISHED_DEWDROP:()=>qw,CLAUDE_CODE_POLL_EVENTS:()=>Vk,CLAUDE_CODE_POLL_EVENT_DECLARATIONS:()=>Yk,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>NM,CLAUDE_CODE_PROACTIVE:()=>Jk,CLAUDE_CODE_PROJECTS_SESSION:()=>LM,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>DU,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>kM,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>Ux,CLAUDE_CODE_REMOTE_TOOLS_DESKTOP_APP_HOST:()=>KU,CLAUDE_CODE_REMOTE_TOOLS_FORWARD:()=>WU,CLAUDE_CODE_REMOTE_TOOLS_HOST_ALLOWS_UNATTENDED:()=>CP,CLAUDE_CODE_REMOTE_TOOLS_HOST_IDLE_RELEASE_MINUTES:()=>bP,CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGIN:()=>AP,CLAUDE_CODE_REMOVE_PROMPT_STRINGS:()=>ON,CLAUDE_CODE_REPLY_GATE_POLICY:()=>Xk,CLAUDE_CODE_REPORT_FINDINGS:()=>Hx,CLAUDE_CODE_RIPPLING_TULIP:()=>zN,CLAUDE_CODE_RUSTLING_PIXEL:()=>Qw,CLAUDE_CODE_SANDBOX_LEAVE_DENIES_TO_SRT_WIN:()=>Zk,CLAUDE_CODE_SANDBOX_LEAVE_PARENT_FOLDERS_ALONE:()=>qk,CLAUDE_CODE_SEND_FEEDBACK:()=>Jx,CLAUDE_CODE_SESSION_ATTENDED:()=>gk,CLAUDE_CODE_SHOW_HIDDEN_CHARACTERS:()=>Bk,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>tv,CLAUDE_CODE_SILENT_TURN_REMINDER_SECONDS:()=>ov,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>rv,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>nv,CLAUDE_CODE_SKILL_PROPOSALS:()=>Qk,CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS:()=>eM,CLAUDE_CODE_SKIP_PLUGIN_MCP_BUNDLES:()=>tM,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>nM,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>oM,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>sM,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>iM,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>aM,CLAUDE_CODE_SNAPPY_PELICAN:()=>Xw,CLAUDE_CODE_SORTED_OTTER:()=>Jw,CLAUDE_CODE_STELLAR_DRIFT:()=>tP,CLAUDE_CODE_STREAMED_BUMBLEBEE:()=>KN,CLAUDE_CODE_STREAMED_BUMBLEBEE_TEXT:()=>jN,CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT:()=>Wx,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>lM,CLAUDE_CODE_SUBAGENT_CONFIG_WARNING:()=>$N,CLAUDE_CODE_SUBAGENT_HISTORY:()=>VN,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>LU,CLAUDE_CODE_SUBAGENT_PROMPT_SNAPSHOT:()=>cM,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>dM,CLAUDE_CODE_SYNC_PLUGINS:()=>pM,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>uM,CLAUDE_CODE_SYNC_SKILLS:()=>fM,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>mM,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>iv,CLAUDE_CODE_THISTLE_GREBE:()=>Fw,CLAUDE_CODE_THRIFTY_SONIC:()=>Ww,CLAUDE_CODE_TOASTY_THIMBLE:()=>zw,CLAUDE_CODE_TODO_REMINDER_MODE:()=>HN,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>FN,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>YN,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>BN,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>gM,CLAUDE_CODE_TURN_UPDATES:()=>ev,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>_M,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>hM,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>EM,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>SM,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>AM,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>CM,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>bM,CLAUDE_CODE_WEBSEARCH_CITATIONS:()=>TM,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>RM,CLAUDE_CODE_WEB_FETCH_AGENT:()=>OM,CLAUDE_CODE_WEB_SEARCH_FAST_ARG:()=>DM,CLAUDE_CODE_WHIMSICAL_ELEPHANT:()=>sP,CLAUDE_CODE_WILLOW_TERN:()=>AN,CLAUDE_CODE_WISE_COMET:()=>nP,CLAUDE_CODE_WITTY_DEWDROP:()=>Bw,CLAUDE_CODE_WORKFLOWS:()=>oN,CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS:()=>YM,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>VM,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>jM,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>$M,CLAUDE_DISABLE_ADOPT:()=>FM,CLAUDE_IMPORT_CONVERSATIONS:()=>BM,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>zM,CLAUDE_RUNNER_DISABLE_RENEWAL_WARNING:()=>GM,CLAUDE_RUNNER_DISABLE_TURN_BEGAN_BEFORE_INIT:()=>WM,CLAUDE_WORKFLOW_NAME_ONLY:()=>KM,DISABLE_AUTOUPDATER:()=>JM,DISABLE_AUTO_COMPACT:()=>XM,DISABLE_BRIEF_MODE_STOP_HOOK:()=>ZM,DISABLE_BUG_COMMAND:()=>qM,DISABLE_COST_WARNINGS:()=>QM,DISABLE_DOCTOR_COMMAND:()=>eU,DISABLE_ERROR_REPORTING:()=>tU,DISABLE_EXTRA_USAGE_COMMAND:()=>nU,DISABLE_FEEDBACK_COMMAND:()=>oU,DISABLE_GROWTHBOOK:()=>rU,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>sU,DISABLE_INTERLEAVED_THINKING:()=>iU,DISABLE_LOGIN_COMMAND:()=>aU,DISABLE_LOGOUT_COMMAND:()=>lU,DISABLE_PROMPT_CACHING:()=>cU,DISABLE_PROMPT_CACHING_FABLE:()=>fU,DISABLE_PROMPT_CACHING_HAIKU:()=>dU,DISABLE_PROMPT_CACHING_MYTHOS:()=>mU,DISABLE_PROMPT_CACHING_OPUS:()=>uU,DISABLE_PROMPT_CACHING_SONNET:()=>pU,DISABLE_TELEMETRY:()=>gU,DISABLE_UPDATES:()=>_U,DISABLE_UPGRADE_COMMAND:()=>hU,EMBEDDED_SEARCH_TOOLS:()=>HU,ENABLE_BETA_TRACING_DETAILED:()=>EU,ENABLE_CLAUDEAI_MCP_SERVERS:()=>SU,ENABLE_ENHANCED_TELEMETRY_BETA:()=>yU,ENABLE_LOCKLESS_UPDATES:()=>OU,ENABLE_LSP_TOOL:()=>AU,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>CU,ENABLE_PID_BASED_VERSION_LOCKING:()=>bU,ENABLE_PROMPT_CACHING_1H:()=>RU,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>TU,ENABLE_SESSION_BACKGROUNDING:()=>wU,ENABLE_SESSION_PERSISTENCE:()=>PU,ENABLE_TOOL_SEARCH:()=>xU,FORCE_AUTOUPDATE_PLUGINS:()=>NU,FORCE_CODE_TERMINAL:()=>kU,FORCE_PROMPT_CACHING_5M:()=>MU,FORCE_VCR:()=>UU,INK_SCREEN_READER:()=>Uw,USE_API_CONTEXT_MANAGEMENT:()=>FU});var bc={};K(bc,{ALACRITTY_LOG:()=>PF,ALACRITTY_WINDOW_ID:()=>xF,ALLUSERSPROFILE:()=>NH,ANDROID_HOME:()=>cF,ANDROID_SDK_ROOT:()=>dF,APPDATA:()=>CH,APP_URL:()=>u0,AWS_CA_BUNDLE:()=>JH,AWS_EXECUTION_ENV:()=>qB,AWS_LAMBDA_FUNCTION_NAME:()=>ZB,AZURE_FUNCTIONS_ENVIRONMENT:()=>d0,BAT_THEME:()=>_0,BROWSER:()=>cH,BUILDKITE:()=>xB,BUN_CHROME_PATH:()=>g0,BUN_INSTALL:()=>m0,CARGO_HTTP_CAINFO:()=>qH,CDPATH:()=>VU,CF_PAGES:()=>XB,CIRCLECI:()=>PB,CLOUDSDK_ACTIVE_CONFIG_NAME:()=>a0,CLOUDSDK_CONFIG:()=>i0,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>YH,CODER:()=>UB,CODER_WORKSPACE_NAME:()=>HB,CODESPACES:()=>MB,COLORFGBG:()=>mF,COLORTERM:()=>fF,COMPUTERNAME:()=>yH,COMSPEC:()=>eH,CONTAINER_SANDBOX_MOUNT_POINT:()=>OH,CURL_CA_BUNDLE:()=>VH,CURSOR_TRACE_ID:()=>ZF,ComSpec:()=>nH,ConEmuANSI:()=>KF,ConEmuPID:()=>jF,ConEmuTask:()=>$F,DAYTONA_WS_ID:()=>zB,DEMO_VERSION:()=>A0,DENO_CERT:()=>ZH,DENO_DEPLOYMENT_ID:()=>JB,DISPLAY:()=>dH,DO_NOT_TRACK:()=>gF,DYNO:()=>YB,EDITOR:()=>aH,FORCE_COLOR:()=>pF,GCLOUD_PROJECT:()=>t0,GCM_INTERACTIVE:()=>sB,GH_CONFIG_DIR:()=>cB,GH_ENTERPRISE_TOKEN:()=>gB,GH_HOST:()=>fB,GH_REPO:()=>mB,GH_TOKEN:()=>pB,GITHUB_ACTIONS:()=>yB,GITHUB_ACTION_INPUTS:()=>OB,GITHUB_ACTION_PATH:()=>AB,GITHUB_ACTOR:()=>CB,GITHUB_ACTOR_ID:()=>bB,GITHUB_ENTERPRISE_TOKEN:()=>hB,GITHUB_ENV:()=>EB,GITHUB_EVENT_NAME:()=>RB,GITHUB_EVENT_PATH:()=>TB,GITHUB_REPOSITORY:()=>DB,GITHUB_REPOSITORY_ID:()=>LB,GITHUB_REPOSITORY_OWNER:()=>IB,GITHUB_REPOSITORY_OWNER_ID:()=>wB,GITHUB_TOKEN:()=>_B,GITHUB_WORKSPACE:()=>SB,GITLAB_CI:()=>NB,GITPOD_WORKSPACE_ID:()=>FB,GIT_ASKPASS:()=>rB,GIT_CONFIG_COUNT:()=>iB,GIT_CONFIG_GLOBAL:()=>aB,GIT_CONFIG_NOSYSTEM:()=>rF,GIT_DIR:()=>lB,GIT_SSH_COMMAND:()=>nB,GIT_SSL_CAINFO:()=>oF,GIT_SSL_CAPATH:()=>sF,GIT_TERMINAL_PROMPT:()=>oB,GNOME_TERMINAL_SERVICE:()=>IF,GOOGLE_APPLICATION_CREDENTIALS:()=>n0,GOOGLE_CLOUD_PROJECT:()=>e0,GOOGLE_CLOUD_WORKSTATIONS:()=>BB,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>eF,HEX_CACERTS_PATH:()=>nF,HISTFILE:()=>BH,HOME:()=>jU,HOMEDRIVE:()=>LH,HOMEPATH:()=>IH,HOMESHARE:()=>wH,HTTPLIB2_CA_CERTS:()=>XH,HUB_CONFIG:()=>dB,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>VF,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>YF,IS_DEMO:()=>O0,IS_SANDBOX:()=>y0,ITERM_SESSION_ID:()=>RF,JAVA_HOME:()=>aF,JAVA_TOOL_OPTIONS:()=>lF,KITTY_WINDOW_ID:()=>TF,KONSOLE_VERSION:()=>DF,KUBERNETES_SERVICE_HOST:()=>f0,K_SERVICE:()=>QB,LANG:()=>pH,LC_ALL:()=>fH,LC_TERMINAL:()=>SF,LC_TIME:()=>mH,LOCALAPPDATA:()=>bH,MSYSTEM:()=>WF,NETLIFY:()=>VB,NIX_SSL_CERT_FILE:()=>tF,NODE_EXTRA_CA_CERTS:()=>WH,NODE_OPTIONS:()=>zH,NODE_PATH:()=>GH,NO_COLOR:()=>uF,NoDefaultCurrentDirectoryInExePath:()=>iH,OneDrive:()=>RH,OneDriveCommercial:()=>DH,OneDriveConsumer:()=>TH,P4PORT:()=>h0,PATH:()=>$U,PATHEXT:()=>sH,PIP_CERT:()=>QH,PLAYWRIGHT_BROWSERS_PATH:()=>E0,PREFIX:()=>XU,PROGRAMDATA:()=>xH,PROJECT_DOMAIN:()=>KB,PWD:()=>YU,ProgramData:()=>PH,ProgramFiles:()=>rH,RENDER:()=>$B,REPL_ID:()=>GB,REPL_SLUG:()=>WB,REQUESTS_CA_BUNDLE:()=>$H,RUNNER_ENVIRONMENT:()=>kB,RUNNER_OS:()=>vB,SAFEUSER:()=>vH,SESSIONNAME:()=>kF,SHELL:()=>QU,SPACE_CREATOR_USER_ID:()=>p0,SSH_AUTH_SOCK:()=>tB,SSH_CLIENT:()=>qF,SSH_CONNECTION:()=>QF,SSH_TTY:()=>eB,SSL_CERT_DIR:()=>jH,SSL_CERT_FILE:()=>KH,STY:()=>MF,SUDO_GID:()=>hH,SUDO_UID:()=>_H,SUDO_USER:()=>EH,SYSTEMROOT:()=>tH,SystemRoot:()=>oH,TEMP:()=>qU,TERM:()=>_F,TERMINAL:()=>yF,TERMINAL_EMULATOR:()=>OF,TERMINATOR_UUID:()=>AF,TERMUX_VERSION:()=>CF,TERM_PROGRAM:()=>hF,TERM_PROGRAM_VERSION:()=>EF,TILIX_ID:()=>bF,TMP:()=>ZU,TMPDIR:()=>JU,TMUX:()=>UF,TMUX_PANE:()=>HF,TRACEPARENT:()=>C0,TRACESTATE:()=>b0,USER:()=>gH,USERNAME:()=>SH,USERPROFILE:()=>AH,USE_BUILTIN_RIPGREP:()=>S0,UV_THREADPOOL_SIZE:()=>iF,VERCEL:()=>jB,VISUAL:()=>lH,VSCODE_GIT_ASKPASS_MAIN:()=>JF,VTE_VERSION:()=>wF,WAYLAND_DISPLAY:()=>uH,WEBSITE_SITE_NAME:()=>l0,WEBSITE_SKU:()=>c0,WEZTERM_PANE:()=>NF,WSL_DISTRO_NAME:()=>zF,WSL_INTEROP:()=>GF,WT_SESSION:()=>vF,XDG_CACHE_HOME:()=>HH,XDG_CONFIG_HOME:()=>MH,XDG_DATA_HOME:()=>UH,XDG_RUNTIME_DIR:()=>kH,XDG_STATE_HOME:()=>FH,XTERM_VERSION:()=>LF,ZDOTDIR:()=>uB,ZED_TERM:()=>BF,ZELLIJ:()=>FF,__CFBundleIdentifier:()=>XF,gcloud_project:()=>o0,google_application_credentials:()=>s0,google_cloud_project:()=>r0});var Rc={};K(Rc,{AI_AGENT:()=>YK,ALLOW_ANT_COMPUTER_USE_MCP:()=>XK,ANTHROPIC_CONFIG_DIR:()=>R0,BASH_MAX_OUTPUT_LENGTH:()=>Y$,CCR_BYOC_RESOURCE_WATCHDOG_TELEMETRY:()=>PV,CCR_SESSION_PROFILE:()=>JK,CLAUBBIT:()=>ZK,CLAUDECODE:()=>qK,CLAUDE_AFK_COUNTDOWN_MS:()=>X$,CLAUDE_AFK_TIMEOUT_MS:()=>J$,CLAUDE_AFTER_LAST_COMPACT:()=>T0,CLAUDE_AGENTS_SELECT:()=>D0,CLAUDE_AGENT_SDK_CLIENT_APP:()=>L0,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>QK,CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS:()=>ej,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>tj,CLAUDE_AGENT_SDK_VERSION:()=>I0,CLAUDE_ARTIFACT_HOST_GRANT:()=>w0,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>Z$,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>P0,CLAUDE_AUTO_BACKGROUND_TASKS:()=>nj,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>oj,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>x0,CLAUDE_BG_AUTO_MEMORY_OFF:()=>z0,CLAUDE_BG_BACKEND:()=>N0,CLAUDE_BG_CARRIED_PROMPTS_SHA256:()=>ez,CLAUDE_BG_CLAIM_AUTH:()=>v0,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>k0,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>M0,CLAUDE_BG_DISPATCH_ENTRYPOINT:()=>U0,CLAUDE_BG_GATEWAY_WITHHELD:()=>F0,CLAUDE_BG_ISOLATION:()=>H0,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>B0,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>G0,CLAUDE_BG_PTY_AUTH:()=>W0,CLAUDE_BG_RENDEZVOUS_SOCK:()=>K0,CLAUDE_BG_RV_AUTH:()=>j0,CLAUDE_BG_SESSION_CREDENTIAL:()=>$0,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>V0,CLAUDE_BG_SILENT_PEER_TIMEOUT_MS:()=>Y0,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>J0,CLAUDE_BG_SOCK_ADMIT_SILENT_PEERS:()=>X0,CLAUDE_BG_SOURCE:()=>Z0,CLAUDE_BG_STARTUP_WEDGE_MS:()=>q$,CLAUDE_BG_TCC_DISCLAIMED:()=>q0,CLAUDE_BG_WORKSPACE_TRUSTED:()=>Q0,CLAUDE_BRIDGE_BASE_URL:()=>tz,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>nz,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>oz,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>rj,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>sj,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>rz,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>sz,CLAUDE_BRIDGE_REATTACH_SEQ:()=>Q$,CLAUDE_BRIDGE_REATTACH_SESSION:()=>iz,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>az,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>lz,CLAUDE_CHROME_PERMISSION_MODE:()=>cz,CLAUDE_CHROME_TAB_GROUP_KEY:()=>dz,CLAUDE_CLIENT_PRESENCE_FILE:()=>uz,CLAUDE_CODE_ACTION:()=>pz,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>fz,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>ij,CLAUDE_CODE_AGENT:()=>mz,CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES:()=>_z,CLAUDE_CODE_APPEND_PROMPT_HEAD:()=>hz,CLAUDE_CODE_ARTIFACT:()=>Ez,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>yz,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>Oz,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>Az,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>Sz,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>Cz,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>bz,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>Rz,CLAUDE_CODE_ATTACHMENTS_BY_PATH:()=>Tz,CLAUDE_CODE_ATTRIBUTION_PROJECT:()=>Dz,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>Lz,CLAUDE_CODE_AUTOMOUNT_ROOTS:()=>gz,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>wz,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>aj,CLAUDE_CODE_AUTO_MODE_TIER:()=>lj,CLAUDE_CODE_BASE_REF:()=>Pz,CLAUDE_CODE_BASE_REFS:()=>xz,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>Nz,CLAUDE_CODE_BRIDGE_CHILD_ARTIFACT:()=>cG,CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULT:()=>lG,CLAUDE_CODE_BRIDGE_CHILD_CLI_ENTRYPOINT:()=>fG,CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS:()=>dG,CLAUDE_CODE_BRIDGE_CHILD_PROJECTS_ENTRYPOINT:()=>uG,CLAUDE_CODE_BRIDGE_CHILD_START_DIR:()=>pG,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>vz,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>kz,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>Mz,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>Hz,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>Bz,CLAUDE_CODE_BRIDGE_SETTINGS_BINDING:()=>Fz,CLAUDE_CODE_BRIDGE_SOURCE_DIR:()=>Uz,CLAUDE_CODE_BRIEF:()=>cj,CLAUDE_CODE_BRIEF_UPLOAD:()=>dj,CLAUDE_CODE_CCR_EVENT_FLUSH_POLICY:()=>d$,CLAUDE_CODE_CCR_SURFACE:()=>u$,CLAUDE_CODE_CHILD_NOTES_DIR:()=>RW,CLAUDE_CODE_CHROME_LATE_MCP_SERVER:()=>u1,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>Gz,CLAUDE_CODE_CONFIG_LOCK_WAIT_MS:()=>_G,CLAUDE_CODE_CONFIG_PROBE:()=>mG,CLAUDE_CODE_CONFIG_WATCH_EVENTS:()=>gG,CLAUDE_CODE_CONTAINER_ID:()=>Wz,CLAUDE_CODE_COORDINATOR_SKILL_GUIDANCE:()=>uj,CLAUDE_CODE_DAEMON_COLD_START:()=>pj,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>Kz,CLAUDE_CODE_DESKTOP_SKILLS_PLUGIN_DIR:()=>$G,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>jz,CLAUDE_CODE_DIFF_COPY_ROOT:()=>$z,CLAUDE_CODE_DISABLE_ATTRIBUTION_BASELINE_REUSE:()=>Iz,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>fj,CLAUDE_CODE_DISABLE_HELD_MESSAGE_RECOGNITION:()=>R$,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>Yz,CLAUDE_CODE_DISABLE_HTTPS_AGENT_KEEPING:()=>Jz,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>Xz,CLAUDE_CODE_DISABLE_POOLED_CONNECTION_IDLE_LIMIT:()=>Zz,CLAUDE_CODE_DISABLE_QUIET_BACKGROUND_WAIT:()=>qz,CLAUDE_CODE_DISABLE_STOP_OF_HELD_MESSAGES:()=>A$,CLAUDE_CODE_DISABLE_TURN_HANDOFF:()=>Qz,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>eG,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>tG,CLAUDE_CODE_DISABLE_WORKING_SYNC_WATCH:()=>nG,CLAUDE_CODE_DONT_INHERIT_ENV:()=>mj,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>oG,CLAUDE_CODE_DROP_UNAVAILABLE_DEFERRED_TOOL:()=>O$,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>gj,CLAUDE_CODE_EMIT_STARTUP_TIMING:()=>Ej,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>Sj,CLAUDE_CODE_EMIT_USER_PROMPT_SUBMIT_HOOK_EVENTS:()=>yj,CLAUDE_CODE_ENTRYPOINT:()=>rG,CLAUDE_CODE_ENTRYPOINT_ON_REQUESTS:()=>sG,CLAUDE_CODE_ENVIRONMENT_KIND:()=>iG,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>hG,CLAUDE_CODE_EVAL_CONFINED:()=>r$,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>Cj,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>eV,CLAUDE_CODE_FLAG_FETCH_WAIT_MS:()=>bj,CLAUDE_CODE_FOOTER_INDICATOR:()=>EG,CLAUDE_CODE_FORCE_BRIDGE:()=>Rj,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>Tj,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>Dj,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>Lj,CLAUDE_CODE_FORCE_TIP_ID:()=>OG,CLAUDE_CODE_GIT_BASH_PATH:()=>AG,CLAUDE_CODE_GIT_CHECK_ONLY_IN_REPOSITORY:()=>Oj,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>tV,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>nV,CLAUDE_CODE_HIDE_REPLY_SERVER_NAME:()=>CG,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>RG,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>T$,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>TG,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>DG,CLAUDE_CODE_HOOK_HEARTBEAT_INTERVAL_MS:()=>g$,CLAUDE_CODE_HOSTED_DESKTOP:()=>wj,CLAUDE_CODE_HOST_OWNED_CONFIG_DIR:()=>LG,CLAUDE_CODE_HOST_OWNED_SPAWN_ENV:()=>aG,CLAUDE_CODE_HOST_PLATFORM:()=>IG,CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD:()=>Ij,CLAUDE_CODE_HOST_SESSION_ID:()=>wG,CLAUDE_CODE_HOST_SHORT_TEMP_DIRS:()=>PG,CLAUDE_CODE_HOST_SKILL_CATALOG:()=>xG,CLAUDE_CODE_HOST_WORKTREE:()=>vG,CLAUDE_CODE_HOST_WORKTREE_FENCE:()=>kG,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>MG,CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS:()=>UG,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>oV,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>rV,CLAUDE_CODE_IGNORE_PERSISTED_TRUST:()=>bG,CLAUDE_CODE_IS_COWORK:()=>Pj,CLAUDE_CODE_JIT_POLICY_AFTER_STARTUP:()=>Qj,CLAUDE_CODE_LAUNCHED_BY_SESSION_IDS:()=>bW,CLAUDE_CODE_LEGACY_BUNDLE:()=>Vz,CLAUDE_CODE_LOOP_KEEPALIVE:()=>xj,CLAUDE_CODE_LOOP_PERSISTENT:()=>Nj,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>HG,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>sV,CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH:()=>g1,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>iV,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>aV,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>FG,CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUT:()=>d1,CLAUDE_CODE_MCP_APPS_HOST:()=>p1,CLAUDE_CODE_MCP_APPS_NO_TOOL_ROUTE:()=>f1,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>e1,CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS:()=>t1,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>U$,CLAUDE_CODE_MCP_NO_REDIAL_AFTER_POLICY_REFUSAL:()=>c1,CLAUDE_CODE_MCP_PREWAIT_SERVERS:()=>r1,CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS:()=>s1,CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS_BY_NAME:()=>i1,CLAUDE_CODE_MCP_SERVE_MEMORY_WALKS_DEADLINE_MS:()=>h$,CLAUDE_CODE_MCP_STARTUP_WAIT_MS:()=>n1,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>qV,CLAUDE_CODE_MEMORY_CONTEXT_NO_WAIT:()=>WK,CLAUDE_CODE_MEMORY_SUBAGENT_APPEND:()=>KK,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>vj,CLAUDE_CODE_MOCK_TRIAL:()=>kj,CLAUDE_CODE_NOTIFICATIONS_HOST:()=>m1,CLAUDE_CODE_OFF_PERSONS_MACHINE:()=>Hj,CLAUDE_CODE_OVERRIDE_DATE:()=>BG,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>_$,CLAUDE_CODE_PARKED_RUN_BEFORE_CLEAR:()=>b$,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>C$,CLAUDE_CODE_PERFORCE_MODE:()=>GG,CLAUDE_CODE_PERSONAL_CONFIG_FIX:()=>WG,CLAUDE_CODE_PERSONAL_HOOKS_OFF:()=>KG,CLAUDE_CODE_PLAIN_DELTA_DIRECT_WRITE:()=>t$,CLAUDE_CODE_PLAIN_DELTA_FAST_PATH:()=>e$,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>cV,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>dV,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>jG,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>VG,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>uV,CLAUDE_CODE_PLUGIN_MCPB_DIR:()=>YG,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>XG,CLAUDE_CODE_POST_TURN_MEMORY:()=>Mj,CLAUDE_CODE_POST_TURN_MEMORY_CONFIG:()=>JG,CLAUDE_CODE_POST_TURN_MEMORY_SYNC:()=>Uj,CLAUDE_CODE_POWERUP_ONBOARDING:()=>ZG,CLAUDE_CODE_PROGRAM_USE_CASE_ID:()=>SG,CLAUDE_CODE_PROGRAM_USE_CASE_STAMPED:()=>yG,CLAUDE_CODE_PROJECT_DIR_NAME:()=>qG,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>pV,CLAUDE_CODE_QUESTION_EXTENDED:()=>eW,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>tW,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>QG,CLAUDE_CODE_RELAUNCH_HOME_TRUST:()=>nW,CLAUDE_CODE_RELAUNCH_PROACTIVITY_BASELINE:()=>oW,CLAUDE_CODE_RELAUNCH_PROACTIVITY_DECIDED:()=>rW,CLAUDE_CODE_RELAUNCH_PROACTIVITY_EVER_ON:()=>sW,CLAUDE_CODE_RELAUNCH_PROACTIVITY_LEVEL:()=>iW,CLAUDE_CODE_RELAUNCH_RESUME_HINT_FLAGS:()=>aW,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>lW,CLAUDE_CODE_REMOTE:()=>Fj,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>cW,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>Bj,CLAUDE_CODE_REMOTE_MCP_CONFIG:()=>dW,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>uW,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>pW,CLAUDE_CODE_REMOTE_SDK_URL:()=>fW,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>zj,CLAUDE_CODE_REMOTE_SESSION_ID:()=>mW,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>gW,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>_W,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>fV,CLAUDE_CODE_REMOTE_STALL_CHECK_INTERVAL_MS:()=>Gj,CLAUDE_CODE_REPL:()=>Wj,CLAUDE_CODE_REPO_CHECKOUTS:()=>hW,CLAUDE_CODE_REQUIRED_PLUGINS_HOLD:()=>Aj,CLAUDE_CODE_RESTRICTED:()=>Kj,CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG:()=>jj,CLAUDE_CODE_RESULT_NONCE:()=>zz,CLAUDE_CODE_RESUME_CACHE_WARM:()=>$j,CLAUDE_CODE_RESUME_FROM_SESSION:()=>EW,CLAUDE_CODE_RESUME_HINT_COMMAND:()=>SW,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>Vj,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>Zj,CLAUDE_CODE_RESUME_PROMPT:()=>yW,CLAUDE_CODE_RESUME_REASON:()=>n$,CLAUDE_CODE_RESUME_SESSIONSTART_HOOKS_WAIT_MS:()=>qj,CLAUDE_CODE_RESUME_SHOWS_CUT_OFF_CALLS:()=>S$,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>Yj,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>mV,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>gV,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>E$,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_SEEDS:()=>y$,CLAUDE_CODE_SAFE_MODE:()=>o$,CLAUDE_CODE_SANDBOXED:()=>s$,CLAUDE_CODE_SCRIPT_CAPS:()=>_V,CLAUDE_CODE_SCROLL_SPEED:()=>OW,CLAUDE_CODE_SDK_MCP_TOOL_IDLE_TIMEOUT:()=>QV,CLAUDE_CODE_SDK_READS_SESSION_STATE:()=>_j,CLAUDE_CODE_SDK_READS_STARTUP_MARKS:()=>hj,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>hV,CLAUDE_CODE_SESSION_BEGAN_AS_COPY:()=>AW,CLAUDE_CODE_SESSION_CREATED_AT_MS:()=>IW,CLAUDE_CODE_SESSION_ID:()=>CW,CLAUDE_CODE_SESSION_KIND:()=>TW,CLAUDE_CODE_SESSION_NAME:()=>DW,CLAUDE_CODE_SESSION_ORIGIN:()=>LW,CLAUDE_CODE_SESSION_START_ANNOUNCEMENTS_BEFORE_PROMPT:()=>i$,CLAUDE_CODE_SHELL:()=>wW,CLAUDE_CODE_SHELL_PREFIX:()=>PW,CLAUDE_CODE_SHOWN_PLUGINS_DIR:()=>NG,CLAUDE_CODE_SIMPLE:()=>a$,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>xW,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>NW,CLAUDE_CODE_SKIP_MCP_DEBUG_LOG_FILES:()=>l1,CLAUDE_CODE_SLEEP_COMPACT:()=>vW,CLAUDE_CODE_SLEEP_COMPACT_AFTER_MS:()=>kW,CLAUDE_CODE_SPARE_DEFER_ALL_MCP:()=>o1,CLAUDE_CODE_SPAWNED_BY_SERVER:()=>xK,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>EV,CLAUDE_CODE_SSE_PORT:()=>SV,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>MW,CLAUDE_CODE_STARTUP_FAILURE_RESULTS:()=>zG,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>yV,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>l$,CLAUDE_CODE_SUPERVISED:()=>c$,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>p$,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_CONCURRENCY:()=>f$,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>m$,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>AV,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>CV,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>OV,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>bV,CLAUDE_CODE_SYNC_SESSION_REFS:()=>D$,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>RV,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>TV,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>L$,CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG:()=>UW,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>HW,CLAUDE_CODE_TAGS:()=>FW,CLAUDE_CODE_TASK_LIST_ID:()=>zW,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>DV,CLAUDE_CODE_TELEPORT_MOVE:()=>H$,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>BW,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>I$,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>GW,CLAUDE_CODE_TEST_FORCE_DENY:()=>w$,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>P$,CLAUDE_CODE_TEST_NO_PWSH:()=>x$,CLAUDE_CODE_TMPDIR:()=>WW,CLAUDE_CODE_TMUX_PREFIX:()=>KW,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>N$,CLAUDE_CODE_TMUX_SESSION:()=>jW,CLAUDE_CODE_TMUX_TRUECOLOR:()=>v$,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>k$,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>M$,CLAUDE_CODE_TOOL_PICTURE_SERVERS:()=>$W,CLAUDE_CODE_TRANSCRIPT_SLIM_TOOL_RESULTS:()=>Xj,CLAUDE_CODE_TRANSCRIPT_TAIL_LOAD:()=>Jj,CLAUDE_CODE_TRIGGER_ID:()=>VW,CLAUDE_CODE_TUI_ASKED:()=>B$,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>F$,CLAUDE_CODE_TUI_TRIAL:()=>z$,CLAUDE_CODE_ULTRAREVIEW_LAUNCH_RECORD:()=>YW,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>JW,CLAUDE_CODE_ULTRAREVIEW_PR_AS_MERGED:()=>XW,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>ZW,CLAUDE_CODE_ULTRAREVIEW_REVIEW_MD_FILE:()=>qW,CLAUDE_CODE_UPFRONT_TOOLS:()=>a1,CLAUDE_CODE_USER_DELEGATED_SESSION:()=>QW,CLAUDE_CODE_USER_DELEGATED_SESSION_ALLOWED_CHECK_MODELS:()=>eK,CLAUDE_CODE_USER_DELEGATED_SESSION_ANY_CHECK_MODEL:()=>tK,CLAUDE_CODE_USER_DELEGATED_SESSION_DIRECT_API:()=>nK,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>LV,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>G$,CLAUDE_CODE_WARN_DISK_FREE_GIB:()=>IV,CLAUDE_CODE_WARN_MEMORY_FREE_GIB:()=>wV,CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR:()=>lV,CLAUDE_CODE_WITHHOLD_PRODUCT_EVENTS:()=>oK,CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE:()=>rK,CLAUDE_CODE_WORKER_EPOCH:()=>xV,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>sK,CLAUDE_CONFIG_DIR:()=>iK,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>aK,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>lK,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>cK,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>dK,CLAUDE_ENV_FILE:()=>uK,CLAUDE_FORCE_DISPLAY_SURVEY:()=>W$,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>pK,CLAUDE_INTERNAL_FC_OVERRIDES:()=>fK,CLAUDE_INTERNAL_SESSION_TASK_LIST_ID:()=>mK,CLAUDE_JOB_DIR:()=>gK,CLAUDE_MEMORY_STORES:()=>_K,CLAUDE_PROJECT_UUID:()=>hK,CLAUDE_PTY_HEARTBEAT_MS:()=>NV,CLAUDE_PTY_HOST_EXEC:()=>EK,CLAUDE_PTY_HOST_NO_STABLE_PATH:()=>SK,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>vV,CLAUDE_RELAUNCH_SESSION_ADD_DIRS:()=>yK,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>OK,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>AK,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>CK,CLAUDE_RUNNER_ACTIVITY_FD:()=>kV,CLAUDE_RUNNER_ALIVE_EVERY_MS:()=>MV,CLAUDE_RUNNER_CLIENT_PLATFORM:()=>bK,CLAUDE_RUNNER_FETCH_DEPTH:()=>RK,CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS:()=>TK,CLAUDE_RUNNER_OFFERS_NEW_MACHINE:()=>HV,CLAUDE_RUNNER_UPDATE_BIN:()=>UV,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>DK,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>FV,CLAUDE_SNIP:()=>LK,CLAUDE_SSH_DAEMON_CHILD:()=>wK,CLAUDE_SSH_LOCAL_BINARY:()=>IK,CLAUDE_SSH_RUN_DIR:()=>PK,CLAUDE_SSH_VERSION:()=>NK,CLAUDE_STAGE_FILE_ROOT:()=>vK,CLAUDE_TMPDIR:()=>kK,LOCAL_BRIDGE:()=>K$,MCP_CONNECTION_NONBLOCKING:()=>j$,MCP_CONNECT_TIMEOUT_MS:()=>BV,MCP_DISCOVERY_CACHE:()=>zV,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>GV,MCP_DISCOVERY_CACHE_STRIKES:()=>WV,MCP_DISCOVERY_CACHE_TTL_S:()=>KV,MCP_OAUTH_CALLBACK_PORT:()=>jV,MCP_OAUTH_CLIENT_METADATA_URL:()=>MK,MCP_PROTOCOL_NEGOTIATION:()=>$V,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>VV,MCP_SDK_GENERATION:()=>XV,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>YV,MCP_TIMEOUT:()=>JV,MCP_TOOL_TIMEOUT:()=>ZV,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>UK,SANDBOX_OFFICE_PDF_DIR:()=>HK,SANDBOX_OFFICE_PDF_SEND:()=>FK,SDK_NATIVE_BIN:()=>BK,SESSION_INGRESS_URL:()=>zK,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>_1,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>GK,TEST_ENABLE_SESSION_PERSISTENCE:()=>$$,ULTRAPLAN_PROMPT_FILE:()=>jK,VCR_RECORD:()=>V$,VITALS_EMITTER_BIN:()=>$K,VOICE_STREAM_BASE_URL:()=>VK});var Tc={};K(Tc,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>H1,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>B1,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>F1,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>y1,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>A1,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>O1,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>I1,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>P1,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>w1,ANTHROPIC_DEFAULT_MODEL:()=>E1,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>C1,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>R1,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>b1,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>T1,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>L1,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>D1,ANTHROPIC_MODEL:()=>h1,ANTHROPIC_SMALL_FAST_MODEL:()=>S1,CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULT:()=>v1,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>N1,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>x1,CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT:()=>M1,CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT:()=>k1,CLAUDE_CODE_ALLOW_OTHER_MODELS:()=>cY,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>Q1,CLAUDE_CODE_AUTO_MODE_MODEL:()=>j1,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>$1,CLAUDE_CODE_CLIENT_DATA_URL:()=>lY,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>rY,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>J1,CLAUDE_CODE_DISABLE_FAST_MODE:()=>tY,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>Z1,CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK:()=>X1,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>sY,CLAUDE_CODE_EFFORT_LEVEL:()=>q1,CLAUDE_CODE_MAX_EFFORT_REMINDER:()=>eY,CLAUDE_CODE_MODEL_CATALOG:()=>iY,CLAUDE_CODE_MODEL_CATALOG_URL:()=>aY,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>Y1,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>nY,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>oY,CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY:()=>U1,CLAUDE_CODE_SUBAGENT_EFFORT:()=>G1,CLAUDE_CODE_SUBAGENT_MODEL:()=>z1,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>W1,CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL:()=>K1,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>V1});var Dc={};K(Dc,{ALL_PROXY:()=>_Y,ANTHROPIC_BETAS:()=>TY,ANTHROPIC_CUSTOM_HEADERS:()=>DY,API_FORCE_IDLE_TIMEOUT:()=>VY,API_TIMEOUT_MS:()=>GY,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>c2,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>wY,CLAUDE_CODE_CERT_STORE:()=>CY,CLAUDE_CODE_CLIENT_CERT:()=>EY,CLAUDE_CODE_CLIENT_KEY:()=>SY,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>yY,CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP:()=>bY,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>OY,CLAUDE_CODE_DISABLE_PROXY_SCHEME_REPAIR:()=>AY,CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP:()=>RY,CLAUDE_CODE_EAGER_FLUSH:()=>h2,CLAUDE_CODE_EXTRA_BODY:()=>LY,CLAUDE_CODE_EXTRA_METADATA:()=>IY,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>vY,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_MESSAGE:()=>kY,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_TURN:()=>MY,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>E2,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>qY,CLAUDE_CODE_GZIP_DATADOG_LOGS:()=>QY,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>ZY,CLAUDE_CODE_GZIP_REQUEST_BODY_BLOCKS:()=>t2,CLAUDE_CODE_GZIP_REQUEST_BODY_LEVEL:()=>e2,CLAUDE_CODE_INCREMENTAL_REQUEST_BODY:()=>n2,CLAUDE_CODE_MAIN_REPLY_HOLD_MS:()=>r2,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>NY,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>xY,CLAUDE_CODE_MAX_RETRIES:()=>PY,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>UY,CLAUDE_CODE_MAX_TURNS:()=>HY,CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES:()=>WY,CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS:()=>KY,CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS:()=>jY,CLAUDE_CODE_OVERLOADED_RETRY_MAX_WAIT_MS:()=>$Y,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>O2,CLAUDE_CODE_RETRY_WATCHDOG:()=>p2,CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS:()=>m2,CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS:()=>f2,CLAUDE_CODE_RETRY_WATCHDOG_SCOPE:()=>_2,CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS:()=>g2,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>y2,CLAUDE_CODE_STREAM_EVENT_HOLD_MS:()=>s2,CLAUDE_CODE_STREAM_EVENT_MAX_LINE_BYTES:()=>i2,CLAUDE_CODE_STREAM_EVENT_NO_SUBSCRIBER_HOLD_MS:()=>a2,CLAUDE_CODE_UNWATCHED_REPLY_HOLD_MS:()=>o2,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>YY,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>XY,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>JY,CLAUDE_MOCK_HEADERLESS_429:()=>S2,CLAUDE_SLOW_FIRST_BYTE_MS:()=>u2,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>d2,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>l2,HTTPS_PROXY:()=>uY,HTTP_PROXY:()=>dY,MAX_MCP_OUTPUT_TOKENS:()=>zY,MAX_STRUCTURED_OUTPUT_RETRIES:()=>BY,MAX_THINKING_TOKENS:()=>FY,NO_PROXY:()=>pY,all_proxy:()=>hY,http_proxy:()=>fY,https_proxy:()=>mY,no_proxy:()=>gY});var Lc={};K(Lc,{AGENT_PROXY_URL:()=>jX,ANTHROPIC_AWS_BASE_URL:()=>k2,ANTHROPIC_AWS_WORKSPACE_ID:()=>M2,ANTHROPIC_BASE_URL:()=>L2,ANTHROPIC_BEDROCK_BASE_URL:()=>P2,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>v2,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>x2,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>N2,ANTHROPIC_FOUNDRY_BASE_URL:()=>K2,ANTHROPIC_FOUNDRY_RESOURCE:()=>j2,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>B2,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>H2,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>U2,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>F2,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>sX,ANTHROPIC_UNIX_SOCKET:()=>iX,ANTHROPIC_VERTEX_BASE_URL:()=>z2,ANTHROPIC_VERTEX_PROJECT_ID:()=>G2,AWS_ACCESS_KEY_ID:()=>Z2,AWS_CONFIG_FILE:()=>X2,AWS_DEFAULT_REGION:()=>V2,AWS_ENDPOINT_URL:()=>eX,AWS_ENDPOINT_URL_BEDROCK:()=>tX,AWS_ENDPOINT_URL_BEDROCK_RUNTIME:()=>nX,AWS_ENDPOINT_URL_STS:()=>oX,AWS_PROFILE:()=>Y2,AWS_REGION:()=>$2,AWS_SECRET_ACCESS_KEY:()=>q2,AWS_SESSION_TOKEN:()=>Q2,AWS_SHARED_CREDENTIALS_FILE:()=>J2,AWS_USE_FIPS_ENDPOINT:()=>rX,CACERT_UPDATES:()=>NX,CCR_AGENT_PROXY_CA_CERT_B64:()=>HX,CCR_AGENT_PROXY_CA_WATCH_ENABLED:()=>FX,CCR_AGENT_PROXY_CONNECTION_LIMITS_DISABLED:()=>PX,CCR_AGENT_PROXY_ENABLED:()=>OX,CCR_AGENT_PROXY_FRAME_HOSTS:()=>zX,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>DX,CCR_AGENT_PROXY_JAVA_STORE_DIRECT_DISABLED:()=>xX,CCR_AGENT_PROXY_MAX_BUSY_TUNNELS:()=>wX,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>UX,CCR_AGENT_PROXY_NSS_RECORDS_DISABLED:()=>BX,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>LX,CCR_AGENT_PROXY_RELAY_MODE:()=>RX,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>IX,CCR_ENABLE_BUNDLE:()=>GX,CCR_FORCE_BUNDLE:()=>WX,CCR_ON_BRANCH_DEFAULT_GUARD:()=>KX,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>CX,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>AX,CLAUDE_CODE_AGENT_PROXY_GIT_HOSTS:()=>bX,CLAUDE_CODE_API_BASE_URL:()=>w2,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>hX,CLAUDE_CODE_FEATURE_FLAGS_REFRESH_INTERVAL_MS:()=>yX,CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS:()=>EX,CLAUDE_CODE_GB_BASE_URL:()=>SX,CLAUDE_CODE_HOST_GATEWAY_LINEAGE:()=>lX,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>aX,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>dX,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>cX,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>$X,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>R2,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>T2,CLAUDE_CODE_USE_BEDROCK:()=>A2,CLAUDE_CODE_USE_FOUNDRY:()=>b2,CLAUDE_CODE_USE_GATEWAY:()=>uX,CLAUDE_CODE_USE_MANTLE:()=>D2,CLAUDE_CODE_USE_VERTEX:()=>C2,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>pX,CLAUDE_GATEWAY_DRAIN_TIMEOUT_MS:()=>_X,CLAUDE_GATEWAY_LOG_FORMAT:()=>gX,CLAUDE_GATEWAY_LOG_LEVEL:()=>mX,CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY:()=>fX,CLOUD_ML_REGION:()=>W2,DPKG_ADMINDIR:()=>kX,DPKG_MAINTSCRIPT_PACKAGE:()=>vX,DPKG_ROOT:()=>MX,SELF_HOSTED_RUNNER_AGENT_PROXY_URL:()=>TX,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>I2});var Na={};K(Na,{default:()=>Xs});import{resolve as Xte}from"path";import{execFile as $A}from"child_process";function KA(i){if(i===void 0)return!1;if(/^[A-Za-z]:[\\/](?![\\/])/.test(i))return!0;return process.platform!=="win32"&&i.startsWith("/")&&!i.startsWith("//")}function fp(i){return KA(i)?i:"C:\\Windows"}import{accessSync as VA,closeSync as YA,constants as XA,openSync as JA,readSync as ZA}from"fs";import{userInfo as jA}from"os";var Ps=["remote_cowork","remote_cowork_trigger"];var mp="com.anthropic.claudecode",Hi="HKLM\\SOFTWARE\\Policies\\ClaudeCode",Fi="HKCU\\SOFTWARE\\Policies\\ClaudeCode",xs="Settings",dc="/usr/bin/plutil",gp=["-convert","json","-o","-","--"],_p=["-lint","-s","--"],Bi=5000,hp=60000,zi=2097152,No="/mnt/c/Windows/System32/reg.exe",Ep="unable to find the specified registry key or value",yn="/mnt/c/Program Files/ClaudeCode",cc=a({isCoworkCloud:void 0},(i)=>{i.isCoworkCloud=void 0});function uc(){if(cc.isCoworkCloud===void 0){let i=process.env.CLAUDE_CODE_ENTRYPOINT;cc.isCoworkCloud=Ps.some((c)=>c===i)}return cc.isCoworkCloud}function Dr(){if(process.platform!=="linux")return!1;let i=uc();if(process.env.WSL_DISTRO_NAME&&!i)return!0;try{let c=Qn("fs").readFileSync("/proc/version","utf8").toLowerCase();return ve(c)}catch{return!1}}var pc="per-user managed preferences";function Sp(){let i="";try{i=jA().username}catch{}let c=[];if(i)c.push({path:`/Library/Managed Preferences/${i}/${mp}.plist`,label:pc});return c.push({path:`/Library/Managed Preferences/${mp}.plist`,label:"device-level managed preferences"}),c}var bp=new Set(["EAGAIN","EMFILE","ENFILE","ENOMEM"]);class Rp{promise=null;start(){if(this.promise)return;this.promise=Wi()}reset(){this.promise=null}}var qA=new Rp;function QA(i){if(!i)return{status:"ok",exitCode:0,errno:null,signal:null};let c=i,T=typeof c.signal==="string"&&c.signal?c.signal:null;if(typeof c.code==="string")return{status:"spawn_error",exitCode:null,errno:c.code,signal:null};if(c.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:T};if(T)return{status:"killed",exitCode:null,errno:null,signal:T};return{status:"exited",exitCode:typeof c.code==="number"?c.code:null,errno:null,signal:null}}function fc(i,c,T){let D=Date.now();return new Promise((w)=>{try{$A(i,c,{encoding:"utf-8",timeout:Bi,windowsHide:!0,...T!==void 0&&{maxBuffer:T}},(x,U,B)=>{w({stdout:U??"",stderr:B??"",...QA(x),durationMs:Date.now()-D})})}catch(x){let U=x.code;w({stdout:"",stderr:"",status:"spawn_error",exitCode:null,errno:typeof U==="string"?U:null,signal:null,durationMs:Date.now()-D})}})}function yp(i){return{status:i.status,exitCode:i.exitCode,errno:i.errno,signal:i.signal,durationMs:i.durationMs,answered:i.status==="ok"||i.status==="exited"&&i.exitCode===1&&i.stderr.includes(Ep)}}function Gi(i){return!i.answered&&!(i.status==="exited"&&i.exitCode===1)&&!(i.status==="spawn_error"&&(i.errno===null||!bp.has(i.errno)))}function Op(i){return i.status==="ok"||i.status==="exited"&&i.exitCode!==null}function Tp(i){return i.status==="spawn_error"&&i.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function Ap(i){if(Tp(i))return{unreadReason:"plutil's output exceeded the size limit",unreadCause:"oversize"};switch(i.status){case"timeout":return{unreadReason:`plutil timed out after ${Bi/1000} seconds`,unreadCause:"timeout"};case"killed":return{unreadReason:"plutil was stopped by a signal",unreadCause:"killed"};case"spawn_error":return{unreadReason:"plutil could not be run",unreadCause:i.errno!==null&&bp.has(i.errno)?"spawn_busy":"spawn_error"};case"ok":case"exited":return{unreadReason:"plutil did not finish"}}}function eC(i){let c;try{return c=JA(i,"r"),ZA(c,Buffer.alloc(1),0,1,0),null}catch(T){return{code:T&&typeof T==="object"&&"code"in T?T.code:void 0,message:T instanceof Error?T.message:String(T)}}finally{if(c!==void 0)try{YA(c)}catch{}}}function Wi(i=!1){return(async()=>{if(process.platform==="darwin"){let c=Sp(),D=(await Promise.all(c.map(async({path:x,...U})=>{try{VA(x,XA.R_OK)}catch(fe){let Ce=fe&&typeof fe==="object"&&"code"in fe?fe.code:void 0;if(Ce==="ENOENT"||Ce==="ENOTDIR")return null;return{stdout:null,unreadReason:fe instanceof Error?fe.message:String(fe),...typeof Ce==="string"&&{unreadErrno:Ce},...U}}let B=await fc(dc,[...gp,x],zi);if(!Op(B))return{stdout:null,...Ap(B),...U};if(B.status==="ok")return{stdout:B.stdout,...U};let z=await fc(dc,[..._p,x]);if(!Op(z)){let{unreadReason:fe,unreadCause:Ce}=Ap(z),xe=Ce==="timeout"||Ce==="killed"||Ce==="spawn_busy"?"lint_unfinished":Ce;return{stdout:null,unreadReason:`plutil rejected the conversion, and in the check that follows ${fe}`,unreadCause:xe,...U}}if(z.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",unreadCause:"unconvertible",...U};let le=eC(x);if(le!==null){if(le.code==="ENOENT"||le.code==="ENOTDIR")return null;return{stdout:null,unreadReason:le.message,...typeof le.code==="string"&&{unreadErrno:le.code},...U}}return{stdout:"",...U}}))).filter((x)=>x!==null),w=D.findIndex((x)=>x.stdout!==null);return{plistStdouts:w===-1?D:D.slice(0,w+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let c=`${fp(process.env.SYSTEMROOT)}\\System32\\reg.exe`;return Cp(c,i)}if(Dr())return Cp(No,i);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function Cp(i,c){let T=(U)=>fc(i,["query",U,"/v",xs],zi),[D,w]=await Promise.all([T(Hi),T(Fi)]),x=yp(D);return{plistStdouts:null,hklmStdout:D.status==="ok"?D.stdout:null,...Tp(D)&&{hklmUnreadReason:`the value exceeds ${zi/1048576} MiB`},hkcuStdout:w.status==="ok"?w.stdout:null,outcomes:{hklm:x,hkcu:yp(w)}}}function Dp(){return qA.promise}function tC(i,c){var T=-1,D=i==null?0:i.length,w=Array(D);while(++T<D)w[T]=c(i[T],T,i);return w}var Lr=tC;function nC(){this.__data__=[],this.size=0}var Lp=nC;function oC(i,c){return i===c||i!==i&&c!==c}var go=oC;function rC(i,c){var T=i.length;while(T--)if(go(i[T][0],c))return T;return-1}var vo=rC;var sC=Array.prototype,iC=sC.splice;function aC(i){var c=this.__data__,T=vo(c,i);if(T<0)return!1;var D=c.length-1;if(T==D)c.pop();else iC.call(c,T,1);return--this.size,!0}var Ip=aC;function lC(i){var c=this.__data__,T=vo(c,i);return T<0?void 0:c[T][1]}var wp=lC;function cC(i){return vo(this.__data__,i)>-1}var Pp=cC;function dC(i,c){var T=this.__data__,D=vo(T,i);if(D<0)++this.size,T.push([i,c]);else T[D][1]=c;return this}var xp=dC;function Ir(i){var c=-1,T=i==null?0:i.length;this.clear();while(++c<T){var D=i[c];this.set(D[0],D[1])}}Ir.prototype.clear=Lp;Ir.prototype.delete=Ip;Ir.prototype.get=wp;Ir.prototype.has=Pp;Ir.prototype.set=xp;var ko=Ir;function uC(){this.__data__=new ko,this.size=0}var Np=uC;function pC(i){var c=this.__data__,T=c.delete(i);return this.size=c.size,T}var vp=pC;function fC(i){return this.__data__.get(i)}var kp=fC;function mC(i){return this.__data__.has(i)}var Mp=mC;var gC=typeof global=="object"&&global&&global.Object===Object&&global,Ki=gC;var _C=typeof self=="object"&&self&&self.Object===Object&&self,hC=Ki||_C||Function("return this")(),en=hC;var EC=en.Symbol,sn=EC;var Up=Object.prototype,{hasOwnProperty:SC,toString:yC}=Up,Ns=sn?sn.toStringTag:void 0;function OC(i){var c=SC.call(i,Ns),T=i[Ns];try{i[Ns]=void 0;var D=!0}catch(x){}var w=yC.call(i);if(D)if(c)i[Ns]=T;else delete i[Ns];return w}var Hp=OC;var AC=Object.prototype,CC=AC.toString;function bC(i){return CC.call(i)}var Fp=bC;var RC="[object Null]",TC="[object Undefined]",Bp=sn?sn.toStringTag:void 0;function DC(i){if(i==null)return i===void 0?TC:RC;return Bp&&Bp in Object(i)?Hp(i):Fp(i)}var Gn=DC;function LC(i){var c=typeof i;return i!=null&&(c=="object"||c=="function")}var Zt=LC;var IC="[object AsyncFunction]",wC="[object Function]",PC="[object GeneratorFunction]",xC="[object Proxy]";function NC(i){if(!Zt(i))return!1;var c=Gn(i);return c==wC||c==PC||c==IC||c==xC}var wr=NC;var vC=en["__core-js_shared__"],ji=vC;var zp=function(){var i=/[^.]+$/.exec(ji&&ji.keys&&ji.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function kC(i){return!!zp&&zp in i}var Gp=kC;var MC=Function.prototype,UC=MC.toString;function HC(i){if(i!=null){try{return UC.call(i)}catch(c){}try{return i+""}catch(c){}}return""}var Ro=HC;var FC=/[\\^$.*+?()[\]{}|]/g,BC=/^\[object .+?Constructor\]$/,zC=Function.prototype,GC=Object.prototype,WC=zC.toString,KC=GC.hasOwnProperty,jC=RegExp("^"+WC.call(KC).replace(FC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $C(i){if(!Zt(i)||Gp(i))return!1;var c=wr(i)?jC:BC;return c.test(Ro(i))}var Wp=$C;function VC(i,c){return i==null?void 0:i[c]}var Kp=VC;function YC(i,c){var T=Kp(i,c);return Wp(T)?T:void 0}var Fn=YC;var XC=Fn(en,"Map"),Mo=XC;var JC=Fn(Object,"create"),To=JC;function ZC(){this.__data__=To?To(null):{},this.size=0}var jp=ZC;function qC(i){var c=this.has(i)&&delete this.__data__[i];return this.size-=c?1:0,c}var $p=qC;var QC="__lodash_hash_undefined__",eb=Object.prototype,tb=eb.hasOwnProperty;function nb(i){var c=this.__data__;if(To){var T=c[i];return T===QC?void 0:T}return tb.call(c,i)?c[i]:void 0}var Vp=nb;var ob=Object.prototype,rb=ob.hasOwnProperty;function sb(i){var c=this.__data__;return To?c[i]!==void 0:rb.call(c,i)}var Yp=sb;var ib="__lodash_hash_undefined__";function ab(i,c){var T=this.__data__;return this.size+=this.has(i)?0:1,T[i]=To&&c===void 0?ib:c,this}var Xp=ab;function Pr(i){var c=-1,T=i==null?0:i.length;this.clear();while(++c<T){var D=i[c];this.set(D[0],D[1])}}Pr.prototype.clear=jp;Pr.prototype.delete=$p;Pr.prototype.get=Vp;Pr.prototype.has=Yp;Pr.prototype.set=Xp;var mc=Pr;function lb(){this.size=0,this.__data__={hash:new mc,map:new(Mo||ko),string:new mc}}var Jp=lb;function cb(i){var c=typeof i;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?i!=="__proto__":i===null}var Zp=cb;function db(i,c){var T=i.__data__;return Zp(c)?T[typeof c=="string"?"string":"hash"]:T.map}var Uo=db;function ub(i){var c=Uo(this,i).delete(i);return this.size-=c?1:0,c}var qp=ub;function pb(i){return Uo(this,i).get(i)}var Qp=pb;function fb(i){return Uo(this,i).has(i)}var ef=fb;function mb(i,c){var T=Uo(this,i),D=T.size;return T.set(i,c),this.size+=T.size==D?0:1,this}var tf=mb;function xr(i){var c=-1,T=i==null?0:i.length;this.clear();while(++c<T){var D=i[c];this.set(D[0],D[1])}}xr.prototype.clear=Jp;xr.prototype.delete=qp;xr.prototype.get=Qp;xr.prototype.has=ef;xr.prototype.set=tf;var or=xr;var gb=200;function _b(i,c){var T=this.__data__;if(T instanceof ko){var D=T.__data__;if(!Mo||D.length<gb-1)return D.push([i,c]),this.size=++T.size,this;T=this.__data__=new or(D)}return T.set(i,c),this.size=T.size,this}var nf=_b;function Nr(i){var c=this.__data__=new ko(i);this.size=c.size}Nr.prototype.clear=Np;Nr.prototype.delete=vp;Nr.prototype.get=kp;Nr.prototype.has=Mp;Nr.prototype.set=nf;var _o=Nr;var hb="__lodash_hash_undefined__";function Eb(i){return this.__data__.set(i,hb),this}var of=Eb;function Sb(i){return this.__data__.has(i)}var rf=Sb;function $i(i){var c=-1,T=i==null?0:i.length;this.__data__=new or;while(++c<T)this.add(i[c])}$i.prototype.add=$i.prototype.push=of;$i.prototype.has=rf;var Vi=$i;function yb(i,c){var T=-1,D=i==null?0:i.length;while(++T<D)if(c(i[T],T,i))return!0;return!1}var sf=yb;function Ob(i,c){return i.has(c)}var Yi=Ob;var Ab=1,Cb=2;function bb(i,c,T,D,w,x){var U=T&Ab,B=i.length,z=c.length;if(B!=z&&!(U&&z>B))return!1;var le=x.get(i),fe=x.get(c);if(le&&fe)return le==c&&fe==i;var Ce=-1,Re=!0,xe=T&Cb?new Vi:void 0;x.set(i,c),x.set(c,i);while(++Ce<B){var Te=i[Ce],Ke=c[Ce];if(D)var Le=U?D(Ke,Te,Ce,c,i,x):D(Te,Ke,Ce,i,c,x);if(Le!==void 0){if(Le)continue;Re=!1;break}if(xe){if(!sf(c,function(Pe,nt){if(!Yi(xe,nt)&&(Te===Pe||w(Te,Pe,T,D,x)))return xe.push(nt)})){Re=!1;break}}else if(!(Te===Ke||w(Te,Ke,T,D,x))){Re=!1;break}}return x.delete(i),x.delete(c),Re}var Xi=bb;var Rb=en.Uint8Array,vr=Rb;function Tb(i){var c=-1,T=Array(i.size);return i.forEach(function(D,w){T[++c]=[w,D]}),T}var af=Tb;function Db(i){var c=-1,T=Array(i.size);return i.forEach(function(D){T[++c]=D}),T}var kr=Db;var Lb=1,Ib=2,wb="[object Boolean]",Pb="[object Date]",xb="[object Error]",Nb="[object Map]",vb="[object Number]",kb="[object RegExp]",Mb="[object Set]",Ub="[object String]",Hb="[object Symbol]",Fb="[object ArrayBuffer]",Bb="[object DataView]",lf=sn?sn.prototype:void 0,gc=lf?lf.valueOf:void 0;function zb(i,c,T,D,w,x,U){switch(T){case Bb:if(i.byteLength!=c.byteLength||i.byteOffset!=c.byteOffset)return!1;i=i.buffer,c=c.buffer;case Fb:if(i.byteLength!=c.byteLength||!x(new vr(i),new vr(c)))return!1;return!0;case wb:case Pb:case vb:return go(+i,+c);case xb:return i.name==c.name&&i.message==c.message;case kb:case Ub:return i==c+"";case Nb:var B=af;case Mb:var z=D&Lb;if(B||(B=kr),i.size!=c.size&&!z)return!1;var le=U.get(i);if(le)return le==c;D|=Ib,U.set(i,c);var fe=Xi(B(i),B(c),D,w,x,U);return U.delete(i),fe;case Hb:if(gc)return gc.call(i)==gc.call(c)}return!1}var cf=zb;function Gb(i,c){var T=-1,D=c.length,w=i.length;while(++T<D)i[w+T]=c[T];return i}var Mr=Gb;var Wb=Array.isArray,Nt=Wb;function Kb(i,c,T){var D=c(i);return Nt(i)?D:Mr(D,T(i))}var Ji=Kb;function jb(i,c){var T=-1,D=i==null?0:i.length,w=0,x=[];while(++T<D){var U=i[T];if(c(U,T,i))x[w++]=U}return x}var df=jb;function $b(){return[]}var Zi=$b;var Vb=Object.prototype,Yb=Vb.propertyIsEnumerable,uf=Object.getOwnPropertySymbols,Xb=!uf?Zi:function(i){if(i==null)return[];return i=Object(i),df(uf(i),function(c){return Yb.call(i,c)})},Ur=Xb;function Jb(i,c){var T=-1,D=Array(i);while(++T<i)D[T]=c(T);return D}var pf=Jb;function Zb(i){return i!=null&&typeof i=="object"}var on=Zb;var qb="[object Arguments]";function Qb(i){return on(i)&&Gn(i)==qb}var _c=Qb;var ff=Object.prototype,{hasOwnProperty:eR,propertyIsEnumerable:tR}=ff,nR=_c(function(){return arguments}())?_c:function(i){return on(i)&&eR.call(i,"callee")&&!tR.call(i,"callee")},ro=nR;function oR(){return!1}var mf=oR;var hf=typeof Qi=="object"&&Qi&&!Qi.nodeType&&Qi,gf=hf&&typeof qi=="object"&&qi&&!qi.nodeType&&qi,rR=gf&&gf.exports===hf,_f=rR?en.Buffer:void 0,sR=_f?_f.isBuffer:void 0,iR=sR||mf,eo=iR;var aR=9007199254740991,lR=/^(?:0|[1-9]\d*)$/;function cR(i,c){var T=typeof i;return c=c==null?aR:c,!!c&&(T=="number"||T!="symbol"&&lR.test(i))&&(i>-1&&i%1==0&&i<c)}var Ho=cR;var dR=9007199254740991;function uR(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=dR}var Hr=uR;var pR="[object Arguments]",fR="[object Array]",mR="[object Boolean]",gR="[object Date]",_R="[object Error]",hR="[object Function]",ER="[object Map]",SR="[object Number]",yR="[object Object]",OR="[object RegExp]",AR="[object Set]",CR="[object String]",bR="[object WeakMap]",RR="[object ArrayBuffer]",TR="[object DataView]",DR="[object Float32Array]",LR="[object Float64Array]",IR="[object Int8Array]",wR="[object Int16Array]",PR="[object Int32Array]",xR="[object Uint8Array]",NR="[object Uint8ClampedArray]",vR="[object Uint16Array]",kR="[object Uint32Array]",Ht={};Ht[DR]=Ht[LR]=Ht[IR]=Ht[wR]=Ht[PR]=Ht[xR]=Ht[NR]=Ht[vR]=Ht[kR]=!0;Ht[pR]=Ht[fR]=Ht[RR]=Ht[mR]=Ht[TR]=Ht[gR]=Ht[_R]=Ht[hR]=Ht[ER]=Ht[SR]=Ht[yR]=Ht[OR]=Ht[AR]=Ht[CR]=Ht[bR]=!1;function MR(i){return on(i)&&Hr(i.length)&&!!Ht[Gn(i)]}var Ef=MR;function UR(i){return function(c){return i(c)}}var Fr=UR;var Sf=typeof ta=="object"&&ta&&!ta.nodeType&&ta,vs=Sf&&typeof ea=="object"&&ea&&!ea.nodeType&&ea,HR=vs&&vs.exports===Sf,hc=HR&&Ki.process,FR=function(){try{var i=vs&&vs.require&&vs.require("util").types;if(i)return i;return hc&&hc.binding&&hc.binding("util")}catch(c){}}(),ho=FR;var yf=ho&&ho.isTypedArray,BR=yf?Fr(yf):Ef,Fo=BR;var zR=Object.prototype,GR=zR.hasOwnProperty;function WR(i,c){var T=Nt(i),D=!T&&ro(i),w=!T&&!D&&eo(i),x=!T&&!D&&!w&&Fo(i),U=T||D||w||x,B=U?pf(i.length,String):[],z=B.length;for(var le in i)if((c||GR.call(i,le))&&!(U&&(le=="length"||w&&(le=="offset"||le=="parent")||x&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||Ho(le,z))))B.push(le);return B}var na=WR;var KR=Object.prototype;function jR(i){var c=i&&i.constructor,T=typeof c=="function"&&c.prototype||KR;return i===T}var Bo=jR;function $R(i,c){return function(T){return i(c(T))}}var oa=$R;var VR=oa(Object.keys,Object),Of=VR;var YR=Object.prototype,XR=YR.hasOwnProperty;function JR(i){if(!Bo(i))return Of(i);var c=[];for(var T in Object(i))if(XR.call(i,T)&&T!="constructor")c.push(T);return c}var ra=JR;function ZR(i){return i!=null&&Hr(i.length)&&!wr(i)}var to=ZR;function qR(i){return to(i)?na(i):ra(i)}var Eo=qR;function QR(i){return Ji(i,Eo,Ur)}var ks=QR;var eT=1,tT=Object.prototype,nT=tT.hasOwnProperty;function oT(i,c,T,D,w,x){var U=T&eT,B=ks(i),z=B.length,le=ks(c),fe=le.length;if(z!=fe&&!U)return!1;var Ce=z;while(Ce--){var Re=B[Ce];if(!(U?Re in c:nT.call(c,Re)))return!1}var xe=x.get(i),Te=x.get(c);if(xe&&Te)return xe==c&&Te==i;var Ke=!0;x.set(i,c),x.set(c,i);var Le=U;while(++Ce<z){Re=B[Ce];var Pe=i[Re],nt=c[Re];if(D)var et=U?D(nt,Pe,Re,c,i,x):D(Pe,nt,Re,i,c,x);if(!(et===void 0?Pe===nt||w(Pe,nt,T,D,x):et)){Ke=!1;break}Le||(Le=Re=="constructor")}if(Ke&&!Le){var rt=i.constructor,At=c.constructor;if(rt!=At&&(("constructor"in i)&&("constructor"in c))&&!(typeof rt=="function"&&rt instanceof rt&&typeof At=="function"&&At instanceof At))Ke=!1}return x.delete(i),x.delete(c),Ke}var Af=oT;var rT=Fn(en,"DataView"),sa=rT;var sT=Fn(en,"Promise"),ia=sT;var iT=Fn(en,"Set"),zo=iT;var aT=Fn(en,"WeakMap"),aa=aT;var Cf="[object Map]",lT="[object Object]",bf="[object Promise]",Rf="[object Set]",Tf="[object WeakMap]",Df="[object DataView]",cT=Ro(sa),dT=Ro(Mo),uT=Ro(ia),pT=Ro(zo),fT=Ro(aa),rr=Gn;if(sa&&rr(new sa(new ArrayBuffer(1)))!=Df||Mo&&rr(new Mo)!=Cf||ia&&rr(ia.resolve())!=bf||zo&&rr(new zo)!=Rf||aa&&rr(new aa)!=Tf)rr=function(i){var c=Gn(i),T=c==lT?i.constructor:void 0,D=T?Ro(T):"";if(D)switch(D){case cT:return Df;case dT:return Cf;case uT:return bf;case pT:return Rf;case fT:return Tf}return c};var so=rr;var mT=1,Lf="[object Arguments]",If="[object Array]",la="[object Object]",gT=Object.prototype,wf=gT.hasOwnProperty;function _T(i,c,T,D,w,x){var U=Nt(i),B=Nt(c),z=U?If:so(i),le=B?If:so(c);z=z==Lf?la:z,le=le==Lf?la:le;var fe=z==la,Ce=le==la,Re=z==le;if(Re&&eo(i)){if(!eo(c))return!1;U=!0,fe=!1}if(Re&&!fe)return x||(x=new _o),U||Fo(i)?Xi(i,c,T,D,w,x):cf(i,c,z,T,D,w,x);if(!(T&mT)){var xe=fe&&wf.call(i,"__wrapped__"),Te=Ce&&wf.call(c,"__wrapped__");if(xe||Te){var Ke=xe?i.value():i,Le=Te?c.value():c;return x||(x=new _o),w(Ke,Le,T,D,x)}}if(!Re)return!1;return x||(x=new _o),Af(i,c,T,D,w,x)}var Pf=_T;function xf(i,c,T,D,w){if(i===c)return!0;if(i==null||c==null||!on(i)&&!on(c))return i!==i&&c!==c;return Pf(i,c,T,D,xf,w)}var ca=xf;var hT=1,ET=2;function ST(i,c,T,D){var w=T.length,x=w,U=!D;if(i==null)return!x;i=Object(i);while(w--){var B=T[w];if(U&&B[2]?B[1]!==i[B[0]]:!(B[0]in i))return!1}while(++w<x){B=T[w];var z=B[0],le=i[z],fe=B[1];if(U&&B[2]){if(le===void 0&&!(z in i))return!1}else{var Ce=new _o;if(D)var Re=D(le,fe,z,i,c,Ce);if(!(Re===void 0?ca(fe,le,hT|ET,D,Ce):Re))return!1}}return!0}var Nf=ST;function yT(i){return i===i&&!Zt(i)}var da=yT;function OT(i){var c=Eo(i),T=c.length;while(T--){var D=c[T],w=i[D];c[T]=[D,w,da(w)]}return c}var vf=OT;function AT(i,c){return function(T){if(T==null)return!1;return T[i]===c&&(c!==void 0||(i in Object(T)))}}var ua=AT;function CT(i){var c=vf(i);if(c.length==1&&c[0][2])return ua(c[0][0],c[0][1]);return function(T){return T===i||Nf(T,i,c)}}var kf=CT;var bT="[object Symbol]";function RT(i){return typeof i=="symbol"||on(i)&&Gn(i)==bT}var Br=RT;var TT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,DT=/^\w*$/;function LT(i,c){if(Nt(i))return!1;var T=typeof i;if(T=="number"||T=="symbol"||T=="boolean"||i==null||Br(i))return!0;return DT.test(i)||!TT.test(i)||c!=null&&i in Object(c)}var zr=LT;var IT="Expected a function";function Ec(i,c){if(typeof i!="function"||c!=null&&typeof c!="function")throw TypeError(IT);var T=function(){var D=arguments,w=c?c.apply(this,D):D[0],x=T.cache;if(x.has(w))return x.get(w);var U=i.apply(this,D);return T.cache=x.set(w,U)||x,U};return T.cache=new(Ec.Cache||or),T}Ec.Cache=or;var Mf=Ec;var wT=500;function PT(i){var c=Mf(i,function(D){if(T.size===wT)T.clear();return D}),T=c.cache;return c}var Uf=PT;var xT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,NT=/\\(\\)?/g,vT=Uf(function(i){var c=[];if(i.charCodeAt(0)===46)c.push("");return i.replace(xT,function(T,D,w,x){c.push(w?x.replace(NT,"$1"):D||T)}),c}),Hf=vT;var kT=1/0,Ff=sn?sn.prototype:void 0,Bf=Ff?Ff.toString:void 0;function zf(i){if(typeof i=="string")return i;if(Nt(i))return Lr(i,zf)+"";if(Br(i))return Bf?Bf.call(i):"";var c=i+"";return c=="0"&&1/i==-kT?"-0":c}var Gf=zf;function MT(i){return i==null?"":Gf(i)}var Wf=MT;function UT(i,c){if(Nt(i))return i;return zr(i,c)?[i]:Hf(Wf(i))}var no=UT;var HT=1/0;function FT(i){if(typeof i=="string"||Br(i))return i;var c=i+"";return c=="0"&&1/i==-HT?"-0":c}var Wn=FT;function BT(i,c){c=no(c,i);var T=0,D=c.length;while(i!=null&&T<D)i=i[Wn(c[T++])];return T&&T==D?i:void 0}var Go=BT;function zT(i,c,T){var D=i==null?void 0:Go(i,c);return D===void 0?T:D}var Kf=zT;function GT(i,c){return i!=null&&c in Object(i)}var jf=GT;function WT(i,c,T){c=no(c,i);var D=-1,w=c.length,x=!1;while(++D<w){var U=Wn(c[D]);if(!(x=i!=null&&T(i,U)))break;i=i[U]}if(x||++D!=w)return x;return w=i==null?0:i.length,!!w&&Hr(w)&&Ho(U,w)&&(Nt(i)||ro(i))}var $f=WT;function KT(i,c){return i!=null&&$f(i,c,jf)}var pa=KT;var jT=1,$T=2;function VT(i,c){if(zr(i)&&da(c))return ua(Wn(i),c);return function(T){var D=Kf(T,i);return D===void 0&&D===c?pa(T,i):ca(c,D,jT|$T)}}var Vf=VT;function YT(i){return i}var Gr=YT;function XT(i){return function(c){return c==null?void 0:c[i]}}var Yf=XT;function JT(i){return function(c){return Go(c,i)}}var Xf=JT;function ZT(i){return zr(i)?Yf(Wn(i)):Xf(i)}var Jf=ZT;function qT(i){if(typeof i=="function")return i;if(i==null)return Gr;if(typeof i=="object")return Nt(i)?Vf(i[0],i[1]):kf(i);return Jf(i)}var So=qT;var QT=function(){try{var i=Fn(Object,"defineProperty");return i({},"",{}),i}catch(c){}}(),Wr=QT;function eD(i,c,T){if(c=="__proto__"&&Wr)Wr(i,c,{configurable:!0,enumerable:!0,value:T,writable:!0});else i[c]=T}var Wo=eD;var tD=Object.prototype,nD=tD.hasOwnProperty;function oD(i,c,T){var D=i[c];if(!(nD.call(i,c)&&go(D,T))||T===void 0&&!(c in i))Wo(i,c,T)}var Kr=oD;function rD(i,c,T,D){if(!Zt(i))return i;c=no(c,i);var w=-1,x=c.length,U=x-1,B=i;while(B!=null&&++w<x){var z=Wn(c[w]),le=T;if(z==="__proto__"||z==="constructor"||z==="prototype")return i;if(w!=U){var fe=B[z];if(le=D?D(fe,z,B):void 0,le===void 0)le=Zt(fe)?fe:Ho(c[w+1])?[]:{}}Kr(B,z,le),B=B[z]}return i}var Zf=rD;function sD(i,c,T){var D=-1,w=c.length,x={};while(++D<w){var U=c[D],B=Go(i,U);if(T(B,U))Zf(x,no(U,i),B)}return x}var fa=sD;var iD=oa(Object.getPrototypeOf,Object),jr=iD;var aD=Object.getOwnPropertySymbols,lD=!aD?Zi:function(i){var c=[];while(i)Mr(c,Ur(i)),i=jr(i);return c},ma=lD;function cD(i){var c=[];if(i!=null)for(var T in Object(i))c.push(T);return c}var qf=cD;var dD=Object.prototype,uD=dD.hasOwnProperty;function pD(i){if(!Zt(i))return qf(i);var c=Bo(i),T=[];for(var D in i)if(!(D=="constructor"&&(c||!uD.call(i,D))))T.push(D);return T}var Qf=pD;function fD(i){return to(i)?na(i,!0):Qf(i)}var yo=fD;function mD(i){return Ji(i,yo,ma)}var $r=mD;function gD(i,c){if(i==null)return{};var T=Lr($r(i),function(D){return[D]});return c=So(c),fa(i,T,function(D,w){return c(D,w[0])})}var Vr=gD;import{lstat as Tte}from"fs/promises";import{dirname as Dte,join as Cr}from"path";function Sc(){return!1}function ga(i){return!1}import{dirname as QX}from"path";import{AsyncLocalStorage as hD}from"async_hooks";var ED=new hD;function em(){return ED.getStore()!==void 0}var rce=new s(()=>new Set),sce=new s(()=>({hasEntered:!1}));function sr(i){return{parse:(c)=>i(yD(c))}}function SD(i){let c=i?.trim();return c?c:void 0}function yD(i){return i===void 0?void 0:String(i)}var OD=sr(SD),AD=sr((i)=>i),CD=sr((i)=>d(i)),bD=sr((i)=>{if(d(i))return!0;if(Q(i))return!1;return}),RD=nm();function tm(i){if(typeof i==="boolean")return i?"1":"0";return String(i)}var I={str:()=>OD,rawStr:()=>AD,bool:()=>CD,triBool:()=>bD,int:(i)=>i?nm(i):RD,names:(i)=>sr((c)=>{let T=new Set;for(let D of c?.split(",")??[]){let w=D.trim();if(w.length>0)T.add(w);if(T.size===i)break}return T.size>0?Object.freeze([...T]):void 0}),enum:(i)=>sr((c)=>c!==void 0&&i.includes(c.trim())?c.trim():void 0)};function nm(i){return sr((c)=>{if(c===void 0)return;if(i?.digitsOnly&&!/^[+-]?\d+$/.test(c.trim()))return;if(i?.wholeValue&&!/^[+-]?\d+$/.test(c.trim())&&$t(c.trim())===void 0)return;let T=Ne(c);if(!Number.isFinite(T))return;if(i?.min!==void 0&&T<i.min)return;if(i?.max!==void 0&&T>i.max)return;return T})}var TD=I.str(),DD=I.str(),LD=I.str(),ID=I.str(),wD=I.str(),PD=I.str(),xD=I.str(),ND=I.str(),vD=I.str(),kD=I.str(),MD=I.str(),UD=I.str(),HD=I.str(),FD=I.str(),BD=I.str(),zD=I.str(),GD=I.str(),WD=I.str(),KD=I.str(),jD=I.str(),$D=I.str(),VD=I.str(),YD=I.str(),XD=I.str(),JD=I.str(),ZD=I.str(),qD=I.str(),QD=I.str(),eL=I.bool(),tL=I.bool(),nL=I.str(),oL=I.bool(),rL=I.bool(),sL=I.bool(),iL=I.bool(),aL=I.int({min:1}),lL=I.str(),cL=I.str(),dL=I.str(),uL=I.str(),pL=I.bool(),fL=I.bool(),mL=I.str(),gL=I.str(),_L=I.str(),hL=I.int({min:0}),EL=I.int({min:0}),SL=I.int(),yL=I.bool(),OL=I.int(),AL=I.bool(),CL=I.bool(),bL=I.bool(),RL=I.bool(),TL=I.bool(),DL=I.bool(),LL=I.bool(),IL=I.int({min:1,max:2147483647}),wL=I.str(),PL=I.str(),xL=I.str(),NL=I.str(),vL=I.str(),kL=I.str(),ML=I.str(),UL=I.str(),HL=I.str(),FL=I.str(),BL=I.str();var zL=I.bool(),GL=I.str(),WL=I.str(),KL=I.str(),jL=I.bool(),$L=I.str(),VL=I.bool(),YL=I.bool(),XL=I.bool(),JL=I.str(),ZL=I.int(),qL=I.str(),QL=I.int(),eI=I.str(),tI=I.str(),nI=I.str(),oI=I.bool(),rI=I.bool(),sI=I.bool(),iI=I.bool(),aI=I.int(),lI=I.int(),cI=I.int(),dI=I.int({min:1}),uI=I.int({min:1}),pI=I.bool(),fI=I.bool(),mI=I.str(),gI=I.str(),_I=I.str(),hI=I.str(),EI=I.str(),SI=I.str(),yI=I.str(),OI=I.str(),AI=I.str(),CI=I.str(),bI=I.str(),RI=I.str(),TI=I.str(),DI=I.str(),LI=I.str(),II=I.str(),wI=I.str(),PI=I.str(),xI=I.str(),NI=I.str(),vI=I.int(),kI=I.int(),MI=I.int(),UI=I.str(),HI=I.bool(),FI=I.int({min:0}),BI=I.int({min:0}),zI=I.int({min:0}),GI=I.int({min:1,digitsOnly:!0}),WI=I.bool(),KI=I.triBool(),jI=I.bool(),$I=I.bool(),VI=I.bool(),YI=I.bool(),XI=I.str(),JI=I.str(),ZI=I.str(),qI=I.str(),QI=I.str(),ew=I.str(),tw=I.str(),nw=I.str(),ow=I.str();import{constants as iw}from"fs";import{access as Ac,readdir as aw,readFile as lw,readlink as cw}from"fs/promises";import{homedir as dw}from"os";import{basename as uw,delimiter as pw,dirname as fw,join as _a,resolve as pm}from"path";function om(i){return!i.isDirectory()&&!i.isFile()&&!i.isSymbolicLink()&&!i.isFIFO()&&!i.isSocket()&&!i.isBlockDevice()&&!i.isCharacterDevice()}import{delimiter as Rce,isAbsolute as rw}from"path";function rm(i){if(process.platform!=="win32")return Bun.which(i);return sw(i,G("PATH")??"")}var sm=async(i)=>rm(i),im=rm;function sw(i,c){if(process.platform!=="win32")return Bun.which(i,{PATH:c});if(/[\\/]/.test(i))return rw(i)&&!Y(i)?Bun.which(i,{PATH:c}):null;return fn(i,c)}function Ms(){return process.platform!=="linux"||g()}function am(){if(Ms())return!1;return l().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function lm(){if(Ms())return;try{return l().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function cm(){if(Ms())return!1;return l().existsSync("/.dockerenv")}function mw(){if(g())return{file:dm()};let i=_a(R(),".config.json"),c=dm();try{let T=l().statSync(i);if(T.isFile()&&(T.size>0||(T.mode&146)!==0)){let D;try{D=l().statSync(c)}catch(w){if(_(w))return{file:i,legacy:i};if(t(`Could not look at ${c}: ${r(w)}`,{level:"warn"}),T.size===0)return{file:i,legacy:i}}if(T.size===0&&D!==void 0&&gw(D))return{file:i,legacy:i};if(T.size>0){if(D!==void 0&&(!D.isFile()||D.size===0))return{file:i,legacy:i};try{if(!l().readdirSync(fw(i)).some((x)=>x.name===uw(i)))return{file:c,legacy:i}}catch(w){if(_(w))return{file:c,legacy:i}}if(D===void 0||m()!=="windows"&&D.dev===T.dev&&D.ino===T.ino)return{file:i,legacy:i};return{file:i,unused:c,legacy:i}}}}catch{}return{file:c,legacy:i}}function gw(i){let c=m();return(c==="linux"||c==="wsl")&&i.isFile()&&i.size===0&&(i.mode&146)===0&&i.nlink===1}function dm(){let i=`.claude${Qt()}.json`;return _a(process.env.CLAUDE_CONFIG_DIR||dw(),i)}async function _w(){return null}async function Yr(i){try{return!!await sm(i)}catch{return!1}}async function hw(){let i=[];if(await Yr("npm"))i.push("npm");if(await Yr("yarn"))i.push("yarn");if(await Yr("pnpm"))i.push("pnpm");return i}async function Ew(){let i=[];if(await Yr("bun"))i.push("bun");if(await Yr("deno"))i.push("deno");if(await Yr("node"))i.push("node");return i}var um=["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"],Sw=1000;async function yw(i){try{return/appinstaller/i.test(await cw(i))}catch{return!1}}async function Ow(i){if(i===""||Y(i)||We(i))return!1;return!await Yt(pm(i))}async function Aw(i,c){let T=m()==="windows",D=new Set(i),w=T?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],x=f((process.env.PATH??"").split(pw).map((U)=>U.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(x.map(async(U)=>{if(!await Ow(U))return;let B;try{B=await aw(U,{withFileTypes:!0})}catch{return}let z=T&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(U);for(let le of B){if(le.isDirectory())continue;let fe=le.name;if(T){let Ce=fe.toLowerCase(),Re=Ce.lastIndexOf(".");if(Re<=0||!w.includes(Ce.slice(Re)))continue;fe=Ce.slice(0,Re)}if(!D.has(fe)||c.has(fe))continue;if(T){if(z&&await yw(_a(U,le.name)))continue}else{let Ce=_a(U,le.name);if((le.isSymbolicLink()||om(le))&&await Yt(pm(Ce)))continue;try{await Ac(Ce,iw.X_OK)}catch{continue}}c.add(fe)}}))}async function Cw(){let i=new Set;try{await F(Aw(um,i),Sw,"build tool PATH scan timed out")}catch{}return um.filter((c)=>i.has(c))}function bw(i){try{if(!i.isWslEnvironment())return!1;let c=im("npm");if(c===null)return!1;return c.startsWith("/mnt/c/")}catch(c){return!1}}function Rw(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var fm=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function Tw(i){let c=i.toLowerCase();return c.includes("windsurf")||c.includes("devin.app")||c.includes("devin desktop")||c.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(c)}function Dw(){if(process.env.CURSOR_TRACE_ID)return"cursor";let i=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(i.includes("cursor"))return"cursor";if(Tw(i))return"windsurf";if(i.includes("antigravity"))return"antigravity";let c=process.env.__CFBundleIdentifier?.toLowerCase();if(c?.includes("vscodium"))return"codium";if(c?.includes("windsurf")||c?.includes("devin"))return"windsurf";if(c?.includes("com.google.android.studio"))return"androidstudio";if(c){for(let T of fm)if(c.includes(T))return T}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(gm())return"ssh-session";if(process.env.TERM){let T=process.env.TERM;if(T.includes("alacritty"))return"alacritty";if(T.includes("rxvt"))return"rxvt";if(T.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class mm{sources;globalClaudeFile;unusedGlobalClaudeFile;probedLegacyGlobalConfigFile;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(i){this.sources=i}getGlobalClaudeFile(){if(this.globalClaudeFile===void 0){let{file:i,unused:c,legacy:T}=mw();this.globalClaudeFile=i,this.unusedGlobalClaudeFile=c,this.probedLegacyGlobalConfigFile=T}return this.globalClaudeFile}getUnusedGlobalClaudeFile(){return this.getGlobalClaudeFile(),this.unusedGlobalClaudeFile}getProbedLegacyGlobalConfigFile(){return this.getGlobalClaudeFile(),this.probedLegacyGlobalConfigFile}seedGlobalClaudeFile(i){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=i,"seeded";return this.globalClaudeFile===i?"unchanged":"conflict"}getPackageManagers(){return this.packageManagers??=hw()}getRuntimes(){return this.runtimes??=Ew()}getDetectedBuildTools(){return this.detectedBuildTools??=Cw()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=bw(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=ww(this)}async prime(){if(this.primedWslInteropExists!==void 0||Ms())return;let[i,c,T]=await Promise.all([Ac("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),lw("/sys/hypervisor/uuid",{encoding:"utf8"}).then((D)=>D.trim().toLowerCase(),()=>{return}),Ac("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=i,this.primedHypervisorUuid=c??"",this.primedDockerenvExists=T,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var Lw=new s(()=>new mm({wslInteropExistsSync:am,readHypervisorUuidSync:lm,dockerenvExistsSync:cm}));function Us(){return Lw.of(A().host)}function Iw(){return Us().detectDeploymentEnvironment()}function ww(i){if(d(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(d(process.env.CODER)||process.env.CODER_WORKSPACE_NAME)return"coder";if(d(process.env.DEVPOD)||process.env.DEVPOD_WORKSPACE_UID)return"devpod";if(process.env.DAYTONA_WS_ID)return"daytona";if(d(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(d(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(d(process.env.RENDER))return"render";if(d(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(d(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(i.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(d(process.env.GITHUB_ACTIONS))return"github-actions";if(d(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(d(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";if(i.isDockerenvPresent())return"docker";if(Hs.platform==="darwin")return"unknown-darwin";if(Hs.platform==="linux")return"unknown-linux";if(Hs.platform==="win32")return"unknown-win32";return"unknown"}function gm(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function _m(){return process.env.CLAUDE_CODE_SPAWNED_BY_SERVER!==void 0||process.env.CLAUDE_SSH_DAEMON_CHILD!==void 0||process.env.CLAUDE_SSH_RUN_DIR!==void 0}var Hs={probeInternalNetworkAccess:_w,isCI:d(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:Dw(),isSSH:gm,getPackageManagers(){return Us().getPackageManagers()},getRuntimes(){return Us().getRuntimes()},isRunningWithBun:se,isWslEnvironment(){return Us().isWslEnvironment()},isNpmFromWindowsPath(){return Us().isNpmFromWindowsPath()},isConductor:Rw,detectDeploymentEnvironment:Iw};var Xr=["5m","1h"];var Pw=I.triBool(),xw=I.int({min:0}),Nw=I.int({min:0}),vw=I.int({min:0}),kw=I.triBool(),Mw=I.triBool(),Uw=I.bool(),Hw=I.bool(),Fw=I.str(),Bw=I.bool(),zw=I.str(),Gw=I.str(),Ww=I.triBool(),Kw=I.triBool(),jw=I.enum(["strict","relaxed"]),$w=I.str(),Vw=I.bool(),Yw=I.str(),Xw=I.triBool(),Jw=I.triBool(),Zw=I.triBool(),qw=I.enum(["drop","block","off"]),Qw=I.str(),eP=I.triBool(),tP=I.triBool(),nP=I.triBool(),oP=I.triBool(),rP=I.triBool(),sP=I.triBool(),iP=I.triBool(),aP=I.triBool(),lP=I.triBool(),cP=I.triBool(),dP=I.bool(),uP=I.bool(),pP=I.bool(),fP=I.bool(),mP=I.bool(),gP=I.bool(),_P=I.bool(),hP=I.bool(),EP=I.bool(),SP=I.bool(),yP=I.bool(),OP=I.bool(),AP=I.bool(),CP=I.str(),bP=I.int({min:1,max:10080,digitsOnly:!0}),RP=I.bool(),TP=I.bool(),DP=I.bool(),LP=I.bool(),IP=I.bool(),wP=I.bool(),PP=I.bool(),xP=I.bool(),NP=I.bool(),vP=I.bool(),kP=I.bool(),MP=I.bool(),UP=I.bool(),HP=I.bool(),FP=I.bool(),BP=I.bool(),zP=I.bool(),GP=I.bool(),WP=I.bool(),KP=I.bool(),jP=I.bool(),$P=I.bool(),VP=I.bool(),YP=I.bool(),XP=I.bool(),JP=I.bool(),ZP=I.bool(),qP=I.bool(),QP=I.bool(),ex=I.bool(),tx=I.bool(),nx=I.bool(),ox=I.bool(),rx=I.bool(),sx=I.bool(),ix=I.bool(),ax=I.bool(),lx=I.bool(),cx=I.triBool(),dx=I.bool(),ux=I.bool(),px=I.bool(),fx=I.bool(),mx=I.bool(),gx=I.bool(),_x=I.bool(),hx=I.bool(),Ex=I.enum(["corroborate","immediate","never","recorded"]),Sx=I.triBool(),yx=I.triBool(),Ox=I.triBool(),Ax=I.bool(),Cx=I.bool(),bx=I.bool(),Rx=I.bool(),Tx=I.bool(),Dx=I.bool(),Lx=I.bool(),Ix=I.bool(),wx=I.bool(),Px=I.bool(),xx=I.bool(),Nx=I.bool(),vx=I.bool(),kx=I.bool(),Mx=I.bool(),Ux=I.triBool(),Hx=I.bool(),Fx=I.bool(),Bx=I.bool(),zx=I.bool(),Gx=I.bool(),Wx=I.bool(),Kx=I.bool(),jx=I.bool(),$x=I.bool(),Vx=I.bool(),Yx=I.bool(),Xx=I.bool(),Jx=I.triBool(),Zx=I.bool(),qx=I.bool(),Qx=I.bool(),eN=I.bool(),tN=I.bool(),nN=I.bool(),oN=I.triBool(),rN=I.bool(),sN=I.bool(),iN=I.bool(),aN=I.triBool(),lN=I.bool(),cN=I.bool(),dN=I.bool(),uN=I.triBool(),pN=I.bool(),fN=I.bool(),mN=I.bool(),gN=I.bool(),_N=I.triBool(),hN=I.bool(),EN=I.triBool(),SN=I.bool(),yN=I.bool(),ON=I.str(),AN=I.bool(),CN=I.int({min:1,digitsOnly:!0}),bN=I.triBool(),RN=I.bool(),TN=I.triBool(),DN=I.bool(),LN=I.bool(),IN=I.triBool(),wN=I.bool(),PN=I.bool(),xN=I.triBool(),NN=I.bool(),vN=I.str(),kN=I.bool(),MN=I.bool(),UN=I.bool(),HN=I.enum(["baseline","off"]),FN=I.str(),BN=I.int(),zN=I.str(),GN=I.str(),WN=I.str(),KN=I.triBool(),jN=I.str(),$N=I.triBool(),VN=I.triBool(),YN=I.triBool(),XN=I.bool(),JN=I.bool(),ZN=I.triBool(),qN=I.triBool(),QN=I.str(),ev=I.triBool(),tv=I.triBool(),nv=I.int({min:1}),ov=I.int({min:1,wholeValue:!0}),rv=I.str(),sv=I.triBool(),iv=I.triBool(),av=I.bool(),lv=I.triBool(),cv=I.triBool(),dv=I.triBool(),uv=I.triBool(),pv=I.triBool(),fv=I.triBool(),mv=I.triBool(),gv=I.triBool(),_v=I.triBool(),hv=I.triBool(),Ev=I.triBool(),Sv=I.triBool(),yv=I.triBool(),Ov=I.triBool(),Av=I.int({min:0}),Cv=I.bool(),bv=I.bool(),Rv=I.triBool(),Tv=I.triBool(),Dv=I.triBool(),Lv=I.triBool(),Iv=I.triBool(),wv=I.triBool(),Pv=I.triBool(),xv=I.triBool(),Nv=I.triBool(),vv=I.triBool(),kv=I.triBool(),Mv=I.triBool(),Uv=I.triBool(),Hv=I.triBool(),Fv=I.triBool(),Bv=I.triBool(),zv=I.triBool(),Gv=I.triBool(),Wv=I.triBool(),Kv=I.bool(),jv=I.str(),$v=I.bool(),Vv=I.bool(),Yv=I.bool(),Xv=I.bool(),Jv=I.str(),Zv=I.bool(),qv=I.triBool(),Qv=I.bool(),ek=I.bool(),tk=I.bool(),nk=I.bool(),ok=I.bool(),rk=I.bool(),sk=I.bool(),ik=I.bool(),ak=I.bool(),lk=I.bool(),ck=I.bool(),dk=I.bool(),uk=I.bool(),pk=I.triBool(),fk=I.bool(),mk=I.bool(),gk=I.triBool(),_k=I.bool(),hk=I.bool(),Ek=I.bool(),Sk=I.names(8),yk=I.bool(),Ok=I.bool(),Ak=I.bool(),Ck=I.triBool(),bk=I.bool(),Rk=I.bool(),Tk=I.bool(),Dk=I.bool(),Lk=I.bool(),Ik=I.bool(),wk=I.bool(),Pk=I.triBool(),xk=I.str(),Nk=I.bool(),vk=I.bool(),kk=I.bool(),Mk=I.bool(),Uk=I.triBool(),Hk=I.bool(),Fk=I.triBool(),Bk=I.triBool(),zk=I.bool(),Gk=I.triBool(),Wk=I.triBool(),Kk=I.triBool(),jk=I.bool(),$k=I.bool(),Vk=I.bool(),Yk=I.str(),Xk=I.str(),Jk=I.bool(),Zk=I.bool(),qk=I.bool(),Qk=I.bool(),eM=I.bool(),tM=I.bool(),nM=I.bool(),oM=I.str(),rM=I.str(),sM=I.bool(),iM=I.bool(),aM=I.bool(),lM=I.bool(),cM=I.bool(),dM=I.bool(),uM=I.bool(),pM=I.bool(),fM=I.bool(),mM=I.bool(),gM=I.triBool(),_M=I.bool(),hM=I.bool(),EM=I.bool(),SM=I.triBool(),yM=I.bool(),OM=I.triBool(),AM=I.int({min:1,digitsOnly:!0}),CM=I.int({min:0,digitsOnly:!0}),bM=I.bool(),RM=I.bool(),TM=I.bool(),DM=I.triBool(),LM=I.bool(),IM=I.bool(),wM=I.bool(),PM=I.bool(),xM=I.bool(),NM=I.bool(),vM=I.bool(),kM=I.bool(),MM=I.triBool(),UM=I.triBool(),HM=I.triBool(),FM=I.bool(),BM=I.bool(),zM=I.bool(),GM=I.bool(),WM=I.bool(),KM=I.bool(),jM=I.int({min:1}),$M=I.int({min:1}),VM=I.int({min:0}),YM=I.int({min:1,max:256,digitsOnly:!0}),XM=I.bool(),JM=I.bool(),ZM=I.bool(),qM=I.bool(),QM=I.bool(),eU=I.bool(),tU=I.bool(),nU=I.bool(),oU=I.bool(),rU=I.bool(),sU=I.bool(),iU=I.bool(),aU=I.bool(),lU=I.bool(),cU=I.bool(),dU=I.bool(),uU=I.bool(),pU=I.bool(),fU=I.bool(),mU=I.bool(),gU=I.bool(),_U=I.bool(),hU=I.bool(),EU=I.bool(),SU=I.triBool(),yU=I.bool(),OU=I.bool(),AU=I.bool(),CU=I.triBool(),bU=I.triBool(),RU=I.bool(),TU=I.bool(),DU=I.enum(Xr),LU=I.enum(Xr),IU=I.enum(["5m"]),wU=I.bool(),PU=I.bool(),xU=I.str(),NU=I.bool(),vU=I.bool(),kU=I.bool(),MU=I.bool(),UU=I.bool(),HU=I.bool(),FU=I.bool(),BU=I.bool(),zU=I.triBool(),GU=I.str(),WU=I.bool(),KU=I.str();var jU=I.str(),$U=I.str(),VU=I.str(),YU=I.str(),XU=I.str(),JU=I.str(),ZU=I.str(),qU=I.str(),QU=I.str(),eH=I.str(),tH=I.str(),nH=I.str(),oH=I.str(),rH=I.str(),sH=I.str(),iH=I.str(),aH=I.str(),lH=I.str(),cH=I.str(),dH=I.str(),uH=I.str(),pH=I.str(),fH=I.str(),mH=I.str(),gH=I.str(),_H=I.int({min:0,digitsOnly:!0}),hH=I.int({min:0,digitsOnly:!0}),EH=I.str(),SH=I.str(),yH=I.str(),OH=I.str(),AH=I.str(),CH=I.str(),bH=I.str(),RH=I.str(),TH=I.str(),DH=I.str(),LH=I.str(),IH=I.str(),wH=I.str(),PH=I.str(),xH=I.str(),NH=I.str(),vH=I.str(),kH=I.str(),MH=I.str(),UH=I.str(),HH=I.str(),FH=I.str(),BH=I.str(),zH=I.str(),GH=I.str(),WH=I.str(),KH=I.str(),jH=I.str(),$H=I.str(),VH=I.str(),YH=I.str(),XH=I.str(),JH=I.str(),ZH=I.str(),qH=I.str(),QH=I.str(),eF=I.str(),tF=I.str(),nF=I.str(),oF=I.str(),rF=I.str(),sF=I.str(),iF=I.str(),aF=I.str(),lF=I.str(),cF=I.str(),dF=I.str(),uF=I.rawStr(),pF=I.rawStr(),fF=I.str(),mF=I.str(),gF=I.str(),_F=I.str(),hF=I.str(),EF=I.str(),SF=I.str(),yF=I.str(),OF=I.str(),AF=I.str(),CF=I.str(),bF=I.str(),RF=I.str(),TF=I.str(),DF=I.str(),LF=I.str(),IF=I.str(),wF=I.str(),PF=I.str(),xF=I.str(),NF=I.str(),vF=I.str(),kF=I.str(),MF=I.str(),UF=I.str(),HF=I.str(),FF=I.str(),BF=I.str(),zF=I.str(),GF=I.str(),WF=I.str(),KF=I.str(),jF=I.str(),$F=I.str(),VF=I.str(),YF=I.str(),XF=I.str(),JF=I.str(),ZF=I.rawStr(),qF=I.str(),QF=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(),_B=I.str(),hB=I.str(),EB=I.str(),SB=I.str(),yB=I.str(),OB=I.rawStr(),AB=I.str(),CB=I.str(),bB=I.str(),RB=I.str(),TB=I.str(),DB=I.str(),LB=I.str(),IB=I.str(),wB=I.str(),PB=I.str(),xB=I.str(),NB=I.str(),vB=I.str(),kB=I.str(),MB=I.str(),UB=I.str(),HB=I.str(),FB=I.str(),BB=I.str(),zB=I.str(),GB=I.str(),WB=I.str(),KB=I.str(),jB=I.str(),$B=I.str(),VB=I.str(),YB=I.str(),XB=I.str(),JB=I.str(),ZB=I.str(),qB=I.str(),QB=I.str(),e0=I.str(),t0=I.str(),n0=I.str(),o0=I.str(),r0=I.str(),s0=I.str(),i0=I.str(),a0=I.str(),l0=I.str(),c0=I.str(),d0=I.str(),u0=I.str(),p0=I.str(),f0=I.str(),m0=I.str(),g0=I.str(),_0=I.str(),h0=I.str(),E0=I.str(),S0=I.str(),y0=I.str(),O0=I.str(),A0=I.str(),C0=I.str(),b0=I.str();var R0=I.str(),T0=I.str(),D0=I.str(),L0=I.str(),I0=I.str(),w0=I.rawStr(),P0=I.str(),x0=I.str(),N0=I.str(),v0=I.str(),k0=I.str(),M0=I.str(),U0=I.str(),H0=I.str(),F0=I.str(),B0=I.str(),z0=I.str(),G0=I.bool(),W0=I.str(),K0=I.str(),j0=I.str(),$0=I.str(),V0=I.str(),Y0=I.int({min:100,max:5000}),X0=I.str(),J0=I.str(),Z0=I.str(),q0=I.str(),Q0=I.bool(),ez=I.str(),tz=I.str(),nz=I.str(),oz=I.str(),rz=I.str(),sz=I.str(),iz=I.str(),az=I.str(),lz=I.str(),cz=I.str(),dz=I.str(),uz=I.str(),pz=I.str(),fz=I.str(),mz=I.str(),gz=I.str(),_z=I.bool(),hz=I.str(),Ez=I.str(),Sz=I.str(),yz=I.str(),Oz=I.str(),Az=I.str(),Cz=I.str(),bz=I.str(),Rz=I.str(),Tz=I.bool(),Dz=I.str(),Lz=I.int({min:0}),Iz=I.bool(),wz=I.str(),Pz=I.str(),xz=I.str(),Nz=I.str(),vz=I.enum(["1","spent"]),kz=I.str(),Mz=I.str(),Uz=I.str(),Hz=I.str(),Fz=I.rawStr(),Bz=I.str(),zz=I.str(),Gz=I.str(),Wz=I.str(),Kz=I.rawStr(),jz=I.str(),$z=I.str(),Vz=I.bool(),Yz=I.bool(),Xz=I.bool(),Jz=I.bool(),Zz=I.bool(),qz=I.bool(),Qz=I.bool(),eG=I.bool(),tG=I.bool(),nG=I.bool(),oG=I.str(),rG=I.str(),sG=I.str(),iG=I.str(),aG=I.bool(),lG=I.bool(),cG=I.bool(),dG=I.bool(),uG=I.bool(),pG=I.str(),fG=I.bool(),mG=I.bool(),gG=I.bool(),_G=I.int({min:0,wholeValue:!0}),hG=I.str(),EG=I.str(),SG=I.str(),yG=I.str(),OG=I.str(),AG=I.str(),CG=I.bool(),bG=I.bool(),RG=I.str(),TG=I.int({min:0}),DG=I.int({min:0}),LG=I.rawStr(),IG=I.str(),wG=I.str(),PG=I.triBool(),xG=I.str(),NG=I.str(),vG=I.str(),kG=I.str(),MG=I.str(),UG=I.int({min:1,wholeValue:!0}),HG=I.str(),FG=I.str(),BG=I.str(),zG=I.bool(),GG=I.str(),WG=I.str(),KG=I.str(),jG=I.str(),$G=I.str(),VG=I.str(),YG=I.str(),XG=I.str(),JG=I.str(),ZG=I.str(),qG=I.str(),QG=I.str(),eW=I.bool(),tW=I.bool(),nW=I.str(),oW=I.str(),rW=I.str(),sW=I.str(),iW=I.str(),aW=I.rawStr(),lW=I.str(),cW=I.str(),dW=I.str(),uW=I.str(),pW=I.str(),fW=I.str(),mW=I.str(),gW=I.str(),_W=I.str(),hW=I.str(),EW=I.str(),SW=I.str(),yW=I.str(),OW=I.str(),AW=I.enum(["1"]),CW=I.str(),bW=I.str(),RW=I.str(),TW=I.str(),DW=I.str(),LW=I.enum(["claude_ai_chat"]),IW=I.int({min:1,max:9999999999999,digitsOnly:!0}),wW=I.str(),PW=I.str(),xW=I.str(),NW=I.str(),vW=I.bool(),kW=I.int({min:1,wholeValue:!0}),MW=I.str(),UW=I.str(),HW=I.str(),FW=I.str(),BW=I.str(),zW=I.str(),GW=I.str(),WW=I.str(),KW=I.str(),jW=I.str(),$W=I.str(),VW=I.str(),YW=I.str(),XW=I.bool(),JW=I.str(),ZW=I.str(),qW=I.str(),QW=I.bool(),eK=I.names(8),tK=I.bool(),nK=I.bool(),oK=I.rawStr(),rK=I.str(),sK=I.str(),iK=I.str(),aK=I.str(),lK=I.str(),cK=I.str(),dK=I.str(),uK=I.str(),pK=I.str(),fK=I.str(),mK=I.str(),gK=I.str(),_K=I.str(),hK=I.str(),EK=I.str(),SK=I.str(),yK=I.str(),OK=I.str(),AK=I.str(),CK=I.str(),bK=I.str(),RK=I.str(),TK=I.str(),DK=I.str(),LK=I.str(),IK=I.str(),wK=I.str(),PK=I.str(),xK=I.rawStr(),NK=I.str(),vK=I.str(),kK=I.str(),MK=I.str(),UK=I.str(),HK=I.str(),FK=I.str(),BK=I.str(),zK=I.str(),GK=I.bool(),WK=I.bool(),KK=I.bool(),jK=I.str(),$K=I.str(),VK=I.str(),YK=I.bool(),XK=I.bool(),JK=I.bool(),ZK=I.bool(),qK=I.bool(),QK=I.bool(),ej=I.bool(),tj=I.bool(),nj=I.bool(),oj=I.bool(),rj=I.bool(),sj=I.bool(),ij=I.bool(),aj=I.bool(),lj=I.rawStr(),cj=I.bool(),dj=I.bool(),uj=I.bool(),pj=I.bool(),fj=I.bool(),mj=I.bool(),gj=I.bool(),_j=I.bool(),hj=I.bool(),Ej=I.bool(),Sj=I.bool(),yj=I.bool(),Oj=I.bool(),Aj=I.bool(),Cj=I.bool(),bj=I.int({min:0}),Rj=I.bool(),Tj=I.bool(),Dj=I.bool(),Lj=I.bool(),Ij=I.bool(),wj=I.bool(),Pj=I.bool(),xj=I.triBool(),Nj=I.bool(),vj=I.str(),kj=I.bool(),Mj=I.bool(),Uj=I.bool(),Hj=I.bool(),Fj=I.bool(),Bj=I.bool(),zj=I.bool(),Gj=I.int({min:1000,max:5000,digitsOnly:!0}),Wj=I.triBool(),Kj=I.bool(),jj=I.bool(),$j=I.triBool(),Vj=I.bool(),Yj=I.str(),Xj=I.bool(),Jj=I.enum(["on","verify"]),Zj=I.str(),qj=I.int({min:1,max:2147483647,wholeValue:!0}),Qj=I.int({min:1,max:100,digitsOnly:!0}),e$=I.rawStr(),t$=I.bool(),n$=I.str(),o$=I.bool(),r$=I.bool(),s$=I.bool(),i$=I.bool(),a$=I.bool(),l$=I.triBool(),c$=I.bool(),d$=I.str(),u$=I.str(),p$=I.bool(),f$=I.int({min:1,max:32,digitsOnly:!0}),m$=I.int({min:1}),g$=I.int({min:100,max:30000}),_$=I.int({min:0}),h$=I.int({min:1}),E$=I.bool(),S$=I.triBool(),y$=I.bool(),O$=I.bool(),A$=I.bool(),C$=I.bool(),b$=I.bool(),R$=I.bool(),T$=I.bool(),D$=I.bool(),L$=I.str(),I$=I.bool(),w$=I.rawStr(),P$=I.str(),x$=I.str(),N$=I.bool(),v$=I.rawStr(),k$=I.str(),M$=I.str(),U$=I.str(),H$=I.str(),F$=I.str(),B$=I.str(),z$=I.str(),G$=I.bool(),W$=I.bool(),K$=I.bool(),j$=I.triBool(),$$=I.bool(),V$=I.bool(),Y$=I.int(),X$=I.int(),J$=I.int(),Z$=I.int({min:1,max:2147483647,digitsOnly:!0}),q$=I.int(),Q$=I.int(),eV=I.int(),tV=I.int({min:1}),nV=I.int({min:0,max:10080,digitsOnly:!0}),oV=I.int(),rV=I.int(),sV=I.int({min:1,digitsOnly:!0}),iV=I.int({min:1,digitsOnly:!0}),aV=I.int({min:1,digitsOnly:!0}),lV=I.int({min:0,digitsOnly:!0}),cV=I.int(),dV=I.int(),uV=I.int(),pV=I.int(),fV=I.int(),mV=I.int(),gV=I.int(),_V=I.int(),hV=I.int({min:1}),EV=I.int(),SV=I.int(),yV=I.int(),OV=I.int({min:1}),AV=I.int({min:1}),CV=I.int({min:0}),bV=I.int({min:0,max:86400000}),RV=I.int(),TV=I.int(),DV=I.int({min:1000,max:60000}),LV=I.int({wholeValue:!0}),IV=I.int({min:0,digitsOnly:!0}),wV=I.int({min:0,digitsOnly:!0}),PV=I.bool(),xV=I.int(),NV=I.int({min:1}),vV=I.int({min:1}),kV=I.int({min:3}),MV=I.int({min:1,max:2147483647,digitsOnly:!0}),UV=I.str(),HV=I.bool(),FV=I.int({min:1}),BV=I.int(),zV=I.triBool(),GV=I.int({min:1}),WV=I.int({min:1}),KV=I.int({min:1}),jV=I.int({min:1}),$V=I.str(),VV=I.int({min:1}),YV=I.int({min:1}),XV=I.str(),JV=I.int(),ZV=I.int({min:1}),qV=I.int(),QV=I.int({min:1,wholeValue:!0}),e1=I.int(),t1=I.int({min:1}),n1=I.int({min:0}),o1=I.bool(),r1=I.str(),s1=I.int({min:0,digitsOnly:!0}),i1=I.str(),a1=I.names(16),l1=I.bool(),c1=I.bool(),d1=I.bool(),u1=I.bool(),p1=I.bool(),f1=I.bool(),m1=I.bool(),g1=I.int({min:1,digitsOnly:!0}),_1=I.int({min:1});var h1=I.str(),E1=I.str(),S1=I.str(),y1=I.str(),O1=I.str(),A1=I.str(),C1=I.str(),b1=I.str(),R1=I.str(),T1=I.str(),D1=I.str(),L1=I.str(),I1=I.str(),w1=I.str(),P1=I.str(),x1=I.str(),N1=I.str(),v1=I.str(),k1=I.str(),M1=I.str(),U1=I.bool(),H1=I.str(),F1=I.str(),B1=I.str(),z1=I.str(),G1=I.str(),W1=I.bool(),K1=I.str(),j1=I.str(),$1=I.str(),V1=I.str(),Y1=I.bool(),X1=I.bool(),J1=I.bool(),Z1=I.bool(),q1=I.str(),Q1=I.bool(),eY=I.triBool(),tY=I.bool(),nY=I.bool(),oY=I.bool(),rY=I.bool(),sY=I.bool(),iY=I.str(),aY=I.str(),lY=I.str(),cY=I.bool();var dY=I.str(),uY=I.str(),pY=I.str(),fY=I.str(),mY=I.str(),gY=I.str(),_Y=I.str(),hY=I.str(),EY=I.str(),SY=I.str(),yY=I.str(),OY=I.bool(),AY=I.bool(),CY=I.str(),bY=I.bool(),RY=I.bool(),TY=I.str(),DY=I.str(),LY=I.str(),IY=I.str(),wY=I.str(),PY=I.int(),xY=I.int(),NY=I.int(),vY=I.int(),kY=I.int({min:1,digitsOnly:!0}),MY=I.int({min:1,digitsOnly:!0}),UY=I.int({min:1}),HY=I.str(),FY=I.int(),BY=I.int(),zY=I.int(),GY=I.int(),WY=I.int({min:0,digitsOnly:!0}),KY=I.int({min:500,max:32000,digitsOnly:!0}),jY=I.int({min:32000,max:300000,digitsOnly:!0}),$Y=I.int({min:300000,max:3600000,digitsOnly:!0}),VY=I.int(),YY=I.triBool(),XY=I.bool(),JY=I.triBool(),ZY=I.triBool(),qY=I.triBool(),QY=I.triBool(),e2=I.int({min:0,max:9,digitsOnly:!0}),t2=I.int({min:0,max:2,digitsOnly:!0}),n2=I.int({min:0,max:2,digitsOnly:!0}),o2=I.int({min:1,max:2000,digitsOnly:!0}),r2=I.int({min:1,max:1000,digitsOnly:!0}),s2=I.int({min:1,max:2000,digitsOnly:!0}),i2=I.rawStr(),a2=I.int({min:1,max:60000,digitsOnly:!0}),l2=I.int({min:1}),c2=I.int({min:1}),d2=I.int({min:1}),u2=I.int({min:1}),p2=I.bool(),f2=I.int({min:1,digitsOnly:!0}),m2=I.int({min:1,digitsOnly:!0}),g2=I.int({min:60000,max:10800000,digitsOnly:!0}),_2=I.enum(["capacity"]),h2=I.bool(),E2=I.bool(),S2=I.bool(),y2=I.int(),O2=I.int({min:0});var A2=I.bool(),C2=I.bool(),b2=I.bool(),R2=I.bool(),T2=I.bool(),D2=I.bool(),L2=I.str(),I2=I.triBool(),w2=I.str(),P2=I.str(),x2=I.enum(Xn),N2=I.str(),v2=I.str(),k2=I.str(),M2=I.str(),U2=I.str(),H2=I.str(),F2=I.str(),B2=I.str(),z2=I.str(),G2=I.str(),W2=I.str(),K2=I.str(),j2=I.str(),$2=I.str(),V2=I.str(),Y2=I.str(),X2=I.str(),J2=I.str(),Z2=I.str(),q2=I.str(),Q2=I.str(),eX=I.str(),tX=I.str(),nX=I.str(),oX=I.str(),rX=I.str(),sX=I.str(),iX=I.str(),aX=I.bool(),lX=I.bool(),cX=I.bool(),dX=I.bool(),uX=I.bool(),pX=I.bool(),fX=I.bool(),mX=I.str(),gX=I.str(),_X=I.int({min:1,max:2147000000,digitsOnly:!0}),hX=I.bool(),EX=I.int({min:1,max:2147483647,digitsOnly:!0}),SX=I.str(),yX=I.int(),OX=I.bool(),AX=I.bool(),CX=I.bool(),bX=I.str(),RX=I.str(),TX=I.str(),DX=I.str(),LX=I.bool(),IX=I.bool(),wX=I.int({min:1,digitsOnly:!0}),PX=I.bool(),xX=I.bool(),NX=I.str(),vX=I.rawStr(),kX=I.rawStr(),MX=I.rawStr(),UX=I.bool(),HX=I.str(),FX=I.bool(),BX=I.bool(),zX=I.str(),GX=I.bool(),WX=I.bool(),KX=I.enum(["enforce","observe","off"]),jX=I.str(),$X=I.bool();var YX={...yc,...Lc,...Tc,...Cc,...Dc,...bc,...Oc,...Rc},XX=new WeakMap;function JX(i,c,T){let D=T,w;return()=>{let x=process.env[i];if(x!==D)w=c.parse(x),D=x;return w}}function ha(i,c){return typeof c==="string"&&Object.hasOwn(i,c)}function Ic(i,c){let T=new Proxy(Object.create(c&&Object.getPrototypeOf(c)),{get:(U,B,z)=>{if(!ha(i,B))return Reflect.get(U,B,z);let le=JX(B,i[B],x);if(z===x)Object.defineProperty(x,B,{get:le,configurable:!0});return le()},set:(U,B,z,le)=>!ha(i,B)&&Reflect.set(U,B,z,le),has:(U,B)=>ha(i,B)||Reflect.has(U,B)}),D=Object.create(T),w=c===null?{}:Object.getOwnPropertyDescriptors(c);for(let[U,B]of Object.entries(w)){if(ha(i,U))continue;Object.defineProperty(D,U,typeof B.value==="function"?{...B,value:{[U](...z){return Reflect.apply(Reflect.get(c,U),this,z)}}[U]}:B)}let x=Object.create(D);return XX.set(x,i),Object.defineProperties(x,{set:{value:(U,B)=>{process.env[U]=tm(B)}},unset:{value:(U)=>{delete process.env[U]}}}),x}var Wt=Ic(YX,Hs),ZX={},hde=Ic(ZX,null),qX={},Ede=Ic(qX,null);function hm(){}class Sm{pendingWrite=Promise.resolve();cleanupRegistered=!1;notStarted=[];appendOldest=this.appendOldestNotStarted.bind(this);append(i,c){let T=this.notStarted.at(-1);if(T?.logFile===i){T.lines+=c;return}if(this.notStarted.push({logFile:i,lines:c}),this.pendingWrite=this.pendingWrite.then(this.appendOldest).catch(hm),!this.cleanupRegistered)this.cleanupRegistered=!0,_t(()=>this.flush())}async appendOldestNotStarted(){let i=this.notStarted.shift();if(i===void 0)return;let c=l();try{await c.appendFile(i.logFile,i.lines)}catch{await c.mkdir(QX(i.logFile)).catch(hm),await c.appendFile(i.logFile,i.lines)}}flush(){return this.pendingWrite}}var e4=new s(()=>new Sm);function t4(){return q(e4)}function Fs(i,c,T,D="queued"){let w=o4();if(!w)return;let x;try{x=Em(i,c,n4(T))}catch{x=Em(i,c,{diagnostics_payload_failed:!0})}if(D==="now")try{l().appendFileSync(w,x)}catch{}else t4().append(w,x)}function n4(i){try{return(typeof i==="function"?i():i)??{}}catch{return{diagnostics_payload_failed:!0}}}function Em(i,c,T){let D={timestamp:new Date().toISOString(),level:i,event:c,data:T,cc_version:typeof{VERSION:"0.3.327"}<"u"?"0.3.327":"unknown"};return o(D)+`
17
+ `}function o4(){return r4()?void 0:Wt.CLAUDE_CODE_DIAGNOSTICS_FILE}function r4(){return em()?g():Gt()}import{isUtf8 as s4}from"buffer";import{closeSync as i4,fstatSync as a4,openSync as l4,readlinkSync as c4}from"fs";import{open as d4,readlink as kde}from"fs/promises";function ym(i,c){if(!Nn())return;let{resolvedPath:T,isSymlink:D}=ye(i,c);if(D)t(`Reading through symlink: ${c} -> ${T}`)}function u4(i,c,T){let D=i.statSync(c);return zs(D,c,T),D}function zs(i,c,T){if(i.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:c});if(!i.isFile())throw wc(c);if(T!==void 0&&i.size>T)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:c,size:i.size,maxBytes:T})}function wc(i){return Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:i})}var Bs=10485760;function p4(){return process.platform!=="darwin"&&process.platform!=="win32"}function f4(i,c){let{resolvedPath:T,isCanonical:D}=ye(l(),c);if(D)return T;return me(i)?c:void 0}function m4(i,c){let w=[];try{const T=y(w,O`readUnsizedFileBytesSync(${i})`,0);if(c?.(i))throw wc(i);let D=l4(i,St());try{let z;try{z=a4(D)}catch{}if(z!==void 0)zs(z,i,Bs);if(c!==void 0&&p4()){let fe;try{fe=c4(`/proc/self/fd/${D}`)}catch(Ce){fe=f4(Ce,i)}if(c(fe))throw wc(i)}let le=qt(D,Bs+8,"stream");return Gs(le.length,i,Bs),le}finally{try{i4(D)}catch{}}}catch(x){var U=x,B=1}finally{b(w,U,B)}}async function g4(i,c){let T=await yt(i,Bs+8,"stream");return Gs(T.length,c,Bs),T}function Gs(i,c,T){if(T===void 0)return;if(i>T)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:c,size:i,maxBytes:T})}function Om(i){return i!=null&&typeof i==="object"&&"code"in i&&i.code==="ERR_FILE_TOO_LARGE"}function Pc(i){if(i.byteLength===0)return"utf8";if(i.byteLength>=2){if(i[0]===255&&i[1]===254)return"utf16le"}if(i.byteLength>=3&&i[0]===239&&i[1]===187&&i[2]===191)return"utf8";return"utf8"}var Am=4096,_4=8000;function h4(i){return i.subarray(0,_4).includes(0)}function E4(i){let c=Pc(i.subarray(0,Am));if(c!=="utf8")return{encoding:c};if(i.byteLength>=2&&i[0]===254&&i[1]===255)return{encoding:c,notText:"utf16be"};if(h4(i))return{encoding:c,notText:"nul"};return s4(i)?{encoding:c}:{encoding:c,notText:"not_utf8"}}function S4(i){let{buffer:c,bytesRead:T}=l().readSync(i,{length:Am});return Pc(c.subarray(0,T))}function Cm(i){let c=0,T=0;for(let D=0;D<i.length;D++)if(i[D]===`
18
+ `)if(D>0&&i[D-1]==="\r")c++;else T++;return c>T?"CRLF":"LF"}function y4(i,c,T){let D=l();ym(D,i);let w=u4(D,i,c);T?.(w);let x=c===void 0&&w.size===0?m4(i):void 0,U=x===void 0?S4(i):Pc(x),B;if(x!==void 0)B=x.toString(U);else if(c===void 0)B=D.readFileSync(i,{encoding:U});else{let{buffer:le,bytesRead:fe}=D.readSync(i,{length:c+1});Gs(fe,i,c),B=le.subarray(0,fe).toString(U)}let z=Cm(B.slice(0,4096));return{content:B.replaceAll(`\r
19
+ `,`
20
+ `),encoding:U,lineEndings:z}}function Ko(i,c,T){return y4(i,c,T).content}async function xc(i,c,T){let x=[];try{let D=l();ym(D,i);zs(await D.stat(i),i,c);const w=y(x,await d4(i,St()),1);return await O4(w,i,c,T)}catch(U){var B=U,z=1}finally{var le=b(x,B,z);le&&await le}}async function O4(i,c,T,D){let w=await i.stat();zs(w,c,T),D?.(w);let x;if(T!==void 0)x=await yt(i,T+1,"file"),Gs(x.length,c,T);else if(w.size===0)x=await g4(i,c);else x=await i.readFile();let{encoding:U,notText:B}=E4(x),z=x.toString(U),le=Cm(z.slice(0,4096));return{content:z.replaceAll(`\r
21
+ `,`
22
+ `),encoding:U,lineEndings:le,...B&&{notText:B}}}function Ea(i){return i>=48&&i<=57}function bm(i){if(Ea(i))return i-48;let c=(i|32)-97;return c>=0&&c<6?c+10:-1}function Rm(i){switch(i){case 34:return'"';case 92:return"\\";case 47:return"/";case 98:return"\b";case 102:return"\f";case 110:return`
23
+ `;case 114:return"\r";case 116:return"\t";default:return}}class Sa{text;position=0;token=14;offset=0;error=0;line=0;lineStart=0;tokenLine=0;tokenLineStart=0;valueStart=0;valueEnd=0;hasEscape=!1;constructor(i){this.text=i}value(){let{text:i,valueEnd:c}=this;if(!this.hasEscape)return i.slice(this.valueStart,c);let T="",D=this.valueStart;for(;;){let w=i.indexOf("\\",D);if(w<0||w>=c)return T+i.slice(D,c);T+=i.slice(D,w),D=w+2;let x=i.charCodeAt(w+1);if(x!==117){T+=Rm(x)??"";continue}let U=0;for(let B=D+4;D<B;D++){let z=bm(i.charCodeAt(D));if(z<0){U=-1;break}U=U*16+z}if(U>=0)T+=String.fromCharCode(U)}}skipWhitespace(){let{text:i}=this,{position:c}=this;for(;;){let T=i.charCodeAt(c);if(T===32||T===9)c++;else if(T===10||T===13)c=this.passLineBreak(c);else{this.position=c;return}}}scan(){let{text:i,position:c}=this;if(this.error=0,this.hasEscape=!1,this.tokenLine=this.line,this.tokenLineStart=this.lineStart,c>=i.length)return this.offset=i.length,this.token=15;this.offset=this.valueStart=c,this.position=c+1;let T=i.charCodeAt(c);switch(T){case 34:return this.scanString(),this.token=10;case 44:return this.token=5;case 58:return this.token=6;case 123:return this.token=1;case 125:return this.token=2;case 91:return this.token=3;case 93:return this.token=4;case 47:return this.token=this.scanComment()}if(Ea(T))return this.scanNumber(c),this.token=11;if(T!==45)return this.token=this.scanWord();if(Ea(i.charCodeAt(c+1)))return this.scanNumber(c+1),this.token=11;return this.token=14}passLineBreak(i){let{text:c}=this,T=c.charCodeAt(i)===13&&c.charCodeAt(i+1)===10;return this.line++,this.lineStart=i+(T?2:1)}scanString(){let{text:i}=this,{length:c}=i,T=this.valueStart=this.position;for(;T<c;T++){let D=i.charCodeAt(T);if(D===34){this.valueEnd=T,this.position=T+1;return}if(D===92){this.hasEscape=!0;let w=i.charCodeAt(++T);if(w===117){let x=T+4;while(T<x&&bm(i.charCodeAt(T+1))>=0)T++;if(T<x)this.error=4}else if(Rm(w)===void 0)this.error=5}else if(D<32){if(D===10||D===13)break;this.error=6}}this.error=2,this.position=this.valueEnd=Math.min(T,c)}passDigits(i){let{text:c}=this,T=i;while(Ea(c.charCodeAt(T)))T++;return T}scanNumber(i){let{text:c}=this,T=c.charCodeAt(i)===48?i+1:this.passDigits(i);if(c.charCodeAt(T)===46){let D=T+1;if(T=this.passDigits(D),T===D){this.error=3,this.position=this.valueEnd=T;return}}if(this.position=this.valueEnd=T,(c.charCodeAt(T)|32)===101){let D=c.charCodeAt(T+1),w=T+(D===43||D===45?2:1);if(this.position=this.passDigits(w),this.position===w)this.error=3;else this.valueEnd=this.position}}scanComment(){let{text:i}=this,{length:c}=i,T=i.charCodeAt(this.position),D=this.position+1;if(T===47){for(;D<c;D++){let U=i.charCodeAt(D);if(U===10||U===13)break}return this.position=D,12}if(T!==42)return 14;let w=i.indexOf("*/",D),x=w<0?c-1:w+2;while(D<x){let U=i.charCodeAt(D);D=U===10||U===13?this.passLineBreak(D):D+1}if(w<0)this.error=1,D++;return this.position=D,13}scanWord(){let{text:i,offset:c}=this,{length:T}=i,D=this.position;e:for(;D<T;D++)switch(i.charCodeAt(D)){case 32:case 9:case 10:case 13:case 34:case 44:case 58:case 47:case 123:case 125:case 91:case 93:break e}if(this.position=D,D-c===4){if(i.startsWith("true",c))return 8;if(i.startsWith("null",c))return 7}return D-c===5&&i.startsWith("false",c)?9:14}}function ya(i){return i===12||i===13}class Ws extends Sa{options;errors;constructor(i,c={},T){super(i);this.options=c;this.errors=T}comma(){}fault(i){this.errors?.push({error:i,offset:this.offset,length:this.position-this.offset})}walk(){if(this.next(),!this.walkValue())this.fault(4);else if(this.token!==15)this.fault(9)}literalValue(){switch(this.token){case 10:return this.value();case 11:return Number(this.value());case 7:return null;default:return this.token===8}}next(){for(;;){this.skipWhitespace();let i=this.scan();if(ya(i)&&this.options.disallowComments){this.fault(10);continue}if(this.error!==0)this.fault(this.error+10);if(i===14)this.fault(1);else if(!ya(i))return i}}skipToCommaOr(i){let{token:c}=this;while(c!==i&&c!==5&&c!==15)c=this.next()}walkValue(){let{token:i}=this;if(i>=7&&i<=11)return this.literal(),this.next(),!0;let c=i===1;if(c)this.objectBegin();else if(i===3)this.arrayBegin();else return!1;let T=c?2:4;this.next();for(let D=!0;this.token!==T&&this.token!==15;D=!1){if(this.token===5){if(D)this.fault(4);if(this.comma(),this.next()===T&&this.options.allowTrailingComma)break}else if(!D)this.fault(6);if(!(c?this.walkProperty():this.walkValue()))this.fault(4),this.skipToCommaOr(T)}if(c)this.objectEnd();else this.arrayEnd();if(this.token===T)this.next();else this.fault(c?7:8);return!0}walkProperty(){if(this.token!==10)return this.fault(3),this.skipToCommaOr(2),!1;if(this.property(),this.next()!==6)return this.fault(5),this.skipToCommaOr(2),!0;if(this.next(),!this.walkValue())this.fault(4),this.skipToCommaOr(2);return!0}}class Dm extends Ws{visitor;constructor(i,c,T){super(i,T);this.visitor=c}objectBegin(){this.visitor.onObjectBegin?.()}property(){this.visitor.onObjectProperty?.(this.value())}objectEnd(){this.visitor.onObjectEnd?.()}arrayBegin(){}arrayEnd(){}literal(){}fault(i){this.visitor.onError?.(i,this.offset,this.position-this.offset,this.tokenLine,this.offset-this.tokenLineStart)}}function Nc(i,c,T){new Dm(i,c,T).walk()}var Jr=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,Im=new Set,vc=typeof process==="object"&&!!process?process:{},wm=(i,c,T,D)=>{typeof vc.emitWarning==="function"?vc.emitWarning(i,c,T,D):console.error(`[${T}] ${c}: ${i}`)},{AbortController:Oa,AbortSignal:Lm}=globalThis;if(typeof Oa>"u"){Lm=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(D,w){this._onabort.push(w)}},Oa=class{constructor(){c()}signal=new Lm;abort(D){if(this.signal.aborted)return;this.signal.reason=D,this.signal.aborted=!0;for(let w of this.signal._onabort)w(D);this.signal.onabort?.(D)}};let i=vc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",c=()=>{if(!i)return;i=!1,wm("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",c)}}var w4=(i)=>!Im.has(i),Sue=Symbol("type"),jo=(i)=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Pm=(i)=>!jo(i)?null:i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?Ks:null;class Ks extends Array{constructor(i){super(i);this.fill(0)}}class Zr{heap;length;static#a=!1;static create(i){let c=Pm(i);if(!c)return[];Zr.#a=!0;let T=new Zr(i,c);return Zr.#a=!1,T}constructor(i,c){if(!Zr.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new c(i),this.length=0}push(i){this.heap[this.length++]=i}pop(){return this.heap[--this.length]}}class Aa{#a;#u;#g;#_;#w;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#h;#o;#n;#e;#c;#p;#l;#s;#E;#i;#S;#y;#f;#O;#T;#d;static unsafeExposeInternals(i){return{starts:i.#y,ttls:i.#f,sizes:i.#S,keyMap:i.#o,keyList:i.#n,valList:i.#e,next:i.#c,prev:i.#p,get head(){return i.#l},get tail(){return i.#s},free:i.#E,isBackgroundFetch:(c)=>i.#t(c),backgroundFetch:(c,T,D,w)=>i.#v(c,T,D,w),moveToTail:(c)=>i.#I(c),indexes:(c)=>i.#A(c),rindexes:(c)=>i.#C(c),isStale:(c)=>i.#m(c)}}get max(){return this.#a}get maxSize(){return this.#u}get calculatedSize(){return this.#h}get size(){return this.#r}get fetchMethod(){return this.#w}get memoMethod(){return this.#P}get dispose(){return this.#g}get disposeAfter(){return this.#_}constructor(i){let{max:c=0,ttl:T,ttlResolution:D=1,ttlAutopurge:w,updateAgeOnGet:x,updateAgeOnHas:U,allowStale:B,dispose:z,disposeAfter:le,noDisposeOnSet:fe,noUpdateTTL:Ce,maxSize:Re=0,maxEntrySize:xe=0,sizeCalculation:Te,fetchMethod:Ke,memoMethod:Le,noDeleteOnFetchRejection:Pe,noDeleteOnStaleGet:nt,allowStaleOnFetchRejection:et,allowStaleOnFetchAbort:rt,ignoreFetchAbort:At}=i;if(c!==0&&!jo(c))throw TypeError("max option must be a nonnegative integer");let ht=c?Pm(c):Array;if(!ht)throw Error("invalid max value: "+c);if(this.#a=c,this.#u=Re,this.maxEntrySize=xe||this.#u,this.sizeCalculation=Te,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(Le!==void 0&&typeof Le!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#P=Le,Ke!==void 0&&typeof Ke!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#w=Ke,this.#T=!!Ke,this.#o=new Map,this.#n=Array(c).fill(void 0),this.#e=Array(c).fill(void 0),this.#c=new ht(c),this.#p=new ht(c),this.#l=0,this.#s=0,this.#E=Zr.create(c),this.#r=0,this.#h=0,typeof z==="function")this.#g=z;if(typeof le==="function")this.#_=le,this.#i=[];else this.#_=void 0,this.#i=void 0;if(this.#O=!!this.#g,this.#d=!!this.#_,this.noDisposeOnSet=!!fe,this.noUpdateTTL=!!Ce,this.noDeleteOnFetchRejection=!!Pe,this.allowStaleOnFetchRejection=!!et,this.allowStaleOnFetchAbort=!!rt,this.ignoreFetchAbort=!!At,this.maxEntrySize!==0){if(this.#u!==0){if(!jo(this.#u))throw TypeError("maxSize must be a positive integer if specified")}if(!jo(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!B,this.noDeleteOnStaleGet=!!nt,this.updateAgeOnGet=!!x,this.updateAgeOnHas=!!U,this.ttlResolution=jo(D)||D===0?D:1,this.ttlAutopurge=!!w,this.ttl=T||0,this.ttl){if(!jo(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#a===0&&this.ttl===0&&this.#u===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#u){if(w4("LRU_CACHE_UNBOUNDED"))Im.add("LRU_CACHE_UNBOUNDED"),wm("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",Aa)}}getRemainingTTL(i){return this.#o.has(i)?1/0:0}#k(){let i=new Ks(this.#a),c=new Ks(this.#a);this.#f=i,this.#y=c,this.#M=(w,x,U=Jr.now())=>{if(c[w]=x!==0?U:0,i[w]=x,x!==0&&this.ttlAutopurge){let B=setTimeout(()=>{if(this.#m(w))this.#b(this.#n[w],"expire")},x+1);if(B.unref)B.unref()}},this.#D=(w)=>{c[w]=i[w]!==0?Jr.now():0},this.#R=(w,x)=>{if(i[x]){let U=i[x],B=c[x];if(!U||!B)return;w.ttl=U,w.start=B,w.now=T||D();let z=w.now-B;w.remainingTTL=U-z}};let T=0,D=()=>{let w=Jr.now();if(this.ttlResolution>0){T=w;let x=setTimeout(()=>T=0,this.ttlResolution);if(x.unref)x.unref()}return w};this.getRemainingTTL=(w)=>{let x=this.#o.get(w);if(x===void 0)return 0;let U=i[x],B=c[x];if(!U||!B)return 1/0;let z=(T||D())-B;return U-z},this.#m=(w)=>{let x=c[w],U=i[w];return!!U&&!!x&&(T||D())-x>U}}#D=()=>{};#R=()=>{};#M=()=>{};#m=()=>!1;#z(){let i=new Ks(this.#a);this.#h=0,this.#S=i,this.#L=(c)=>{this.#h-=i[c],i[c]=0},this.#U=(c,T,D,w)=>{if(this.#t(T))return 0;if(!jo(D))if(w){if(typeof w!=="function")throw TypeError("sizeCalculation must be a function");if(D=w(T,c),!jo(D))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 D},this.#x=(c,T,D)=>{if(i[c]=T,this.#u){let w=this.#u-i[c];while(this.#h>w)this.#N(!0)}if(this.#h+=i[c],D)D.entrySize=T,D.totalCalculatedSize=this.#h}}#L=(i)=>{};#x=(i,c,T)=>{};#U=(i,c,T,D)=>{if(T||D)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:i=this.allowStale}={}){if(this.#r)for(let c=this.#s;;){if(!this.#H(c))break;if(i||!this.#m(c))yield c;if(c===this.#l)break;else c=this.#p[c]}}*#C({allowStale:i=this.allowStale}={}){if(this.#r)for(let c=this.#l;;){if(!this.#H(c))break;if(i||!this.#m(c))yield c;if(c===this.#s)break;else c=this.#c[c]}}#H(i){return i!==void 0&&this.#o.get(this.#n[i])===i}*entries(){for(let i of this.#A())if(this.#e[i]!==void 0&&this.#n[i]!==void 0&&!this.#t(this.#e[i]))yield[this.#n[i],this.#e[i]]}*rentries(){for(let i of this.#C())if(this.#e[i]!==void 0&&this.#n[i]!==void 0&&!this.#t(this.#e[i]))yield[this.#n[i],this.#e[i]]}*keys(){for(let i of this.#A()){let c=this.#n[i];if(c!==void 0&&!this.#t(this.#e[i]))yield c}}*rkeys(){for(let i of this.#C()){let c=this.#n[i];if(c!==void 0&&!this.#t(this.#e[i]))yield c}}*values(){for(let i of this.#A())if(this.#e[i]!==void 0&&!this.#t(this.#e[i]))yield this.#e[i]}*rvalues(){for(let i of this.#C())if(this.#e[i]!==void 0&&!this.#t(this.#e[i]))yield this.#e[i]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(i,c={}){for(let T of this.#A()){let D=this.#e[T],w=this.#t(D)?D.__staleWhileFetching:D;if(w===void 0)continue;if(i(w,this.#n[T],this))return this.get(this.#n[T],c)}}forEach(i,c=this){for(let T of this.#A()){let D=this.#e[T],w=this.#t(D)?D.__staleWhileFetching:D;if(w===void 0)continue;i.call(c,w,this.#n[T],this)}}rforEach(i,c=this){for(let T of this.#C()){let D=this.#e[T],w=this.#t(D)?D.__staleWhileFetching:D;if(w===void 0)continue;i.call(c,w,this.#n[T],this)}}purgeStale(){let i=!1;for(let c of this.#C({allowStale:!0}))if(this.#m(c))this.#b(this.#n[c],"expire"),i=!0;return i}info(i){let c=this.#o.get(i);if(c===void 0)return;let T=this.#e[c],D=this.#t(T)?T.__staleWhileFetching:T;if(D===void 0)return;let w={value:D};if(this.#f&&this.#y){let x=this.#f[c],U=this.#y[c];if(x&&U){let B=x-(Jr.now()-U);w.ttl=B,w.start=Date.now()}}if(this.#S)w.size=this.#S[c];return w}dump(){let i=[];for(let c of this.#A({allowStale:!0})){let T=this.#n[c],D=this.#e[c],w=this.#t(D)?D.__staleWhileFetching:D;if(w===void 0||T===void 0)continue;let x={value:w};if(this.#f&&this.#y){x.ttl=this.#f[c];let U=Jr.now()-this.#y[c];x.start=Math.floor(Date.now()-U)}if(this.#S)x.size=this.#S[c];i.unshift([T,x])}return i}load(i){this.clear();for(let[c,T]of i){if(T.start){let D=Date.now()-T.start;T.start=Jr.now()-D}this.set(c,T.value,T)}}set(i,c,T={}){if(c===void 0)return this.delete(i),this;let{ttl:D=this.ttl,start:w,noDisposeOnSet:x=this.noDisposeOnSet,sizeCalculation:U=this.sizeCalculation,status:B}=T,{noUpdateTTL:z=this.noUpdateTTL}=T,le=this.#U(i,c,T.size||0,U);if(this.maxEntrySize&&le>this.maxEntrySize){if(B)B.set="miss",B.maxEntrySizeExceeded=!0;return this.#b(i,"set"),this}let fe=this.#r===0?void 0:this.#o.get(i);if(fe===void 0){if(fe=this.#r===0?this.#s:this.#E.length!==0?this.#E.pop():this.#r===this.#a?this.#N(!1):this.#r,this.#n[fe]=i,this.#e[fe]=c,this.#o.set(i,fe),this.#c[this.#s]=fe,this.#p[fe]=this.#s,this.#s=fe,this.#r++,this.#x(fe,le,B),B)B.set="add";z=!1}else{this.#I(fe);let Ce=this.#e[fe];if(c!==Ce){if(this.#T&&this.#t(Ce)){Ce.__abortController.abort(Error("replaced"));let{__staleWhileFetching:Re}=Ce;if(Re!==void 0&&!x){if(this.#O)this.#g?.(Re,i,"set");if(this.#d)this.#i?.push([Re,i,"set"])}}else if(!x){if(this.#O)this.#g?.(Ce,i,"set");if(this.#d)this.#i?.push([Ce,i,"set"])}if(this.#L(fe),this.#x(fe,le,B),this.#e[fe]=c,B){B.set="replace";let Re=Ce&&this.#t(Ce)?Ce.__staleWhileFetching:Ce;if(Re!==void 0)B.oldValue=Re}}else if(B)B.set="update"}if(D!==0&&!this.#f)this.#k();if(this.#f){if(!z)this.#M(fe,D,w);if(B)this.#R(B,fe)}if(!x&&this.#d&&this.#i){let Ce=this.#i,Re;while(Re=Ce?.shift())this.#_?.(...Re)}return this}pop(){try{while(this.#r){let i=this.#e[this.#l];if(this.#N(!0),this.#t(i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(this.#d&&this.#i){let i=this.#i,c;while(c=i?.shift())this.#_?.(...c)}}}#N(i){let c=this.#l,T=this.#n[c],D=this.#e[c];if(this.#T&&this.#t(D))D.__abortController.abort(Error("evicted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(D,T,"evict");if(this.#d)this.#i?.push([D,T,"evict"])}if(this.#L(c),i)this.#n[c]=void 0,this.#e[c]=void 0,this.#E.push(c);if(this.#r===1)this.#l=this.#s=0,this.#E.length=0;else this.#l=this.#c[c];return this.#o.delete(T),this.#r--,c}has(i,c={}){let{updateAgeOnHas:T=this.updateAgeOnHas,status:D}=c,w=this.#o.get(i);if(w!==void 0){let x=this.#e[w];if(this.#t(x)&&x.__staleWhileFetching===void 0)return!1;if(!this.#m(w)){if(T)this.#D(w);if(D)D.has="hit",this.#R(D,w);return!0}else if(D)D.has="stale",this.#R(D,w)}else if(D)D.has="miss";return!1}peek(i,c={}){let{allowStale:T=this.allowStale}=c,D=this.#o.get(i);if(D===void 0||!T&&this.#m(D))return;let w=this.#e[D];return this.#t(w)?w.__staleWhileFetching:w}#v(i,c,T,D){let w=c===void 0?void 0:this.#e[c];if(this.#t(w))return w;let x=new Oa,{signal:U}=T;U?.addEventListener("abort",()=>x.abort(U.reason),{signal:x.signal});let B={signal:x.signal,options:T,context:D},z=(Te,Ke=!1)=>{let{aborted:Le}=x.signal,Pe=T.ignoreFetchAbort&&Te!==void 0;if(T.status)if(Le&&!Ke){if(T.status.fetchAborted=!0,T.status.fetchError=x.signal.reason,Pe)T.status.fetchAbortIgnored=!0}else T.status.fetchResolved=!0;if(Le&&!Pe&&!Ke)return fe(x.signal.reason);let nt=Re;if(this.#e[c]===Re)if(Te===void 0)if(nt.__staleWhileFetching)this.#e[c]=nt.__staleWhileFetching;else this.#b(i,"fetch");else{if(T.status)T.status.fetchUpdated=!0;this.set(i,Te,B.options)}return Te},le=(Te)=>{if(T.status)T.status.fetchRejected=!0,T.status.fetchError=Te;return fe(Te)},fe=(Te)=>{let{aborted:Ke}=x.signal,Le=Ke&&T.allowStaleOnFetchAbort,Pe=Le||T.allowStaleOnFetchRejection,nt=Pe||T.noDeleteOnFetchRejection,et=Re;if(this.#e[c]===Re){if(!nt||et.__staleWhileFetching===void 0)this.#b(i,"fetch");else if(!Le)this.#e[c]=et.__staleWhileFetching}if(Pe){if(T.status&&et.__staleWhileFetching!==void 0)T.status.returnedStale=!0;return et.__staleWhileFetching}else if(et.__returned===et)throw Te},Ce=(Te,Ke)=>{let Le=this.#w?.(i,w,B);if(Le&&Le instanceof Promise)Le.then((Pe)=>Te(Pe===void 0?void 0:Pe),Ke);x.signal.addEventListener("abort",()=>{if(!T.ignoreFetchAbort||T.allowStaleOnFetchAbort){if(Te(void 0),T.allowStaleOnFetchAbort)Te=(Pe)=>z(Pe,!0)}})};if(T.status)T.status.fetchDispatched=!0;let Re=new Promise(Ce).then(z,le),xe=Object.assign(Re,{__abortController:x,__staleWhileFetching:w,__returned:void 0});if(c===void 0)this.set(i,xe,{...B.options,status:void 0}),c=this.#o.get(i);else this.#e[c]=xe;return xe}#t(i){if(!this.#T)return!1;let c=i;return!!c&&c instanceof Promise&&c.hasOwnProperty("__staleWhileFetching")&&c.__abortController instanceof Oa}async fetch(i,c={}){let{allowStale:T=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:w=this.noDeleteOnStaleGet,ttl:x=this.ttl,noDisposeOnSet:U=this.noDisposeOnSet,size:B=0,sizeCalculation:z=this.sizeCalculation,noUpdateTTL:le=this.noUpdateTTL,noDeleteOnFetchRejection:fe=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Ce=this.allowStaleOnFetchRejection,ignoreFetchAbort:Re=this.ignoreFetchAbort,allowStaleOnFetchAbort:xe=this.allowStaleOnFetchAbort,context:Te,forceRefresh:Ke=!1,status:Le,signal:Pe}=c;if(!this.#T){if(Le)Le.fetch="get";return this.get(i,{allowStale:T,updateAgeOnGet:D,noDeleteOnStaleGet:w,status:Le})}let nt={allowStale:T,updateAgeOnGet:D,noDeleteOnStaleGet:w,ttl:x,noDisposeOnSet:U,size:B,sizeCalculation:z,noUpdateTTL:le,noDeleteOnFetchRejection:fe,allowStaleOnFetchRejection:Ce,allowStaleOnFetchAbort:xe,ignoreFetchAbort:Re,status:Le,signal:Pe},et=this.#o.get(i);if(et===void 0){if(Le)Le.fetch="miss";let rt=this.#v(i,et,nt,Te);return rt.__returned=rt}else{let rt=this.#e[et];if(this.#t(rt)){let It=T&&rt.__staleWhileFetching!==void 0;if(Le){if(Le.fetch="inflight",It)Le.returnedStale=!0}return It?rt.__staleWhileFetching:rt.__returned=rt}let At=this.#m(et);if(!Ke&&!At){if(Le)Le.fetch="hit";if(this.#I(et),D)this.#D(et);if(Le)this.#R(Le,et);return rt}let ht=this.#v(i,et,nt,Te),Tt=ht.__staleWhileFetching!==void 0&&T;if(Le){if(Le.fetch=At?"stale":"refresh",Tt&&At)Le.returnedStale=!0}return Tt?ht.__staleWhileFetching:ht.__returned=ht}}async forceFetch(i,c={}){let T=await this.fetch(i,c);if(T===void 0)throw Error("fetch() returned undefined");return T}memo(i,c={}){let T=this.#P;if(!T)throw Error("no memoMethod provided to constructor");let{context:D,forceRefresh:w,...x}=c,U=this.get(i,x);if(!w&&U!==void 0)return U;let B=T(i,U,{options:x,context:D});return this.set(i,B,x),B}get(i,c={}){let{allowStale:T=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:w=this.noDeleteOnStaleGet,status:x}=c,U=this.#o.get(i);if(U!==void 0){let B=this.#e[U],z=this.#t(B);if(x)this.#R(x,U);if(this.#m(U)){if(x)x.get="stale";if(!z){if(!w)this.#b(i,"expire");if(x&&T)x.returnedStale=!0;return T?B:void 0}else{if(x&&T&&B.__staleWhileFetching!==void 0)x.returnedStale=!0;return T?B.__staleWhileFetching:void 0}}else{if(x)x.get="hit";if(z)return B.__staleWhileFetching;if(this.#I(U),D)this.#D(U);return B}}else if(x)x.get="miss"}#F(i,c){this.#p[c]=i,this.#c[i]=c}#I(i){if(i!==this.#s){if(i===this.#l)this.#l=this.#c[i];else this.#F(this.#p[i],this.#c[i]);this.#F(this.#s,i),this.#s=i}}delete(i){return this.#b(i,"delete")}#b(i,c){let T=!1;if(this.#r!==0){let D=this.#o.get(i);if(D!==void 0)if(T=!0,this.#r===1)this.#B(c);else{this.#L(D);let w=this.#e[D];if(this.#t(w))w.__abortController.abort(Error("deleted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(w,i,c);if(this.#d)this.#i?.push([w,i,c])}if(this.#o.delete(i),this.#n[D]=void 0,this.#e[D]=void 0,D===this.#s)this.#s=this.#p[D];else if(D===this.#l)this.#l=this.#c[D];else{let x=this.#p[D];this.#c[x]=this.#c[D];let U=this.#c[D];this.#p[U]=this.#p[D]}this.#r--,this.#E.push(D)}}if(this.#d&&this.#i?.length){let D=this.#i,w;while(w=D?.shift())this.#_?.(...w)}return T}clear(){return this.#B("delete")}#B(i){for(let c of this.#C({allowStale:!0})){let T=this.#e[c];if(this.#t(T))T.__abortController.abort(Error("deleted"));else{let D=this.#n[c];if(this.#O)this.#g?.(T,D,i);if(this.#d)this.#i?.push([T,D,i])}}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.#l=0,this.#s=0,this.#E.length=0,this.#h=0,this.#r=0,this.#d&&this.#i){let c=this.#i,T;while(T=c?.shift())this.#_?.(...T)}}}function Ca(i,c,T=100){let D=new Aa({max:T}),w=(...x)=>{let U=c(...x),B=D.get(U);if(B!==void 0)return B;let z=i(...x);return D.set(U,z),z};return w.cache={clear:()=>D.clear(),size:()=>D.size,delete:(x)=>D.delete(x),get:(x)=>D.peek(x),has:(x)=>D.has(x),set:(x,U)=>void D.set(x,U)},w}var P4=8192;function Nm(i,c){try{return{ok:!0,value:JSON.parse(be(i))}}catch(T){if(c)ue(_n(T,`safeParseJSON: invalid JSON (${T instanceof Error?T.constructor.name:typeof T}, ${i.length} bytes)`));return{ok:!1}}}class vm{cached=Ca(Nm,(i)=>i,50);cache=this.cached.cache;parse(i,c){return this.cached(i,c)}}var xm=new vm;var ir=Object.assign(function(c,T=!0){if(!c)return null;let D=c.length>P4?Nm(c,T):xm.parse(c,T);return D.ok?D.value:null},{cache:xm.cache});function km(i){let c;try{Nc(be(i),{onError:(T,D,w,x,U)=>{c??={line:x+1,column:U+1}}},{disallowComments:!0})}catch{}return c}import{accessSync as Bm,constants as Fc,lstatSync as Mm,readlinkSync as x4,realpath as N4,realpathSync as v4}from"fs";import{access as k4}from"fs/promises";import{basename as Uue,dirname as M4,join as Uc,parse as U4,resolve as Hc,sep as Um}from"path";import{promisify as H4}from"util";function zm(i,c,T,D,w){let x=l(),U=Km(i,c,T,D),B=U.next();while(!B.done){let z;try{z=F4(x,B.value,w)}catch(le){B=U.throw(le);continue}B=U.next(z)}return B.value}async function Gm(i,c,T,D){let w=l(),x=Km(i,c,T,D),U=x.next();while(!U.done){let B;try{B=await B4(w,U.value)}catch(z){U=x.throw(z);continue}U=x.next(B)}return U.value}var Wm={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function F4(i,{ask:c,path:T},D){switch(c){case"isLink":{let w=i.lstatSync(T);return D.set(T,{uid:w.uid,gid:w.gid,mode:w.mode}),w.isSymbolicLink()}case"networkJunction":return Fe(i,T,Wm);case"realpath":return re(v4.native(T));case"writable":return Bm(T,Fc.W_OK),!0}}async function B4(i,{ask:c,path:T}){switch(c){case"isLink":return(await i.lstat(T)).isSymbolicLink();case"networkJunction":return Et(i,T,Wm);case"realpath":return re(await H4(N4.native)(T));case"writable":return await k4(T,Fc.W_OK),!0}}function*Km(i,c,T,D){let w=Uc(i,...c),x;try{if(x=yield*kc(Hc(i),D),!x){let le=i,fe=!1;for(let[Ce,Re]of c.entries())if(le=Uc(le,Re),fe=Ce===c.length-1?T??(yield*kc(le)):yield*kc(le,D),fe)break;if(!fe)return null}}catch{return null}if(x){let le=jm()?yield*Hm(yield*Mc(w)):"unknown";return{path:w,folder:i,kind:"outside",targetWritable:le}}let U=yield*Mc(w),B=yield*Mc(i);if(U==="gone"||B==="gone")return null;if(B==="unverified"||"network"in B||U==="unverified")return{path:w,folder:i,kind:"unverified"};if("real"in U&&Vt(B.real,U.real))return{path:w,folder:i,kind:"inside"};let z=yield*Hm(U);return{path:w,folder:i,kind:"outside",targetWritable:z}}function*kc(i,c){let T=c?.get(i);if(T===void 0)T=(yield{ask:"isLink",path:i})===!0,c?.set(i,T);return T}function*Mc(i){if(bn(i)&&!H(i))return{network:i};try{let c=yield{ask:"networkJunction",path:i};if(c===j||c===Ue)return"unverified";if(typeof c==="string")return{network:c};let T=yield{ask:"realpath",path:i};return typeof T==="string"?{real:T}:"unverified"}catch(c){let T=r(c);return T==="ENOENT"||T==="ENOTDIR"?"gone":"unverified"}}function jm(){try{let i=m();return i!=="windows"&&i!=="wsl"}catch{return!1}}function*Hm(i){try{if(typeof i==="string"||!("real"in i)||!jm())return"unknown";let c=yield*Fm(i.real);if(c==="yes")return"yes";let T=yield*Fm(M4(i.real));if(T==="yes")return"yes";return c==="no"&&T==="no"?"no":"unknown"}catch{return"unknown"}}function*Fm(i){try{return yield{ask:"writable",path:i},"yes"}catch(c){return $m(c)}}function $m(i){switch(r(i)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}function Bc(i){try{return Bm(i,Fc.W_OK),"yes"}catch(c){return $m(c)}}function Vm(i,c){return{uids:c===void 0||c===i?[i]:[i,c],groups:()=>[...process.getgroups?.()??[],...process.getegid?[process.getegid()]:[],...process.getgid?[process.getgid()]:[]]}}function zc(i,c,T){for(let D of i.uids){let w=hn({file:c,folder:T,posix:!0,euid:D,groups:i.groups});if(w!==!1)return w}return!1}var z4=40;function Ym(i,c,T){let D=Hc(i);try{for(let w=0;w<=z4;w++){let x=U4(D).root,U,B=D.slice(x.length).split(Um).filter(Boolean),z;for(let[le,fe]of B.entries()){let Ce=T.get(x);if(Ce===void 0){U??=Mm(x);let Te={uid:U.uid,gid:U.gid,mode:U.mode};Ce=zc(c,Te,Te)===!1&&Bc(x)==="no",T.set(x,Ce)}if(!Ce)return!0;let Re=Uc(x,fe);if(T.has(Re)){x=Re,U=void 0;continue}let xe=Mm(Re);if(xe.isSymbolicLink()){let Te=x4(Re),Ke=Te.split(Um).filter((Le)=>Le&&Le!==".");if(Ke.lastIndexOf("..")>Ke.findIndex((Le)=>Le!==".."))return!0;z=Hc(x,Te,...B.slice(le+1));break}x=Re,U=xe}if(z===void 0)return!1;D=z}}catch{}return!0}import{join as G4}from"path";class Xm{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=K4(),this.managedFilePath}getDropInDir(){return this.dropInDir??=G4($o(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var W4=new Xm;function $o(){return W4.getManagedFilePath()}function K4(){let i=j4();if(i!==void 0)return i;switch(m()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function j4(){return}var Jm="cc-plugin-sec-default";var Zm={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 kpe=new Set(Object.keys(Zm));function qm(){let i=Wt.CLAUDE_CODE_ENTRYPOINT;return Wt.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&!Wt.CLAUDE_CODE_REMOTE&&!_m()&&(i==="claude-desktop-3p"||i==="local-agent"&&Wt.CLAUDE_CODE_DESKTOP_APP_VERSION==="")}var X4=new Set(["claude-desktop-3p","local-agent"]);function Gc(){let i=Wt.CLAUDE_CODE_ENTRYPOINT;return i!==void 0&&X4.has(i)}var Qm=new Set(["claude-desktop","claude-desktop-3p"]);function js(){return!1}function eg(){return js()&&J4()}function J4(){return Wt.CLAUDE_CODE_HOST_GATEWAY_LINEAGE&&!!Wt.CLAUDE_CODE_HOST_CREDS_FILE}var Wc=new Set(Ps);function tg(){let i=Wt.CLAUDE_CODE_ENTRYPOINT;return i!==void 0&&Wc.has(i)}function ng(){let i=Kc();return i!==void 0&&Wc.has(i)}function og(){let i=Kt()?Tn():void 0;return i!==void 0&&Wc.has(i)}function Z4(i){return i?.startsWith("remote")===!0}class rg{entrypoint=void 0;interactive=!1;spawnedByAttendedSession=void 0;childSession=!1;hasRemoteSessionOrContainerId=!1;claudecode=!1;hostManagedRunnerChild=!1;coworkFrameArtifacts=!1;hostScheduledRun=!1;desktopSkillSwitches=!1;desktopConnectorNames=!1;desktopWorkflowLimitWait=!1;desktopModeFromRecord=!1;desktopMessageCard=!1;desktopResultFirst=!1;desktopPluginInstallFrames=!1;hostUnattendedGrant=void 0;sdkMcpToolIdleTimeoutMs=void 0;desktopAppHostMark=!1;chromeTabGroupKey=void 0;hostAssignedGroup=void 0;hostGuest=void 0;hostTestVm=void 0;hostSkillCatalog=void 0;shownPluginsDir=void 0;desktopSkillsPluginDir=void 0;remoteControlOwnerDeclared=!1;remoteRelayMark=void 0;offPersonsMachine=!1;setEntrypoint(i){this.entrypoint=i}setInteractive(i){this.interactive=i}setSpawnedByAttendedSession(i){this.spawnedByAttendedSession=i}setChildSession(i){this.childSession=i}setHasRemoteSessionOrContainerId(i){this.hasRemoteSessionOrContainerId=i}setClaudecode(i){this.claudecode=i}setHostManagedRunnerChild(i){this.hostManagedRunnerChild=i}setDesktopAppHostMark(i){this.desktopAppHostMark=i}setCoworkFrameArtifacts(i){this.coworkFrameArtifacts=i}setHostScheduledRun(i){this.hostScheduledRun=i}setDesktopSkillSwitches(i){this.desktopSkillSwitches=i}setDesktopConnectorNames(i){this.desktopConnectorNames=i}setDesktopWorkflowLimitWait(i){this.desktopWorkflowLimitWait=i}setDesktopModeFromRecord(i){this.desktopModeFromRecord=i}setDesktopMessageCard(i){this.desktopMessageCard=i}setDesktopResultFirst(i){this.desktopResultFirst=i}setDesktopPluginInstallFrames(i){this.desktopPluginInstallFrames=i}setHostUnattendedGrant(i){this.hostUnattendedGrant=i}setSdkMcpToolIdleTimeoutMs(i){this.sdkMcpToolIdleTimeoutMs=i}setChromeTabGroupKey(i){this.chromeTabGroupKey=i}setHostSkillCatalog(i){this.hostSkillCatalog=i}setShownPluginsDir(i){this.shownPluginsDir=i}setDesktopSkillsPluginDir(i){this.desktopSkillsPluginDir=i}setRemoteControlOwnerDeclared(i){this.remoteControlOwnerDeclared=i}setRemoteRelayMark(i){this.remoteRelayMark=this.remoteRelayMark===!0||i}setOffPersonsMachine(i){this.offPersonsMachine||=i}setHostGuest(i){this.hostGuest=i}setHostTestVm(i){this.hostTestVm=i}setHostAssignedGroup(i){this.hostAssignedGroup=i}}var q4=new s(()=>new rg);function Q4(){return q4.of(A().host)}function Kc(){return Q4().entrypoint}var eJ=new Set(["claude-vscode","claude-desktop","claude-desktop-3p","local-agent","local_agent","remote","remote_desktop","remote_mobile","remote_projects","remote_cowork","ssh-remote","claude-in-slack","claude_in_slack","claude-in-teams","claude-coworker","claude-coworker-terminal"]),tJ=new Set([...eJ].filter(Z4)),Mpe=new Set([...tJ].filter((i)=>i!=="remote_cowork"&&i!=="remote_mobile"));var Upe=new Set([...Ps,"remote","remote_desktop","remote_mobile","remote_projects","remote_trigger"]);var $s=["low","medium","high","xhigh","max"];var ar=/^(?:Read|Edit)\((?:\.\/)?!/;var Kn=e(()=>[{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:["disableWindowsBashCommandSplit"],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:["permissions","blockWritesOutsideWorkingDirectories"],restrictive:!0},{path:["permissions","denyInsteadOfPrompting"],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:["responseComparisonEnabled"],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:$s},{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","allowNestedUserNamespaces"],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","windows","backend"],restrictive:"sandboxuser"},{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}]),jpe=e(()=>new Set([]));function Oo(i){return Array.isArray(i)?i:[i]}function Lt(i,c){let T=i;for(let D of c){if(T===null||typeof T!=="object")return;T=T[D]}return T}function vt(i,c,T){let D=[i],w=i;for(let U of c.slice(0,-1)){let B={...w[U]};w[U]=B,w=B,D.push(w)}let x=c.at(-1);if(T!==void 0){w[x]=T;return}delete w[x];for(let U=D.length-1;U>0;U--){if(Object.keys(D[U]).length>0)break;delete D[U-1][c[U-1]]}}function lr(i,c){let T=Lt(c,i.path);return i.normalize===void 0?T:i.normalize(T)}var jc=`${Jm}@builtin`,nJ=["sec-default@builtin"],ba=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly","forceHotReloadPrompt"]),setAside:Object.freeze(["allowModsToOverrideDenyRules"])});function qr(){return oJ()??tg()}function Vs(){return qr()||og()}function oJ(){try{return Kc()===void 0?void 0:ng()}catch(i){ue(i);return}}function Ra(i){let c=new Map([...nJ,jc].flatMap((w)=>{let x=Lt(i,["pluginConfigs",w,"options"]);return Object.entries(n(x)?x:{}).filter(([,U])=>U===!1||$c(U))})),T={};for(let w of ba.policyModOptions){let x=c.get(w);if($c(x))T[w]=x}return Object.keys(T).length>0?{[jc]:{options:T}}:void 0}function Ta(i){let c={};for(let w of ba.settings){let x=Lt(i,[w]);if(ig(x))c[w]=x}let T=Ra(i);if(T!==void 0)c.pluginConfigs=T;return Object.keys(c).length>0?{...c,managedSourcesBehavior:"merge"}:{}}function Vc(i,c){let T=rJ.filter(({path:w,holds:x})=>x(Lt(i,w))&&!x(Lt(c,w)));if(T.length===0)return c;let D={...c};for(let{path:w}of T)vt(D,w,Lt(i,w));return{...D,managedSourcesBehavior:"merge"}}function ig(i){return i===!0}function $c(i){return i!==!1&&(["string","number","boolean"].includes(typeof i)||Array.isArray(i)&&i.every((c)=>typeof c==="string"))}var rJ=[...ba.settings.map((i)=>({path:[i],holds:ig})),...ba.policyModOptions.map((i)=>({path:["pluginConfigs",jc,"options",i],holds:$c}))];var sJ=a({asks:void 0,isAsking:!1,readAs:void 0,told:void 0},(i)=>{i.asks=void 0,i.isAsking=!1,i.readAs=void 0,i.told=void 0});function Da(){let i=sJ;if(i.isAsking)return i.readAs??=qr(),i.readAs;let c=qr();if(i.asks!==void 0){i.isAsking=!0;try{c=i.asks()}finally{i.isAsking=!1}}let T=i.readAs!==void 0&&i.readAs!==c;if(i.readAs=c,T)ce().invalidatePolicyLayer();return c}var iJ="[object Map]",aJ="[object Set]",lJ=Object.prototype,cJ=lJ.hasOwnProperty;function dJ(i){if(i==null)return!0;if(to(i)&&(Nt(i)||typeof i=="string"||typeof i.splice=="function"||eo(i)||Fo(i)||ro(i)))return!i.length;var c=so(i);if(c==iJ||c==aJ)return!i.size;if(Bo(i))return!ra(i).length;for(var T in i)if(cJ.call(i,T))return!1;return!0}var La=dJ;function uJ(i){return function(c,T,D){var w=-1,x=Object(c),U=D(c),B=U.length;while(B--){var z=U[i?B:++w];if(T(x[z],z,x)===!1)break}return c}}var ag=uJ;var pJ=ag(),Ia=pJ;function fJ(i,c){return i&&Ia(i,c,Eo)}var wa=fJ;function mJ(i,c){var T={};return c=So(c,3),wa(i,function(D,w,x){Wo(T,w,c(D,w,x))}),T}var Pa=mJ;function gJ(i,c,T){if(T!==void 0&&!go(i[c],T)||T===void 0&&!(c in i))Wo(i,c,T)}var Ys=gJ;var ug=typeof Na=="object"&&Na&&!Na.nodeType&&Na,lg=ug&&typeof xa=="object"&&xa&&!xa.nodeType&&xa,_J=lg&&lg.exports===ug,cg=_J?en.Buffer:void 0,dg=cg?cg.allocUnsafe:void 0;function hJ(i,c){if(c)return i.slice();var T=i.length,D=dg?dg(T):new i.constructor(T);return i.copy(D),D}var Xs=hJ;function EJ(i){var c=new i.constructor(i.byteLength);return new vr(c).set(new vr(i)),c}var Qr=EJ;function SJ(i,c){var T=c?Qr(i.buffer):i.buffer;return new i.constructor(T,i.byteOffset,i.length)}var va=SJ;function yJ(i,c){var T=-1,D=i.length;c||(c=Array(D));while(++T<D)c[T]=i[T];return c}var ka=yJ;var pg=Object.create,OJ=function(){function i(){}return function(c){if(!Zt(c))return{};if(pg)return pg(c);i.prototype=c;var T=new i;return i.prototype=void 0,T}}(),fg=OJ;function AJ(i){return typeof i.constructor=="function"&&!Bo(i)?fg(jr(i)):{}}var Ma=AJ;function CJ(i){return on(i)&&to(i)}var mg=CJ;var bJ="[object Object]",RJ=Function.prototype,TJ=Object.prototype,gg=RJ.toString,DJ=TJ.hasOwnProperty,LJ=gg.call(Object);function IJ(i){if(!on(i)||Gn(i)!=bJ)return!1;var c=jr(i);if(c===null)return!0;var T=DJ.call(c,"constructor")&&c.constructor;return typeof T=="function"&&T instanceof T&&gg.call(T)==LJ}var Ua=IJ;function wJ(i,c){if(c==="constructor"&&typeof i[c]==="function")return;if(c=="__proto__")return;return i[c]}var Js=wJ;function PJ(i,c,T,D){var w=!T;T||(T={});var x=-1,U=c.length;while(++x<U){var B=c[x],z=D?D(T[B],i[B],B,T,i):void 0;if(z===void 0)z=i[B];if(w)Wo(T,B,z);else Kr(T,B,z)}return T}var oo=PJ;function xJ(i){return oo(i,yo(i))}var _g=xJ;function NJ(i,c,T,D,w,x,U){var B=Js(i,T),z=Js(c,T),le=U.get(z);if(le){Ys(i,T,le);return}var fe=x?x(B,z,T+"",i,c,U):void 0,Ce=fe===void 0;if(Ce){var Re=Nt(z),xe=!Re&&eo(z),Te=!Re&&!xe&&Fo(z);if(fe=z,Re||xe||Te)if(Nt(B))fe=B;else if(mg(B))fe=ka(B);else if(xe)Ce=!1,fe=Xs(z,!0);else if(Te)Ce=!1,fe=va(z,!0);else fe=[];else if(Ua(z)||ro(z)){if(fe=B,ro(B))fe=_g(B);else if(!Zt(B)||wr(B))fe=Ma(z)}else Ce=!1}if(Ce)U.set(z,fe),w(fe,z,D,x,U),U.delete(z);Ys(i,T,fe)}var hg=NJ;function Eg(i,c,T,D,w){if(i===c)return;Ia(c,function(x,U){if(w||(w=new _o),Zt(x))hg(i,c,U,T,Eg,D,w);else{var B=D?D(Js(i,U),x,U+"",i,c,w):void 0;if(B===void 0)B=x;Ys(i,U,B)}},yo)}var Sg=Eg;function vJ(i,c,T){switch(T.length){case 0:return i.call(c);case 1:return i.call(c,T[0]);case 2:return i.call(c,T[0],T[1]);case 3:return i.call(c,T[0],T[1],T[2])}return i.apply(c,T)}var yg=vJ;var Og=Math.max;function kJ(i,c,T){return c=Og(c===void 0?i.length-1:c,0),function(){var D=arguments,w=-1,x=Og(D.length-c,0),U=Array(x);while(++w<x)U[w]=D[c+w];w=-1;var B=Array(c+1);while(++w<c)B[w]=D[w];return B[c]=T(U),yg(i,this,B)}}var Ha=kJ;function MJ(i){return function(){return i}}var Ag=MJ;var UJ=!Wr?Gr:function(i,c){return Wr(i,"toString",{configurable:!0,enumerable:!1,value:Ag(c),writable:!0})},Cg=UJ;var HJ=800,FJ=16,BJ=Date.now;function zJ(i){var c=0,T=0;return function(){var D=BJ(),w=FJ-(D-T);if(T=D,w>0){if(++c>=HJ)return arguments[0]}else c=0;return i.apply(void 0,arguments)}}var bg=zJ;var GJ=bg(Cg),Fa=GJ;function WJ(i,c){return Fa(Ha(i,c,Gr),i+"")}var Rg=WJ;function KJ(i,c,T){if(!Zt(T))return!1;var D=typeof c;if(D=="number"?to(T)&&Ho(c,T.length):D=="string"&&(c in T))return go(T[c],i);return!1}var Tg=KJ;function jJ(i){return Rg(function(c,T){var D=-1,w=T.length,x=w>1?T[w-1]:void 0,U=w>2?T[2]:void 0;if(x=i.length>3&&typeof x=="function"?(w--,x):void 0,U&&Tg(T[0],T[1],U))x=w<3?void 0:x,w=1;c=Object(c);while(++D<w){var B=T[D];if(B)i(c,B,D,x)}return c})}var Dg=jJ;var $J=Dg(function(i,c,T,D){Sg(i,c,T,D)}),un=$J;function VJ(i,c){var T=-1,D=i==null?0:i.length;while(++T<D)if(c(i[T],T,i)===!1)break;return i}var Lg=VJ;function YJ(i,c){return i&&oo(c,Eo(c),i)}var Ig=YJ;function XJ(i,c){return i&&oo(c,yo(c),i)}var wg=XJ;function JJ(i,c){return oo(i,Ur(i),c)}var Pg=JJ;function ZJ(i,c){return oo(i,ma(i),c)}var xg=ZJ;var qJ=Object.prototype,QJ=qJ.hasOwnProperty;function e3(i){var c=i.length,T=new i.constructor(c);if(c&&typeof i[0]=="string"&&QJ.call(i,"index"))T.index=i.index,T.input=i.input;return T}var Ng=e3;function t3(i,c){var T=c?Qr(i.buffer):i.buffer;return new i.constructor(T,i.byteOffset,i.byteLength)}var vg=t3;var n3=/\w*$/;function o3(i){var c=new i.constructor(i.source,n3.exec(i));return c.lastIndex=i.lastIndex,c}var kg=o3;var Mg=sn?sn.prototype:void 0,Ug=Mg?Mg.valueOf:void 0;function r3(i){return Ug?Object(Ug.call(i)):{}}var Hg=r3;var s3="[object Boolean]",i3="[object Date]",a3="[object Map]",l3="[object Number]",c3="[object RegExp]",d3="[object Set]",u3="[object String]",p3="[object Symbol]",f3="[object ArrayBuffer]",m3="[object DataView]",g3="[object Float32Array]",_3="[object Float64Array]",h3="[object Int8Array]",E3="[object Int16Array]",S3="[object Int32Array]",y3="[object Uint8Array]",O3="[object Uint8ClampedArray]",A3="[object Uint16Array]",C3="[object Uint32Array]";function b3(i,c,T){var D=i.constructor;switch(c){case f3:return Qr(i);case s3:case i3:return new D(+i);case m3:return vg(i,T);case g3:case _3:case h3:case E3:case S3:case y3:case O3:case A3:case C3:return va(i,T);case a3:return new D;case l3:case u3:return new D(i);case c3:return kg(i);case d3:return new D;case p3:return Hg(i)}}var Fg=b3;var R3="[object Map]";function T3(i){return on(i)&&so(i)==R3}var Bg=T3;var zg=ho&&ho.isMap,D3=zg?Fr(zg):Bg,Gg=D3;var L3="[object Set]";function I3(i){return on(i)&&so(i)==L3}var Wg=I3;var Kg=ho&&ho.isSet,w3=Kg?Fr(Kg):Wg,jg=w3;var P3=1,x3=2,N3=4,$g="[object Arguments]",v3="[object Array]",k3="[object Boolean]",M3="[object Date]",U3="[object Error]",Vg="[object Function]",H3="[object GeneratorFunction]",F3="[object Map]",B3="[object Number]",Yg="[object Object]",z3="[object RegExp]",G3="[object Set]",W3="[object String]",K3="[object Symbol]",j3="[object WeakMap]",$3="[object ArrayBuffer]",V3="[object DataView]",Y3="[object Float32Array]",X3="[object Float64Array]",J3="[object Int8Array]",Z3="[object Int16Array]",q3="[object Int32Array]",Q3="[object Uint8Array]",e6="[object Uint8ClampedArray]",t6="[object Uint16Array]",n6="[object Uint32Array]",Mt={};Mt[$g]=Mt[v3]=Mt[$3]=Mt[V3]=Mt[k3]=Mt[M3]=Mt[Y3]=Mt[X3]=Mt[J3]=Mt[Z3]=Mt[q3]=Mt[F3]=Mt[B3]=Mt[Yg]=Mt[z3]=Mt[G3]=Mt[W3]=Mt[K3]=Mt[Q3]=Mt[e6]=Mt[t6]=Mt[n6]=!0;Mt[U3]=Mt[Vg]=Mt[j3]=!1;function Ba(i,c,T,D,w,x){var U,B=c&P3,z=c&x3,le=c&N3;if(T)U=w?T(i,D,w,x):T(i);if(U!==void 0)return U;if(!Zt(i))return i;var fe=Nt(i);if(fe){if(U=Ng(i),!B)return ka(i,U)}else{var Ce=so(i),Re=Ce==Vg||Ce==H3;if(eo(i))return Xs(i,B);if(Ce==Yg||Ce==$g||Re&&!w){if(U=z||Re?{}:Ma(i),!B)return z?xg(i,wg(U,i)):Pg(i,Ig(U,i))}else{if(!Mt[Ce])return w?i:{};U=Fg(i,Ce,B)}}x||(x=new _o);var xe=x.get(i);if(xe)return xe;if(x.set(i,U),jg(i))i.forEach(function(Le){U.add(Ba(Le,c,T,Le,i,x))});else if(Gg(i))i.forEach(function(Le,Pe){U.set(Pe,Ba(Le,c,T,Pe,i,x))});var Te=le?z?$r:ks:z?yo:Eo,Ke=fe?void 0:Te(i);return Lg(Ke||i,function(Le,Pe){if(Ke)Pe=Le,Le=i[Pe];Kr(U,Pe,Ba(Le,c,T,Pe,i,x))}),U}var Xg=Ba;function o6(i){var c=i==null?0:i.length;return c?i[c-1]:void 0}var Jg=o6;function r6(i,c,T){var D=-1,w=i.length;if(c<0)c=-c>w?0:w+c;if(T=T>w?w:T,T<0)T+=w;w=c>T?0:T-c>>>0,c>>>=0;var x=Array(w);while(++D<w)x[D]=i[D+c];return x}var Zg=r6;function s6(i,c){return c.length<2?i:Go(i,Zg(c,0,-1))}var qg=s6;var i6=Object.prototype,a6=i6.hasOwnProperty;function l6(i,c){c=no(c,i);var T=-1,D=c.length;if(!D)return!0;while(++T<D){var w=Wn(c[T]);if(w==="__proto__"&&!a6.call(i,"__proto__"))return!1;if((w==="constructor"||w==="prototype")&&T<D-1)return!1}var x=qg(i,c);return x==null||delete x[Wn(Jg(c))]}var za=l6;function c6(i){return Ua(i)?void 0:i}var Qg=c6;var e_=sn?sn.isConcatSpreadable:void 0;function d6(i){return Nt(i)||ro(i)||!!(e_&&i&&i[e_])}var t_=d6;function n_(i,c,T,D,w){var x=-1,U=i.length;T||(T=t_),w||(w=[]);while(++x<U){var B=i[x];if(c>0&&T(B))if(c>1)n_(B,c-1,T,D,w);else Mr(w,B);else if(!D)w[w.length]=B}return w}var o_=n_;function u6(i){var c=i==null?0:i.length;return c?o_(i,1):[]}var r_=u6;function p6(i){return Fa(Ha(i,void 0,r_),i+"")}var Ga=p6;var f6=1,m6=2,g6=4,_6=Ga(function(i,c){var T={};if(i==null)return T;var D=!1;if(c=Lr(c,function(x){return x=no(x,i),D||(D=x.length>1),x}),oo(i,$r(i),T),D)T=Xg(T,f6|m6|g6,Qg);var w=c.length;while(w--)za(T,c[w]);return T}),In=_6;function h6(i,c,T,D){var w=-1,x=i==null?0:i.length;while(++w<x){var U=i[w];c(D,U,T(U),i)}return D}var s_=h6;function E6(i,c){return function(T,D){if(T==null)return T;if(!to(T))return i(T,D);var w=T.length,x=c?w:-1,U=Object(T);while(c?x--:++x<w)if(D(U[x],x,U)===!1)break;return T}}var i_=E6;var S6=i_(wa),a_=S6;function y6(i,c,T,D){return a_(i,function(w,x,U){c(D,w,T(w),U)}),D}var l_=y6;function O6(i,c){return function(T,D){var w=Nt(T)?s_:l_,x=c?c():{};return w(T,i,So(D,2),x)}}var c_=O6;var A6=c_(function(i,c,T){i[T?0:1].push(c)},function(){return[[],[]]}),d_=A6;function C6(i,c){return fa(i,c,function(T,D){return pa(i,D)})}var u_=C6;var b6=Ga(function(i,c){return i==null?{}:u_(i,c)}),Vo=b6;function R6(i,c){return i==null?!0:za(i,c)}var p_=R6;import{homedir as lee}from"os";import{basename as cee,dirname as Yl,join as pn,resolve as Ft,sep as dee}from"path";var Yo="$defaults";var T6=["user_allow_rules_to_replace","user_soft_deny_rules_to_replace","user_hard_deny_rules_to_replace","user_environment_to_replace"];var D6=["account_standing_rule_changes","auto_mode_bypass","blind_apply","browser_file_upload_exfil","browser_input_exfil","browser_js_exfil","browser_navigate_exfil","browser_shortcut_execution","chatops_trigger_comments","ci_bypass","cloud_storage_mass_delete","cluster_wide_workload_creation","code_from_external","code_that_leaks_when_run","command_network_lists","containment_escape","create_public_surface","create_rce_surface","create_unsafe_agents","credential_exploration","credential_leakage","credential_materialization","data_exfiltration","dns_domain_cert_changes","excess_sensitive_detail","exfil_scouting","expose_local_services","external_ingress_tunnel","external_system_writes","feature_flag_writes","git_destructive","instruction_poisoning","interfere_with_workloads","irreversible_deletion_general","irreversible_local_destruction","live_shared_artifact_sensitive_delta","logging_audit_tampering","merge_without_review","modify_shared_resources","node_lifecycle_operations","out_of_place_publication","package_registry_bypass","permission_grant","pii_data_handling","production_deploy","production_reads","protected_scope_iac_apply","public_data_sharing_upload","real_world_transactions","remote_repoint","remote_shell_writes","safety_bypass_flag","sandbox_network_callback","secret_store_writes","security_test_removal","security_weaken","self_approval","self_modification","sensitive_remote_exec","sensitive_source_provenance","session_transcript_tampering","shared_cluster_mutation","shared_scratch_sweep","third_party_attack","tls_auth_weaken","tmux_self_drive","traffic_redirection","unauthorized_persistence","unrequested_artifact_publish","unrequested_commit_in_a_connected_app","untrusted_code_integration","unverifiable_deletion_scope","unverifiable_deletion_target"],L6=["cowork_delete_grant","cowork_folder_access","cowork_run_routine_now","cowork_scheduled_task_delete","cowork_scheduled_task_write","cowork_skill_persistence"],I6=["access_added_as_a_means","bot_check_circumvention","consent_given_for_the_user","identity_not_given","notes_for_later_sessions","save_over_an_occupied_name","stated_interface_sidestepped","walled_content_from_a_copy","website_access_circumvention"],w6=["destructive_or_unwanted_actions","unauthorized_access","undermining_oversight","unsanctioned_communication"];var P6=[],f_=new Set([...D6,...P6]),ihe=new Set([...f_,...I6,...w6]),ahe=new Set([...f_,...L6]);function Wa(i){for(let c=0;c<i.length;c++){let T=i.charCodeAt(c);if(T<32&&T!==9||T>=127&&T<=159||T===8232||T===8233)return!0}return!1}var x6=/[\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029\u2800\uFFF9-\uFFFB\u{1D173}-\u{1D17A}]/u;function Ka(i){return x6.test(i)}function m_(i){if(i.includes("<settings_")||T6.some((c)=>i.includes(`<${c}`)||i.includes(`</${c}`)))return"template_token";if(i.includes("<cc_automode")||i.includes("</cc_automode"))return"region_tag";return null}function g_(i){return i.trim().length>0&&!Wa(i)&&!Ka(i)&&m_(i)===null}var N6="Expected a function";function v6(i){if(typeof i!="function")throw TypeError(N6);return function(){var c=arguments;switch(c.length){case 0:return!i.call(this);case 1:return!i.call(this,c[0]);case 2:return!i.call(this,c[0],c[1]);case 3:return!i.call(this,c[0],c[1],c[2])}return!i.apply(this,c)}}var __=v6;function k6(i,c){return Vr(i,__(So(c)))}var cr=k6;import{posix as wE,win32 as PE}from"path";import*as Z from"zod/v4";import{isAbsolute as h_}from"path";import*as it from"zod/v4";var Yc="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",M6="When managed settings or a --settings file set allowUnsandboxedCommands: false, network.deniedDomains "+"or a WebFetch(domain:…) deny rule, when managed settings set network.allowManagedDomainsOnly: true, "+"or when managed, --settings or user settings set network.strictAllowlist: true",U6="When managed settings or a --settings file set allowUnsandboxedCommands: false, filesystem.denyRead, "+"a Read(…) deny rule or a credentials.files entry (deny or mask), or managed settings set network.allowManagedDomainsOnly: true",H6="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",Ao="project settings (.claude/settings.json and .claude/settings.local.json)",es=`${Yc}, values from ${Ao} are ignored.`,ja=`${Yc}, true from ${Ao} is ignored (false there still applies).`,E_=`${Yc}, and managed, --settings or user settings set true, false from ${Ao} is ignored (true there still applies).`,S_=`${M6}, values from ${Ao} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,F6=`${U6}, a value from ${Ao} that would re-open a path managed, --settings or user settings deny reading is ignored, as is one spelled as a glob or a network path (UNC or automount); one carving out of the project's own denyRead still applies. A value inside a directory sandboxed commands can write is re-checked before every command and dropped once it has been re-pointed into a denied path.`,B6=`${es} ${H6}, a value from ${Ao} under or equal to a denied path, or spelled as a glob or a network path (UNC or automount), is ignored. A value inside a directory sandboxed commands can already write is re-checked before every command and dropped once it has been re-pointed into a denied read path.`,z6=e(()=>it.object({allowedDomains:it.array(it.string()).optional().describe("Domains sandboxed commands may reach without a prompt (wildcards such as *.example.com supported). "+"Merged with WebFetch(domain:…) allow rules and across settings sources. "+es+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:it.array(it.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:it.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 — "+`${Ao} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:it.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:it.array(it.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+es),allowAllUnixSockets:it.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+ja),allowLocalBinding:it.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+ja),allowMachLookup:it.array(it.string().refine((i)=>!(i.endsWith("*")?i.slice(0,-1):i).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. Each entry lets sandboxed commands reach services outside the sandbox, and the sandbox does not confine what those services do for them. Merged across settings sources. '+es),httpProxyPort:it.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+S_),socksProxyPort:it.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+S_),tlsTerminate:it.object({caCertPath:it.string().min(1).optional(),caKeyPath:it.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()),G6=e(()=>it.object({allowWrite:it.array(it.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+B6),denyWrite:it.array(it.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:it.array(it.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:it.array(it.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+F6),allowManagedReadPathsOnly:it.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:it.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 false, so sandboxed commands keep going through the permission flow unless it is set to true. 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 y_(i,c,T){if(i.length===0||i.some((D)=>D.length===0))T.addIssue({code:it.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(c===void 0)T.addIssue({code:it.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 O_(i,c){let T;try{T=new RegExp(i)}catch(w){c.addIssue({code:it.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${h(w)}`});return}if(new RegExp(T.source+"|").exec("").length-1<1)c.addIssue({code:it.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 A_(i){if(typeof i!=="object"||i===null)return i;let c=i;if(c.mode!=="deny")return i;let T={...c};if("extract"in T&&typeof T.extract!=="string")delete T.extract;if("onExtractNoMatch"in T&&T.onExtractNoMatch!=="warn"&&T.onExtractNoMatch!=="deny"&&T.onExtractNoMatch!=="error")delete T.onExtractNoMatch;if("decode"in T&&T.decode!=="jwt")delete T.decode;if("maskClaims"in T&&!(Array.isArray(T.maskClaims)&&T.maskClaims.every((D)=>typeof D==="string")))delete T.maskClaims;if("maskDuplicates"in T&&typeof T.maskDuplicates!=="boolean")delete T.maskDuplicates;if("injectHosts"in T&&!(Array.isArray(T.injectHosts)&&T.injectHosts.every((D)=>typeof D==="string")))delete T.injectHosts;return T}var $a=e(()=>it.preprocess(A_,it.object({path:it.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:it.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:it.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:it.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:it.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:it.array(it.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:it.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:it.array(it.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((i,c)=>{if(i.mode==="mask"&&i.path.endsWith("/"))c.addIssue({code:it.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(i.mode==="mask"&&i.extract!==void 0)O_(i.extract,c);if(i.mode==="mask"&&i.maskClaims!==void 0)y_(i.maskClaims,i.decode,c)}))),ts=()=>it.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"),Va=e(()=>it.preprocess(A_,it.object({name:ts().describe("Environment variable name."),mode:it.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:it.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:it.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:it.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:it.array(it.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:it.array(it.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((i,c)=>{if(i.mode==="mask"&&i.extract!==void 0)O_(i.extract,c);if(i.mode==="mask"&&i.maskClaims!==void 0)y_(i.maskClaims,i.decode,c);if(i.mode==="mask"&&i.decode!==void 0&&i.extract!==void 0)c.addIssue({code:it.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(i.mode==="mask"&&i.decode!==void 0&&(i.onExtractNoMatch==="deny"||i.onExtractNoMatch==="error"))c.addIssue({code:it.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)."})}))),Xo=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var Xc="_INVALID_PAIR_",Ya="_PARENT_PAIR_SUPPRESSOR_";var Xa=e(()=>it.object({accessKeyIdVar:ts().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:ts().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:ts().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((i,c)=>{let T=new Map;for(let[D,w]of[["accessKeyIdVar",i.accessKeyIdVar],["secretAccessKeyVar",i.secretAccessKeyVar],["sessionTokenVar",i.sessionTokenVar]]){if(w===void 0)continue;let x=T.get(w);if(x!==void 0)c.addIssue({code:it.ZodIssueCode.custom,path:[D],message:`${D} names the same env var ('${w}') as ${x} — each pair member must be a distinct variable.`});else T.set(w,D)}})),W6=e(()=>{let i=it.enum(["deny","passthrough"]);return it.object({streaming:i.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:i.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:i.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),K6=e(()=>it.object({files:it.array($a()).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:it.array(Va()).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:it.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:it.array(Xa()).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:W6().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((i,c)=>{let T=new Set;for(let[D,w]of(i?.awsPairs??[]).entries()){let x=[["accessKeyIdVar",w.accessKeyIdVar],["secretAccessKeyVar",w.secretAccessKeyVar],["sessionTokenVar",w.sessionTokenVar]],U=new Set;for(let[B,z]of x){if(z===void 0)continue;if(T.has(z))c.addIssue({code:it.ZodIssueCode.custom,path:["awsPairs",D,B],message:`"${z}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});U.add(z)}for(let B of U)T.add(B)}}).optional()),Ja=e(()=>it.object({enabled:it.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+E_),failIfUnavailable:it.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. A Claude Code on the web, scheduled-task or Cowork cloud session (Anthropic's cloud container, which has no command sandbox) starts anyway with a warning: the container isolates it, and the sandbox.filesystem and sandbox.network rules in settings are not enforced there. "+E_),autoAllowBashIfSandboxed:it.boolean().optional().describe("macOS and Linux/WSL only: approve a Bash command that will run inside the sandbox without a permission prompt, unless a deny rule, a command-specific ask rule or a safety check stops it. Default: false, so sandboxed commands go through the same permission flow as any other command. Has no effect on native Windows."),allowUnsandboxedCommands:it.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. A false in managed, --settings or user settings holds whatever ${Ao} say (false there still applies).`),network:z6(),filesystem:G6(),credentials:K6(),windows:it.object({backend:it.enum(["sandboxuser","mxc"]).optional().describe(`Windows only: how sandboxed commands are confined. "sandboxuser" (default) runs them as the dedicated sandbox account that the sandbox set-up creates. "mxc" runs them in a Microsoft eXecution Container (BaseContainer) through the MXC SDK, with no install step; experimental. Claude Code ignores "mxc" and uses the sandbox account, with a note in /sandbox, when this build lacks the MXC SDK, when a higher settings tier or another managed source sets network.tlsTerminate, or when an administrator requires the sandbox or locks reads (filesystem.allowManagedReadPathsOnly) unless managed settings picked "mxc" and no other managed source sets network.allowManagedDomainsOnly. On "mxc" only the PowerShell tool is enabled and Bash commands are refused (MXC cannot run Git Bash yet); network.tlsTerminate and network.allowLocalBinding do not apply. Read from user, managed/policy or --settings settings only; a value in ${Ao} is ignored.`)}).optional().describe("@internal Settings of the sandbox on native Windows."),ignoreViolations:it.record(it.string(),it.array(it.string())).optional().describe('Sandbox violations to leave unreported: a map of command patterns ("*" for every command) to the filesystem paths whose violations are ignored. Merged across settings sources. '+es),enableWeakerNestedSandbox:it.boolean().optional().describe("Linux only: Run without the fresh /proc mount, for hosts such as unprivileged Docker containers that cannot create one. "+"**Reduces security** — the host /proc stays readable by sandboxed commands. Default: false. "+ja),allowNestedUserNamespaces:it.boolean().optional().describe("Linux/WSL only: Let sandboxed commands create user namespaces of their own, which the sandbox refuses by default. Needed by tools that sandbox themselves that way, such as Chromium's and Electron's sandbox, a nested bubblewrap, and `unshare`. "+"**Removes code-execution isolation** — in any folder a hostile command may write, it can then bypass filesystem.denyWrite, filesystem.denyRead, credentials.files entries and the paths the sandbox always write-protects (such as .claude/settings.json, git hooks and git config), "+"and so plant code that later runs outside the sandbox; while autoAllowBashIfSandboxed is on, the command that plants it needs no approval. Default: false. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+`true from ${Ao} is ignored (false there still applies).`),enableWeakerNetworkIsolation:it.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. "+ja),allowAppleEvents:it.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:it.array(it.string()).optional().describe("Command patterns (Bash permission-rule syntax) for commands to run outside the sandbox. An entry takes a call out of the sandbox only when every command in the call matches an entry: in a Bash pipe or a chain such as `a && b`, each part needs its own match. Some calls stay sandboxed whatever the entries, such as one with a `cd`, a command substitution, or a redirect other than a file-descriptor duplication like `2>&1`, a heredoc included. A convenience, not a security boundary: excluded commands still go through the permission flow. Merged across settings sources. "+es),ripgrep:it.object({command:it.string(),args:it.array(it.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:it.preprocess((i)=>typeof i==="string"&&h_(i)?i:void 0,it.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:it.preprocess((i)=>typeof i==="string"&&h_(i)?i:void 0,it.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()),She=e(()=>Ja().omit({windows:!0}));import*as Zs from"zod/v4";var dr=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],$6=[...dr],C_=$6;function ns(i){return i==="manual"?"default":i}var Ahe=`Cannot set permission mode: must be one of ${dr.join(", ")}`;var Che={dangerousRemoval:{bypassImmune:!0,waivableInBypass:!0,classifierRouted:!0,autoModeDeny:!0,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},backgroundOperator:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},suspiciousWindowsPath:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!0,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},isolatePeerMachines:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},restrictedMode:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},outsideReadsBlocked:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},claudeSettingsFile:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},internalHardDeny:{bypassImmune:!1,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!0},connectorFileSend:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!1,localProjectionOnly:!1,servedUnplaceable:!1},unfinishedCheck:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},...{},...{}};var V6=["auto_mode_no_check_in_session","auto_mode_stop_no_check_in_session","auto_mode_stop_no_result_for_calls","auto_mode_stop_no_verdict"],bhe=["classifier_transcript_too_long","outside_reads_blocked","memory_paused",...V6];var b_=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var R_=["normal","vim"];var T_=["auto","12-hour","24-hour","24-hour-utc"],qs=["auto","tmux","iterm2","in-process"],Y6=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],D_=["auto",...Y6],L_=["auto","alwaysAsk","disabled"],I_=1e5,w_=1e4;import*as P_ from"zod/v4";import*as io from"zod/v4/core";var X6=io.$ZodType,J6=P_.ZodType,Jc=io.$constructor("ZodDeferredOptional",(i,c)=>{X6.init(i,c),J6.init(i,c),i._zod.optin="optional",i._zod.optout="optional",Object.defineProperty(i._zod,"innerType",{get:c.built,configurable:!0}),i._zod.processJSONSchema=(T,D,w)=>{let x=c.getter();io.process(x,T,w),T.seen.get(i).ref=x},io.util.defineLazy(i._zod,"values",()=>{let T=c.getter()._zod.values;return T?new Set([...T,void 0]):void 0}),io.util.defineLazy(i._zod,"pattern",()=>{let T=c.getter()._zod.pattern;return T?new RegExp(`^(${io.util.cleanRegex(T.source)})?$`):void 0}),io.util.defineLazy(i._zod,"propValues",()=>c.getter()._zod.propValues),i._zod.parse=(T,D)=>{if(T.value===void 0)return T;return c.getter()._zod.run(T,D)},i.unwrap=c.getter});function jn(i){let c;return new Jc({type:"lazy",getter:()=>{if(c===void 0){let D=i();if(D._zod.optin!==void 0)throw Error("deferredOptional(): the schema the build callback returned already handles a missing key itself (.optional(), .catch(), .default(), .prefault(), z.preprocess(), or a union or wrapper holding one). Return the plain schema and let deferredOptional() make it optional, or use that schema with .optional() without deferring it.");c=D}return c},built:()=>c})}import*as tt from"zod/v4";var Z6=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function x_(i){return new RegExp(Z6).test(i)}var N_=/[\p{Pi}\p{Pf}\u201a\u201e\u201f\u2e32\u2e34\u2e41\u2e49\u2e42\u3003\u300c-\u300f\ufe41-\ufe44\u301d-\u301f\u275b-\u2760\u276e\u276f\u{1f676}-\u{1f678}\u2032-\u2037\u2057\u02b9\u02ba\u0374\u02bd-\u02bf\u02c8\u02d2\u02d3\u02ca\u02ce\u02cf\u02dd\u02f4-\u02f6\u02ee\u00b4\u0384\u0385\u1fbd\u1fbf\u1fcd-\u1fcf\u1fdd-\u1fdf\u1ffd\u1ffe\u05f3\u05f4\u0559-\u055b\u07f4\u07f5\ua67f\ua78b\ua78c\uff02\uff07\uff62\uff63]/gu,v_=/(?<![^\s\p{P}])\p{M}+/gu,q6=/[\p{Quotation_Mark}\u02BA\u02DD\u02EE\u02F5\u02F6\u05F2\u05F4\u1425\u1CD3\u2033\u2034\u2036\u2037\u2057\u275B-\u2760\u3003\u309B\uFF9E\u{1F676}-\u{1F678}]/gu,Ihe=new RegExp(`${N_.source}|${q6.source}`,"gu");function Q6(i){return Ze(n9(Ye(i))).replace(/ {2,}/g," ").trim()}var e9=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,t9=4;function n9(i){let c=i;for(let T=0;T<t9;T++){let D=c.replace(e9,"");if(D===c)break;c=D}return c}function Zc(i,c=160){return o9(Q6(r9(i,c)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(v_,""),c)}var Fhe=new RegExp(`[^\\S ]|[${W}]`,"u");function o9(i,c=2000){return i.length>c?`${Se(i,c)}…`:i}function r9(i,c){let T=Se(i,c*8);if(T.length===i.length)return T;let D=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(T);if(D===null)return T;let w=i.slice(D.index);return(w[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(w):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(w))?T.slice(0,D.index):T}var Ghe=a({accepted:!1},(i)=>{i.accepted=!1});function qc(i){let c=u9();return Object.hasOwn(c,i)?c[i]:i}var k_="workspace",Jhe=`mcp__${k_}__bash`,Zhe=`mcp__${k_}__web_fetch`;function Qs(i){return i.includes("*")}function i9(i){return i.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function a9(i){return l9(i).replaceAll("\\\\","\\")}function l9(i){return i.replaceAll("\\(","(").replaceAll("\\)",")")}function Qc(i){if(typeof i==="string"&&!i.includes("(")&&!i.includes(")"))return{kind:"bare"};let c=c9(i,"("),T=d9(i,")");if(c===-1&&T===-1)return{kind:"bare"};let D=i.substring(0,c);if(c===-1||T<=c||T!==i.length-1||/[()]/.test(D))return{kind:"malformed"};return{kind:"call",toolName:D,rawContent:i.substring(c+1,T)}}function M_(i){let c=Qc(i);if(c.kind!=="call"||!c.toolName)return{toolName:qc(i)};if(c.rawContent===""||c.rawContent==="*")return{toolName:qc(c.toolName)};let T=a9(c.rawContent);return{toolName:qc(c.toolName),ruleContent:T}}function Pn(i){if(!i.ruleContent)return i.toolName;let c=i9(i.ruleContent);return`${i.toolName}(${c})`}function c9(i,c){for(let T=0;T<i.length;T++)if(i[T]===c){let D=0,w=T-1;while(w>=0&&i[w]==="\\")D++,w--;if(D%2===0)return T}return-1}function d9(i,c){for(let T=i.length-1;T>=0;T--)if(i[T]===c){let D=0,w=T-1;while(w>=0&&i[w]==="\\")D++,w--;if(D%2===0)return T}return-1}function u9(){return qe}function ei(i){let c=i.replace(/[^a-zA-Z0-9_-]/g,"_");if(i.startsWith("claude.ai "))c=c.replace(/_+/g,"_").replace(/^_|_$/g,"");return c}function U_(){return{active:!1,enforcesGrants:!1,readLegacyKeyOwner:()=>{return},claimLegacyKeyOwner:async()=>{return},legacyKeyOwners:new Map,unsavedLegacyKeys:new Set,refusedLegacyKeys:new Map,claimedMayNotOwn:new Set,notedMayNotOwn:new Set,needsRebuild:!1,servers:new Map,tools:new Map,wireByInternal:new Map,internalByWire:new Map,wireKeyByInternalKey:new Map,internalKeyByWireKey:new Map,keptLegacyNames:0,serverKeyMoved:!1,sessionKeyById:new Map,formerKeys:new Map,formerSessionKeys:new Map,spelledKeys:new Map,otherDenyOrAskNames:new Map,retiredWireNames:new Map,wireHolders:new Map,sentWires:new Map}}var CEe=new _e(U_),bEe=new s(()=>({used:!1})),REe=U_();function p9(i,c){return i.value===!c&&i.source==="payload"&&i.defaultHost?!c:c}class ur{reader=null;register(i){let c=this.reader;return this.reader=i,c}read(i,c){let T=this.reader;if(!T)return c;try{return p9(T(i,c),c)}catch{return c}}}var IEe=new ur;var xEe=new ur;var os="mcp__";function rs(i){if(!i.startsWith(os))return null;let c=i.indexOf("__",os.length);if(c===-1){let T=i.slice(os.length);return T?{serverName:T,toolName:void 0}:null}if(c===os.length)return null;return{serverName:i.slice(os.length,c),toolName:i.slice(c+2)}}function ed(i){return`${os}${ei(i)}__`}function H_(i){return rs(`${ed(i)}t`)===null}function F_(i){return i in Object.prototype&&H_(i)}var Za="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";var lSe=e(()=>tt.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"]));var m9=/^[A-Za-z0-9_-]+$/;var ss=e(()=>tt.literal("comms").optional().catch(void 0)),Jo=e(()=>tt.number().int().positive()),g9=300000,B_=e(()=>tt.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function z_({request_timeout_ms:i,...c}){return{...c,...c.timeout===void 0&&i!==void 0&&{timeout:Math.min(i,g9)}}}var _9=e(()=>tt.object({type:tt.literal("stdio").optional(),command:tt.string().min(1,"Command cannot be empty"),args:tt.array(tt.string()).default([]),env:tt.record(tt.string(),tt.string()).optional(),timeout:Jo().optional(),alwaysLoad:tt.boolean().optional(),bareElicitationCapability:tt.boolean().optional(),role:ss()})),h9=e(()=>tt.boolean()),E9=65536,is=()=>tt.string().refine((i)=>i.length<=E9,{abort:!0,message:"url is too long"}),S9=4096,G_=e(()=>tt.object({clientId:tt.string().optional(),callbackPort:tt.number().int().positive().optional(),authServerMetadataUrl:tt.string().refine((i)=>i.length<=S9,{abort:!0,message:"authServerMetadataUrl is too long"}).url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:tt.string().min(1).optional(),xaa:h9().optional()})),td=e(()=>tt.object({name:tt.string(),permission_policy:tt.enum(["always_allow","always_ask","always_deny"]).optional()}));function W_(){return{}}var K_=e(()=>tt.object({type:tt.literal("sse"),url:is(),headers:tt.record(tt.string(),tt.string()).optional(),headersHelper:tt.string().optional(),oauth:G_().optional(),timeout:Jo().optional(),request_timeout_ms:B_(),tools:tt.array(td()).optional(),alwaysLoad:tt.boolean().optional(),displayName:tt.string().optional().catch(void 0),bareElicitationCapability:tt.boolean().optional(),discoveryCache:tt.boolean().optional(),role:ss(),toolPermissions:tt.record(tt.string(),sd()).optional(),...W_()}).transform(z_)),y9=e(()=>tt.object({type:tt.literal("sse-ide"),url:is(),ideName:tt.string(),ideRunningInWindows:tt.boolean().optional(),timeout:Jo().optional(),alwaysLoad:tt.boolean().optional(),role:ss()})),O9=e(()=>tt.object({type:tt.literal("ws-ide"),url:is(),ideName:tt.string(),authToken:tt.string().optional(),ideRunningInWindows:tt.boolean().optional(),timeout:Jo().optional(),alwaysLoad:tt.boolean().optional(),role:ss()})),j_=e(()=>tt.object({type:tt.enum(["http","streamable-http"]).transform(()=>"http"),url:is(),headers:tt.record(tt.string(),tt.string()).optional(),headersHelper:tt.string().optional(),oauth:G_().optional(),timeout:Jo().optional(),request_timeout_ms:B_(),tools:tt.array(td()).optional(),alwaysLoad:tt.boolean().optional(),displayName:tt.string().optional().catch(void 0),bareElicitationCapability:tt.boolean().optional(),discoveryCache:tt.boolean().optional(),role:ss(),toolPermissions:tt.record(tt.string(),sd()).optional(),...W_()}).transform(z_)),A9=["command","args","env","headersHelper"],C9=new Set(["http","streamable-http","sse"]),b9=/[\p{Cc}\p{Cf}\u2028\u2029]/u,R9=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function nd(i){return/^[A-Za-z0-9_-]+$/.test(i)&&!F_(i)&&i!=="constructor"&&i!=="prototype"}function T9(i){try{let c=new URL(i);return c.protocol==="https:"&&c.hostname!==""}catch{return!1}}function $_(i,c="",T=0){if(typeof i==="string")return[[c,i,!1]];if(T>4||i===null||typeof i!=="object")return[];return Object.entries(i).flatMap(([D,w])=>{let x=D.replace(R9,(B)=>`\\u${B.codePointAt(0).toString(16).padStart(4,"0")}`),U=c?`${c}.${x}`:x;return[[U,D,!0],...$_(w,U,T+1)]})}var od=e(()=>tt.record(tt.string(),tt.unknown()).check((i)=>{let c=(D,w)=>{i.issues.push({code:"custom",path:D,message:w,input:i.value})};for(let D of A9)if(Object.hasOwn(i.value,D))c([D],`"${D}" 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(!C9.has(i.value.type))c(["type"],'managed settings can only deliver "http" or "sse" servers');let T=i.value.url;if(typeof T==="string"&&!T9(T))c(["url"],"managed settings servers must use a valid https:// url");for(let[D,w,x]of $_(i.value))if(b9.test(w))c(D.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(!x&&x_(w))c(D.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(tt.union([j_(),K_()]))),rd=`"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 qa(i,c){if(i===void 0)return;if(i===null||typeof i!=="object"||Array.isArray(i)){c("",rd);return}let T=Object.create(null);for(let[D,w]of Object.entries(i)){if(!nd(D)){c("<invalid name>",Za);continue}let x=od().safeParse(w);if(x.success){T[D]=x.data;continue}let U=x.error.issues[0];c(D,U?[U.path.join("."),U.message].filter(Boolean).join(": "):"failed validation")}return T}var D9=e(()=>tt.object({type:tt.literal("ws"),url:is(),headers:tt.record(tt.string(),tt.string()).optional(),headersHelper:tt.string().optional(),timeout:Jo().optional(),alwaysLoad:tt.boolean().optional(),bareElicitationCapability:tt.boolean().optional(),role:ss()})),L9=e(()=>tt.object({type:tt.literal("sdk"),name:tt.string(),timeout:Jo().optional(),alwaysLoad:tt.boolean().optional(),disableAutoBackground:tt.boolean().optional().catch(void 0),tools:tt.array(td()).optional().catch(void 0),connectorId:tt.string().min(1).optional().catch(void 0),autoModeVerdictTools:tt.array(tt.string()).optional().catch(void 0),dataFlowServer:I9().optional().catch(void 0),onPersonsMachine:tt.object({exceptTools:tt.array(tt.string())}).optional().catch({exceptTools:[]})})),I9=e(()=>tt.union([tt.object({type:tt.literal("anthropic"),id:tt.string().min(1)}),tt.object({type:tt.literal("claude_ai_connector"),id:tt.string().min(1),directory_id:tt.string().min(1).nullable()}),tt.object({type:tt.literal("client_configured"),transport:tt.enum(["stdio","http","in_process"]),plugin_id_hash:tt.string().min(1).optional()})])),sd=e(()=>tt.enum(["allow","ask","blocked"])),w9=e(()=>tt.object({type:tt.literal("claudeai-proxy"),url:is(),id:tt.string().regex(m9),displayName:tt.string().optional(),urlReportable:tt.boolean().optional(),noDirectoryEntry:tt.boolean().optional(),iconUrl:tt.string().optional(),timeout:Jo().optional(),alwaysLoad:tt.boolean().optional(),toolPermissions:tt.record(tt.string(),sd()).optional(),stateless:tt.boolean().optional(),cachedInitResponse:tt.record(tt.string(),tt.unknown()).nullish(),discoverSupport:tt.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:tt.record(tt.string(),tt.unknown()).nullish(),eligible:tt.boolean().nullish(),ineligibleReason:tt.string().nullish(),enterpriseManaged:tt.boolean().optional()})),Qa=e(()=>tt.union([_9(),K_(),y9(),O9(),j_(),D9(),L9(),w9()]));var cSe=e(()=>tt.object({mcpServers:tt.record(tt.string(),Qa())}));import*as el from"zod/v4";var ti=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],P9=/^anthropic[A-Z][A-Za-z0-9]*$/,x9=new Set(ti);function id(i){return typeof i==="string"&&x9.has(i)}function ad(i){return id(i)||typeof i==="string"&&P9.test(i)}var pr="Your session can't run on this machine",pSe=`${pr}: its requests must go to Anthropic's API or a cloud provider this machine is set up for, so a gateway, a custom endpoint, or a project's provider, credential or model settings aren't allowed. Remove the setting, such as ANTHROPIC_BASE_URL, from wherever it's set, or ask whoever runs this machine to.`,fSe=`${pr}: an env entry in a project's .claude settings file changes the provider settings, credentials, proxy, certificates, headers, request body or auto mode settings this machine is set up with. Remove that entry, set the same value on the machine, or ask whoever runs this machine to.`,mSe=`${pr}: none of the models allowed for its auto mode check can be used here. Ask whoever runs this machine to update Claude Code or use a provider that offers one of them, and ask your organization's administrator whether its model settings block them or, on Microsoft Foundry, to map one to a deployment.`,gSe=[`${pr}: its requests must go straight to Anthropic's API, and this machine sends them somewhere else. Remove what does that, or ask whoever runs this machine to. It is usually a setting such as CLAUDE_CODE_USE_BEDROCK or ANTHROPIC_BASE_URL, in the environment, in managed settings or in a Claude Code settings file such as the project's .claude/settings.json.`,`${pr}: its requests must go to Anthropic's API, or straight to a cloud provider Anthropic allows for these sessions with no custom endpoint, and this machine sends them somewhere else. Remove the custom endpoint, gateway or provider setting that does that, in the environment, managed settings or a Claude Code settings file, or ask whoever runs this machine to.`,`${pr}: it needs the server's auto mode check, and CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS turns that off here. Remove it from the environment, managed settings or the Claude Code settings file that sets it, or ask whoever runs this machine to.`],_Se=`${pr}: it needs the server's auto mode check, and your organization's compliance policy rules that out, so this kind of session can't run for your organization.`;import*as as from"zod/v4";var SSe=m()==="macos"?"⏺":"●";var N9=new Set(["Claude Preview","Claude Browser"]),v9=new Set(["claude-in-chrome","Claude in Chrome"]),kSe=new Set([...v9,...N9]);var k9=["Claude_Browser__"],M9=["claude-in-chrome__","Claude_in_Chrome__"],MSe=[...k9,...M9];var $Se=e(()=>as.preprocess(ns,as.enum(C_))),VSe=e(()=>as.preprocess(ns,as.enum(dr)));import{posix as r5,win32 as s5}from"path";import*as de from"zod/v4";var V_={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var ld=Object.keys(V_);var F9=`${ld.slice(0,-1).join(", ")} or `+String(ld.at(-1));import{isIPv4 as W9,isIPv6 as K9}from"net";var B9=/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,z9=/^[0-9a-f]{1,4}$/i,G9=/%[0-9a-z.:-]+$/i;function tl(i){if(!i.includes(":")){let le=i.split(".");return le.length===4&&le.every((fe)=>B9.test(fe))?le.map(Number):void 0}let c=i.replace(G9,""),T=c.lastIndexOf(":")+1,D=tl(c.slice(T)),w=(D?c.slice(0,T)+"0:0":c).split("::").map((le)=>le?le.split(":"):[]),[x=[],U]=w,B=8-w.flat().length;if(w.length>2||(U?B<1:B!==0)||!w.flat().every((le)=>z9.test(le)))return;let z=[...x,...Array(B).fill("0"),...U??[]].flatMap((le)=>[parseInt(le,16)>>8,parseInt(le,16)&255]);return D?[...z.slice(0,12),...D]:z}var j9=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"]),X_=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]),$9=new Set(["fd00:ec2::254","fd00:ec2::23","fd20:ce::254","fd00:c1::a9fe:a9fe","fd00:a9fe:a9fe::1"].map((i)=>String(tl(i))));function J_(i,c,T,D){return i===127||i===169&&c===254||i===0}function V9(i){return Z_(i)&&i[4]===0&&i[5]===1}function Z_(i){return i[0]===0&&i[1]===100&&i[2]===255&&i[3]===155}function Y9(i){let c=[];if(i[0]===32&&i[1]===2)c.push(i.slice(2,6));let T=i.slice(0,10).every((B)=>B===0),D=T&&i[10]===255&&i[11]===255,w=T&&i[10]===0&&i[11]===0,x=Z_(i)&&i.slice(4,12).every((B)=>B===0),U=(i[8]===0||i[8]===2)&&i[9]===0&&i[10]===94&&i[11]===254;if(D||w||x||U)c.push(i.slice(12,16));return c}function q_(i){let c=i.toLowerCase().replace(/^\[|\]$/g,"");if(c.endsWith("."))c=c.slice(0,-1);if(c===""||c==="localhost"||c.endsWith(".localhost"))return!0;if(j9.has(c))return!0;if(c.startsWith("instance-data.")&&c.endsWith(".compute.internal"))return!0;if(W9(c)){if(X_.has(c))return!0;let[D=0,w=0,x=0,U=0]=c.split(".").map(Number);return J_(D,w,x,U)}if(!K9(c))return!1;let T=tl(c);if(T===void 0)return!0;if(V9(T))return!0;if(T.every((D)=>D===0))return!0;if(T.slice(0,15).every((D)=>D===0)&&T[15]===1)return!0;if($9.has(String(T)))return!0;if(T[0]===254&&(T[1]??0)>=128&&(T[1]??0)<=191)return!0;return Y9(T).some((D)=>{let[w=0,x=0,U=0,B=0]=D;return J_(w,x,U,B)||X_.has(`${w}.${x}.${U}.${B}`)})}import*as mt from"zod/v4";var Q_=["bash","powershell"];import*as eh from"zod/v4";var th=e(()=>eh.enum(["continue","block"]).optional());var ni=e(()=>mt.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.')),nh=e(()=>th().describe("What a failure of this hook does: it could not start (a missing script or plugin directory), timed out, exited with a code other than 0 or 2, or printed JSON that is invalid or fails validation. 'continue' (default): the failure is reported and the action goes ahead. 'block': the failure counts as exit code 2, so the action the event guards (a tool call, a permission request, a prompt) is blocked. Ignored for async hooks and on Stop, SubagentStop, TaskCompleted and TeammateIdle."));function X9(){let i=mt.object({type:mt.literal("command").describe("Shell command hook type"),command:mt.string().describe("Shell command to execute"),args:mt.array(mt.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:ni(),shell:mt.enum(Q_).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:mt.number().positive().optional().describe("Timeout in seconds for this specific command"),onFailure:nh(),statusMessage:mt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:mt.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:mt.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:mt.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:mt.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:mt.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:mt.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).")}),c=mt.object({type:mt.literal("prompt").describe("LLM prompt hook type"),prompt:mt.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:ni(),timeout:mt.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:mt.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:mt.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:mt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:mt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),T=mt.object({type:mt.literal("mcp_tool").describe("MCP tool hook type"),server:mt.string().describe("Name of an already-configured MCP server to invoke"),tool:mt.string().describe("Name of the tool on that server to call"),input:mt.record(mt.string(),mt.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:ni(),timeout:mt.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:mt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:mt.boolean().optional().describe("If true, hook runs once and is removed after execution")}),D=mt.object({type:mt.literal("http").describe("HTTP hook type"),url:mt.string().url().describe("URL to POST the hook input JSON to"),if:ni(),timeout:mt.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:nh(),headers:mt.record(mt.string(),mt.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. Content-Length and Transfer-Encoding given here are ignored: Claude Code works out the request\'s length from its body.'),allowedEnvVars:mt.array(mt.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:mt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:mt.boolean().optional().describe("If true, hook runs once and is removed after execution"),cloud:mt.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).")}),w=mt.object({type:mt.literal("agent").describe("Agentic verifier hook type"),prompt:mt.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:ni(),timeout:mt.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:mt.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:mt.string().optional().describe("Custom status message to display in spinner while hook runs"),once:mt.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:i,PromptHookSchema:c,HttpHookSchema:D,AgentHookSchema:w,McpToolHookSchema:T}}var nl=e(()=>{let{BashCommandHookSchema:i,PromptHookSchema:c,AgentHookSchema:T,HttpHookSchema:D,McpToolHookSchema:w}=X9();return mt.discriminatedUnion("type",[...[i,c,T,D,w]])}),cd=e(()=>mt.object({matcher:mt.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:mt.array(nl()).describe("List of hooks to execute when the matcher matches")})),gr=e(()=>mt.partialRecord(mt.enum(X),mt.array(cd())));function ol(){return new Set(nl().options.map((i)=>i.shape.type.value))}function J9(i,c){if(!i||typeof i!=="object"||Array.isArray(i)){let w=fr(i);return{problem:`Hook entry must be an object; received ${w}`,received:w,aboutType:!1}}let T=i.type;if(typeof T!=="string"){let w=fr(T);return{problem:T===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${w}`,received:w,aboutType:!0}}if(!c.has(T)){let w=pt(T);return{problem:`Unknown hook type "${w}"`,received:w,aboutType:!0}}let D=nl().safeParse(i);if(!D.success)return{problem:`Invalid ${T} hook (${oh(D.error)})`,received:T,aboutType:!1};return}function oh(i){return i.issues.map((c)=>c.path.length>0?`${c.path.join(".")}: ${c.message}`:c.message).join("; ")}function rl(i){if(!i||typeof i!=="object"||Array.isArray(i))return!1;if(!("matcher"in i)&&Object.keys(i).some((T)=>X.includes(T)))return!1;let c=i.hooks;if(Array.isArray(c))return c.length>0;return!!c&&typeof c==="object"&&(("matcher"in i)||typeof c.type==="string")}function mr(i,c=3,{matchersCount:T=!0,unscannedKeys:D=Z9,inHooksList:w=!1}={}){if(ih(i))return!0;if(T&&rl(i))return!0;if(c===0||!i||typeof i!=="object")return!1;if(Array.isArray(i))return i.some((x)=>mr(x,c-1,{matchersCount:T,unscannedKeys:D,inHooksList:w}));if(w&&typeof i.type==="string")return!1;return Object.entries(i).some(([x,U])=>!D.has(x)&&mr(U,c-1,{unscannedKeys:D,matchersCount:T&&!X.includes(x),inHooksList:x==="hooks"&&Array.isArray(U)}))}function rh(i,c){if(!i||typeof i!=="object"||Array.isArray(i))return!1;return ih(i)||Object.entries(i).some(([T,D])=>T!=="hooks"&&!c.has(T)&&mr(D,3,{unscannedKeys:c,matchersCount:!X.includes(T)}))}var Z9=new Set,sh=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),q9=new Set(["metadata","mcpServers","lspServers"]),_ye=new Set([...q9,"experimental"]);function ih(i){if(!i||typeof i!=="object"||Array.isArray(i))return!1;return Object.entries(i).some(([c,T])=>oi.has(c)&&T!==null&&T!==void 0&&!(Array.isArray(T)&&T.length===0))}function dd(i){if(rl(i))return!0;if(Array.isArray(i))return i.some(dd);if(!i||typeof i!=="object")return!1;return Object.entries(i).some(([c,T])=>oi.has(c)&&T!==null&&T!==void 0&&!(Array.isArray(T)&&T.length===0))}var oi=new Set(["PreToolUse","PermissionRequest"]);function ah(i,c){if(!Array.isArray(i))return{stripped:[],unloadableGuards:[]};let T=oi.has(c),D=ol(),w=cd(),x=[],U=[];for(let B=i.length-1;B>=0;B--){let z=i[B],le=(xe,Te)=>{if(!T)i.splice(B,1);x.push({hookIndex:void 0,path:`${B}`,problem:xe,received:Te,aboutType:!1})};if(mr(z,3,{matchersCount:!1})){(T?x:U).push({hookIndex:void 0,path:`${B}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:fr(z),aboutType:!1});continue}if(!z||typeof z!=="object"||Array.isArray(z)){le(`Hook matcher must be an object; received ${fr(z)}`,fr(z));continue}let fe=z.hooks;if(!Array.isArray(fe)){le(`Hook matcher "hooks" must be an array of hook entries; received ${fr(fe)}`,fr(fe));continue}let Ce=[];for(let xe=fe.length-1;xe>=0;xe--){let Te=J9(fe[xe],D);if(Te!==void 0){if(!T)fe.splice(xe,1);Ce.push({hookIndex:xe,path:`${B}.hooks.${xe}`,...Te})}}let Re=w.safeParse(T?{...z,hooks:[]}:z);if(!Re.success){le(`Invalid hook matcher (${oh(Re.error)})`,"matcher");continue}x.push(...Ce)}return x.reverse(),U.reverse(),T?{stripped:[],unloadableGuards:x}:{stripped:x,unloadableGuards:U}}var Co="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 fr(i){if(i===null||i===void 0)return String(i);if(Array.isArray(i))return"an array";let c=typeof i;return`${c==="object"?"an":"a"} ${c}`}var lh=new Set(["http","https","ws","wss","ftp"]);function _r(i){i=i.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let c=i.indexOf("://");if(c===-1)return!1;let T=i.slice(c+3),D=i.slice(0,c).toLowerCase();if(lh.has(D)){let U=T.match(/^[/\\]+/)?.[0]??"";if(U.includes("\\"))return!0;T=T.slice(U.length)}let w=T.search(/[/?#]/);return(w===-1?T:T.slice(0,w)).includes("\\")}var xn="github.com",Aye=[`git@${xn}:`,`ssh://git@${xn}/`],Cye=[`https://${xn}`,`https://${xn}/`,xn],bye=`users.noreply.${xn}`;var Q9=/[:/\\?#@\s]/;function ri(i){let c=dh(i.replace(/[\t\n\r]/g,"").toLowerCase());if(c===""||Q9.test(c))return c;try{let T=new URL(`https://${c}`);if(T.username!==""||T.password!==""||T.port!==""||T.pathname!=="/"||T.search!==""||T.hash!=="")return c;return dh(T.hostname)}catch{return c}}var uh=Ca(function(c){let T=ri(c);while(T.startsWith("www."))T=T.slice(4);return T},(i)=>i,50);function ph(i,c){return uh(i)===c}function Zo(i){return ph(i,xn)}function ch(i){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(i)}function ud(i){if(He(i))return!0;if(i.includes("://")){if(_r(i))return!0;try{let w=new URL(i);if(w.protocol==="http:"||w.protocol==="https:")return!1;return ch(w.hostname)}catch{return!0}}let c=i.indexOf(":"),T=i.indexOf("@");if(c>=0&&T>c)return!0;let D=i.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return D?ch(D):!1}function dh(i){let c=i.length;while(c>0&&i[c-1]===".")c--;return i.slice(0,c)}function pd(i){let c=ri(i);return Zo(c)?xn:c}function fh(i){let c=i.trimStart(),T=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(c);if(T===null||/^https?$/i.test(T[1]??""))return ie(c);return ie(T[0]+Qe(c.slice(T[0].length)))}function mh(i){let c=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(i);return c&&!He(i)?{user:c[1],host:c[2],path:c[3]}:null}import*as ls from"zod/v4";var o5=64;class cs{fields;activeWhenAbsent;keys;built=new Map;byPresentKeys=new Map;wholeSchema;constructor(i,c=new Set){this.fields=i;this.activeWhenAbsent=c;this.keys=Object.keys(i).filter((T)=>i[T]!==void 0)}has(i){return Object.hasOwn(this.fields,i)&&this.fields[i]!==void 0}field(i){let c=this.built.get(i);if(c)return c;let T=this.has(i)?this.fields[i]:void 0;if(!T)return;let D=T();return this.built.set(i,D),D}carries(i,c){return this.activeWhenAbsent.has(c)||typeof i==="object"&&i!==null&&c in i}whole(){return this.wholeSchema??=ls.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(i,c="passthrough"){let T=this.keys.filter((B)=>this.carries(i,B));if(T.length===this.keys.length&&c==="passthrough")return this.whole();let D=`${c}
24
+ ${T.join(`
25
+ `)}`,w=this.byPresentKeys.get(D);if(w)return this.byPresentKeys.delete(D),this.byPresentKeys.set(D,w),w;let x=this.shapeOf(T),U=c==="strip"?ls.preprocess((B,z)=>{for(let le of this.wrongDocumentIssues(B,x))z.addIssue(le);return B},ls.object(x)):ls.object(x).passthrough().check((B)=>{B.issues.push(...this.wrongDocumentIssues(B.value,x))});if(this.byPresentKeys.size>=o5)for(let B of this.byPresentKeys.keys()){this.byPresentKeys.delete(B);break}return this.byPresentKeys.set(D,U),U}wrongDocumentIssues(i,c){if(typeof i!=="object"||i===null)return[];let T=[];for(let D of Object.keys(i))if(!Object.hasOwn(c,D)&&this.has(D))T.push({code:"custom",input:i[D],path:[D],message:"This settings schema was built for a document without this key"});return T}shapeOf(i){let c={};for(let T of i){let D=this.field(T);if(D)c[T]=D}return c}}var gh=600;var Sd=500,i5=32;function Ah(){return{claudeaiPluginId:de.string().max(128).optional().catch(void 0),archiveSha256:rE().optional().catch(void 0)}}function Ch(){return{directoryRepositoryKey:de.string().max(4096).optional().catch(void 0)}}function bh(i){if(!/^https?:\/\/[^/\\]/i.test(i))return!1;try{let{protocol:c}=new URL(i);return c==="https:"||c==="http:"}catch{return!1}}function Rh(){return{sourceCommand:de.string().max(Sd+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:de.string().max(4096).refine(_h,{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:de.array(de.unknown()).transform((i)=>i.filter((c)=>typeof c==="string"&&c.length<=4096&&_h(c)).slice(-i5)).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 _h(i){return r5.isAbsolute(i)||s5.isAbsolute(i)}var Th=/[^\x20-\x7E]| {4,}/;function yd(){return de.string().max(Sd,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((i)=>!Th.test(i),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var a5="anthropic-plugin-directory",l5=["healthcare"],Dh=new Set(["claude-community","claude-plugins-community",...l5]),Lh=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"]),c5=new Set([a5,"claude-plugin-directory"]),Od=new Set([...Lh,...Dh,...c5]);var Ih=["marketplace","plugins","official"];function d5(){return Ih}var wh="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",gOe=new RegExp(wh,"i");function Ph(i){return new RegExp(`(?:${wh}|^(?:anthropic|claude)[^a-z0-9]*(${i.join("|")}))`,"i")}var u5=Ph(d5()),p5=Ph(Ih),f5=/[^\u0020-\u007E]/;function xh(i){if(Od.has(i.toLowerCase()))return!1;if(m5(i))return!0;if(u5.test(i))return!0;return!1}function m5(i){return!Od.has(i.toLowerCase())&&(f5.test(i)||p5.test(i))}var $n=e(()=>de.string().startsWith("./")),hr=e(()=>$n().endsWith(".json")),hh=e(()=>de.union([de.literal("."),$n()])),Eh=e(()=>de.union([$n().refine((i)=>i.endsWith(".mcpb")||i.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),de.string().url().refine((i)=>i.endsWith(".mcpb")||i.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),gd=e(()=>$n().endsWith(".md")),_d=e(()=>de.union([gd(),$n()])),Nh={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"};function Ad(i){return Object.hasOwn(Nh,i)}var g5="Marketplace name impersonates an official Anthropic/Claude marketplace",Cd=(i)=>de.string().min(1,"Marketplace must have a name").refine((c)=>!c.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((c)=>!aE.test(c),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((c)=>!c.includes("/")&&!c.includes("\\")&&!c.includes("..")&&c!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((c)=>!i(c),{message:g5}).superRefine((c,T)=>{let D=c.toLowerCase();if(!Ad(D))return;T.addIssue({code:"custom",message:`Marketplace name "${D}" is reserved for ${Nh[D]}`})}),_5=e(()=>Cd(xh)),h5=e(()=>Cd(()=>!1)),sl=e(()=>de.string().min(1,"Plugin name cannot be empty").refine((i)=>!i.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).refine((i)=>!aE.test(i),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),bd=e(()=>de.object({name:de.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:de.string().optional().describe("Contact email for support or feedback"),url:de.string().optional().describe("Website, GitHub profile, or organization URL")})),vh=e(()=>de.preprocess((i)=>n(i)?i:void 0,de.record(de.string(),de.unknown()).optional()).optional().describe('Versions of its hosts this plugin runs on. "claude-code" is a semver range (e.g. ">=2.1.320"): outside it, the plugin is not installed, updated or loaded. Other keys are ignored.')),kn=e(()=>de.object({$schema:de.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:sl().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:de.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:de.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:de.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:bd().optional().describe("Information about the plugin creator or maintainer"),homepage:de.string().url().optional().describe("Plugin homepage or documentation URL"),repository:de.string().optional().describe("Source code repository URL"),license:de.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:de.array(de.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:de.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. In a cloud session that began as a claude.ai chat, so is a plugin synced from the user's claude.ai account."),dependencies:de.array(f8()).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:de.preprocess((i)=>n(i)?i:void 0,de.record(de.string(),de.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."),engines:vh()})),E5=1,_Oe=e(()=>de.object({$schema:de.string().optional().catch(void 0).describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),description:de.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:de.lazy(()=>gr()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:de.array(de.string()).max(E5,{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 (${F9}; 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:de.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((i)=>i.hooks!==void 0||(i.modules?.length??0)>0,{message:"hooks.json must have `hooks` (the hook matchers) or `modules` (hooks modules), or both"})),kh=e(()=>de.object({hooks:de.union([hr().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),de.lazy(()=>gr()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),de.array(de.union([hr().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),de.lazy(()=>gr()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),S5=e(()=>de.object({source:_d().optional().describe("Path to command markdown file, relative to plugin root"),content:de.string().optional().describe("Inline markdown content for the command"),description:de.string().optional().describe("Command description override"),argumentHint:de.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:de.string().optional().describe("Default model for this command"),allowedTools:de.array(de.string()).optional().describe("Tools allowed when command runs")}).refine((i)=>i.source&&!i.content||!i.source&&i.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),Mh=e(()=>de.object({commands:de.union([_d().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."),de.array(_d().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."),de.record(de.string(),S5()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),Uh=e(()=>de.object({agents:de.union([gd().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."),de.array(gd().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.")])})),Hh=e(()=>de.object({skills:de.union([hh().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).'),de.array(hh().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).")])})),y5=e(()=>de.union([de.string(),de.array(de.string())])),Rd=e(()=>de.object({outputStyles:de.union([$n().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."),de.array($n().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.")])})),O5=e(()=>de.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),A5=16,C5=e(()=>de.object({id:O5(),remote:de.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:de.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),b5=e(()=>de.object({syntaxHighlighting:de.object({hljsLanguages:de.array(C5()).max(A5)}).strict()})),Td=e(()=>de.object({themes:de.union([$n().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."),de.array($n().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.")])})),Fh=e(()=>de.object({workflows:de.union([$n().describe("Path to a workflows directory or .js file, relative to the plugin root. When set, the workflows/ directory is not auto-loaded — list its files here if you want both."),de.array($n().describe("Path to a workflows directory or .js file, relative to the plugin root. When set, the workflows/ directory is not auto-loaded — list its files here if you want both.")).describe("List of workflow directory or .js file paths. When set, the workflows/ directory is not auto-loaded.")]).optional()})),Sh=e(()=>de.string().min(1)),R5=e(()=>de.string().min(2).refine((i)=>i.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),Bh=e(()=>de.object({mcpServers:de.union([hr().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),Eh().describe("Path or URL to MCPB file containing MCP server configuration"),de.record(de.string(),Qa()).describe("MCP server configurations keyed by server name"),de.array(de.union([hr().describe("Path to MCP servers configuration file"),Eh().describe("Path or URL to MCPB file"),de.record(de.string(),Qa()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),zh=e(()=>de.object({type:de.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:de.string().describe("Human-readable label shown in the config dialog"),description:de.string().describe("Help text shown beneath the field in the config dialog"),required:de.boolean().optional().describe("If true, validation fails when this field is empty"),default:de.union([de.string(),de.number(),de.boolean(),de.array(de.string())]).optional().describe("Default value used when the user provides nothing"),multiple:de.boolean().optional().describe("For string type: allow an array of strings"),sensitive:de.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:de.number().optional().describe("Minimum value (number type only)"),max:de.number().optional().describe("Maximum value (number type only)"),options:de.array(de.string().min(1,"An option cannot be empty").max(64,"An option can be at most 64 characters").refine((i)=>Ln(i)===i,{message:"An option cannot contain control, invisible or bidirectional-formatting characters"}).refine((i)=>i.trim()===i,{message:"An option cannot start or end with a space"})).min(1,"options needs at least one value").refine((i)=>new Set(i.map((c)=>c.toLowerCase())).size===i.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((i,c)=>{if(i.options===void 0)return;if(i.type!=="string"||i.multiple===!0||i.sensitive===!0){c.addIssue({code:"custom",path:["options"],message:'options is only for a field of type "string" that is neither multiple nor sensitive'});return}if(i.default===void 0){if(i.required!==!0)c.addIssue({code:"custom",path:["default"],message:"a field with options needs a default among them, or required: true"});return}if(typeof i.default!=="string"||!i.options.includes(i.default))c.addIssue({code:"custom",path:["default"],message:`default must be one of the options: ${i.options.join(", ")}`})})),Gh=e(()=>de.object({userConfig:de.record(de.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"),zh()).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.")})),Wh=e(()=>de.object({channels:de.array(de.object({server:de.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:de.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:de.record(de.string(),zh()).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.")})),yh=e(()=>de.strictObject({command:de.string().min(1).refine((i)=>{if(i.includes(" ")&&!i.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:de.array(Sh()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:de.record(R5(),Sh()).refine((i)=>Object.keys(i).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:de.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:de.record(de.string(),de.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:de.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:de.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:de.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:de.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:de.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),requestTimeout:de.number().int().positive().max(2147483647).optional().describe("Maximum time to wait for the server to answer a request (milliseconds). Defaults to 60000."),restartOnCrash:de.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:de.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:de.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.")})),T5=e(()=>de.strictObject({name:de.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:de.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:de.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:de.union([de.literal("always"),de.string().startsWith("on-skill-invoke:").refine((i)=>i.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).')})),D5=e(()=>de.array(T5()).refine((i)=>new Set(i.map((c)=>c.name)).size===i.length,{message:"Monitor names must be unique within a plugin"})),Dd=e(()=>de.object({monitors:de.union([hr().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),D5()]).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.")})),Kh=e(()=>de.object({lspServers:de.union([hr().describe("Path to .lsp.json configuration file relative to plugin root"),de.record(de.string(),yh()).describe("LSP server configurations keyed by server name"),de.array(de.union([hr().describe("Path to LSP configuration file"),de.record(de.string(),yh()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),L5=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,I5=/^[a-z0-9][a-z0-9-._]*$/,w5=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function Ld(i){return!i.includes("..")&&!i.includes("//")&&(L5.test(i)||I5.test(i))}var jh=e(()=>de.string().refine((i)=>!i.includes("..")&&!i.includes("//"),"Package name cannot contain path traversal patterns").refine((i)=>Ld(i),"Invalid npm package name format")),$h=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,P5=/^[0-9a-f]{64}$/;var x5=64;var N5=e(()=>de.object({sha256:de.string().regex(P5)}));function v5(i){let c=de.record(de.string(),de.unknown()).safeParse(i);if(!c.success)return;let T=Object.create(null),D=0;for(let[w,x]of Object.entries(c.data)){if(D>=x5)break;let U=N5().safeParse(x);if($h.test(w)&&U.success)T[w]=U.data,D++}return D>0?T:void 0}var Vh=e(()=>de.object({binaries:de.unknown().transform(v5).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),Yh=e(()=>de.object({settings:de.record(de.string(),de.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),Xh=e(()=>de.object({types:$n().refine((i)=>i.endsWith(".d.ts"),{message:"types must name a TypeScript declaration file ending in '.d.ts'"}).refine((i)=>!i.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. A mod that lists this plugin under dependencies gets the contract laid at .claude-plugin/types/<plugin>/index.d.ts each time the engine loads it from a folder the person owns, so it types against the noun with nothing copied; claude plugin validate checks the file.")})),Jh=e(()=>de.object({experimental:de.preprocess((i)=>n(i)?i:void 0,de.object({...Td().partial().shape,...b5().partial().shape,...Dd().partial().shape,...Rd().partial().shape,evals:y5().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 k5=e(()=>de.object({...kn().shape,...kh().partial().shape,...Mh().partial().shape,...Uh().partial().shape,...Hh().partial().shape,...Rd().partial().shape,...Td().partial().shape,...Fh().shape,...Wh().partial().shape,...Bh().partial().shape,...Kh().partial().shape,...Dd().partial().shape,...Yh().partial().shape,...Xh().partial().shape,...Gh().partial().shape,...Vh().partial().shape,...Jh().partial().shape})),hOe=e(()=>new cs({$schema:()=>kn().shape.$schema,name:()=>kn().shape.name,displayName:()=>kn().shape.displayName,version:()=>kn().shape.version,description:()=>kn().shape.description,author:()=>kn().shape.author,homepage:()=>kn().shape.homepage,repository:()=>kn().shape.repository,license:()=>kn().shape.license,keywords:()=>kn().shape.keywords,defaultEnabled:()=>kn().shape.defaultEnabled,dependencies:()=>kn().shape.dependencies,metadata:()=>kn().shape.metadata,engines:()=>kn().shape.engines,hooks:()=>kh().partial().shape.hooks,commands:()=>Mh().partial().shape.commands,agents:()=>Uh().partial().shape.agents,skills:()=>Hh().partial().shape.skills,outputStyles:()=>Rd().partial().shape.outputStyles,themes:()=>Td().partial().shape.themes,workflows:()=>Fh().shape.workflows,channels:()=>Wh().partial().shape.channels,mcpServers:()=>Bh().partial().shape.mcpServers,lspServers:()=>Kh().partial().shape.lspServers,monitors:()=>Dd().partial().shape.monitors,settings:()=>Yh().partial().shape.settings,types:()=>Xh().partial().shape.types,userConfig:()=>Gh().partial().shape.userConfig,binaries:()=>Vh().partial().shape.binaries,experimental:()=>Jh().partial().shape.experimental},new Set(["name"])));var Zh=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function qh(i){try{return new RegExp(i),!0}catch{return!1}}function M5(i){return _r(i)||He(i)}var Qh="ssh.github.com";function fd(i){return Zo(i)||ri(i)===Qh}var U5=/^[A-Za-z0-9._-]+$/;function H5(i){return U5.test(i)&&!i.startsWith("-")&&i!=="."&&i!==".."}function eE(i){if(!i.endsWith("/*"))return null;let c=i.slice(0,-2);return H5(c)?c:null}function F5(i){let c=[];for(let T of i.split("/")){if(T===".")continue;if(T===".."){c.pop();continue}c.push(T)}return c.filter((T)=>T!=="").join("/")}function B5(i){let c=i.length;for(;;){let T=c;while(T>0&&i.charCodeAt(T-1)===47)T--;if(T>=4&&i.startsWith(".git",T-4))T-=4;if(T===c)return c===i.length?i:i.slice(0,c);c=T}}function Oh(i){let c=pd(i);return c===Qh?xn:c}function z5(i,c){if(i.includes("://"))try{let D=fh(i);if(D===null)return i;D.hostname=Oh(D.hostname),D.username="",D.password="",D.search="",D.hash="";try{D.pathname=decodeURIComponent(D.pathname)}catch{}let w=F5(D.pathname);return D.pathname=c?.stripDotGit?B5(w):w,D.toString()}catch{return i}let T=Be(i);return T?`${Oh(T.host)}:${T.path}`:i}var G5=new Set(["http:","https:","git:","git+http:","git+https:"]);function W5(i){if(ud(i))return i;if(i.includes("://"))try{let D=new URL(i);if(D.hostname=pd(D.hostname),G5.has(D.protocol)||Zo(D.hostname))D.username="",D.password="";return D.toString()}catch{return i}let c=mh(i);if(!c)return i;let T=c.host.toLowerCase().replace(/\.+$/,"");return Zo(T)?`${xn}:${c.path}`:`${c.user}@${T}:${c.path}`}function tE(i){if(i.includes("://")){if(M5(i))return!1;let x=Be(i)?.host;if(x!==void 0&&fd(x)&&z5(i,{stripDotGit:!0}).includes("*"))return!0;let U=ie(i)?.hostname;if(!U||!fd(U))return!1;let B=W5(i);try{let z=new URL(B);return z.hostname.includes("*")||z.pathname.includes("*")}catch{return B.includes("*")}}let c=Be(i),T=c?.host,D=c?.path;if(!T||D===void 0||!fd(T))return!1;let w=D;try{w=decodeURIComponent(D)}catch{}return w.includes("*")}function nE(i){return de.discriminatedUnion("source",[de.object({source:de.literal("url"),url:de.string().url().describe("Direct URL to marketplace.json file"),headers:de.record(de.string(),de.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:yd().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.")}),de.object({source:de.literal("github"),repo:de.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:de.string().optional().describe('Git branch, tag or full commit id to use (e.g., "main", "v1.0.0"). Defaults to repository default branch. A full commit id (40 or 64 lowercase hex digits) holds the marketplace at that commit: refreshes and auto-updates do not move it. A branch or tag of the repository must hold the commit. Plugins listed with a remote source follow that source unless they name a `sha`. Reserved Anthropic marketplace names do not accept a commit id.'),path:de.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:de.array(de.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:de.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/.")}),de.object({source:de.literal("git"),url:de.string().describe("Full git repository URL"),ref:de.string().optional().describe('Git branch, tag or full commit id to use (e.g., "main", "v1.0.0"). Defaults to repository default branch. A full commit id (40 or 64 lowercase hex digits) holds the marketplace at that commit: refreshes and auto-updates do not move it. A branch or tag of the repository must hold the commit. Plugins listed with a remote source follow that source unless they name a `sha`. Reserved Anthropic marketplace names do not accept a commit id.'),path:de.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:de.array(de.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:de.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/.")}),de.object({source:de.literal("npm"),package:jh().or(de.string().regex(w5,"Invalid npm package name format")).describe('npm package containing marketplace.json (e.g. "@acme/claude-marketplace"). A scope wildcard such as "@acme/*" still parses in a managed list, so a list that holds one stays valid, but it matches no marketplace package.'),version:de.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:de.string().url().refine(bh,"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). Under allowManagedPermissionRulesOnly, an npm marketplace keeps plugin allowed-tools only when both the entry and the registration pin this same registry.")}),de.object({source:de.literal("file"),path:de.string().describe("Local file path to marketplace.json")}),de.object({source:de.literal("directory"),path:de.string().describe("Local directory containing .claude-plugin/marketplace.json")}),de.object({source:de.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."),de.object({source:de.literal("hostPattern"),hostPattern:de.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$").')}),de.object({source:de.literal("pathPattern"),pathPattern:de.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.')}),de.object({source:de.literal("settings"),name:i?h5().describe("Marketplace name, as stored in known_marketplaces.json. A reserved name is refused per entry at load (revalidateReservedNameEntry); a look-alike name is judged when that marketplace's own catalog is parsed (catalogNameSchemaFor)."):_5().refine((c)=>!Od.has(c.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:de.array(Y5()).describe("Plugin entries declared inline in settings.json"),owner:bd().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 si=e(()=>nE(!1));var Id=String.raw`[\w./+-]`,EOe=new RegExp(`^(?:#${Id}*)?$`),SOe=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${Id}*)?$`),yOe=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${Id}*)?$`);var K5=e(()=>nE(!0));function oE(){return si()}var wd=e(()=>oE()),il=e(()=>oE()),md=e(()=>de.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),rE=e(()=>de.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),j5="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function $5(i){try{let c=new URL(i);return c.protocol==="https:"&&!q_(c.hostname)}catch{return!1}}var V5=e(()=>de.object({source:de.literal("archive"),url:de.string().url().refine($5,{message:j5}).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:rE().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.")),sE=e(()=>de.union([de.preprocess((i)=>i==="."?"./":i,$n()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),de.object({source:de.literal("npm"),package:jh().or(de.string().refine((i)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(i)||!i.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:de.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:de.string().url().refine(bh,"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"),de.object({source:de.literal("url"),url:de.string().describe("Full git repository URL (https:// or git@)"),ref:de.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:md().optional().describe("Specific commit SHA to use")}),de.object({source:de.literal("github"),repo:de.string().describe("GitHub repository in owner/repo format"),ref:de.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:md().optional().describe("Specific commit SHA to use")}),de.object({source:de.literal("git-subdir"),url:de.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:de.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). '+"Checked out sparsely — over https or ssh as a partial clone (--filter=tree:0) — to minimize bandwidth for monorepos."),ref:de.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:md().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."),V5(),de.object({source:de.literal("command"),command:de.string().min(1).max(Sd,{message:"command must not be longer than the install consent UI can display"}).refine((i)=>!Th.test(i),{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:de.number().int().positive().max(gh).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:de.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."),de.object({source:de.literal("unsupported"),error:de.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.")])),Y5=e(()=>de.object({name:sl().describe("Plugin name as it appears in the target repository"),source:sE().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:de.string().optional(),version:de.string().optional(),strict:de.boolean().optional(),engines:vh(),headers:de.record(de.string(),de.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:yd().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((i)=>typeof i.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((i)=>typeof i.source==="string"||i.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 X5=e(()=>de.object({cli:de.array(de.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:de.array(de.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:de.array(de.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:de.array(de.object({file:de.string().max(256),pattern:de.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:de.array(de.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.`)})),J5=e(()=>de.object({topic:de.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:X5().optional().describe("Matchers that determine when the plugin is relevant.")})),Z5=e(()=>k5().partial().extend({name:sl().describe("Unique identifier matching the plugin name"),source:sE().describe("Where to fetch the plugin from"),headers:de.record(de.string(),de.string()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:yd().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:de.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:de.array(de.string()).optional().describe("Tags for searchability and discovery"),strict:de.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:de.preprocess((i)=>n(i)?i:void 0,J5().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.`)})),q5=e(()=>de.object({name:sl()}));function Q5(i){let c=Z5();return i.flatMap((T,D)=>{let w=c.safeParse(T);if(w.success){let B=w.data.source;if(typeof B==="object"&&B.source==="unsupported"&&B.error!==void 0)return[{...w.data,source:{source:"unsupported"}}];return[w.data]}let x=q5().safeParse(T).data?.name,U=w.error.issues.map((B)=>`${B.path.join(".")}: ${B.message}`).join(", ");if(x){t(`Stubbing unparseable marketplace plugin entry (${x}): ${U}`,{level:"warn"});let B=iE(n(T)?T.source:void 0)?a8:Pd(T)?void 0:n8(w.error.issues)??al(w.error.issues);return[{name:x,source:{source:"unsupported",...B&&{error:B}},strict:!0}]}return t(`Dropping unparseable marketplace plugin entry (index ${D}): ${U}`,{level:"warn"}),[]})}function e8(i){if(!n(i))return i;let c=Object.keys(i).filter((T)=>typeof i[T]!=="string"&&i[T]!==null);if(c.length>0){if(t(`Unreadable entries in a marketplace's renames map: ${c.length}`,{level:"warn"}),Object.hasOwn(i,"__proto__"))return}return{...i,...Object.fromEntries(c.map((T)=>[T,T]))}}var t8=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function Pd(i){if(!i||typeof i!=="object")return!1;let c=i.source;if(!c||typeof c!=="object")return!1;let T=c.source;return typeof T==="string"&&!t8.has(T)}function n8(i){let c=i.find((D)=>D.path.length===1&&D.path[0]==="source");if(!c||c.code!=="invalid_union")return;let T=c.errors.find((D)=>!D.some((w)=>w.path.length===0||w.code==="invalid_value"&&w.path[0]==="source"));if(!T||T.length===0)return;return al(T.map((D)=>({...D,path:["source",...D.path]})))}var o8=/^[A-Za-z0-9_$.-]{1,40}$/;function qn(i){return o8.test(i)?i:"<key>"}var r8=3,s8=160;function al(i){let c=i.slice(0,r8).map((D)=>{let w=D.path.map(String).map((U)=>qn(U)).join("."),x=D.code==="unrecognized_keys"?`Unrecognized ${D.keys.length===1?"field":"fields"}: ${D.keys.map(qn).join(", ")}`:Zc(D.message,s8);return w?`${w}: ${x}`:x}),T=i.length-c.length;return T>0?`${c.join(", ")} (+${T} more)`:c.join(", ")}var i8=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,a8='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 iE(i){return typeof i==="string"&&i8.test(i)&&!i.includes("..")}function l8(i){if(typeof i!=="string"||i===""||i.startsWith("/")||i.includes("\\")||i.includes(":"))return;let c=i.replace(/^\.\//,"").replace(/\/+$/,"");if(c===""||c===".")return".";if(c.split("/").some((T)=>T===""||T==="."||T===".."))return;return c}function c8(i,c){if(c===void 0||!n(i)||!iE(i.source))return i;let T=c==="."?`./${i.source}`:`./${c}/${i.source}`;return{...i,source:T}}function d8(i){if(!n(i)||!Array.isArray(i.plugins))return i;let c=n(i.metadata)?l8(i.metadata.pluginRoot):void 0;if(c===void 0)return i;return{...i,plugins:i.plugins.map((T)=>c8(T,c))}}var u8=e(()=>de.object({$schema:de.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Cd(xh),version:de.string().optional().describe("Marketplace manifest version"),description:de.string().optional().describe("Human-readable description of this marketplace"),owner:bd().describe("Marketplace maintainer or curator information"),plugins:de.array(de.unknown()).transform(Q5).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:de.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:de.object({pluginRoot:de.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:de.string().optional().describe("Marketplace version"),description:de.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:de.array(de.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:de.preprocess(e8,de.record(de.string(),de.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.")})),OOe=e(()=>de.preprocess(d8,u8()));var hd="[A-Za-z0-9][-A-Za-z0-9._]*",AOe=new RegExp(`^${hd}$`);var ds=e(()=>de.string().regex(new RegExp(`^${hd}@${hd}$`),"Plugin ID must be in format: plugin@marketplace")),COe=new RegExp(`[@:\\s/\\\\${W}]`,"u"),bOe=new RegExp(`[${W}]`,"u"),aE=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,p8=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,f8=e(()=>de.union([de.string().regex(p8,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((i)=>i.replace(/@\^[^@]*$/,"")),de.object({name:de.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:de.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((i)=>i.marketplace?`${i.name}@${i.marketplace}`:i.name)])),m8=e(()=>de.object({version:de.string().describe("Currently installed version"),installedAt:de.string().describe("ISO 8601 timestamp of installation"),lastUpdated:de.string().optional().describe("ISO 8601 timestamp of last update"),installPath:de.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:de.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:de.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:de.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)."),...Ah(),...Ch(),...Rh()})),ROe=e(()=>de.object({version:de.literal(1).describe("Schema version 1"),plugins:de.record(ds(),m8()).describe("Map of plugin IDs to their installation metadata")})),g8=e(()=>de.enum(["managed","user","project","local"])),_8=e(()=>de.object({scope:g8().describe("Installation scope"),projectPath:de.string().optional().describe("Project path (required for project/local scopes)"),installPath:de.string().describe("Absolute path to the versioned plugin directory"),version:de.string().optional().describe("Currently installed version"),installedAt:de.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:de.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:de.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:de.string().optional().describe("Tag-derived semver this install resolved to"),auto:de.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),copyHash:de.string().optional().catch(void 0).describe("What a plugin managed settings enable from a remote marketplace was copied as: compared at each load, and absent on any other plugin"),...Ah(),...Ch(),...Rh()})),TOe=e(()=>de.object({version:de.literal(2).describe("Schema version 2"),plugins:de.record(ds(),de.array(_8())).describe("Map of plugin IDs to arrays of installation entries")})),DOe=e(()=>de.object({version:de.literal(2),plugins:de.record(de.string(),de.unknown())}));var h8=e(()=>de.object({source:K5().describe("Where to fetch the marketplace from"),installLocation:de.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:de.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:de.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup"),declaredByManagedSettings:de.literal(!0).optional().describe("Managed settings declared this source for this name: when they later declare another, it is the organization moving its marketplace, and what its plugins saved stays")})),LOe=e(()=>de.record(de.string(),h8()));import*as lE from"zod/v4";function us(i){return i==="true"?!0:i==="false"?!1:i}var ll=["aspell","hunspell","ispell"];import*as tn from"zod/v4";var E8=["autoMode","deepLink","voice","briefView","screenReader"],S8={},Nd={autoMode:{buildGate:()=>!0,shape:()=>({skipAutoPermissionPrompt:tn.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:tn.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:tn.object({allow:tn.array(tn.string()).optional().describe('Rules for the auto mode classifier allow section. Include the literal string "$defaults" to inherit the built-in rules at that position.'),soft_deny:tn.array(tn.string()).optional().describe('Rules for the auto mode classifier SOFT BLOCK section — destructive/irreversible actions that user intent can clear. Include the literal string "$defaults" to inherit the built-in rules at that position.'),hard_deny:tn.array(tn.string()).optional().describe('Rules for the auto mode classifier HARD BLOCK section — security boundaries that user intent does NOT clear. Include the literal string "$defaults" to inherit the built-in rules at that position.'),...!1,...{},environment:tn.array(tn.string()).optional().describe('Entries for the auto mode classifier environment section. Include the literal string "$defaults" to inherit the built-in entries at that position.'),classifyAllShell:tn.boolean().optional().describe("When true, every Bash/PowerShell allow rule is suspended while auto mode is active so all shell commands are routed through the classifier (higher safety, more classifier calls). Default: false.")}).optional().describe("Auto mode classifier prompt customization")}),permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:tn.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:tn.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:tn.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>S8}};function ps(){return E8.filter((i)=>Nd[i].buildGate())}function cE(i){let c={};for(let T of i)c={...c,...Nd[T].shape()};return c}function vd(i){let c=[];for(let T of i)c.push(...Nd[T].permissionModes?.()??[]);return c}import*as dl from"zod/v4";var MOe=new RegExp("\x00ESCAPED_STAR\x00","g"),UOe=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var HOe=new RegExp("\x00GLOBSTAR\x00","g");function dE(i){return i.match(/^(.+):\*$/)?.[1]??null}function uE(i){let c=i.trimEnd();if(!c.endsWith("*"))return!1;let T=0,D=c.length-2;while(D>=0&&c[D]==="\\")T++,D--;return T%2===0}var ii={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(i)=>{if(i.includes("*")||i.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:(i)=>{if(i.includes("://")||i.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(!i.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}}}},BOe=[...ii.filePatternTools,"Grep","MultiEdit","LS"];function kd(i){return ii.filePatternTools.includes(i)}function pE(i){return ii.bashPrefixTools.includes(i)}function fE(i){return Object.hasOwn(ii.customValidation,i)?ii.customValidation[i]:void 0}function _E(i,c){let T=0,D=c-1;while(D>=0&&i[D]==="\\")T++,D--;return T%2!==0}function mE(i,c){let T=0;for(let D=0;D<i.length;D++)if(i[D]===c&&!_E(i,D))T++;return T}var y8=/(?:^|[^\\])\\[()]/;function O8(i){return y8.test(i)&&mE(i,"(")!==mE(i,")")}var A8=/^(?:[|&;<>]|\d+[<>])/;function hE(i){return A8.test(i)}function cl(i){for(let c=0;c<i.length;c++)if(i[c]==="*"&&!_E(i,c))return!0;return!1}function C8(i){if(i.endsWith(":*"))return;let c=i.trim().split(/\s+/).filter(Boolean),T=c[0];if(c.length<3||T===void 0||cl(T))return;let D=!1;for(let w of c.slice(1)){if(hE(w))return;if(cl(w)){D=!0;continue}if(w.startsWith("-"))continue;return D?T:void 0}return}function b8(i){if(i.endsWith(":*"))return;let c=i.trim().split(/\s+/).filter(Boolean),T=c.findIndex((w)=>!/^[A-Za-z_]\w*\+?=/.test(w)),D=c[T]??"";return!hE(D)&&c.slice(0,T).some(cl)?/^[^*]+/.exec(D)?.[0]:void 0}function gE(i){if(!Qs(i))return null;let c=rs(i);if(c&&!Qs(c.serverName))return null;return{valid:!1,error:`Wildcard tool name "${i}" 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 Md(i,c){if(!i||i.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let T=Qc(i);if(T.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(T.kind==="call"&&T.rawContent===""){if(!T.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 "${T.toolName}" without parentheses`,examples:[`${T.toolName}`,`${T.toolName}(some-pattern)`]}}let D=M_(i),w=rs(D.toolName);if(w){if(T.kind==="call"){let U=w.toolName&&!Qs(w.toolName)?`${D.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:U===void 0?`Use "${D.toolName}" without parentheses, or use "mcp__${w.serverName}__*" for all tools`:`Use "${D.toolName}" without parentheses. For all tools of a server, use "mcp__${w.serverName}__*" for the server "${w.serverName}", or "${U}" for a server named "${w.serverName}__${w.toolName}"`,examples:[`mcp__${w.serverName}`,`mcp__${w.serverName}__*`,w.toolName&&w.toolName!=="*"?`mcp__${w.serverName}__${w.toolName}`:void 0,U].filter(Boolean)}}if(c==="allow"){let U=gE(D.toolName);if(U)return U}return{valid:!0}}if(!D.toolName||D.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(c==="allow"){let U=gE(D.toolName);if(U)return U}if(!D.toolName.includes("_")&&D.toolName[0]!==D.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Ve(String(D.toolName))}"`};if(T.kind==="call"&&O8(T.rawContent)){let U=kd(D.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:U?"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:U?[`${D.toolName}(C:/Projects/(drafts)/**)`,`${D.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${D.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let x=fE(D.toolName);if(x&&D.ruleContent!==void 0){let U=x(D.ruleContent);if(!U.valid)return U}if(pE(D.toolName)&&D.ruleContent!==void 0){let U=D.ruleContent;if(U===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(c==="allow"){let z=b8(U);if(z!==void 0)return{valid:!0,warning:`${Pn(D)} has a * in a variable's value. A * also matches spaces, so this rule can also approve a different command that has ${z} later in the line, without a prompt. Give the variable an exact value instead.`,securityNotice:`${Pn(D)} allows any command at the * in its value · use an exact value`};let le=C8(U);if(le!==void 0){let fe=le==="git",Ce=fe?" For git, options such as -c and --exec-path can run arbitrary commands.":"",Re=fe?" (for example Bash(git status *))":"";return{valid:!0,warning:`${Pn(D)} 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.${Ce} Replace that * with the exact value you mean, or only use * after the subcommand${Re}.`,securityNotice:`${Pn(D)} allows any option at its * · use an exact value`}}}let B=dE(U)?.trimEnd();if(B!==void 0){if(cl(B)){let z=uE(B),le=z?"matches only commands containing a literal * at that position":"will likely never match",fe=z?B:`${B}*`,Ce=c==="allow"?" Replace that * with the exact value you mean.":fe.endsWith(":*")?"":` Use ${Pn({toolName:D.toolName,ruleContent:fe})} for wildcard matching.`;return{valid:!0,warning:`${Pn(D)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${le}.${Ce}`,...c!=="allow"&&{securityNotice:`${Pn(D)} reads its * literally${fe.endsWith(":*")?"":` · use ${Pn({toolName:D.toolName,ruleContent:fe})}`}`}}}}else if(U.includes(":*")&&!U.endsWith(":*")){let z=c==="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:`${Pn(D)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${z}`,...c==="allow"&&{securityNotice:`${Pn(D)} reads its :* as a wildcard · use an exact value`}}}}if(kd(D.toolName)&&D.ruleContent!==void 0){if(D.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${D.toolName}(*.ts) - matches .ts files`,`${D.toolName}(src/**) - matches all files in src`,`${D.toolName}(**/*.test.ts) - matches test files`]}}if(D.ruleContent!==void 0){let U=D.toolName==="Write"||D.toolName==="NotebookEdit"||D.toolName==="MultiEdit"?"Edit":D.toolName==="Glob"?"Read":void 0;if(U!==void 0&&!D.ruleContent.includes(":*"))return{valid:!0,warning:`${Pn(D)} is not matched by file permission checks — only ${U}(path) rules are. Use ${Pn({toolName:U,ruleContent:D.ruleContent})} instead (${U} rules cover all file-${U==="Edit"?"editing":"reading"} tools).`,...c!=="allow"&&{securityNotice:`${Pn(D)} never matches · use ${Pn({toolName:U,ruleContent:D.ruleContent})}`}}}return{valid:!0}}var Ud=e(()=>SE()),EE=e(()=>SE("allow"));function SE(i){return dl.string().superRefine((c,T)=>{let D=Md(c,i);if(!D.valid){let w=D.error;if(D.suggestion)w+=`. ${D.suggestion}`;if(D.examples&&D.examples.length>0)w+=`. Examples: ${D.examples.join(", ")}`;T.addIssue({code:dl.ZodIssueCode.custom,message:w,params:{received:c}})}})}var di=["accept","hold","refuse"],gl=["off","basic","full"],R8=e(()=>Z.record(Z.string(),Z.coerce.string()));function xE(i){return Z.object({allow:Z.array(EE()).optional().describe("List of permission rules for allowed operations"),deny:Z.array(Ud()).optional().describe("List of permission rules for denied operations"),ask:Z.array(Ud()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:Z.preprocess(ns,Z.enum([...dr,...vd(i)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:Z.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:Z.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. No allow rule lifts it. Also binds shell commands: one that names a path outside them is asked about in every mode, and the sandbox, where it is on, denies such reads. Also set when the user picks "block" on the one-time auto-mode prompt for a read outside the working directories.'),blockFileToolReadsOutsideWorkingDirectories:Z.boolean().optional().describe("@internal For the program that starts Claude Code: read only from --settings at the launch; ignored in settings sent to a running session and in user, project, local and managed settings. Refuse reads outside the working directories, other than a shell command's, in every permission mode: reads by the file tools (Read, Grep, Glob, LSP) and by other built-in tools that send or publish a file, attachments, connectors' file inputs, Chrome uploads, memory recall, a project's CLAUDE.md includes and memory. No allow rule lifts it, and blockReadsExemptPaths applies to it. With it on, only the starting directory, --add-dir and the additionalDirectories of --settings or of settings sent later by that program (a full path, on Windows with its drive, or ~ or ~/…; a relative entry does not count) count as working directories, for it and for blockWritesOutsideWorkingDirectories: the user, project, local and managed settings and /add-dir add none. Claude Code's own files stay readable: this project's and this session's files in its configuration folder, this project's memory unless a user, project or local settings file, or managed settings, chose that folder, and the CLAUDE.md, rules, skills, plugins, agents and commands in its configuration folder. It is blockReadsOutsideWorkingDirectories without that setting's hold on the shell: it does not limit shell commands, sandboxed or not, nor what MCP servers and the programs that hooks run read by themselves. Like that setting, it does not stop Claude Code loading skills, commands, agents, output styles and workflows from .claude folders above the working directory (as far as the repository's root; outside a repository, the home folder or the disk's root), nor through links in a .claude folder, the working directory's own included. It does not limit writes, but Edit and Write need an existing file read first, and where Read is refused only a shell command (such as cat) can do that. Cloud sessions (Claude Code on the web), whose file tools run in a container that is itself the boundary, may not apply it."),blockWritesOutsideWorkingDirectories:Z.boolean().optional().describe("Refuse file-tool writes (Write, Edit, NotebookEdit) outside the working directories in every permission mode; true in any settings source wins. No allow rule lifts it. Files that Claude Code keeps for the session are not refused: its plan files, scratchpad and background job folder, and the auto-memory of this project, unless a repository settings file points it elsewhere (a setting of the program that starts Claude Code can narrow this and the working directories). Nothing runs them unless the model asks. Also refuses file-tool writes to Claude Code settings files, inside the working directories too, and takes EnterWorktree and ExitWorktree, which move the working directory, out of the tools on offer (a setting of the program that starts Claude Code can keep them). Does not limit shell commands, MCP tools, the programs that hooks run, or the memory tools. Cloud sessions (Claude Code on the web), whose file tools run in a container that is itself the boundary, may not apply it."),blockReadsExemptPaths:Z.array(Z.string().catch("")).optional().catch(void 0).describe('For the program that starts Claude Code: read only from --settings and from settings that program sends while the session runs; ignored in user, project, local and managed settings. Absolute paths, each a folder with all below it or one file, that blockReadsOutsideWorkingDirectories lets through beside the working directories. It allows nothing: an allow rule, the permission mode or the user still decides each read, as with that setting off, and a shell command that hands such a path to a program is still asked about unless a Read allow rule covers it. The paths do not become working directories, so blockWritesOutsideWorkingDirectories refuses writes to them, and they are not told to MCP servers or to the model. Each path counts as written: a link in it is not followed and a pattern is not expanded, so list every spelling that a read may arrive by. Ignored: an entry that starts with ~, has a ".." segment or has white space at either end (as written or once normalized), a relative or network path, and the root of a filesystem. Does not change what sandboxed commands may read (sandbox.filesystem.allowRead does).'),workingDirectoriesAsGiven:Z.array(Z.string().catch("")).optional().catch(void 0).describe("For the program that starts Claude Code: read only from --settings and from settings that program sends while the session runs; ignored in user, project, local and managed settings. Absolute paths of working directories, each spelled exactly as it is passed, letter case included (the session folder, --add-dir, permissions.additionalDirectories). To decide what lies inside a listed working directory, Claude Code takes it as written and follows no link at it, so a link that later stands in its place gives the file tools no access to where the link leads. List real paths: the files of a listed path that runs through a link count as outside the working directories, because where they really are lies outside it. List a mapped network drive by its drive-letter path: Claude Code still derives the UNC form of that path by itself and adds it, as for any mapped drive. A file path that is itself spelled as a UNC path is judged as written, so a link on the share is not seen by that spelling. It adds no working directory and allows nothing. Once listed, a path stays so until the process ends, also if later settings leave it out. Ignored: an entry that is not already normalized (a relative path, one that starts with ~, a \"..\" segment, a separator at its end unless it is a filesystem root, forward slashes on Windows, white space at either end). Does not change what sandboxed commands may write."),disableAutoMode:Z.enum(["disable"]).optional().describe("Disable auto mode"),denyInsteadOfPrompting:Z.boolean().optional().describe("Never wait for a person to answer a tool permission prompt: a call that would prompt is denied at once, the model is told, and the turn carries on. This is what --permission-prompts none does for -p, in every kind of session, subagents and agent teams included. Allow rules, the permission mode, auto mode's classifier and PermissionRequest hooks decide first, as they do without it; it only ever denies, and allows nothing. Claude's questions and plan mode's tools are not offered to the model, and an MCP server's request for input is cancelled unless an Elicitation hook answers it. An app or script that answers prompts through canUseTool or --permission-prompt-tool is not asked either: answer from a PermissionRequest hook instead. Read from user settings, --settings and managed settings; project and local settings are ignored, and true in any of those sources wins."),additionalDirectories:Z.array(Z.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var wAe=e(()=>xE(ps())),T8=e(()=>Z.union([Z.string(),Z.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) }')])),D8=e(()=>Z.preprocess((i)=>Array.isArray(i)?i.filter((c)=>typeof c==="string"||!!c&&typeof c==="object"&&!Array.isArray(c)):[],Z.array(T8()))),Gd=e(()=>Z.object({source:si().describe("Where to fetch the marketplace from"),installLocation:Z.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:Z.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup"),pluginDigests:Z.record(Z.string(),Z.array(Z.string()).catch([])).optional().catch(void 0).describe("Deprecated and ignored: settings that hold it still load. A plugin takes the organization tier when managed settings enable it and declare its marketplace with a remote source.")})),Wd=e(()=>{let i=()=>Z.number().min(0).max(w_);return Z.object({input:i(),output:i(),cacheRead:i(),cacheWrite:i()})}),Kd=e(()=>Z.number().gt(0).lte(10).optional()),jd=e(()=>Z.object({model:Z.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:Z.string().optional().describe("Row title. Defaults to the model name."),description:Z.string().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:Z.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.")})),_l=e(()=>Z.object({serverName:Z.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:Z.array(Z.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:Z.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((i)=>Ie([i.serverName!==void 0,i.serverCommand!==void 0,i.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),hl=e(()=>Z.object({serverName:Z.string().min(1,"Server name must be non-empty").refine((i)=>i.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((i)=>i===i.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:Z.array(Z.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:Z.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((i)=>Ie([i.serverName!==void 0,i.serverCommand!==void 0,i.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),NE=e(()=>Z.object({marketplace:Z.string(),plugin:Z.string()})),L8=e(()=>Z.preprocess((i)=>{if(typeof i!=="string"||!ds().safeParse(i).success)return i;let c=i.indexOf("@");return{marketplace:i.slice(c+1),plugin:i.slice(0,c)}},NE())),I8=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function w8(i){let c=i.replaceAll("/","\\");if(te(c))return!1;return/^\\{2}[^\\]/.test(c)}function P8(i){return V(i)||/^\/network\/servers(\/|$)/i.test(i)||ne(i)}function x8(i){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(i)}function N8(i,c,T={}){if(c==="win32"){let D=i.replaceAll("/","\\");if(te(D))return!1;let w=w8(D);if(T.rejectUnc&&w)return!1;if(T.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(D)&&!w&&/^(\\|[A-Za-z]:)/.test(D))return!1}if(PE.normalize(D)!==D)return!1;let x=D.split("\\");if(x.some((B)=>B==="."||B===".."))return!1;if(x.some((B,z)=>/[. ]$/.test(B)||B.includes(":")&&!(z===0&&/^[A-Za-z]:$/.test(B))))return!1;let U=D.startsWith("\\\\")?D.slice(2):D;if(/\\{2}/.test(U))return!1;return!D.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(D)}if(T.rejectNetworkRoot&&P8(i))return!1;if(T.rejectMagicLinkRoot&&x8(i))return!1;if(wE.normalize(i)!==i)return!1;if(i.split("/").some((D)=>D==="."||D===".."))return!1;if(/\/{2}/.test(i))return!1;return!i.endsWith("/")||i==="/"}var v8=/\.(exe|ps1)$/i;function k8(i){return/\.ps1$/i.test(i)}function M8(i){return k8(i)&&/[[\]`*?]/.test(i)}var U8='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',H8=()=>Z.string().describe("Absolute path to the helper executable"),qo=(i)=>Z.preprocess((c)=>c===null?void 0:c,i.optional()).optional(),F8=we,yE=(i)=>Z.number().int().min(i).transform((c)=>Math.min(c,F8)),OE=["path","script","defaultSettings"];function vE(i){if(!i||typeof i!=="object"||Array.isArray(i))return!1;let c=i;return OE.some((T)=>c[T]===null)&&OE.every((T)=>c[T]===null||c[T]===void 0)}var AE=64,fl=e(()=>Z.object({path:H8(),timeoutMs:qo(yE(1000)),refreshIntervalMs:qo(Z.union([Z.literal(0),yE(60000)]))})),kE=()=>Z.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, allowedProviders, 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 ME(i){return i==="continue"||i==="refuse"}var B8=()=>Z.preprocess((i)=>i===void 0||ME(i)?i:"refuse",Z.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`)),z8=5,G8=()=>Z.number().int().min(0).transform((i)=>Math.min(i,z8)).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"),W8=(i)=>(i==="windows"?Z.literal("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):Z.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"),K8="exactly one of path/script must be configured",j8='"script" and "interpreter" must be configured together',$8="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",V8=(i)=>Z.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((c)=>!c.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((c)=>Oe(c),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((c)=>i!=="windows"||!/[\u0080-\uffff]/.test(c),{message:$8}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var gn=["macos","linux","windows","wsl"];function $d(i){return i==="wsl"?["wsl","linux"]:[i]}function Y8(i){return i==="windows"?"win32":"posix"}function X8(i){return{rejectDriveRelative:i==="windows",rejectUnc:i==="windows",rejectNetworkRoot:i!=="windows",rejectMagicLinkRoot:i!=="windows",requireWin32ExecutableSuffix:i==="windows"}}function J8(i){let c=Y8(i),T=X8(i);return Z.string().max(1024,{message:"path must be at most 1024 characters"}).refine((D)=>!I8.test(D),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((D)=>(c==="win32"?PE:wE).isAbsolute(D),{message:"path must be absolute"}).refine((D)=>!(c==="win32"&&T.requireWin32ExecutableSuffix)||v8.test(D),{message:"path must end in .exe or .ps1 on Windows"}).refine((D)=>c!=="win32"||!M8(D),{message:U8}).refine((D)=>N8(D,c,T),{message:c==="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 Vd=[...gn,"default"],Hd=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],pl=["managedSettings","appendSystemPrompt"],Er=e(()=>Z.record(Z.string(),Z.unknown()).superRefine((i,c)=>{for(let T of["policyHelper","policyHelpers"])if(i[T]!==void 0&&i[T]!==null)c.addIssue({code:"custom",message:`must not contain "${T}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let T of Hd)if(i[T]!==void 0&&i[T]!==null)c.addIssue({code:"custom",message:`must not contain "${T}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${Hd.join("/")}) belong on the per-OS entries (policyHelpers.${gn.join("/")})`});for(let T of pl)if(i[T]!==void 0&&i[T]!==null)c.addIssue({code:"custom",message:`must not contain "${T}" — 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 T of Vd)if(i[T]!==void 0&&i[T]!==null)c.addIssue({code:"custom",message:`must not contain "${T}" — 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 "${T}" line inside the slot`})})),Z8='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function q8(i){let{path:c,script:T,interpreter:D,defaultSettings:w}=i;if(c!==void 0&&T!==void 0)return K8;if(T===void 0!==(D===void 0))return j8;if(c===void 0&&T===void 0&&w===void 0)return Z8;return null}function UE(i,c){return fl().omit({path:!0}).extend({path:qo(J8(i)),script:qo(V8(i)),interpreter:qo(W8(i)),outputBehavior:qo(kE()),onFailure:qo(B8()),retries:qo(G8()),defaultSettings:Z.preprocess((T)=>T===null?void 0:T,c.optional()).optional()}).check((T)=>{if(T.issues.length>0)return;let D=q8(T.value);if(D!==null)T.issues.push({code:"custom",message:D,input:T.value})})}var PAe=e(()=>UE("linux",Er()));function Fd(i,c=Er()){return i==="default"?Er():UE(i,c)}var Q8=e(()=>Z.object(Object.fromEntries(Vd.map((i)=>[i,Z.preprocess((c)=>{if(c===null)return;if(i!=="default"&&vE(c))return;return c},Fd(i).optional()).optional()])))),ci=["skills","agents","hooks","mcp"];function HE(i){return Z.preprocess((c)=>{if(!Array.isArray(c))return c;let T=c.filter((D)=>ci.includes(D));if(T.length<c.length)i?.(c.length-T.length);return T},Z.union([Z.boolean(),Z.array(Z.enum(ci))]))}function FE(){return Z.union([Z.array(Z.string()),Z.boolean(),Z.undefined()])}var CE=Object.freeze({type:"invalid-entry-stripped"}),e7=e(()=>Z.union([Z.object({type:Z.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:Z.string().describe("Regex matched against turn output (tool results and assistant text)"),url:Z.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:Z.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),Z.object({type:Z.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),bE=()=>Z.number().int().min(I_).optional().catch(void 0);function BE(i,{strictPolicyHelperKeys:c=!1}={}){function T(w){return Z.record(Z.string(),Gd()).check((x)=>{for(let[U,B]of Object.entries(x.value))if(B.source.source==="settings"&&B.source.name!==U)x.issues.push({code:"custom",input:B.source.name,path:[U,"source","name"],message:`Settings-sourced marketplace name must match its ${w} key (got key "${U}" but source.name "${B.source.name}")`})})}let D=(w,x)=>c?Z.preprocess((U)=>{if(U===null)return;return x?x(U):U},w):w.catch(void 0);return{$schema:()=>Z.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:()=>Z.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:()=>Z.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:()=>Z.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:()=>Z.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:()=>Z.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:()=>Z.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:()=>D(fl().optional(),(w)=>w&&typeof w==="object"&&!Array.isArray(w)&&w.path===null?void 0:w).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:()=>D(Q8().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).`),...Wt.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:()=>Z.object({issuer:Z.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:Z.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:Z.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:()=>Z.object({type:Z.literal("command"),command:Z.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:()=>Z.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:()=>Z.object({enabled:Z.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:Z.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:Z.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:Z.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:()=>Z.object({enabled:Z.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:Z.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:Z.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:()=>Z.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. Cleanup deletes data only on this computer, not anything stored by Anthropic."),desktopSessionCleanupPeriodDays:()=>Z.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. Cleanup deletes data only on this computer, not anything stored by Anthropic."),syncClaudeAiSkills:()=>Z.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 about every 10 minutes while a session is in use and a quarter as often otherwise, and removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),syncClaudeAiPlugins:()=>Z.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:()=>Z.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:()=>Z.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:()=>Z.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:()=>jn(()=>R8()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let w=Z.object({commit:Z.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:Z.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:Z.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 Z.union([Z.boolean(),w],{error:(x)=>{let U=(x.errors??[]).flat().filter((z)=>z.path.length>0);if(U.length>0)return U.map((z)=>`${z.path.join(".")}: ${z.message.replace(/^Invalid input: /,"")}`).join("; ");return`Expected false, true, or an object such as { "commit": "", "pr": "" }, but received ${Array.isArray(x.input)?"array":x.input===null?"null":typeof x.input}`}}).transform((x)=>{if(typeof x!=="boolean")return x;return x?{}:{commit:"",pr:"",sessionUrl:!1}}).pipe(w).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.')},attributionProject:()=>Z.string().optional().describe(`The claude.ai Project this session names for your organization's usage reports: the Project's ID, starting with "claude_proj_" or "chan_", or the UUID of a "claude_proj_" Project. An empty string names none and stops lower-precedence files from naming one; the organization default still applies. A Project is sent only when Claude Code uses your claude.ai login, connects directly to the Anthropic API, is not in a cloud session, and CLAUDE_CODE_ATTRIBUTION_HEADER is not 0. CLAUDE_CODE_ATTRIBUTION_PROJECT takes precedence over it. Set in managed settings, it overrides people's own settings files. A project's .claude/settings.json and settings.local.json count only once the folder is trusted; for runs in a folder nobody has trusted, such as CI, use CLAUDE_CODE_ATTRIBUTION_PROJECT. Behind a Claude apps gateway that reports usage by group, name one of your groups instead, such as "payments"; CLAUDE_CODE_ATTRIBUTION_HEADER does not affect that.`),attributionProjectPolicy:()=>Z.object({default:Z.string().optional().describe('The Project used when neither CLAUDE_CODE_ATTRIBUTION_PROJECT nor attributionProject names one: its ID, starting with "claude_proj_" or "chan_", or the UUID of a "claude_proj_" Project. Behind a Claude apps gateway that reports usage by group, a group name instead.')}).optional().describe("Your organization's default for attributionProject. Only honored from managed settings (server-managed, MDM / OS policy, or managed-settings.json); ignored in user, project, local and --settings sources."),includeCoAuthoredBy:()=>Z.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:()=>Z.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:()=>jn(()=>xE(i)).describe("Tool usage permissions configuration"),model:()=>Z.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:()=>Z.array(Z.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:()=>Z.array(Z.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:()=>Z.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:()=>Z.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:()=>Z.array(Z.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:()=>Z.record(Z.string(),Z.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:()=>Z.object({options:Z.array(jd()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:Z.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:()=>Z.object({multiplier:Kd(),overrides:Z.record(Z.string(),Wd()).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:()=>Z.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:()=>Z.array(Z.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:()=>Z.array(Z.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:()=>Z.boolean().optional().describe("When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected, and a claudeai-proxy server passed explicitly (e.g. via --mcp-config or the SDK mcpServers option) does not connect either. Where a managed or served source sets it, the connectors that the desktop app's Code tab hands to a session do not connect either, from the app version that shows them as turned off. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:()=>Z.record(Z.string(),Z.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:()=>Z.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:()=>jn(()=>Z.record(Z.string().refine(nd,{error:Za}),od(),{error:rd})).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:()=>jn(()=>Z.array(_l())).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 with no ${VAR} in their command, args, url or header values) are allowed without being listed; a managed-mcp.json entry with ${VAR} in any of those must match 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:()=>jn(()=>Z.array(hl())).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:()=>jn(()=>gr()).describe("Custom commands to run before/after tool executions"),worktree:()=>Z.object({symlinkDirectories:Z.array(Z.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:Z.array(Z.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:Z.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:Z.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:Z.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:()=>Z.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."),disableReplyCheck:()=>Z.boolean().optional().describe("Disable the reply check in Claude Tag sessions on a self-hosted runner. The check re-prompts Claude, at most four times a turn, when a turn ends without a call to one of Claude Tag's reply tools. It is not a hook, so disableAllHooks does not affect it. Disabling it also stops two messages to Claude that Anthropic's service can request for such a session: a nudge after a long stretch of work with no visible update, and a reminder added to prompts. Claude Code's built-in reminder to give progress updates, on models that have it, is then no longer held back. Set it in managed settings; false there keeps the check on. Everywhere else it is ignored and the check stays on. Has no effect on sessions that Anthropic hosts."),disableAgentView:()=>Z.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:()=>Z.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:()=>Z.boolean().optional().describe("Disable the Workflows feature. Code Review on pull requests and /ultrareview run in Anthropic's cloud and are not stopped by this setting, except an /ultrareview that has to restart partway through. A machine that runs a review itself refuses it when that machine's own administrator set this, or CLAUDE_CODE_DISABLE_WORKFLOWS in an `env` block, in its managed settings (MDM, the managed-settings file or an administrator's policy helper). Set in the environment before Claude Code starts, CLAUDE_CODE_DISABLE_WORKFLOWS disables Workflows. Beyond the cases above it stops a review only when the review's own session starts with it set."),disableArtifact:()=>Z.boolean().optional().describe("Deprecated: use enableArtifact: false. Still honored — true turns Artifacts off; false is ignored."),enableArtifact:()=>Z.boolean().optional().describe("Turn Artifacts 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:()=>Z.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:()=>Z.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:()=>Z.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:()=>Z.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."),disableWindowsBashCommandSplit:()=>Z.boolean().optional().describe("Windows only. Set to true to keep every Bash command in a single argument to bash, so that endpoint security tools that match text in process command lines see it whole. Otherwise Claude Code may split a long command over several arguments. With true, a command of about 7,000 characters or more, or fewer if it is full of quotes, may reach bash cut short, and then usually fails with a syntax error. Only honored from managed settings; ignored in user, project, local and --settings sources."),defaultShell:()=>Z.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashEditDiffEnabled:()=>Z.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: off, except in auto and bypassPermissions modes when the Bash tool handles file edits or the model's configuration turns it on. Only user, flag or policy settings can turn it on in other modes."),bashOutputMaxChars:()=>Z.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:()=>Z.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:()=>Z.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:()=>Z.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:()=>Z.array(Z.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). Where managed settings do not set this list, a list in any other settings file does not apply to hooks that managed settings define, or that come from a plugin they enable from a local folder they name.'),httpHookAllowedEnvVars:()=>Z.array(Z.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). Where managed settings do not set this list, a list in any other settings file does not apply to hooks that managed settings define, or that come from a plugin they enable from a local folder they name."),allowManagedPermissionRulesOnly:()=>Z.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 (in Claude Desktop, only while this is not set by the organization's own managed settings), 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) (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:()=>Z.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:()=>Z.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:()=>Z.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:()=>HE().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:()=>Z.object({type:Z.literal("command"),command:Z.string(),padding:Z.number().optional(),refreshInterval:Z.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:Z.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:()=>Z.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:()=>Z.array(e7().catch(CE)).transform((w)=>w.filter((x)=>x!==CE)).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:()=>Z.object({type:Z.literal("command"),command:Z.string()}).optional().catch(void 0).describe("Deprecated: still works, and will stop working in a future release. Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:()=>Z.record(Z.string(),FE()).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Only true turns on a marketplace plugin: a list of versions is accepted but leaves it off. 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:()=>Z.array(Z.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 from a local folder or a remote marketplace managed settings name, and 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 cc-plugin-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 it where it should sit or leave it out. Name it there as sec-default@builtin, the id every release reads, for as long as any machine in the organization may run a release from before its rename; a release that knows the new id reads either. 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:()=>Z.array(Z.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:()=>jn(()=>T("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:()=>jn(()=>T("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:()=>jn(()=>Z.array(il())).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:()=>jn(()=>Z.array(il())).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:()=>jn(()=>Z.array(wd())).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, and an entry naming a branch or tag in `ref` also blocks every full commit id in that repository. The check happens BEFORE downloading, so blocked sources never touch the filesystem.'),disableCommandPluginSources:()=>Z.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:()=>Z.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:()=>Z.array(Z.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 tips for Anthropic's own plugins are 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:()=>Z.enum(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for a Claude subscription (individual, Team, or Enterprise plans), "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:()=>Z.string().min(1).optional().catch(void 0).describe('Cloud gateway URL to pre-fill during login, alongside forceLoginMethod: "gateway". Honored from admin-controlled managed settings (MDM / managed-settings.json / policy helper) and, on a machine with none of those, from your own user settings; ignored in project, local, flag, and remote-delivered settings.'),gatewayInternalNetworks:()=>Z.array(Z.string()).optional().catch([WE]).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:()=>Z.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:()=>Z.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, allowedProviders, 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, allowNestedModelAccessUnderForceLogin, 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). In both modes, a forceLoginOrgUUID, or a forceLoginMethod of claudeai or console, that this machine's own MDM policy or managed settings file sets applies ahead of server-managed settings. 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:()=>Z.union([Z.string(),Z.array(Z.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."),allowNestedModelAccessUnderForceLogin:()=>Z.boolean().optional().describe("Self-hosted runner hosts only. Set to true to let a Claude Code started by a runner session's command use the runner's model access (--nested-model-access) when this machine's managed settings set forceLoginOrgUUID or forceLoginMethod. It asks the runner which organization the session owner's sign-in belongs to, and stops if the pin does not permit it or the runner does not answer. Without this key it is left signed out. Any program on the machine can pretend to be the runner, so with this key the pin is not a security boundary: set it on runner hosts only, never in a profile that reaches people's own computers. Honored only from this machine's own administrator sources (MDM, the managed settings file, or a policy helper that they name); ignored in server-managed, user, project, local and --settings sources."),allowedProviders:()=>Z.preprocess((w)=>Array.isArray(w)?w.filter(id):w,Z.array(Z.enum(ti))).optional().catch(void 0).describe(`Managed settings only (managed-settings.json, MDM, or server-managed). The API providers Claude Code may use on this machine: "anthropic" (the Anthropic API on Anthropic's own host, via a claude.ai or Console sign-in or an API key; pair it with forceLoginMethod / forceLoginOrgUUID to require a sign-in), "bedrock", "vertex", "foundry", "anthropicAws", "mantle" (each meaning that provider's own service: its regional, FIPS, private-endpoint and sovereign-cloud hosts), "customEndpoint" (the `+"Anthropic API or a cloud provider's API sent to some other host — ANTHROPIC_BASE_URL, that "+"provider's ANTHROPIC_*_BASE_URL, a Foundry resource name that is not a bare name, or for "+"Bedrock the AWS SDK's AWS_ENDPOINT_URL[_BEDROCK[_RUNTIME]] — such as an LLM gateway; admitted "+`only for the value pinned in the "env" block of the same managed source), or "gateway" (the Cloud gateway sign-in). A session on a provider that is not listed is refused at startup, at login, and when it next contacts the API, with a message naming what selected the provider and the entry that would allow it. Under a list, where first-party traffic goes (ANTHROPIC_BASE_URL, a gateway sign-in) is honored only when the same managed source pins it in "env" (or forceLoginGatewayUrl), and a claude ssh tunnel into the machine is refused. A cloud provider's credential and tenancy variables, and the network path and TLS trust (HTTPS_PROXY, NODE_EXTRA_CA_CERTS, CLAUDE_CODE_CERT_STORE), are not judged by this list; set those for the fleet in the managed "env" block, whose values replace the user's. To route Bedrock through a gateway for a fleet, pin ANTHROPIC_BEDROCK_BASE_URL there (it is what the clients use, ahead of an endpoint_url in ~/.aws/config, which this list does not judge); the AWS SDK's AWS_ENDPOINT_URL* pins only sanction where the SDK's own clients go and never stand in for the "bedrock" entry. Unset allows every provider; an empty array allows none. Only a list in managed-settings.json or MDM is enforcement on the machine: it cannot be widened or hidden by server-managed settings and reaches every session. A list set `+"only in the admin console reaches only sessions that fetch your server-managed settings — not "+"a session on a cloud provider, another organization or a non-Anthropic ANTHROPIC_BASE_URL, one authenticating only with apiKeyHelper or ANTHROPIC_AUTH_TOKEN, a Pro/Max/Ultra login, --bare without "+"an API key, or a first launch before the fetch lands — all conditions the user controls. "+`Versions that predate this setting ignore it; pair it with a minimum-version policy on a mixed fleet. 'claude auth status' reports the Anthropic API as apiProvider "firstParty".`),...!1,forceRemoteSettingsRefresh:()=>Z.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:()=>Z.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:()=>Z.string().optional().describe("Controls the output style for assistant responses"),viewMode:()=>Z.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:()=>Z.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:()=>Z.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:()=>jn(()=>Ja()),...!1,feedbackSurveyRate:()=>Z.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:()=>Z.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:()=>Z.boolean().optional().describe("Whether to show tips in the spinner"),clawdFileProgressEnabled:()=>Z.boolean().optional().describe("@internal Whether to show Clawd, Claude Code's mascot, carrying the file on the progress line when a file goes to or from a connector"),spinnerVerbs:()=>Z.object({mode:Z.enum(["append","replace"]),verbs:Z.array(Z.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:()=>Z.object({excludeDefault:Z.boolean().optional().catch(void 0),tips:D8().optional(),tipsFile:Z.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:Z.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:()=>Z.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),maxProseWidth:()=>Z.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:()=>Z.object({enabled:Z.boolean().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:Z.string().optional().catch(void 0).describe(`Which spell checker to run: ${ll.map((w)=>`"${w}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:Z.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:Z.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 ${ll.slice(0,-1).join(", ")} or ${ll.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:()=>Z.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:()=>Z.enum(Xr).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:()=>Z.enum(Xr).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:()=>Z.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:()=>Z.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:()=>Z.enum($s).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:()=>Z.preprocess((w)=>typeof w==="object"&&w!==null&&!Array.isArray(w)?cr(w,(x,U)=>Object.hasOwn(Object.prototype,U)):w,Z.record(Z.string(),Z.object({effortLevel:Z.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:Z.enum($s).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.'),autoCompactWindow:Z.union([Z.literal("auto"),bE()]).describe('Auto-compact window for this model, in tokens (at least 100000), or "auto" for the window tuned for the model. Within one settings file it replaces the top-level autoCompactWindow for the model. /autocompact saves here. The canonical model name as key 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:()=>Z.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:()=>bE().describe("Auto-compact window size"),...!1,advisorModel:()=>Z.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:()=>Z.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off. On Vertex a saved value is ignored: use /fast each session."),fastModePerSessionOptIn:()=>Z.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:()=>Z.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:()=>Z.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:()=>Z.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."),responseComparisonEnabled:()=>Z.boolean().optional().describe("@internal Set to false to stop Claude Code from showing two answers to one message and asking which is better. When absent or true, it may do so on some turns. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:()=>Z.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:()=>Z.enum(["60s","5m","10m","never"]).optional().catch(void 0).describe(`Idle time before Claude's questions in the terminal auto-continue with any answers selected so far. When unset, the terminal does not auto-continue. The Claude desktop and web apps show Claude's questions in their own interface and may move on from some unanswered ones after a wait the app sets. Claude is then told that nobody answered and uses its best judgment. In sessions that read this setting, only "never" stops the apps from moving on. Leaving it unset does not. Cloud sessions and Cowork tasks do not read your user settings file (~/.claude/settings.json), and managed settings do not reach all of them. This setting is ignored in a project's settings files.`),dialogExpiry:()=>Z.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:()=>Z.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:()=>Z.enum(L_).optional().catch(void 0).describe("@internal Controls the session goal tools (model-proposed 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 tools off. Typing /goal works under every value. Unless disabled, the model can pause any active goal until the user's next message. Consent-affecting, so it is read "+"from trusted sources only (user/policy/flag) — "+"workspace-resident project and local settings are ignored."),companyAnnouncements:()=>Z.array(Z.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:()=>Z.record(Z.string(),Z.object({mcpServers:Z.record(Z.string(),Z.record(Z.string(),Z.union([Z.string(),Z.number(),Z.boolean(),Z.array(Z.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:Z.record(Z.string(),Z.union([Z.string(),Z.number(),Z.boolean(),Z.array(Z.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(Z.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:()=>Z.object({defaultEnvironmentId:Z.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:()=>Z.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:()=>Z.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:()=>Z.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:()=>Z.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:()=>Z.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:()=>Z.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:()=>Z.object({enabled:Z.boolean().optional(),mode:Z.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:Z.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:()=>Z.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:()=>Z.array(NE()).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:()=>Z.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:()=>Z.union([Z.enum(T_),Z.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:()=>Z.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:()=>Z.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:()=>Z.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 for a "+"model with the total_tokens_reminder capability, else off. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:()=>Z.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:()=>Z.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:()=>Z.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:()=>Z.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:()=>Z.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:()=>Z.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:()=>Z.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:()=>Z.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:()=>Z.enum(["disable"]).optional().describe("Disable auto mode"),remoteTools:()=>Z.object({allowUnattendedServing:Z.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:()=>Z.array(Z.object({id:Z.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:Z.string().describe("Display name for the SSH connection"),sshHost:Z.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:Z.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:Z.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:Z.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."),sshHostCommands:()=>Z.unknown().meta({type:"array"}).optional().describe("SSH connections in Claude Desktop whose host comes from a command. A list of entries, each with `id`, `name` and `command`, and optionally `sshIdentityFile` and `startDirectory`. Desktop runs `command` on this computer when you create the connection or another host for it, not each time you connect. `command` is a program name or absolute path (single-quote a path with spaces), then plain arguments. Nothing else can be quoted. For pipes, variables or a leading `~`, use a script. On Windows, the program must be a full path from a drive letter, such as `C:/tools/acme.exe`, ending in `.exe`, `.cmd` or `.bat`. Quoted paths and Windows need Claude Desktop v4.16336.0 or later. The command must print only the host on standard output: `host` or `user@host` on one line, or a JSON object with `sshHost` and, optionally, `sshPort` and `startDirectory`. Desktop reads this key only from user settings and from this computer's managed settings. Claude Code itself does not use it."),claudeMd:()=>Z.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:()=>Z.array(Z.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:()=>Z.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:()=>Z.union([Z.enum(D_),Z.string().startsWith("custom:").transform((w)=>w)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>Z.enum(R_).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:()=>Z.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:()=>Z.record(Z.string(),Z.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:()=>Z.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:()=>Z.enum(b_).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:()=>Z.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:()=>Z.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),precomputeArmTokens:()=>Z.number().int().positive().optional().catch(void 0).describe("@internal Read from the flag settings only, for a host that sends /compact below the automatic threshold: the main conversation starts its background compaction summary at this many tokens, when that is sooner than it would by itself, so that /compact finds it ready. A window set below the billing boundary compacts without a background summary, and this does not change that."),autoCompactRaisedForLoad:()=>Z.boolean().optional().catch(void 0).describe("@internal Read from the flag settings only, in Claude Desktop's Code tab: true lets a conversation compact at twice what is still in each request after a summary (system prompt, tools, instruction files), where that is above its auto-compact threshold."),autoCompactOfferAnswer:()=>Z.object({model:Z.string().min(1).max(200),choice:Z.enum(["accept","keep","undo"]),tokens:Z.number().int().positive(),at:Z.number().int().positive()}).optional().catch(void 0).describe("@internal Read from the flag settings only, in Claude Desktop's Code tab: the person's answer to the app's offer of a lower auto-compact window, which Claude Code records on this computer. `tokens` is the window they chose or kept, and `at` is when they answered (epoch ms)"),idleCompaction:()=>Z.boolean().optional().describe("Set to false to stop Claude Code from compacting a long conversation while the session is idle. Defaults to true."),switchModelsOnFlag:()=>Z.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:()=>Z.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:()=>Z.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:()=>Z.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:()=>Z.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:()=>Z.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:()=>Z.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:()=>Z.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:()=>Z.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:()=>Z.enum(qs).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:()=>Z.boolean().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:()=>Z.object({shareHostProfile:Z.enum(gl).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:()=>Z.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:()=>Z.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:()=>Z.enum(di).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:()=>Z.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:()=>Z.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:()=>Z.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...Pa(cE(i),(w)=>()=>w)}}function zE(i,c={}){let T=BE(i,c);return new cs(T).whole()}var t7=new Set,n7=new Set,El=e(()=>new cs(BE(ps()),t7)),xAe=e(()=>El().whole());function Sl(i){return El().forDocument(i)}var RE=Object.freeze({serverName:"invalid-entry-stripped"});function GE(i){for(let c of i){let T=c.path.length>0?`${c.path.map(String).join(".")}: `:"";if(c.code==="invalid_union"){for(let D of c.errors){let w=GE(D);if(w!==null)return`${T}${w}`}if("note"in c&&typeof c.note==="string"&&c.note!=="")return`${T}${c.note}`}if(c.message!=="")return`${T}${c.message}`}return null}var Yd=e(()=>{let i=El();return Kn().flatMap(({path:c,restrictive:T})=>{if(c.length!==1||c[0]==="strictPluginOnlyCustomization"||c[0]==="disableAllHooks"||typeof T!=="boolean"&&typeof T!=="string")return[];let D=c[0],w=i.field(D);if(w===void 0||w instanceof Z.ZodCatch)return[];return[{key:D,restrictive:T,field:w}]})}),yl=e(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...Yd().map((i)=>i.key)]),Qo=["managedSourcesBehavior","wslInheritsWindowsSettings"];function ui(i){return n(i)&&Object.values(i).every(ui)}function Xd(i){let c=i.wslInheritsWindowsSettings;if(c===void 0||c===null)return"disarmed";let T=us(c);return T===!0?"armed":T===!1?"disarmed":"unreadable"}function Jd(i){let c=i.source==="hostPattern"?i.hostPattern:i.source==="pathPattern"?i.pathPattern:null;if(c!==null&&!qh(c))return`${i.source}: regex does not compile; the entry cannot be enforced`;if(i.source==="github"&&i.repo.includes("*")&&eE(i.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(i.source==="git"&&tE(i.url))return'git: wildcards are only supported in github-form entries, as "<owner>/*"; the entry cannot be enforced';if((i.source==="github"||i.source==="git")&&i.ref!==void 0&&i.ref.includes("*"))return`${i.source}: ref contains "*", which git does not allow in ref names; the entry cannot be enforced`;return null}function TE(i,c){return Z.union([Z.null().transform(()=>{return}),Z.array(Z.unknown()).transform((T)=>{let D=[];for(let[w,x]of T.entries()){let U=(i==="blockedMarketplaces"?wd():il()).safeParse(x);if(U.success){let B=Jd(U.data);if(B!==null){if(i==="blockedMarketplaces")c({path:`${i}[${w}]`,message:`Unenforceable entry was kept: ${B}; it can never match a marketplace source, but marketplace restrictions stay active`}),D.push(U.data);else c({path:`${i}[${w}]`,message:`Invalid entry was ignored: ${B}`});continue}D.push(U.data)}else c({path:`${i}[${w}]`,message:`Invalid entry was ignored: ${GE(U.error.issues)??"failed validation"}`})}if(i==="blockedMarketplaces"&&T.length>0&&D.length===0)c({path:i,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return D})]).optional()}function DE(i,c,T){return Z.array(c.catch((D)=>(T({path:`${i}[]`,message:`Invalid entry was ignored: ${D.issues[0]?.message??"failed validation"}`}),RE))).transform((D)=>D.filter((w)=>w!==RE)).optional()}var WE="(unreadable)";function ul(i,c,T,D,w,x){return Z.array(Z.unknown()).transform((U)=>{let B=[];for(let[z,le]of U.entries()){let fe=c.safeParse(le);if(fe.success){B.push(fe.data);let Ce=w?.(le,fe.data);if(Ce!==void 0)T({path:`${i}[${z}]`,message:Ce,statusOnly:!0})}else{let Ce=fe.error.issues[0],Re=Ce===void 0?"failed validation":Ce.path.length?`${Ce.path.join(".")}: ${Ce.message}`:Ce.message;T({path:`${i}[${z}]`,message:`Invalid entry was ignored: ${Re}`,...x?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(U.length>0&&B.length===0)T({path:i,message:`Every entry of "${i}" was invalid; enforcing an empty allowlist (${D}) until it is fixed.`});return B}).optional().catch(()=>(T({path:i,message:`"${i}" was present but invalid; enforcing an empty allowlist (${D}) until it is fixed.`}),[]))}var fs=e(()=>new Map(Kn().flatMap(({path:i,restrictive:c})=>i.length>1?[[i.join("."),Oo(c)[0]]]:[]))),er=["soft_deny","hard_deny","deny"],o7=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:er,grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),Ol=new Map([["permissions.defaultMode",{read:(i)=>{let c=ns(i);return[...dr,...vd(ps())].find((T)=>T===c)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function Zd(i,c,T,D){let w=[],x=o7.get(i);if(x===void 0)return w;let U=x.restrictions.flatMap((z)=>{switch(T(z)){case"unreadable":return[`"${z}"`];case"trimmed":return x.withholdOnEntryDrop?[`an entry of "${z}"`]:[];case void 0:return[]}});if(U.length===0)return w;let B=U.join(" and ");for(let z of x.grants){let le=Ol.get(`${i}.${z}`),fe=le===void 0?c[z]:le.read(c[z]);if(fe===void 0||le?.inert.has(fe)===!0)continue;if(le===void 0)delete c[z];else c[z]=le.floor,w.push(z);D({path:`${i}.${z}`,message:le===void 0?`"${z}" was withheld because ${B} in the same block could not be read; it takes effect again once that is fixed.`:`"${z}" was withheld because ${B} in the same block could not be read; treating it as ${li(le.floor)} until that is fixed.`,...le!==void 0&&{substituted:!0}})}return w}function ml(i){for(let c of fs().keys())if(c.startsWith(`${i}.`))return!0;return!1}function Al(i){return i!=="sandbox.credentials"&&!i.startsWith("sandbox.credentials.")&&ml(i)}function qd(i){let c=i;while(c instanceof Z.ZodOptional||c instanceof Jc||c instanceof Z.ZodPipe)c=c instanceof Z.ZodPipe?c.out:c.unwrap();return c instanceof Z.ZodObject?c:void 0}var LE=new Set(["remoteTools","remoteControl"]);function KE(i,c){return typeof c==="object"&&c!==null&&i.has(c)}function jE(i,c,T){let D={};for(let[w,x]of Object.entries(c.shape)){let U=`${i}.${w}`;if(T?.has(U))continue;let B=fs().get(U),z=qd(x);if(B!==void 0)D[w]=B;else if(z!==void 0&&ml(U))D[w]=jE(U,z,T)}return D}function IE(i,c){return{path:i,message:`"${c}" was null, which is read as key removal; this source does not set it.`,statusOnly:!0,removal:!0}}function li(i){return typeof i==="string"?`"${i}"`:String(i)}function ai(i,c=0){let T=i===void 0||i.input===void 0?"failed validation":i.code==="custom"&&i.message!==void 0?i.message:("expected"in i)&&typeof i.expected==="string"?`expected ${i.expected}`:("values"in i)&&Array.isArray(i.values)?`expected ${i.values.map(li).join(" or ")}`:"failed validation",D=(i?.path??[]).slice(c);if(D.length===0)return T;return D.every((w)=>typeof w==="number")?`${D.join(".")}: ${T}`:`nested value: ${T}`}function $E(i){return i===!1||i==="false"}function Qd(i,c){if(c===null)return!0;return(i.includes(".")?fs().get(i):Yd().find((D)=>D.key===i)?.restrictive)==="disable"&&$E(c)}function Bd(i,c,T,D){let w=i.slice(i.lastIndexOf(".")+1);if(typeof c==="boolean")return Z.preprocess((x)=>{let U=us(x);if(U!==x)D({path:i,message:`"${w}" holds the string "${String(U)}" where a boolean belongs; reading it as ${String(U)}. Write it without quotes.`,statusOnly:!0});return U},T);if(c==="disable")return Z.preprocess((x)=>{if($E(x)){D({path:i,message:`"${w}" 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 x},T);return T}function r7(i,c,T,D,w,x,U){let B=i.slice(i.lastIndexOf(".")+1),z=fs().get(i),le=U?void 0:z,fe=Ol.get(i),Ce=c instanceof Z.ZodCatch?c.unwrap():void 0,Re=Ce instanceof Z.ZodType?Ce:c;return Bd(i,z,Re,T).catch((Te)=>{if(le!==void 0)return T({path:i,message:`"${B}" was present but invalid (${ai(Te.issues[0])}); treating it as ${li(le)}, its restrictive value, until it is fixed.`,substituted:!0}),D.add(B),le;if(fe!==void 0)return T({path:i,message:`"${B}" was present but invalid (${ai(Te.issues[0])}); treating it as ${li(fe.floor)} until it is fixed.`,substituted:!0}),D.add(B),fe.floor;if(Re.safeParse([]).success){let Ke=Te.value;if(Array.isArray(Ke)){let Le=new Map;for(let nt of Te.issues){let et=nt.path?.[0];if(typeof et==="number"&&!Le.has(et))Le.set(et,ai(nt,1))}let Pe=Re.safeParse(Ke.filter((nt,et)=>!Le.has(et)));if(Le.size>0&&Le.size<Ke.length&&Pe.success){for(let[nt,et]of Le)T({path:`${i}[${nt}]`,message:`Invalid entry was ignored (${et}); it cannot take effect until it is fixed.`});return x.add(B),Pe.data}}}T({path:i,message:z===void 0?`"${B}" was present but invalid (${ai(Te.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${B}" was present but invalid (${ai(Te.issues[0])}) and was ignored, not treated as ${li(z)}; it cannot take effect until it is fixed.`}),w.add(B);return})}function zd(i,c,T,D={}){let w=i.slice(i.lastIndexOf(".")+1),x=new Set,U=new Set,B=new Set,z={};for(let[Ce,Re]of Object.entries(c.shape)){let xe=`${i}.${Ce}`,Te=qd(Re);z[Ce]=D.override?.[xe]??(Te!==void 0&&ml(xe)?zd(xe,Te,T,{...D,strictField:Re}):r7(xe,Re,T,x,U,B,D.neverSubstitute?.has(xe)===!0))}let le=new Set([...D.skeletonExclude??[],...D.neverSubstitute??[]]),fe=c.safeExtend(z);return Z.unknown().transform((Ce)=>{if(Ce===null){T(IE(i,w));return}x.clear(),U.clear(),B.clear();let Re=n(Ce)||D.strictField===void 0?void 0:D.strictField.safeParse(Ce),xe=Re?.success===!0&&n(Re.data)?Re.data:Ce,Te=n(xe)?fe.safeParse(cr(xe,(nt)=>nt===null||nt===void 0)):void 0;if(!n(xe)||Te?.success!==!0){let nt=jE(i,c,le),et=Object.keys(nt);if(T({path:i,message:et.length>0?`"${w}" was present but not an object; treating its locks as their restrictive values (${et.join(", ")}) until it is fixed.`:`"${w}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...et.length>0&&{substituted:!0}}),et.length===0)return;if(!LE.has(i))D.synthesized?.add(nt);return nt}for(let[nt,et]of Object.entries(xe)){let rt=`${i}.${nt}`;if(et===null&&(fs().has(rt)||ml(rt)))T(IE(rt,nt))}let Ke={...Te.data};for(let nt of Zd(i,Ke,(et)=>U.has(et)?"unreadable":B.has(et)?"trimmed":void 0,T))x.add(nt);let Le=cr(Ke,(nt)=>nt===void 0);if(Object.keys(Le).length===0)return Object.entries(xe).some(([nt,et])=>et!==void 0&&Object.hasOwn(c.shape,nt))?void 0:Le;let Pe=D.synthesized;if(Pe!==void 0&&!LE.has(i)&&Object.entries(Le).every(([nt,et])=>x.has(nt)||KE(Pe,et)||ui(et)))Pe.add(Le);return Le}).optional()}function eu(i,c,T){let D=El(),w=(Ge)=>n7.has(Ge)||D.carries(T,Ge),x=(Ge)=>{let ke=D.field(Ge);if(!ke)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return ke},U=new Map,B=(Ge,ke)=>{U.set(Ge,ke)};for(let Ge of["prependPlugins","appendPlugins"])if(D.has(Ge))B(Ge,()=>Z.array(Z.string()).optional().catch((ke)=>{i({path:Ge,message:`${ke.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));B("wslInheritsWindowsSettings",()=>Z.union([Z.null().transform(()=>{return}),Z.preprocess((Ge)=>{let ke=us(Ge);if(ke!==Ge)i({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(ke)}" where a boolean belongs; reading it as ${String(ke)}. Write it without quotes.`,statusOnly:!0});return ke},x("wslInheritsWindowsSettings"))]).optional().catch(()=>{i({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})),B("strictKnownMarketplaces",()=>TE("strictKnownMarketplaces",i).catch(()=>(i({path:"strictKnownMarketplaces",message:'"strictKnownMarketplaces" was present but invalid; enforcing an empty allowlist (no marketplaces admitted) until it is fixed.'}),[]))),B("blockedMarketplaces",()=>TE("blockedMarketplaces",i).catch(()=>{i({path:"blockedMarketplaces",message:'"blockedMarketplaces" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),B("allowedMcpServers",()=>DE("allowedMcpServers",_l(),i).catch(()=>(i({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[]))),B("deniedMcpServers",()=>DE("deniedMcpServers",hl(),i).catch(()=>{i({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),B("managedMcpServers",()=>Z.unknown().transform((Ge)=>qa(Ge,(ke,st)=>i({path:ke?`managedMcpServers.${ke}`:"managedMcpServers",message:ke?`Managed MCP server was ignored: ${st}`:st,statusOnly:!0}))).optional());let z=new Set;for(let{key:Ge,restrictive:ke,field:st}of Yd()){let ft=typeof ke==="string"?`"${ke}"`:String(ke);B(Ge,()=>Z.union([Z.null().transform(()=>{return}),Bd(Ge,ke,st,i)]).optional().catch(()=>(i({path:Ge,message:`"${Ge}" was present but invalid; treating it as ${ft} (its restrictive value) until it is fixed.`,substituted:!0}),z.add(Ge),ke)))}B("strictPluginOnlyCustomization",()=>Z.union([Z.null().transform(()=>{return}),HE((Ge)=>i({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${Ge} ${oe(Ge,"entry","entries")} this version does not recognize as a surface (known: ${ci.join(", ")}); an unrecognized entry locks nothing, so check it for a typo.`,statusOnly:!0}))]).optional().catch(()=>(i({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}),z.add("strictPluginOnlyCustomization"),!0))),B("enabledPlugins",()=>{let Ge=FE();return Z.record(Z.string(),Z.unknown()).transform((ke)=>{let st=[],ft=0;for(let[Ot,Rt]of Object.entries(ke)){let Ct=Ge.safeParse(Rt);if(Ct.success){st.push([Ot,Ct.data]);continue}ft++,i({path:ds().safeParse(Ot).success?`enabledPlugins.${Ot}`:"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(ft>0&&st.length===0){i({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(st)}).optional().catch(()=>{i({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})}),B("availableModels",()=>Z.array(Z.unknown()).transform((Ge)=>{let ke=[];for(let st of Ge)if(typeof st==="string")ke.push(st);else i({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(st)}); the entry was ignored.`});return ke}).optional().catch(()=>(i({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[]))),B("deniedModels",()=>Z.array(Z.unknown()).transform((Ge)=>{let{entries:ke,notes:st}=xt(Ge);for(let ft of st)i({path:"deniedModels",message:ft});return ke}).optional().catch(()=>{i({path:"deniedModels",message:Dt});return})),B("allowedHttpHookUrls",()=>ul("allowedHttpHookUrls",Z.string(),i,"no HTTP hooks may run")),B("httpHookAllowedEnvVars",()=>ul("httpHookAllowedEnvVars",Z.string(),i,"no environment variables may be interpolated into HTTP hook headers")),B("allowedChannelPlugins",()=>ul("allowedChannelPlugins",L8(),i,"no channel plugins admitted",(Ge,ke)=>typeof Ge==="string"?`"allowedChannelPlugins" entry "${Ge}" was accepted; prefer the documented object form {"plugin": "${ke.plugin}", "marketplace": "${ke.marketplace}"}.`:void 0)),B("gatewayInternalNetworks",()=>Z.array(Z.string()).optional().catch(()=>(i({path:"gatewayInternalNetworks",message:'"gatewayInternalNetworks" was present but invalid; gateway sign-in governed by this source is refused until it is fixed.'}),[WE]))),B("forceLoginOrgUUID",()=>x("forceLoginOrgUUID").catch(()=>(i({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]))),B("allowedProviders",()=>ul("allowedProviders",Z.custom(ad,{message:`not a known provider name (${ti.join(", ")})`}),i,"no API provider may be used, so Claude Code will not start on this machine",void 0,{invalidEntryIsStatusOnly:!0}));let le=!1,fe=(Ge,ke)=>{let st=Ge.safeParse(ke);if(st.success)return;return st.error.issues.slice(0,3).map((ft)=>ft.path.length?`${ft.path.join(".")}: ${ft.message}`:ft.message).join("; ")},Ce;B("policyHelper",()=>Z.preprocess((Ge)=>{if(le=!1,Ce=Ge,Ge&&typeof Ge==="object"&&!Array.isArray(Ge)){let ke=Ge;for(let st of["defaultSettings","default",...pl])if(ke[st]!==void 0&&ke[st]!==null)i({path:"policyHelper",message:`"${st}" 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 st of["policyHelper","policyHelpers"])if(ke[st]!==void 0&&ke[st]!==null)i({path:"policyHelper",message:`"${st}" 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 st of gn)if(ke[st]!==void 0&&ke[st]!==null)i({path:"policyHelper",message:`"${st}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${st}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(ke.claudeMd!==void 0&&ke.claudeMd!==null)i({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(ke.outputBehavior!==void 0&&ke.outputBehavior!==null)i({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${gn.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(ke.onFailure!==void 0&&ke.onFailure!==null)i({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${gn.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(ke.retries!==void 0&&ke.retries!==null)i({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${gn.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(ke.path===null||ke.path===void 0)le=!0}return Ge===null?void 0:Ge},fl().optional()).catch((Ge)=>{i({path:"policyHelper",message:`${Ge.issues[0]?.message??fe(fl(),Ce)??"Failed schema validation"}. This field was ignored.`,...le&&{statusOnly:!0}});return}));let Re=(Ge,ke)=>{i({path:Ge,message:`"${Ge}" is not a valid static settings payload: ${ke??"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})},xe=[],Te=(Ge)=>{let ke=!1,st,ft=Fd(Ge,Er().optional().catch((Ot)=>{ke=!0,Re(`policyHelpers.${Ge}.defaultSettings`,Ot.issues[0]?.message??fe(Er(),st&&typeof st==="object"&&!Array.isArray(st)?st.defaultSettings:void 0));return}));return Z.preprocess((Ot)=>{if(ke=!1,st=Ot,Ge!=="default"&&Ot&&typeof Ot==="object"&&!Array.isArray(Ot)){let Rt=Ot;for(let wt of[...pl,"claudeMd"])if(Rt[wt]!==void 0&&Rt[wt]!==null)i({path:`policyHelpers.${Ge}`,message:`"${wt}" on the policyHelpers.${Ge} 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 wt of["policyHelper","policyHelpers"])if(Rt[wt]!==void 0&&Rt[wt]!==null)i({path:`policyHelpers.${Ge}`,message:`"${wt}" on the policyHelpers.${Ge} 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 wt of gn)if(Rt[wt]!==void 0&&Rt[wt]!==null)i({path:`policyHelpers.${Ge}`,message:`"${wt}" on the policyHelpers.${Ge} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${wt} config will NOT apply from here.`,statusOnly:!0});if(Rt.default!==void 0&&Rt.default!==null)i({path:`policyHelpers.${Ge}`,message:`"default" on the policyHelpers.${Ge} 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 Ct=Rt.onFailure;if(Ct!==void 0&&Ct!==null&&!ME(Ct)){let wt;if(typeof Ct==="string"){let zn=Ct.replace(/[^\x20-\x7e]/gu,"?");wt=JSON.stringify(zn.length>AE?`${zn.slice(0,AE-1)}…`:zn)}else if(typeof Ct==="number"||typeof Ct==="boolean")wt=String(Ct);else wt=`a non-string value (${Array.isArray(Ct)?"array":typeof Ct})`;i({path:`policyHelpers.${Ge}.onFailure`,message:`"onFailure": ${wt} on the policyHelpers.${Ge} 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(vE(Ot))return}return Ot===null?void 0:Ot},ft.optional()).catch((Ot)=>{if(Ge==="default"){Re("policyHelpers.default",Ot.issues[0]?.message??fe(Er(),st));return}if(ke)return;let Rt=fe(Fd(Ge),st)??"failed validation",Ct=st,wt=Ct&&typeof Ct==="object"&&!Array.isArray(Ct)?Ct:null,zn=wt?.onFailure,bo=zn!==void 0&&zn!==null&&zn!=="continue",nn=(rn)=>{let uo=`policyHelpers.${Ge}`;if(bo)xe.push({entryKey:Ge,message:rn});else i({path:uo,message:rn,statusOnly:!0})};if(wt){let rn=wt.defaultSettings;if(rn!==void 0&&rn!==null){let uo=Er().safeParse(rn);if(uo.success){let po=wt.outputBehavior,Un=po===void 0||po===null?null:kE().safeParse(po);if(Un&&!Un.success){nn(`Invalid entry was ignored: ${Rt}. 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 ${Ge} from this entry.`);return}return i({path:`policyHelpers.${Ge}`,message:`Invalid entry: its helper fields were ignored (${Rt}), but its "defaultSettings" static payload was kept. No policy helper runs on ${Ge} from this entry.`,statusOnly:!0}),{defaultSettings:uo.data,...Un&&{outputBehavior:Un.data}}}}}nn(`Invalid entry was ignored: ${Rt}. No policy helper runs on ${Ge} from this entry.`);return})};B("policyHelpers",()=>Z.preprocess((Ge)=>{if(xe=[],Ge&&typeof Ge==="object"&&!Array.isArray(Ge)){let ke=Ge;for(let st of["defaultSettings",...pl,"claudeMd"])if(ke[st]!==void 0&&ke[st]!==null)i({path:"policyHelpers",message:`"${st}" 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 st of["policyHelper","policyHelpers"])if(ke[st]!==void 0&&ke[st]!==null)i({path:"policyHelpers",message:`"${st}" 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 st of Hd.filter((ft)=>ft!=="defaultSettings"))if(ke[st]!==void 0&&ke[st]!==null){let ft=st==="script"||st==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":st==="outputBehavior"||st==="onFailure"||st==="retries"?"":", or on the singular policyHelper key";i({path:"policyHelpers",message:`"${st}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${gn.join("/")})${ft}. No helper runs from this field here.`,statusOnly:!0})}}return Ge===null?void 0:Ge},Z.object(Object.fromEntries(Vd.map((Ge)=>[Ge,Te(Ge)]))).transform((Ge)=>{for(let ke of Object.keys(Ge))if(Ge[ke]===void 0)delete Ge[ke];for(let{entryKey:ke,message:st}of xe){let ft=`policyHelpers.${ke}`,Ot=$d(ke).find((Ct)=>Ge[Ct]?.defaultSettings!==void 0&&Ge[Ct]?.defaultSettings!==null),Rt=Ot!==void 0?`${Ot}.defaultSettings`:Ge.default!==void 0?"default":null;i(Rt!==null?{path:ft,message:`${st} Its "onFailure" requires the helper; the "policyHelpers.${Rt}" static payload serves in its place.`,statusOnly:!0}:{path:ft,message:`${st} 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 xe=[],Ge}).optional().catch((Ge)=>(i({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${gn.join(", ")}) to helper entries, plus an optional "default" settings payload (${Ge.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 Ke=new WeakSet;for(let Ge of D.keys){if(Ge==="sandbox"||!Al(Ge))continue;B(Ge,()=>{let ke=x(Ge),st=qd(ke);if(st===void 0)return ke.catch((ft)=>{i({path:Ge,message:`${ft.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return zd(Ge,st,i,{synthesized:Ke,strictField:ke})})}let Le=Object.freeze({mode:"deny"}),Pe=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),nt=0,et=[],rt=new Set,At=new Set,ht=c===void 0?"":`${[...c].reduce((Ge,ke)=>Math.imul(Ge^ke.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,ct=(Ge,ke)=>{if(typeof Ge!=="object"||Ge===null)return;let st=(Pt)=>ke.some((fo)=>fo.path?.includes(Pt)),ft=(Pt)=>{let fo=Ge[Pt];if(typeof fo==="string")return fo;return st(Pt)?"":void 0},Ot=ft("accessKeyIdVar"),Rt=ft("secretAccessKeyVar"),Ct=ft("sessionTokenVar"),wt=Xo;if(![Ot,Rt,Ct].some((Pt)=>Pt!==void 0&&wt.includes(Pt)))return;let zn=(Pt)=>Pt!==void 0&&ts().safeParse(Pt).success;nt+=1;let bo=(Pt)=>`${Xc}${Pt}_${ht}${nt}_`,nn=zn(Ot)?Ot:bo("ACCESS_KEY_ID"),rn=zn(Rt)&&Rt!==nn?Rt:bo("SECRET_ACCESS_KEY"),uo=Ct===void 0?void 0:zn(Ct)&&Ct!==nn&&Ct!==rn?Ct:bo("SESSION_TOKEN"),po=(Pt)=>Pt.startsWith(Xc);if(!po(nn)&&!po(rn)){let Pt=wt.includes(rn)?rn:void 0;if(rn=bo("SECRET_ACCESS_KEY"),Pt!==void 0){let fo=ct({accessKeyIdVar:Pt},[]);if(fo!==void 0)et.push(fo)}}let Un=Xa().safeParse({accessKeyIdVar:nn,secretAccessKeyVar:rn,...uo!==void 0&&{sessionTokenVar:uo}});return Un.success?Un.data:void 0},Tt=(Ge,ke,st)=>Z.array(ke.catch((ft)=>{let Ot=st(ft.value);if(Ot!==void 0)return i({path:`sandbox.credentials.${Ge}[]`,message:`Invalid entry was degraded to mode "deny": ${ft.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${Ge==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),Ot;return i({path:`sandbox.credentials.${Ge}[]`,message:`Invalid entry was ignored: ${ft.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),Le})).transform((ft)=>{let Ot=ft.filter((Rt)=>Rt!==Le);if(ft.length>0&&Ot.length===0)rt.add(Ge);return Ot}).optional().catch((ft)=>{if(typeof ft.value==="object"&&ft.value!==null&&!Array.isArray(ft.value)){let Ot=ke.safeParse(ft.value);if(Ot.success)return i({path:`sandbox.credentials.${Ge}`,message:`"${Ge}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[Ot.data];let Rt=st(ft.value);if(Rt!==void 0)return i({path:`sandbox.credentials.${Ge}`,message:`"${Ge}" 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}),[Rt]}return i({path:`sandbox.credentials.${Ge}`,message:`${ft.issues[0]?.message??"Invalid value"}. "${Ge}" was ignored; these credential entries are NOT protected until it is fixed.`}),rt.add(Ge),[]});B("sandbox",()=>{let Ge=Z.object({files:Tt("files",$a(),(ke)=>{if(typeof ke!=="object"||ke===null||!("mode"in ke)||ke.mode!=="mask"&&ke.mode!=="deny"||!("path"in ke)||typeof ke.path!=="string")return;let st=$a().safeParse({path:ke.path,mode:"deny"});return st.success?st.data:void 0}),envVars:Tt("envVars",Va(),(ke)=>{if(typeof ke!=="object"||ke===null||!("mode"in ke)||ke.mode!=="mask"&&ke.mode!=="deny"||!("name"in ke)||typeof ke.name!=="string")return;let st=Va().safeParse({name:ke.name,mode:"deny"});return st.success?st.data:void 0}),allowPlaintextInject:Bd("sandbox.credentials.allowPlaintextInject",fs().get("sandbox.credentials.allowPlaintextInject"),Z.boolean().optional(),i).catch((ke)=>(i({path:"sandbox.credentials.allowPlaintextInject",message:`${ke.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}),rt.add("allowPlaintextInject"),!1)),awsPairs:Z.array(Xa().catch((ke)=>{let st=ct(ke.value,ke.issues);if(st!==void 0)return i({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${ke.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),st;return i({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${ke.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),Pe})).transform((ke)=>{let st=ke.filter((ft)=>ft!==Pe);if(et.length>0)st.push(...et),et.length=0;if(ke.length>0&&st.length===0)rt.add("awsPairs");return st}).optional().catch((ke)=>{let st=typeof ke.value==="object"&&ke.value!==null?ct(ke.value,[]):void 0,ft=typeof ke.value==="object"&&ke.value!==null&&(("accessKeyIdVar"in ke.value)||("secretAccessKeyVar"in ke.value)||("sessionTokenVar"in ke.value));if(st===void 0&&ft)return et.length=0,i({path:"sandbox.credentials.awsPairs",message:`${ke.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.`}),rt.add("awsPairs"),[];let Ot=st!==void 0?[st]:Xo.flatMap((Rt)=>{let Ct=ct({accessKeyIdVar:Rt},[]);return Ct!==void 0?[Ct]:[]});if(et.length>0)Ot.push(...et),et.length=0;if(st===void 0)rt.add("awsPairs");return i({path:"sandbox.credentials.awsPairs",message:`${ke.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}),Ot}),sigv4:Z.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((ke)=>[ke,Z.enum(["deny","passthrough"]).optional().catch((st)=>(i({path:`sandbox.credentials.sigv4.${ke}`,message:`${st.issues[0]?.message??"Invalid value"}. "${ke}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),At.add(ke),"deny"))]))).transform((ke)=>{let st=Object.entries(ke).filter(([,ft])=>ft!==void 0);if(st.length>0&&st.every(([ft])=>At.has(ft)))rt.add("sigv4");return At.clear(),ke}).optional().catch((ke)=>(i({path:"sandbox.credentials.sigv4",message:`${ke.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}),At.clear(),rt.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((ke)=>{let st=Object.entries(ke).filter(([,ft])=>ft!==void 0);if(st.length>0&&st.every(([ft])=>rt.has(ft)))Ke.add(ke);return rt.clear(),ke}).optional().catch((ke)=>{i({path:"sandbox.credentials",message:`${ke.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 st=Xo.flatMap((Ot)=>{let Rt=ct({accessKeyIdVar:Ot},[]);return Rt!==void 0?[Rt]:[]});et.length=0,rt.clear(),At.clear();let ft={allowPlaintextInject:!1,awsPairs:st,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return Ke.add(ft),ft});return zd("sandbox",Ja(),i,{override:{"sandbox.credentials":Ge},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:Ke})});let It={};for(let Ge of D.keys){if(!w(Ge))continue;let ke=U.get(Ge);It[Ge]=ke?ke():x(Ge).catch((st)=>{i({path:Ge,message:`${st.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[Ge,ke]of U)if(!(Ge in It)&&w(Ge))It[Ge]=ke();return Z.object(It).passthrough().check((Ge)=>{Ge.issues.push(...D.wrongDocumentIssues(Ge.value,It))}).transform((Ge)=>{for(let ft of Object.keys(Ge))if(Ge[ft]===void 0)delete Ge[ft];let ke=Object.keys(Ge).filter((ft)=>!Qo.some((Ot)=>Ot===ft)&&!ui(Ge[ft])),st=ke.length>0&&ke.every((ft)=>z.has(ft)||KE(Ke,Ge[ft]));if(z.clear(),st)for(let ft of ke)i({path:ft,message:`"${ft}" 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 Ge})}var tu=65536,VE=new RegExp(`[${Mn("<")}]`,"gu");function s7(i){return g_(i)&&i.search(VE)===-1}function pi(i){let c={},T=tu,D=0,w=new Set,x=0;for(let U of er.toSorted((B,z)=>Number(z==="hard_deny")-Number(B==="hard_deny"))){let B=n(i)?i[U]:void 0;if(B!==void 0&&B!==null&&!Array.isArray(B))D++,w.add(U);let z=[Yo];for(let le of Array.isArray(B)?B:[]){if(typeof le!=="string"){D++,w.add(U);continue}if(["",Yo].includes(le.trim()))continue;let fe=le.length>2*T?1/0:jt(le);if(fe>T){D++,w.add(U);continue}T-=fe;let Re=Array.from(wn(le),(Te)=>Wa(Te)||Ka(Te)?" ":Te).join("").replace(VE,"&lt;");if(Re.trim()===Yo)continue;let xe=jt(Re)-fe;if(!s7(Re)||xe>T){if(D++,Re.trim()!=="")w.add(U);continue}if(T-=xe,z.push(Re),Re!==le)x++}if(z.length>1)c[U]=z}return{lists:c,leftOut:D,listsThatLostARule:w,mended:x}}function i7(i,c,T,D){var w=i.length,x=T+(D?1:-1);while(D?x--:++x<w)if(c(i[x],x,i))return x;return-1}var YE=i7;function a7(i){return i!==i}var XE=a7;function l7(i,c,T){var D=T-1,w=i.length;while(++D<w)if(i[D]===c)return D;return-1}var JE=l7;function c7(i,c,T){return c===c?JE(i,c,T):YE(i,XE,T)}var ZE=c7;function d7(i,c){var T=i==null?0:i.length;return!!T&&ZE(i,c,0)>-1}var qE=d7;function u7(i,c,T){var D=-1,w=i==null?0:i.length;while(++D<w)if(T(c,i[D]))return!0;return!1}var QE=u7;function p7(){}var eS=p7;var f7=1/0,m7=!(zo&&1/kr(new zo([,-0]))[1]==f7)?eS:function(i){return new zo(i)},tS=m7;var g7=200;function _7(i,c,T){var D=-1,w=qE,x=i.length,U=!0,B=[],z=B;if(T)U=!1,w=QE;else if(x>=g7){var le=c?null:tS(i);if(le)return kr(le);U=!1,w=Yi,z=new Vi}else z=c?[]:B;e:while(++D<x){var fe=i[D],Ce=c?c(fe):fe;if(fe=T||fe!==0?fe:0,U&&Ce===Ce){var Re=z.length;while(Re--)if(z[Re]===Ce)continue e;if(c)z.push(Ce);B.push(fe)}else if(!w(z,Ce,T)){if(z!==B)z.push(Ce);B.push(fe)}}return B}var nS=_7;function h7(i,c){return i&&i.length?nS(i,So(c,2)):[]}var oS=h7;import{join as Ty}from"path";function rS(){return Cn()&&!(eg()&&Wt.CLAUDE_CODE_SESSION_KIND==="bg")}var E7="tengu_fizzy_widget";class sS{reader=null;register(i){let c=this.reader;return this.reader=i,c}servedTrue(i){let c=this.reader;if(!c)return!1;try{return c(i,!1)===!0}catch{return!1}}}var S7=new sS,fi=a({settled:void 0,answeredOff:!1,answeredOn:!1},(i)=>{i.settled=void 0,i.answeredOff=!1,i.answeredOn=!1});function iS(){if(fi.settled!==void 0)return fi.settled;if(fi.answeredOff)return!1;let i=S7.servedTrue(E7);return fi.answeredOff=!i,fi.answeredOn||=i,i}import{createHash as y7}from"crypto";function mi(i){if(Array.isArray(i))return i.map(mi);if(i!==null&&typeof i==="object"){let c={};for(let T of Object.keys(i).sort())c[T]=mi(i[T]);return c}return i}function Cl(i){if(typeof i==="number")return!Number.isFinite(i)||Object.is(i,-0);if(Array.isArray(i))return i.some(Cl);if(i===null||typeof i!=="object")return!1;return Object.hasOwn(i,"__proto__")||Object.values(i).some(Cl)}function aS(i){let c=mi(i),T=o(c);return`sha256:${y7("sha256").update(T).digest("hex")}`}import*as ms from"zod/v4";import{closeSync as O7,constants as A7,fstatSync as C7,lstatSync as b7,openSync as R7,readSync as T7}from"fs";function lS(i,c,{refuseLinkOnWindows:T}){let D;try{if(T&&pe===0&&!b7(i).isFile())return{kind:"refused"};D=R7(i,A7.O_RDONLY|pe);let w=C7(D);if(!w.isFile()||w.size>c)return{kind:"refused"};let x=Buffer.alloc(w.size),U=T7(D,x,0,w.size,0);return{kind:"ok",text:x.toString("utf-8",0,U)}}catch(w){return _(w)?{kind:"absent"}:{kind:"error",error:w}}finally{if(D!==void 0)try{O7(D)}catch{}}}import{verify as w7,X509Certificate as gS}from"crypto";import*as Ut from"zod/v4";var D7=[85,29,19];function bl(i,c,T){if(c+2>T)throw Error("DER: truncated element header");let D=i[c];if((D&31)===31)throw Error("DER: high-tag-number form is not supported");let w=i[c+1],x=c+2,U;if(w<128)U=w;else{let z=w&127;if(z===0||z>3||x+z>T)throw Error("DER: unsupported length encoding");U=0;for(let le=0;le<z;le++)U=U*256+i[x+le];if(U<128||z>1&&i[x]===0)throw Error("DER: non-minimal length encoding");x+=z}let B=x+U;if(B>T)throw Error("DER: element overruns its container");return{tag:D,start:x,end:B}}function gi(i,c){let T=[],D=c.start;while(D<c.end){let w=bl(i,D,c.end);T.push(w),D=w.end}return T}function L7(i,c,T){return c.end-c.start===T.length&&T.every((D,w)=>i[c.start+w]===D)}function Do(i,c){if(i.tag!==c)throw Error("DER: unexpected tag");return i}function cS(i){let c=Do(bl(i,0,i.length),48);if(c.end!==i.length)throw Error("DER: bytes after the Certificate");let T=Do(bl(i,c.start,c.end),48),D=gi(i,T).find((z)=>z.tag===163);if(D===void 0)return;let[w,...x]=gi(i,D);if(w===void 0||x.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");Do(w,48);let U,B=!1;for(let z of gi(i,w)){Do(z,48);let le=gi(i,z),fe=le[0],Ce=le.at(-1);if(fe===void 0||Ce===void 0||le.length<2||le.length>3)throw Error("DER: Extension is not { extnID, critical?, extnValue }");if(Do(fe,6),!L7(i,fe,D7))continue;if(B)throw Error("DER: duplicate basicConstraints extension");if(B=!0,le.length===3)Do(le[1],1);Do(Ce,4);let Re=Do(bl(i,Ce.start,Ce.end),48);if(Re.end!==Ce.end)throw Error("DER: bytes after BasicConstraints");let xe=gi(i,Re),Te=xe[0]?.tag===1?xe.slice(1):xe;if(Te.length>1)throw Error("DER: BasicConstraints has extra members");if(Te[0]!==void 0)Do(Te[0],2),U=I7(i,Te[0])}return U}function I7(i,c){let T=c.end-c.start;if(T===0)throw Error("DER: empty INTEGER");let D=i[c.start];if(D&128)throw Error("DER: negative pathLenConstraint");if(T>1&&D===0&&!(i[c.start+1]&128))throw Error("DER: non-minimal INTEGER");if((D===0?T-1:T)>2)throw Error("DER: pathLenConstraint out of range");let x=0;for(let U=c.start;U<c.end;U++)x=x*256+i[U];return x}var P7=["enterprise","team","consumer","api","other"];function dS(i){return P7.find((c)=>c===i)??"other"}var _S=Symbol("signed-cache mint");class nu{#a=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(i,{kind:c,state:T,bodySha:D,issuedAt:w,notAfter:x,plan:U,organizationUuid:B,accountUuid:z}){if(i!==_S)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=c,this.state=T,this.bodySha=D,this.issuedAt=w,this.notAfter=x,this.plan=U,this.organizationUuid=B,this.accountUuid=z,Object.freeze(this)}static isMadeByVerifier(i){return#a in i}}function hS(i){return typeof i==="object"&&i!==null&&nu.isMadeByVerifier(i)}var x7="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",N7={"managed-settings":86400,"policy-limits":86400},v7=300,ou=16384,k7=8192,M7=300000,U7=3,H7=3600000,F7=/^[A-Za-z0-9_-]+$/,B7=/^[A-Za-z0-9+/]+={0,2}$/,z7=e(()=>Ut.object({alg:Ut.literal("ES256"),typ:Ut.literal("cc-signed-cache+jws"),kid:Ut.string(),x5c:Ut.array(Ut.string().regex(B7)).min(1).max(U7)})),G7=e(()=>Ut.object({v:Ut.literal(1),typ:Ut.string(),aud:Ut.string(),iat:Ut.number(),sha:Ut.string(),sub:Ut.string().optional(),ws:Ut.string().optional(),exp:Ut.int().optional(),abs:Ut.literal(!0).optional(),doc:Ut.string().optional(),plan:Ut.string().optional()})),W7=e(()=>Ut.object({v:Ut.int().min(2)}));function ES({jws:i,...c}){if(!i)return{result:"unsigned"};let T={};try{let D=K7(i,c,T);if(typeof D==="string")return{result:D,...T};return{...T,result:"valid",issuedAt:D.issuedAt,notAfter:D.notAfter,plan:D.plan,verified:new nu(_S,{kind:c.kind,state:D.state,bodySha:c.bodySha,issuedAt:D.issuedAt,notAfter:D.notAfter,plan:D.plan,organizationUuid:D.organizationUuid,accountUuid:D.accountUuid})}}catch{return{result:"malformed",...T}}}function K7(i,{kind:c,orgUuid:T,accountUuid:D,workspaceUuid:w,unanchoredClaims:x,bodySha:U,nowMs:B,roots:z},le){if(i.length>ou)return"malformed";let[fe,Ce,Re,...xe]=i.split(".");if(fe===void 0||Ce===void 0||Re===void 0||xe.length>0||![fe,Ce,Re].every((Ct)=>F7.test(Ct)))return"malformed";let Te=z7().safeParse(mS(fe)),Ke=mS(Ce),Le=G7().safeParse(Ke);if(!Te.success||!(Le.success||W7().safeParse(Ke).success))return"malformed";if(Le.success){if(le.issuedAt=Le.data.iat,le.ageSeconds=Math.floor(B/1000)-Le.data.iat,le.wsUnanchored=w===void 0&&Le.data.ws!==void 0,le.statesLifetime=Le.data.exp!==void 0,le.absence=Le.data.abs===!0,le.plan=dS(Le.data.plan),Le.data.abs===!0&&Le.data.exp===void 0)return"malformed"}let Pe=Te.data.x5c.map((Ct)=>Buffer.from(Ct,"base64"));if(Pe.some((Ct)=>Ct.length>k7))return"malformed";let[nt,...et]=Pe,rt=fS(nt);if(le.certHoursLeft=Math.floor((Date.parse(rt.validTo)-B)/H7),z.length===0)return"no_embedded_root";let At=[rt,...et.map(fS)];for(let Ct=0;Ct+1<At.length;Ct++)if(!uS(At[Ct],At[Ct+1]))return"bad_chain";let ht=At.at(-1),ct;for(let Ct of z){let wt=new gS(Ct.pem);if(uS(ht,wt)){ct={root:Ct,certificate:wt};break}}if(ct===void 0)return"bad_chain";for(let Ct=1;Ct<At.length;Ct++)if(pS(At[Ct],Ct-1))return"bad_chain";if(pS(ct.certificate,At.length-1))return"bad_chain";if(rt.ca)return"bad_chain";if(ct.root.issuingCommonName!==void 0&&(At.length!==2||$7(At[1])!==ct.root.issuingCommonName))return"bad_chain";let Tt=Le.success?Le.data.iat*1000:B;if(![...At,ct.certificate].every((Ct)=>V7(Ct,Tt)))return"cert_expired";if(!j7(rt.subjectAltName??"").includes(`URI:${ct.root.marker}`))return"no_marker";if(rt.publicKey.asymmetricKeyType!=="ec"||rt.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!w7("sha256",Buffer.from(`${fe}.${Ce}`,"utf8"),{key:rt.publicKey,dsaEncoding:"ieee-p1363"},Buffer.from(Re,"base64url")))return"bad_signature";if(!Le.success)return"unsupported_version";if(Le.data.typ!==c)return"wrong_type";let Ge=x==="refuse";if((T!==void 0||Ge)&&Le.data.aud!==T)return"aud_mismatch";if((D!==void 0||Ge)&&Le.data.sub!==D)return"sub_mismatch";if(w!==void 0&&Le.data.ws!==w)return"ws_mismatch";if(Le.data.sha!==U)return"sha_mismatch";let ke=Le.data.abs===!0,st=Le.data.sha===x7;if(c==="managed-settings"?(ke||Le.data.exp!==void 0)&&(ke!==st||ke&&Le.data.doc!==void 0):ke)return"abs_mismatch";let ft=Math.floor(B/1000)-Le.data.iat;if(ft<-v7)return"future_iat";let Ot=Math.min(N7[c],(Le.data.exp??Number.POSITIVE_INFINITY)-Le.data.iat),Rt=Le.data.iat+Ot;if(le.notAfter=Rt,Ot<=0||ft>Ot)return"stale";return{issuedAt:Le.data.iat,notAfter:Rt,state:ke?"absence":"document",plan:dS(Le.data.plan),organizationUuid:Le.data.aud,accountUuid:Le.data.sub}}function j7(i){let c=[],T="",D=!1;for(let w=0;w<i.length;w++){let x=i[w];if(D){if(x==="\\"&&w+1<i.length){T+=x+i[w+1],w++;continue}if(T+=x,x==='"')D=!1;continue}if(x==='"'){D=!0,T+=x;continue}if(x===","){c.push(T),T="";let U=w+1;while(U<i.length&&/\s/.test(i[U]))U++;w=U-1;continue}T+=x}if(D)return[];return c.push(T),c}function uS(i,c){return c.ca&&Boolean(i.checkIssued(c))&&i.verify(c.publicKey)}function $7(i){let c=i.toLegacyObject().subject?.CN;return typeof c==="string"?c:void 0}function pS(i,c){let T=cS(i.raw);return T!==void 0&&c>T}function fS(i){let c=new gS(i);if(c.raw.length!==i.length)throw Error("trailing bytes after x5c certificate DER");return c}function V7(i,c){return c>=Date.parse(i.validFrom)-M7&&c<=Date.parse(i.validTo)}function mS(i){try{return S(Buffer.from(i,"base64url").toString("utf8"))}catch{return}}var Y7=ou+256,X7=e(()=>ms.object({jws:ms.string().min(1),receivedAt:ms.number()}));function J7(i){return`${i}.signature.json`}function Z7(i){return`${i}.signature-iat.json`}var YCe=["remote-settings.json","policy-limits.json"].map(Z7);function SS(i){let c=q7(J7(i),X7());return c.kind==="ok"?c.value:null}function q7(i,c){if(g())return{kind:"absent"};let T=lS(i,Y7,{refuseLinkOnWindows:!0});if(T.kind!=="ok")return T.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let D=c.safeParse(S(T.text));return D.success?{kind:"ok",value:D.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function ru(i,c){return c===void 0||c.includes(i)?void 0:"org_pin_mismatch"}function Q7({verification:i,held:c,pinnedOrgs:T}){if(c.orgUuid!==void 0){let w=ru(c.orgUuid,T);if(w!==void 0)return{trusted:!1,reason:w}}let D;switch(i.result){case"valid":if(!hS(i.verified))return{trusted:!1,reason:"error"};if(i.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};D=i.verified;break;case"unsigned":case"malformed":case"no_embedded_root":case"bad_chain":case"cert_expired":case"no_marker":case"bad_signature":case"unsupported_version":case"wrong_type":case"aud_mismatch":case"sub_mismatch":case"ws_mismatch":case"sha_mismatch":case"abs_mismatch":case"future_iat":case"stale":return{trusted:!1,reason:i.result};default:return{trusted:!1,reason:"error"}}if(c.orgUuid===void 0){let w=ru(D.organizationUuid,T);if(w!==void 0)return{trusted:!1,reason:w}}return{trusted:!0,principal:{orgUuid:c.orgUuid??D.organizationUuid,accountUuid:c.accountUuid??D.accountUuid,workspaceUuid:c.workspaceUuid}}}function Rl(i){switch(i){case"stale":case"future_iat":case"no_lifetime":case"unsigned":case"unsupported_version":return!0;case"malformed":case"no_embedded_root":case"bad_chain":case"cert_expired":case"no_marker":case"bad_signature":case"wrong_type":case"aud_mismatch":case"sub_mismatch":case"ws_mismatch":case"sha_mismatch":case"abs_mismatch":case"org_pin_mismatch":case"org_pin_unknown":case"error":return!1}}function yS({kind:i,cachePath:c,live:T,body:D,bodySha:w,account:x,pinnedOrgs:U,nowMs:B,roots:z}){try{let le=x?.organizationUuid||void 0,fe=x?.accountUuid||void 0,Ce=x?.workspaceUuid||void 0,Re={orgUuid:le,accountUuid:fe,workspaceUuid:Ce};if(le!==void 0&&ru(le,U)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(Cl(D))return{trusted:!1,reason:"sha_mismatch"};return Q7({verification:ES({jws:T!==void 0?T.jws:SS(c)?.jws,kind:i,orgUuid:le,accountUuid:fe,workspaceUuid:Ce,unanchoredClaims:"accept",bodySha:w,nowMs:B,roots:z}),held:Re,pinnedOrgs:U})}catch(le){return t(`signed-cache: judging a stored copy failed: ${h(le)}`,{level:"error"}),{trusted:!1,reason:"error"}}}var eZ={begin:"-----SIGNED-CACHE-ROOTS-BEGIN-----",roots:[{pem:`-----BEGIN CERTIFICATE-----
26
+ MIIB3TCCAYKgAwIBAgIUANUYY/tuc08yPd9Nsh7rY/zDEiwwCgYIKoZIzj0EAwIw
27
+ OjESMBAGA1UEChMJQW50aHJvcGljMSQwIgYDVQQDExtBbnRocm9waWMgQXBwcyBT
28
+ aWduaW5nIFJvb3QwHhcNMjYwOTAyMjMzNDMwWhcNNDEwODI5MjMzNDI5WjA6MRIw
29
+ EAYDVQQKEwlBbnRocm9waWMxJDAiBgNVBAMTG0FudGhyb3BpYyBBcHBzIFNpZ25p
30
+ bmcgUm9vdDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAsUtD9z65VTC61W8M40
31
+ B+bGEhcvb+8mLm/9aTh39H4lwLH0agHzBBqkt4dvqqGzo1J2pJN7L7UoX9nEEVbO
32
+ 7rmjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMB0GA1Ud
33
+ DgQWBBQW+2L0kdDEOi+A6fBK5jpwNdtoCzAfBgNVHSMEGDAWgBQW+2L0kdDEOi+A
34
+ 6fBK5jpwNdtoCzAKBggqhkjOPQQDAgNJADBGAiEA+vhhLCvaUT2ccO0ND0YZaUy0
35
+ e+zhUoJOBhE9hXPs+SkCIQCHdbMcFo/ZQEq/rVnaS8qv/BZvRfYoEm318TY0WBU4
36
+ XA==
37
+ -----END CERTIFICATE-----`,marker:"urn:anthropic:claude-code:signed-cache:production"}],end:"-----SIGNED-CACHE-ROOTS-END-----"},OS=eZ.roots;var AS={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},gs=void 0,CS=Object.freeze(OS.map((i)=>Object.freeze({...i,issuingCommonName:gs!==void 0&&i.marker===gs.marker?gs.issuingCommonName:AS.issuingCommonName})));function tZ(){if(gs!==void 0&&Hn()&&CS.some((i)=>i.marker===gs.marker))return gs.marker;return AS.marker}function nZ(i,c){return Object.freeze(i.filter((T)=>T.marker===c))}function bS(){return nZ(CS,tZ())}var Tl=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_VERTEX"];var oZ=a(new Map,(i)=>i.clear());var Dl=a({isOpen:!1},(i)=>{i.isOpen=!1});function rZ(i){return process.env[i]}function RS(i,c){if(c===void 0){delete process.env[i];return}process.env[i]=c}function sZ(i){return rZ(i.name)===i.theirs}function iZ(){let i=[...oZ.values()];return Dl.isOpen?i:i.filter(sZ)}function TS(i,c){if(Dl.isOpen)return i();let T=iZ();if(T.length===0)return i();let D=T.filter((w)=>w.writer===void 0||c===void 0||!c(w.writer));for(let w=D.length-1;w>=0;w--)RS(D[w].name,D[w].before);Dl.isOpen=!0;try{return i()}finally{for(let w of D)RS(w.name,w.theirs);Dl.isOpen=!1}}var DS="anthropic-skills";var Sbe=Object.freeze([]);var aZ=/[\u093b\u093e-\u0940\u0949-\u094c\u0982\u09be-\u09c0\u09c7\u09c8\u09cb\u09cc\u09d7\u0a3e-\u0a40\u0abe-\u0ac0\u0ac9\u0acb\u0acc\u0b02\u0b3e\u0b40\u0b47\u0b48\u0b4b\u0b4c\u0b57\u0bbe\u0bbf\u0bc1\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcc\u0bd7\u0c01\u0c02\u0c41-\u0c44\u0c82\u0cbe\u0cc0-\u0cc4\u0cc7\u0cc8\u0cca\u0ccb\u0cd5\u0cd6\u0d02\u0d3e-\u0d40\u0d46-\u0d48\u0d4a-\u0d4c]/,lZ=/[\u17a4\u17d8\u261d\u26f9\u270c\u270d\u2e3a\u2e3b\u3248-\u324f\u{1f1e6}-\u{1f1ff}\u{1f3cb}\u{1f3cc}\u{1f574}\u{1f575}\u{1f590}\u{1f93b}\u{1f946}]/u,zbe=new RegExp(aZ.source.slice(0,-1)+lZ.source.slice(1),"u");var cZ=[/^agent-a[0-9a-f]{16}$/,/^agent-a[0-9a-f]{7}$/,/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/];var $be=[...cZ,/^wf-\d+$/,/^bridge-[A-Za-z0-9_]+(-[A-Za-z0-9_]+)*$/,/^job-[a-zA-Z0-9._-]{1,55}-[0-9a-f]{8}$/,/^bg-[a-zA-Z0-9._-]{1,55}-[0-9a-f]{8}$/];var wS=/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/,dZ=new RegExp(wS,"g");function _i(i){return uZ(i,!0)}function uZ(i,c){let T=i.toLowerCase().replace(/\u0131/g,"i").replace(/\u017f/g,"s"),D=T.replace(dZ,"");return(c?D.replace(/:.*$/,""):D).replace(/[. ]+$/,"")||T}var PS=String.raw`[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*\.?`,Ll="[A-Za-z0-9._-]+",su="[A-Za-z0-9._~-]",pZ=`${su}+(?::${su}*)?@`,fZ=":[1-9][0-9]{0,4}",mZ=`(?:/(?:${su}|%[0-9A-Fa-f]{2})*)*`,cRe=new RegExp(`^${Ll}/${Ll}$`),dRe=new RegExp(`^git@(${PS}):(${Ll}(?:/${Ll})*)/?$`),xS=`(?:${pZ})?(${PS})(?:${fZ})?(${mZ})$`,uRe=new RegExp(`^https://${xS}`),pRe=new RegExp(`^https?://${xS}`),fRe=`ssh.${xn}`;class NS{reader=null;register(i){let c=this.reader;return this.reader=i,c}}var hRe=new NS;var gZ="inline",wRe=`${DS}@${gZ}`;var _s="builtin";function vS(i){let c=i.toLowerCase();return Ad(c)?c:i}function kS(i){if(i.startsWith("@")&&Ld(i))return{name:i};if(i.includes("@")){let c=i.split("@");return{name:c[0]||"",marketplace:c[1]}}return{name:i}}function hs(i){return i.normalize("NFC").toLowerCase()}var MS=new Set(["disableAllHooks","disableReplyCheck"]),US=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"],_Z;function HS(i){let c=i.enabledPlugins,T=Object.entries(c??{}).flatMap(([D,w])=>w===!1&&D.endsWith(`@${_s}`)&&_Z?.(c,D)===!0?[D]:[]);return T.length>0?Object.fromEntries(T.map((D)=>[D,!1])):void 0}function iu(i){let c={};for(let Te of Kn()){let{path:Ke,restrictive:Le}=Te;if(MS.has(Ke[0]))continue;let Pe=lr(Te,i);if((typeof Pe==="boolean"||typeof Pe==="string")&&Oo(Le).includes(Pe))vt(c,Ke,Pe)}if(Lt(i,["attribution"])===!1)vt(c,["attribution","sessionUrl"],!1);let T=Il(i.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(T)c.permissions={...c.permissions,...T};for(let Te of hZ)if(i[Te]!==void 0)c[Te]=i[Te];for(let[Te,Ke]of Object.entries(i))if((Te.startsWith("disable")&&(Ke===!0||Ke==="disable")||Te.startsWith("enable")&&Ke===!1)&&!MS.has(Te))c[Te]=Ke;if(i.disableAllHooks===!0)c.allowManagedHooksOnly=!0;if(Array.isArray(i.httpHookAllowedEnvVars)&&i.httpHookAllowedEnvVars.length===0)c.httpHookAllowedEnvVars=[];let D=Il(i.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),w=Il(i.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),x=Il(i.sandbox?.credentials,["files","envVars"])??{},U=i.sandbox?.credentials?.awsPairs,B=n(U)&&US.some((Te)=>(Te in U)),le=(Array.isArray(U)?U:B?[U]:[]).flatMap((Te)=>n(Te)?US.map((Ke)=>Te[Ke]):[]),fe=U!==void 0&&!Array.isArray(U)&&!B,Ce=Xo.filter((Te)=>fe||le.includes(Te));if(Ce.length>0)x.awsPairs=Ce.map((Te,Ke)=>({accessKeyIdVar:Te,secretAccessKeyVar:`${Ya}${Ke+1}_`}));let Re=i.sandbox?.credentials?.sigv4;if(Re){let Te={};for(let[Ke,Le]of Object.entries(Re))if(Le==="deny")Te[Ke]="deny";if(Object.keys(Te).length>0)x.sigv4=Te}let xe=Object.keys(x).length>0;if(D||w||xe){let Te=c.sandbox??{};c.sandbox={...Te,...D&&{filesystem:{...Te.filesystem,...D}},...w&&{network:{...Te.network,...w}},...xe&&{credentials:{...Te.credentials,...x}}}}return Object.keys(c).length>0?c:null}function Il(i,c){if(!i)return;let T={};for(let D of c)if(i[D]!==void 0)T[D]=i[D];return Object.keys(T).length>0?T:void 0}var hZ=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var EZ=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],SZ=["AWS_CA_BUNDLE","DENO_CERT","CARGO_HTTP_CAINFO","PIP_CERT","GIT_SSL_CAINFO","GRPC_DEFAULT_SSL_ROOTS_FILE_PATH","NIX_SSL_CERT_FILE","HEX_CACERTS_PATH"],FS=[...EZ,...SZ],BS={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var yZ=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var HRe=Object.freeze(["--no-optional-locks","status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),OZ=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var AZ=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],CZ=AZ.join(" "),FRe=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:CZ,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...OZ}),BRe=Object.freeze({LC_ALL:"C",LANGUAGE:"C"}),zRe=Object.freeze({GIT_SSH_COMMAND:"false"});var GRe=Object.freeze([...yZ,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),au=["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR","GIT_INDEX_FILE","GIT_CEILING_DIRECTORIES","GIT_DISCOVERY_ACROSS_FILESYSTEM","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_SHALLOW_FILE","GIT_NAMESPACE","GIT_IMPLICIT_WORK_TREE","GIT_REFERENCE_BACKEND"],lu=[...au,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],bZ=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,RZ=new RegExp(bZ.source,"i");var WRe=new Set(lu);function GS(i){let c=0,T=i.length;while(c<T&&zS(i.charCodeAt(c)))c++;while(T>c&&zS(i.charCodeAt(T-1)))T--;let D=TZ(i.slice(c,T));if(D!==-1)return{kind:"line_break",index:cu(i,c+D)};for(let w=c;w<T;w++){let x=i.charCodeAt(w);if(x===0)return{kind:"nul",index:cu(i,w)};if(x>255)return{kind:"non_ascii",index:cu(i,w),codePoint:DZ(i,w)}}return null}function TZ(i){let c=i.indexOf(`
38
+ `),T=i.indexOf("\r");if(c===-1)return T;return T===-1?c:Math.min(c,T)}function zS(i){return i===9||i===32||i===10||i===13}function DZ(i,c){return i.codePointAt(c)??i.charCodeAt(c)}function cu(i,c){let T=0;for(let D=0;D<c;D++){let w=i.charCodeAt(D);if(w>=55296&&w<=56319&&D+1<i.length&&(i.charCodeAt(D+1)&64512)===56320)D++;T++}return T}var du=["NODE_TLS_REJECT_UNAUTHORIZED","BUN_TLS_REFUSE_DISTRUSTED_KEYS"];var WS=["YARN_HTTP_PROXY","YARN_HTTPS_PROXY","npm_config_proxy","npm_config_https_proxy","npm_config_noproxy","GLOBAL_AGENT_HTTP_PROXY","GLOBAL_AGENT_HTTPS_PROXY","GLOBAL_AGENT_NO_PROXY","DOCKER_HTTP_PROXY","DOCKER_HTTPS_PROXY","ELECTRON_GET_USE_PROXY","CLOUDSDK_PROXY_TYPE","CLOUDSDK_PROXY_ADDRESS","CLOUDSDK_PROXY_PORT","CLOUDSDK_PROXY_USERNAME","CLOUDSDK_PROXY_PASSWORD","FSSPEC_GCS","JAVA_TOOL_OPTIONS"];var uu=["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"],KS=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var jS="OTEL_EXPORTER_OTLP_",pu=["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"],$S=[jS,`ANT_${jS}`];var VS={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...KS,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...KS,"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"]},YS=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var XS=["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"],fu=["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",...XS,...YS],LZ=[{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"]}];var iTe=f(LZ.flatMap((i)=>[i.endpoint,...i.companions])),wl=["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"];var aTe=[...wl,"ANTHROPIC_CUSTOM_HEADERS"];var 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"],gu=["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_WORKFLOW_SUBAGENT_MODEL","CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULT","CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT","CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT"],_u=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],IZ=["CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR","CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR","CCR_AGENT_PROXY_TOKEN_FILE_DESCRIPTOR"],lTe=[...XS,...YS,"CLAUDE_CODE_API_BASE_URL","CLAUDE_BRIDGE_BASE_URL","CLAUDE_BRIDGE_SESSION_INGRESS_URL","CLAUDE_REMOTE_TOOLS_BRIDGE_URL","CLAUDE_CODE_GB_BASE_URL","VOICE_STREAM_BASE_URL"],cTe=["CLAUDE_CODE_OAUTH_TOKEN","CLAUDE_CODE_SESSIONS_OAUTH_TOKEN",...IZ,"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"];var wZ=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],hu=[...wZ,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var hi=["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"],Eu=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],dTe=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...uu,...fu,...wl,...mu,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_ASK_AT_START","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...hu,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...Eu,...hi,"AWS_REGION","AWS_DEFAULT_REGION",...gu,"ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_BEDROCK_REGION_PREFIX","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_DISABLE_FEATURE_FLAGS","DISABLE_GROWTHBOOK","CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE",..._u]);var JS=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],PZ=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],xZ=new Set(au),NZ=new Set(["HTTP_PROXY","HTTPS_PROXY","ALL_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_HTTP_PROXY","CLAUDE_CODE_HTTPS_PROXY","NPM_CONFIG_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_HTTPS_PROXY"]);var vZ=f([...FS,...Object.keys(BS),...WS.map((i)=>i.toUpperCase()),...JS,...lu.filter((i)=>!xZ.has(i))]).filter((i)=>i!=="NODE_EXTRA_CA_CERTS"&&i!=="JAVA_TOOL_OPTIONS"&&!NZ.has(i));var uTe=new Set(["CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP","CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP",...du,"CLAUDE_CODE_OAUTH_SCOPES",...vZ]);var ZS="CLAUDE_CODE_AUTO_MODE_MODEL";var kZ=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",...JS,...PZ,"NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP","CLAUDE_CODE_DISABLE_SELF_NAMED_CERT_DROP","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE",...du],qS=[...kZ,"CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_PROXY_SCHEME_REPAIR","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","CLAUDE_CODE_RUNNER_MODEL_SOCKET","CLAUDE_CODE_DISABLE_HTTPS_AGENT_KEEPING","NODE_OPTIONS"];var QS=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],Su=["bwrapPath","ripgrep","socatPath"],ey=["allowAppleEvents","allowNestedUserNamespaces","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],ty=["required","egress"],MZ=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_FEATURE_FLAGS","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","CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL","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_RESOURCE_INCLUDE_HOST","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_FABLE_5_2","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","VERTEX_REGION_CLAUDE_HAIKU_5_5","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE","CLAUDE_CODE_AUTO_COMPACT_WINDOW","CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT","CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS","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_SUBAGENT_EFFORT","CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL","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_CODE_WEB_SEARCH_REFILLS_PER_HOUR","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"]),UZ=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES","CLAUDE_CODE_DISABLE_MCP_TASKS","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_RESPONSE_COMPARISON","CLAUDE_CODE_DISABLE_ULTRATHINK","CLAUDE_CODE_DISABLE_WEB_FETCH","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),HZ=new Set([...[],"ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),FZ=/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|^anthropic-(routing|thread|conversation|affinity|state)-/;function BZ(i){if(/\r(?!\n)/.test(i))return!0;return i.split(/\n|\r\n/).some((c)=>{let T=c.indexOf(":");if(T===-1)return!1;let D=c.slice(0,T).trim();return!zZ.test(D)||GS(c.slice(T+1))!==null||FZ.test(D.toLowerCase())})}var zZ=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function ny(i,c){let T=i.toUpperCase();return MZ.has(T)||GZ(T,c)||T==="ANTHROPIC_CUSTOM_HEADERS"&&!BZ(c)}function GZ(i,c){return UZ.has(i)&&d(c)||HZ.has(i)&&Q(c)}var tr=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function oy(i,c,T){if(!n(i))return[];let D=[];for(let{alias:w,canonical:x}of tr){if(!(w in i))continue;if(i[w]===null){if(!(x in i)&&T?.loneNullAlias==="rename")i[x]=null;delete i[w];continue}if(x in i&&i[x]!==null)D.push({file:c,path:w,message:`"${w}" is an alias for "${x}" and this file sets both; the "${w}" value was ignored. Use only "${x}".`,severity:"warning",alias:w,canonical:x});else i[x]=i[w];delete i[w]}return D}function yu(){let i=at();return i!==void 0&&ve(i)}function ry(){let i=m(),c=i==="wsl"&&!yu()?"linux":i;switch(c){case"unknown":return{platform:c,chain:[]};default:return{platform:c,chain:$d(c)}}}var jZ=["enabled","enabledPlatforms"],Ei="network.allowedDomains",$Z=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function cy(i,c="enabling"){if(!i)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let T=[["top",i],...Si(i),...Si(i).map(([z])=>[z,{slotPresent:!0}]),...gn.map((z)=>[`policyHelpers.${z}`,{outputBehavior:Lo(i,`policyHelpers.${z}.outputBehavior`)}])],D=dy(i,T,c),w=VZ(i,T,c);YZ([D,...w.map(([,z])=>z)]);let x={};for(let[z,le]of w){let fe={shellSettings:le.hasHooks?{...le.shellSettings,hooks:Io(le.hooks)}:le.shellSettings,envVars:le.envVars,sandboxSettings:le.sandboxSettings,isolationSettings:le.isolationSettings};if(fy(fe))x[z]=fe}let{sandboxSwitches:U,...B}=D;return{...B,payloadSlots:x}}function dy(i,c,T){let D={},w;for(let xe of QS){let Te=i[xe];if(xe==="policyHelpers"){if(Te!==null&&typeof Te==="object")for(let Le of gn){let Pe=nq(Te[Le]);if(Pe){if(D[`policyHelpers.${Le}`]=Pe.command,Pe.scriptSize)w??={},w[`policyHelpers.${Le}`]=Pe.scriptSize}}continue}let Ke;if(typeof Te==="string")Ke=Te;else if(Te!==null&&typeof Te==="object"&&"command"in Te&&typeof Te.command==="string")Ke=Te.command;if(Ke!==void 0&&Ke.length>0)D[xe]=Ke}let x=uq(i);for(let[xe,Te]of lq(i,x,c,T))D[`extraKnownMarketplaces[${o(xe)}].listedMods`]=Io({source:Object.hasOwn(x??{},xe)?x?.[xe]?.source??null:null,arming:cq(c,Te)});if(x&&typeof x==="object")for(let[xe,Te]of Object.entries(x)){let Ke=Te?.source;if(!Ke||typeof Ke!=="object")continue;if(Ke.source==="url"&&typeof Ke.headersHelper==="string"&&Ke.headersHelper.length>0)D[`extraKnownMarketplaces[${o(xe)}].source.headersHelper`]=ly(Ke.headersHelper,"url",Ke.url);if(Ke.source==="settings"&&Array.isArray(Ke.plugins)){let Le=new Map;for(let Pe of Ke.plugins){let nt=o(Pe?.name),et=Le.get(nt)??0;Le.set(nt,et+1);let rt=Pe?.source;if(rt!==null&&typeof rt==="object"&&"source"in rt&&rt.source==="command"&&"command"in rt&&typeof rt.command==="string"&&rt.command.length>0)D[`extraKnownMarketplaces[${o(xe)}].plugins[${o(Pe.name)}][${et}].source.command`]=rt.command;if(typeof Pe?.headersHelper==="string"&&Pe.headersHelper.length>0){let At=Pe.source,ht=At!==null&&typeof At==="object";D[`extraKnownMarketplaces[${o(xe)}].plugins[${o(Pe.name)}][${et}].headersHelper`]=ly(Pe.headersHelper,ht&&"source"in At?At.source:void 0,ht&&"url"in At?At.url:void 0)}}}}let U=i.sandbox,B={},z={enabled:Lo(U,"enabled"),enabledPlatforms:Lo(U,"enabledPlatforms"),[Ei]:Lo(U,Ei)};if(U!==null&&typeof U==="object"){let xe={enabled:z.enabled,enabledPlatforms:z.enabledPlatforms};for(let Te of Su){let Ke=sq(U[Te]);if(Ke)D[`sandbox.${Te}`]=Io({value:Ke,...xe})}for(let Te of ey){let Ke=Lo(U,Te);if(XZ(Te,Ke))B[`sandbox.${Te}`]=Io({value:Ke,...xe,...my.has(Te)&&{allowedDomains:gy(z[Ei])}})}}let le=i.isolation,fe={};for(let xe of ty){let Te=Lo(le,xe);if(JZ(xe,Te))fe[`isolation.${xe}`]=Io({value:Te})}let Ce={};if(i.env&&typeof i.env==="object")for(let[xe,Te]of Object.entries(i.env)){if(Te===void 0)continue;let Ke=String(Te);if(Ke.length>0&&!$Z.has(xe.toUpperCase())&&!ny(xe,Ke))Ce[xe]=Ke}let Re=i.hooks!==void 0&&i.hooks!==null&&typeof i.hooks==="object"&&Object.keys(i.hooks).length>0;return{shellSettings:D,inlineHelperScriptSizes:w,envVars:Ce,sandboxSettings:B,isolationSettings:fe,hasHooks:Re,hooks:Re?i.hooks:void 0,sandboxSwitches:z}}function VZ(i,c,T){return Si(i).map(([D,w])=>[D,dy(w,c,T)])}function Si(i){let c=[];for(let T of py){let D=`policyHelpers.${T}`,w=Lo(i,D);if(!P(w))continue;let{policyHelper:x,policyHelpers:U,...B}=w;c.push([D,B])}return c}function Au(i){return gn.find((c)=>i===`policyHelpers.${c}.defaultSettings`)}function uy(i,c){let T=Au(c);return T!==void 0&&Lo(i,`policyHelpers.${T}.outputBehavior`)==="merge"}function YZ(i){let c=i.map((D)=>Object.keys(D.sandboxSettings).length>0||Su.some((w)=>D.shellSettings[`sandbox.${w}`]!==void 0)),T=i.map((D)=>[...my].some((w)=>D.sandboxSettings[`sandbox.${w}`]!==void 0));i.forEach((D,w)=>{if(c.some((x,U)=>x&&U!==w))for(let x of jZ){let U=D.sandboxSwitches[x];if(U!==void 0)D.sandboxSettings[`sandbox.${x}`]=Io({value:U})}if(T.some((x,U)=>x&&U!==w)){let x=D.sandboxSwitches[Ei];if(x!==void 0)D.sandboxSettings[`sandbox.${Ei}`]=Io({value:gy(x)??x})}})}var py=[...gn.map((i)=>`${i}.defaultSettings`),"default"];function Ou(i){let c=[];for(let T of py){let D=`policyHelpers.${T}`,w=i.payloadSlots[D];if(w!==void 0&&fy(w))c.push([D,w])}return c}function fy(i){return Object.keys(i.shellSettings).length>0||Object.keys(i.envVars).length>0||Object.keys(i.sandboxSettings).length>0||Object.keys(i.isolationSettings).length>0}var my=new Set(["credentials","network.tlsTerminate"]);function gy(i){return Array.isArray(i)?f(i.filter((c)=>typeof c==="string")).sort():void 0}function Lo(i,c){let T=i;for(let D of c.split(".")){if(T===null||typeof T!=="object")return;T=T[D]}return T}function XZ(i,c){if(c===void 0||c===null||c===!1)return!1;if(Array.isArray(c)&&c.length===0)return!1;return!(i==="credentials"&&qZ(c))}function JZ(i,c){if(c===void 0||c===null)return!1;switch(i){case"required":return c!==!1;case"egress":return!P(c)||Object.entries(c).some(([T,D])=>ZZ.has(T)?D!==void 0&&D!==null&&!(Array.isArray(D)&&D.length===0):D!==void 0)}}var ZZ=new Set(["allowedHosts","deniedHosts"]);function qZ(i){if(typeof i!=="object"||i===null)return!1;return Object.entries(i).every(([c,T])=>{if(T===void 0)return!0;if(c==="files"||c==="envVars")return Array.isArray(T)&&T.every((D)=>typeof D==="object"&&D!==null&&D.mode==="deny");if(c==="sigv4")return typeof T==="object"&&T!==null&&Object.values(T).every((D)=>D===void 0||D==="deny");return c==="allowPlaintextInject"&&T===!1})}function QZ(i){return Object.keys(i.shellSettings).some(eq)}function eq(i){return gn.some((c)=>i===`policyHelpers.${c}`)}function _y(i){return QZ(i)||Object.keys(i.shellSettings).some((c)=>c.startsWith("extraKnownMarketplaces["))||Ou(i).length>0}function tq(i){return i==="sh"||i==="pwsh"}function nq(i){if(i===null||typeof i!=="object")return;let{path:c,script:T,interpreter:D,timeoutMs:w,refreshIntervalMs:x}=i,U,B;if(typeof c==="string"&&c)U=c;else if(typeof T==="string"&&T&&tq(D))U={interpreter:D,script:rq(T)},B=oq(T);else return;return{command:o([U,w??null,x??null]),scriptSize:B}}function oq(i){return{bytes:Buffer.byteLength(i,"utf8"),lines:Dn(i,`
39
+ `)+(i.endsWith(`
40
+ `)?0:1)}}function rq(i){return je(o(i))}function sq(i){if(typeof i==="string")return i||void 0;if(i===null||typeof i!=="object"||!("command"in i)||typeof i.command!=="string"||!i.command)return;let c="args"in i&&Array.isArray(i.args)?i.args.map(String):[];return o([i.command,...c])}function iq(i){return Io(hy(i))}function hy(i){return{shellSettings:i.shellSettings,envVars:i.envVars,sandboxSettings:Object.keys(i.sandboxSettings).length>0?i.sandboxSettings:void 0,...sy(i),hooks:i.hooks,payloadSlots:Ou(i).length>0?Object.fromEntries(Ou(i).map(([c,T])=>{let{isolationSettings:D,...w}=T;return[c,{...w,...sy(T)}]})):void 0}}function sy(i){return Object.keys(i.isolationSettings).length>0?{isolationSettings:i.isolationSettings}:{}}function iy(i){return[i.prependPlugins,i.appendPlugins].flatMap((c)=>Array.isArray(c)?c:[]).filter((c)=>typeof c==="string").map(hs)}function aq(i){return P(i.enabledPlugins)?Object.entries(i.enabledPlugins).filter(([,c])=>c!==!1&&!Array.isArray(c)).map(([c])=>hs(c)):[]}function ay(i){return kS(i).marketplace}function lq(i,c,T,D){let w=T.flatMap(([,le])=>iy(le)),x=T.flatMap(([,le])=>aq(le)),U=Object.keys(c??{}),B=iy(i).filter((le)=>!le.endsWith(`@${_s}`)).flatMap((le)=>ay(le)??[]).filter((le)=>!U.some((fe)=>hs(fe)===le)),z=new Map;for(let le of[...U,...B]){let fe=hs(le),Ce=Lo(c?.[le],"source.source"),Re=D==="enabling"&&U.includes(le)&&Ce!=="directory"&&Ce!=="file",xe=[...w,...Re?x:[]].filter((Te)=>ay(Te)===fe);if(xe.length>0)z.set(le,xe)}return z}function cq(i,c){let T=new Set(c);return i.flatMap(([D,w])=>["enabledPlugins","prependPlugins","appendPlugins","managedSourcesBehavior","outputBehavior","slotPresent"].flatMap((x)=>{let U=w[x],B=x==="enabledPlugins"?P(U):Array.isArray(U);if(U===void 0)return[];if(!B)return[[D,`${x}:whole`,U]];return(P(U)?Object.entries(U).toSorted():[U].flat().map((le)=>[le])).filter(([le])=>typeof le!=="string"||T.has(hs(le))).map((le)=>[D,x,...le])}))}function Io(i){return o(mi(i))}function Ey(i){return je(iq(i))}function Sy(i,c,T){if(Ey(c)===i)return!0;return typeof T==="string"&&T.length>0&&je(Io({...hy(c),claudeMd:T}))===i}function ly(i,c,T){return o([i,typeof c==="string"?c:null,typeof T==="string"?T:null])}var dq=new Set(["dns","unix","ipv4","ipv6"]),jTe=new Set([...dq,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function yy(i){return i.replace(/[^\x20-\x7e]/gu,"?")}function uq(i){let c=i.extraKnownMarketplaces;if(c!==void 0&&c!==null)return c;let T=i;for(let{alias:D,canonical:w}of tr){if(w!=="extraKnownMarketplaces")continue;let x=T[D];if(x!==void 0&&x!==null&&typeof x==="object")return x}return}var fq="remote-settings.json",mq=5000;var Dy="remote-settings-helper-consent";function gq(){return Ty(R(),Dy)}function _q(i,c){let T=cy(i,c);return _y(T)?T:void 0}function hq(i){let c=cr(i,(T,D)=>D.startsWith("$")&&D!=="$schema");if(Object.keys(c).length!==Object.keys(i).length)Ly.set(c,i);return c}function Oy(i){return Ly.get(i)??i}var Ly=new WeakMap;class Iy{sessionCache=null;storedAccountReader=null;storedCopyGateCovers=!0;storedCopyOrgPin={kind:"unreadable"};mayHideDialog=()=>!1;writesForHiddenDialog=()=>!1;seededUnjudged=null;storedCopyTrust="not_asked";storedCopyRefusal=null;helperTierReadAtMs=null;refusedCopyHelperTier=null;droppedHelperTier=null;eligible=void 0;eligibilityMemo=void 0;machinePinsSignInMemo=void 0;ineligibleReason=void 0;evalPolicySnapshotOnly=!1;hybridTokenRenewalDue=!1;hybridOrganizationUuid=null;usesGatewayVariable=!1;hybridSignInEnded=!1;hybridBlockFilter=null;hybridHostsWithheld=!1;hybridProviderFromOrganization=!1;hybridOnlyForConnection=!1;hybridSignInKeepsCredentialAside=!1;hybridLeftOut=null;hybridMarketplacesOffered=null;hybridPluginLocksByUrl=new Map;hybridPluginLockRules=null;pluginMcpServersListed=[];pluginLocksByUrlView=null;hybridNote=null;hybridCacheLeftOut=null;lastLoadStatus=void 0;lastLoadOkAtMs=void 0;hybridCacheLastRead=void 0;loadCycleEnded=!1;loadCycleBegun=!1;loadCycleEndedSignal=p();loadBackstopReleased=!1;lastLoadStatusChanged=p();hybridStateWritten=p();policySettingsNotified=!1;verifiedPayload=null;verifiedByGateway=void 0;unverifiedView=null;projectedView=null;projectedParse=null;consentedPayload=null;storedPayload=null;deferredPayload=null;resetEpoch=0;backendView=void 0;coworkCloudHolds={};heldSoFar(i){let c=Object.keys(this.coworkCloudHolds).length>0;if(!c&&!Vs())return i;if(i!==null){let T=Vc(this.coworkCloudHolds,i);return this.coworkCloudHolds=Ta(T),T}return c?this.coworkCloudHolds:null}replaceSessionCache(i,c){let T=c?.verified===!0||!Vs();if(!T&&i!==null&&i===this.sessionCache)return;let D=this.heldSoFar(T?Cq(i):null);if(this.keepHelperLeaving(),this.sessionCache=D,c?.verified){if(this.seededUnjudged=null,this.verifiedPayload=D,this.verifiedByGateway=On()?.url,this.projectedView=null,this.projectedParse=null,c.consentDeferred)this.deferredPayload=D;this.hybridStateWritten.emit()}}seedFromDisk(i){let c=Object.keys(this.coworkCloudHolds).length>0?Vc(this.coworkCloudHolds,i):i;this.sessionCache=c,this.seedConsentBaseline(c)}seedConsentBaseline(i){let c=(T)=>{let D=_q(i,T);if(D===void 0)return!0;let w=Lq();return w!==void 0&&Sy(w,D,i.claudeMd)};if(c("enabling"))this.consentedPayload??=i,this.storedPayload??=i;else if(c("listing"))this.storedPayload??=i}markConsented(i,c){if(this.storedPayload=i,c==="enabling")this.consentedPayload=i}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(i,c){if(this.eligible=i,c.memoize)this.eligibilityMemo=i,this.ineligibleReason=i?void 0:c.ineligibleReason}resetListener=null;registerResetListener(i){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=i}keepHelperLeaving(){if(this.sessionCache===this.verifiedPayload){let i=Cu(this.sessionCache);this.droppedHelperTier=i===null?this.droppedHelperTier:{...i,env:{...this.droppedHelperTier?.env,...i.env}}}}reset(){this.keepHelperLeaving(),this.sessionCache=null,this.helperTierReadAtMs=null,this.storedCopyTrust="not_asked",this.storedCopyRefusal=null,this.refusedCopyHelperTier=null,this.storedAccountReader=null,this.storedCopyGateCovers=!0,this.storedCopyOrgPin={kind:"unreadable"},this.mayHideDialog=()=>!1,this.writesForHiddenDialog=()=>!1,this.seededUnjudged=null,this.eligible=void 0,this.eligibilityMemo=void 0,this.machinePinsSignInMemo=void 0,this.ineligibleReason=void 0,this.hybridTokenRenewalDue=!1,this.evalPolicySnapshotOnly=!1,this.hybridOrganizationUuid=null,this.usesGatewayVariable=!1,this.hybridSignInEnded=!1,this.hybridBlockFilter=null,this.hybridHostsWithheld=!1,this.hybridProviderFromOrganization=!1,this.hybridOnlyForConnection=!1,this.hybridSignInKeepsCredentialAside=!1,this.hybridLeftOut=null,this.hybridMarketplacesOffered=null,this.hybridPluginLocksByUrl=new Map,this.hybridPluginLockRules=null,this.pluginLocksByUrlView=null,this.hybridNote=null,this.hybridCacheLeftOut=null,this.lastLoadStatus=void 0,this.lastLoadOkAtMs=void 0,this.hybridCacheLastRead=void 0,this.loadCycleEnded=!1,this.loadCycleBegun=!1,this.loadBackstopReleased=!1,this.policySettingsNotified=!1,this.verifiedPayload=null,this.verifiedByGateway=void 0,this.unverifiedView=null,this.projectedView=null,this.projectedParse=null,this.consentedPayload=null,this.storedPayload=null,this.deferredPayload=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(i){try{this.lastLoadStatusChanged.emit(i)}catch(c){t(`Remote settings: load-status listener threw: ${h(c)}`,{level:"error"})}}}var Eq=new s(()=>new Iy);function Bn(){return Eq.of(A().host)}function Pl(){return iS()||(!An()&&!Rn()||rS())&&Bn().mayHideDialog()}function wy(){return Bn().lastLoadStatus}function Es(){return}function Sq(){return Bn().evalPolicySnapshotOnly}var qDe=new s(()=>new Map);var QDe=new s(()=>new Set);var eLe=new s(()=>new Map);var tLe=new s(()=>new Map);var nLe=new s(()=>new Set);var oLe=new s(()=>({held:void 0,running:void 0,afterRefusal:!1,gatewaySignIn:{auth:null,heldAt:0,refreshInFlight:null},identityProviderRefusedAt:void 0,identityProviderGrant:{held:void 0,spent:void 0,readFailed:!1}}));var rLe=new s(()=>({credentials:new Set,resources:new Set}));var sLe=new s(()=>({value:!1}));var iLe=new s(()=>({value:!0}));var aLe=new s(()=>({value:!1}));function Ru(){return g()||Sq()}function Py(i){let{projectedView:c,projectedParse:T}=Bn();return i!==null&&(c?.view===i||T?.view===i||yq(i))}function xy(i){let{projectedParse:c}=Bn();return c?.view===i?c.raw:void 0}function yq(i){return qr()&&Object.keys(i).length>0&&C(Ta(i),i)}var Oq=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],Ny=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function vy(i){for(let T of Oq)vt(i,T,void 0);for(let{path:T,names:D}of Ny){let w=Lt(i,T),x=(Array.isArray(w)?w:[w]).flatMap((U)=>n(U)&&typeof U[D]==="string"?[{[D]:U[D],mode:"deny"}]:[]);vt(i,T,x.length>0?x:void 0)}for(let T of[["permissions","deny"],["permissions","ask"]]){let D=Lt(i,T);if(Array.isArray(D)){let w=D.filter((x)=>typeof x!=="string"||!ar.test(x));vt(i,T,w)}}for(let{path:T,restrictive:D}of Kn()){let w=Lt(i,T),x=T[0]==="strictPluginOnlyCustomization"?w:us(w);if(D===!0&&x===!1)vt(i,T,void 0)}let c=i.strictPluginOnlyCustomization;if(Array.isArray(c)&&!c.some((T)=>ci.includes(T)))delete i.strictPluginOnlyCustomization;if(i.availableModelsMatch==="prefix")delete i.availableModelsMatch}function ky(i){let c={...iu(i)};if(vy(c),i.parentSettingsBehavior==="merge")c.parentSettingsBehavior="merge";let T=Ra(i);if(T!==void 0)c.pluginConfigs=T;let D=Object.entries(i.enabledPlugins??{}).filter(([w,x])=>x===!1&&!(w.includes("@")&&vS(w.slice(w.lastIndexOf("@")+1))===_s));return D.length===0?c:{...c,enabledPlugins:Object.fromEntries(D)}}function Ay(i){if(!i||!Ru())return i;let c={...iu(i)};if(g()){if(vy(c),i.fastMode===!1)c.fastMode=!1;if(i.fastModePerSessionOptIn===!0)c.fastModePerSessionOptIn=!0;let T=Object.entries(n(i.skillOverrides)?i.skillOverrides:{}).flatMap(([w,x])=>x==="off"?[[w,"off"]]:[]);if(T.length>0)c.skillOverrides=Object.fromEntries(T);let D=Ra(i);if(D!==void 0)c.pluginConfigs=D;if(i===Bn().verifiedPayload){if(typeof i.claudeMd==="string"&&i.claudeMd!=="")c.claudeMd=i.claudeMd;let w=HS(i);if(w!==void 0)c.enabledPlugins=w;for(let[x,U]of Object.entries(pi(i.autoMode).lists))vt(c,["autoMode",x],U)}}return{...c,managedSourcesBehavior:"merge"}}function Aq(){return TS(()=>Vs()||Wt.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&Qm.has(Wt.CLAUDE_CODE_ENTRYPOINT??"")||js())}function My(){return Es()??Ty(R(),fq)}var Uy=8388608;function Hy(i){return i}function Cq(i){if(i===null||!Vs())return i;let c=Ta(i);return C(c,i)?i:c}function bq(){if(Aq())return null;let i=Bn(),c=i.storedCopyRefusal;if(c!==null&&Pl()&&Date.now()-c.atMs<mq)return i.storedCopyTrust={trusted:!1,reason:c.reason},null;i.storedCopyTrust="not_asked",i.storedCopyRefusal=null,i.refusedCopyHelperTier=null;try{let T=Iq();if(T===null)return null;let D=S(be(T));if(!D||typeof D!=="object"||Array.isArray(D))return null;let w=hq(D);return Rq(w)?w:null}catch(T){if(Om(T))t(`Remote settings: Disk cache exceeds ${Uy} bytes; ignoring it as if absent`);return null}}function Rq(i){let c=Bn();if(!Pl()||!c.storedCopyGateCovers||Es()!==void 0||c.evalPolicySnapshotOnly)return c.storedCopyTrust="not_asked",!0;let T=c.storedCopyOrgPin;if(T.kind==="read"){let w=Cy(i,T.orgs);if(w.trusted)return c.storedCopyTrust=w,!0;return by(i,w.reason,Rl(w.reason)),!1}let D=i.forceRemoteSettingsRefresh===!0?Cy(i,void 0):void 0;return by(i,"org_pin_unknown",D!==void 0&&(D.trusted||Rl(D.reason))),!1}function Cy(i,c){try{return yS({kind:"managed-settings",cachePath:My(),body:Oy(i),bodySha:aS(Oy(i)),account:Bn().storedAccountReader?.(),pinnedOrgs:c,nowMs:Date.now(),roots:bS()})}catch(T){return t(`Remote settings: the gate on a stored copy failed: ${h(T)}`,{level:"error"}),{trusted:!1,reason:"error"}}}function by(i,c,T){let D=Bn();D.storedCopyTrust={trusted:!1,reason:c},D.storedCopyRefusal={atMs:Date.now(),reason:c,forcesRefresh:T&&i.forceRemoteSettingsRefresh===!0},D.refusedCopyHelperTier=Rl(c)?Tq(i):null,D.seedConsentBaseline(i),t(`Remote settings: the stored copy is not trusted at rest (${c}); treating it as absent`)}function Cu(i){if(i===null)return null;let{apiKeyHelper:c,env:T}=i;return typeof c==="string"&&c.trim()!==""?{apiKeyHelper:c,env:Vr(n(T)?T:{},(D)=>typeof D==="string")}:null}function Tq(i){let[c]=By(i);if(i===null||c===void 0)return Cu(i);let[T,D]=c;return Cu(uy(i,T)?{...i,...D,env:{...i.env,...D.env}}:D)}var Dq=4096;function Lq(){let i=Tu();if(i!==void 0)return i.attestation;if(g())return;try{return Ko(gq(),Dq).trim()||void 0}catch{return}}function Iq(){let i=Tu();if(i!==void 0)return i.content;if(g()&&Es()===void 0)return null;return Ko(My(),Uy)}function Tu(){let i=Bn().backendView;if(!u()||i===void 0||!i.ready||i.stoodDown||Es()!==void 0)return;if(!vn(i.configHome)){i.standDown("config home changed");return}return i}var lLe=N.state("remote-settings"),cLe=N.state(Dy);var wq=new Set([...qS,...uu,...fu,"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",...hu,...hi,...Eu,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...wl,"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","ALLUSERSPROFILE","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((i)=>i.toUpperCase()));function Pq(i){if(!i||!i.env&&!("managedMcpServers"in i))return i;let{managedMcpServers:c,...T}=i;return i.env?{...T,env:cr(i.env,(D,w)=>wq.has(w.toUpperCase()))}:T}function Fy(){let i=Gy();if(i===null||Ru()||zy(Bn(),i))return!1;if(Ry(i))return!0;return By(i).some(([,c])=>Ry(c))}function By(i){let c=Si(i);if(c.length===0)return[];return[...ry().chain,void 0].flatMap((T)=>c.filter(([D])=>Au(D)===T))}function Ry(i){let c=i.managedMcpServers;return n(c)&&Object.keys(c).length>0}function zy(i,c){return c===i.verifiedPayload||Boolean(Es())}function Gy(){let i=Bn();if(!Es()&&i.eligible!==!0)return i.heldSoFar(null);if(i.sessionCache){if(i.sessionCache!==i.seededUnjudged||!Pl())return i.sessionCache;i.sessionCache=null,i.seededUnjudged=null,an()}let c=Tu()!==void 0,T=bq();if(T){if(i.seedFromDisk(T),i.seededUnjudged=Pl()?null:i.sessionCache,c)ce().invalidatePolicyLayer();else an();return i.sessionCache}return i.heldSoFar(null)}function Wy(i){let c=Gy(),T=Bn(),D=zy(T,c)?c:xq(T,c);if(D===null)return null;if(!Ru())return D;if(T.projectedView?.raw!==D)T.projectedView={raw:D,view:Ay(D)};let w=T.projectedView.view;if(!i)return w;if(T.projectedParse?.raw!==D){let x={...w};Ky(x,Ay(i(D))??{});for(let{alias:U,canonical:B}of tr)if((Lt(x,[B])??null)!==null&&(Lt(w,[B])??null)===null)delete x[U];if(g())for(let{path:U,names:B}of Ny){let z=[w,x].flatMap((le)=>Lt(le,U)??[]);if(z.length>0)vt(x,U,oS(z,B))}T.projectedParse={raw:D,view:x}}return T.projectedParse.view}function Ky(i,c){for(let[T,D]of Object.entries(c)){let w=i[T];if(w!==D&&n(w)&&n(D)){let x={...w};Ky(x,D),i[T]=x}else i[T]=D}}function xq(i,c){if(c===null)return null;if(i.unverifiedView?.raw!==c)i.unverifiedView={raw:c,view:Pq(c)};return i.unverifiedView.view}var Nq=a(new Set,(i)=>i.clear());function $y(i){Nq.add(i)}var jy=a(new Set,(i)=>i.clear());function Vy(i,c){let T=c.filter((D)=>!jy.has(`${i}:${D}`));for(let D of T)jy.add(`${i}:${D}`);return T}var DLe=a({noFollowAny:"untried",localVolumes:void 0},(i)=>{i.noFollowAny="untried",i.localVolumes=void 0});var LLe=Symbol("no procfs"),ILe=Symbol("descriptor path unreadable");var wLe=Symbol("boundRead.linkToNothing");var vq={opus:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnet:"ANTHROPIC_DEFAULT_SONNET_MODEL",haiku:"ANTHROPIC_DEFAULT_HAIKU_MODEL",fable:"ANTHROPIC_DEFAULT_FABLE_MODEL"},Yy=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL"],Xy=[...Tl,"ANTHROPIC_BASE_URL","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","AWS_REGION","AWS_PROFILE",...Yy,"AWS_BEARER_TOKEN_BEDROCK",...mu,"ANTHROPIC_VERTEX_PROJECT_ID","CLOUD_ML_REGION","ANTHROPIC_FOUNDRY_RESOURCE"],MLe=[...Tl,...Yy,"ANTHROPIC_BASE_URL","AWS_REGION","AWS_DEFAULT_REGION","AWS_PROFILE","CLOUD_ML_REGION","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION",...gt.map(([,i])=>i)],ULe=[...Xy,"AWS_ENDPOINT_URL_BEDROCK_RUNTIME","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL","AWS_ENDPOINT_URL_STS","AWS_ENDPOINT_URL_SSO","AWS_ENDPOINT_URL_SSO_OIDC","AWS_ENDPOINT_URL_SIGNIN","ANTHROPIC_BEDROCK_REGION_PREFIX","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN",...hi],Jy=["AWS_BEARER_TOKEN_BEDROCK","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","GOOGLE_APPLICATION_CREDENTIALS","ANTHROPIC_BEDROCK_SERVICE_TIER"],kq=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"];function Mq(i,c){return}function Zy(i,c){let T=new Map(Object.entries(i).map(([le,fe])=>[le.toUpperCase(),fe])),D=new Set(Object.entries(c??{}).filter(([,le])=>le.trim()!=="").map(([le])=>le.toUpperCase())),w=Mq(c,T.get("AWS_REGION"))!==void 0&&kq.some((le)=>T.get(le)==="")?["AWS_BEARER_TOKEN_BEDROCK"]:[],x=Boolean(T.get("AWS_CONFIG_FILE"))&&T.get("AWS_ACCESS_KEY_ID")==="",U=D.has("AWS_PROFILE")||D.has("AWS_ACCESS_KEY_ID"),B=D.has("AWS_CONFIG_FILE")||D.has("AWS_SHARED_CREDENTIALS_FILE"),z=D.has("AWS_ACCESS_KEY_ID");if(!(B||z))return{dropped:[],cleared:w};return{dropped:["AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE",...x||z||D.has("AWS_PROFILE")?["AWS_PROFILE"]:[],...x&&!U?["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","AWS_BEARER_TOKEN_BEDROCK"]:[]],cleared:[...w,...z&&!T.has("AWS_SESSION_TOKEN")&&!D.has("AWS_SESSION_TOKEN")?["AWS_SESSION_TOKEN"]:[]]}}var HLe=[...Xy,"AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","ANTHROPIC_BEDROCK_SERVICE_TIER",...Object.values(vq),"ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION",...gt.map(([,i])=>i),"ANTHROPIC_CUSTOM_HEADERS"],qy=["availableModels","availableModelsMatch","modelPicker"];function Qy(i){let c=dn(i.trim().toLowerCase());if(c==="")return{kind:"ignored"};if(De(c))return{kind:"family",family:c};let T=c.startsWith("claude-")?c.slice(7):"";if(De(T))return{kind:"family",family:T};if(kt(c)||c==="default")return{kind:"ignored"};let D=J(c)!==null||c.startsWith("claude-")?c:`claude-${c}`,w=J(D);return w!==null?{kind:"model",id:w,latest:Hq(D,w),spelling:D}:{kind:"literal",value:c}}function Uq(i,c){let T=i.toLowerCase(),D=T.lastIndexOf(c.base);return D===-1?"":T.slice(D+c.base.length)}function Hq(i,c){return c.trailer===void 0&&Uq(i,c).startsWith("-latest")}function Fq(i,c){for(let T of c){if(De(T))continue;let D=T.indexOf(i);if(D===-1)continue;let w=D+i.length;if(w===T.length||T[w]==="-")return!0}return!1}function Bq(i){return i.charAt(0).toUpperCase()+i.slice(1)}function eO(i){let c;for(let T of Jn){let D=J(T);if(D!==null&&D.family===i&&!D.legacyVersionFirst&&(c===void 0||Zn(D,c)>0))c=D}return c?.base}function tO(i,c){let T=Qy(i);switch(T.kind){case"ignored":{if(i.trim()==="")return"An empty availableModels entry was ignored.";let D=eO("opus");return`"${L(i)}" 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${D===void 0?"":`, for example "${D}"`}.`}case"family":{let D=c.filter((x)=>Qy(x).kind!=="ignored").map((x)=>dn(x.trim().toLowerCase()));if(De(i.trim().toLowerCase())&&Fq(T.family,D))return;let w=eO(T.family);return`"${L(i)}" in availableModels allows every ${Bq(T.family)} model, including future releases, even though "availableModelsMatch" is "exact". To allow only some versions, list their model IDs instead${w===void 0?"":`, for example "${w}"`}.`}case"model":return;case"literal":return zq(i,T.value)}}function zq(i,c){let T=`"${L(i)}" in availableModels allows only a model named exactly "${L(c)}".`,D=c.replace(/(\d)\.(\d)/g,"$1-$2");if(D!==c){let x=D.startsWith("claude-")?D:`claude-${D}`;if(J(x)!==null)return`${T} To allow a version, write it with a hyphen: "${L(x)}".`}let w=new RegExp(`^(${Ae.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(c);if(w){let[,x,U,B]=w;return`${T} To allow a version, write its model ID, for example "claude-${x}-${U}${B!==void 0?`-${B}`:""}".`}return}function Gq(i){return i!==void 0&&(i.commit!==void 0||i.pr!==void 0)}function nO(i,c){let T=i?.commitTrailers;if(typeof T==="boolean")return T?"explicit-enabled":"disabled";if(i!==void 0&&Gq(i))return i.commit===""?"disabled":"implicit-enabled";if(c!==void 0)return c?"implicit-enabled":"disabled";return}import{closeSync as Qq,lstatSync as dO,openSync as eQ,readdirSync as tQ,readSync as nQ,realpath as oQ,realpathSync as rQ,statSync as sQ}from"node:fs";import{join as AIe,posix as vl,resolve as uO,sep as iQ}from"node:path";import{promisify as aQ}from"node:util";import{posix as Wq}from"path";var oO=String.raw`(?![\p{Default_Ignorable_Code_Point}\u{16FE4}])[\p{L}\p{M}\p{N}._-]`;var{dirname:xl,isAbsolute:QLe,join:Nl,normalize:eIe,relative:tIe,sep:nIe}=Wq,yi="/mnt/user-data/uploads",Kq="/uploads",rO="/uploads/cowork-folders/",oIe=`${yi}${rO.slice(Kq.length)}`;var rIe=new RegExp(`^(${rO}[a-z0-9-]+/)(?:CLAUDE\\.md|\\.cowork-folder)$`);var sIe=Nl(xl(yi),"outputs");var iIe=Nl(xl(yi),"attachments"),aIe=Nl(xl(yi),"project-docs"),jq="/connector-downloads",sO=String.raw`download-[0-9a-f]{8}\.[a-z0-9]{2,5}`,$q=String.raw`(?!(?:(?<![\p{L}\p{N}\p{M}])|(?<=\p{M}{8}))\p{M})${oO}`,Vq=String.raw`[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/(?:${sO}|(?![.-])(?:${$q}){1,80}\.[a-z0-9]{2,5})`,lIe=new RegExp(`/${sO}$`),cIe=new RegExp(`^${Vq}$`,"u");var Yq=Nl(xl(yi),jq);function iO(){return Yq}var Xq="/mnt/project-files",dIe=Object.freeze({product:Xq,attach:"/mnt/attach/project-files"});import{join as Jq,resolve as Zq}from"node:path";function lO(i){let c=Ee();if(c===null)return!1;let T=aO(Zq(Jq(c,"projects"))),D=aO(i);return D.length===T.length+2&&T.every((w,x)=>w===D[x])&&/\.[0-9a-f]{16}$/.test(D.at(-2)??"")}function aO(i){return i.split(/[\\/]/).map(_i)}import{constants as Du}from"fs";function cO(){return Du.O_RDONLY|qq()}function qq(){if(m()==="windows")return 0;return Du.O_NOFOLLOW|Du.O_NONBLOCK}var kIe=aQ(oQ.native),lQ="connector-downloads";function cQ(i){if(typeof i!=="string")return!1;return i.split(/[\\/]/).slice(0,-1).some(Lu)}function Lu(i){return _i(i)===lQ}var dQ=1000;var Ml=a(new Map,(i)=>i.clear()),uQ=256,Ul=/^([^~./\\]{1,6})~\d+(\.[^./\\]{0,3})?$/;function pQ(i,c,T){if(Ml.size>=uQ)Ml.clear();Ml.set(i,{expanded:c,dev:T.dev,ino:T.ino})}function fQ(i){if(process.platform!=="linux"||!i.startsWith("/"))return;let c=i.split("/").filter((D)=>D!=="");if(!c.some((D)=>Ul.test(D))||m()!=="wsl")return;let T="/";try{for(let D of c){let w=Ul.exec(D);if(w===null){T=vl.join(T,D);continue}let x=vl.join(T,D),U=sQ(x,{bigint:!0}),B=Ml.get(x);if(B!==void 0&&B.dev===U.dev&&B.ino===U.ino){T=B.expanded;continue}let z;if(!Xe(U.ino)){let fe=tQ(T);for(let Ce of gQ(fe,D,w[1])){let Re;try{Re=dO(vl.join(T,Ce),{bigint:!0})}catch{continue}if(Re!==void 0&&Re.dev===U.dev&&Re.ino===U.ino){z=Ce;break}}}let le=vl.join(T,z??D);pQ(x,le,U),T=le}}catch{return}return T}function mQ(i){if(process.platform!=="win32"||Me(i))return;try{return rQ.native(i)}catch{return}}function gQ(i,c,T){let D=T.toLowerCase(),w=i.filter((z)=>z!==c),x=w.filter((z)=>!Ul.test(z)),U=x.filter(Lu),B=x.filter((z)=>!U.includes(z)&&z.replace(/[ .]/g,"").toLowerCase().startsWith(D));return[...U,...B,...x.filter((z)=>!U.includes(z)&&!B.includes(z)),...w.filter((z)=>Ul.test(z))].slice(0,dQ)}function _Q(i){return i.replace(/[\\/][^\\/]*$/,"")}var kl=a(new Map,(i)=>i.clear());function Hl(i){let c=kl.get(i);if(c!==void 0)return c;let T=!1;for(let D of pO(i)){let w=uO(D).split(/[\\/]/);for(let x=0;x<w.length&&!T;x++)if(Lu(w[x])){let U=w.slice(0,x+1).join("/");T=U===iO()||lO(U)||SQ(`${U}/.gitignore`)}}if(kl.size>=64)kl.clear();if(T||!i.includes("~"))kl.set(i,T);return T}var hQ=/^(download-[0-9a-f]{8}(-\d+)?(\.[^./\\]*)?|\..+\.from\.json|\.download-[0-9a-f]{8}(-\d+)?(\.[^./\\]*)?\.part)$/;function EQ(i){let c=dO(i);if(!c.isFile()||c.size>3)return"";let T=eQ(i,cO());try{let D=Buffer.alloc(4),w=nQ(T,D,0,D.length,0);return D.subarray(0,w).toString("utf8")}finally{Qq(T)}}function SQ(i){let c=l();try{let T=Je(c,i);if(c.readdirSync(_Q(i)).some((w)=>hQ.test(w.name)))return!0;if(T.absentAt!==void 0)return!1;return["*",`*
41
+ `,`*\r
42
+ `].includes(EQ(i))}catch{return!0}}function Oi(i){return pO(i).some((c)=>cQ(`${c}/.`))}function pO(i){let c=m();if(!i.includes("~")||c!=="windows"&&c!=="wsl")return[i];let T=uO(i).split(/[\\/]/);return[i,...T.flatMap((D,w)=>{if(!D.includes("~")&&w<T.length-1)return[];let{resolvedPath:x,isCanonical:U}=ye(l(),ze(T.slice(0,w+1).join(iQ)));return U?[mQ(x)??fQ(x)??x]:[]})]}var yQ=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function Fl({slot:i,adminTiers:c}){return i?.allowManagedMcpServersOnly===!0||c.some((T)=>T.allowManagedMcpServersOnly===!0)}function Iu({slot:i,adminTiers:c}){return i?.allowedMcpServers??c.find((T)=>T.allowedMcpServers!==void 0)?.allowedMcpServers}function fO(i,c){return yQ.filter((T)=>i[T]!==void 0&&!OQ(T,i,c))}function OQ(i,c,T){let D=T.slot??{};switch(i){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return c.allowManagedMcpServersOnly===Fl(T);case"disableClaudeAiConnectors":return c.disableClaudeAiConnectors===(D.disableClaudeAiConnectors===!0||T.adminTiers.some((w)=>w.disableClaudeAiConnectors===!0));case"allowedMcpServers":return C(c.allowedMcpServers,Fl(T)?Iu(T):D.allowedMcpServers);case"disabledMcpjsonServers":return(c.disabledMcpjsonServers??[]).every((w)=>D.disabledMcpjsonServers?.includes(w)===!0);case"enabledMcpjsonServers":return(c.enabledMcpjsonServers??[]).every((w)=>D.enabledMcpjsonServers?.includes(w)===!0);case"enableAllProjectMcpServers":return(c.enableAllProjectMcpServers??!1)===(D.enableAllProjectMcpServers??!1);case"managedMcpServers":{let w=D.managedMcpServers??{};return Object.entries(c.managedMcpServers??{}).every(([x,U])=>Object.hasOwn(w,x)&&C(w[x],U))}}}var Ai=64;var AQ=2000000;function Ss(i,c=Ai){if(!wu(i))return{copy:M(i),cut:0,dropped:[]};let T=Array.isArray(i)?[]:{},D=0,w=new Map,x=[{from:i,into:T,depth:1}],U=0;for(let z=x.pop();z;z=x.pop()){if(U+=1,U>AQ)throw RangeError("settings document has too many objects to copy");let le=Array.isArray(z.from)?z.from.entries():Object.entries(z.from);for(let[fe,Ce]of le){let Re=z.top??String(fe),xe=Ce;if(wu(Ce))if(z.depth>=c){D+=1;let Te=w.get(Re);if(Te)Te.count+=1;else{let Ke=[String(fe)];for(let Le=z;Le;Le=Le.up)if(Le.key!==void 0)Ke.unshift(String(Le.key));w.set(Re,{key:Re,count:1,path:Ke.join(".")})}if(!Array.isArray(z.into)&&CQ(Ce))continue;xe=null}else{let Te=Array.isArray(Ce)?[]:{};x.push({from:Ce,into:Te,depth:z.depth+1,key:fe,up:z,top:Re}),xe=Te}else if(typeof Ce==="object"&&Ce!==null||typeof Ce==="function")xe=M(Ce);if(Array.isArray(z.into))z.into.push(xe);else Object.defineProperty(z.into,fe,{value:xe,enumerable:!0,writable:!0,configurable:!0})}}let B=new Map(Object.keys(i).map((z,le)=>[z,le]));return{copy:T,cut:D,dropped:[...w.values()].sort((z,le)=>(B.get(z.key)??0)-(B.get(le.key)??0))}}function CQ(i){let c=new Set,T=[i];for(let D=T.pop();D;D=T.pop()){if(Array.isArray(D))return!1;if(c.has(D))continue;c.add(D);for(let w of Object.values(D)){if(!wu(w))return!1;T.push(w)}}return!0}function wu(i){if(typeof i!=="object"||i===null)return!1;let c=Object.getPrototypeOf(i);return Array.isArray(i)||c===Object.prototype||c===null}var mO=512;function Pu(i){return i.map(bQ)}function bQ(i){let{file:c,severity:T,docLink:D,statusOnly:w,startupFatal:x,loadedWithoutGuardHook:U,errorClass:B,errno:z,unreadCause:le,preserveOnWrite:fe,mcpErrorMetadata:Ce,userWritable:Re,wslIgnored:xe,substituted:Te,onlySubstitutes:Ke,removal:Le,unattendedSafe:Pe,line:nt,column:et,path:rt,message:At,expected:ht,suggestion:ct,invalidValue:Tt,...It}=i,Xt=It;return{file:c,severity:T,docLink:D,statusOnly:w,startupFatal:x,loadedWithoutGuardHook:U,errorClass:B,errno:z,unreadCause:le,preserveOnWrite:fe,mcpErrorMetadata:Ce,userWritable:Re,wslIgnored:xe,substituted:Te,onlySubstitutes:Ke,removal:Le,unattendedSafe:Pe,line:nt,column:et,path:Ci(rt),message:Ci(At),expected:ht===void 0?void 0:Ci(ht),suggestion:ct===void 0?void 0:Ci(ct),invalidValue:typeof Tt==="string"?Ci(Tt):void 0}}function Ci(i){let c=yy(i.replace(/\s+/gu," "));return c.length>mO?`${c.slice(0,mO-1)}…`:c}function gO(i,c){if(c===null)return i;let T=[...c.values];return{settings:un(In(i.settings,T.filter(([,D])=>D===void 0).map(([D])=>D)),M(Object.fromEntries(T.filter(([,D])=>D!==void 0))),(D,w)=>w),errors:[...i.errors,...c.errors]}}var RQ=[["permissions","additionalDirectories"],["permissions","blockReadsExemptPaths"],["autoMode","allow"],["autoMode","environment"],["enabledMcpjsonServers"],["extraKnownMarketplaces"],["sandbox","excludedCommands"],["sandbox","ignoreViolations"],["sandbox","filesystem","allowRead"],["sandbox","filesystem","allowWrite"],["sandbox","network","allowedDomains"],["sandbox","network","allowMachLookup"],["sandbox","network","allowUnixSockets"],["sandbox","network","httpProxyPort"],["sandbox","network","socksProxyPort"]],TQ=[["allow",!0],["deny",!1],["ask",!1]];function _O(i){let c=M(i);for(let D of RQ)vt(c,D,void 0);for(let D of Kn()){let w=lr(D,c);if(D.path[0]!=="disableAllHooks"&&Lt(c,D.path)!==void 0&&!Oo(D.restrictive).some((x)=>x===w))vt(c,D.path,void 0)}for(let[D,w]of TQ){let x=["permissions",D],U=Lt(c,x);if(Array.isArray(U)){let B=U.filter((z)=>ar.test(String(z))===w);vt(c,x,B.length>0?B:void 0)}}for(let D of er){let w=["autoMode",D],x=Lt(c,w);if(Array.isArray(x)&&!x.includes(Yo))vt(c,w,[Yo,...x])}let T=Lt(c,["enabledPlugins"]);if(n(T)){let D=Object.entries(T).filter(([,w])=>w!==!0);vt(c,["enabledPlugins"],D.length>0?Object.fromEntries(D):void 0)}return c}var DQ="bot_protected_tengu_foamy_pebble",LQ=new ur;function hO(){return LQ.read(DQ,!0)}var wo="https://code.claude.com/docs/en",IQ=[{matches:(i)=>i.path==="permissions.defaultMode"&&i.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${wo}/iam#permission-modes`}},{matches:(i)=>i.path==="apiKeyHelper"&&i.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:(i)=>i.path==="cleanupPeriodDays"&&i.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:(i)=>i.path.startsWith("env.")&&i.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${wo}/settings#environment-variables`}},{matches:(i)=>(i.path==="permissions.allow"||i.path==="permissions.deny")&&i.code==="invalid_type"&&i.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:(i)=>i.path==="hooks"&&i.code==="unrecognized_keys",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${wo}/hooks`}},{matches:(i)=>/\.hooks\.\d+\.command$/.test(i.path)&&i.code==="invalid_type"&&i.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:`${wo}/hooks#exec-form-and-shell-form`}},{matches:(i)=>i.path.includes("hooks")&&i.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:(i)=>i.code==="invalid_type"&&i.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(i)=>i.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${wo}/settings`}},{matches:(i)=>i.code==="invalid_value"&&i.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(i)=>i.code==="invalid_type"&&i.expected==="object"&&i.received===null&&i.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(i)=>i.path==="permissions.additionalDirectories"&&i.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:`${wo}/iam#working-directories`}}],wQ={permissions:`${wo}/iam#configuring-permissions`,env:`${wo}/settings#environment-variables`,hooks:`${wo}/hooks`};function EO(i){let c=IQ.find((D)=>D.matches(i));if(!c)return null;let T={...c.tip};if(i.code==="invalid_value"&&i.enumValues&&!T.suggestion)T.suggestion=`Valid values: ${i.enumValues.map((D)=>`"${D}"`).join(", ")}`;if(!T.docLink&&i.path)T.docLink=wQ[ut(i.path,".")];return T}var bwe=e(()=>zE(ps(),{strictPolicyHelperKeys:!0}).strict());function SO(i){return i.code==="invalid_type"}function yO(i){return i.code==="invalid_value"}function PQ(i){return i.code==="unrecognized_keys"}function OO(i){return i.code==="too_small"}function bO(i){return i.severity!=="warning"&&!i.loadedWithoutGuardHook}var xQ='a PreToolUse/PermissionRequest hook that cannot be loaded does not run, nor does any other hook of the document where "hooks" is listed here as ignored; fix or remove the entry. The managed settings document is not skipped for it, unlike a user or project settings file';function RO(i){return i.map((c)=>c.severity!=="warning"&&c.message.includes(Co)?{...c,message:c.message.replace(Co,()=>xQ),loadedWithoutGuardHook:!0}:c)}function En(i){if(i===null)return"null";if(i===void 0)return"undefined";if(Array.isArray(i))return"array";return typeof i}function AO(i){let c=i.match(/received (\w+)/);return c?c[1]:void 0}function bi(i,c){return i.issues.flatMap((D)=>{if(D.code!=="invalid_union"||D.path.join(".")!=="attribution")return[D];let w=D.errors.flat().filter((x)=>x.path.length>0);return w.length>0?w.map((x)=>({...x,path:[...D.path,...x.path]})):[D]}).map((D)=>{let w=D.path.map(String).join("."),x=D.message,U,B,z,le,fe;if(yO(D))B=D.values.map((Re)=>String(Re)),z=B.join(" | "),le=void 0,fe=void 0;else if(SO(D)){z=D.expected;let Re=AO(D.message);le=Re??En(D.input),fe=Re??En(D.input)}else if(OO(D))z=String(D.minimum);else if(D.code==="custom"&&"params"in D)le=D.params.received,fe=le;let Ce=EO({path:w,code:D.code,expected:z,received:le,enumValues:B,message:D.message,value:le});if(yO(D))U=B?.map((Re)=>`"${Re}"`).join(", "),x=`Invalid value. Expected one of: ${U}`;else if(SO(D)){let Re=AO(D.message)??En(D.input);if(D.expected==="object"&&Re==="null"&&w==="")x="Invalid or malformed JSON";else x=`Expected ${D.expected}, but received ${Re}`}else if(PQ(D)){let Re=D.keys.join(", ");x=`Unrecognized ${oe(D.keys.length,"field")}: ${Re}`}else if(OO(D))x=`Number must be greater than or equal to ${D.minimum}`,U=String(D.minimum);return{file:c,path:w,message:x,expected:U,invalidValue:fe,suggestion:Ce?.suggestion,docLink:Ce?.docLink}})}function NQ(i,c,T){if(!i||typeof i!=="object")return[];let D=i;if(!D.permissions||typeof D.permissions!=="object")return[];let w=D.permissions,x=[],U=new Map;for(let B of["allow","deny","ask"]){let z=w[B];if(!Array.isArray(z))continue;let le=z.filter((fe)=>{if(typeof fe!=="string")return x.push({file:c,path:`permissions.${B}`,message:`Non-string value in ${B} array was removed`,severity:"warning",invalidValue:fe}),!1;let Ce=Md(fe,B);if(!Ce.valid){let Re=`Invalid permission rule "${fe}" was skipped: ${Ce.error}`;if(Ce.suggestion)Re+=`. ${Ce.suggestion}`;return x.push({file:c,path:`permissions.${B}`,message:Re,severity:"warning",invalidValue:fe}),!1}return!0});if(T?.policySource&&B!=="allow"&&z.length>0&&le.length===0){if(!T.strictParseFollows)continue;U.set(B,"unreadable")}else if(le.length<z.length)U.set(B,"trimmed");w[B]=le}return Zd("permissions",w,(B)=>U.get(B),(B)=>x.push({file:c,path:B.path,message:B.message,severity:"warning",...B.substituted&&{substituted:B.substituted}})),x}var vQ=new Set(X),kQ=Ai/2;function MQ(i){let c=[{array:i,depth:1}];for(let T=c.pop();T;T=c.pop())for(let D of T.array)if(Array.isArray(D))c.push({array:D,depth:T.depth+1});else if(T.depth>=kQ&&(D===null||n(D)&&Object.values(D).includes(null)))return!0;return!1}function UQ(i,c){if(!i||typeof i!=="object")return[];return[...rh(i,sh)?[{file:c,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${Co}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...HQ(i,c)]}function HQ(i,c){if(!("hooks"in i))return[];if(i.hooks===null||typeof i.hooks!=="object"||Array.isArray(i.hooks)){let w=En(i.hooks);if(Array.isArray(i.hooks)&&(i.hooks.some(n)||dd(i.hooks)||MQ(i.hooks)))return[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${w} — ${Co}.`,invalidValue:w,docLink:"https://code.claude.com/docs/en/hooks"}];return delete i.hooks,[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${w}. This field was ignored.`,severity:"warning",invalidValue:w,docLink:"https://code.claude.com/docs/en/hooks"}]}let T=i.hooks;if(rl(T))return[{file:c,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${Co}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let D=[];for(let w of Object.keys(T)){let x=pt(w);if(!vQ.has(w)){if(mr(T[w],3,{matchersCount:!Array.isArray(T[w])})){D.push({file:c,path:`hooks.${x}`,message:`"${x}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${Co}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete T[w],D.push({file:c,path:`hooks.${x}`,message:`Unknown hook event "${x}" was ignored. Valid events: ${X.join(", ")}`,severity:"warning",invalidValue:x,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(T[w])){let U=T[w],B=En(U);if(oi.has(w)&&U!==null||mr(U,3,{matchersCount:!1})){D.push({file:c,path:`hooks.${x}`,message:`Hook event "${x}" must be an array of matchers; received ${B} — ${Co}.`,invalidValue:B,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete T[w],D.push({file:c,path:`hooks.${x}`,message:`Hook event "${x}" must be an array of matchers; received ${B}. This entry was ignored.`,severity:"warning",invalidValue:B,docLink:"https://code.claude.com/docs/en/hooks",...U!==null&&{preserveOnWrite:!0}})}}for(let[w,x]of Object.entries(T)){let{stripped:U,unloadableGuards:B}=ah(x,w);for(let z of B)D.push({file:c,path:z.aboutType?`hooks.${w}.${z.path}.type`:`hooks.${w}.${z.path}`,message:`${z.problem} — ${Co}.${z.aboutType?` Valid types: ${[...ol()].join(", ")}`:""}`,severity:"fatal",invalidValue:z.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let z of U)D.push({file:c,path:z.aboutType?`hooks.${w}.${z.path}.type`:`hooks.${w}.${z.path}`,message:z.aboutType?`${z.problem}; entry ignored. Valid types: ${[...ol()].join(", ")}`:`${z.problem}; ${z.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:z.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(D.length>0&&Object.keys(T).length===0)delete i.hooks;return D}var FQ=[{key:"allowedMcpServers",schema:_l},{key:"deniedMcpServers",schema:hl}];function BQ(i,c,T){if(!i||typeof i!=="object")return[];let D=i,w=[];for(let{key:x,schema:U}of FQ){if(!(x in D))continue;if(!Array.isArray(D[x])){if(T?.keepWholeFieldInvalid)continue;let le=D[x];delete D[x],w.push({file:c,path:x,message:`"${x}" must be an array; received ${En(le)}. This field was ignored.`,severity:"warning",invalidValue:le});continue}let B=D[x],z=[];for(let le=0;le<B.length;le++){let fe=U().safeParse(B[le]);if(fe.success)z.push(B[le]);else w.push({file:c,path:`${x}[${le}]`,message:`Invalid entry was ignored: ${fe.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:B[le]})}if(z.length<B.length)D[x]=z}return w}var zQ=["strictKnownMarketplaces","blockedMarketplaces"];function GQ(i){if(!n(i)||!Object.values(i).includes(null))return;for(let c of yl())if(i[c]===null)delete i[c]}function WQ(i,c,T){if(!n(i))return[];let D=[];for(let w of zQ){let x=i[w];if(!Array.isArray(x))continue;let U=[],B=[];for(let z=0;z<x.length;z++){let le=si().safeParse(x[z]);if(!le.success){U.push(x[z]),B.push(z);continue}let fe=Jd(le.data);if(fe===null){U.push(x[z]),B.push(z);continue}if(w==="blockedMarketplaces"){U.push(x[z]),B.push(z),D.push({file:c,path:`${w}[${z}]`,message:`Unenforceable entry was kept: ${fe}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}D.push({file:c,path:`${w}[${z}]`,message:`Invalid entry was ignored: ${fe}`,severity:"warning"})}if(U.length<x.length)i[w]=U,T?.set(w,B)}return D}function KQ(i,c){if(!n(i)||i.managedMcpServers===void 0)return[];let D=[],w=qa(i.managedMcpServers,(x,U)=>D.push({file:c,path:x?`managedMcpServers.${x}`:"managedMcpServers",message:x?`Managed MCP server was ignored: ${U}`:U,severity:"warning"}));if(w===void 0)delete i.managedMcpServers;else i.managedMcpServers=w;return D}function jQ(i){if(!i||typeof i!=="object")return;let c=i.source;if(!c||typeof c!=="object")return;let T=c.source;return typeof T==="string"?T:void 0}function $Q(i){if(!i||typeof i!=="object")return!1;let c=i.source;if(!c||typeof c!=="object")return!1;let T=c.plugins;return Array.isArray(T)&&T.some(Pd)}function VQ(i,c){if(!i||typeof i!=="object")return[];let T=i,D="extraKnownMarketplaces";if(!(D in T))return[];let w=T[D];if(!w||typeof w!=="object"||Array.isArray(w)){let B=En(w);return delete T[D],[{file:c,path:D,message:`"${D}" must be an object mapping marketplace names to declarations; received ${B}. This field was ignored.`,severity:"warning",invalidValue:B}]}let x=w,U=[];for(let B of Object.keys(x)){let z=Gd().safeParse(x[B]),le,fe=!1;if(!z.success){let Ce=jQ(x[B]);if(Ce!==void 0&&!Zh.has(Ce)||$Q(x[B]))continue;le=al(z.error.issues)}else if(z.data.source.source==="settings"&&z.data.source.name!==B)le=`key "${qn(B)}" must match the settings source name "${qn(z.data.source.name)}"`;if(le!==void 0)U.push({file:c,path:`${D}.${qn(B)}`,message:fe?"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. If /plugin also shows a marketplace of this name as refused, remove that one in /plugin → Marketplaces once this entry is renamed or deleted.":`Invalid marketplace entry was ignored: ${le}`,severity:"warning",...fe&&{preserveOnWrite:!0}}),delete x[B]}return U}function YQ(i,c){if(!i||typeof i!=="object")return[];let T=i,D="modelPicker";if(!(D in T))return[];let w=T[D];if(!n(w)||!Array.isArray(w.options)){let z=n(w)?`options: ${En(w.options)}`:En(w);return delete T[D],[{file:c,path:D,message:`"${D}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${z}. This field was ignored.`,severity:"warning",invalidValue:z}]}let x=[];if("replaceBuiltInOptions"in w&&typeof w.replaceBuiltInOptions!=="boolean"){let z=En(w.replaceBuiltInOptions);delete w.replaceBuiltInOptions,x.push({file:c,path:`${D}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${z}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:z})}let U=w.options,B=[];for(let z=0;z<U.length;z++){let le=jd().safeParse(U[z]);if(le.success){B.push(U[z]);continue}x.push({file:c,path:`${D}.options.${z}`,message:`${JQ(le.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:En(U[z])})}if(B.length!==U.length)w.options=B;return x}function XQ(i,c){if(!i||typeof i!=="object"||Array.isArray(i))return[];let T=i;if(!("modelPricing"in T)||T.modelPricing===void 0)return[];let D=T.modelPricing;if(!D||typeof D!=="object"||Array.isArray(D))return delete T.modelPricing,[{file:c,path:"modelPricing",message:`"modelPricing" must be an object; received ${En(D)}. It was ignored.`,severity:"warning"}];let w=D,x=[];if(w.multiplier!==void 0&&!Kd().safeParse(w.multiplier).success)x.push({file:c,path:"modelPricing.multiplier",message:'"multiplier" must be a number greater than 0 and at most 10. It was ignored.',severity:"warning",invalidValue:w.multiplier}),delete w.multiplier;if(w.overrides!==void 0){let U=w.overrides;if(!U||typeof U!=="object"||Array.isArray(U))x.push({file:c,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${En(U)}. It was ignored.`,severity:"warning"}),delete w.overrides;else{let B=U;for(let z of Object.keys(B)){let le=Wd().safeParse(B[z]);if(le.success&&z!=="constructor"&&z!=="__proto__")continue;let fe=le.success?void 0:le.error.issues[0];x.push({file:c,path:`modelPricing.overrides.${qn(z)}`,message:`Invalid pricing row was ignored (${fe?`${fe.path.join(".")||"row"}: ${fe.message}`:"not a model ID"}).`,severity:"warning",invalidValue:B[z]}),delete B[z]}}}return x}function JQ(i){if(!i)return"Invalid modelPicker row";return`modelPicker row ${i.path.length>0?`"${i.path.join(".")}" `:""}${i.message}`.trim()}function ZQ(i,c,T){if(!i||typeof i!=="object"||Array.isArray(i))return[];let D=i,w=D.crossSessionInbound;if(w===void 0||qQ(w))return[];if(T?.policySource)D.crossSessionInbound="refuse";else delete D.crossSessionInbound;return[nee(w,c,T?.policySource===!0)]}function qQ(i){return typeof i==="string"&&di.includes(i)}var QQ="crossSessionInbound";function Ri({dropped:i,copy:c},T,D=!1){return i.map(({key:w,count:x,path:U})=>{let B=qn(w),z=`${x===1?"A value":`${x} values`} under "${B}" ${x===1?"is":"are"} nested more than ${Ai} levels deep`;if(w==="hooks"&&n(c)&&Array.isArray(c.hooks))return{file:T,path:"hooks",message:`"hooks" is written as nested arrays and holds ${x===1?"a value":`${x} values`} more than ${Ai} levels deep that ${x===1?"was":"were"} left out — ${Co}. Write "hooks" as an object of event names.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"};return{file:T,path:eee(U),message:`${z}, so Claude Code ignores ${x===1?"it":"them"}${D?`, and leaves ${x===1?"it":"them"} out if it saves a setting to this file`:""}. Reduce the nesting under "${B}".`,severity:"warning"}})}function xu(i,c){return{dropped:c.dropped.filter(({key:T})=>n(i)&&Object.hasOwn(i,T)),copy:i}}function eee(i){let c=i.split(".").map(qn);return(c.length<=7?c:[...c.slice(0,6),"…"]).join(".")}function tee(i){let c=di.map((D)=>`"${D}"`).join(", "),T=typeof i==="string"?`"${qn(i).replace(/^<key>$/,"<value>")}"`:En(i);return`must be one of ${c}; received ${T}`}function nee(i,c,T=!1){let D=di.map((x)=>`"${x}"`).join(", "),w=T?'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:c,path:QQ,message:`"crossSessionInbound" ${tee(i)}. ${w}`,severity:"warning",expected:D,...T&&{statusOnly:!0}}}function oee(i,c,T){if(!n(i))return[];let D=i.teammateMode;if(D===void 0||qs.some((z)=>z===D))return[];let w=T?.policySource===!0;if(!w)delete i.teammateMode;let x=qs.map((z)=>`"${z}"`).join(", "),U=typeof D==="string"?`"${qn(D).replace(/^<key>$/,"<value>")}"`:En(D);return[{file:c,path:"teammateMode",message:`"teammateMode" must be one of ${x}; received ${U}. ${w?'In managed settings this value is ignored and teammates use the mode from other settings or the default ("in-process").':'This value is ignored and teammates use the mode from your other settings or the default ("in-process"); change it to one of the values above.'}`,severity:"warning",expected:x,...w?{statusOnly:!0}:{unattendedSafe:!0}}]}var CO="remoteControl.shareHostProfile";function ree(i,c,T){if(!n(i)||i.remoteControl===void 0)return[];let D=T?.policySource===!0,w=gl.map((Re)=>`"${Re}"`).join(", "),x=D?'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.",U=(Re)=>({file:c,path:CO,message:`${Re}. ${x}`,severity:"warning",expected:w,...D?{statusOnly:!0}:{preserveOnWrite:!0}}),B=(Re)=>typeof Re==="string"?`"${qn(Re).replace(/^<key>$/,"<value>")}"`:En(Re),z=i.remoteControl;if(!n(z)){if(D)i.remoteControl={shareHostProfile:"off"};else delete i.remoteControl;return[U(`"remoteControl" must be an object like { "shareHostProfile": ${w.replace(/, /g," | ")} }; received ${B(z)}`)]}let le=[],fe=Object.keys(z).filter((Re)=>Re!=="shareHostProfile");if(fe.length>0){if(D)z.shareHostProfile="off";le.push(U(`"remoteControl" has an unrecognized key ${fe.map((Re)=>`"${qn(Re)}"`).join(", ")} (its only key is "shareHostProfile")`))}let Ce=z.shareHostProfile;if(Ce!==void 0&&!(typeof Ce==="string"&&gl.includes(Ce))){if(D)z.shareHostProfile="off";else delete z.shareHostProfile;le.push(U(`"${CO}" must be one of ${w}; received ${B(Ce)}`))}return le}var see=["enabledMcpjsonServers","disabledMcpjsonServers"],iee=/^[A-Za-z0-9_-]+$/;function aee(i){if(!n(i))return;for(let c of see){let T=i[c];if(typeof T==="string"&&iee.test(T))i[c]=[T]}}function Ti(i,c,T){let D=[...oy(i,c)];if(GQ(i),!T?.policySource)aee(i);return D.push(...NQ(i,c,{policySource:T?.policySource,strictParseFollows:T?.mcpServerEntrySalvageOnly}),...UQ(i,c),...VQ(i,c),...YQ(i,c),...XQ(i,c),...ZQ(i,c,{policySource:T?.policySource}),...ree(i,c,{policySource:T?.policySource}),...oee(i,c,{policySource:T?.policySource}),...T?.skipMcpServerEntryFilter?[]:BQ(i,c,{keepWholeFieldInvalid:T?.mcpServerEntrySalvageOnly}),...T?.mcpServerEntrySalvageOnly?KQ(i,c):[],...T?.mcpServerEntrySalvageOnly?WQ(i,c,T.marketplacePatternIndexMapOut):[]),D}function Wu(i){let c=new Set(i.allowedSources);return c.add("flagSettings"),c.add("policySettings"),Vn.filter((T)=>c.has(T))}function uee(){return pn($o(),"managed-settings.json")}function DO(i){return i.path===""&&(bO(i)||i.userWritable===!0)}function Nu(i){return i.map((c)=>{let{invalidValue:T}=c,D=T!==void 0&&T!==null,w=D?zt(T):void 0,x=w===void 0?void 0:v(w);return{...c,path:v(c.path),message:v(c.message),...c.expected!==void 0&&{expected:v(c.expected)},...c.suggestion!==void 0&&{suggestion:v(c.suggestion)},...D&&(w===void 0||typeof T==="string"||x!==w)&&{invalidValue:x}}})}function Xl(i){if(i.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};if(ga(i))return Cs(i.parentManaged??{},Fu);let c,T=(ht)=>{if(ht===Ku)return!0;return c??=i.asksOrganization?.()===!0,c&&ht()},D=!1,w=new Map,x=new Set,U=IO(i,(ht,ct,Tt)=>{if(ht.settings===null){if(w.delete(ct),!T(Tt))return ht;return lt.forEach((It)=>x.add(It)),{...ht,errors:Nu(ht.errors)}}if(!T(Tt))return w.set(ct,Vo(ht.settings,Qo)),ht;return D=!0,{...ht,settings:{},errors:Nu(ht.errors)}});if(!D)return x.size===0?U:{...U,lostSignInPins:[...x]};let B=new Map,z=new Map,le=IO(i,(ht,ct,Tt)=>{if(ht.settings===null||!T(Tt))return B.delete(ct),z.delete(ct),{...ht,settings:ht.settings&&{},errors:[]};let It=pee(ht,ht.settings,ct);for(let Xt of lt)if(ht.settings[Xt]!==void 0&&It.settings?.[Xt]===void 0)x.add(Xt);return B.set(ct,Object.keys(It.settings??{})),z.set(ct,It.errors.slice(ht.errors.length)),It}),fe=new Set([...z.values()].flat()),Ce=le.errors.filter((ht)=>DO(ht)&&!fe.has(ht)&&!U.errors.some((ct)=>DO(ct)&&ct.file===ht.file));if(Ce.length>0)lt.forEach((ht)=>x.add(ht));let Re=[...U.errors,...Nu(Ce),...fe],xe=lo(Po(U),Po(le)),Te=U.settings??{},Ke=le.settings??{},Le=!Os({...U,settings:Te})&&{heldOnly:!0};if(Object.keys(Ke).length===0)return{...U,errors:Re,loadState:xe,...Le,lostSignInPins:[...x]};let Pe=Object.keys(Te).length===0,nt=Object.assign({},...w.values()),et={...Pe?Ke:In(Gl([Te,Ke],"merge",!1,0).admin,"parentSettingsBehavior"),...Vo(Te,"parentSettingsBehavior"),...nt},rt=et,At=Te;for(let[ht,ct]of B)for(let Tt of ct)if(Tt in At&&C(rt[Tt],At[Tt]))Re.push({file:ht,path:v(Tt),message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${v(Tt)}" was ignored in ${v(ht)}, since another managed settings document sets it and this one adds nothing to it.`,severity:"warning",statusOnly:!0,userWritable:!0});return{...Pe?le:U,settings:et,errors:Re,loadState:xe,...Le,lostSignInPins:[...x],...!Ts(Te)&&{onlyHeldContent:!0},settingsNotHeld:Te,heldOffPlugins:Object.keys(Ke.enabledPlugins??{}).filter((ht)=>Te.enabledPlugins?.[ht]===void 0),heldAllowLists:qu.filter((ht)=>Ke[ht]!==void 0&&Te[ht]===void 0)}}function pee(i,c,T){let D=ky(c),w=fee(c,D).map((x)=>({...x,key:v(x.key)}));if(w.length===0)return i;if(!LO.has(T))LO.add(T),t(`${v(T)}: not taken as written: ${w.map(({key:x})=>x).join(", ")}: this session takes its managed settings from its organization, and a managed settings file may only restrict there`,{level:"warn"});return{...i,settings:D,errors:[...i.errors,...w.filter(({key:x})=>!nr(x)).map(({key:x,became:U})=>({file:T,path:x,message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${x}" ${U} in ${v(T)}.`,severity:"warning",statusOnly:!0,userWritable:!0}))]}}function fee(i,c){let T=(D,w)=>w==="disableAllHooks"&&i.disableAllHooks===!0&&c.allowManagedHooksOnly===!0?'was taken as "allowManagedHooksOnly"':w==="allowManagedHooksOnly"&&D===!0?'was set by "disableAllHooks"':D===void 0?"was ignored":"was kept in part";return Object.keys(i).flatMap((D)=>{let w=i[D],x=c[D];if(C(w,x))return[];if(!n(w)||!n(x))return[{key:D,became:T(x,D)}];return Object.keys(w).filter((U)=>!C(w[U],x[U])).map((U)=>({key:`${D}.${U}`,became:T(x[U],D)}))})}function KO(i){return m()==="wsl"&&(!i||yu())}var LO=a(new Set,(i)=>i.clear()),vu=a(new Set,(i)=>i.clear());function IO(i,c){let T=i.mdm?.()?.heldDocuments??[];if(KO(i.asksOrganization?.()===!0)){let D=co(Jl({...i,file:()=>({settings:null,errors:[]})}));if(i.wslInherits?.()){let w=T.length===0?void 0:D||co(Di(yn,i.store)),x=Di(yn,i.store,c,w?T:[]);if(w??(co(x)||D))return x;let U=Di($o(),i.store,c,T);return{...U,errors:[...x.errors,...U.errors],loadState:lo(x.loadState,U.loadState)}}if(D)return Di(null,i.store,c,T)}return Di($o(),i.store,c,T)}var Ku=()=>!0;function mee(i,c,T){T.push(...c.errors);let{settings:D}=c;if(!D||Object.keys(D).length===0)return;for(let[w,x]of Ol){let U=w.split(".");if(Lt(D,U)===void 0)continue;let B=c.errors.find((fe)=>fe.substituted&&fe.path===w),z=B!==void 0,le=Lt(i.merged,U);if(z&&le!==void 0&&!i.floors.has(w)){let fe=U.at(-1);if(x.inert.has(x.read(le))){p_(D,U),T.push({file:B.file,path:w,message:`That substitute is not applied: "${fe}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}T.push({file:B.file,path:w,message:`That substitute also displaces the wider "${fe}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(z)i.floors.add(w);else i.floors.delete(w)}if(i.merged=un(i.merged,D,ao),i.found=!0,Ts(D)&&!c.errors.some((w)=>w.onlySubstitutes))i.authored=!0}function ju(i){return i.endsWith(".json")&&!i.startsWith(".")}function gee(i){return(i.isFile()||i.isSymbolicLink())&&ju(i.name)}function wO(i,c,T,D){let w=i.managedFileProtections,x={file:D,folder:i.managedDocumentLinks.folderIsLink.get(c)===!1?w.folderOwners.get(c):void 0,posix:m()!=="windows"&&!T.startsWith(yn)};return w.note(T,mn({...x,linked:i.managedDocumentLinks.isLinked(T)})),()=>$u(i,T,x.file,x.folder)}function $u(i,c,T,D){let w=process.geteuid?.(),x=process.getuid?.();if(KO(!0)&&(c===No||c.startsWith(`${yn}${dee}`)))return PO;if(w===0||x===0)return!0;if(m()==="windows"||w===void 0)return PO;let B=i.managedDocumentLinks.linkOf(c),z=Vm(w,x);if(zc(z,T,B===null?D:T)!==!1||B?.kind==="unverified")return!0;let fe=i.policy.writableNow??=new Map,Ce=fe.get(c)??Bc(c);if(fe.set(c,Ce),Ce!=="no")return!0;let Re=i.policy.walkedDocuments??=new Map,xe=Re.get(c)??Ym(c,z,i.policy.certainDirectories??=new Map);return Re.set(c,xe),xe}var PO=!1;function xO(i,c,T,D,w){let x=i.managedDocumentLinks;x.noteWalked(pn(c,...T),!D.errors.some((U)=>U.errorClass==="unreadable"),()=>zm(c,T,w,x.folderIsLink,i.managedFileProtections.folderOwners))}function Di(i,c,T=(w)=>w,D=[]){let w=[],x={merged:{},found:!1,authored:!1,floors:new Set},U=!1,B="absent";for(let{path:Pe,parsed:nt,userWritable:et}of D){let rt=ku(x,w,T,()=>({parsed:nt,isHeld:Ku}),Pe,et);B=lo(B,rt.loadState),U||=As(rt.parsed)}if(i===null)return NO(x,w,U,B,c);let z=pn(i,"managed-settings.json"),le=ku(x,w,T,()=>{let Pe=Kl(z,c,void 0,!0);if(Po(Pe)==="absent")return{parsed:Pe,isHeld:()=>!1};return xO(c,i,["managed-settings.json"],Pe),{parsed:Pe,isHeld:wO(c,Ft(i),z,Pe.fileOwner)}},z);B=lo(B,le.loadState),U||=As(le.parsed);let fe=pn(i,"managed-settings.d"),Ce=[],Re,xe=c.frozenFolderMembership(fe),Te=void 0,Ke,Le=(Pe)=>{let nt=r(Pe),et=nt==="ENOENT"||nt==="ENOTDIR";if(c.noteFolderListed(fe,et?[]:"failed"),c.noteRawFolderListing(fe,et?"absent":"failed"),!et)t(`managed-settings.d read failed: ${Pe}`,{level:"error"}),w.push(wi(fe,Pe,"directory")),B="didNotLoad",T({settings:null,errors:[]},fe,()=>!0)};try{let Pe=c.folderListingForPolicyWalk(fe);if(Pe!==void 0)Ce=Pe;else{let nt;try{nt=l().readdirSync(fe).filter(gee)}catch(rt){if(xe===void 0)throw rt;Te=rt,nt=[]}let et=nt.map((rt)=>rt.name).sort();if(Ke=new Set(et),Re=new Set(nt.filter((rt)=>!rt.isFile()).map((rt)=>rt.name)),Te===void 0)c.noteRawFolderListing(fe,et),c.noteWalkListing(fe,et);Ce=et}if(xe!==void 0)Ce=f([...Ce,...xe]).sort();c.noteFolderListed(fe,Ce)}catch(Pe){Le(Pe)}for(let Pe of Ce){let nt=pn(fe,Pe),et=ku(x,w,T,()=>{let rt=Kl(nt,c,void 0,!0);if(Po(rt)==="absent")return{parsed:rt,isHeld:()=>!1};return xO(c,i,["managed-settings.d",Pe],rt,Ke?.has(Pe)===!0?Re?.has(Pe):void 0),{parsed:rt,isHeld:wO(c,fe,nt,rt.fileOwner)}},nt);B=lo(B,et.loadState),U||=As(et.parsed)}if(Te!==void 0)Le(Te);return NO(x,w,U,B,c)}function ku(i,c,T,D,w,x){let U=c.length,B={settings:null,errors:[],loadState:"didNotLoad"},z=B,le=()=>!0,fe;try{let Ce=D();z=Ce.parsed,le=Ce.isHeld;let Re=T(z,w,le);if(Re.settings&&Object.keys(Re.settings).length>0)fe={...i,merged:M(i.merged),floors:new Set(i.floors)};if(mee(i,Re,c),fe!==void 0)vu.delete(w);return{parsed:z,loadState:Po(z)}}catch(Ce){if(Bt(Ce))throw Ce;if(!vu.has(w))vu.add(w),ue(Ce);if(fe!==void 0)Object.assign(i,fe);return c.length=U,c.push(bee(w,Ce,{userWritable:x})),T(B,w,le===Ku?le:()=>{try{return le()}catch{return!0}}),{parsed:z,loadState:"didNotLoad"}}}function NO(i,c,T,D,w){let x=i.found&&Rs(i.merged)?i.merged:null;if(x?.forceLoginOrgUUID!==void 0)w.managedFileProtections.setsOrgPin=!0;return{settings:x,errors:c,documentHasPolicyContent:T,loadState:D,...x!==null&&!i.authored&&Ts(x)&&{onlySubstitutes:!0}}}function _ee(i,c){if(_(i))Dee(c);else t(v(`settings file read failed at ${c}: ${i}`),{level:"error"})}function Kl(i,c,T,D){let w=T!==void 0?`${i}\x00pinned`:i,x=c.parsedFiles.get(w);if(x){if(x.settings!==null&&!c.walkRead(w)&&Object.keys(x.settings).length>0)c.noteReadFromDisk(i,!0);return{...x,settings:x.settings?M(x.settings):null}}let U,B=Cee(i,T,D,({ino:z,size:le,mtimeMs:fe,ctimeMs:Ce})=>{U={ino:z,size:le,mtimeMs:fe,ctimeMs:Ce}});if(T===void 0&&B.loadState==="absent")U??=null;if(U!==void 0)c.noteFirstRead(i,U);if(T===void 0)c.noteReadFromDisk(i,B.settings!==null&&!!U?.size),c.noteRead(i,B,D===!0);return c.parsedFiles.set(w,B),{...B,settings:B.settings?M(B.settings):null}}function Hu(i,c,T){let D=Kl(i,c,T),w=D.settings===null&&D.errors.some((x)=>x.errorClass==="unreadable")?c.settingsAtLastRead(i):void 0;if(w===void 0||!hO())return D;return c.noteKeptCopyServed(i),{...D,settings:_O(w)}}function Jl(i){let c=i.mdm?.();if(!c)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};return{settings:c.settings&&Object.keys(c.settings).length>0?c.settings:null,errors:wee(c,()=>Vu(i),()=>i.file?.()??Xl(i)),documentHasPolicyContent:As(c),loadState:Po(c),...c.onlySubstitutes&&{onlySubstitutes:c.onlySubstitutes}}}function Cs(i,c){return hee(jO(i,c))}function jO(i,c){let T=vO.get(i),D=T?.get(c);if(D)return D;let w=Eee(i,c);if(T)T.set(c,w);else vO.set(i,new Map([[c,w]]));return w}function hee(i){return{settings:i.settings&&M(i.settings),errors:i.errors.map((c)=>({...c})),documentHasPolicyContent:i.documentHasPolicyContent,loadState:i.loadState,removed:i.removed,...i.onlySubstitutes&&{onlySubstitutes:i.onlySubstitutes}}}var vO=new WeakMap;function Eee(i,c){let T=Ss(i),D=T.copy,w=[...Ri(T,c),...Ti(D,c,{skipMcpServerEntryFilter:!0,policySource:!0})],x=[],U=eu(XO(c,x),c,D).safeParse(D);if(!U.success)return{settings:null,errors:[...w,...bi(U.error,c)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let B=[...lA(w,U.data,x),...x],z=i,le=Object.keys(U.data).length>0?U.data:null;return{settings:le,errors:B,documentHasPolicyContent:dA(i,U.data),loadState:"loaded",removed:Object.keys(z).filter((fe)=>$O(fe,z[fe])&&U.data[fe]===void 0&&B.every((Ce)=>Ce.statusOnly||Ce.path!==fe&&!Ce.path.startsWith(`${fe}.`))),...le!==null&&x.some((fe)=>fe.onlySubstitutes)&&{onlySubstitutes:!0}}}function $O(i,c){let T=yl();return T.includes(i)||tr.some(({alias:D,canonical:w})=>D===i&&T.includes(w))?Qd(i,c):Al(i)&&VO(i,c)}function VO(i,c){return c===null||n(c)&&Object.keys(c).length>0&&Object.entries(c).every(([T,D])=>{let w=`${i}.${T}`;return Qd(w,D)||Al(w)&&VO(w,D)})}function nr(i){return Gc()&&(i==="managedMcpServers"||i.startsWith("managedMcpServers."))}var Zl=["managedMcpServers","isolation","attributionProjectPolicy"],See=[...Zl,"deniedModels","availableModelsMatch"];function YO(i,c){if(!n(i))return[];let T=[];for(let D of See){if(!(D in i))continue;if(delete i[D],!nr(D))T.push({file:c,path:D,message:`"${D}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return T}function XO(i,c){return(T)=>{if(nr(T.path))return;if(c.push({file:i,path:T.path,message:T.message,severity:"warning",...T.statusOnly&&{statusOnly:T.statusOnly},...T.startupFatal&&{startupFatal:T.startupFatal},...T.substituted&&{substituted:T.substituted},...T.onlySubstitutes&&{onlySubstitutes:T.onlySubstitutes},...T.removal&&{removal:T.removal}}),T.statusOnly||T.startupFatal)t(v(`${i}: ${T.path}: ${T.message}`),{level:T.startupFatal?"error":"warn"})}}function Vu(i){let c=i?.remote?i.remote():Wy((xe)=>Cs(xe,"remote managed settings").settings),T=!i?.remote&&!nr("managedMcpServers")&&Fy()?[{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}]:[],D=i?.remote?void 0:wy(),w=(D?.state==="stale_cache"||D?.state==="failed")&&D.failure.errorKind==="ruled_empty"?Pu(D.failure.rulings??[]):[];if(!c||Object.keys(c).length===0)return{settings:null,errors:[...T,...w],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:x,errors:U,documentHasPolicyContent:B,onlySubstitutes:z}=Cs(c,"remote managed settings"),le=xy(c),fe=le&&jO(le,"remote managed settings"),Ce=(fe?.errors??[]).filter(({path:xe,substituted:Te})=>Te===!0&&n(Lt(fe?.settings,xe.split(".")))&&!La(Lt(le,xe.split(".")))),Re=[...AA,"deniedMcpServers","skillOverrides"].flatMap((xe)=>{let Te=xe.split("."),[Ke,Le]=Te,Pe=(et)=>{let rt=Lt(et,Te);return Ke==="autoMode"&&Le!==void 0&&Array.isArray(rt)?pi(Lt(et,[Ke])).lists[Le]===void 0:La(rt)},nt=Lt(le,Te);return!La(nt)&&!(xe==="skillOverrides"&&n(nt))&&Pe(fe?.settings)&&Pe(c)?fe?.errors.find(({path:et})=>et===xe||et.startsWith(`${xe}[`))??(Ke==="autoMode"&&Le!==void 0&&pi(Lt(fe?.settings,[Ke])).listsThatLostARule.has(Le)?{file:"remote managed settings",path:xe,message:`None of these rules is in effect: the autoMode block lists may hold ${tu} characters together, hard_deny first, and none of these fits`,suggestion:"Shorten the autoMode block lists",severity:"warning"}:[]):[]});return{settings:x,errors:[...T,...w,...Pu([...Ce,...Re,...U])],servedSnapshot:Py(c),documentHasPolicyContent:B,...z&&{onlySubstitutes:z}}}var Fu="parent managed settings";function yee(i){let c=i.parentManaged;if(!c||Object.keys(c).length===0)return{settings:null,errors:[]};let T=Cs(c,Fu);for(let D of Zl)if(T.settings?.[D]!==void 0&&!nr(D))T.errors.push({file:Fu,path:D,message:`"${D}" 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 T}function Oee(i){return null}function JO(i){let c=i.flagInline;if(!c)return{settings:null,errors:[]};let T=Gc(),D=i.store.inlineFlagParse;if(D?.inline!==c||D.desktopSupplied!==T)D={inline:c,desktopSupplied:T,parsed:Aee(c)},i.store.inlineFlagParse=D;let{settings:w,errors:x}=D.parsed;return{settings:w&&M(w),errors:x.map((U)=>({...U}))}}function Aee(i){let c=Ss(i),T=c.copy,D=[...YO(T,"SDK inline settings"),...Ri(xu(T,c),"SDK inline settings"),...Ti(T,"SDK inline settings")],w=Sl(T).safeParse(T);if(!w.success)return{settings:null,errors:[...D,...bi(w.error,"SDK inline settings")]};if(D.some((x)=>x.severity==="fatal"))return{settings:null,errors:D};return{settings:w.data,errors:D}}var Ii=2097152;function Cee(i,c,T,D){try{let w;if(c!==void 0)w=c;else{let x=T||Ree(i)?ye(l(),i):Je(l(),i);if(T){let U={};w=Ko(x.resolvedPath,Ii,(z)=>{U.owner={uid:z.uid,gid:z.gid,mode:z.mode},D?.(z)});let B=jl(w,i,T);return U.owner?{...B,fileOwner:U.owner}:B}w=Ko(x.resolvedPath,Ii,D)}return jl(w,i,T)}catch(w){return Iee(w,i)}}function jl(i,c,T){if(i.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let D=ir(i,!1);if(T){if(!n(D))return{settings:null,errors:[ql(c)],loadState:"didNotLoad"};let z=Ss(D),le=z.copy,fe=[...Ri(z,c),...Ti(le,c,{skipMcpServerEntryFilter:!0,policySource:!0})],Ce=[],Re=eu(XO(c,Ce),c,le).safeParse(le);if(!Re.success)return{settings:null,errors:[...fe,...bi(Re.error,c)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:Re.data,errors:[...lA(fe,Re.data,Ce),...Ce],documentHasPolicyContent:dA(D,Re.data),loadState:"loaded"}}let w=Ss(D),x=w.copy,U=[...YO(x,c),...Ri(xu(x,w),c,!0),...Ti(x,c)],B=Sl(x).safeParse(x);if(!B.success){let z=D===null?km(i):void 0,le=bi(B.error,c).map((fe)=>({...fe,...z}));return{settings:null,errors:[...U,...le]}}if(U.some((z)=>z.severity==="fatal"))return{settings:null,errors:U};return{settings:B.data,errors:U}}function ql(i,{userWritable:c=!1}={}){return ZO(i,"could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",c)}function bee(i,c,{userWritable:T=!1}={}){return ZO(i,`could not be applied because of a bug in Claude Code, so none of its settings are in effect. Report this to Anthropic support. Error: ${c instanceof Error?c.message:String(c)}`,T)}function ZO(i,c,T){return T?{file:i,path:"",message:`Managed settings document (${i}) ${c}`,severity:"warning",statusOnly:!0,userWritable:!0}:{file:i,path:"",message:`Managed settings document ${c}`,startupFatal:!0}}function Ree(i){let c=Ee();if(c===null)return!1;let T=E(Yl(Ft(i))),D=Ft(c);return T===E(D)||T===Tee(D)}var Mu;function Tee(i){if(Mu?.lexical!==i){let c=Yl(i);Mu={lexical:i,physical:E(pn(dt(c)??c,cee(i)))}}return Mu.physical}function Dee(i){t(v(`Broken symlink or missing file encountered for settings.json at path: ${i}`))}function Lee(){return{settings:null,errors:[],loadState:"absent"}}function Iee(i,c){if(Bt(i))throw i;if(_ee(i,c),_(i))return Lee();return{settings:null,errors:[wi(c,i)],loadState:"didNotLoad"}}function wi(i,c,T="file"){return{file:i,path:"",message:`${T==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${c instanceof Error?c.message:String(c)}`,severity:"fatal",errorClass:"unreadable",...r(c)!==void 0&&{errno:r(c)}}}function qO(i){return{file:i,path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" in ${i} holds a value that cannot be read (it takes true or false) and no Windows administrator policy is deployed beside it (HKLM or ${yn}), 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 kO(i){return i.path==="wslInheritsWindowsSettings"&&i.severity==="fatal"}function wee(i,c,T){let D=i.withheldFlagRecord&&T().heldOnly===!0?[...i.errors,i.withheldFlagRecord]:i.errors;if(!D.some(kO))return D;if(!Os(c()))return D;return D.map((w)=>kO(w)?{...w,severity:"warning"}:w)}function QO(i){return}function Bu(i,c){let T=QO(i);if(T!==void 0)return T;switch(i){case"userSettings":return Ft(R());case"policySettings":return Ft(Bl(c));case"projectSettings":return Ft(c.projectConfigDir??Bl(c));case"localSettings":{if(c.launchsLocalSettingsStoreRoot!==void 0)return c.launchsLocalSettingsStoreRoot;if(c.projectConfigDir!==void 0)return Ft(c.projectConfigDir);return tA(Bl(c),c.canonicalGitRoot)}case"flagSettings":return c.flagPath?Yl(Ft(c.flagPath)):Ft(Bl(c))}}function eA(i){if(i.launchsLocalSettingsStoreRoot!==void 0){let c=i.projectConfigDir??i.cwd;return c!==null&&i.launchsLocalSettingsStoreRoot!==Ft(c)?Ft(c):null}if(i.projectConfigDir!==void 0||i.cwd===null)return null;return tA(i.cwd,i.canonicalGitRoot)!==Ft(i.cwd)?Ft(i.cwd):null}function Bl(i){if(i.cwd===null)throw new $e;return i.cwd}function tA(i,c){let T=Pee(i,c);if(T.decided!==void 0)return T.decided;if(!kee(T.root))return T.cwdResolved;return T.root}function Pee(i,c){let T=c?.(i);if(!T)return{decided:Ft(i)};let D=Ft(T),w=Ft(i);if(D===w)return{decided:D};let x;try{x=Mee()}catch{return{decided:w}}if(D===x)return{decided:w};return{decided:void 0,root:D,cwdResolved:w}}function xee(i){return ce().localStoreProbes.canonicalRootOwnerUids(i,Nee)}function Nee(i){let c=l(),T=null;try{T=c.lstatSync(pn(i,".claude")).uid}catch(D){if(!_(D))throw D}return{rootUid:c.statSync(i).uid,gitEntryUid:vee(i),claudeEntryUid:T}}function vee(i){let c=l();try{return c.lstatSync(pn(i,".git")).uid}catch(T){throw T}}function kee(i){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return t(`localSettings: not canonicalizing the consent store to ${i} — 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 c=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:T,gitEntryUid:D,claudeEntryUid:w}=xee(i);if(T===c&&D===c&&(w===null||w===c))return!0;return t(`localSettings: not canonicalizing the consent store to ${i} — it (uid ${T}), its .git entry (uid ${D}), or its .claude entry (uid ${w??"absent"}) is not owned by the current user (uid ${c}); 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(T){return t(`localSettings: not canonicalizing the consent store to ${i} — its ownership could not be verified (${T instanceof Error?T.message:String(T)}); the store stays at the session cwd`,{level:"warn"}),!1}}function Mee(){return ce().localStoreProbes.normalizedRealHomeDir(Uee)}function Uee(){let i=dt(lee());if(i===null)throw Error("home directory realpath unavailable");return E(i)}var MO={default:"settings.json",cowork:"cowork_settings.json"};function Hee(i){if(i.coworkPlugins||Wt.CLAUDE_CODE_USE_COWORK_PLUGINS)return MO.cowork;return MO.default}function Or(i,c){switch(i){case"userSettings":return pn(Bu(i,c),Hee(c));case"projectSettings":case"localSettings":{if(c.diskless||c.cwd===null&&c.projectConfigDir===void 0)return;let T=Bu(i,c),D=pn(T,$l(i));if(Yu(c)&&Oi(T)&&Hl(T))return;return D}case"policySettings":return uee();case"flagSettings":return c.flagPath}}function $l(i){switch(i){case"projectSettings":return pn(".claude","settings.json");case"localSettings":return pn(".claude","settings.local.json")}}function nA(i){if(i.diskless||QO("localSettings")!==void 0)return;let c=eA(i);if(c===null||Yu(i))return;return pn(c,$l("localSettings"))}function Yu(i){let c=i.projectConfigDir??i.cwd;return c!==null&&Oi(Ft(c))&&Hl(Ft(c))}function Fee(i,c){if(i!=="projectSettings"&&i!=="localSettings"||c.diskless||c.cwd===null&&c.projectConfigDir===void 0)return[];if(!Yu(c))return[];let T=[],D=Bu(i,c),w=pn(D,$l(i));if(Oi(D)&&Hl(D))T.push(w);let x=i==="localSettings"?eA(c):null;if(x!==null&&Oi(x))T.push(pn(x,$l("localSettings")));return T}var Bee=" is not used: it is in a connector-downloads folder, where Claude Code saves files from claude.ai connectors, so no settings are taken from it. To use it, move or rename the folder named connector-downloads.";function zee(i){return{file:i,path:"",message:`${v(i)}${Bee}`,severity:"fatal",statusOnly:!0}}function Gee(i,c){let T=c.repoTierFreeze.tier(i);if(T!==void 0)return T.settings;return c.perSource.get(i)}function oA(i,c){let T=Gee(i,c.store);if(T!==void 0)return T;let D=yte(i,c,{keepUnreadableFileSettings:!0}),w=D&&Li(i,D,c);return c.store.perSource.set(i,w),w}function rA(i){return(i.parentSettingsBehavior??(js()?"merge":"first-wins"))==="merge"}function Wee(i,c=!1){return!i||rA(i)||c}var Kee=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function jee(i){let c={};for(let{path:T,restrictive:D}of Kn()){let w=Lt(i,T);if(T[0]==="sandbox"&&Oo(D).includes(w))vt(c,T,w)}return c.sandbox??{}}function sA(i){let c=i?.disableAllHooks;return c!==void 0&&c!==null&&c!==!1&&c!=="false"}var Xu=["disableRemoteControl","disableAgentView","disableWorkflows","disableArtifact"],Ju=["enableWorkflows","enableArtifact"],$ee=new Set([...Xu,...Ju]);function zu(i,c,T,D){let w={};if(i.allowManagedHooksOnly===!0||i.disableAllHooks===!0||sA(T))w.allowManagedHooksOnly=!0;if(i.disableSkillShellExecution===!0)w.disableSkillShellExecution=!0;for(let B of Xu)if(i[B]===!0)w[B]=!0;for(let B of Ju)if(i[B]===!1)w[B]=!1;if(c.hooks===void 0&&!Object.values(c.enabledPlugins??{}).some((B)=>B!==!1&&B!==void 0)){if(i.allowedHttpHookUrls?.length===0)w.allowedHttpHookUrls=[];if(i.httpHookAllowedEnvVars?.length===0)w.httpHookAllowedEnvVars=[]}if(i.disableCommandPluginSources===!0)w.disableCommandPluginSources=!0;if(i.disableSideloadFlags===!0)w.disableSideloadFlags=!0;if(i.disableWindowsBashCommandSplit===!0)w.disableWindowsBashCommandSplit=!0;if(i.allowManagedMcpServersOnly===!0)w.allowManagedMcpServersOnly=!0;if(i.disableClaudeAiConnectors===!0)w.disableClaudeAiConnectors=!0;if(i.syncClaudeAiSkills===!1)w.syncClaudeAiSkills=!1;if(i.syncClaudeAiPlugins===!1)w.syncClaudeAiPlugins=!1;if(i.remoteTools?.allowUnattendedServing===!1)w.remoteTools={...w.remoteTools,allowUnattendedServing:!1};if(i.allowManagedPermissionRulesOnly===!0)w.allowManagedPermissionRulesOnly=!0;if(i.disableAutoMode==="disable")w.disableAutoMode="disable";let x=i.remoteControl?.shareHostProfile;if(x==="off"||x==="basic")w.remoteControl={...w.remoteControl,shareHostProfile:x};if(nO(i.attribution,i.includeCoAuthoredBy)==="disabled")w.attribution={...w.attribution,commitTrailers:!1};if(i.attribution?.sessionUrl===!1)w.attribution={...w.attribution,sessionUrl:!1};let U=i.strictPluginOnlyCustomization;if(U===!0||Array.isArray(U)&&U.length>0)w.strictPluginOnlyCustomization=U;if(i.deniedMcpServers)w.deniedMcpServers=i.deniedMcpServers;if(i.blockedMarketplaces?.length)w.blockedMarketplaces=i.blockedMarketplaces;if(i.deniedModels&&i.deniedModels.length>0)w.deniedModels=i.deniedModels;if(c.forceLoginOrgUUID===void 0&&i.forceLoginOrgUUID)w.forceLoginOrgUUID=i.forceLoginOrgUUID;for(let B of ys)if(c[B]===void 0&&i[B])Object.assign(w,{[B]:i[B]});if(i.enforceAvailableModels===!0)w.enforceAvailableModels=!0;if(i.availableModelsMatch==="exact")w.availableModelsMatch="exact";if(i.permissions){let B=Vo(i.permissions,["deny","ask"]);for(let z of["deny","ask"]){let le=B[z];if(le!==void 0)B[z]=le.filter((fe)=>{if(!ar.test(fe))return!0;return t(`Ignoring ${z} rule "${fe}" 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(i.permissions.disableBypassPermissionsMode==="disable")B.disableBypassPermissionsMode="disable";if(i.permissions.disableAutoMode==="disable")B.disableAutoMode="disable";if(i.permissions.blockReadsOutsideWorkingDirectories===!0)B.blockReadsOutsideWorkingDirectories=!0;if(i.permissions.blockWritesOutsideWorkingDirectories===!0)B.blockWritesOutsideWorkingDirectories=!0;if(i.permissions.denyInsteadOfPrompting===!0)B.denyInsteadOfPrompting=!0;if(c.allowManagedPermissionRulesOnly!==!0){let{allow:z,additionalDirectories:le}=i.permissions;if(z&&c.sandbox?.network?.allowManagedDomainsOnly!==!0)B.allow=z;if(le)B.additionalDirectories=le}if(Object.keys(B).length>0)w.permissions=B}if(i.sandbox){let{network:B,filesystem:z,credentials:le}=i.sandbox,fe={},Ce=B?Vo(B,["deniedDomains"]):{},Re=z?Vo(z,["denyRead","denyWrite"]):{};if(B){if(c.sandbox?.network?.allowManagedDomainsOnly!==!0&&B.allowedDomains)Ce.allowedDomains=B.allowedDomains}if(Object.keys(Ce).length>0)fe.network=Ce;if(z){if(c.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&z.allowRead)Re.allowRead=z.allowRead}if(Object.keys(Re).length>0)fe.filesystem=Re;if(le){let xe=(le.files??[]).map((Le)=>Le.mode==="deny"?{path:Le.path,mode:"deny"}:{path:Le.path,mode:"mask",injectHosts:[]}),Te=(le.envVars??[]).filter((Le)=>Le.mode==="deny").map((Le)=>({name:Le.name,mode:"deny"})),Ke={...xe.length>0&&{files:xe},...Te.length>0&&{envVars:Te}};if(le.sigv4){let Le={};for(let Pe of["streaming","presigned","sigv4a"])if(le.sigv4[Pe]==="deny")Le[Pe]="deny";Ke.sigv4=Le}{let Le=iA(le.awsPairs??[],[]);if(Le.length>0)Ke.awsPairs=Le}if(Object.keys(Ke).length>0)fe.credentials=Ke}if(un(fe,jee(i)),Object.keys(fe).length>0)w.sandbox=fe}return w}function iA(i,c){let T=Xo,D=new Set(c.flatMap(UO));return f(i.flatMap(UO)).filter((w)=>T.includes(w)&&!D.has(w)).map((w,x)=>({accessKeyIdVar:w,secretAccessKeyVar:`${Ya}${x+1}_`}))}function UO(i){if(!n(i))return[];return[i.accessKeyIdVar,i.secretAccessKeyVar,i.sessionTokenVar].filter((c)=>typeof c==="string")}var Vee=new Set([...[...gu].filter((i)=>i!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),..._u,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function Yee(i,c){if(!c||!i)return null;let T={};if(i.model!==void 0)T.model=i.model;if(i.availableModels!==void 0)T.availableModels=i.availableModels;if(i.availableModelsMatch==="exact"||i.availableModelsMatch!==void 0&&i.availableModels!==void 0)T.availableModelsMatch=i.availableModelsMatch;if(i.enforceAvailableModels!==void 0)T.enforceAvailableModels=i.enforceAvailableModels;if(i.deniedModels!==void 0&&i.deniedModels.length>0)T.deniedModels=i.deniedModels;if(i.fallbackModel!==void 0)T.fallbackModel=i.fallbackModel;if(i.modelPicker!==void 0)T.modelPicker=i.modelPicker;return Object.keys(T).length>0?T:null}function Xee(i){let c=[];for(let T of i?.deniedModels??[]){let{warning:D}=ot(T);if(D!==void 0)c.push({file:"managed settings",path:"deniedModels",message:D,severity:"warning",statusOnly:!0})}return c}function Jee(i){if(i?.availableModelsMatch!=="exact")return[];let c=i.availableModels??[];return c.flatMap((T)=>{let D=tO(T,c);return D===void 0?[]:[{file:"managed settings",path:"availableModels",message:D,severity:"warning",statusOnly:!0}]})}function HO(i,c){let T=i.deniedModels;if(Object.assign(i,c),T!==void 0&&c.deniedModels!==void 0)i.deniedModels=f([...T,...c.deniedModels])}function zl(i,c=!1){if(delete i.model,delete i.fallbackModel,delete i.modelPicker,delete i.modelOverrides,i.env){let T={};for(let[D,w]of Object.entries(i.env)){let x=D.toUpperCase();if(!Vee.has(x)||c&&x===ZS)T[D]=w}i.env=T}}function Zee(i){let c=i.store.policy.allTiers;if(c!==void 0)return c;let T=lte(i);return i.store.policy.allTiers=T,T}function yr(){return m()==="macos"?"plist":"hklm"}function aA(i){let c=Pi(i);if(c.composes==="tier")return"helper";let T=bs(i);if(c.composes==="remoteSlot"||T.present.remote)return"remote";if(T.present.mdm)return yr();if(T.present.file)return"file";if(T.parentSlice||T.hostModelOverlay)return"parent";let D=i.hkcu?.();return D&&Object.keys(D.settings).length>0?"hkcu":null}function bs(i){let c=[],T=Vu(i),{settings:D,servedSnapshot:w}=T;c.push(...T.errors);let x=Pi(i),U=x.composes==="remoteSlot"?x.helper:Wl(D),B=Jl(i),z=B.settings;c.push(...B.errors);let le=Wl(z),fe=i.file?.()??Xl(i),Ce=fe.settings;c.push(...fe.errors);let Re=Wl(Ce),xe=Os(B),Te=Os(fe),Ke=Te&&fe.heldOnly===!0,Le=i.policyOnlyServerTier?.()==="unconfirmed"&&(xe&&i.mdm?.().userWritable!==!0||Te),Pe=Le&&U?tte(U):U,nt=!Le&&(x.composes==="remoteSlot"?Pe!==null:Os(T)),et=Uu(Pe,nt),rt=Uu(le,xe),At=fe.onlyHeldContent?cA:Uu(Re,Te),ht=!Le&&Pe!==null&&et>=Math.max(rt,At),ct=le!==null&&rt>=At,Tt=[[Le?null:D,ht],[z,ct],[Ce,Re!==null]],Xt=(x.composes==="remoteSlot"?x.helper:Tt.find(([bt,Jt])=>bt!==null&&(bt===D&&w?Jt:bt.managedSourcesBehavior!==void 0||Jt))?.[0])?.managedSourcesBehavior,Ge=Le?Pe:null,ke=Pe!==null&&!ht,st=ke?null:Pe,ft=le!==null&&!ct&&st===null,Ot=ft?null:le,Rt=[],Ct=[[ke,"remote",Pe],[ft,yr(),le]];for(let[bt,Jt,Sn]of Ct){if(!bt||Sn===null)continue;if(Rt.push([Sn,Jt]),!Ts(Sn)||Sn===Ge)continue;let xo=Jt==="remote"&&xe?yr():"file";c.push({file:Sr[Jt],path:Object.keys(Sn).find((Tr)=>!Qo.includes(Tr))??"",message:`${Sr[Jt]} holds only values that could not be applied as written, so ${Sr[xo]} 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:wt,errors:zn}=yee(i);c.push(...zn);let bo=Oee(i);c.push(...bo?.errors??[]);let nn=bo?.settings??wt,rn=st!==null&&w&&x.composes!=="remoteSlot",uo=!(st!==null&&nt&&!rn)&&!(Ot!==null&&xe),po=uo&&(!Te||Ke),Un=po&&Ke,Pt=Un&&nn&&Re?In(Re,ys.filter((bt)=>nn[bt]!==void 0)):Re,fo=(xe?Ot:null)??(Te?Re:null),FA=nn!==null&&(fo===null||rA(fo)||Un),cn=[nte(st,w&&x.composes!=="remoteSlot",[Ot,Pt&&In(Pt,fe.heldAllowLists??[]),...FA?[Vo(nn,ys)]:[]]),Ot,Pt,...Rt.map(([bt])=>bt)].filter((bt)=>bt!==null),BA=[...st!==null?["remote"]:[],...Ot!==null?[yr()]:[],...Re!==null?["file"]:[],...Rt.map(([,bt])=>bt)],ip=(bt)=>cn.some((Jt)=>Jt!==Pt&&Jt[bt]!==void 0),nc=Pt!==null&&fe.onlyHeldContent===!0&&uo&&Xt!=="merge"&&cn[0]!==Pt,oc=st!==null&&i.policyOnlyServerTier?.()!==void 0,{admin:br,merged:vi}=Gl(nc?cn.filter((bt)=>bt!==Pt):cn,Xt,rn,nc?cn.length-2:Rt.length,oc),ap=(bt)=>Fl({slot:bt,adminTiers:cn})||nn?.allowManagedMcpServersOnly===!0&&bt?.allowManagedMcpServersOnly!==!1,lp=(bt,Jt)=>vi?ip(bt):cn[0]!==Pt&&cn[0]?.[bt]!==void 0||bt==="allowedMcpServers"&&ip(bt)&&ap(Jt),Rr=br&&Pt&&nc?Gl([br,In(Pt,qu.filter((bt)=>lp(bt,br)))],"merge",!1,0).admin:br&&Ge&&!vi?Gl([br,Ge],"merge",!1,0).admin:br;if(oc&&Rr!==null){let{kept:bt}=CA(i);for(let Jt of OA){let Sn=Lt(bt,Jt),xo=Lt(Rr,Jt),Tr=qy.some((Ui)=>Ui===Jt[0])&&Lt(cn[0],Jt)!==void 0;if(Sn!==void 0&&!Tr)vt(Rr,Jt,AA.includes(Jt.join("."))&&Array.isArray(Sn)&&Array.isArray(xo)?f([...xo,...Sn]):Sn)}}let Is=Rr===null?[T,B,fe].find(As):void 0,mo=Rr??(Is?{}:null),rc={remote:st!==null||Is===T,mdm:Ot!==null||Is===B,file:Re!==null||Is===fe},cp=[];if(vi){let bt=rc.remote?"remote":rc.mdm?yr():"file",Jt=[[Ot,yr()],[Pt,"file"]];for(let[Sn,xo]of Jt){if(Sn===null||Sn===cn[0]||rn&&Sn===cn[1])continue;let Tr=Zu.filter((lc)=>Object.values(Sn[lc]??{}).some((pp)=>pp!==void 0&&pp!==null)),[Ui]=Tr;if(Ui===void 0)continue;cp.push(xo),c.push({file:Sr[xo],path:Ui,message:`${Tr.map((lc)=>`"${lc}"`).join(" and ")} in ${Sr[xo]} ignored: policy helper configuration is read from the highest managed settings source only (${Sr[bt]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let sc=(bt)=>bt!==null&&(bt===cn[0]||Object.keys(In(bt,bA())).length>0),zA={remote:sc(st),mdm:sc(Ot),file:sc(Pt)},ws={allowManagedPermissionRulesOnly:cn.some((bt)=>bt.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:mo?.forceLoginOrgUUID,...Vo(mo??{},ys),hooks:mo?.hooks,enabledPlugins:mo?.enabledPlugins,allowedMcpServers:ap(mo)?Iu({slot:mo,adminTiers:cn}):mo?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:cn.some((bt)=>bt.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:cn.some((bt)=>bt.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},ic=!ga(i)&&Wee(Rr,po),ki=Un&&nn?FO(nn,ws):nn,dp=ic&&nn&&!Un?ys.filter((bt)=>nn[bt]!==void 0&&fe.heldAllowLists?.includes(bt)===!0&&C(ws[bt],Re?.[bt])&&!lp(bt,mo)):[],ac=(ki||sA(i.parentManaged))&&ic?Un?zu(ki??{},{...ws,allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}},i.parentManaged,i.parentOrganizationSettings?.own):zu(ki??{},In(ws,dp),i.parentManaged,i.parentOrganizationSettings?.own):null,Mi=ac&&Object.keys(ac).length>0?ac:null,up=Mi&&!mo&&Object.entries(Mi).every(([bt,Jt])=>$ee.has(bt)&&i.parentOrganizationSettings?.own[bt]!==Jt)&&Object.keys(i.hkcu?.().settings??{}).length>0?Mi:null,GA=up?null:Mi,WA=Yee(nn===wt?ki:Un&&wt?FO(wt,ws):wt,i.hostManagedProvider);return{tiers:cn,tierSources:BA,admin:mo,parentSlice:GA,hostFeatureOverlay:up,hostModelOverlay:WA,errors:c,present:rc,mode:Xt,merged:vi,composed:zA,snapshotFirst:rn,parentNeverShutOut:po,shadowedHelperSources:cp,parentIncluded:ic,heldEmpty:Is!==void 0,fileNotHeld:fe.settingsNotHeld,heldInTheHostsPlace:dp,policyOnlyLeads:oc}}function Gl(i,c,T,D,w=!1){let x=i[0];if(!x)return{admin:null,merged:!1};let{managedSourcesBehavior:U,...B}=x,z=c==="merge"&&i.length>=2;if(!z&&D===0&&!w)return{admin:U===void 0?x:B,merged:!1};let le=i.slice(z||w?1:i.length-D).map((Ce,Re)=>{let xe=z&&T&&Re===0,Te=xe?{...Ce}:In(Ce,bA());if(!xe){for(let Le of Kee)if(Lt(Te,Le)!==void 0)vt(Te,Le,void 0)}let Ke=Lt(Te.sandbox,["enabledPlatforms"]);if(Array.isArray(Ke)&&Ke.includes(m()))vt(Te,["sandbox","enabledPlatforms"],void 0);else if(Ke!==void 0)delete Te.sandbox;return Te});if(!z)return BO(B,[x,...le]),{admin:B,merged:!1};let fe={};for(let Ce of[...le].reverse())un(fe,Ce,Gu);return un(fe,B,T?ote:Gu),BO(fe,[x,...le]),qee(fe,[x,...le],T),{admin:fe,merged:!0}}var Zu=["policyHelper","policyHelpers"],Sr={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function Rs(i){return Object.keys(i).some((c)=>!Qo.includes(c))}function Ts(i){return Object.entries(i).some(([c,T])=>!Qo.includes(c)&&!ui(T))}function Wl(i){return i&&Rs(i)?i:null}function Os(i){return i.settings!==null&&Ts(i.settings)&&!i.onlySubstitutes}function lA(i,c,T){return Os({settings:c})&&!T.some((D)=>D.onlySubstitutes)?RO(i):i}var cA=0;function Uu(i,c){if(i===null)return-1;if(c)return 2;return Ts(i)?1:cA}function dA(i,c){return Object.entries(i).some(([T,D])=>D!==null&&!$O(T,D)&&!Qo.includes(T))||c!==null&&Rs(c)}function As(i){return i.documentHasPolicyContent??(i.settings!==null&&Rs(i.settings))}function Po(i){return i.loadState??(i.settings!==null?"loaded":"absent")}function lo(i,c){if(i==="didNotLoad"||c==="didNotLoad")return"didNotLoad";return i==="loaded"||c==="loaded"?"loaded":"absent"}function co(i){return i.userWritable!==!0&&(As(i)||i.loadState==="didNotLoad")}function qee(i,c,T){let D=c.findIndex((x)=>x.availableModels!==void 0),w=c.findIndex((x)=>x.modelOverrides!==void 0);if(w!==-1&&(D===-1||w<=D||T&&D===0))i.modelOverrides={...c[w].modelOverrides};else delete i.modelOverrides}var uA=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],Qee=["awsPairs","ripgrep"];function pA(i,c,T){if(c===void 0)return i;if(Array.isArray(c))return T==="awsPairs"&&Array.isArray(i)?[...c,...iA(i,c)]:[...c];if(!n(c))return c;return Pa(c,(D)=>Array.isArray(D)?[...D]:D)}var qu=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],ys=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"],fA=[["allowManagedMcpServersOnly","allowedMcpServers"],["enforceAvailableModels","availableModels"]];function FO(i,c){return In(i,fA.filter(([,T])=>i[T]===void 0&&c[T]===void 0).map(([T])=>T))}var ete=[...fA.map(([i])=>i),"allowManagedPermissionRulesOnly","allowManagedHooksOnly","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars","strictPluginOnlyCustomization","sandbox.network.allowManagedDomainsOnly","sandbox.filesystem.allowManagedReadPathsOnly","sandbox.enabled"];function tte(i){return Wl(zu(In(i,ete),{...Object.fromEntries(ys.map((c)=>[c,[]])),forceLoginOrgUUID:[],allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}))}function nte(i,c,T){if(i===null||!c)return i;let D=qu.filter((w)=>T.some((x)=>x?.[w]!==void 0));return D.length===0?i:In(i,D)}function Gu(i,c,T){if(T!==void 0&&(uA.includes(T)||Qee.includes(T)))return pA(i,c,T);return mA(i,c,T)}function ote(i,c,T){if(T!==void 0&&uA.includes(T))return pA(i,c,T);return mA(i,c,T)}function mA(i,c,T){if(Array.isArray(i)&&Array.isArray(c)&&T!=="fallbackModel")return f([...c,...i]);return ao(i,c,T)}function BO(i,c){let T=c[0],D=i;for(let w of Kn()){let{path:x,restrictive:U}=w,B=Oo(U),z=Math.min(...c.map((le)=>B.indexOf(lr(w,le))).filter((le)=>le!==-1));if(Number.isFinite(z))vt(D,x,B[z]);else if(Lt(T,x)===void 0&&Lt(i,x)!==void 0)vt(D,x,void 0)}if(i.strictPluginOnlyCustomization!==!0){let w=f(c.flatMap((x)=>Array.isArray(x.strictPluginOnlyCustomization)?x.strictPluginOnlyCustomization:[]));if(w.length>0)i.strictPluginOnlyCustomization=w;else if(T?.strictPluginOnlyCustomization===void 0)delete i.strictPluginOnlyCustomization}}function Pi(i){let c=i.helper?.()??null;if(!c)return{composes:"none"};let T=i.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(i.helperMergesOutput?.()!==!0)return{composes:T,helper:c,mergedOver:null};if(!i.store.policy.mergedHelper){let{base:D,mergedOver:w}=T==="remoteSlot"?{base:Vu(i).settings,mergedOver:"remote"}:gA(i);i.store.policy.mergedHelper={helper:ate(D,c),mergedOver:Object.keys(_A(D)).length>0?w:null}}return{composes:T,...i.store.policy.mergedHelper}}function gA(i){let c=Jl(i);if(bs({...i,helper:void 0}).present.mdm)return{base:c.settings,mergedOver:yr(),errors:c.errors};let T=i.file?.()??Xl(i);return{base:T.settings,mergedOver:"file",errors:[...c.errors,...T.errors]}}function _A(i){return In(i??{},Zu)}function rte(i,c){let T=new Map;for(let[w,x]of Object.entries(c)){let U=w.toUpperCase();if(!T.has(U))T.set(U,x)}let D={};for(let[w,x]of Object.entries(i))D[w]=T.get(w.toUpperCase())??x;return Object.assign(D,c)}var ste=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function ite(i,c,T){let D=T!==void 0&&c!==void 0&&ste.includes(T)?c:Gu(i,c,T);return D===c&&Array.isArray(D)?[...D]:D}function ate(i,c){let T=_A(i),D=un({},T,c,ite);if(T.env&&c.env)D.env=rte(T.env,c.env);return D}function hA(i){let c=Jl(i);return i.mdm?.().userWritable!==!0&&c.loadState==="didNotLoad"||c.errors.some((T)=>T.errorClass==="unreadable"&&T.userWritable!==!0)}function EA(i){return Po(i.file?.()??Xl(i))==="didNotLoad"}function lte(i){let c=Pi(i);if(c.composes==="tier")return[c.helper];let{tiers:T,parentSlice:D}=bs(i);return D?[...T,D]:T}function cte(i,c,T){let D={slot:T,adminTiers:i};return i.flatMap((w,x)=>{let U=c[x],B=fO(w,D);return U!==void 0&&B.length>0?[{source:U,keys:B}]:[]})}var SA=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var Vl=[...SA,"otelHeadersHelper","proxyAuthHelper"],dte=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function ute(i,c,T){let D=T.launchFolderKeysFrom?.(i)??"as_read";if(D==="as_read")return c;let w=dte.filter((z)=>c[z]!==void 0),x={...c};for(let z of w)delete x[z];let U=D==="none"?[]:Kn().filter((z)=>z.path[0]!=="sandbox"&&Lt(x,z.path)!==void 0&&!Oo(z.restrictive).some((le)=>le===lr(z,x)));if(w.length===0&&U.length===0)return c;for(let{path:z}of U)vt(x,z,void 0);let B=Vy(Or(i,T)??i,U.map(({path:z})=>z.join(".")));if(B.length>0)t(`Ignoring ${B.join(", ")} in ${i==="localSettings"?".claude/settings.local.json":".claude/settings.json"}: this session's host does not trust the folder, so that file can make these settings stricter, not looser. To use such a value, set it in user or managed settings.`,{level:"warn"});if(w.length>0)$y("keys");return x}function Li(i,c,T){return pte(i,ute(i,c,T),T)}function pte(i,c,T){let D=Vl.some((B)=>c[B]!==void 0);if(!D&&i!=="policySettings")return c;let w=T.credentialHelperKeysFrom(i);if(w==="as_read")return c;let x=i==="policySettings"&&w==="machine_admin"?fte(T):{};if(!D&&Object.keys(x).length===0)return c;let U={...c};for(let B of Vl)delete U[B];return Object.assign(U,x)}function fte(i){let c=Qu(i),T={};for(let D of Vl){let w=c?.[D];if(w!==void 0)T[D]=w}return T}function Qu(i){let c=yA(i),T=Pi(c);return T.composes==="tier"?T.helper:bs(c).admin}function yA(i){let c=i.helperArmedFromRemote?.()===!1&&i.helperArmedFromUserWritableBase?.()===!1;return{...i,store:new ge,remote:()=>null,helper:c?i.helper:()=>null,...i.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}}}function mte(i){return i.helperArmedFromUserWritableBase?.()!==!1||i.helperMergesOutput?.()===!0&&i.mdm?.().userWritable===!0}function zO(i,c){if(c.store.policy.machineLoginPins===void 0){let w=Qu(c);c.store.policy.machineLoginPins={value:{forceLoginOrgUUID:w?.forceLoginOrgUUID,forceLoginMethod:w?.forceLoginMethod}}}let{forceLoginOrgUUID:T,forceLoginMethod:D}=c.store.policy.machineLoginPins.value;if(T!==void 0)i.forceLoginOrgUUID=T;if(D==="claudeai"||D==="console")i.forceLoginMethod=D}var OA=[["model"],["fallbackModel"],["advisorModel"],["modelOverrides"],["modelPricing"],["modelPicker"],["processWrapper"],["sandbox","credentials","files"],["sandbox","credentials","envVars"],["sandbox","credentials","awsPairs"],["availableModels"],["requiredMinimumVersion"],["requiredMaximumVersion"],["strictKnownMarketplaces"],["allowedMarketplaces"],["allowedChannelPlugins"],["permissions","deny"],["permissions","ask"],["deniedModels"],["blockedMarketplaces"],...er.map((i)=>["autoMode",i]),["hooks"],["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["managedMcpServers"],["extraKnownMarketplaces"],["additionalMarketplaces"],["enabledPlugins"],["pluginConfigs"],["pluginTrustMessage"],["pluginSuggestionMarketplaces"],["claudeMd"],["cleanupPeriodDays"],["desktopSessionCleanupPeriodDays"]],AA=["permissions.deny","permissions.ask","deniedModels","blockedMarketplaces",...er.map((i)=>`autoMode.${i}`)];function CA(i){if(i.store.policy.machineBeneathPolicyOnly===void 0){let c=Qu(i),T=c===null?null:Hy(c);if(T!==c)t(`Managed settings: Left out the "!" rules among this computer's ask and deny rules, under the organization's settings`,{level:"warn"});let D={};for(let w of OA){let x=Lt(T,w);if(x!==void 0)vt(D,w,x)}i.store.policy.machineBeneathPolicyOnly={kept:D,env:gte(i)}}return i.store.policy.machineBeneathPolicyOnly}function gte(i){return ep({...yA(i),helper:()=>null,hkcu:void 0,parentManaged:null}).settings?.env}var _te=[...Vl,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","allowNestedModelAccessUnderForceLogin","parentSettingsBehavior","env","modelPicker",...Zu,...Qo];function bA(){return _te}function RA(i){return $S.some((c)=>i.startsWith(c))||pu.includes(i)}function hte(i,c,T,D=0){let w=new Map,x=new Map,U=!1;for(let[B,z]of i.entries()){let le=new Set,fe=c?.[B]===!0;for(let[Ce,Re]of Object.entries(z??{})){let xe=Ce.toUpperCase(),Te=RA(xe);if(Te&&Re.trim()==="")continue;if(Te&&U)continue;if(Te&&B>D&&c?.[B]===!0)continue;let Ke=w.get(xe);if(Ke!==void 0){if(le.has(xe))x.set(Ce,Re);else if(!x.has(Ce))x.set(Ce,Ke);continue}if(B>D&&T?.[B]?.has(xe))continue;if(x.set(Ce,Re),le.add(xe),w.set(xe,Re),Te)fe=!0}if(fe)U=!0}return Object.fromEntries(x)}var Ete="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function GO(i){if(!i)return;let c={};for(let[T,D]of Object.entries(i))if(T.toUpperCase()!==Ete)c[T]=D;return c}function Ste(i,c){let T=Object.entries(i??{}),D=c??{};return T.length===Object.keys(D).length&&T.every(([w,x])=>D[w]===x)}function WO(i,c){if(c===i.store.parentLeftOutReason)return;if(i.store.parentLeftOutReason=c,c!==null)t(`--managed-settings left out of the policy tier: ${c}`,{level:"warn"})}function ep(i){let c=Pi(i),T=(i.helperWarnings?.()??[]).filter((ct)=>!nr(ct.path)),D=!ga(i)&&Object.keys(i.parentManaged??{}).length>0;if(c.composes==="tier"){WO(i,D?"a policy helper supplies that tier (parentSettingsBehavior does not apply to it)":null);let{helper:ct}=c;i.store.lastPolicyEnvComposition=null;let Tt=mte(i),It=i.hostManagedProvider||Tt?{...ct}:ct;if(i.hostManagedProvider)zl(It);if(Tt)zO(It,i);i.store.policy.pairedModelOverrides={value:i.hostManagedProvider&&ct.availableModels!==void 0?ct.modelOverrides:void 0},i.store.policy.deniedModelsOverrides={value:i.hostManagedProvider?ct.modelOverrides:void 0};let Xt=i.store.policy.helperBaseStatusNotices??=[...i.helperMergesOutput?.()===!0?gA(i).errors.filter((Ge)=>!Ge.statusOnly):[],...bs(i).errors.filter((Ge)=>Ge.statusOnly)];return{settings:It,errors:[...Xt,...T]}}let{tiers:w,tierSources:x,admin:U,parentSlice:B,hostFeatureOverlay:z,hostModelOverlay:le,errors:fe,present:Ce,snapshotFirst:Re,parentIncluded:xe,heldInTheHostsPlace:Te,policyOnlyLeads:Ke}=bs(i),Le=null;if(D&&!xe)Le="an administrator's managed settings apply and do not set parentSettingsBehavior to 'merge'";else if(D&&!B&&!z&&!le)Le="nothing shuts it out, yet none of its keys was kept (unreadable, no restriction, or already set by an administrator)";if(WO(i,Le),fe.push(...T),!U&&!B){i.store.lastPolicyEnvComposition=null,i.store.policy.pairedModelOverrides={value:void 0},i.store.policy.deniedModelsOverrides={value:void 0};let ct=i.hkcu?.();if(ct&&Object.keys(ct.settings).length>0){let Tt=i.hostManagedProvider||z?{...ct.settings,...z}:ct.settings;if(i.hostManagedProvider){if(zl(Tt),le)HO(Tt,le)}return{settings:Tt,errors:[...fe,...ct.errors]}}if(le)return{settings:{...le},errors:[...fe,...ct?.errors??[]]};return{settings:null,errors:[...fe,...ct?.errors??[]]}}let Pe=un({},B??{},In(U??{},Te),ao);if(B?.availableModelsMatch==="exact")Pe.availableModelsMatch="exact";if(B?.allowManagedHooksOnly===!0)Pe.allowManagedHooksOnly=!0;if(B?.disableSkillShellExecution===!0)Pe.disableSkillShellExecution=!0;if(B?.disableWindowsBashCommandSplit===!0)Pe.disableWindowsBashCommandSplit=!0;for(let ct of Xu)if(B?.[ct]===!0)Pe[ct]=!0;for(let ct of Ju)if(B?.[ct]===!1)Pe[ct]=!1;if(w.some((ct)=>ct.forceRemoteSettingsRefresh===!0))Pe.forceRemoteSettingsRefresh=!0;if(x.includes("remote")||i.mdm?.().userWritable===!0)zO(Pe,i);let nt=Wt.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0&&!Ke,et=Pe.env;if(!nt){let ct=w;if(Ke){let It=CA(i).env,Xt=new Set(Object.entries(It??{}).filter(([,Ot])=>Ot.trim()!=="").map(([Ot])=>Ot.toUpperCase())),Ge=Zy(w[0]?.env??{},It),ke=Object.entries(w[0]?.env??{}).filter(([Ot])=>{let Rt=Ot.toUpperCase();return!(Jy.includes(Rt)&&Xt.has(Rt)||Ge.dropped.includes(Rt))}).concat(Ge.cleared.map((Ot)=>[Ot,""])),[st,ft]=d_(ke,([Ot,Rt])=>pu.includes(Ot.toUpperCase())&&Q(Rt));ct=[{...w[0],env:Object.fromEntries(ft.some(([Ot])=>RA(Ot.toUpperCase()))?ke:ft)},{env:{...It,...Object.fromEntries(st)}}]}let Tt=hte(ct.map((It)=>It.env),ct.map((It)=>(It.otelHeadersHelper??"").trim()!==""),ct.map((It)=>{let Xt=new Set;for(let Ge of SA){let ke=It[Ge];if(typeof ke==="string"&&ke.trim()!=="")for(let st of VS[Ge])Xt.add(st)}return Xt.size>0?Xt:void 0}),Re||Ke?1:0);if(Object.keys(Tt).length>0)Pe.env=Tt;else delete Pe.env}if(Pe.env){let ct=GO(Pe.env);if(ct&&Object.keys(ct).length>0)Pe.env=ct;else delete Pe.env}let rt=qm();if(i.hostManagedProvider){if(zl(Pe,rt),le)HO(Pe,le)}let At={env:GO(et)};if(i.hostManagedProvider)zl(At,rt);let ht=!nt&&!Ste(Pe.env,At.env);i.store.lastPolicyEnvComposition={unionOptedOut:nt,unionChangedEnv:ht,remoteTierPresent:Ce.remote,mdmTierPresent:Ce.mdm,fileTierPresent:Ce.file,adminTierCount:w.length,tiersWithEnv:Ie(w,(ct)=>Object.keys(ct.env??{}).length>0)},i.store.policy.pairedModelOverrides={value:i.hostManagedProvider&&U?.availableModels!==void 0&&U.modelOverrides!==void 0&&le?.availableModels===void 0?U.modelOverrides:void 0},i.store.policy.deniedModelsOverrides={value:i.hostManagedProvider?U?.modelOverrides:void 0};for(let{source:ct,keys:Tt}of cte(w,x,Pe)){let[It]=Tt;if(It===void 0)continue;let Xt=Sr[ct],Ge=Tt.length===1;fe.push({file:Xt,path:It,message:`${Tt.map((ke)=>`"${ke}"`).join(" and ")} in ${Xt} ${Ge?"is":"are"} not applied: ${Xt} is not the managed settings source that applies for ${Ge?"this key":"these keys"} (/status lists the setting sources). Remove ${Ge?"it":"them"} from ${Xt}, or set ${Ge?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:Pe,errors:fe}}function yte(i,c,{includeLegacyLocalSettings:T=!0,keepUnreadableFileSettings:D=!1}={}){if(i==="policySettings")return ep(c).settings;let w=D?Hu:Kl,x=Or(i,c),{settings:U}=x?w(x,c.store,i==="flagSettings"?c.flagExpectedContent:void 0):{settings:null};if(i==="flagSettings"){let{settings:B}=JO(c);if(B)return un(U||{},B,ao)}if(i==="localSettings"&&T){let B=nA(c);if(B){let{settings:z}=w(B,c.store);if(z)return c.onLegacyLocalSettingsRead?.("per_source"),un(z,U||{},ao)}}return U}function Ote(i,c){return{...i,...c}}function ao(i,c,T){if(T==="modelPicker"&&c!==void 0)return TA(c);if(Array.isArray(i)&&Array.isArray(c)){if(T==="fallbackModel")return c;return f([...i,...c])}if((T==="extraKnownMarketplaces"||T==="managedMcpServers")&&n(i)&&n(c))return Ote(i,c);return}function TA(i){if(!n(i))return i;let c=i.options;return{...i,...Array.isArray(c)&&{options:c.map((T)=>n(T)?{...T}:T)}}}function Ate(i){if(i.store.isLoadingFromDisk)return{settings:{},errors:[]};let c=Date.now();Fs("info","settings_load_started"),i.store.isLoadingFromDisk=!0;try{let T=i.store.pluginBase,D={};if(T)D=un(D,T,ao);let w=[],x=new Set,U=new Set,B=(Le)=>{for(let Pe of Le){let nt=`${Pe.file}:${Pe.path}:${Pe.message}`;if(!x.has(nt))x.add(nt),w.push(Pe)}},z=[],le=[$o()];if(m()==="wsl"&&i.wslInherits?.())le.push(yn);let fe=new Set(le.map((Le)=>Ft(pn(Le,"managed-settings.json")))),Ce=new Set(le.map((Le)=>Ft(pn(Le,"managed-settings.d")))),Re=(Le)=>{let Pe=Ft(Le);return fe.has(Pe)||Ce.has(Yl(Pe))},xe=(Le,Pe,nt)=>{if(nt?.channelLabel!==!0&&Re(Le))return;let et=Pe.sandbox?.filesystem?.allowRead?.length??0,rt=Pe.sandbox?.network?.allowedDomains?.length??0;if(et>0||rt>0)z.push({file:Le,allowReadCount:et,allowedDomainsCount:rt})},Te=null;for(let Le of Wu(i)){if(Le==="policySettings"){let{settings:et,errors:rt}=ep(i);if(Te=et,B(Xee(et)),B(Jee(et)),et)D=un(D,Li(Le,et,i),ao);B(rt);continue}let Pe=i.store.repoTierFreeze.tier(Le);if(Pe!==void 0){let et=Or(Le,i);if(et)U.add(Ft(et));if(B([...Pe.errors]),Pe.settings)D=un(D,Pe.settings,ao);continue}if(Le==="localSettings"){let et=nA(i);if(et&&!U.has(Ft(et))){U.add(Ft(et));let{settings:rt,errors:At}=Hu(et,i.store);if(B(At),rt)i.onLegacyLocalSettingsRead?.("cascade"),xe(et,rt),D=un(D,Li(Le,rt,i),ao)}}for(let et of Fee(Le,i)){let rt;try{rt=Je(l(),et).absentAt===void 0}catch{rt=!0}if(rt)B([zee(et)]),t(`Settings file ${et} is not used: it is in a connector-downloads folder`)}let nt=Or(Le,i);if(nt){let et=Ft(nt),rt=Le==="flagSettings"&&i.flagExpectedContent!==void 0;if(!U.has(et)||rt){U.add(et);let{settings:At,errors:ht}=Hu(nt,i.store,Le==="flagSettings"?i.flagExpectedContent:void 0);if(B(ht),At){if(Le==="flagSettings"&&i.flagInlineJson===!0)xe(Yn,At,{channelLabel:!0});else xe(nt,At);D=un(D,Li(Le,At,i),ao)}}}if(Le==="flagSettings"){let{settings:et,errors:rt}=JO(i);if(B(rt),et)xe("SDK inline settings",et,{channelLabel:!0}),D=un(D,Li(Le,et,i),ao)}}if(Te){if(Te.availableModels!==void 0)D.availableModels=[...Te.availableModels];if(Te.enforceAvailableModels!==void 0)D.enforceAvailableModels=Te.enforceAvailableModels;if(Te.modelPicker!==void 0)D.modelPicker=TA(Te.modelPicker)}let Ke=Te?.deniedModels;if(Ke!==void 0)D.deniedModels=[...Ke];else delete D.deniedModels;if(z.length>0){let Le=Zee(i),Pe=(nt,et,rt,At,ht)=>({file:nt,path:et,severity:"warning",statusOnly:!0,message:`${et} is ignored — managed settings set ${rt}, so only ${At} from managed settings are honored. The ${ht===1?"entry":`${ht} entries`} in ${nt} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(Le.some((nt)=>nt.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let nt of z)if(nt.allowReadCount>0)B([Pe(nt.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",nt.allowReadCount)])}if(Le.some((nt)=>nt.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let nt of z)if(nt.allowedDomainsCount>0)B([Pe(nt.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",nt.allowedDomainsCount)])}}return Fs("info","settings_load_completed",{duration_ms:Date.now()-c,source_count:U.size,error_count:w.length}),i.store.hookedMerge.computed=D,gO({settings:D,errors:w},i.store.hookedMerge.answers)}finally{i.store.isLoadingFromDisk=!1}}function Cte(i){let c=i.store.mergedSettings;if(c!==null)return c;let T=Ate(i);return i.store.mergedSettings=T,T}function bte(i){let{settings:c}=Cte(i);return c||{}}function DA(i){i.store.invalidateAll();let c=[];for(let T of Wu(i)){let D=oA(T,i);if(D&&Object.keys(D).length>0)c.push({source:T,settings:D})}return{effective:bte(i),sources:c}}function LA(i,c){let T=Wu(c);for(let D=T.length-1;D>=0;D--){let w=T[D];if(oA(w,c)?.[i]!==void 0)return w}return null}var xA=Object.freeze({settings:{},errors:[],loadState:"absent"}),Ar=Object.freeze({settings:{},errors:[]});class NA{mdm=null;hkcu=null;wslInherits=!1;whereAsked=void 0;readOutcomes=null;unansweredReadsInARow=0;lastAnswered=null;seatedWithNoAnswer=void 0;heldSince=void 0;loadPromise=null;sdkReread={lastReadAt:0,inFlight:void 0,lossSeen:""};reread={failedFor:void 0,failedAt:0,inFlight:void 0,startedAt:0};startLoad(i){if(this.loadPromise)return;this.loadPromise=(async()=>{let c=Date.now(),D=await(Dp()??Wi()),{mdm:w,hkcu:x,wslInherits:U,whereAsked:B}=await ec(D,i);this.replace(w,x,U,B,D.outcomes),this.readOutcomes=D.outcomes;let z=Date.now()-c;t(`MDM settings load completed in ${z}ms`);try{ae("tengu_managed_settings_os_read",$te(D,z))}catch{}let le=Ds();if(Object.keys(le.settings).length>0){t(`MDM settings found: ${Object.keys(le.settings).join(", ")}`);try{Fs("info","mdm_settings_loaded",{duration_ms:z,key_count:Object.keys(w.settings).length,error_count:w.errors.length})}catch{}}})()}replace(i,c,T,D,w){if(this.mdm=i,this.hkcu=c,this.wslInherits=T,this.whereAsked=D,this.sdkReread.lossSeen="",w===void 0)return;this.sdkReread.lastReadAt=Date.now();let x={mdm:i,hkcu:c,wslInherits:T,whereAsked:D};if((w.hklm===null||w.hklm.answered)&&!tc(x).mdm.errors.some((B)=>B.errorClass==="unreadable"&&B.errno===void 0&&B.userWritable!==!0))this.unansweredReadsInARow=0,this.lastAnswered=x,this.seatedWithNoAnswer=void 0;else this.unansweredReadsInARow++,this.seatedWithNoAnswer=i}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.whereAsked=void 0,this.readOutcomes=null,this.unansweredReadsInARow=0,this.lastAnswered=null,this.seatedWithNoAnswer=void 0,this.heldSince=void 0,this.loadPromise=null,this.sdkReread={lastReadAt:0,inFlight:void 0,lossSeen:""},this.reread={failedFor:void 0,failedAt:0,inFlight:void 0,startedAt:0}}}var IA="@builtin",Lte=["prependPlugins","appendPlugins"];function Ite(i){return typeof i==="object"&&i!==null&&!Array.isArray(i)}var wte=new s(()=>new NA);function Ls(){return wte.of(A().host)}function Pte(i){Ls().startLoad(i)}async function xte(){let i=Ls();if(!i.loadPromise)Pte();await i.loadPromise}var Nte=1800000,vte=1000,kte=30000;function Mte(i,c){let{mdm:T}=tc(i),D={...Ds().settings,...Ni().settings},w=i.readOutcomes?.hklm??null,x=w===null||w.answered||c&&!Gi(w),U=i.readOutcomes?.hkcu??null,B=U===null||U.answered||co(T)||Object.keys(Ni().settings).length===0;return i.readOutcomes!==void 0&&x&&B&&(!Dr()&&!co(Ds())&&Object.keys(D).length===0||T.loadState!=="didNotLoad"&&!T.errors.some((z)=>z.severity!=="warning"&&z.userWritable!==!0))}function Ute(i){let c=tc(i),T=Ds(),D={...T.settings,...Ni().settings},w={...c.mdm.settings,...c.hkcu.settings};return[!co(c.mdm)&&(co(T)||Object.keys(D).length>0&&Object.keys(w).length===0)&&"all policy",T.plist===pc&&c.mdm.plist!==T.plist&&"the per-user plist",!c.wslInherits&&sp()&&"WSL's inheriting"].filter(Boolean).join()}async function vA(){await xte();let i=Ls(),{sdkReread:c,unansweredReadsInARow:T}=i;if(c.inFlight===void 0){let D=T>=1&&T<=4,w=c.lossSeen?kte:!D?Nte:T===1?0:hp,x=Date.now()-c.lastReadAt;if(x>=0&&x<w)return;let U="",B=(async()=>{try{let z=await Bte();if(Mte(z,i.lastAnswered===null)){let le=Ute(z);if(le===""||le===c.lossSeen){i.replace(z.mdm,z.hkcu,z.wslInherits,z.whereAsked,z.readOutcomes),i.readOutcomes=z.readOutcomes;return}if(!D){U=le;return}}t("MDM re-read for resolveSettings was not taken: the reading in force stays")}catch(z){t(`MDM re-read for resolveSettings failed (${r(z)??(z instanceof Error?z.name:typeof z)})`,{level:"error"})}Fte()})().finally(()=>{c.lossSeen=U,c.lastReadAt=Date.now(),c.inFlight=void 0});c.inFlight=he(B,vte)}if(T<=1)await c.inFlight}function Ds(){if(Sc())return xA;return rp().mdm}function rp(){return Hte()}function Hte(){let{mdm:i,hkcu:c,wslInherits:T}=tc(Ls());return{mdm:i??xA,hkcu:c??Ar,wslInherits:T}}function tc(i){return i.whereAsked!==void 0&&Da()?i.whereAsked:i}function kA(){return Ls().readOutcomes?.hklm??null}function Ni(){if(Sc())return Ar;return rp().hkcu}function sp(){return rp().wslInherits}function Fte(){Ls().unansweredReadsInARow++}async function Bte(i){let c=await Wi(!0);return{...await ec(c,i),readOutcomes:c.outcomes}}function xi(i,c,{userWritable:T=!1}={}){let D=ir(i,!1);if(!n(D))return{settings:{},errors:[ql(c,{userWritable:T})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let w=[],x=D;for(let Re of T?Zl:[]){if(!(Re in x))continue;if(x=x===D?{...D}:x,delete x[Re],!nr(Re))w.push({file:c,path:Re,message:`"${Re}" is only honored from administrator-controlled managed settings and was ignored in ${c}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(T){for(let xe of Lte){if(!(xe in x))continue;x=x===D?{...D}:x,delete x[xe],w.push({file:c,path:xe,message:`"${xe}" is only honored from administrator-controlled managed settings and was ignored in ${c}, which the user account can write.`,severity:"warning",statusOnly:!0})}let Re=x.enabledPlugins;if(Ite(Re)){if(Object.entries(Re).filter(([Te,Ke])=>Te.endsWith(IA)||Ke!==!1).length>0){x=x===D?{...D}:x;let Te=Vr(Re,(Ke,Le)=>!Le.endsWith(IA)&&Ke===!1);if(Object.keys(Te).length>0)x.enabledPlugins=Te;else delete x.enabledPlugins;w.push({file:c,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 ${c}, which the user account can write.`,severity:"warning",statusOnly:!0})}}}let{settings:U,errors:B,documentHasPolicyContent:z,loadState:le,onlySubstitutes:fe}=Cs(x,c),Ce=[...w,...B];return{settings:U??{},errors:T?Ce.map((Re)=>({...Re.severity==="warning"&&!Re.startupFatal?Re:{...zte(Re),severity:"warning",statusOnly:!0},userWritable:!0})):Ce,documentHasPolicyContent:z,loadState:le,...fe&&{onlySubstitutes:fe}}}function zte({startupFatal:i,loadedWithoutGuardHook:c,...T}){return T}function tp(i,c,T,D){return{file:i,path:"",message:`Managed settings document (${i}) could not be read: ${c}; none of its settings are in effect.`,severity:T?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...D.errno!==void 0&&{errno:D.errno},...D.cause!==void 0&&{unreadCause:D.cause},...T&&{userWritable:!0}}}function Ql(i,c="Settings"){let T=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),D=new RegExp(`^[ \\t]+${T}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),w=i.match(D)?.[1]?.trimEnd();return w?w:null}var Gte=new Map([["ENOENT",k("ENOENT")],["EACCES",k("EACCES")],["EPERM",k("EPERM")],["ENOEXEC",k("ENOEXEC")],["EAGAIN",k("EAGAIN")],["EMFILE",k("EMFILE")],["ENOMEM",k("ENOMEM")],["ETIMEDOUT",k("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",k("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),Wte=new Map([["SIGTERM",k("SIGTERM")],["SIGKILL",k("SIGKILL")],["SIGINT",k("SIGINT")]]);function Kte(i){if(!i)return;return Gte.get(i)??k("other")}function jte(i){if(!i)return;return Wte.get(i)??k("other")}function wA(i,c){if(!c)return{};return{[`${i}_status`]:ee(c.status),[`${i}_exit_code`]:c.exitCode??void 0,[`${i}_errno`]:Kte(c.errno),[`${i}_signal`]:jte(c.signal),[`${i}_duration_ms`]:c.durationMs}}function $te(i,c){return{is_wsl:Dr(),await_ms:c,...wA("hklm",i.outcomes.hklm),...wA("hkcu",i.outcomes.hkcu)}}async function ec(i,c,T=!1){let D=[],w=!1,x="absent";for(let Pe of i.plistStdouts??[]){let{label:nt,userWritable:et}=Pe;if(et&&w)continue;let rt=Pe.stdout===null?{settings:{},errors:[tp(nt,Pe.unreadReason,et,{errno:Pe.unreadErrno,cause:Pe.unreadCause})],documentHasPolicyContent:!1,loadState:"didNotLoad",...et&&{userWritable:et}}:{...xi(Pe.stdout,nt,{userWritable:et}),...et&&{userWritable:et}};if(et?Rs(rt.settings):rt.documentHasPolicyContent)return{mdm:{...rt,errors:[...D,...rt.errors],documentHasPolicyContent:!0,plist:nt},hkcu:Ar,wslInherits:!1};if(w||=co(rt),D.push(...rt.errors),!et)x=lo(x,rt.loadState)}let U=`Registry: ${Hi}\\${xs}`,B=null,z="disarmed",le=`Registry: ${Fi}\\${xs}`;if(!T&&(i.hklmStdout!==null||i.hklmUnreadReason!==void 0||i.hkcuStdout!==null)&&process.platform!=="win32"&&uc()){let[Pe,nt]=await Promise.all([No,Dte(No)].map((rt)=>Tte(rt).then(({uid:At,gid:ht,mode:ct})=>({uid:At,gid:ht,mode:ct}),()=>{return}))),et=!0;try{et=$u(new ge,No,Pe,nt)}catch(rt){t(`registry tool: could not be asked about, held: ${rt}`,{level:"error"})}if(et){let rt=[];if(i.hklmStdout!==null)rt.push([U,xi(Ql(i.hklmStdout)??"",U)]);else if(i.hklmUnreadReason!==void 0)rt.push([U,{settings:{},errors:[tp(U,i.hklmUnreadReason,!1,{cause:"oversize"})],documentHasPolicyContent:!1,loadState:"didNotLoad"}]);if(i.hkcuStdout!==null)rt.push([le,xi(Ql(i.hkcuStdout)??"",le,{userWritable:!0})]);let At=await ec(i,c,!0),ht=await ec({...i,hklmStdout:null,hklmUnreadReason:void 0,hkcuStdout:null},c,!0);return{...At,whereAsked:{...ht,mdm:{...ht.mdm,heldDocuments:rt.map(([ct,Tt])=>({path:ct,parsed:{...Tt,settings:Tt.loadState==="loaded"?Tt.settings:null},...ct===le&&{userWritable:!0}}))}}}}}if(i.hklmStdout!==null){let Pe=Ql(i.hklmStdout)??"";B=xi(Pe,U);let nt=ir(Pe,!1);if(n(nt))z=Xd(nt)}else if(i.hklmUnreadReason!==void 0)B={settings:{},errors:[tp(U,i.hklmUnreadReason,!1,{cause:"oversize"})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let fe=B!==null&&co(B);if(B)D.push(...B.errors),x=lo(x,B.loadState);let Ce=Dr(),Re="disarmed",xe=U,Te=[];if(Ce){if(Re=z,Re!=="armed"){let Pe=await Yte(c);if(Te=Pe.links,Pe.flag==="armed"||Re==="disarmed")Re=Pe.flag,xe=Pe.unreadableFlagPath??yn;if(Re==="disarmed")D.push(...Pe.records),x=lo(x,Pe.loadState)}}let Ke=Re!=="disarmed",Le={settings:{},errors:D,loadState:x};if(Ce&&!Ke){let Pe=new Set(B?.errors.filter((nt)=>nt.severity==="warning"));return{mdm:{...Le,errors:Le.errors.map((nt)=>Pe.has(nt)?{...nt,wslIgnored:!0}:nt),...Te.length>0&&{managedDocumentLinks:Te}},hkcu:Ar,wslInherits:!1}}if(B&&fe)return{mdm:B,hkcu:Ar,wslInherits:Ke};if(Re==="unreadable"){let Pe=await op(yn,c),nt=qO(xe);return{mdm:{...Le,errors:Pe?Le.errors:[...Le.errors,nt],...Pe&&{withheldFlagRecord:nt},documentHasPolicyContent:!0,loadState:lo(Le.loadState,"loaded")},hkcu:Ar,wslInherits:Ke}}if(i.hkcuStdout!==null&&!g()&&!await Vte(Ke,c)){let Pe=xi(Ql(i.hkcuStdout)??"",le,{userWritable:!0});if(!Ce||Pe.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:nt,managedSourcesBehavior:et,...rt}=Pe.settings;return{mdm:Le,hkcu:{settings:rt,errors:Pe.errors},wslInherits:Ke}}if(Pe.errors.length>0)return{mdm:Le,hkcu:{settings:{},errors:Pe.errors},wslInherits:Ke}}return{mdm:Le,hkcu:Ar,wslInherits:Ke}}async function MA(i,c){if(u()&&c!==void 0)return(await xc(i,Ii)).content;return Ko(i,Ii)}async function Vte(i,c){if(i&&await op(yn,c))return!0;return op($o(),c)}async function PA(i,c){let T;try{T=await MA(i,c)}catch(D){return!_(D)}try{let D=jl(T,i,!0);return co({...D,loadState:Po(D)})}catch{return!0}}function np(i){let c=r(i);return c==="ENOENT"||c==="ENOTDIR"}async function Yte(i){let c=[],T="absent",D=[],w=new Map;async function x(Ce,Re){let xe=Cr(yn,...Ce),Te;try{Te=await MA(xe,i)}catch(Pe){if(np(Pe))return"disarmed";c.push(wi(xe,Pe)),T="didNotLoad"}let Ke=await Gm(yn,Ce,Re,w);if(Ke!==null)D.push({link:Ke,read:Te!==void 0});if(Te===void 0)return"disarmed";let Le=Te.trim()===""?{}:ir(Te,!1);if(!n(Le))return c.push(ql(xe)),T="didNotLoad","disarmed";return T=lo(T,"loaded"),Xd(Le)}let U=Cr(yn,"managed-settings.json"),B=await x(["managed-settings.json"]);if(B==="armed")return{flag:B,records:c,loadState:T,links:D};let z=B==="unreadable"?U:void 0,le=Cr(yn,"managed-settings.d"),fe;try{fe=await l().readdir(le)}catch(Ce){if(!np(Ce))c.push(wi(le,Ce,"directory")),T="didNotLoad";return{flag:B,unreadableFlagPath:z,records:c,loadState:T,links:D}}for(let Ce of fe){if(!(Ce.isFile()||Ce.isSymbolicLink())||!Ce.name.endsWith(".json")||Ce.name.startsWith("."))continue;let Re=await x(["managed-settings.d",Ce.name],Ce.isSymbolicLink());if(Re==="armed")return{flag:Re,records:c,loadState:T,links:D};if(Re==="unreadable")B=Re,z??=Cr(le,Ce.name)}return{flag:B,unreadableFlagPath:z,records:c,loadState:T,links:D}}async function op(i,c){if(await PA(Cr(i,"managed-settings.json"),c))return!0;let T=Cr(i,"managed-settings.d"),D;try{D=await l().readdir(T)}catch(w){return!np(w)}for(let w of D)if((w.isFile()||w.isSymbolicLink())&&ju(w.name)&&await PA(Cr(T,w.name),c))return!0;return!1}function UA(i){if(!Object.hasOwn(i,ln))return{tier:i,organization:null,memberLost:!1};let{[ln]:c,...T}=i;return{tier:T,organization:null,memberLost:!1}}var Jte={user:"userSettings",project:"projectSettings",local:"localSettings"},HA={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},Zte=["user","project","local"];async function xxe(i={}){await vA();let c=i.managedSettings&&UA(i.managedSettings),T={store:new ge,cwd:Xte(i.cwd??l().cwd()),allowedSources:(i.settingSources??Zte).map((fe)=>Jte[fe]),diskless:g(),parentManaged:c?.tier??null,parentOrganizationSettings:c?.organization,flagInline:null,flagPath:void 0,mdm:Ds,hkcu:Ni,wslInherits:sp,credentialHelperKeysFrom:()=>"as_read",asksOrganization:()=>Da(),...i.serverManagedSettings!==void 0&&{remote:()=>i.serverManagedSettings}},{effective:D,sources:w}=DA(T),x=aA(T)??void 0,U=w.map(({source:fe,settings:Ce})=>({source:HA[fe],settings:Ce,path:fe==="policySettings"?void 0:Or(fe,T),...fe==="policySettings"&&{policyOrigin:x}})),B={};for(let fe of Object.keys(D)){let Ce=LA(fe,T);if(Ce)B[fe]={source:HA[Ce],path:Ce==="policySettings"?void 0:Or(Ce,T),...Ce==="policySettings"&&{policyOrigin:x}}}let z=kA(),le=[];if(hA(T))le.push(z===null?"profile":"registry");else if(z!==null&&Gi(z))le.push("registry");if(EA(T))le.push("file");return{effective:D,provenance:B,sources:U,machinePolicy:{didNotLoad:le.length>0&&le}}}export{xxe as resolveSettingsForSdk};