UNPKG

@anthropic-ai/claude-agent-sdk

Version:

SDK for building AI agents with Claude Code's capabilities. Programmatically interact with Claude to build autonomous agents that can understand codebases, edit files, and execute workflows.

44 lines • 554 kB
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.

// Version: 0.3.314

//! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.
if (typeof Symbol.dispose !== 'symbol') {
  try {
    Symbol.dispose = Symbol.for('Symbol.dispose')
  } catch {}
}
if (typeof Symbol.asyncDispose !== 'symbol') {
  try {
    Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
  } catch {}
}
import{k,Gt,m,h,c,s,o,U,a,pt,ft,Ge,Y,le,S,d,b,F,gt,u,r,g,T,p,ye,H,q,ht,J,$e,D,B,xe,ve,be,X,St,C,M,_t,Et,yt,bt,f,Ve,N,Ce,K,Ye,ee,de,Ct,Ae,De,Rt,Pe,R,Je,Re,te,Xe,ue,y,pe,vt,Me,n,_,w,Ze,Qe,P,Ne,et,fe,Ue,ge,Dt,i,tt,I,Pt,me,j,he,Oe,e,re,Fe,Se,E,Q,O,oe,G,t,se,ot,Ut,ie,V,dt,Bt,Kt,ut}from"./core-a9vq6p1m.mjs";import{_e}from"./core-bb8r6h44.mjs";var ri={};k(ri,{default:()=>vn});var ii={};k(ii,{default:()=>Mn});var tl={};k(tl,{AGENT_PROXY_AUTH_TOKEN:()=>FR,ANTHROPIC_API_KEY:()=>TR,ANTHROPIC_AUTH_TOKEN:()=>DR,ANTHROPIC_AWS_API_KEY:()=>wR,ANTHROPIC_FEDERATION_RULE_ID:()=>DT,ANTHROPIC_FOUNDRY_API_KEY:()=>PR,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>xR,ANTHROPIC_ORGANIZATION_ID:()=>IT,ANTHROPIC_PROFILE:()=>PT,ANTHROPIC_WORKSPACE_ID:()=>wT,AWS_BEARER_TOKEN_BEDROCK:()=>IR,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>MR,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>vR,AWS_ROLE_ARN:()=>kR,AWS_WEB_IDENTITY_TOKEN_FILE:()=>NR,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>NT,CLAUDE_CODE_ACCOUNT_UUID:()=>xT,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>WR,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>_T,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>gT,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>TT,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>qR,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>JR,CLAUDE_CODE_DISABLE_LAUNCHER_SIGN_IN:()=>nT,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>ET,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>LT,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>KR,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>HR,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>sT,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>rT,CLAUDE_CODE_HOST_CREDS_FILE:()=>iT,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>mT,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>XR,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>YR,CLAUDE_CODE_OAUTH_SCOPES:()=>ZR,CLAUDE_CODE_OAUTH_TOKEN:()=>LR,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>jR,CLAUDE_CODE_ORGANIZATION_UUID:()=>kT,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>hT,CLAUDE_CODE_RATE_LIMIT_TIER:()=>UT,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>oT,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>QR,CLAUDE_CODE_SDK_HAS_SESSIONS_OAUTH_REFRESH:()=>eT,CLAUDE_CODE_SESSIONS_OAUTH_TOKEN:()=>tT,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>aT,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>AT,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>CT,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>RT,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>ST,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>OT,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>bT,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>yT,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>MT,CLAUDE_CODE_USER_EMAIL:()=>vT,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>$R,CLAUDE_LOCAL_OAUTH_API_BASE:()=>uT,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>pT,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>fT,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>VR,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>lT,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>UR,ENVIRONMENT_SERVICE_KEY:()=>BR,MCP_CLIENT_SECRET:()=>zR,MCP_XAA_IDP_CLIENT_SECRET:()=>GR,USE_LOCAL_OAUTH:()=>cT,USE_STAGING_OAUTH:()=>dT});var nl={};k(nl,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>VD,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>BD,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>zD,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>GD,ANT_OTEL_LOGS_EXPORTER:()=>WD,ANT_OTEL_METRICS_EXPORTER:()=>jD,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>$D,ANT_OTEL_TRACES_EXPORTER:()=>KD,BETA_TRACING_ENDPOINT:()=>YD,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>tD,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>lD,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>iD,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>aD,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>zT,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>BT,CLAUDE_CODE_DEBUG_REPAINTS:()=>GT,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>WT,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>nD,CLAUDE_CODE_FRAME_TIMING_LOG:()=>XT,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>JT,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>ND,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>cD,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>oD,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>sD,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>rD,CLAUDE_CODE_PERFETTO_TRACE:()=>VT,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>YT,CLAUDE_CODE_PROFILE_STARTUP:()=>$T,CLAUDE_CODE_SESSION_LOG:()=>ZT,CLAUDE_CODE_TEE_SDK_STDOUT:()=>eD,CLAUDE_CODE_TERMINAL_RECORDING:()=>QT,CLAUDE_DEBUG:()=>HT,CLAUDE_PTY_RECORD:()=>qT,DEBUG:()=>FT,DEBUG_CLAUDE_AGENT_SDK:()=>jT,DEBUG_SDK:()=>KT,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>wD,OTEL_EXPORTER_OTLP_ENDPOINT:()=>fD,OTEL_EXPORTER_OTLP_HEADERS:()=>mD,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>_D,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>ED,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>hD,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>SD,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>yD,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>OD,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>AD,OTEL_EXPORTER_OTLP_PROTOCOL:()=>gD,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>CD,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>bD,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>RD,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>PD,OTEL_LOGS_EXPORTER:()=>uD,OTEL_LOGS_EXPORT_INTERVAL:()=>DD,OTEL_LOG_ASSISTANT_RESPONSES:()=>vD,OTEL_LOG_MANAGED_SETTINGS:()=>HD,OTEL_LOG_RAW_API_BODIES:()=>FD,OTEL_LOG_TOOL_CONTENT:()=>MD,OTEL_LOG_TOOL_DETAILS:()=>UD,OTEL_LOG_USER_PROMPTS:()=>kD,OTEL_METRICS_EXPORTER:()=>dD,OTEL_METRIC_EXPORT_INTERVAL:()=>TD,OTEL_RESOURCE_ATTRIBUTES:()=>ID,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>xD,OTEL_TRACES_EXPORTER:()=>pD,OTEL_TRACES_EXPORT_INTERVAL:()=>LD});var rl={};k(rl,{CLAUDE_AX_ANNOUNCEMENT_HOLD_MS:()=>AL,CLAUDE_AX_PREPARK_MS:()=>OL,CLAUDE_AX_REWRITE_HELD_ANNOUNCEMENT:()=>CL,CLAUDE_AX_SCREEN_READER:()=>SL,CLAUDE_AX_STARTUP_QUIET_MS:()=>yL,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>bL,CLAUDE_CODE_ACCESSIBILITY:()=>EP,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>hP,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>TL,CLAUDE_CODE_AMBER_ASTROLABE:()=>Fw,CLAUDE_CODE_ARTIFACT_ASK_FIRST:()=>sx,CLAUDE_CODE_ARTIFACT_ASSETS:()=>VP,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>LP,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>IP,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>PP,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>xP,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>wP,CLAUDE_CODE_ARTIFACT_DB:()=>NP,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>kP,CLAUDE_CODE_ARTIFACT_DELETE:()=>MP,CLAUDE_CODE_ARTIFACT_FRESH_READ:()=>nx,CLAUDE_CODE_ARTIFACT_HOT:()=>XP,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>YP,CLAUDE_CODE_ARTIFACT_OPENING_PREFETCH:()=>ox,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>FP,CLAUDE_CODE_ARTIFACT_PATH_PIN:()=>JP,CLAUDE_CODE_ARTIFACT_PIN:()=>BP,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>$P,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>UP,CLAUDE_CODE_ARTIFACT_PREVIEW_EMULATOR:()=>HP,CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS:()=>ZP,CLAUDE_CODE_ARTIFACT_QUICKSTART:()=>tx,CLAUDE_CODE_ARTIFACT_REPL:()=>vP,CLAUDE_CODE_ARTIFACT_ROOM:()=>KP,CLAUDE_CODE_ARTIFACT_SHARE:()=>zP,CLAUDE_CODE_ARTIFACT_SHARE_PROBE_REUSE_MS:()=>GP,CLAUDE_CODE_ARTIFACT_START_KIT:()=>rx,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>qP,CLAUDE_CODE_ARTIFACT_TYPES:()=>QP,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>ex,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>ix,CLAUDE_CODE_ARTIFACT_VERIFY:()=>ax,CLAUDE_CODE_ARTIFACT_VERSIONS:()=>jP,CLAUDE_CODE_ATTACHMENTS_IN_USER_DATA:()=>Rx,CLAUDE_CODE_ATTRIBUTION_ANNOUNCEMENT:()=>SP,CLAUDE_CODE_AUTOUPDATER_DISABLED_BY_HOST:()=>Uk,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>lx,CLAUDE_CODE_AUTO_MODE_SERVER:()=>cx,CLAUDE_CODE_BASALT_COVE:()=>ML,CLAUDE_CODE_BASH_EDIT_DIFF:()=>NL,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>TP,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>dx,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>YL,CLAUDE_CODE_BISON_CAIRN:()=>Bw,CLAUDE_CODE_BREEZY_HORIZON:()=>UL,CLAUDE_CODE_BUBBLEWRAP:()=>ux,CLAUDE_CODE_CALM_MOCHI:()=>dP,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>px,CLAUDE_CODE_CCR_EARLY_PLUGINS_SYNC:()=>Sx,CLAUDE_CODE_CCR_EARLY_REMOTE_CONNECT:()=>fx,CLAUDE_CODE_CCR_EARLY_SKILLS_SYNC:()=>yx,CLAUDE_CODE_CCR_EARLY_SYNC_AFTER_SETTINGS_REFUSAL:()=>Ox,CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCAN:()=>Ax,CLAUDE_CODE_CCR_LONG_POLL:()=>_x,CLAUDE_CODE_CCR_OWN_CONNECTION_POOL:()=>gx,CLAUDE_CODE_CCR_SKIP_FRESH_MIGRATIONS:()=>bx,CLAUDE_CODE_CCR_WORKER_SOCKET:()=>mx,CLAUDE_CODE_CHILD_SESSION:()=>Dx,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>Ix,CLAUDE_CODE_COLD_COMPACT:()=>wx,CLAUDE_CODE_CONSENT_POINTERLESS:()=>DL,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>XL,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>qL,CLAUDE_CODE_COZY_TEAPOT:()=>kL,CLAUDE_CODE_CURRIED_TRINKET:()=>vL,CLAUDE_CODE_DAPPER_CUPCAKE:()=>$L,CLAUDE_CODE_DESKTOP_CONNECTOR_NAMES:()=>tI,CLAUDE_CODE_DESKTOP_SKILL_SWITCHES:()=>eI,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>aI,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>sI,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>lI,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>cI,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>dI,CLAUDE_CODE_DISABLE_ARTIFACT:()=>uI,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>pI,CLAUDE_CODE_DISABLE_ATTRIBUTION_CROSS_REPO:()=>fI,CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK:()=>mI,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>gI,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>_I,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>EI,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>SI,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>yI,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>OI,CLAUDE_CODE_DISABLE_BG_STABLE_PATH:()=>AI,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>CI,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>bI,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>RI,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>TI,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>DI,CLAUDE_CODE_DISABLE_CRON:()=>LI,CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT:()=>II,CLAUDE_CODE_DISABLE_EMPTY_CLASSIC_DISPATCH_SKIP:()=>xI,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>wI,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>NI,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>kI,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>MI,CLAUDE_CODE_DISABLE_FILE_MENTIONS:()=>UI,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>HI,CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT:()=>fw,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>FI,CLAUDE_CODE_DISABLE_LONE_SEC_DEFAULT_SHORTCUT:()=>BI,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>hI,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>zI,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>GI,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>WI,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>jI,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>KI,CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT:()=>gw,CLAUDE_CODE_DISABLE_MOUSE:()=>YI,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>XI,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>JI,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>ZI,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>qI,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>QI,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>ew,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>tw,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>nw,CLAUDE_CODE_DISABLE_OTEL_EVENT_SKIP:()=>ow,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>$I,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>rw,CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY:()=>sw,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>iw,CLAUDE_CODE_DISABLE_PROACTIVITY:()=>aw,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>lw,CLAUDE_CODE_DISABLE_REFUSAL_RETRY:()=>cw,CLAUDE_CODE_DISABLE_RESPONSE_COMPARISON:()=>vI,CLAUDE_CODE_DISABLE_STARTUP_WORK_GATE:()=>hw,CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS:()=>PI,CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT:()=>pw,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>Sw,CLAUDE_CODE_DISABLE_THINKING:()=>Ow,CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK:()=>Ew,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>Aw,CLAUDE_CODE_DISABLE_WEB_FETCH:()=>Cw,CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER:()=>HN,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>bw,CLAUDE_CODE_EDITOR_CODELIVERY:()=>JL,CLAUDE_CODE_ELEGANT_MEADOW:()=>VL,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>Tw,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>Dw,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>Lw,CLAUDE_CODE_ENABLE_CFC:()=>Iw,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>ww,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>Pw,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>xw,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>Nw,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>kw,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>vw,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>$w,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>Vw,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>Yw,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>Xw,CLAUDE_CODE_ENABLE_SHARE_BUNDLE:()=>Jw,CLAUDE_CODE_ENABLE_TASKS:()=>Zw,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>qw,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>Qw,CLAUDE_CODE_ENABLE_XAA:()=>eP,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>bN,CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS:()=>_w,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>Px,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>xx,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>Mw,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>Bx,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>Ux,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>Hx,CLAUDE_CODE_FORCE_TERMINAL_IMAGES:()=>Fx,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>Gx,CLAUDE_CODE_FORK_SUBAGENT:()=>Nx,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>Wx,CLAUDE_CODE_FORWARD_USER_INTENT:()=>ZL,CLAUDE_CODE_GATEWAY_HINT_HEADERS:()=>BN,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>Uw,CLAUDE_CODE_GENTLE_PARASOL:()=>PL,CLAUDE_CODE_GLOB_HIDDEN:()=>kx,CLAUDE_CODE_GLOB_NO_IGNORE:()=>vx,CLAUDE_CODE_GORSE_PLOVER:()=>Gw,CLAUDE_CODE_GROWTHBOOK_KICK_FROM_INIT:()=>Ex,CLAUDE_CODE_GROWTHBOOK_KICK_ON_WARM_CACHE:()=>hx,CLAUDE_CODE_HARBOR_KITE:()=>tP,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>oP,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>nP,CLAUDE_CODE_HARMONIC_RIDDLE:()=>cP,CLAUDE_CODE_HIDE_CWD:()=>Mx,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>Wk,CLAUDE_CODE_HOST_GUARDS_ARTIFACTS_MCP:()=>WP,CLAUDE_CODE_HOST_SCHEDULED_RUN:()=>QL,CLAUDE_CODE_HOVER_REST:()=>Hw,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>zL,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>jx,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>Kx,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>$x,CLAUDE_CODE_INLINE_TOOLS:()=>zx,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>Kw,CLAUDE_CODE_KB_COHESION_FIXES:()=>_P,CLAUDE_CODE_LANTERN_PRISM:()=>rP,CLAUDE_CODE_LARCH_CISTERN:()=>zw,CLAUDE_CODE_MANAGED_CONFIG_PREFETCH:()=>Tx,CLAUDE_CODE_MCP_REGISTRY_FETCH_AT_STARTUP:()=>Cx,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>VI,CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL:()=>xk,CLAUDE_CODE_MODEL_CAPABILITIES:()=>yP,CLAUDE_CODE_NANKEEN_KESTREL:()=>iI,CLAUDE_CODE_NATIVE_CURSOR:()=>Vx,CLAUDE_CODE_NEW_INIT:()=>Yx,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>Jx,CLAUDE_CODE_NO_FLICKER:()=>Xx,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>Zx,CLAUDE_CODE_PARSED_WILLOW:()=>jL,CLAUDE_CODE_PEWTER_OWL:()=>zN,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>GN,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>qx,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>kN,CLAUDE_CODE_PLUGIN_DIRS:()=>Kk,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>jk,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>NN,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>MN,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>vN,CLAUDE_CODE_POLISHED_DEWDROP:()=>FL,CLAUDE_CODE_POLL_EVENTS:()=>Qx,CLAUDE_CODE_POLL_EVENT_DECLARATIONS:()=>eN,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>UN,CLAUDE_CODE_PROACTIVE:()=>tN,CLAUDE_CODE_PROJECTS_SESSION:()=>xN,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>wk,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>FN,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>dw,CLAUDE_CODE_REMOTE_TOOLS_FORWARD:()=>$k,CLAUDE_CODE_REMOTE_TOOLS_HOST_ALLOWS_UNATTENDED:()=>oI,CLAUDE_CODE_REMOTE_TOOLS_HOST_IDLE_RELEASE_MINUTES:()=>rI,CLAUDE_CODE_REMOTE_TOOLS_PIN_STORED_LOGIN:()=>nI,CLAUDE_CODE_REMOVE_PROMPT_STRINGS:()=>Ww,CLAUDE_CODE_REPORT_FINDINGS:()=>uw,CLAUDE_CODE_RIPPLING_TULIP:()=>lP,CLAUDE_CODE_RUSTLING_PIXEL:()=>BL,CLAUDE_CODE_SANDBOX_LEAVE_DENIES_TO_SRT_WIN:()=>nN,CLAUDE_CODE_SANDBOX_LEAVE_PARENT_FOLDERS_ALONE:()=>oN,CLAUDE_CODE_SEND_FEEDBACK:()=>yw,CLAUDE_CODE_SESSION_ATTENDED:()=>Lx,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>AP,CLAUDE_CODE_SILENT_TURN_REMINDER_SECONDS:()=>bP,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>RP,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>CP,CLAUDE_CODE_SKILL_PROPOSALS:()=>rN,CLAUDE_CODE_SKIP_PLUGIN_LOCAL_MCP_SERVERS:()=>sN,CLAUDE_CODE_SKIP_PLUGIN_MCP_BUNDLES:()=>iN,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>aN,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>lN,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>cN,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>dN,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>uN,CLAUDE_CODE_SNAPPY_PELICAN:()=>HL,CLAUDE_CODE_STELLAR_DRIFT:()=>GL,CLAUDE_CODE_STREAMED_BUMBLEBEE:()=>uP,CLAUDE_CODE_STREAMED_BUMBLEBEE_TEXT:()=>pP,CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT:()=>mw,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>pN,CLAUDE_CODE_SUBAGENT_CONFIG_WARNING:()=>fP,CLAUDE_CODE_SUBAGENT_HISTORY:()=>mP,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>Pk,CLAUDE_CODE_SUBAGENT_PROMPT_SNAPSHOT:()=>fN,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>mN,CLAUDE_CODE_SYNC_PLUGINS:()=>_N,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>gN,CLAUDE_CODE_SYNC_SKILLS:()=>EN,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>hN,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>DP,CLAUDE_CODE_THISTLE_GREBE:()=>LL,CLAUDE_CODE_THRIFTY_SONIC:()=>xL,CLAUDE_CODE_TOASTY_THIMBLE:()=>wL,CLAUDE_CODE_TODO_REMINDER_MODE:()=>sP,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>iP,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>gP,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>aP,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>SN,CLAUDE_CODE_TURN_UPDATES:()=>OP,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>yN,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>ON,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>AN,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>CN,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>TN,CLAUDE_CODE_WEBFETCH_DEADLINE_MS:()=>DN,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>LN,CLAUDE_CODE_WEBSEARCH_CITATIONS:()=>wN,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>IN,CLAUDE_CODE_WEB_FETCH_AGENT:()=>RN,CLAUDE_CODE_WEB_SEARCH_FAST_ARG:()=>PN,CLAUDE_CODE_WHIMSICAL_ELEPHANT:()=>KL,CLAUDE_CODE_WILLOW_TERN:()=>jw,CLAUDE_CODE_WISE_COMET:()=>WL,CLAUDE_CODE_WITTY_DEWDROP:()=>IL,CLAUDE_CODE_WORKFLOWS:()=>Rw,CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS:()=>ZN,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>JN,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>YN,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>XN,CLAUDE_DISABLE_ADOPT:()=>WN,CLAUDE_IMPORT_CONVERSATIONS:()=>jN,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>KN,CLAUDE_RUNNER_DISABLE_TURN_BEGAN_BEFORE_INIT:()=>$N,CLAUDE_WORKFLOW_NAME_ONLY:()=>VN,DISABLE_AUTOUPDATER:()=>QN,DISABLE_AUTO_COMPACT:()=>qN,DISABLE_BRIEF_MODE_STOP_HOOK:()=>ek,DISABLE_BUG_COMMAND:()=>tk,DISABLE_COST_WARNINGS:()=>nk,DISABLE_DOCTOR_COMMAND:()=>ok,DISABLE_ERROR_REPORTING:()=>rk,DISABLE_EXTRA_USAGE_COMMAND:()=>sk,DISABLE_FEEDBACK_COMMAND:()=>ik,DISABLE_GROWTHBOOK:()=>ak,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>lk,DISABLE_INTERLEAVED_THINKING:()=>ck,DISABLE_LOGIN_COMMAND:()=>dk,DISABLE_LOGOUT_COMMAND:()=>uk,DISABLE_PROMPT_CACHING:()=>pk,DISABLE_PROMPT_CACHING_FABLE:()=>_k,DISABLE_PROMPT_CACHING_HAIKU:()=>fk,DISABLE_PROMPT_CACHING_MYTHOS:()=>Ek,DISABLE_PROMPT_CACHING_OPUS:()=>mk,DISABLE_PROMPT_CACHING_SONNET:()=>gk,DISABLE_TELEMETRY:()=>hk,DISABLE_UPDATES:()=>Sk,DISABLE_UPGRADE_COMMAND:()=>yk,EMBEDDED_SEARCH_TOOLS:()=>zk,ENABLE_BETA_TRACING_DETAILED:()=>Ok,ENABLE_CLAUDEAI_MCP_SERVERS:()=>Ak,ENABLE_ENHANCED_TELEMETRY_BETA:()=>Ck,ENABLE_LOCKLESS_UPDATES:()=>bk,ENABLE_LSP_TOOL:()=>Rk,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>Tk,ENABLE_PID_BASED_VERSION_LOCKING:()=>Dk,ENABLE_PROMPT_CACHING_1H:()=>Lk,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>Ik,ENABLE_SESSION_BACKGROUNDING:()=>Nk,ENABLE_SESSION_PERSISTENCE:()=>kk,ENABLE_TOOL_SEARCH:()=>vk,FORCE_AUTOUPDATE_PLUGINS:()=>Mk,FORCE_CODE_TERMINAL:()=>Hk,FORCE_PROMPT_CACHING_5M:()=>Fk,FORCE_VCR:()=>Bk,INK_SCREEN_READER:()=>RL,USE_API_CONTEXT_MANAGEMENT:()=>Gk});var sl={};k(sl,{ALACRITTY_LOG:()=>NM,ALACRITTY_WINDOW_ID:()=>kM,ALLUSERSPROFILE:()=>vv,ANDROID_HOME:()=>uM,ANDROID_SDK_ROOT:()=>pM,APPDATA:()=>Rv,APP_URL:()=>fH,AWS_CA_BUNDLE:()=>qv,AWS_EXECUTION_ENV:()=>eH,AWS_LAMBDA_FUNCTION_NAME:()=>QU,AZURE_FUNCTIONS_ENVIRONMENT:()=>pH,BAT_THEME:()=>hH,BROWSER:()=>uv,BUILDKITE:()=>kU,BUN_CHROME_PATH:()=>EH,BUN_INSTALL:()=>_H,CARGO_HTTP_CAINFO:()=>eM,CDPATH:()=>Xk,CF_PAGES:()=>ZU,CIRCLECI:()=>NU,CLOUDSDK_ACTIVE_CONFIG_NAME:()=>cH,CLOUDSDK_CONFIG:()=>lH,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>Jv,CODER:()=>FU,CODER_WORKSPACE_NAME:()=>BU,CODESPACES:()=>HU,COLORFGBG:()=>_M,COLORTERM:()=>gM,COMPUTERNAME:()=>Av,COMSPEC:()=>nv,CONTAINER_SANDBOX_MOUNT_POINT:()=>Cv,CURL_CA_BUNDLE:()=>Xv,CURSOR_TRACE_ID:()=>QM,ComSpec:()=>rv,ConEmuANSI:()=>$M,ConEmuPID:()=>VM,ConEmuTask:()=>YM,DAYTONA_WS_ID:()=>WU,DEMO_VERSION:()=>bH,DENO_CERT:()=>Qv,DENO_DEPLOYMENT_ID:()=>qU,DISPLAY:()=>pv,DO_NOT_TRACK:()=>EM,DYNO:()=>JU,EDITOR:()=>cv,FORCE_COLOR:()=>mM,GCLOUD_PROJECT:()=>oH,GCM_INTERACTIVE:()=>aU,GH_CONFIG_DIR:()=>uU,GH_ENTERPRISE_TOKEN:()=>EU,GH_HOST:()=>gU,GH_REPO:()=>_U,GH_TOKEN:()=>mU,GITHUB_ACTIONS:()=>AU,GITHUB_ACTION_INPUTS:()=>CU,GITHUB_ACTION_PATH:()=>bU,GITHUB_ACTOR:()=>RU,GITHUB_ACTOR_ID:()=>TU,GITHUB_ENTERPRISE_TOKEN:()=>SU,GITHUB_ENV:()=>yU,GITHUB_EVENT_NAME:()=>DU,GITHUB_EVENT_PATH:()=>LU,GITHUB_REPOSITORY:()=>IU,GITHUB_REPOSITORY_ID:()=>wU,GITHUB_REPOSITORY_OWNER:()=>PU,GITHUB_REPOSITORY_OWNER_ID:()=>xU,GITHUB_TOKEN:()=>hU,GITHUB_WORKSPACE:()=>OU,GITLAB_CI:()=>vU,GITPOD_WORKSPACE_ID:()=>zU,GIT_ASKPASS:()=>iU,GIT_CONFIG_COUNT:()=>lU,GIT_CONFIG_GLOBAL:()=>cU,GIT_CONFIG_NOSYSTEM:()=>iM,GIT_DIR:()=>dU,GIT_SSH_COMMAND:()=>rU,GIT_SSL_CAINFO:()=>sM,GIT_SSL_CAPATH:()=>aM,GIT_TERMINAL_PROMPT:()=>sU,GNOME_TERMINAL_SERVICE:()=>PM,GOOGLE_APPLICATION_CREDENTIALS:()=>rH,GOOGLE_CLOUD_PROJECT:()=>nH,GOOGLE_CLOUD_WORKSTATIONS:()=>GU,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>nM,HEX_CACERTS_PATH:()=>rM,HISTFILE:()=>Gv,HOME:()=>Vk,HOMEDRIVE:()=>wv,HOMEPATH:()=>Pv,HOMESHARE:()=>xv,HTTPLIB2_CA_CERTS:()=>Zv,HUB_CONFIG:()=>pU,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>XM,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>JM,IS_DEMO:()=>CH,IS_SANDBOX:()=>AH,ITERM_SESSION_ID:()=>DM,JAVA_HOME:()=>cM,JAVA_TOOL_OPTIONS:()=>dM,KITTY_WINDOW_ID:()=>LM,KONSOLE_VERSION:()=>IM,KUBERNETES_SERVICE_HOST:()=>gH,K_SERVICE:()=>tH,LANG:()=>mv,LC_ALL:()=>gv,LC_TERMINAL:()=>OM,LC_TIME:()=>_v,LOCALAPPDATA:()=>Tv,MSYSTEM:()=>KM,NETLIFY:()=>XU,NIX_SSL_CERT_FILE:()=>oM,NODE_EXTRA_CA_CERTS:()=>Kv,NODE_OPTIONS:()=>Wv,NODE_PATH:()=>jv,NO_COLOR:()=>fM,NoDefaultCurrentDirectoryInExePath:()=>lv,OneDrive:()=>Dv,OneDriveCommercial:()=>Iv,OneDriveConsumer:()=>Lv,P4PORT:()=>SH,PATH:()=>Yk,PATHEXT:()=>av,PIP_CERT:()=>tM,PLAYWRIGHT_BROWSERS_PATH:()=>yH,PREFIX:()=>Zk,PROGRAMDATA:()=>kv,PROJECT_DOMAIN:()=>$U,PWD:()=>Jk,ProgramData:()=>Nv,ProgramFiles:()=>iv,RENDER:()=>YU,REPL_ID:()=>jU,REPL_SLUG:()=>KU,REQUESTS_CA_BUNDLE:()=>Yv,RUNNER_ENVIRONMENT:()=>UU,RUNNER_OS:()=>MU,SAFEUSER:()=>Mv,SESSIONNAME:()=>UM,SHELL:()=>tv,SPACE_CREATOR_USER_ID:()=>mH,SSH_AUTH_SOCK:()=>oU,SSH_CLIENT:()=>eU,SSH_CONNECTION:()=>tU,SSH_TTY:()=>nU,SSL_CERT_DIR:()=>Vv,SSL_CERT_FILE:()=>$v,STY:()=>HM,SUDO_GID:()=>Sv,SUDO_UID:()=>hv,SUDO_USER:()=>yv,SYSTEMROOT:()=>ov,SystemRoot:()=>sv,TEMP:()=>ev,TERM:()=>hM,TERMINAL:()=>AM,TERMINAL_EMULATOR:()=>CM,TERMINATOR_UUID:()=>bM,TERMUX_VERSION:()=>RM,TERM_PROGRAM:()=>SM,TERM_PROGRAM_VERSION:()=>yM,TILIX_ID:()=>TM,TMP:()=>Qk,TMPDIR:()=>qk,TMUX:()=>FM,TMUX_PANE:()=>BM,TRACEPARENT:()=>RH,TRACESTATE:()=>TH,USER:()=>Ev,USERNAME:()=>Ov,USERPROFILE:()=>bv,USE_BUILTIN_RIPGREP:()=>OH,UV_THREADPOOL_SIZE:()=>lM,VERCEL:()=>VU,VISUAL:()=>dv,VSCODE_GIT_ASKPASS_MAIN:()=>qM,VTE_VERSION:()=>xM,WAYLAND_DISPLAY:()=>fv,WEBSITE_SITE_NAME:()=>dH,WEBSITE_SKU:()=>uH,WEZTERM_PANE:()=>vM,WSL_DISTRO_NAME:()=>WM,WSL_INTEROP:()=>jM,WT_SESSION:()=>MM,XDG_CACHE_HOME:()=>Bv,XDG_CONFIG_HOME:()=>Hv,XDG_DATA_HOME:()=>Fv,XDG_RUNTIME_DIR:()=>Uv,XDG_STATE_HOME:()=>zv,XTERM_VERSION:()=>wM,ZDOTDIR:()=>fU,ZED_TERM:()=>GM,ZELLIJ:()=>zM,__CFBundleIdentifier:()=>ZM,gcloud_project:()=>sH,google_application_credentials:()=>aH,google_cloud_project:()=>iH});var al={};k(al,{AI_AGENT:()=>_z,ALLOW_ANT_COMPUTER_USE_MCP:()=>Ez,ANTHROPIC_CONFIG_DIR:()=>DH,BASH_MAX_OUTPUT_LENGTH:()=>nW,CCR_BYOC_RESOURCE_WATCHDOG_TELEMETRY:()=>FW,CCR_SESSION_PROFILE:()=>hz,CLAUBBIT:()=>Sz,CLAUDECODE:()=>yz,CLAUDE_AFK_COUNTDOWN_MS:()=>oW,CLAUDE_AFK_TIMEOUT_MS:()=>rW,CLAUDE_AFTER_LAST_COMPACT:()=>LH,CLAUDE_AGENTS_SELECT:()=>IH,CLAUDE_AGENT_SDK_CLIENT_APP:()=>wH,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>Oz,CLAUDE_AGENT_SDK_DISABLE_MCP_MANIFESTS:()=>Az,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>Cz,CLAUDE_AGENT_SDK_VERSION:()=>PH,CLAUDE_ARTIFACT_HOST_GRANT:()=>xH,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>sW,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>NH,CLAUDE_AUTO_BACKGROUND_TASKS:()=>bz,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>Rz,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>kH,CLAUDE_BG_AUTO_MEMORY_OFF:()=>GH,CLAUDE_BG_BACKEND:()=>vH,CLAUDE_BG_CARRIED_PROMPTS_SHA256:()=>qH,CLAUDE_BG_CLAIM_AUTH:()=>MH,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>UH,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>HH,CLAUDE_BG_GATEWAY_WITHHELD:()=>BH,CLAUDE_BG_ISOLATION:()=>FH,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>zH,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>WH,CLAUDE_BG_PTY_AUTH:()=>jH,CLAUDE_BG_RENDEZVOUS_SOCK:()=>KH,CLAUDE_BG_RV_AUTH:()=>$H,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>VH,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>YH,CLAUDE_BG_SOURCE:()=>XH,CLAUDE_BG_STARTUP_WEDGE_MS:()=>iW,CLAUDE_BG_TCC_DISCLAIMED:()=>JH,CLAUDE_BG_WORKSPACE_TRUSTED:()=>ZH,CLAUDE_BRIDGE_BASE_URL:()=>QH,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>e0,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>t0,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>Tz,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>Dz,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>n0,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>o0,CLAUDE_BRIDGE_REATTACH_SEQ:()=>aW,CLAUDE_BRIDGE_REATTACH_SESSION:()=>r0,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>s0,CLAUDE_CHROME_PAIRED_DEVICE_ID:()=>i0,CLAUDE_CHROME_PERMISSION_MODE:()=>a0,CLAUDE_CHROME_TAB_GROUP_KEY:()=>l0,CLAUDE_CLIENT_PRESENCE_FILE:()=>c0,CLAUDE_CODE_ACTION:()=>d0,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>u0,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>Lz,CLAUDE_CODE_AGENT:()=>p0,CLAUDE_CODE_AGENT_PROGRESS_SUMMARIES:()=>f0,CLAUDE_CODE_APPEND_PROMPT_HEAD:()=>m0,CLAUDE_CODE_ARTIFACT:()=>g0,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>E0,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>h0,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>S0,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>_0,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>y0,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>O0,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>A0,CLAUDE_CODE_ATTACHMENTS_BY_PATH:()=>C0,CLAUDE_CODE_ATTRIBUTION_PROJECT:()=>b0,CLAUDE_CODE_ATTRIBUTION_STATUS_TIMEOUT_MS:()=>R0,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>D0,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>Iz,CLAUDE_CODE_AUTO_MODE_TIER:()=>wz,CLAUDE_CODE_BASE_REF:()=>L0,CLAUDE_CODE_BASE_REFS:()=>I0,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>w0,CLAUDE_CODE_BRIDGE_CHILD_ARTIFACT:()=>rF,CLAUDE_CODE_BRIDGE_CHILD_AUTO_DEFAULT:()=>oF,CLAUDE_CODE_BRIDGE_CHILD_CLI_ENTRYPOINT:()=>aF,CLAUDE_CODE_BRIDGE_CHILD_MACHINE_SETTINGS:()=>sF,CLAUDE_CODE_BRIDGE_CHILD_PROJECTS_ENTRYPOINT:()=>iF,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>P0,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>x0,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>N0,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>v0,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>M0,CLAUDE_CODE_BRIDGE_SOURCE_DIR:()=>k0,CLAUDE_CODE_BRIEF:()=>Pz,CLAUDE_CODE_BRIEF_UPLOAD:()=>xz,CLAUDE_CODE_CCR_EVENT_FLUSH_POLICY:()=>RG,CLAUDE_CODE_CCR_SURFACE:()=>TG,CLAUDE_CODE_CHROME_LATE_MCP_SERVER:()=>mj,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>H0,CLAUDE_CODE_CONFIG_PROBE:()=>lF,CLAUDE_CODE_CONFIG_WATCH_EVENTS:()=>cF,CLAUDE_CODE_CONTAINER_ID:()=>F0,CLAUDE_CODE_COORDINATOR_SKILL_GUIDANCE:()=>Nz,CLAUDE_CODE_DAEMON_COLD_START:()=>kz,CLAUDE_CODE_DECSTBM:()=>B0,CLAUDE_CODE_DESKTOP_APP_VERSION:()=>z0,CLAUDE_CODE_DESKTOP_SKILLS_PLUGIN_DIR:()=>NF,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>G0,CLAUDE_CODE_DIFF_COPY_ROOT:()=>W0,CLAUDE_CODE_DISABLE_ATTRIBUTION_BASELINE_REUSE:()=>T0,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>vz,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>K0,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>$0,CLAUDE_CODE_DISABLE_POOLED_CONNECTION_IDLE_LIMIT:()=>V0,CLAUDE_CODE_DISABLE_QUIET_BACKGROUND_WAIT:()=>Y0,CLAUDE_CODE_DISABLE_TURN_HANDOFF:()=>X0,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>J0,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>Z0,CLAUDE_CODE_DISABLE_WORKING_SYNC_WATCH:()=>q0,CLAUDE_CODE_DONT_INHERIT_ENV:()=>Mz,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>Q0,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>Uz,CLAUDE_CODE_EMIT_STARTUP_TIMING:()=>Bz,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>zz,CLAUDE_CODE_EMIT_USER_PROMPT_SUBMIT_HOOK_EVENTS:()=>Gz,CLAUDE_CODE_ENTRYPOINT:()=>eF,CLAUDE_CODE_ENTRYPOINT_ON_REQUESTS:()=>tF,CLAUDE_CODE_ENVIRONMENT_KIND:()=>nF,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>dF,CLAUDE_CODE_EVAL_CONFINED:()=>SG,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>Wz,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>lW,CLAUDE_CODE_FLAG_FETCH_WAIT_MS:()=>jz,CLAUDE_CODE_FOOTER_INDICATOR:()=>uF,CLAUDE_CODE_FORCE_BRIDGE:()=>Kz,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>$z,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>Vz,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>Yz,CLAUDE_CODE_FORCE_TIP_ID:()=>pF,CLAUDE_CODE_GIT_BASH_PATH:()=>fF,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>cW,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>dW,CLAUDE_CODE_HIDE_REPLY_SERVER_NAME:()=>mF,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>_F,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>MG,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>EF,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>hF,CLAUDE_CODE_HOSTED_DESKTOP:()=>Jz,CLAUDE_CODE_HOST_PLATFORM:()=>SF,CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD:()=>Xz,CLAUDE_CODE_HOST_SESSION_ID:()=>yF,CLAUDE_CODE_HOST_SKILL_CATALOG:()=>OF,CLAUDE_CODE_HOST_WORKTREE:()=>AF,CLAUDE_CODE_HOST_WORKTREE_FENCE:()=>CF,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>bF,CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS:()=>RF,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>uW,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>pW,CLAUDE_CODE_IGNORE_PERSISTED_TRUST:()=>gF,CLAUDE_CODE_IS_COWORK:()=>Zz,CLAUDE_CODE_JIT_POLICY_AFTER_STARTUP:()=>gG,CLAUDE_CODE_LAZY_ENV_GETTERS:()=>il,CLAUDE_CODE_LEGACY_BUNDLE:()=>j0,CLAUDE_CODE_LOOP_KEEPALIVE:()=>qz,CLAUDE_CODE_LOOP_PERSISTENT:()=>Qz,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>TF,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>fW,CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH:()=>_j,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>mW,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>gW,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>DF,CLAUDE_CODE_MCP_ALWAYS_LOAD_JOIN_BEFORE_INPUT:()=>fj,CLAUDE_CODE_MCP_APPS_HOST:()=>gj,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>ij,CLAUDE_CODE_MCP_CONNECTOR_PREWAIT_MS:()=>aj,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>VG,CLAUDE_CODE_MCP_PREWAIT_SERVERS:()=>cj,CLAUDE_CODE_MCP_PREWAIT_SERVERS_MS:()=>dj,CLAUDE_CODE_MCP_STARTUP_WAIT_MS:()=>lj,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>sj,CLAUDE_CODE_MEMORY_CONTEXT_NO_WAIT:()=>uz,CLAUDE_CODE_MEMORY_SUBAGENT_APPEND:()=>pz,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>eG,CLAUDE_CODE_MOCK_TRIAL:()=>tG,CLAUDE_CODE_OVERRIDE_DATE:()=>LF,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>wG,CLAUDE_CODE_PARKED_RUN_BEFORE_CLEAR:()=>vG,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>kG,CLAUDE_CODE_PERFORCE_MODE:()=>wF,CLAUDE_CODE_PERSONAL_CONFIG_FIX:()=>PF,CLAUDE_CODE_PLAIN_DELTA_FAST_PATH:()=>_G,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>EW,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>hW,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>xF,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>kF,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>SW,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>vF,CLAUDE_CODE_POST_TURN_MEMORY:()=>nG,CLAUDE_CODE_POST_TURN_MEMORY_CONFIG:()=>MF,CLAUDE_CODE_POST_TURN_MEMORY_SYNC:()=>oG,CLAUDE_CODE_POWERUP_ONBOARDING:()=>UF,CLAUDE_CODE_PROJECT_DIR_NAME:()=>HF,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>yW,CLAUDE_CODE_QUESTION_EXTENDED:()=>BF,CLAUDE_CODE_QUESTION_OPTIONAL_DESCRIPTIONS:()=>zF,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>FF,CLAUDE_CODE_RELAUNCH_HOME_TRUST:()=>GF,CLAUDE_CODE_RELAUNCH_PROACTIVITY_BASELINE:()=>WF,CLAUDE_CODE_RELAUNCH_PROACTIVITY_DECIDED:()=>jF,CLAUDE_CODE_RELAUNCH_PROACTIVITY_EVER_ON:()=>KF,CLAUDE_CODE_RELAUNCH_PROACTIVITY_LEVEL:()=>$F,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>VF,CLAUDE_CODE_REMOTE:()=>rG,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>YF,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>sG,CLAUDE_CODE_REMOTE_MCP_CONFIG:()=>XF,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>JF,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>ZF,CLAUDE_CODE_REMOTE_SDK_URL:()=>qF,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>iG,CLAUDE_CODE_REMOTE_SESSION_ID:()=>QF,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>eB,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>tB,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>OW,CLAUDE_CODE_REPL:()=>aG,CLAUDE_CODE_REPO_CHECKOUTS:()=>nB,CLAUDE_CODE_RESTRICTED:()=>lG,CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG:()=>cG,CLAUDE_CODE_RESULT_NONCE:()=>U0,CLAUDE_CODE_RESUME_FROM_SESSION:()=>oB,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>dG,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>fG,CLAUDE_CODE_RESUME_PROMPT:()=>rB,CLAUDE_CODE_RESUME_REASON:()=>EG,CLAUDE_CODE_RESUME_SESSIONSTART_HOOKS_WAIT_MS:()=>mG,CLAUDE_CODE_RESUME_SHOWS_CUT_OFF_CALLS:()=>xG,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>uG,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>AW,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>CW,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>PG,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_SEEDS:()=>NG,CLAUDE_CODE_SAFE_MODE:()=>hG,CLAUDE_CODE_SANDBOXED:()=>yG,CLAUDE_CODE_SCRIPT_CAPS:()=>bW,CLAUDE_CODE_SCROLL_SPEED:()=>sB,CLAUDE_CODE_SDK_READS_SESSION_STATE:()=>Hz,CLAUDE_CODE_SDK_READS_STARTUP_MARKS:()=>Fz,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>RW,CLAUDE_CODE_SESSION_ID:()=>iB,CLAUDE_CODE_SESSION_KIND:()=>aB,CLAUDE_CODE_SESSION_NAME:()=>lB,CLAUDE_CODE_SESSION_ORIGIN:()=>cB,CLAUDE_CODE_SESSION_START_ANNOUNCEMENTS_BEFORE_PROMPT:()=>OG,CLAUDE_CODE_SHELL:()=>dB,CLAUDE_CODE_SHELL_PREFIX:()=>uB,CLAUDE_CODE_SIMPLE:()=>AG,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>pB,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>fB,CLAUDE_CODE_SKIP_MCP_DEBUG_LOG_FILES:()=>pj,CLAUDE_CODE_SLEEP_COMPACT:()=>mB,CLAUDE_CODE_SLEEP_COMPACT_AFTER_MS:()=>gB,CLAUDE_CODE_SPAWNED_BY_SERVER:()=>nz,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>TW,CLAUDE_CODE_SSE_PORT:()=>DW,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>_B,CLAUDE_CODE_STARTUP_FAILURE_RESULTS:()=>IF,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>LW,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>CG,CLAUDE_CODE_SUPERVISED:()=>bG,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>DG,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_CONCURRENCY:()=>LG,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>IG,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>wW,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>PW,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>IW,CLAUDE_CODE_SYNC_REUSE_WITHIN_MS:()=>xW,CLAUDE_CODE_SYNC_SESSION_REFS:()=>UG,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>NW,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>kW,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>HG,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>EB,CLAUDE_CODE_TAGS:()=>hB,CLAUDE_CODE_TASK_LIST_ID:()=>yB,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>vW,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>SB,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>FG,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>OB,CLAUDE_CODE_TEST_FORCE_DENY:()=>BG,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>zG,CLAUDE_CODE_TEST_NO_PWSH:()=>GG,CLAUDE_CODE_TMPDIR:()=>AB,CLAUDE_CODE_TMUX_PREFIX:()=>CB,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>WG,CLAUDE_CODE_TMUX_SESSION:()=>bB,CLAUDE_CODE_TMUX_TRUECOLOR:()=>jG,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>KG,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>$G,CLAUDE_CODE_TRANSCRIPT_SLIM_TOOL_RESULTS:()=>pG,CLAUDE_CODE_TRIGGER_ID:()=>RB,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>YG,CLAUDE_CODE_TUI_TRIAL:()=>XG,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>TB,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>DB,CLAUDE_CODE_UPFRONT_TOOLS:()=>uj,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>MW,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>JG,CLAUDE_CODE_WARN_DISK_FREE_GIB:()=>UW,CLAUDE_CODE_WARN_MEMORY_FREE_GIB:()=>HW,CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR:()=>_W,CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE:()=>LB,CLAUDE_CODE_WORKER_EPOCH:()=>BW,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>IB,CLAUDE_CONFIG_DIR:()=>wB,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>PB,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>xB,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>NB,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>kB,CLAUDE_ENV_FILE:()=>vB,CLAUDE_FORCE_DISPLAY_SURVEY:()=>ZG,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>MB,CLAUDE_INTERNAL_FC_OVERRIDES:()=>UB,CLAUDE_INTERNAL_SESSION_TASK_LIST_ID:()=>HB,CLAUDE_JOB_DIR:()=>FB,CLAUDE_MEMORY_STORES:()=>BB,CLAUDE_PROJECT_UUID:()=>zB,CLAUDE_PTY_HEARTBEAT_MS:()=>zW,CLAUDE_PTY_HOST_EXEC:()=>GB,CLAUDE_PTY_HOST_NO_STABLE_PATH:()=>WB,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>GW,CLAUDE_RELAUNCH_SESSION_ADD_DIRS:()=>jB,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>KB,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>$B,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>VB,CLAUDE_RUNNER_ACTIVITY_FD:()=>WW,CLAUDE_RUNNER_ALIVE_EVERY_MS:()=>jW,CLAUDE_RUNNER_CLIENT_PLATFORM:()=>YB,CLAUDE_RUNNER_FETCH_DEPTH:()=>XB,CLAUDE_RUNNER_FETCH_SERVER_PROGRESS_CAP_MS:()=>JB,CLAUDE_RUNNER_UPDATE_BIN:()=>KW,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>ZB,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>$W,CLAUDE_SNIP:()=>qB,CLAUDE_SSH_DAEMON_CHILD:()=>ez,CLAUDE_SSH_LOCAL_BINARY:()=>QB,CLAUDE_SSH_RUN_DIR:()=>tz,CLAUDE_SSH_VERSION:()=>oz,CLAUDE_STAGE_FILE_ROOT:()=>rz,CLAUDE_TMPDIR:()=>sz,LOCAL_BRIDGE:()=>qG,MCP_CONNECTION_NONBLOCKING:()=>QG,MCP_CONNECT_TIMEOUT_MS:()=>VW,MCP_DISCOVERY_CACHE:()=>YW,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>XW,MCP_DISCOVERY_CACHE_STRIKES:()=>JW,MCP_DISCOVERY_CACHE_TTL_S:()=>ZW,MCP_OAUTH_CALLBACK_PORT:()=>qW,MCP_OAUTH_CLIENT_METADATA_URL:()=>iz,MCP_PROTOCOL_NEGOTIATION:()=>QW,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>ej,MCP_SDK_GENERATION:()=>nj,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>tj,MCP_TIMEOUT:()=>oj,MCP_TOOL_TIMEOUT:()=>rj,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>az,SDK_NATIVE_BIN:()=>lz,SESSION_INGRESS_URL:()=>cz,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>Ej,SYSTEM_REMINDER_MEMORY_CONTEXT:()=>dz,TEST_ENABLE_SESSION_PERSISTENCE:()=>eW,ULTRAPLAN_PROMPT_FILE:()=>fz,VCR_RECORD:()=>tW,VITALS_EMITTER_BIN:()=>mz,VOICE_STREAM_BASE_URL:()=>gz});var ll={};k(ll,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>Fj,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>zj,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>Bj,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>Oj,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>Cj,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>Aj,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>wj,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>xj,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>Pj,ANTHROPIC_DEFAULT_MODEL:()=>Sj,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>bj,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>Tj,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>Rj,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>Dj,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>Ij,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>Lj,ANTHROPIC_MODEL:()=>hj,ANTHROPIC_SMALL_FAST_MODEL:()=>yj,CLAUDE_CODE_3P_PROBE_WROTE_HAIKU_DEFAULT:()=>vj,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>kj,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>Nj,CLAUDE_CODE_3P_SEEDED_OPUS_DEFAULT:()=>Uj,CLAUDE_CODE_3P_SEEDED_SONNET_DEFAULT:()=>Mj,CLAUDE_CODE_ALLOW_OTHER_MODELS:()=>cK,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>Qj,CLAUDE_CODE_AUTO_MODE_MODEL:()=>Kj,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>$j,CLAUDE_CODE_CLIENT_DATA_URL:()=>lK,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>rK,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>Jj,CLAUDE_CODE_DISABLE_FAST_MODE:()=>tK,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>Zj,CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK:()=>Xj,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>sK,CLAUDE_CODE_EFFORT_LEVEL:()=>qj,CLAUDE_CODE_MAX_EFFORT_REMINDER:()=>eK,CLAUDE_CODE_MODEL_CATALOG:()=>iK,CLAUDE_CODE_MODEL_CATALOG_URL:()=>aK,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>Yj,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>nK,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>oK,CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY:()=>Hj,CLAUDE_CODE_SUBAGENT_MODEL:()=>Gj,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>Wj,CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL:()=>jj,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>Vj});var cl={};k(cl,{ALL_PROXY:()=>_K,ANTHROPIC_BETAS:()=>CK,ANTHROPIC_CUSTOM_HEADERS:()=>bK,API_FORCE_IDLE_TIMEOUT:()=>WK,API_TIMEOUT_MS:()=>FK,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>o$,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>DK,CLAUDE_CODE_CERT_STORE:()=>AK,CLAUDE_CODE_CLIENT_CERT:()=>hK,CLAUDE_CODE_CLIENT_KEY:()=>SK,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>yK,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>OK,CLAUDE_CODE_EAGER_FLUSH:()=>u$,CLAUDE_CODE_EXTRA_BODY:()=>RK,CLAUDE_CODE_EXTRA_METADATA:()=>TK,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>PK,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_MESSAGE:()=>xK,CLAUDE_CODE_FILE_READ_MAX_PDF_PAGES_PER_TURN:()=>NK,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>p$,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>YK,CLAUDE_CODE_GZIP_DATADOG_LOGS:()=>XK,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>VK,CLAUDE_CODE_GZIP_REQUEST_BODY_BLOCKS:()=>ZK,CLAUDE_CODE_GZIP_REQUEST_BODY_LEVEL:()=>JK,CLAUDE_CODE_INCREMENTAL_REQUEST_BODY:()=>qK,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>wK,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>IK,CLAUDE_CODE_MAX_RETRIES:()=>LK,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>kK,CLAUDE_CODE_MAX_TURNS:()=>vK,CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES:()=>BK,CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS:()=>zK,CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS:()=>GK,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>g$,CLAUDE_CODE_RETRY_WATCHDOG:()=>i$,CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS:()=>l$,CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS:()=>a$,CLAUDE_CODE_RETRY_WATCHDOG_SCOPE:()=>d$,CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS:()=>c$,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>m$,CLAUDE_CODE_STREAM_EVENT_HOLD_MS:()=>e$,CLAUDE_CODE_STREAM_EVENT_MAX_LINE_BYTES:()=>t$,CLAUDE_CODE_UNWATCHED_REPLY_HOLD_MS:()=>QK,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>jK,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>KK,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>$K,CLAUDE_MOCK_HEADERLESS_429:()=>f$,CLAUDE_SLOW_FIRST_BYTE_MS:()=>s$,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>r$,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>n$,HTTPS_PROXY:()=>uK,HTTP_PROXY:()=>dK,MAX_MCP_OUTPUT_TOKENS:()=>HK,MAX_STRUCTURED_OUTPUT_RETRIES:()=>UK,MAX_THINKING_TOKENS:()=>MK,NO_PROXY:()=>pK,all_proxy:()=>EK,http_proxy:()=>fK,https_proxy:()=>mK,no_proxy:()=>gK});var dl={};k(dl,{AGENT_PROXY_URL:()=>M1,ANTHROPIC_AWS_BASE_URL:()=>I$,ANTHROPIC_AWS_WORKSPACE_ID:()=>w$,ANTHROPIC_BASE_URL:()=>A$,ANTHROPIC_BEDROCK_BASE_URL:()=>R$,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>L$,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>T$,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>D$,ANTHROPIC_FOUNDRY_BASE_URL:()=>H$,ANTHROPIC_FOUNDRY_RESOURCE:()=>F$,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>k$,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>x$,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>P$,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>N$,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>Q$,ANTHROPIC_UNIX_SOCKET:()=>e1,ANTHROPIC_VERTEX_BASE_URL:()=>v$,ANTHROPIC_VERTEX_PROJECT_ID:()=>M$,AWS_ACCESS_KEY_ID:()=>K$,AWS_CONFIG_FILE:()=>W$,AWS_DEFAULT_REGION:()=>z$,AWS_ENDPOINT_URL:()=>Y$,AWS_ENDPOINT_URL_BEDROCK:()=>X$,AWS_ENDPOINT_URL_BEDROCK_RUNTIME:()=>J$,AWS_ENDPOINT_URL_STS:()=>Z$,AWS_PROFILE:()=>G$,AWS_REGION:()=>B$,AWS_SECRET_ACCESS_KEY:()=>$$,AWS_SESSION_TOKEN:()=>V$,AWS_SHARED_CREDENTIALS_FILE:()=>j$,AWS_USE_FIPS_ENDPOINT:()=>q$,CACERT_UPDATES:()=>b1,CCR_AGENT_PROXY_CA_CERT_B64:()=>I1,CCR_AGENT_PROXY_CA_WATCH_ENABLED:()=>w1,CCR_AGENT_PROXY_ENABLED:()=>m1,CCR_AGENT_PROXY_FRAME_HOSTS:()=>x1,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>y1,CCR_AGENT_PROXY_JAVA_STORE_DIRECT_DISABLED:()=>C1,CCR_AGENT_PROXY_NO_PROXY_LOCAL_ONLY:()=>L1,CCR_AGENT_PROXY_NSS_RECORDS_DISABLED:()=>P1,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>O1,CCR_AGENT_PROXY_RELAY_MODE:()=>h1,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>A1,CCR_ENABLE_BUNDLE:()=>N1,CCR_FORCE_BUNDLE:()=>k1,CCR_ON_BRANCH_DEFAULT_GUARD:()=>v1,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>_1,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>g1,CLAUDE_CODE_AGENT_PROXY_GIT_HOSTS:()=>E1,CLAUDE_CODE_API_BASE_URL:()=>b$,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>d1,CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS:()=>u1,CLAUDE_CODE_GB_BASE_URL:()=>p1,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>f1,CLAUDE_CODE_HOST_GATEWAY_LINEAGE:()=>n1,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>t1,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>r1,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>o1,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>U1,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>S$,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>y$,CLAUDE_CODE_USE_BEDROCK:()=>_$,CLAUDE_CODE_USE_FOUNDRY:()=>h$,CLAUDE_CODE_USE_GATEWAY:()=>s1,CLAUDE_CODE_USE_MANTLE:()=>O$,CLAUDE_CODE_USE_VERTEX:()=>E$,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>i1,CLAUDE_GATEWAY_DRAIN_TIMEOUT_MS:()=>c1,CLAUDE_GATEWAY_LOG_LEVEL:()=>l1,CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY:()=>a1,CLOUD_ML_REGION:()=>U$,DPKG_ADMINDIR:()=>T1,DPKG_MAINTSCRIPT_PACKAGE:()=>R1,DPKG_ROOT:()=>D1,SELF_HOSTED_RUNNER_AGENT_PROXY_URL:()=>S1,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>C$});var Ni={};k(Ni,{default:()=>us});import{resolve as F7}from"path";function nO(l,A){var L=-1,x=l==null?0:l.length,z=Array(x);while(++L<x)z[L]=A(l[L],L,l);return z}var Yo=nO;function oO(){this.__data__=[],this.size=0}var jd=oO;function rO(l,A){return l===A||l!==l&&A!==A}var Nn=rO;function sO(l,A){var L=l.length;while(L--)if(Nn(l[L][0],A))return L;return-1}var ro=sO;var iO=Array.prototype,aO=iO.splice;function lO(l){var A=this.__data__,L=ro(A,l);if(L<0)return!1;var x=A.length-1;if(L==x)A.pop();else aO.call(A,L,1);return--this.size,!0}var Kd=lO;function cO(l){var A=this.__data__,L=ro(A,l);return L<0?void 0:A[L][1]}var $d=cO;function dO(l){return ro(this.__data__,l)>-1}var Vd=dO;function uO(l,A){var L=this.__data__,x=ro(L,l);if(x<0)++this.size,L.push([l,A]);else L[x][1]=A;return this}var Yd=uO;function Xo(l){var A=-1,L=l==null?0:l.length;this.clear();while(++A<L){var x=l[A];this.set(x[0],x[1])}}Xo.prototype.clear=jd;Xo.prototype.delete=Kd;Xo.prototype.get=$d;Xo.prototype.has=Vd;Xo.prototype.set=Yd;var so=Xo;function pO(){this.__data__=new so,this.size=0}var Xd=pO;function fO(l){var A=this.__data__,L=A.delete(l);return this.size=A.size,L}var Jd=fO;function mO(l){return this.__data__.get(l)}var Zd=mO;function gO(l){return this.__data__.has(l)}var qd=gO;var _O=typeof global=="object"&&global&&global.Object===Object&&global,Xs=_O;var EO=typeof self=="object"&&self&&self.Object===Object&&self,hO=Xs||EO||Function("return this")(),Vt=hO;var SO=Vt.Symbol,on=SO;var Qd=Object.prototype,{hasOwnProperty:yO,toString:OO}=Qd,qr=on?on.toStringTag:void 0;function AO(l){var A=yO.call(l,qr),L=l[qr];try{l[qr]=void 0;var x=!0}catch(W){}var z=OO.call(l);if(x)if(A)l[qr]=L;else delete l[qr];return z}var eu=AO;var CO=Object.prototype,bO=CO.toString;function RO(l){return bO.call(l)}var tu=RO;var TO="[object Null]",DO="[object Undefined]",nu=on?on.toStringTag:void 0;function LO(l){if(l==null)return l===void 0?DO:TO;return nu&&nu in Object(l)?eu(l):tu(l)}var hn=LO;function IO(l){var A=typeof l;return l!=null&&(A=="object"||A=="function")}var jt=IO;var wO="[object AsyncFunction]",PO="[object Function]",xO="[object GeneratorFunction]",NO="[object Proxy]";function kO(l){if(!jt(l))return!1;var A=hn(l);return A==PO||A==xO||A==wO||A==NO}var Jo=kO;var vO=Vt["__core-js_shared__"],Js=vO;var ou=function(){var l=/[^.]+$/.exec(Js&&Js.keys&&Js.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}();function MO(l){return!!ou&&ou in l}var ru=MO;var UO=Function.prototype,HO=UO.toString;function FO(l){if(l!=null){try{return HO.call(l)}catch(A){}try{return l+""}catch(A){}}return""}var $n=FO;var BO=/[\\^$.*+?()[\]{}|]/g,zO=/^\[object .+?Constructor\]$/,GO=Function.prototype,WO=Object.prototype,jO=GO.toString,KO=WO.hasOwnProperty,$O=RegExp("^"+jO.call(KO).replace(BO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VO(l){if(!jt(l)||ru(l))return!1;var A=Jo(l)?$O:zO;return A.test($n(l))}var su=VO;function YO(l,A){return l==null?void 0:l[A]}var iu=YO;function XO(l,A){var L=iu(l,A);return su(L)?L:void 0}var mn=XO;var JO=mn(Vt,"Map"),io=JO;var ZO=mn(Object,"create"),Vn=ZO;function qO(){this.__data__=Vn?Vn(null):{},this.size=0}var au=qO;function QO(l){var A=this.has(l)&&delete this.__data__[l];return this.size-=A?1:0,A}var lu=QO;var eA="__lodash_hash_undefined__",tA=Object.prototype,nA=tA.hasOwnProperty;function oA(l){var A=this.__data__;if(Vn){var L=A[l];return L===eA?void 0:L}return nA.call(A,l)?A[l]:void 0}var cu=oA;var rA=Object.prototype,sA=rA.hasOwnProperty;function iA(l){var A=this.__data__;return Vn?A[l]!==void 0:sA.call(A,l)}var du=iA;var aA="__lodash_hash_undefined__";function lA(l,A){var L=this.__data__;return this.size+=this.has(l)?0:1,L[l]=Vn&&A===void 0?aA:A,this}var uu=lA;function Zo(l){var A=-1,L=l==null?0:l.length;this.clear();while(++A<L){var x=l[A];this.set(x[0],x[1])}}Zo.prototype.clear=au;Zo.prototype.delete=lu;Zo.prototype.get=cu;Zo.prototype.has=du;Zo.prototype.set=uu;var Ja=Zo;function cA(){this.size=0,this.__data__={hash:new Ja,map:new(io||so),string:new Ja}}var pu=cA;function dA(l){var A=typeof l;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?l!=="__proto__":l===null}var fu=dA;function uA(l,A){var L=l.__data__;return fu(A)?L[typeof A=="string"?"string":"hash"]:L.map}var ao=uA;function pA(l){var A=ao(this,l).delete(l);return this.size-=A?1:0,A}var mu=pA;function fA(l){return ao(this,l).get(l)}var gu=fA;function mA(l){return ao(this,l).has(l)}var _u=mA;function gA(l,A){var L=ao(this,l),x=L.size;return L.set(l,A),this.size+=L.size==x?0:1,this}var Eu=gA;function qo(l){var A=-1,L=l==null?0:l.length;this.clear();while(++A<L){var x=l[A];this.set(x[0],x[1])}}qo.prototype.clear=pu;qo.prototype.delete=mu;qo.prototype.get=gu;qo.prototype.has=_u;qo.prototype.set=Eu;var Do=qo;var _A=200;function EA(l,A){var L=this.__data__;if(L instanceof so){var x=L.__data__;if(!io||x.length<_A-1)return x.push([l,A]),this.size=++L.size,this;L=this.__data__=new Do(x)}return L.set(l,A),this.size=L.size,this}var hu=EA;function Qo(l){var A=this.__data__=new so(l);this.size=A.size}Qo.prototype.clear=Xd;Qo.prototype.delete=Jd;Qo.prototype.get=Zd;Qo.prototype.has=qd;Qo.prototype.set=hu;var kn=Qo;var hA="__lodash_hash_undefined__";function SA(l){return this.__data__.set(l,hA),this}var Su=SA;function yA(l){return this.__data__.has(l)}var yu=yA;function Zs(l){var A=-1,L=l==null?0:l.length;this.__data__=new Do;while(++A<L)this.add(l[A])}Zs.prototype.add=Zs.prototype.push=Su;Zs.prototype.has=yu;var qs=Zs;function OA(l,A){var L=-1,x=l==null?0:l.length;while(++L<x)if(A(l[L],L,l))return!0;return!1}var Ou=OA;function AA(l,A){return l.has(A)}var Qs=AA;var CA=1,bA=2;function RA(l,A,L,x,z,W){var Z=L&CA,ne=l.length,ce=A.length;if(ne!=ce&&!(Z&&ce>ne))return!1;var Te=W.get(l),Le=W.get(A);if(Te&&Le)return Te==A&&Le==l;var we=-1,Ie=!0,Be=L&bA?new qs:void 0;W.set(l,A),W.set(A,l);while(++we<ne){var ke=l[we],qe=A[we];if(x)var He=Z?x(qe,ke,we,A,l,W):x(ke,qe,we,l,A,W);if(He!==void 0){if(He)continue;Ie=!1;break}if(Be){if(!Ou(A,function(rt,We){if(!Qs(Be,We)&&(ke===rt||z(ke,rt,L,x,W)))return Be.push(We)})){Ie=!1;break}}else if(!(ke===qe||z(ke,qe,L,x,W))){Ie=!1;break}}return W.delete(l),W.delete(A),Ie}var ei=RA;var TA=Vt.Uint8Array,er=TA;function DA(l){var A=-1,L=Array(l.size);return l.forEach(function(x,z){L[++A]=[z,x]}),L}var Au=DA;function LA(l){var A=-1,L=Array(l.size);return l.forEach(function(x){L[++A]=x}),L}var tr=LA;var IA=1,wA=2,PA="[object Boolean]",xA="[object Date]",NA="[object Error]",kA="[object Map]",vA="[object Number]",MA="[object RegExp]",UA="[object Set]",HA="[object String]",FA="[object Symbol]",BA="[object ArrayBuffer]",zA="[object DataView]",Cu=on?on.prototype:void 0,Za=Cu?Cu.valueOf:void 0;function GA(l,A,L,x,z,W,Z){switch(L){case zA:if(l.byteLength!=A.byteLength||l.byteOffset!=A.byteOffset)return!1;l=l.buffer,A=A.buffer;case BA:if(l.byteLength!=A.byteLength||!W(new er(l),new er(A)))return!1;return!0;case PA:case xA:case vA:return Nn(+l,+A);case NA:return l.name==A.name&&l.message==A.message;case MA:case HA:return l==A+"";case kA:var ne=Au;case UA:var ce=x&IA;if(ne||(ne=tr),l.size!=A.size&&!ce)return!1;var Te=Z.get(l);if(Te)return Te==A;x|=wA,Z.set(l,A);var Le=ei(ne(l),ne(A),x,z,W,Z);return Z.delete(l),Le;case FA:if(Za)return Za.call(l)==Za.call(A)}return!1}var bu=GA;function WA(l,A){var L=-1,x=A.length,z=l.length;while(++L<x)l[z+L]=A[L];return l}var nr=WA;var jA=Array.isArray,Mt=jA;function KA(l,A,L){var x=A(l);return Mt(l)?x:nr(x,L(l))}var ti=KA;function $A(l,A){var L=-1,x=l==null?0:l.length,z=0,W=[];while(++L<x){var Z=l[L];if(A(Z,L,l))W[z++]=Z}return W}var Ru=$A;function VA(){return[]}var ni=VA;var YA=Object.prototype,XA=YA.propertyIsEnumerable,Tu=Object.getOwnPropertySymbols,JA=!Tu?ni:function(l){if(l==null)return[];return l=Object(l),Ru(Tu(l),function(A){return XA.call(l,A)})},or=JA;function ZA(l,A){var L=-1,x=Array(l);while(++L<l)x[L]=A(L);return x}var Du=ZA;function qA(l){return l!=null&&typeof l=="object"}var Qt=qA;var QA="[object Arguments]";function eC(l){return Qt(l)&&hn(l)==QA}var qa=eC;var Lu=Object.prototype,{hasOwnProperty:tC,propertyIsEnumerable:nC}=Lu,oC=qa(function(){return arguments}())?qa:function(l){return Qt(l)&&tC.call(l,"callee")&&!nC.call(l,"callee")},Yn=oC;function rC(){return!1}var Iu=rC;var xu=typeof ri=="object"&&ri&&!ri.nodeType&&ri,wu=xu&&typeof oi=="object"&&oi&&!oi.nodeType&&oi,sC=wu&&wu.exports===xu,Pu=sC?Vt.Buffer:void 0,iC=Pu?Pu.isBuffer:void 0,aC=iC||Iu,vn=aC;var lC=9007199254740991,cC=/^(?:0|[1-9]\d*)$/;function dC(l,A){var L=typeof l;return A=A==null?lC:A,!!A&&(L=="number"||L!="symbol"&&cC.test(l))&&(l>-1&&l%1==0&&l<A)}var lo=dC;var uC=9007199254740991;function pC(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=uC}var rr=pC;var fC="[object Arguments]",mC="[object Array]",gC="[object Boolean]",_C="[object Date]",EC="[object Error]",hC="[object Function]",SC="[object Map]",yC="[object Number]",OC="[object Object]",AC="[object RegExp]",CC="[object Set]",bC="[object String]",RC="[object WeakMap]",TC="[object ArrayBuffer]",DC="[object DataView]",LC="[object Float32Array]",IC="[object Float64Array]",wC="[object Int8Array]",PC="[object Int16Array]",xC="[object Int32Array]",NC="[object Uint8Array]",kC="[object Uint8ClampedArray]",vC="[object Uint16Array]",MC="[object Uint32Array]",zt={};zt[LC]=zt[IC]=zt[wC]=zt[PC]=zt[xC]=zt[NC]=zt[kC]=zt[vC]=zt[MC]=!0;zt[fC]=zt[mC]=zt[TC]=zt[gC]=zt[DC]=zt[_C]=zt[EC]=zt[hC]=zt[SC]=zt[yC]=zt[OC]=zt[AC]=zt[CC]=zt[bC]=zt[RC]=!1;function UC(l){return Qt(l)&&rr(l.length)&&!!zt[hn(l)]}var Nu=UC;function HC(l){return function(A){return l(A)}}var sr=HC;var ku=typeof ii=="object"&&ii&&!ii.nodeType&&ii,Qr=ku&&typeof si=="object"&&si&&!si.nodeType&&si,FC=Qr&&Qr.exports===ku,Qa=FC&&Xs.process,BC=function(){try{var l=Qr&&Qr.require&&Qr.require("util").types;if(l)return l;return Qa&&Qa.binding&&Qa.binding("util")}catch(A){}}(),Mn=BC;var vu=Mn&&Mn.isTypedArray,zC=vu?sr(vu):Nu,ir=zC;var GC=Object.prototype,WC=GC.hasOwnProperty;function jC(l,A){var L=Mt(l),x=!L&&Yn(l),z=!L&&!x&&vn(l),W=!L&&!x&&!z&&ir(l),Z=L||x||z||W,ne=Z?Du(l.length,String):[],ce=ne.length;for(var Te in l)if((A||WC.call(l,Te))&&!(Z&&(Te=="length"||z&&(Te=="offset"||Te=="parent")||W&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||lo(Te,ce))))ne.push(Te);return ne}var ai=jC;var KC=Object.prototype;function $C(l){var A=l&&l.constructor,L=typeof A=="function"&&A.prototype||KC;return l===L}var ar=$C;function VC(l,A){return function(L){return l(A(L))}}var li=VC;var YC=li(Object.keys,Object),Mu=YC;var XC=Object.prototype,JC=XC.hasOwnProperty;function ZC(l){if(!ar(l))return Mu(l);var A=[];for(var L in Object(l))if(JC.call(l,L)&&L!="constructor")A.push(L);return A}var Uu=ZC;function qC(l){return l!=null&&rr(l.length)&&!Jo(l)}var Un=qC;function QC(l){return Un(l)?ai(l):Uu(l)}var Hn=QC;function eb(l){return ti(l,Hn,or)}var es=eb;var tb=1,nb=Object.prototype,ob=nb.hasOwnProperty;function rb(l,A,L,x,z,W){var Z=L&tb,ne=es(l),ce=ne.length,Te=es(A),Le=Te.length;if(ce!=Le&&!Z)return!1;var we=ce;while(we--){var Ie=ne[we];if(!(Z?Ie in A:ob.call(A,Ie)))return!1}var Be=W.get(l),ke=W.get(A);if(Be&&ke)return Be==A&&ke==l;var qe=!0;W.set(l,A),W.set(A,l);var He=Z;while(++we<ce){Ie=ne[we];var rt=l[Ie],We=A[Ie];if(x)var nt=Z?x(We,rt,Ie,A,l,W):x(rt,We,Ie,l,A,W);if(!(nt===void 0?rt===We||z(rt,We,L,x,W):nt)){qe=!1;break}He||(He=Ie=="constructor")}if(qe&&!He){var it=l.constructor,mt=A.constructor;if(it!=mt&&(("constructor"in l)&&("constructor"in A))&&!(typeof it=="function"&&it instanceof it&&typeof mt=="function"&&mt instanceof mt))qe=!1}return W.delete(l),W.delete(A),qe}var Hu=rb;var sb=mn(Vt,"DataView"),ci=sb;var ib=mn(Vt,"Promise"),di=ib;var ab=mn(Vt,"Set"),co=ab;var lb=mn(Vt,"WeakMap"),ui=lb;var Fu="[object Map]",cb="[object Object]",Bu="[object Promise]",zu="[object Set]",Gu="[object WeakMap]",Wu="[object DataView]",db=$n(ci),ub=$n(io),pb=$n(di),fb=$n(co),mb=$n(ui),Lo=hn;if(ci&&Lo(new ci(new ArrayBuffer(1)))!=Wu||io&&Lo(new io)!=Fu||di&&Lo(di.resolve())!=Bu||co&&Lo(new co)!=zu||ui&&Lo(new ui)!=Gu)Lo=function(l){var A=hn(l),L=A==cb?l.constructor:void 0,x=L?$n(L):"";if(x)switch(x){case db:return Wu;case ub:return Fu;case pb:return Bu;case fb:return zu;case mb:return Gu}return A};var Xn=Lo;var gb=1,ju="[object Arguments]",Ku="[object Array]",pi="[object Object]",_b=Object.prototype,$u=_b.hasOwnProperty;function Eb(l,A,L,x,z,W){var Z=Mt(l),ne=Mt(A),ce=Z?Ku:Xn(l),Te=ne?Ku:Xn(A);ce=ce==ju?pi:ce,Te=Te==ju?pi:Te;var Le=ce==pi,we=Te==pi,Ie=ce==Te;if(Ie&&vn(l)){if(!vn(A))return!1;Z=!0,Le=!1}if(Ie&&!Le)return W||(W=new kn),Z||ir(l)?ei(l,A,L,x,z,W):bu(l,A,ce,L,x,z,W);if(!(L&gb)){var Be=Le&&$u.call(l,"__wrapped__"),ke=we&&$u.call(A,"__wrapped__");if(Be||ke){var qe=Be?l.value():l,He=ke?A.value():A;return W||(W=new kn),z(qe,He,L,x,W)}}if(!Ie)return!1;return W||(W=new kn),Hu(l,A,L,x,z,W)}var Vu=Eb;function Yu(l,A,L,x,z){if(l===A)return!0;if(l==null||A==null||!Qt(l)&&!Qt(A))return l!==l&&A!==A;return Vu(l,A,L,x,Yu,z)}var lr=Yu;var hb=1,Sb=2;function yb(l,A,L,x){var z=L.length,W=z,Z=!x;if(l==null)return!W;l=Object(l);while(z--){var ne=L[z];if(Z&&ne[2]?ne[1]!==l[ne[0]]:!(ne[0]in l))return!1}while(++z<W){ne=L[z];var ce=ne[0],Te=l[ce],Le=ne[1];if(Z&&ne[2]){if(Te===void 0&&!(ce in l))return!1}else{var we=new kn;if(x)var Ie=x(Te,Le,ce,l,A,we);if(!(Ie===void 0?lr(Le,Te,hb|Sb,x,we):Ie))return!1}}return!0}var Xu=yb;function Ob(l){return l===l&&!jt(l)}var fi=Ob;function Ab(l){var A=Hn(l),L=A.length;while(L--){var x=A[L],z=l[x];A[L]=[x,z,fi(z)]}return A}var Ju=Ab;function Cb(l,A){return function(L){if(L==null)return!1;return L[l]===A&&(A!==void 0||(l in Object(L)))}}var mi=Cb;function bb(l){var A=Ju(l);if(A.length==1&&A[0][2])return mi(A[0][0],A[0][1]);return function(L){return L===l||Xu(L,l,A)}}var Zu=bb;var Rb="[object Symbol]";function Tb(l){return typeof l=="symbol"||Qt(l)&&hn(l)==Rb}var cr=Tb;var Db=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lb=/^\w*$/;function Ib(l,A){if(Mt(l))return!1;var L=typeof l;if(L=="number"||L=="symbol"||L=="boolean"||l==null||cr(l))return!0;return Lb.test(l)||!Db.test(l)||A!=null&&l in Object(A)}var dr=Ib;var wb="Expected a function";function el(l,A){if(typeof l!="function"||A!=null&&typeof A!="function")throw TypeError(wb);var L=function(){var x=arguments,z=A?A.apply(this,x):x[0],W=L.cache;if(W.has(z))return W.get(z);var Z=l.apply(this,x);return L.cache=W.set(z,Z)||W,Z};return L.cache=new(el.Cache||Do),L}el.Cache=Do;var qu=el;var Pb=500;function xb(l){var A=qu(l,function(x){if(L.size===Pb)L.clear();return x}),L=A.cache;return A}var Qu=xb;var Nb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kb=/\\(\\)?/g,vb=Qu(function(l){var A=[];if(l.charCodeAt(0)===46)A.push("");return l.replace(Nb,function(L,x,z,W){A.push(z?W.replace(kb,"$1"):x||L)}),A}),ep=vb;var Mb=1/0,tp=on?on.prototype:void 0,np=tp?tp.toString:void 0;function op(l){if(typeof l=="string")return l;if(Mt(l))return Yo(l,op)+"";if(cr(l))return np?np.call(l):"";var A=l+"";return A=="0"&&1/l==-Mb?"-0":A}var rp=op;function Ub(l){return l==null?"":rp(l)}var sp=Ub;function Hb(l,A){if(Mt(l))return l;return dr(l,A)?[l]:ep(sp(l))}var Rn=Hb;var Fb=1/0;function Bb(l){if(typeof l=="string"||cr(l))return l;var A=l+"";return A=="0"&&1/l==-Fb?"-0":A}var Sn=Bb;function zb(l,A){A=Rn(A,l);var L=0,x=A.length;while(l!=null&&L<x)l=l[Sn(A[L++])];return L&&L==x?l:void 0}var uo=zb;function Gb(l,A,L){var x=l==null?void 0:uo(l,A);return x===void 0?L:x}var ip=Gb;function Wb(l,A){return l!=null&&A in Object(l)}var ap=Wb;function jb(l,A,L){A=Rn(A,l);var x=-1,z=A.length,W=!1;while(++x<z){var Z=Sn(A[x]);if(!(W=l!=null&&L(l,Z)))break;l=l[Z]}if(W||++x!=z)return W;return z=l==null?0:l.length,!!z&&rr(z)&&lo(Z,z)&&(Mt(l)||Yn(l))}var lp=jb;function Kb(l,A){return l!=null&&lp(l,A,ap)}var gi=Kb;var $b=1,Vb=2;function Yb(l,A){if(dr(l)&&fi(A))return mi(Sn(l),A);return function(L){var x=ip(L,l);return x===void 0&&x===A?gi(L,l):lr(A,x,$b|Vb)}}var cp=Yb;function Xb(l){return l}var ur=Xb;function Jb(l){return function(A){return A==null?void 0:A[l]}}var dp=Jb;function Zb(l){return function(A){return uo(A,l)}}var up=Zb;function qb(l){return dr(l)?dp(Sn(l)):up(l)}var pp=qb;function Qb(l){if(typeof l=="function")return l;if(l==null)return ur;if(typeof l=="object")return Mt(l)?cp(l[0],l[1]):Zu(l);return pp(l)}var Fn=Qb;var eR=function(){try{var l=mn(Object,"defineProperty");return l({},"",{}),l}catch(A){}}(),pr=eR;function tR(l,A,L){if(A=="__proto__"&&pr)pr(l,A,{configurable:!0,enumerable:!0,value:L,writable:!0});else l[A]=L}var po=tR;var nR=Object.prototype,oR=nR.hasOwnProperty;function rR(l,A,L){var x=l[A];if(!(oR.call(l,A)&&Nn(x,L))||L===void 0&&!(A in l))po(l,A,L)}var fr=rR;function sR(l,A,L,x){if(!jt(l))return l;A=Rn(A,l);var z=-1,W=A.length,Z=W-1,ne=l;while(ne!=null&&++z<W){var ce=Sn(A[z]),Te=L;if(ce==="__proto__"||ce==="constructor"||ce==="prototype")return l;if(z!=Z){var Le=ne[ce];if(Te=x?x(Le,ce,ne):void 0,Te===void 0)Te=jt(Le)?Le:lo(A[z+1])?[]:{}}fr(ne,ce,Te),ne=ne[ce]}return l}var fp=sR;function iR(l,A,L){var x=-1,z=A.length,W={};while(++x<z){var Z=A[x],ne=uo(l,Z);if(L(ne,Z))fp(W,Rn(Z,l),ne)}return W}var _i=iR;var aR=li(Object.getPrototypeOf,Object),mr=aR;var lR=Object.getOwnPropertySymbols,cR=!lR?ni:function(l){var A=[];while(l)nr(A,or(l)),l=mr(l);return A},Ei=cR;function dR(l){var A=[];if(l!=null)for(var L in Object(l))A.push(L);return A}var mp=dR;var uR=Object.prototype,pR=uR.hasOwnProperty;function fR(l){if(!jt(l))return mp(l);var A=ar(l),L=[];for(var x in l)if(!(x=="constructor"&&(A||!pR.call(l,x))))L.push(x);return L}var gp=fR;function mR(l){return Un(l)?ai(l,!0):gp(l)}var Bn=mR;function gR(l){return ti(l,Bn,Ei)}var gr=gR;function _R(l,A){if(l==null)return{};var L=Yo(gr(l),function(x){return[x]});return A=Fn(A),_i(l,L,function(x,z){return A(x,z[0])})}var hi=_R;import{lstat as b7}from"fs/promises";import{dirname as R7,join as Ko}from"path";import{dirname as K1}from"path";import{AsyncLocalStorage as ER}from"async_hooks";var hR=new ER;function _p(){return hR.getStore()!==void 0}var _oe=new s(()=>new Set);function Io(l){return{parse:(A)=>l(yR(A))}}function SR(l){let A=l?.trim();return A?A:void 0}function yR(l){return l===void 0?void 0:String(l)}var OR=Io(SR),AR=Io((l)=>l),CR=Io((l)=>o(l)),bR=Io((l)=>{if(o(l))return!0;if(U(l))return!1;return}),RR=hp();function Ep(l){if(typeof l==="boolean")return l?"1":"0";return String(l)}var v={str:()=>OR,rawStr:()=>AR,bool:()=>CR,triBool:()=>bR,int:(l)=>l?hp(l):RR,names:(l)=>Io((A)=>{let L=new Set;for(let x of A?.split(",")??[]){let z=x.trim();if(z.length>0)L.add(z);if(L.size===l)break}return L.size>0?Object.freeze([...L]):void 0}),enum:(l)=>Io((A)=>A!==void 0&&l.includes(A.trim())?A.trim():void 0)};function hp(l){return Io((A)=>{if(A===void 0)return;if(l?.digitsOnly&&!/^[+-]?\d+$/.test(A.trim()))return;if(l?.wholeValue&&!/^[+-]?\d+$/.test(A.trim())&&Xe(A.trim())===void 0)return;let L=ue(A);if(!Number.isFinite(L))return;if(l?.min!==void 0&&L<l.min)return;if(l?.max!==void 0&&L>l.max)return;return L})}var TR=v.str(),DR=v.str(),LR=v.str(),IR=v.str(),wR=v.str(),PR=v.str(),xR=v.str(),NR=v.str(),kR=v.str(),vR=v.str(),MR=v.str(),UR=v.str(),HR=v.str(),FR=v.str(),BR=v.str(),zR=v.str(),GR=v.str(),WR=v.str(),jR=v.str(),KR=v.str(),$R=v.str(),VR=v.str(),YR=v.str(),XR=v.str(),JR=v.str(),ZR=v.str(),qR=v.str(),QR=v.bool(),eT=v.bool(),tT=v.str(),nT=v.bool(),oT=v.bool(),rT=v.int({min:1}),sT=v.str(),iT=v.str(),aT=v.str(),lT=v.str(),cT=v.bool(),dT=v.bool(),uT=v.str(),pT=v.str(),fT=v.str(),mT=v.int({min:0}),gT=v.int({min:0}),_T=v.int(),ET=v.bool(),hT=v.int(),ST=v.bool(),yT=v.bool(),OT=v.bool(),AT=v.bool(),CT=v.bool(),bT=v.bool(),RT=v.bool(),TT=v.int({min:1,max:2147483647}),DT=v.str(),LT=v.str(),IT=v.str(),wT=v.str(),PT=v.str(),xT=v.str(),NT=v.str(),kT=v.str(),vT=v.str(),MT=v.str(),UT=v.str();var HT=v.bool(),FT=v.str(),BT=v.str(),zT=v.str(),GT=v.bool(),WT=v.str(),jT=v.bool(),KT=v.bool(),$T=v.bool(),VT=v.str(),YT=v.int(),XT=v.str(),JT=v.int(),ZT=v.str(),qT=v.str(),QT=v.str(),eD=v.bool(),tD=v.bool(),nD=v.bool(),oD=v.int(),rD=v.int(),sD=v.int(),iD=v.int({min:1}),aD=v.int({min:1}),lD=v.bool(),cD=v.bool(),dD=v.str(),uD=v.str(),pD=v.str(),fD=v.str(),mD=v.str(),gD=v.str(),_D=v.str(),ED=v.str(),hD=v.str(),SD=v.str(),yD=v.str(),OD=v.str(),AD=v.str(),CD=v.str(),bD=v.str(),RD=v.str(),TD=v.int(),DD=v.int(),LD=v.int(),ID=v.str(),wD=v.int({min:0}),PD=v.int({min:0}),xD=v.int({min:0}),ND=v.int({min:1,digitsOnly:!0}),kD=v.bool(),vD=v.triBool(),MD=v.bool(),UD=v.bool(),HD=v.bool(),FD=v.bool(),BD=v.str(),zD=v.str(),GD=v.str(),WD=v.str(),jD=v.str(),KD=v.str(),$D=v.str(),VD=v.str(),YD=v.str();import{constants as qD}from"fs";import{access as ol,readdir as QD,readFile as eL,readlink as tL}from"fs/promises";import{homedir as nL}from"os";import{delimiter as oL,join as Si,resolve as Lp}from"path";function Sp(l){return!l.isDirectory()&&!l.isFile()&&!l.isSymbolicLink()&&!l.isFIFO()&&!l.isSocket()&&!l.isBlockDevice()&&!l.isCharacterDevice()}import{delimiter as Noe,isAbsolute as XD}from"path";function JD(l){let A=process.cwd();return l.filter((L)=>!ve(L,A))}function yp(l){return ZD(l,Bun.which(l))}function ZD(l,A){if(!A||process.platform!=="win32"||XD(l))return A;return JD([A])[0]??null}var Op=async(l)=>yp(l),Ap=yp;function ts(){return process.platform!=="linux"||f()}function Cp(){if(ts())return!1;return i().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function bp(){if(ts())return;try{return i().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function Rp(){if(ts())return!1;return i().existsSync("/.dockerenv")}function rL(){if(f())return Tp();let l=Si(y(),".config.json"),A=Tp();try{let L=i().statSync(l);if(L.isFile()&&(L.size>0||(L.mode&146)!==0&&!i().existsSync(A)))return l}catch{}return A}function Tp(){let l=`.claude${ot()}.json`;return Si(process.env.CLAUDE_CONFIG_DIR||nL(),l)}async function sL(){return null}async function _r(l){try{return!!await Op(l)}catch{return!1}}async function iL(){let l=[];if(await _r("npm"))l.push("npm");if(await _r("yarn"))l.push("yarn");if(await _r("pnpm"))l.push("pnpm");return l}async function aL(){let l=[];if(await _r("bun"))l.push("bun");if(await _r("deno"))l.push("deno");if(await _r("node"))l.push("node");return l}var Dp=["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"],lL=1000;async function cL(l){try{return/appinstaller/i.test(await tL(l))}catch{return!1}}async function dL(l){if(l===""||$e(l)||ye(l))return!1;return!await et(Lp(l))}async function uL(l,A){let L=E()==="windows",x=new Set(l),z=L?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],W=S((process.env.PATH??"").split(oL).map((Z)=>Z.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(W.map(async(Z)=>{if(!await dL(Z))return;let ne;try{ne=await QD(Z,{withFileTypes:!0})}catch{return}let ce=L&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(Z);for(let Te of ne){if(Te.isDirectory())continue;let Le=Te.name;if(L){let we=Le.toLowerCase(),Ie=we.lastIndexOf(".");if(Ie<=0||!z.includes(we.slice(Ie)))continue;Le=we.slice(0,Ie)}if(!x.has(Le)||A.has(Le))continue;if(L){if(ce&&await cL(Si(Z,Te.name)))continue}else{let we=Si(Z,Te.name);if((Te.isSymbolicLink()||Sp(Te))&&await et(Lp(we)))continue;try{await ol(we,qD.X_OK)}catch{continue}}A.add(Le)}}))}async function pL(){let l=new Set;try{await T(uL(Dp,l),lL,"build tool PATH scan timed out")}catch{}return Dp.filter((A)=>l.has(A))}function fL(l){try{if(!l.isWslEnvironment())return!1;let A=Ap("npm");if(A===null)return!1;return A.startsWith("/mnt/c/")}catch(A){return!1}}function mL(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var Ip=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function gL(l){let A=l.toLowerCase();return A.includes("windsurf")||A.includes("devin.app")||A.includes("devin desktop")||A.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(A)}function _L(){if(process.env.CURSOR_TRACE_ID)return"cursor";let l=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(l.includes("cursor"))return"cursor";if(gL(l))return"windsurf";if(l.includes("antigravity"))return"antigravity";let A=process.env.__CFBundleIdentifier?.toLowerCase();if(A?.includes("vscodium"))return"codium";if(A?.includes("windsurf")||A?.includes("devin"))return"windsurf";if(A?.includes("com.google.android.studio"))return"androidstudio";if(A){for(let L of Ip)if(A.includes(L))return L}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(xp())return"ssh-session";if(process.env.TERM){let L=process.env.TERM;if(L.includes("alacritty"))return"alacritty";if(L.includes("rxvt"))return"rxvt";if(L.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class wp{sources;globalClaudeFile;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(l){this.sources=l}getGlobalClaudeFile(){return this.globalClaudeFile??=rL()}seedGlobalClaudeFile(l){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=l,"seeded";return this.globalClaudeFile===l?"unchanged":"conflict"}getPackageManagers(){return this.packageManagers??=iL()}getRuntimes(){return this.runtimes??=aL()}getDetectedBuildTools(){return this.detectedBuildTools??=pL()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=fL(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=hL(this)}async prime(){if(this.primedWslInteropExists!==void 0||ts())return;let[l,A,L]=await Promise.all([ol("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),eL("/sys/hypervisor/uuid",{encoding:"utf8"}).then((x)=>x.trim().toLowerCase(),()=>{return}),ol("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=l,this.primedHypervisorUuid=A??"",this.primedDockerenvExists=L,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var EL=new s(()=>new wp({wslInteropExistsSync:Cp,readHypervisorUuidSync:bp,dockerenvExistsSync:Rp}));function ns(){return EL.of(C().host)}function Pp(){return ns().detectDeploymentEnvironment()}function hL(l){if(o(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(o(process.env.CODER)||process.env.CODER_WORKSPACE_NAME)return"coder";if(o(process.env.DEVPOD)||process.env.DEVPOD_WORKSPACE_UID)return"devpod";if(process.env.DAYTONA_WS_ID)return"daytona";if(o(process.env.GOOGLE_CLOUD_WORKSTATIONS))return"gcp-cloud-workstations";if(process.env.C9_PID||process.env.C9_USER)return"aws-cloud9";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(o(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(o(process.env.RENDER))return"render";if(o(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(o(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";if(l.hypervisorUuid().startsWith("ec2"))return"aws-ec2";if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(o(process.env.GITHUB_ACTIONS))return"github-actions";if(o(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(o(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";if(l.isDockerenvPresent())return"docker";if(os.platform==="darwin")return"unknown-darwin";if(os.platform==="linux")return"unknown-linux";if(os.platform==="win32")return"unknown-win32";return"unknown"}function xp(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var os={probeInternalNetworkAccess:sL,isCI:o(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:_L(),isSSH:xp,getPackageManagers(){return ns().getPackageManagers()},getRuntimes(){return ns().getRuntimes()},isRunningWithBun:te,isWslEnvironment(){return ns().isWslEnvironment()},isNpmFromWindowsPath(){return ns().isNpmFromWindowsPath()},isConductor:mL,detectDeploymentEnvironment:Pp};var Er=["5m","1h"];var SL=v.triBool(),yL=v.int({min:0}),OL=v.int({min:0}),AL=v.int({min:0}),CL=v.triBool(),bL=v.triBool(),RL=v.bool(),TL=v.bool(),DL=v.bool(),LL=v.str(),IL=v.bool(),wL=v.str(),PL=v.str(),xL=v.triBool(),NL=v.triBool(),kL=v.enum(["strict","relaxed"]),vL=v.enum(["control","no_scratchpad","no_scratchpad_capped","no_scratchpad_keep_asks","lean","short","short_v2","capped"]),ML=v.bool(),UL=v.str(),HL=v.triBool(),FL=v.enum(["drop","block","off"]),BL=v.str(),zL=v.triBool(),GL=v.triBool(),WL=v.triBool(),jL=v.triBool(),KL=v.triBool(),$L=v.triBool(),VL=v.triBool(),YL=v.triBool(),XL=v.bool(),JL=v.bool(),ZL=v.bool(),qL=v.bool(),QL=v.bool(),eI=v.bool(),tI=v.bool(),nI=v.bool(),oI=v.str(),rI=v.int({min:1,max:10080,digitsOnly:!0}),sI=v.bool(),iI=v.bool(),aI=v.bool(),lI=v.bool(),cI=v.bool(),dI=v.bool(),uI=v.bool(),pI=v.bool(),fI=v.bool(),mI=v.bool(),gI=v.bool(),_I=v.bool(),EI=v.bool(),hI=v.bool(),SI=v.bool(),yI=v.bool(),OI=v.bool(),AI=v.bool(),CI=v.bool(),bI=v.bool(),RI=v.bool(),TI=v.bool(),DI=v.bool(),LI=v.bool(),II=v.bool(),wI=v.bool(),PI=v.bool(),xI=v.bool(),NI=v.bool(),kI=v.bool(),vI=v.bool(),MI=v.bool(),UI=v.bool(),HI=v.triBool(),FI=v.bool(),BI=v.bool(),zI=v.bool(),GI=v.bool(),WI=v.bool(),jI=v.bool(),KI=v.bool(),$I=v.bool(),VI=v.enum(["corroborate","immediate","never"]),YI=v.triBool(),XI=v.triBool(),JI=v.bool(),ZI=v.bool(),qI=v.bool(),QI=v.bool(),ew=v.bool(),tw=v.bool(),nw=v.bool(),ow=v.bool(),rw=v.bool(),sw=v.bool(),iw=v.bool(),aw=v.bool(),lw=v.bool(),cw=v.bool(),dw=v.triBool(),uw=v.bool(),pw=v.bool(),fw=v.bool(),mw=v.bool(),gw=v.bool(),_w=v.bool(),Ew=v.bool(),hw=v.bool(),Sw=v.bool(),yw=v.triBool(),Ow=v.bool(),Aw=v.bool(),Cw=v.bool(),bw=v.bool(),Rw=v.triBool(),Tw=v.bool(),Dw=v.bool(),Lw=v.bool(),Iw=v.triBool(),ww=v.bool(),Pw=v.bool(),xw=v.bool(),Nw=v.triBool(),kw=v.bool(),vw=v.bool(),Mw=v.bool(),Uw=v.bool(),Hw=v.triBool(),Fw=v.bool(),Bw=v.triBool(),zw=v.bool(),Gw=v.bool(),Ww=v.str(),jw=v.bool(),Kw=v.int({min:1,digitsOnly:!0}),$w=v.triBool(),Vw=v.bool(),Yw=v.triBool(),Xw=v.bool(),Jw=v.bool(),Zw=v.triBool(),qw=v.bool(),Qw=v.bool(),eP=v.bool(),tP=v.str(),nP=v.bool(),oP=v.bool(),rP=v.bool(),sP=v.enum(["baseline","off"]),iP=v.str(),aP=v.int(),lP=v.str(),cP=v.str(),dP=v.str(),uP=v.triBool(),pP=v.str(),fP=v.triBool(),mP=v.triBool(),gP=v.triBool(),_P=v.bool(),EP=v.bool(),hP=v.triBool(),SP=v.triBool(),yP=v.str(),OP=v.triBool(),AP=v.triBool(),CP=v.int({min:1}),bP=v.int({min:1,wholeValue:!0}),RP=v.str(),TP=v.triBool(),DP=v.triBool(),LP=v.triBool(),IP=v.triBool(),wP=v.triBool(),PP=v.triBool(),xP=v.triBool(),NP=v.triBool(),kP=v.triBool(),vP=v.triBool(),MP=v.triBool(),UP=v.triBool(),HP=v.triBool(),FP=v.triBool(),BP=v.triBool(),zP=v.triBool(),GP=v.int({min:0}),WP=v.bool(),jP=v.bool(),KP=v.triBool(),$P=v.triBool(),VP=v.triBool(),YP=v.triBool(),XP=v.triBool(),JP=v.triBool(),ZP=v.triBool(),qP=v.triBool(),QP=v.triBool(),ex=v.triBool(),tx=v.triBool(),nx=v.triBool(),ox=v.triBool(),rx=v.triBool(),sx=v.triBool(),ix=v.triBool(),ax=v.triBool(),lx=v.triBool(),cx=v.str(),dx=v.bool(),ux=v.bool(),px=v.bool(),fx=v.bool(),mx=v.str(),gx=v.bool(),_x=v.triBool(),Ex=v.bool(),hx=v.bool(),Sx=v.bool(),yx=v.bool(),Ox=v.bool(),Ax=v.bool(),Cx=v.bool(),bx=v.bool(),Rx=v.bool(),Tx=v.triBool(),Dx=v.bool(),Lx=v.triBool(),Ix=v.bool(),wx=v.bool(),Px=v.bool(),xx=v.bool(),Nx=v.triBool(),kx=v.bool(),vx=v.bool(),Mx=v.bool(),Ux=v.bool(),Hx=v.bool(),Fx=v.bool(),Bx=v.bool(),zx=v.triBool(),Gx=v.str(),Wx=v.bool(),jx=v.bool(),Kx=v.bool(),$x=v.bool(),Vx=v.bool(),Yx=v.bool(),Xx=v.triBool(),Jx=v.triBool(),Zx=v.bool(),qx=v.bool(),Qx=v.bool(),eN=v.str(),tN=v.bool(),nN=v.bool(),oN=v.bool(),rN=v.bool(),sN=v.bool(),iN=v.bool(),aN=v.bool(),lN=v.str(),cN=v.bool(),dN=v.bool(),uN=v.bool(),pN=v.bool(),fN=v.bool(),mN=v.bool(),gN=v.bool(),_N=v.bool(),EN=v.bool(),hN=v.bool(),SN=v.triBool(),yN=v.bool(),ON=v.bool(),AN=v.bool(),CN=v.triBool(),bN=v.bool(),RN=v.triBool(),TN=v.int({min:1,digitsOnly:!0}),DN=v.int({min:0,digitsOnly:!0}),LN=v.bool(),IN=v.bool(),wN=v.bool(),PN=v.triBool(),xN=v.bool(),NN=v.bool(),kN=v.bool(),vN=v.bool(),MN=v.bool(),UN=v.bool(),HN=v.bool(),FN=v.bool(),BN=v.triBool(),zN=v.triBool(),GN=v.triBool(),WN=v.bool(),jN=v.bool(),KN=v.bool(),$N=v.bool(),VN=v.bool(),YN=v.int({min:1}),XN=v.int({min:1}),JN=v.int({min:0}),ZN=v.int({min:1,max:256,digitsOnly:!0}),qN=v.bool(),QN=v.bool(),ek=v.bool(),tk=v.bool(),nk=v.bool(),ok=v.bool(),rk=v.bool(),sk=v.bool(),ik=v.bool(),ak=v.bool(),lk=v.bool(),ck=v.bool(),dk=v.bool(),uk=v.bool(),pk=v.bool(),fk=v.bool(),mk=v.bool(),gk=v.bool(),_k=v.bool(),Ek=v.bool(),hk=v.bool(),Sk=v.bool(),yk=v.bool(),Ok=v.bool(),Ak=v.triBool(),Ck=v.bool(),bk=v.bool(),Rk=v.bool(),Tk=v.triBool(),Dk=v.triBool(),Lk=v.bool(),Ik=v.bool(),wk=v.enum(Er),Pk=v.enum(Er),xk=v.enum(["5m"]),Nk=v.bool(),kk=v.bool(),vk=v.str(),Mk=v.bool(),Uk=v.bool(),Hk=v.bool(),Fk=v.bool(),Bk=v.bool(),zk=v.bool(),Gk=v.bool(),Wk=v.bool(),jk=v.triBool(),Kk=v.str(),$k=v.bool();var Vk=v.str(),Yk=v.str(),Xk=v.str(),Jk=v.str(),Zk=v.str(),qk=v.str(),Qk=v.str(),ev=v.str(),tv=v.str(),nv=v.str(),ov=v.str(),rv=v.str(),sv=v.str(),iv=v.str(),av=v.str(),lv=v.str(),cv=v.str(),dv=v.str(),uv=v.str(),pv=v.str(),fv=v.str(),mv=v.str(),gv=v.str(),_v=v.str(),Ev=v.str(),hv=v.int({min:0,digitsOnly:!0}),Sv=v.int({min:0,digitsOnly:!0}),yv=v.str(),Ov=v.str(),Av=v.str(),Cv=v.str(),bv=v.str(),Rv=v.str(),Tv=v.str(),Dv=v.str(),Lv=v.str(),Iv=v.str(),wv=v.str(),Pv=v.str(),xv=v.str(),Nv=v.str(),kv=v.str(),vv=v.str(),Mv=v.str(),Uv=v.str(),Hv=v.str(),Fv=v.str(),Bv=v.str(),zv=v.str(),Gv=v.str(),Wv=v.str(),jv=v.str(),Kv=v.str(),$v=v.str(),Vv=v.str(),Yv=v.str(),Xv=v.str(),Jv=v.str(),Zv=v.str(),qv=v.str(),Qv=v.str(),eM=v.str(),tM=v.str(),nM=v.str(),oM=v.str(),rM=v.str(),sM=v.str(),iM=v.str(),aM=v.str(),lM=v.str(),cM=v.str(),dM=v.str(),uM=v.str(),pM=v.str(),fM=v.rawStr(),mM=v.rawStr(),gM=v.str(),_M=v.str(),EM=v.str(),hM=v.str(),SM=v.str(),yM=v.str(),OM=v.str(),AM=v.str(),CM=v.str(),bM=v.str(),RM=v.str(),TM=v.str(),DM=v.str(),LM=v.str(),IM=v.str(),wM=v.str(),PM=v.str(),xM=v.str(),NM=v.str(),kM=v.str(),vM=v.str(),MM=v.str(),UM=v.str(),HM=v.str(),FM=v.str(),BM=v.str(),zM=v.str(),GM=v.str(),WM=v.str(),jM=v.str(),KM=v.str(),$M=v.str(),VM=v.str(),YM=v.str(),XM=v.str(),JM=v.str(),ZM=v.str(),qM=v.str(),QM=v.rawStr(),eU=v.str(),tU=v.str(),nU=v.str(),oU=v.str(),rU=v.str(),sU=v.str(),iU=v.str(),aU=v.str(),lU=v.str(),cU=v.str(),dU=v.str(),uU=v.str(),pU=v.str(),fU=v.str(),mU=v.str(),gU=v.str(),_U=v.str(),EU=v.str(),hU=v.str(),SU=v.str(),yU=v.str(),OU=v.str(),AU=v.str(),CU=v.rawStr(),bU=v.str(),RU=v.str(),TU=v.str(),DU=v.str(),LU=v.str(),IU=v.str(),wU=v.str(),PU=v.str(),xU=v.str(),NU=v.str(),kU=v.str(),vU=v.str(),MU=v.str(),UU=v.str(),HU=v.str(),FU=v.str(),BU=v.str(),zU=v.str(),GU=v.str(),WU=v.str(),jU=v.str(),KU=v.str(),$U=v.str(),VU=v.str(),YU=v.str(),XU=v.str(),JU=v.str(),ZU=v.str(),qU=v.str(),QU=v.str(),eH=v.str(),tH=v.str(),nH=v.str(),oH=v.str(),rH=v.str(),sH=v.str(),iH=v.str(),aH=v.str(),lH=v.str(),cH=v.str(),dH=v.str(),uH=v.str(),pH=v.str(),fH=v.str(),mH=v.str(),gH=v.str(),_H=v.str(),EH=v.str(),hH=v.str(),SH=v.str(),yH=v.str(),OH=v.str(),AH=v.str(),CH=v.str(),bH=v.str(),RH=v.str(),TH=v.str();var DH=v.str(),LH=v.str(),IH=v.str(),wH=v.str(),PH=v.str(),xH=v.rawStr(),NH=v.str(),kH=v.str(),vH=v.str(),MH=v.str(),UH=v.str(),HH=v.str(),FH=v.str(),BH=v.str(),zH=v.str(),GH=v.str(),WH=v.bool(),jH=v.str(),KH=v.str(),$H=v.str(),VH=v.str(),YH=v.str(),XH=v.str(),JH=v.str(),ZH=v.bool(),qH=v.str(),QH=v.str(),e0=v.str(),t0=v.str(),n0=v.str(),o0=v.str(),r0=v.str(),s0=v.str(),i0=v.str(),a0=v.str(),l0=v.str(),c0=v.str(),d0=v.str(),u0=v.str(),p0=v.str(),f0=v.bool(),m0=v.str(),g0=v.str(),_0=v.str(),E0=v.str(),h0=v.str(),S0=v.str(),y0=v.str(),O0=v.str(),A0=v.str(),C0=v.bool(),b0=v.str(),R0=v.int({min:0}),T0=v.bool(),D0=v.str(),L0=v.str(),I0=v.str(),w0=v.str(),P0=v.enum(["1","spent"]),x0=v.str(),N0=v.str(),k0=v.str(),v0=v.str(),M0=v.str(),U0=v.str(),H0=v.str(),F0=v.str(),B0=v.str(),z0=v.str(),G0=v.str(),W0=v.str(),j0=v.bool(),il=v.bool(),K0=v.bool(),$0=v.bool(),V0=v.bool(),Y0=v.bool(),X0=v.bool(),J0=v.bool(),Z0=v.bool(),q0=v.bool(),Q0=v.str(),eF=v.str(),tF=v.str(),nF=v.str(),oF=v.bool(),rF=v.bool(),sF=v.bool(),iF=v.bool(),aF=v.bool(),lF=v.bool(),cF=v.bool(),dF=v.str(),uF=v.str(),pF=v.str(),fF=v.str(),mF=v.bool(),gF=v.bool(),_F=v.str(),EF=v.int({min:0}),hF=v.int({min:0}),SF=v.str(),yF=v.str(),OF=v.str(),AF=v.str(),CF=v.str(),bF=v.str(),RF=v.int({min:1,wholeValue:!0}),TF=v.str(),DF=v.str(),LF=v.str(),IF=v.bool(),wF=v.str(),PF=v.str(),xF=v.str(),NF=v.str(),kF=v.str(),vF=v.str(),MF=v.str(),UF=v.str(),HF=v.str(),FF=v.str(),BF=v.bool(),zF=v.bool(),GF=v.str(),WF=v.str(),jF=v.str(),KF=v.str(),$F=v.str(),VF=v.str(),YF=v.str(),XF=v.str(),JF=v.str(),ZF=v.str(),qF=v.str(),QF=v.str(),eB=v.str(),tB=v.str(),nB=v.str(),oB=v.str(),rB=v.str(),sB=v.str(),iB=v.str(),aB=v.str(),lB=v.str(),cB=v.enum(["claude_ai_chat"]),dB=v.str(),uB=v.str(),pB=v.str(),fB=v.str(),mB=v.bool(),gB=v.int({min:1,wholeValue:!0}),_B=v.str(),EB=v.str(),hB=v.str(),SB=v.str(),yB=v.str(),OB=v.str(),AB=v.str(),CB=v.str(),bB=v.str(),RB=v.str(),TB=v.str(),DB=v.str(),LB=v.str(),IB=v.str(),wB=v.str(),PB=v.str(),xB=v.str(),NB=v.str(),kB=v.str(),vB=v.str(),MB=v.str(),UB=v.str(),HB=v.str(),FB=v.str(),BB=v.str(),zB=v.str(),GB=v.str(),WB=v.str(),jB=v.str(),KB=v.str(),$B=v.str(),VB=v.str(),YB=v.str(),XB=v.str(),JB=v.str(),ZB=v.str(),qB=v.str(),QB=v.str(),ez=v.str(),tz=v.str(),nz=v.rawStr(),oz=v.str(),rz=v.str(),sz=v.str(),iz=v.str(),az=v.str(),lz=v.str(),cz=v.str(),dz=v.bool(),uz=v.bool(),pz=v.bool(),fz=v.str(),mz=v.str(),gz=v.str(),_z=v.bool(),Ez=v.bool(),hz=v.bool(),Sz=v.bool(),yz=v.bool(),Oz=v.bool(),Az=v.bool(),Cz=v.bool(),bz=v.bool(),Rz=v.bool(),Tz=v.bool(),Dz=v.bool(),Lz=v.bool(),Iz=v.bool(),wz=v.rawStr(),Pz=v.bool(),xz=v.bool(),Nz=v.bool(),kz=v.bool(),vz=v.bool(),Mz=v.bool(),Uz=v.bool(),Hz=v.bool(),Fz=v.bool(),Bz=v.bool(),zz=v.bool(),Gz=v.bool(),Wz=v.bool(),jz=v.int({min:0}),Kz=v.bool(),$z=v.bool(),Vz=v.bool(),Yz=v.bool(),Xz=v.bool(),Jz=v.bool(),Zz=v.bool(),qz=v.triBool(),Qz=v.bool(),eG=v.str(),tG=v.bool(),nG=v.bool(),oG=v.bool(),rG=v.bool(),sG=v.bool(),iG=v.bool(),aG=v.triBool(),lG=v.bool(),cG=v.bool(),dG=v.bool(),uG=v.str(),pG=v.bool(),fG=v.str(),mG=v.int({min:1,max:2147483647,wholeValue:!0}),gG=v.int({min:1,max:100,digitsOnly:!0}),_G=v.bool(),EG=v.str(),hG=v.bool(),SG=v.bool(),yG=v.bool(),OG=v.bool(),AG=v.bool(),CG=v.triBool(),bG=v.bool(),RG=v.str(),TG=v.str(),DG=v.bool(),LG=v.int({min:1,max:32,digitsOnly:!0}),IG=v.int({min:1}),wG=v.int({min:0}),PG=v.bool(),xG=v.triBool(),NG=v.bool(),kG=v.bool(),vG=v.bool(),MG=v.bool(),UG=v.bool(),HG=v.str(),FG=v.bool(),BG=v.rawStr(),zG=v.str(),GG=v.str(),WG=v.bool(),jG=v.rawStr(),KG=v.str(),$G=v.str(),VG=v.str(),YG=v.str(),XG=v.str(),JG=v.bool(),ZG=v.bool(),qG=v.bool(),QG=v.triBool(),eW=v.bool(),tW=v.bool(),nW=v.int(),oW=v.int(),rW=v.int(),sW=v.int({min:1,max:2147483647,digitsOnly:!0}),iW=v.int(),aW=v.int(),lW=v.int(),cW=v.int({min:1}),dW=v.int({min:0,max:10080,digitsOnly:!0}),uW=v.int(),pW=v.int(),fW=v.int({min:1,digitsOnly:!0}),mW=v.int({min:1,digitsOnly:!0}),gW=v.int({min:1,digitsOnly:!0}),_W=v.int({min:0,digitsOnly:!0}),EW=v.int(),hW=v.int(),SW=v.int(),yW=v.int(),OW=v.int(),AW=v.int(),CW=v.int(),bW=v.int(),RW=v.int({min:1}),TW=v.int(),DW=v.int(),LW=v.int(),IW=v.int({min:1}),wW=v.int({min:1}),PW=v.int({min:0}),xW=v.int({min:0,max:86400000}),NW=v.int(),kW=v.int(),vW=v.int({min:1000,max:60000}),MW=v.int({wholeValue:!0}),UW=v.int({min:0,digitsOnly:!0}),HW=v.int({min:0,digitsOnly:!0}),FW=v.bool(),BW=v.int(),zW=v.int({min:1}),GW=v.int({min:1}),WW=v.int({min:3}),jW=v.int({min:1,max:2147483647,digitsOnly:!0}),KW=v.str(),$W=v.int({min:1}),VW=v.int(),YW=v.triBool(),XW=v.int({min:1}),JW=v.int({min:1}),ZW=v.int({min:1}),qW=v.int({min:1}),QW=v.str(),ej=v.int({min:1}),tj=v.int({min:1}),nj=v.str(),oj=v.int(),rj=v.int({min:1}),sj=v.int(),ij=v.int(),aj=v.int({min:1}),lj=v.int({min:0}),cj=v.str(),dj=v.int({min:0,digitsOnly:!0}),uj=v.names(16),pj=v.bool(),fj=v.bool(),mj=v.bool(),gj=v.bool(),_j=v.int({min:1,digitsOnly:!0}),Ej=v.int({min:1});var hj=v.str(),Sj=v.str(),yj=v.str(),Oj=v.str(),Aj=v.str(),Cj=v.str(),bj=v.str(),Rj=v.str(),Tj=v.str(),Dj=v.str(),Lj=v.str(),Ij=v.str(),wj=v.str(),Pj=v.str(),xj=v.str(),Nj=v.str(),kj=v.str(),vj=v.str(),Mj=v.str(),Uj=v.str(),Hj=v.bool(),Fj=v.str(),Bj=v.str(),zj=v.str(),Gj=v.str(),Wj=v.bool(),jj=v.str(),Kj=v.str(),$j=v.str(),Vj=v.str(),Yj=v.bool(),Xj=v.bool(),Jj=v.bool(),Zj=v.bool(),qj=v.str(),Qj=v.bool(),eK=v.triBool(),tK=v.bool(),nK=v.bool(),oK=v.bool(),rK=v.bool(),sK=v.bool(),iK=v.str(),aK=v.str(),lK=v.str(),cK=v.bool();var dK=v.str(),uK=v.str(),pK=v.str(),fK=v.str(),mK=v.str(),gK=v.str(),_K=v.str(),EK=v.str(),hK=v.str(),SK=v.str(),yK=v.str(),OK=v.bool(),AK=v.str(),CK=v.str(),bK=v.str(),RK=v.str(),TK=v.str(),DK=v.str(),LK=v.int(),IK=v.int(),wK=v.int(),PK=v.int(),xK=v.int({min:1,digitsOnly:!0}),NK=v.int({min:1,digitsOnly:!0}),kK=v.int({min:1}),vK=v.str(),MK=v.int(),UK=v.int(),HK=v.int(),FK=v.int(),BK=v.int({min:0,digitsOnly:!0}),zK=v.int({min:500,max:32000,digitsOnly:!0}),GK=v.int({min:32000,max:64000,digitsOnly:!0}),WK=v.int(),jK=v.triBool(),KK=v.bool(),$K=v.triBool(),VK=v.triBool(),YK=v.triBool(),XK=v.triBool(),JK=v.int({min:0,max:9,digitsOnly:!0}),ZK=v.int({min:0,max:2,digitsOnly:!0}),qK=v.int({min:0,max:2,digitsOnly:!0}),QK=v.int({min:1,max:2000,digitsOnly:!0}),e$=v.int({min:1,max:2000,digitsOnly:!0}),t$=v.rawStr(),n$=v.int({min:1}),o$=v.int({min:1}),r$=v.int({min:1}),s$=v.int({min:1}),i$=v.bool(),a$=v.int({min:1,digitsOnly:!0}),l$=v.int({min:1,digitsOnly:!0}),c$=v.int({min:60000,max:10800000,digitsOnly:!0}),d$=v.enum(["capacity"]),u$=v.bool(),p$=v.bool(),f$=v.bool(),m$=v.int(),g$=v.int({min:0});var Np=["us","eu","apac","jp","au","us-gov","global"],kp=["us","eu","apac","jp","au","global"];var _$=v.bool(),E$=v.bool(),h$=v.bool(),S$=v.bool(),y$=v.bool(),O$=v.bool(),A$=v.str(),C$=v.triBool(),b$=v.str(),R$=v.str(),T$=v.enum(kp),D$=v.str(),L$=v.str(),I$=v.str(),w$=v.str(),P$=v.str(),x$=v.str(),N$=v.str(),k$=v.str(),v$=v.str(),M$=v.str(),U$=v.str(),H$=v.str(),F$=v.str(),B$=v.str(),z$=v.str(),G$=v.str(),W$=v.str(),j$=v.str(),K$=v.str(),$$=v.str(),V$=v.str(),Y$=v.str(),X$=v.str(),J$=v.str(),Z$=v.str(),q$=v.str(),Q$=v.str(),e1=v.str(),t1=v.bool(),n1=v.bool(),o1=v.bool(),r1=v.bool(),s1=v.bool(),i1=v.bool(),a1=v.bool(),l1=v.str(),c1=v.int({min:1,max:2147000000,digitsOnly:!0}),d1=v.bool(),u1=v.int({min:1,max:2147483647,digitsOnly:!0}),p1=v.str(),f1=v.int(),m1=v.bool(),g1=v.bool(),_1=v.bool(),E1=v.str(),h1=v.str(),S1=v.str(),y1=v.str(),O1=v.bool(),A1=v.bool(),C1=v.bool(),b1=v.str(),R1=v.rawStr(),T1=v.rawStr(),D1=v.rawStr(),L1=v.bool(),I1=v.str(),w1=v.bool(),P1=v.bool(),x1=v.str(),N1=v.bool(),k1=v.bool(),v1=v.enum(["enforce","observe","off"]),M1=v.str(),U1=v.bool();var F1={...tl,...dl,...ll,...rl,...cl,...sl,...nl,...al},B1=new WeakMap,z1="CLAUDE_CODE_LAZY_ENV_GETTERS";function ul(l,A,L=il.parse(process.env[z1])===!0){let x=L?G1(l,A):Object.create(A);for(let[z,W]of L?[]:Object.entries(l))Object.defineProperty(x,z,{get:vp(z,W,x),enumerable:!0,configurable:!0});return B1.set(x,L?l:null),Object.defineProperties(x,{set:{value:(z,W)=>{process.env[z]=Ep(W)}},unset:{value:(z)=>{delete process.env[z]}}}),x}function vp(l,A,L){let x=L,z;return()=>{let W=process.env[l];if(W!==x)z=A.parse(W),x=W;return z}}function yi(l,A){return typeof A==="string"&&Object.hasOwn(l,A)}function G1(l,A){let L=new Proxy(Object.create(A&&Object.getPrototypeOf(A)),{get:(Z,ne,ce)=>{if(!yi(l,ne))return Reflect.get(Z,ne,ce);let Te=vp(ne,l[ne],W);if(ce===W)Object.defineProperty(W,ne,{get:Te,configurable:!0});return Te()},set:(Z,ne,ce,Te)=>!yi(l,ne)&&Reflect.set(Z,ne,ce,Te),has:(Z,ne)=>yi(l,ne)||Reflect.has(Z,ne)}),x=Object.create(L),z=A===null?{}:Object.getOwnPropertyDescriptors(A);for(let[Z,ne]of Object.entries(z)){if(yi(l,Z))continue;Object.defineProperty(x,Z,typeof ne.value==="function"?{...ne,value:{[Z](...ce){return Reflect.apply(Reflect.get(A,Z),this,ce)}}[Z]}:ne)}let W=Object.create(x);return W}var en=ul(F1,os),W1={},Are=ul(W1,null),j1={},Cre=ul(j1,null);function Mp(){}class Hp{pendingWrite=Promise.resolve();cleanupRegistered=!1;notStarted=[];appendOldest=this.appendOldestNotStarted.bind(this);append(l,A){let L=this.notStarted.at(-1);if(L?.logFile===l){L.lines+=A;return}if(this.notStarted.push({logFile:l,lines:A}),this.pendingWrite=this.pendingWrite.then(this.appendOldest).catch(Mp),!this.cleanupRegistered)this.cleanupRegistered=!0,Me(()=>this.flush())}async appendOldestNotStarted(){let l=this.notStarted.shift();if(l===void 0)return;let A=i();try{await A.appendFile(l.logFile,l.lines)}catch{await A.mkdir(K1(l.logFile)).catch(Mp),await A.appendFile(l.logFile,l.lines)}}flush(){return this.pendingWrite}}var $1=new s(()=>new Hp);function V1(){return M($1)}function rs(l,A,L,x="queued"){let z=X1();if(!z)return;let W;try{W=Up(l,A,Y1(L))}catch{W=Up(l,A,{diagnostics_payload_failed:!0})}if(x==="now")try{i().appendFileSync(z,W)}catch{}else V1().append(z,W)}function Y1(l){try{return(typeof l==="function"?l():l)??{}}catch{return{diagnostics_payload_failed:!0}}}function Up(l,A,L){let x={timestamp:new Date().toISOString(),level:l,event:A,data:L,cc_version:typeof{VERSION:"0.3.314"}<"u"?"0.3.314":"unknown"};return n(x)+`
`}function X1(){return J1()?void 0:en.CLAUDE_CODE_DIAGNOSTICS_FILE}function J1(){return _p()?f():Ve()}import{isUtf8 as Z1}from"buffer";import{open as q1}from"fs/promises";function Q1(l,A,L){let x=l.statSync(A);return Oi(x,A,L),x}function Oi(l,A,L){if(l.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:A});if(!l.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:A});if(L!==void 0&&l.size>L)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:A,size:l.size,maxBytes:L})}function pl(l,A,L){if(L===void 0)return;if(l>L)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:A,size:l,maxBytes:L})}function Fp(l){return l!=null&&typeof l==="object"&&"code"in l&&l.code==="ERR_FILE_TOO_LARGE"}function Bp(l){if(l.byteLength===0)return"utf8";if(l.byteLength>=2){if(l[0]===255&&l[1]===254)return"utf16le"}if(l.byteLength>=3&&l[0]===239&&l[1]===187&&l[2]===191)return"utf8";return"utf8"}var zp=4096,eV=8000;function tV(l){return l.subarray(0,eV).includes(0)}function nV(l){let A=Bp(l.subarray(0,zp));if(A!=="utf8")return{encoding:A};if(l.byteLength>=2&&l[0]===254&&l[1]===255)return{encoding:A,notText:"utf16be"};if(tV(l))return{encoding:A,notText:"nul"};return Z1(l)?{encoding:A}:{encoding:A,notText:"not_utf8"}}function oV(l){let{buffer:A,bytesRead:L}=i().readSync(l,{length:zp});return Bp(A.subarray(0,L))}function Gp(l){let A=0,L=0;for(let x=0;x<l.length;x++)if(l[x]===`
`)if(x>0&&l[x-1]==="\r")A++;else L++;return A>L?"CRLF":"LF"}function rV(l,A,L){let x=i(),{resolvedPath:z,isSymlink:W}=ge(x,l);if(W)e(`Reading through symlink: ${l} -> ${z}`);let Z=Q1(x,l,A);L?.(Z);let ne=oV(l),ce;if(A===void 0)ce=x.readFileSync(l,{encoding:ne});else{let{buffer:Le,bytesRead:we}=x.readSync(l,{length:A+1});pl(we,l,A),ce=Le.subarray(0,we).toString(ne)}let Te=Gp(ce.slice(0,4096));return{content:ce.replaceAll(`\r
`,`
`),encoding:ne,lineEndings:Te}}function fo(l,A,L){return rV(l,A,L).content}async function Wp(l,A){let Z=[];try{let L=i();let{resolvedPath:x,isSymlink:z}=ge(L,l);if(z)e(`Reading through symlink: ${l} -> ${x}`);Oi(await L.stat(l),l,A);const W=m(Z,await q1(l,Ze()),1);return await sV(W,l,A)}catch(ne){var ce=ne,Te=1}finally{var Le=h(Z,ce,Te);Le&&await Le}}async function sV(l,A,L){Oi(await l.stat(),A,L);let x=L===void 0?await l.readFile():await tt(l,L+1,"file");pl(x.length,A,L);let{encoding:z,notText:W}=nV(x),Z=x.toString(z),ne=Gp(Z.slice(0,4096));return{content:Z.replaceAll(`\r
`,`
`),encoding:z,lineEndings:ne,...W&&{notText:W}}}var jp;(function(l){l[l.lineFeed=10]="lineFeed",l[l.carriageReturn=13]="carriageReturn",l[l.space=32]="space",l[l._0=48]="_0",l[l._1=49]="_1",l[l._2=50]="_2",l[l._3=51]="_3",l[l._4=52]="_4",l[l._5=53]="_5",l[l._6=54]="_6",l[l._7=55]="_7",l[l._8=56]="_8",l[l._9=57]="_9",l[l.a=97]="a",l[l.b=98]="b",l[l.c=99]="c",l[l.d=100]="d",l[l.e=101]="e",l[l.f=102]="f",l[l.g=103]="g",l[l.h=104]="h",l[l.i=105]="i",l[l.j=106]="j",l[l.k=107]="k",l[l.l=108]="l",l[l.m=109]="m",l[l.n=110]="n",l[l.o=111]="o",l[l.p=112]="p",l[l.q=113]="q",l[l.r=114]="r",l[l.s=115]="s",l[l.t=116]="t",l[l.u=117]="u",l[l.v=118]="v",l[l.w=119]="w",l[l.x=120]="x",l[l.y=121]="y",l[l.z=122]="z",l[l.A=65]="A",l[l.B=66]="B",l[l.C=67]="C",l[l.D=68]="D",l[l.E=69]="E",l[l.F=70]="F",l[l.G=71]="G",l[l.H=72]="H",l[l.I=73]="I",l[l.J=74]="J",l[l.K=75]="K",l[l.L=76]="L",l[l.M=77]="M",l[l.N=78]="N",l[l.O=79]="O",l[l.P=80]="P",l[l.Q=81]="Q",l[l.R=82]="R",l[l.S=83]="S",l[l.T=84]="T",l[l.U=85]="U",l[l.V=86]="V",l[l.W=87]="W",l[l.X=88]="X",l[l.Y=89]="Y",l[l.Z=90]="Z",l[l.asterisk=42]="asterisk",l[l.backslash=92]="backslash",l[l.closeBrace=125]="closeBrace",l[l.closeBracket=93]="closeBracket",l[l.colon=58]="colon",l[l.comma=44]="comma",l[l.dot=46]="dot",l[l.doubleQuote=34]="doubleQuote",l[l.minus=45]="minus",l[l.openBrace=123]="openBrace",l[l.openBracket=91]="openBracket",l[l.plus=43]="plus",l[l.slash=47]="slash",l[l.formFeed=12]="formFeed",l[l.tab=9]="tab"})(jp||(jp={}));var aV=Array(20).fill(0).map((l,A)=>" ".repeat(A));var lV={" ":{"\n":Array(200).fill(0).map((l,A)=>`
`+" ".repeat(A)),"\r":Array(200).fill(0).map((l,A)=>"\r"+" ".repeat(A)),"\r\n":Array(200).fill(0).map((l,A)=>`\r
`+" ".repeat(A))},"\t":{"\n":Array(200).fill(0).map((l,A)=>`
`+"\t".repeat(A)),"\r":Array(200).fill(0).map((l,A)=>"\r"+"\t".repeat(A)),"\r\n":Array(200).fill(0).map((l,A)=>`\r
`+"\t".repeat(A))}};var $p;(function(l){l.DEFAULT={allowTrailingComma:!1}})($p||($p={}));var Vp;(function(l){l[l.None=0]="None",l[l.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",l[l.UnexpectedEndOfString=2]="UnexpectedEndOfString",l[l.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",l[l.InvalidUnicode=4]="InvalidUnicode",l[l.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",l[l.InvalidCharacter=6]="InvalidCharacter"})(Vp||(Vp={}));var Yp;(function(l){l[l.OpenBraceToken=1]="OpenBraceToken",l[l.CloseBraceToken=2]="CloseBraceToken",l[l.OpenBracketToken=3]="OpenBracketToken",l[l.CloseBracketToken=4]="CloseBracketToken",l[l.CommaToken=5]="CommaToken",l[l.ColonToken=6]="ColonToken",l[l.NullKeyword=7]="NullKeyword",l[l.TrueKeyword=8]="TrueKeyword",l[l.FalseKeyword=9]="FalseKeyword",l[l.StringLiteral=10]="StringLiteral",l[l.NumericLiteral=11]="NumericLiteral",l[l.LineCommentTrivia=12]="LineCommentTrivia",l[l.BlockCommentTrivia=13]="BlockCommentTrivia",l[l.LineBreakTrivia=14]="LineBreakTrivia",l[l.Trivia=15]="Trivia",l[l.Unknown=16]="Unknown",l[l.EOF=17]="EOF"})(Yp||(Yp={}));var Xp;(function(l){l[l.InvalidSymbol=1]="InvalidSymbol",l[l.InvalidNumberFormat=2]="InvalidNumberFormat",l[l.PropertyNameExpected=3]="PropertyNameExpected",l[l.ValueExpected=4]="ValueExpected",l[l.ColonExpected=5]="ColonExpected",l[l.CommaExpected=6]="CommaExpected",l[l.CloseBraceExpected=7]="CloseBraceExpected",l[l.CloseBracketExpected=8]="CloseBracketExpected",l[l.EndOfFileExpected=9]="EndOfFileExpected",l[l.InvalidCommentToken=10]="InvalidCommentToken",l[l.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",l[l.UnexpectedEndOfString=12]="UnexpectedEndOfString",l[l.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",l[l.InvalidUnicode=14]="InvalidUnicode",l[l.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",l[l.InvalidCharacter=16]="InvalidCharacter"})(Xp||(Xp={}));var hr=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,Zp=new Set,fl=typeof process==="object"&&!!process?process:{},qp=(l,A,L,x)=>{typeof fl.emitWarning==="function"?fl.emitWarning(l,A,L,x):console.error(`[${L}] ${A}: ${l}`)},{AbortController:Ai,AbortSignal:Jp}=globalThis;if(typeof Ai>"u"){Jp=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(x,z){this._onabort.push(z)}},Ai=class{constructor(){A()}signal=new Jp;abort(x){if(this.signal.aborted)return;this.signal.reason=x,this.signal.aborted=!0;for(let z of this.signal._onabort)z(x);this.signal.onabort?.(x)}};let l=fl.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",A=()=>{if(!l)return;l=!1,qp("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",A)}}var gV=(l)=>!Zp.has(l),ase=Symbol("type"),mo=(l)=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Qp=(l)=>!mo(l)?null:l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?ss:null;class ss extends Array{constructor(l){super(l);this.fill(0)}}class Sr{heap;length;static#a=!1;static create(l){let A=Qp(l);if(!A)return[];Sr.#a=!0;let L=new Sr(l,A);return Sr.#a=!1,L}constructor(l,A){if(!Sr.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new A(l),this.length=0}push(l){this.heap[this.length++]=l}pop(){return this.heap[--this.length]}}class Ci{#a;#u;#g;#_;#w;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#E;#o;#n;#e;#c;#p;#l;#s;#h;#i;#S;#y;#f;#O;#T;#d;static unsafeExposeInternals(l){return{starts:l.#y,ttls:l.#f,sizes:l.#S,keyMap:l.#o,keyList:l.#n,valList:l.#e,next:l.#c,prev:l.#p,get head(){return l.#l},get tail(){return l.#s},free:l.#h,isBackgroundFetch:(A)=>l.#t(A),backgroundFetch:(A,L,x,z)=>l.#k(A,L,x,z),moveToTail:(A)=>l.#I(A),indexes:(A)=>l.#A(A),rindexes:(A)=>l.#C(A),isStale:(A)=>l.#m(A)}}get max(){return this.#a}get maxSize(){return this.#u}get calculatedSize(){return this.#E}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(l){let{max:A=0,ttl:L,ttlResolution:x=1,ttlAutopurge:z,updateAgeOnGet:W,updateAgeOnHas:Z,allowStale:ne,dispose:ce,disposeAfter:Te,noDisposeOnSet:Le,noUpdateTTL:we,maxSize:Ie=0,maxEntrySize:Be=0,sizeCalculation:ke,fetchMethod:qe,memoMethod:He,noDeleteOnFetchRejection:rt,noDeleteOnStaleGet:We,allowStaleOnFetchRejection:nt,allowStaleOnFetchAbort:it,ignoreFetchAbort:mt}=l;if(A!==0&&!mo(A))throw TypeError("max option must be a nonnegative integer");let Lt=A?Qp(A):Array;if(!Lt)throw Error("invalid max value: "+A);if(this.#a=A,this.#u=Ie,this.maxEntrySize=Be||this.#u,this.sizeCalculation=ke,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(He!==void 0&&typeof He!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#P=He,qe!==void 0&&typeof qe!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#w=qe,this.#T=!!qe,this.#o=new Map,this.#n=Array(A).fill(void 0),this.#e=Array(A).fill(void 0),this.#c=new Lt(A),this.#p=new Lt(A),this.#l=0,this.#s=0,this.#h=Sr.create(A),this.#r=0,this.#E=0,typeof ce==="function")this.#g=ce;if(typeof Te==="function")this.#_=Te,this.#i=[];else this.#_=void 0,this.#i=void 0;if(this.#O=!!this.#g,this.#d=!!this.#_,this.noDisposeOnSet=!!Le,this.noUpdateTTL=!!we,this.noDeleteOnFetchRejection=!!rt,this.allowStaleOnFetchRejection=!!nt,this.allowStaleOnFetchAbort=!!it,this.ignoreFetchAbort=!!mt,this.maxEntrySize!==0){if(this.#u!==0){if(!mo(this.#u))throw TypeError("maxSize must be a positive integer if specified")}if(!mo(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!ne,this.noDeleteOnStaleGet=!!We,this.updateAgeOnGet=!!W,this.updateAgeOnHas=!!Z,this.ttlResolution=mo(x)||x===0?x:1,this.ttlAutopurge=!!z,this.ttl=L||0,this.ttl){if(!mo(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#v()}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(gV("LRU_CACHE_UNBOUNDED"))Zp.add("LRU_CACHE_UNBOUNDED"),qp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",Ci)}}getRemainingTTL(l){return this.#o.has(l)?1/0:0}#v(){let l=new ss(this.#a),A=new ss(this.#a);this.#f=l,this.#y=A,this.#M=(z,W,Z=hr.now())=>{if(A[z]=W!==0?Z:0,l[z]=W,W!==0&&this.ttlAutopurge){let ne=setTimeout(()=>{if(this.#m(z))this.#b(this.#n[z],"expire")},W+1);if(ne.unref)ne.unref()}},this.#D=(z)=>{A[z]=l[z]!==0?hr.now():0},this.#R=(z,W)=>{if(l[W]){let Z=l[W],ne=A[W];if(!Z||!ne)return;z.ttl=Z,z.start=ne,z.now=L||x();let ce=z.now-ne;z.remainingTTL=Z-ce}};let L=0,x=()=>{let z=hr.now();if(this.ttlResolution>0){L=z;let W=setTimeout(()=>L=0,this.ttlResolution);if(W.unref)W.unref()}return z};this.getRemainingTTL=(z)=>{let W=this.#o.get(z);if(W===void 0)return 0;let Z=l[W],ne=A[W];if(!Z||!ne)return 1/0;let ce=(L||x())-ne;return Z-ce},this.#m=(z)=>{let W=A[z],Z=l[z];return!!Z&&!!W&&(L||x())-W>Z}}#D=()=>{};#R=()=>{};#M=()=>{};#m=()=>!1;#z(){let l=new ss(this.#a);this.#E=0,this.#S=l,this.#L=(A)=>{this.#E-=l[A],l[A]=0},this.#U=(A,L,x,z)=>{if(this.#t(L))return 0;if(!mo(x))if(z){if(typeof z!=="function")throw TypeError("sizeCalculation must be a function");if(x=z(L,A),!mo(x))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 x},this.#x=(A,L,x)=>{if(l[A]=L,this.#u){let z=this.#u-l[A];while(this.#E>z)this.#N(!0)}if(this.#E+=l[A],x)x.entrySize=L,x.totalCalculatedSize=this.#E}}#L=(l)=>{};#x=(l,A,L)=>{};#U=(l,A,L,x)=>{if(L||x)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:l=this.allowStale}={}){if(this.#r)for(let A=this.#s;;){if(!this.#H(A))break;if(l||!this.#m(A))yield A;if(A===this.#l)break;else A=this.#p[A]}}*#C({allowStale:l=this.allowStale}={}){if(this.#r)for(let A=this.#l;;){if(!this.#H(A))break;if(l||!this.#m(A))yield A;if(A===this.#s)break;else A=this.#c[A]}}#H(l){return l!==void 0&&this.#o.get(this.#n[l])===l}*entries(){for(let l of this.#A())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*rentries(){for(let l of this.#C())if(this.#e[l]!==void 0&&this.#n[l]!==void 0&&!this.#t(this.#e[l]))yield[this.#n[l],this.#e[l]]}*keys(){for(let l of this.#A()){let A=this.#n[l];if(A!==void 0&&!this.#t(this.#e[l]))yield A}}*rkeys(){for(let l of this.#C()){let A=this.#n[l];if(A!==void 0&&!this.#t(this.#e[l]))yield A}}*values(){for(let l of this.#A())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}*rvalues(){for(let l of this.#C())if(this.#e[l]!==void 0&&!this.#t(this.#e[l]))yield this.#e[l]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(l,A={}){for(let L of this.#A()){let x=this.#e[L],z=this.#t(x)?x.__staleWhileFetching:x;if(z===void 0)continue;if(l(z,this.#n[L],this))return this.get(this.#n[L],A)}}forEach(l,A=this){for(let L of this.#A()){let x=this.#e[L],z=this.#t(x)?x.__staleWhileFetching:x;if(z===void 0)continue;l.call(A,z,this.#n[L],this)}}rforEach(l,A=this){for(let L of this.#C()){let x=this.#e[L],z=this.#t(x)?x.__staleWhileFetching:x;if(z===void 0)continue;l.call(A,z,this.#n[L],this)}}purgeStale(){let l=!1;for(let A of this.#C({allowStale:!0}))if(this.#m(A))this.#b(this.#n[A],"expire"),l=!0;return l}info(l){let A=this.#o.get(l);if(A===void 0)return;let L=this.#e[A],x=this.#t(L)?L.__staleWhileFetching:L;if(x===void 0)return;let z={value:x};if(this.#f&&this.#y){let W=this.#f[A],Z=this.#y[A];if(W&&Z){let ne=W-(hr.now()-Z);z.ttl=ne,z.start=Date.now()}}if(this.#S)z.size=this.#S[A];return z}dump(){let l=[];for(let A of this.#A({allowStale:!0})){let L=this.#n[A],x=this.#e[A],z=this.#t(x)?x.__staleWhileFetching:x;if(z===void 0||L===void 0)continue;let W={value:z};if(this.#f&&this.#y){W.ttl=this.#f[A];let Z=hr.now()-this.#y[A];W.start=Math.floor(Date.now()-Z)}if(this.#S)W.size=this.#S[A];l.unshift([L,W])}return l}load(l){this.clear();for(let[A,L]of l){if(L.start){let x=Date.now()-L.start;L.start=hr.now()-x}this.set(A,L.value,L)}}set(l,A,L={}){if(A===void 0)return this.delete(l),this;let{ttl:x=this.ttl,start:z,noDisposeOnSet:W=this.noDisposeOnSet,sizeCalculation:Z=this.sizeCalculation,status:ne}=L,{noUpdateTTL:ce=this.noUpdateTTL}=L,Te=this.#U(l,A,L.size||0,Z);if(this.maxEntrySize&&Te>this.maxEntrySize){if(ne)ne.set="miss",ne.maxEntrySizeExceeded=!0;return this.#b(l,"set"),this}let Le=this.#r===0?void 0:this.#o.get(l);if(Le===void 0){if(Le=this.#r===0?this.#s:this.#h.length!==0?this.#h.pop():this.#r===this.#a?this.#N(!1):this.#r,this.#n[Le]=l,this.#e[Le]=A,this.#o.set(l,Le),this.#c[this.#s]=Le,this.#p[Le]=this.#s,this.#s=Le,this.#r++,this.#x(Le,Te,ne),ne)ne.set="add";ce=!1}else{this.#I(Le);let we=this.#e[Le];if(A!==we){if(this.#T&&this.#t(we)){we.__abortController.abort(Error("replaced"));let{__staleWhileFetching:Ie}=we;if(Ie!==void 0&&!W){if(this.#O)this.#g?.(Ie,l,"set");if(this.#d)this.#i?.push([Ie,l,"set"])}}else if(!W){if(this.#O)this.#g?.(we,l,"set");if(this.#d)this.#i?.push([we,l,"set"])}if(this.#L(Le),this.#x(Le,Te,ne),this.#e[Le]=A,ne){ne.set="replace";let Ie=we&&this.#t(we)?we.__staleWhileFetching:we;if(Ie!==void 0)ne.oldValue=Ie}}else if(ne)ne.set="update"}if(x!==0&&!this.#f)this.#v();if(this.#f){if(!ce)this.#M(Le,x,z);if(ne)this.#R(ne,Le)}if(!W&&this.#d&&this.#i){let we=this.#i,Ie;while(Ie=we?.shift())this.#_?.(...Ie)}return this}pop(){try{while(this.#r){let l=this.#e[this.#l];if(this.#N(!0),this.#t(l)){if(l.__staleWhileFetching)return l.__staleWhileFetching}else if(l!==void 0)return l}}finally{if(this.#d&&this.#i){let l=this.#i,A;while(A=l?.shift())this.#_?.(...A)}}}#N(l){let A=this.#l,L=this.#n[A],x=this.#e[A];if(this.#T&&this.#t(x))x.__abortController.abort(Error("evicted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(x,L,"evict");if(this.#d)this.#i?.push([x,L,"evict"])}if(this.#L(A),l)this.#n[A]=void 0,this.#e[A]=void 0,this.#h.push(A);if(this.#r===1)this.#l=this.#s=0,this.#h.length=0;else this.#l=this.#c[A];return this.#o.delete(L),this.#r--,A}has(l,A={}){let{updateAgeOnHas:L=this.updateAgeOnHas,status:x}=A,z=this.#o.get(l);if(z!==void 0){let W=this.#e[z];if(this.#t(W)&&W.__staleWhileFetching===void 0)return!1;if(!this.#m(z)){if(L)this.#D(z);if(x)x.has="hit",this.#R(x,z);return!0}else if(x)x.has="stale",this.#R(x,z)}else if(x)x.has="miss";return!1}peek(l,A={}){let{allowStale:L=this.allowStale}=A,x=this.#o.get(l);if(x===void 0||!L&&this.#m(x))return;let z=this.#e[x];return this.#t(z)?z.__staleWhileFetching:z}#k(l,A,L,x){let z=A===void 0?void 0:this.#e[A];if(this.#t(z))return z;let W=new Ai,{signal:Z}=L;Z?.addEventListener("abort",()=>W.abort(Z.reason),{signal:W.signal});let ne={signal:W.signal,options:L,context:x},ce=(ke,qe=!1)=>{let{aborted:He}=W.signal,rt=L.ignoreFetchAbort&&ke!==void 0;if(L.status)if(He&&!qe){if(L.status.fetchAborted=!0,L.status.fetchError=W.signal.reason,rt)L.status.fetchAbortIgnored=!0}else L.status.fetchResolved=!0;if(He&&!rt&&!qe)return Le(W.signal.reason);let We=Ie;if(this.#e[A]===Ie)if(ke===void 0)if(We.__staleWhileFetching)this.#e[A]=We.__staleWhileFetching;else this.#b(l,"fetch");else{if(L.status)L.status.fetchUpdated=!0;this.set(l,ke,ne.options)}return ke},Te=(ke)=>{if(L.status)L.status.fetchRejected=!0,L.status.fetchError=ke;return Le(ke)},Le=(ke)=>{let{aborted:qe}=W.signal,He=qe&&L.allowStaleOnFetchAbort,rt=He||L.allowStaleOnFetchRejection,We=rt||L.noDeleteOnFetchRejection,nt=Ie;if(this.#e[A]===Ie){if(!We||nt.__staleWhileFetching===void 0)this.#b(l,"fetch");else if(!He)this.#e[A]=nt.__staleWhileFetching}if(rt){if(L.status&&nt.__staleWhileFetching!==void 0)L.status.returnedStale=!0;return nt.__staleWhileFetching}else if(nt.__returned===nt)throw ke},we=(ke,qe)=>{let He=this.#w?.(l,z,ne);if(He&&He instanceof Promise)He.then((rt)=>ke(rt===void 0?void 0:rt),qe);W.signal.addEventListener("abort",()=>{if(!L.ignoreFetchAbort||L.allowStaleOnFetchAbort){if(ke(void 0),L.allowStaleOnFetchAbort)ke=(rt)=>ce(rt,!0)}})};if(L.status)L.status.fetchDispatched=!0;let Ie=new Promise(we).then(ce,Te),Be=Object.assign(Ie,{__abortController:W,__staleWhileFetching:z,__returned:void 0});if(A===void 0)this.set(l,Be,{...ne.options,status:void 0}),A=this.#o.get(l);else this.#e[A]=Be;return Be}#t(l){if(!this.#T)return!1;let A=l;return!!A&&A instanceof Promise&&A.hasOwnProperty("__staleWhileFetching")&&A.__abortController instanceof Ai}async fetch(l,A={}){let{allowStale:L=this.allowStale,updateAgeOnGet:x=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,ttl:W=this.ttl,noDisposeOnSet:Z=this.noDisposeOnSet,size:ne=0,sizeCalculation:ce=this.sizeCalculation,noUpdateTTL:Te=this.noUpdateTTL,noDeleteOnFetchRejection:Le=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:we=this.allowStaleOnFetchRejection,ignoreFetchAbort:Ie=this.ignoreFetchAbort,allowStaleOnFetchAbort:Be=this.allowStaleOnFetchAbort,context:ke,forceRefresh:qe=!1,status:He,signal:rt}=A;if(!this.#T){if(He)He.fetch="get";return this.get(l,{allowStale:L,updateAgeOnGet:x,noDeleteOnStaleGet:z,status:He})}let We={allowStale:L,updateAgeOnGet:x,noDeleteOnStaleGet:z,ttl:W,noDisposeOnSet:Z,size:ne,sizeCalculation:ce,noUpdateTTL:Te,noDeleteOnFetchRejection:Le,allowStaleOnFetchRejection:we,allowStaleOnFetchAbort:Be,ignoreFetchAbort:Ie,status:He,signal:rt},nt=this.#o.get(l);if(nt===void 0){if(He)He.fetch="miss";let it=this.#k(l,nt,We,ke);return it.__returned=it}else{let it=this.#e[nt];if(this.#t(it)){let _n=L&&it.__staleWhileFetching!==void 0;if(He){if(He.fetch="inflight",_n)He.returnedStale=!0}return _n?it.__staleWhileFetching:it.__returned=it}let mt=this.#m(nt);if(!qe&&!mt){if(He)He.fetch="hit";if(this.#I(nt),x)this.#D(nt);if(He)this.#R(He,nt);return it}let Lt=this.#k(l,nt,We,ke),Jt=Lt.__staleWhileFetching!==void 0&&L;if(He){if(He.fetch=mt?"stale":"refresh",Jt&&mt)He.returnedStale=!0}return Jt?Lt.__staleWhileFetching:Lt.__returned=Lt}}async forceFetch(l,A={}){let L=await this.fetch(l,A);if(L===void 0)throw Error("fetch() returned undefined");return L}memo(l,A={}){let L=this.#P;if(!L)throw Error("no memoMethod provided to constructor");let{context:x,forceRefresh:z,...W}=A,Z=this.get(l,W);if(!z&&Z!==void 0)return Z;let ne=L(l,Z,{options:W,context:x});return this.set(l,ne,W),ne}get(l,A={}){let{allowStale:L=this.allowStale,updateAgeOnGet:x=this.updateAgeOnGet,noDeleteOnStaleGet:z=this.noDeleteOnStaleGet,status:W}=A,Z=this.#o.get(l);if(Z!==void 0){let ne=this.#e[Z],ce=this.#t(ne);if(W)this.#R(W,Z);if(this.#m(Z)){if(W)W.get="stale";if(!ce){if(!z)this.#b(l,"expire");if(W&&L)W.returnedStale=!0;return L?ne:void 0}else{if(W&&L&&ne.__staleWhileFetching!==void 0)W.returnedStale=!0;return L?ne.__staleWhileFetching:void 0}}else{if(W)W.get="hit";if(ce)return ne.__staleWhileFetching;if(this.#I(Z),x)this.#D(Z);return ne}}else if(W)W.get="miss"}#F(l,A){this.#p[A]=l,this.#c[l]=A}#I(l){if(l!==this.#s){if(l===this.#l)this.#l=this.#c[l];else this.#F(this.#p[l],this.#c[l]);this.#F(this.#s,l),this.#s=l}}delete(l){return this.#b(l,"delete")}#b(l,A){let L=!1;if(this.#r!==0){let x=this.#o.get(l);if(x!==void 0)if(L=!0,this.#r===1)this.#B(A);else{this.#L(x);let z=this.#e[x];if(this.#t(z))z.__abortController.abort(Error("deleted"));else if(this.#O||this.#d){if(this.#O)this.#g?.(z,l,A);if(this.#d)this.#i?.push([z,l,A])}if(this.#o.delete(l),this.#n[x]=void 0,this.#e[x]=void 0,x===this.#s)this.#s=this.#p[x];else if(x===this.#l)this.#l=this.#c[x];else{let W=this.#p[x];this.#c[W]=this.#c[x];let Z=this.#c[x];this.#p[Z]=this.#p[x]}this.#r--,this.#h.push(x)}}if(this.#d&&this.#i?.length){let x=this.#i,z;while(z=x?.shift())this.#_?.(...z)}return L}clear(){return this.#B("delete")}#B(l){for(let A of this.#C({allowStale:!0})){let L=this.#e[A];if(this.#t(L))L.__abortController.abort(Error("deleted"));else{let x=this.#n[A];if(this.#O)this.#g?.(L,x,l);if(this.#d)this.#i?.push([L,x,l])}}if(this.#o.clear(),this.#e.fill(void 0),this.#n.fill(void 0),this.#f&&this.#y)this.#f.fill(0),this.#y.fill(0);if(this.#S)this.#S.fill(0);if(this.#l=0,this.#s=0,this.#h.length=0,this.#E=0,this.#r=0,this.#d&&this.#i){let A=this.#i,L;while(L=A?.shift())this.#_?.(...L)}}}function bi(l,A,L=100){let x=new Ci({max:L}),z=(...W)=>{let Z=A(...W),ne=x.get(Z);if(ne!==void 0)return ne;let ce=l(...W);return x.set(Z,ce),ce};return z.cache={clear:()=>x.clear(),size:()=>x.size,delete:(W)=>x.delete(W),get:(W)=>x.peek(W),has:(W)=>x.has(W),set:(W,Z)=>void x.set(W,Z)},z}var _V=8192;function tf(l,A){try{return{ok:!0,value:JSON.parse(se(l))}}catch(L){if(A)re(gt(L,`safeParseJSON: invalid JSON (${L instanceof Error?L.constructor.name:typeof L}, ${l.length} bytes)`));return{ok:!1}}}class nf{cached=bi(tf,(l)=>l,50);cache=this.cached.cache;parse(l,A){return this.cached(l,A)}}var ef=new nf;var wo=Object.assign(function(A,L=!0){if(!A)return null;let x=A.length>_V?tf(A,L):ef.parse(A,L);return x.ok?x.value:null},{cache:ef.cache});import{accessSync as lf,constants as hl,lstatSync as of,readlinkSync as EV,realpath as hV,realpathSync as SV}from"fs";import{access as yV}from"fs/promises";import{basename as Ise,dirname as OV,join as _l,parse as AV,resolve as El,sep as rf}from"path";import{promisify as CV}from"util";function cf(l,A,L,x,z){let W=i(),Z=pf(l,A,L,x),ne=Z.next();while(!ne.done){let ce;try{ce=bV(W,ne.value,z)}catch(Te){ne=Z.throw(Te);continue}ne=Z.next(ce)}return ne.value}async function df(l,A,L,x){let z=i(),W=pf(l,A,L,x),Z=W.next();while(!Z.done){let ne;try{ne=await RV(z,Z.value)}catch(ce){Z=W.throw(ce);continue}Z=W.next(ne)}return Z.value}var uf={unreadableAncestry:"unverified",surfaceNetworkRaw:!0,literalLinkText:"opaque"};function bV(l,{ask:A,path:L},x){switch(A){case"isLink":{let z=l.lstatSync(L);return x.set(L,{uid:z.uid,gid:z.gid,mode:z.mode}),z.isSymbolicLink()}case"networkJunction":return fe(l,L,uf);case"realpath":return B(SV.native(L));case"writable":return lf(L,hl.W_OK),!0}}async function RV(l,{ask:A,path:L}){switch(A){case"isLink":return(await l.lstat(L)).isSymbolicLink();case"networkJunction":return Ue(l,L,uf);case"realpath":return B(await CV(hV.native)(L));case"writable":return await yV(L,hl.W_OK),!0}}function*pf(l,A,L,x){let z=_l(l,...A),W;try{if(W=yield*ml(El(l),x),!W){let Te=l,Le=!1;for(let[we,Ie]of A.entries())if(Te=_l(Te,Ie),Le=we===A.length-1?L??(yield*ml(Te)):yield*ml(Te,x),Le)break;if(!Le)return null}}catch{return null}if(W){let Te=ff()?yield*sf(yield*gl(z)):"unknown";return{path:z,folder:l,kind:"outside",targetWritable:Te}}let Z=yield*gl(z),ne=yield*gl(l);if(Z==="gone"||ne==="gone")return null;if(ne==="unverified"||"network"in ne||Z==="unverified")return{path:z,folder:l,kind:"unverified"};if("real"in Z&&Qe(ne.real,Z.real))return{path:z,folder:l,kind:"inside"};let ce=yield*sf(Z);return{path:z,folder:l,kind:"outside",targetWritable:ce}}function*ml(l,A){let L=A?.get(l);if(L===void 0)L=(yield{ask:"isLink",path:l})===!0,A?.set(l,L);return L}function*gl(l){if(ht(l)&&!D(l))return{network:l};try{let A=yield{ask:"networkJunction",path:l};if(A===P||A===Ne)return"unverified";if(typeof A==="string")return{network:A};let L=yield{ask:"realpath",path:l};return typeof L==="string"?{real:L}:"unverified"}catch(A){let L=r(A);return L==="ENOENT"||L==="ENOTDIR"?"gone":"unverified"}}function ff(){try{let l=E();return l!=="windows"&&l!=="wsl"}catch{return!1}}function*sf(l){try{if(typeof l==="string"||!("real"in l)||!ff())return"unknown";let A=yield*af(l.real);if(A==="yes")return"yes";let L=yield*af(OV(l.real));if(L==="yes")return"yes";return A==="no"&&L==="no"?"no":"unknown"}catch{return"unknown"}}function*af(l){try{return yield{ask:"writable",path:l},"yes"}catch(A){return mf(A)}}function mf(l){switch(r(l)){case"EACCES":case"EPERM":case"EROFS":return"no";default:return"unknown"}}function Sl(l){try{return lf(l,hl.W_OK),"yes"}catch(A){return mf(A)}}function yl(l,A,L){for(let x of l.uids){let z=ft({file:A,folder:L,posix:!0,euid:x,groups:l.groups});if(z!==!1)return z}return!1}var TV=40;function gf(l,A,L){let x=El(l);try{for(let z=0;z<=TV;z++){let W=AV(x).root,Z,ne=x.slice(W.length).split(rf).filter(Boolean),ce;for(let[Te,Le]of ne.entries()){let we=L.get(W);if(we===void 0){Z??=of(W);let ke={uid:Z.uid,gid:Z.gid,mode:Z.mode};we=yl(A,ke,ke)===!1&&Sl(W)==="no",L.set(W,we)}if(!we)return!0;let Ie=_l(W,Le);if(L.has(Ie)){W=Ie,Z=void 0;continue}let Be=of(Ie);if(Be.isSymbolicLink()){let ke=EV(Ie),qe=ke.split(rf).filter((He)=>He&&He!==".");if(qe.lastIndexOf("..")>qe.findIndex((He)=>He!==".."))return!0;ce=El(W,ke,...ne.slice(Te+1));break}W=Ie,Z=Be}if(ce===void 0)return!1;x=ce}}catch{}return!0}import{join as DV}from"path";class _f{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=IV(),this.managedFilePath}getDropInDir(){return this.dropInDir??=DV(go(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var LV=new _f;function go(){return LV.getManagedFilePath()}function IV(){let l=wV();if(l!==void 0)return l;switch(E()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function wV(){return}var Ef="cc-plugin-sec-default";var is=["remote_cowork","remote_cowork_trigger"];var hf={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 _ie=new Set(Object.keys(hf));var kV=new Set(["claude-desktop-3p","local-agent"]);function Ol(){let l=en.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&kV.has(l)}var Sf=new Set(["claude-desktop","claude-desktop-3p"]);function as(){return!1}function yf(){return as()&&vV()}function vV(){return en.CLAUDE_CODE_HOST_GATEWAY_LINEAGE&&!!en.CLAUDE_CODE_HOST_CREDS_FILE}var Of=new Set(is);function Af(){let l=en.CLAUDE_CODE_ENTRYPOINT;return l!==void 0&&Of.has(l)}function Cf(){let l=Al();return l!==void 0&&Of.has(l)}function MV(l){return l?.startsWith("remote")===!0}class bf{entrypoint=void 0;interactive=!1;spawnedByAttendedSession=void 0;childSession=!1;hasRemoteSessionOrContainerId=!1;claudecode=!1;coworkFrameArtifacts=!1;hostScheduledRun=!1;desktopSkillSwitches=!1;desktopConnectorNames=!1;hostUnattendedGrant=void 0;chromeTabGroupKey=void 0;hostAssignedGroup=void 0;hostGuest=void 0;hostTestVm=void 0;hostSkillCatalog=void 0;desktopSkillsPluginDir=void 0;remoteControlOwnerDeclared=!1;remoteRelayMark=void 0;setEntrypoint(l){this.entrypoint=l}setInteractive(l){this.interactive=l}setSpawnedByAttendedSession(l){this.spawnedByAttendedSession=l}setChildSession(l){this.childSession=l}setHasRemoteSessionOrContainerId(l){this.hasRemoteSessionOrContainerId=l}setClaudecode(l){this.claudecode=l}setCoworkFrameArtifacts(l){this.coworkFrameArtifacts=l}setHostScheduledRun(l){this.hostScheduledRun=l}setDesktopSkillSwitches(l){this.desktopSkillSwitches=l}setDesktopConnectorNames(l){this.desktopConnectorNames=l}setHostUnattendedGrant(l){this.hostUnattendedGrant=l}setChromeTabGroupKey(l){this.chromeTabGroupKey=l}setHostSkillCatalog(l){this.hostSkillCatalog=l}setDesktopSkillsPluginDir(l){this.desktopSkillsPluginDir=l}setRemoteControlOwnerDeclared(l){this.remoteControlOwnerDeclared=l}setRemoteRelayMark(l){this.remoteRelayMark=this.remoteRelayMark===!0||l}setHostGuest(l){this.hostGuest=l}setHostTestVm(l){this.hostTestVm=l}setHostAssignedGroup(l){this.hostAssignedGroup=l}}var UV=new s(()=>new bf);function HV(){return UV.of(C().host)}function Al(){return HV().entrypoint}var FV=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"]),Eie=new Set([...FV].filter(MV));var hie=new Set([...is,"remote","remote_desktop","remote_mobile","remote_projects","remote_trigger"]);var ls=["low","medium","high","xhigh","max"];class Rf{resetters=[];built=[];lazy(l){let A,L=()=>{A=void 0};return this.resetters.push(L),()=>{if(A===void 0)A=l(),this.built.push(L);return A}}builtCount(){return this.built.length}releaseBuiltSince(l){for(let A of this.built.splice(l))A()}reset(){for(let l of this.resetters)l();this.built.length=0}}var BV=new Rf;function Ke(l){return BV.lazy(l)}var cs=/^(?:Read|Edit)\((?:\.\/)?!/;var zn=Ke(()=>[{path:["allowManagedPermissionRulesOnly"],restrictive:!0},{path:["allowManagedHooksOnly"],restrictive:!0},{path:["allowManagedMcpServersOnly"],restrictive:!0},{path:["enforceAvailableModels"],restrictive:!0},{path:["disableAllHooks"],restrictive:!0},{path:["disableClaudeAiConnectors"],restrictive:!0},{path:["disableCommandPluginSources"],restrictive:!0},{path:["disableSideloadFlags"],restrictive:!0},{path:["disableSkillShellExecution"],restrictive:!0},{path:["disableRemoteControl"],restrictive:!0},{path:["disableAgentView"],restrictive:!0},{path:["disableWorkflows"],restrictive:!0},{path:["disableArtifact"],restrictive:!0},{path:["disableBundledSkills"],restrictive:!0},{path:["fastModePerSessionOptIn"],restrictive:!0},{path:["isolatePeerMachines"],restrictive:!0},{path:["strictPluginOnlyCustomization"],restrictive:!0},{path:["disableAutoMode"],restrictive:"disable"},{path:["disableDeepLinkRegistration"],restrictive:"disable"},{path:["permissions","disableBypassPermissionsMode"],restrictive:"disable"},{path:["permissions","disableAutoMode"],restrictive:"disable"},{path:["permissions","blockReadsOutsideWorkingDirectories"],restrictive:!0},{path:["permissions","blockWritesOutsideWorkingDirectories"],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:ls},{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","filesystem","allowManagedReadPathsOnly"],restrictive:!0},{path:["sandbox","filesystem","disabled"],restrictive:!1},{path:["sandbox","credentials","allowPlaintextInject"],restrictive:!1},{path:["sandbox","credentials","sigv4","streaming"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","presigned"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","sigv4a"],restrictive:"deny"},{path:["isolation","required"],restrictive:!0},{path:["isolation","persistHome"],restrictive:!1}]);function Po(l){return Array.isArray(l)?l:[l]}function Wt(l,A){let L=l;for(let x of A){if(L===null||typeof L!=="object")return;L=L[x]}return L}function Yt(l,A,L){let x=[l],z=l;for(let Z of A.slice(0,-1)){let ne={...z[Z]};z[Z]=ne,z=ne,x.push(z)}let W=A.at(-1);if(L!==void 0){z[W]=L;return}delete z[W];for(let Z=x.length-1;Z>0;Z--){if(Object.keys(x[Z]).length>0)break;delete x[Z-1][A[Z-1]]}}function Ri(l,A){let L=Wt(A,l.path);return l.normalize===void 0?L:l.normalize(L)}var yr=`${Ef}@builtin`,Tf=["sec-default@builtin"],Ti=Object.freeze({settings:Object.freeze(["allowManagedHooksOnly","disableAllHooks","disableCommandPluginSources"]),policyModOptions:Object.freeze(["allowManagedModsOnly"]),setAside:Object.freeze(["allowModsToOverrideDenyRules"])});function Jn(){return GV()??Af()}function GV(){try{return Al()===void 0?void 0:Cf()}catch(l){re(l);return}}function Cl(l){let A=Wt(l,["pluginConfigs",yr,"options"]),L={};for(let z of Ti.policyModOptions){let W=t(A)?A[z]:void 0;if(Lf(W))L[z]=W}return Object.keys(L).length>0?{[yr]:{options:L}}:void 0}function Di(l){let A={};for(let z of Ti.settings){let W=Wt(l,[z]);if(Df(W))A[z]=W}let L=Cl(l);if(L!==void 0)A.pluginConfigs=L;return Object.keys(A).length>0?{...A,managedSourcesBehavior:"merge"}:{}}function bl(l,A){let L=WV.filter(({path:z,holds:W})=>W(Wt(l,z))&&!W(Wt(A,z)));if(L.length===0)return A;let x={...A};for(let{path:z}of L)Yt(x,z,Wt(l,z));return{...x,managedSourcesBehavior:"merge"}}function Df(l){return l===!0}function Lf(l){return l!==!1&&(["string","number","boolean"].includes(typeof l)||Array.isArray(l)&&l.every((A)=>typeof A==="string"))}var WV=[...Ti.settings.map((l)=>({path:[l],holds:Df})),...Ti.policyModOptions.map((l)=>({path:["pluginConfigs",yr,"options",l],holds:Lf}))];var jV=d({asks:void 0,isAsking:!1,readAs:void 0,told:void 0},(l)=>{l.asks=void 0,l.isAsking=!1,l.readAs=void 0,l.told=void 0});function Li(){let l=jV;if(l.isAsking)return l.readAs??=Jn(),l.readAs;let A=Jn();if(l.asks!==void 0){l.isAsking=!0;try{A=l.asks()}finally{l.isAsking=!1}}let L=l.readAs!==void 0&&l.readAs!==A;if(l.readAs=A,L)V().invalidatePolicyLayer();return A}function KV(l,A){return lr(l,A)}var Dn=KV;function $V(l){return function(A,L,x){var z=-1,W=Object(A),Z=x(A),ne=Z.length;while(ne--){var ce=Z[l?ne:++z];if(L(W[ce],ce,W)===!1)break}return A}}var If=$V;var VV=If(),Ii=VV;function YV(l,A){return l&&Ii(l,A,Hn)}var wi=YV;function XV(l,A){var L={};return A=Fn(A,3),wi(l,function(x,z,W){po(L,z,A(x,z,W))}),L}var Pi=XV;function JV(l,A,L){if(L!==void 0&&!Nn(l[A],L)||L===void 0&&!(A in l))po(l,A,L)}var ds=JV;var Nf=typeof Ni=="object"&&Ni&&!Ni.nodeType&&Ni,wf=Nf&&typeof xi=="object"&&xi&&!xi.nodeType&&xi,ZV=wf&&wf.exports===Nf,Pf=ZV?Vt.Buffer:void 0,xf=Pf?Pf.allocUnsafe:void 0;function qV(l,A){if(A)return l.slice();var L=l.length,x=xf?xf(L):new l.constructor(L);return l.copy(x),x}var us=qV;function QV(l){var A=new l.constructor(l.byteLength);return new er(A).set(new er(l)),A}var Or=QV;function eY(l,A){var L=A?Or(l.buffer):l.buffer;return new l.constructor(L,l.byteOffset,l.length)}var ki=eY;function tY(l,A){var L=-1,x=l.length;A||(A=Array(x));while(++L<x)A[L]=l[L];return A}var vi=tY;var kf=Object.create,nY=function(){function l(){}return function(A){if(!jt(A))return{};if(kf)return kf(A);l.prototype=A;var L=new l;return l.prototype=void 0,L}}(),vf=nY;function oY(l){return typeof l.constructor=="function"&&!ar(l)?vf(mr(l)):{}}var Mi=oY;function rY(l){return Qt(l)&&Un(l)}var Mf=rY;var sY="[object Object]",iY=Function.prototype,aY=Object.prototype,Uf=iY.toString,lY=aY.hasOwnProperty,cY=Uf.call(Object);function dY(l){if(!Qt(l)||hn(l)!=sY)return!1;var A=mr(l);if(A===null)return!0;var L=lY.call(A,"constructor")&&A.constructor;return typeof L=="function"&&L instanceof L&&Uf.call(L)==cY}var Ui=dY;function uY(l,A){if(A==="constructor"&&typeof l[A]==="function")return;if(A=="__proto__")return;return l[A]}var ps=uY;function pY(l,A,L,x){var z=!L;L||(L={});var W=-1,Z=A.length;while(++W<Z){var ne=A[W],ce=x?x(L[ne],l[ne],ne,L,l):void 0;if(ce===void 0)ce=l[ne];if(z)po(L,ne,ce);else fr(L,ne,ce)}return L}var Tn=pY;function fY(l){return Tn(l,Bn(l))}var Hf=fY;function mY(l,A,L,x,z,W,Z){var ne=ps(l,L),ce=ps(A,L),Te=Z.get(ce);if(Te){ds(l,L,Te);return}var Le=W?W(ne,ce,L+"",l,A,Z):void 0,we=Le===void 0;if(we){var Ie=Mt(ce),Be=!Ie&&vn(ce),ke=!Ie&&!Be&&ir(ce);if(Le=ce,Ie||Be||ke)if(Mt(ne))Le=ne;else if(Mf(ne))Le=vi(ne);else if(Be)we=!1,Le=us(ce,!0);else if(ke)we=!1,Le=ki(ce,!0);else Le=[];else if(Ui(ce)||Yn(ce)){if(Le=ne,Yn(ne))Le=Hf(ne);else if(!jt(ne)||Jo(ne))Le=Mi(ce)}else we=!1}if(we)Z.set(ce,Le),z(Le,ce,x,W,Z),Z.delete(ce);ds(l,L,Le)}var Ff=mY;function Bf(l,A,L,x,z){if(l===A)return;Ii(A,function(W,Z){if(z||(z=new kn),jt(W))Ff(l,A,Z,L,Bf,x,z);else{var ne=x?x(ps(l,Z),W,Z+"",l,A,z):void 0;if(ne===void 0)ne=W;ds(l,Z,ne)}},Bn)}var zf=Bf;function gY(l,A,L){switch(L.length){case 0:return l.call(A);case 1:return l.call(A,L[0]);case 2:return l.call(A,L[0],L[1]);case 3:return l.call(A,L[0],L[1],L[2])}return l.apply(A,L)}var Gf=gY;var Wf=Math.max;function _Y(l,A,L){return A=Wf(A===void 0?l.length-1:A,0),function(){var x=arguments,z=-1,W=Wf(x.length-A,0),Z=Array(W);while(++z<W)Z[z]=x[A+z];z=-1;var ne=Array(A+1);while(++z<A)ne[z]=x[z];return ne[A]=L(Z),Gf(l,this,ne)}}var Hi=_Y;function EY(l){return function(){return l}}var jf=EY;var hY=!pr?ur:function(l,A){return pr(l,"toString",{configurable:!0,enumerable:!1,value:jf(A),writable:!0})},Kf=hY;var SY=800,yY=16,OY=Date.now;function AY(l){var A=0,L=0;return function(){var x=OY(),z=yY-(x-L);if(L=x,z>0){if(++A>=SY)return arguments[0]}else A=0;return l.apply(void 0,arguments)}}var $f=AY;var CY=$f(Kf),Fi=CY;function bY(l,A){return Fi(Hi(l,A,ur),l+"")}var Vf=bY;function RY(l,A,L){if(!jt(L))return!1;var x=typeof A;if(x=="number"?Un(L)&&lo(A,L.length):x=="string"&&(A in L))return Nn(L[A],l);return!1}var Yf=RY;function TY(l){return Vf(function(A,L){var x=-1,z=L.length,W=z>1?L[z-1]:void 0,Z=z>2?L[2]:void 0;if(W=l.length>3&&typeof W=="function"?(z--,W):void 0,Z&&Yf(L[0],L[1],Z))W=z<3?void 0:W,z=1;A=Object(A);while(++x<z){var ne=L[x];if(ne)l(A,ne,x,W)}return A})}var Xf=TY;var DY=Xf(function(l,A,L,x){zf(l,A,L,x)}),rn=DY;function LY(l,A){var L=-1,x=l==null?0:l.length;while(++L<x)if(A(l[L],L,l)===!1)break;return l}var Jf=LY;function IY(l,A){return l&&Tn(A,Hn(A),l)}var Zf=IY;function wY(l,A){return l&&Tn(A,Bn(A),l)}var qf=wY;function PY(l,A){return Tn(l,or(l),A)}var Qf=PY;function xY(l,A){return Tn(l,Ei(l),A)}var em=xY;var NY=Object.prototype,kY=NY.hasOwnProperty;function vY(l){var A=l.length,L=new l.constructor(A);if(A&&typeof l[0]=="string"&&kY.call(l,"index"))L.index=l.index,L.input=l.input;return L}var tm=vY;function MY(l,A){var L=A?Or(l.buffer):l.buffer;return new l.constructor(L,l.byteOffset,l.byteLength)}var nm=MY;var UY=/\w*$/;function HY(l){var A=new l.constructor(l.source,UY.exec(l));return A.lastIndex=l.lastIndex,A}var om=HY;var rm=on?on.prototype:void 0,sm=rm?rm.valueOf:void 0;function FY(l){return sm?Object(sm.call(l)):{}}var im=FY;var BY="[object Boolean]",zY="[object Date]",GY="[object Map]",WY="[object Number]",jY="[object RegExp]",KY="[object Set]",$Y="[object String]",VY="[object Symbol]",YY="[object ArrayBuffer]",XY="[object DataView]",JY="[object Float32Array]",ZY="[object Float64Array]",qY="[object Int8Array]",QY="[object Int16Array]",e2="[object Int32Array]",t2="[object Uint8Array]",n2="[object Uint8ClampedArray]",o2="[object Uint16Array]",r2="[object Uint32Array]";function s2(l,A,L){var x=l.constructor;switch(A){case YY:return Or(l);case BY:case zY:return new x(+l);case XY:return nm(l,L);case JY:case ZY:case qY:case QY:case e2:case t2:case n2:case o2:case r2:return ki(l,L);case GY:return new x;case WY:case $Y:return new x(l);case jY:return om(l);case KY:return new x;case VY:return im(l)}}var am=s2;var i2="[object Map]";function a2(l){return Qt(l)&&Xn(l)==i2}var lm=a2;var cm=Mn&&Mn.isMap,l2=cm?sr(cm):lm,dm=l2;var c2="[object Set]";function d2(l){return Qt(l)&&Xn(l)==c2}var um=d2;var pm=Mn&&Mn.isSet,u2=pm?sr(pm):um,fm=u2;var p2=1,f2=2,m2=4,mm="[object Arguments]",g2="[object Array]",_2="[object Boolean]",E2="[object Date]",h2="[object Error]",gm="[object Function]",S2="[object GeneratorFunction]",y2="[object Map]",O2="[object Number]",_m="[object Object]",A2="[object RegExp]",C2="[object Set]",b2="[object String]",R2="[object Symbol]",T2="[object WeakMap]",D2="[object ArrayBuffer]",L2="[object DataView]",I2="[object Float32Array]",w2="[object Float64Array]",P2="[object Int8Array]",x2="[object Int16Array]",N2="[object Int32Array]",k2="[object Uint8Array]",v2="[object Uint8ClampedArray]",M2="[object Uint16Array]",U2="[object Uint32Array]",Ht={};Ht[mm]=Ht[g2]=Ht[D2]=Ht[L2]=Ht[_2]=Ht[E2]=Ht[I2]=Ht[w2]=Ht[P2]=Ht[x2]=Ht[N2]=Ht[y2]=Ht[O2]=Ht[_m]=Ht[A2]=Ht[C2]=Ht[b2]=Ht[R2]=Ht[k2]=Ht[v2]=Ht[M2]=Ht[U2]=!0;Ht[h2]=Ht[gm]=Ht[T2]=!1;function Bi(l,A,L,x,z,W){var Z,ne=A&p2,ce=A&f2,Te=A&m2;if(L)Z=z?L(l,x,z,W):L(l);if(Z!==void 0)return Z;if(!jt(l))return l;var Le=Mt(l);if(Le){if(Z=tm(l),!ne)return vi(l,Z)}else{var we=Xn(l),Ie=we==gm||we==S2;if(vn(l))return us(l,ne);if(we==_m||we==mm||Ie&&!z){if(Z=ce||Ie?{}:Mi(l),!ne)return ce?em(l,qf(Z,l)):Qf(l,Zf(Z,l))}else{if(!Ht[we])return z?l:{};Z=am(l,we,ne)}}W||(W=new kn);var Be=W.get(l);if(Be)return Be;if(W.set(l,Z),fm(l))l.forEach(function(He){Z.add(Bi(He,A,L,He,l,W))});else if(dm(l))l.forEach(function(He,rt){Z.set(rt,Bi(He,A,L,rt,l,W))});var ke=Te?ce?gr:es:ce?Bn:Hn,qe=Le?void 0:ke(l);return Jf(qe||l,function(He,rt){if(qe)rt=He,He=l[rt];fr(Z,rt,Bi(He,A,L,rt,l,W))}),Z}var Em=Bi;function H2(l){var A=l==null?0:l.length;return A?l[A-1]:void 0}var hm=H2;function F2(l,A,L){var x=-1,z=l.length;if(A<0)A=-A>z?0:z+A;if(L=L>z?z:L,L<0)L+=z;z=A>L?0:L-A>>>0,A>>>=0;var W=Array(z);while(++x<z)W[x]=l[x+A];return W}var Sm=F2;function B2(l,A){return A.length<2?l:uo(l,Sm(A,0,-1))}var ym=B2;var z2=Object.prototype,G2=z2.hasOwnProperty;function W2(l,A){A=Rn(A,l);var L=-1,x=A.length;if(!x)return!0;while(++L<x){var z=Sn(A[L]);if(z==="__proto__"&&!G2.call(l,"__proto__"))return!1;if((z==="constructor"||z==="prototype")&&L<x-1)return!1}var W=ym(l,A);return W==null||delete W[Sn(hm(A))]}var zi=W2;function j2(l){return Ui(l)?void 0:l}var Om=j2;var Am=on?on.isConcatSpreadable:void 0;function K2(l){return Mt(l)||Yn(l)||!!(Am&&l&&l[Am])}var Cm=K2;function bm(l,A,L,x,z){var W=-1,Z=l.length;L||(L=Cm),z||(z=[]);while(++W<Z){var ne=l[W];if(A>0&&L(ne))if(A>1)bm(ne,A-1,L,x,z);else nr(z,ne);else if(!x)z[z.length]=ne}return z}var Rm=bm;function $2(l){var A=l==null?0:l.length;return A?Rm(l,1):[]}var Tm=$2;function V2(l){return Fi(Hi(l,void 0,Tm),l+"")}var Gi=V2;var Y2=1,X2=2,J2=4,Z2=Gi(function(l,A){var L={};if(l==null)return L;var x=!1;if(A=Yo(A,function(W){return W=Rn(W,l),x||(x=W.length>1),W}),Tn(l,gr(l),L),x)L=Em(L,Y2|X2|J2,Om);var z=A.length;while(z--)zi(L,A[z]);return L}),cn=Z2;function q2(l,A,L,x){var z=-1,W=l==null?0:l.length;while(++z<W){var Z=l[z];A(x,Z,L(Z),l)}return x}var Dm=q2;function Q2(l,A){return function(L,x){if(L==null)return L;if(!Un(L))return l(L,x);var z=L.length,W=A?z:-1,Z=Object(L);while(A?W--:++W<z)if(x(Z[W],W,Z)===!1)break;return L}}var Lm=Q2;var eX=Lm(wi),Im=eX;function tX(l,A,L,x){return Im(l,function(z,W,Z){A(x,z,L(z),Z)}),x}var wm=tX;function nX(l,A){return function(L,x){var z=Mt(L)?Dm:wm,W=A?A():{};return z(L,l,Fn(x,2),W)}}var Pm=nX;var oX=Pm(function(l,A,L){l[L?0:1].push(A)},function(){return[[],[]]}),xm=oX;function rX(l,A){return _i(l,A,function(L,x){return gi(l,x)})}var Nm=rX;var sX=Gi(function(l,A){return l==null?{}:Nm(l,A)}),_o=sX;function iX(l,A){return l==null?!0:zi(l,A)}var km=iX;import{homedir as r8}from"os";import{basename as s8,dirname as Fa,join as tn,resolve as $t,sep as i8}from"path";var aX="Expected a function";function lX(l){if(typeof l!="function")throw TypeError(aX);return function(){var A=arguments;switch(A.length){case 0:return!l.call(this);case 1:return!l.call(this,A[0]);case 2:return!l.call(this,A[0],A[1]);case 3:return!l.call(this,A[0],A[1],A[2])}return!l.apply(this,A)}}var vm=lX;function cX(l,A){return hi(l,vm(Fn(A)))}var xo=cX;function dX(l,A,L,x){var z=l.length,W=L+(x?1:-1);while(x?W--:++W<z)if(A(l[W],W,l))return W;return-1}var Mm=dX;function uX(l){return l!==l}var Um=uX;function pX(l,A,L){var x=L-1,z=l.length;while(++x<z)if(l[x]===A)return x;return-1}var Hm=pX;function fX(l,A,L){return A===A?Hm(l,A,L):Mm(l,Um,L)}var Fm=fX;function mX(l,A){var L=l==null?0:l.length;return!!L&&Fm(l,A,0)>-1}var Bm=mX;function gX(l,A,L){var x=-1,z=l==null?0:l.length;while(++x<z)if(L(A,l[x]))return!0;return!1}var zm=gX;function _X(){}var Gm=_X;var EX=1/0,hX=!(co&&1/tr(new co([,-0]))[1]==EX)?Gm:function(l){return new co(l)},Wm=hX;var SX=200;function yX(l,A,L){var x=-1,z=Bm,W=l.length,Z=!0,ne=[],ce=ne;if(L)Z=!1,z=zm;else if(W>=SX){var Te=A?null:Wm(l);if(Te)return tr(Te);Z=!1,z=Qs,ce=new qs}else ce=A?[]:ne;e:while(++x<W){var Le=l[x],we=A?A(Le):Le;if(Le=L||Le!==0?Le:0,Z&&we===we){var Ie=ce.length;while(Ie--)if(ce[Ie]===we)continue e;if(A)ce.push(we);ne.push(Le)}else if(!z(ce,we,L)){if(ce!==ne)ce.push(we);ne.push(Le)}}return ne}var jm=yX;function OX(l,A){return l&&l.length?jm(l,Fn(A,2)):[]}var Km=OX;import{join as Gh}from"path";function $m(){return _t()&&!(yf()&&en.CLAUDE_CODE_SESSION_KIND==="bg")}var AX="tengu_fizzy_widget";class Vm{reader=null;register(l){let A=this.reader;return this.reader=l,A}servedTrue(l){let A=this.reader;if(!A)return!1;try{return A(l,!1)===!0}catch{return!1}}}var CX=new Vm,fs=d({settled:void 0,answeredOff:!1,answeredOn:!1},(l)=>{l.settled=void 0,l.answeredOff=!1,l.answeredOn=!1});function Ym(){if(fs.settled!==void 0)return fs.settled;if(fs.answeredOff)return!1;let l=CX.servedTrue(AX);return fs.answeredOff=!l,fs.answeredOn||=l,l}import{createHash as bX}from"crypto";function ms(l){if(Array.isArray(l))return l.map(ms);if(l!==null&&typeof l==="object"){let A={};for(let L of Object.keys(l).sort())A[L]=ms(l[L]);return A}return l}function Wi(l){if(typeof l==="number")return!Number.isFinite(l)||Object.is(l,-0);if(Array.isArray(l))return l.some(Wi);if(l===null||typeof l!=="object")return!1;return Object.hasOwn(l,"__proto__")||Object.values(l).some(Wi)}function Xm(l){let A=ms(l),L=n(A);return`sha256:${bX("sha256").update(L).digest("hex")}`}import*as Ar from"zod/v4";import{closeSync as RX,constants as TX,fstatSync as DX,lstatSync as LX,openSync as IX,readSync as wX}from"fs";function Jm(l,A,{refuseLinkOnWindows:L}){let x;try{if(L&&Q===0&&!LX(l).isFile())return{kind:"refused"};x=IX(l,TX.O_RDONLY|Q);let z=DX(x);if(!z.isFile()||z.size>A)return{kind:"refused"};let W=Buffer.alloc(z.size),Z=wX(x,W,0,z.size,0);return{kind:"ok",text:W.toString("utf-8",0,Z)}}catch(z){return g(z)?{kind:"absent"}:{kind:"error",error:z}}finally{if(x!==void 0)try{RX(x)}catch{}}}import{verify as kX,X509Certificate as og}from"crypto";import*as Ft from"zod/v4";var PX=[85,29,19];function ji(l,A,L){if(A+2>L)throw Error("DER: truncated element header");let x=l[A];if((x&31)===31)throw Error("DER: high-tag-number form is not supported");let z=l[A+1],W=A+2,Z;if(z<128)Z=z;else{let ce=z&127;if(ce===0||ce>3||W+ce>L)throw Error("DER: unsupported length encoding");Z=0;for(let Te=0;Te<ce;Te++)Z=Z*256+l[W+Te];if(Z<128||ce>1&&l[W]===0)throw Error("DER: non-minimal length encoding");W+=ce}let ne=W+Z;if(ne>L)throw Error("DER: element overruns its container");return{tag:x,start:W,end:ne}}function gs(l,A){let L=[],x=A.start;while(x<A.end){let z=ji(l,x,A.end);L.push(z),x=z.end}return L}function xX(l,A,L){return A.end-A.start===L.length&&L.every((x,z)=>l[A.start+z]===x)}function Zn(l,A){if(l.tag!==A)throw Error("DER: unexpected tag");return l}function Zm(l){let A=Zn(ji(l,0,l.length),48);if(A.end!==l.length)throw Error("DER: bytes after the Certificate");let L=Zn(ji(l,A.start,A.end),48),x=gs(l,L).find((ce)=>ce.tag===163);if(x===void 0)return;let[z,...W]=gs(l,x);if(z===void 0||W.length>0)throw Error("DER: [3] must wrap exactly one Extensions sequence");Zn(z,48);let Z,ne=!1;for(let ce of gs(l,z)){Zn(ce,48);let Te=gs(l,ce),Le=Te[0],we=Te.at(-1);if(Le===void 0||we===void 0||Te.length<2||Te.length>3)throw Error("DER: Extension is not { extnID, critical?, extnValue }");if(Zn(Le,6),!xX(l,Le,PX))continue;if(ne)throw Error("DER: duplicate basicConstraints extension");if(ne=!0,Te.length===3)Zn(Te[1],1);Zn(we,4);let Ie=Zn(ji(l,we.start,we.end),48);if(Ie.end!==we.end)throw Error("DER: bytes after BasicConstraints");let Be=gs(l,Ie),ke=Be[0]?.tag===1?Be.slice(1):Be;if(ke.length>1)throw Error("DER: BasicConstraints has extra members");if(ke[0]!==void 0)Zn(ke[0],2),Z=NX(l,ke[0])}return Z}function NX(l,A){let L=A.end-A.start;if(L===0)throw Error("DER: empty INTEGER");let x=l[A.start];if(x&128)throw Error("DER: negative pathLenConstraint");if(L>1&&x===0&&!(l[A.start+1]&128))throw Error("DER: non-minimal INTEGER");if((x===0?L-1:L)>2)throw Error("DER: pathLenConstraint out of range");let W=0;for(let Z=A.start;Z<A.end;Z++)W=W*256+l[Z];return W}var vX=["enterprise","team","consumer","api","other"];function qm(l){return vX.find((A)=>A===l)??"other"}var rg=Symbol("signed-cache mint");class Rl{#a=!0;kind;state;bodySha;issuedAt;notAfter;plan;organizationUuid;accountUuid;constructor(l,{kind:A,state:L,bodySha:x,issuedAt:z,notAfter:W,plan:Z,organizationUuid:ne,accountUuid:ce}){if(l!==rg)throw TypeError("only the verifier makes a VerifiedStatement");this.kind=A,this.state=L,this.bodySha=x,this.issuedAt=z,this.notAfter=W,this.plan=Z,this.organizationUuid=ne,this.accountUuid=ce,Object.freeze(this)}static isMadeByVerifier(l){return#a in l}}function sg(l){return typeof l==="object"&&l!==null&&Rl.isMadeByVerifier(l)}var MX="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",UX={"managed-settings":86400,"policy-limits":86400},HX=300,Tl=16384,FX=8192,BX=300000,zX=3,GX=3600000,WX=/^[A-Za-z0-9_-]+$/,jX=/^[A-Za-z0-9+/]+={0,2}$/,KX=Ke(()=>Ft.object({alg:Ft.literal("ES256"),typ:Ft.literal("cc-signed-cache+jws"),kid:Ft.string(),x5c:Ft.array(Ft.string().regex(jX)).min(1).max(zX)})),$X=Ke(()=>Ft.object({v:Ft.literal(1),typ:Ft.string(),aud:Ft.string(),iat:Ft.number(),sha:Ft.string(),sub:Ft.string().optional(),ws:Ft.string().optional(),exp:Ft.int().optional(),abs:Ft.literal(!0).optional(),doc:Ft.string().optional(),plan:Ft.string().optional()})),VX=Ke(()=>Ft.object({v:Ft.int().min(2)}));function ig({jws:l,...A}){if(!l)return{result:"unsigned"};let L={};try{let x=YX(l,A,L);if(typeof x==="string")return{result:x,...L};return{...L,result:"valid",issuedAt:x.issuedAt,notAfter:x.notAfter,plan:x.plan,verified:new Rl(rg,{kind:A.kind,state:x.state,bodySha:A.bodySha,issuedAt:x.issuedAt,notAfter:x.notAfter,plan:x.plan,organizationUuid:x.organizationUuid,accountUuid:x.accountUuid})}}catch{return{result:"malformed",...L}}}function YX(l,{kind:A,orgUuid:L,accountUuid:x,workspaceUuid:z,unanchoredClaims:W,bodySha:Z,nowMs:ne,roots:ce},Te){if(l.length>Tl)return"malformed";let[Le,we,Ie,...Be]=l.split(".");if(Le===void 0||we===void 0||Ie===void 0||Be.length>0||![Le,we,Ie].every((At)=>WX.test(At)))return"malformed";let ke=KX().safeParse(ng(Le)),qe=ng(we),He=$X().safeParse(qe);if(!ke.success||!(He.success||VX().safeParse(qe).success))return"malformed";if(He.success){if(Te.issuedAt=He.data.iat,Te.ageSeconds=Math.floor(ne/1000)-He.data.iat,Te.wsUnanchored=z===void 0&&He.data.ws!==void 0,Te.statesLifetime=He.data.exp!==void 0,Te.absence=He.data.abs===!0,Te.plan=qm(He.data.plan),He.data.abs===!0&&He.data.exp===void 0)return"malformed"}let rt=ke.data.x5c.map((At)=>Buffer.from(At,"base64"));if(rt.some((At)=>At.length>FX))return"malformed";let[We,...nt]=rt,it=tg(We);if(Te.certHoursLeft=Math.floor((Date.parse(it.validTo)-ne)/GX),ce.length===0)return"no_embedded_root";let mt=[it,...nt.map(tg)];for(let At=0;At+1<mt.length;At++)if(!Qm(mt[At],mt[At+1]))return"bad_chain";let Lt=mt.at(-1),kt;for(let At of ce){let xt=new og(At.pem);if(Qm(Lt,xt)){kt={root:At,certificate:xt};break}}if(kt===void 0)return"bad_chain";for(let At=1;At<mt.length;At++)if(eg(mt[At],At-1))return"bad_chain";if(eg(kt.certificate,mt.length-1))return"bad_chain";if(it.ca)return"bad_chain";if(kt.root.issuingCommonName!==void 0&&(mt.length!==2||JX(mt[1])!==kt.root.issuingCommonName))return"bad_chain";let Jt=He.success?He.data.iat*1000:ne;if(![...mt,kt.certificate].every((At)=>ZX(At,Jt)))return"cert_expired";if(!XX(it.subjectAltName??"").includes(`URI:${kt.root.marker}`))return"no_marker";if(it.publicKey.asymmetricKeyType!=="ec"||it.publicKey.asymmetricKeyDetails?.namedCurve!=="prime256v1")return"bad_signature";if(!kX("sha256",Buffer.from(`${Le}.${we}`,"utf8"),{key:it.publicKey,dsaEncoding:"ieee-p1363"},Buffer.from(Ie,"base64url")))return"bad_signature";if(!He.success)return"unsupported_version";if(He.data.typ!==A)return"wrong_type";let je=W==="refuse";if((L!==void 0||je)&&He.data.aud!==L)return"aud_mismatch";if((x!==void 0||je)&&He.data.sub!==x)return"sub_mismatch";if(z!==void 0&&He.data.ws!==z)return"ws_mismatch";if(He.data.sha!==Z)return"sha_mismatch";let ze=He.data.abs===!0,st=He.data.sha===MX;if(A==="managed-settings"?(ze||He.data.exp!==void 0)&&(ze!==st||ze&&He.data.doc!==void 0):ze)return"abs_mismatch";let ct=Math.floor(ne/1000)-He.data.iat;if(ct<-HX)return"future_iat";let Tt=Math.min(UX[A],(He.data.exp??Number.POSITIVE_INFINITY)-He.data.iat),wt=He.data.iat+Tt;if(Te.notAfter=wt,Tt<=0||ct>Tt)return"stale";return{issuedAt:He.data.iat,notAfter:wt,state:ze?"absence":"document",plan:qm(He.data.plan),organizationUuid:He.data.aud,accountUuid:He.data.sub}}function XX(l){let A=[],L="",x=!1;for(let z=0;z<l.length;z++){let W=l[z];if(x){if(W==="\\"&&z+1<l.length){L+=W+l[z+1],z++;continue}if(L+=W,W==='"')x=!1;continue}if(W==='"'){x=!0,L+=W;continue}if(W===","){A.push(L),L="";let Z=z+1;while(Z<l.length&&/\s/.test(l[Z]))Z++;z=Z-1;continue}L+=W}if(x)return[];return A.push(L),A}function Qm(l,A){return A.ca&&Boolean(l.checkIssued(A))&&l.verify(A.publicKey)}function JX(l){let A=l.toLegacyObject().subject?.CN;return typeof A==="string"?A:void 0}function eg(l,A){let L=Zm(l.raw);return L!==void 0&&A>L}function tg(l){let A=new og(l);if(A.raw.length!==l.length)throw Error("trailing bytes after x5c certificate DER");return A}function ZX(l,A){return A>=Date.parse(l.validFrom)-BX&&A<=Date.parse(l.validTo)}function ng(l){try{return _(Buffer.from(l,"base64url").toString("utf8"))}catch{return}}var qX=Tl+256,QX=Ke(()=>Ar.object({jws:Ar.string().min(1),receivedAt:Ar.number()}));function e4(l){return`${l}.signature.json`}function t4(l){return`${l}.signature-iat.json`}var Kue=["remote-settings.json","policy-limits.json"].map(t4);function ag(l){let A=n4(e4(l),QX());return A.kind==="ok"?A.value:null}function n4(l,A){if(f())return{kind:"absent"};let L=Jm(l,qX,{refuseLinkOnWindows:!0});if(L.kind!=="ok")return L.kind==="absent"?{kind:"absent"}:{kind:"unparsable"};try{let x=A.safeParse(_(L.text));return x.success?{kind:"ok",value:x.data}:{kind:"unparsable"}}catch{return{kind:"unparsable"}}}function Dl(l,A){return A===void 0||A.includes(l)?void 0:"org_pin_mismatch"}function o4({verification:l,held:A,pinnedOrgs:L}){if(A.orgUuid!==void 0){let z=Dl(A.orgUuid,L);if(z!==void 0)return{trusted:!1,reason:z}}let x;switch(l.result){case"valid":if(!sg(l.verified))return{trusted:!1,reason:"error"};if(l.statesLifetime!==!0)return{trusted:!1,reason:"no_lifetime"};x=l.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:l.result};default:return{trusted:!1,reason:"error"}}if(A.orgUuid===void 0){let z=Dl(x.organizationUuid,L);if(z!==void 0)return{trusted:!1,reason:z}}return{trusted:!0,principal:{orgUuid:A.orgUuid??x.organizationUuid,accountUuid:A.accountUuid??x.accountUuid,workspaceUuid:A.workspaceUuid}}}function Ll(l){switch(l){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 lg({kind:l,cachePath:A,live:L,body:x,bodySha:z,account:W,pinnedOrgs:Z,nowMs:ne,roots:ce}){try{let Te=W?.organizationUuid||void 0,Le=W?.accountUuid||void 0,we=W?.workspaceUuid||void 0,Ie={orgUuid:Te,accountUuid:Le,workspaceUuid:we};if(Te!==void 0&&Dl(Te,Z)!==void 0)return{trusted:!1,reason:"org_pin_mismatch"};if(Wi(x))return{trusted:!1,reason:"sha_mismatch"};return o4({verification:ig({jws:L!==void 0?L.jws:ag(A)?.jws,kind:l,orgUuid:Te,accountUuid:Le,workspaceUuid:we,unanchoredClaims:"accept",bodySha:z,nowMs:ne,roots:ce}),held:Ie,pinnedOrgs:Z})}catch(Te){return e(`signed-cache: judging a stored copy failed: ${u(Te)}`,{level:"error"}),{trusted:!1,reason:"error"}}}var r4={begin:"-----SIGNED-CACHE-ROOTS-BEGIN-----",roots:[{pem:`-----BEGIN CERTIFICATE-----
MIIB3TCCAYKgAwIBAgIUANUYY/tuc08yPd9Nsh7rY/zDEiwwCgYIKoZIzj0EAwIw
OjESMBAGA1UEChMJQW50aHJvcGljMSQwIgYDVQQDExtBbnRocm9waWMgQXBwcyBT
aWduaW5nIFJvb3QwHhcNMjYwOTAyMjMzNDMwWhcNNDEwODI5MjMzNDI5WjA6MRIw
EAYDVQQKEwlBbnRocm9waWMxJDAiBgNVBAMTG0FudGhyb3BpYyBBcHBzIFNpZ25p
bmcgUm9vdDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAsUtD9z65VTC61W8M40
B+bGEhcvb+8mLm/9aTh39H4lwLH0agHzBBqkt4dvqqGzo1J2pJN7L7UoX9nEEVbO
7rmjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMB0GA1Ud
DgQWBBQW+2L0kdDEOi+A6fBK5jpwNdtoCzAfBgNVHSMEGDAWgBQW+2L0kdDEOi+A
6fBK5jpwNdtoCzAKBggqhkjOPQQDAgNJADBGAiEA+vhhLCvaUT2ccO0ND0YZaUy0
e+zhUoJOBhE9hXPs+SkCIQCHdbMcFo/ZQEq/rVnaS8qv/BZvRfYoEm318TY0WBU4
XA==
-----END CERTIFICATE-----`,marker:"urn:anthropic:claude-code:signed-cache:production"}],end:"-----SIGNED-CACHE-ROOTS-END-----"},cg=r4.roots;var dg={marker:"urn:anthropic:claude-code:signed-cache:production",issuingCommonName:"Claude Code Signed Cache Issuing CA"},Cr=void 0,ug=Object.freeze(cg.map((l)=>Object.freeze({...l,issuingCommonName:Cr!==void 0&&l.marker===Cr.marker?Cr.issuingCommonName:dg.issuingCommonName})));function s4(){if(Cr!==void 0&&Ut()&&ug.some((l)=>l.marker===Cr.marker))return Cr.marker;return dg.marker}function i4(l,A){return Object.freeze(l.filter((L)=>L.marker===A))}function pg(){return i4(ug,s4())}var a4=d(new Map,(l)=>l.clear());var Ki=d({isOpen:!1},(l)=>{l.isOpen=!1});function l4(l){return process.env[l]}function fg(l,A){if(A===void 0){delete process.env[l];return}process.env[l]=A}function c4(l){return l4(l.name)===l.theirs}function d4(){let l=[...a4.values()];return Ki.isOpen?l:l.filter(c4)}function mg(l,A){if(Ki.isOpen)return l();let L=d4();if(L.length===0)return l();let x=L.filter((z)=>z.writer===void 0||A===void 0||!A(z.writer));for(let z=x.length-1;z>=0;z--)fg(x[z].name,x[z].before);Ki.isOpen=!0;try{return l()}finally{for(let z of x)fg(z.name,z.theirs);Ki.isOpen=!1}}var u4=new Map([["˂","<"],["˃",">"],["ᐳ",">"],["ᐸ","<"],["ᚲ","<"],["‹","<"],["›",">"],["≮","<"],["≯",">"],["≺","<"],["≻",">"],["⊀","<"],["⊁",">"],["⋖","<"],["⋗",">"],["〈","<"],["〉",">"],["❬","<"],["❭",">"],["❮","<"],["❯",">"],["❰","<"],["❱",">"],["⟨","<"],["⟩",">"],["⦑","<"],["⦒",">"],["⦓","<"],["⦔",">"],["⧼","<"],["⧽",">"],["⩹","<"],["⩺",">"],["⪦","<"],["⪧",">"],["〈","<"],["〉",">"],["︿","<"],["﹀",">"],["﹤","<"],["﹥",">"],["<","<"],[">",">"],["\uD81B\uDF3F",">"],["\uD834\uDE36","<"],["\uD834\uDE37",">"]]);var p4=new Map([...u4,...Array.from("≪⋘⪡⫷⟪︽",(l)=>[l,"<"]),...Array.from("≫⋙⪢⫸⟫︾",(l)=>[l,">"])]),f4=new Map([...p4,["《","<"],["》",">"]]),spe=new Set(`⦒⦔⩺⪧${"≫⋙⪢⫸⟫︾"}`);function gg(l){let A=l;for(let[L,x]of f4)if(x===l)A+=L;return A}var _s="$defaults";var m4=["user_allow_rules_to_replace","user_soft_deny_rules_to_replace","user_hard_deny_rules_to_replace","user_environment_to_replace"];var g4=["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"],_4=["cowork_delete_grant","cowork_folder_access","cowork_run_routine_now","cowork_scheduled_task_delete","cowork_scheduled_task_write","cowork_skill_persistence"],E4=["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"];var h4=[],_g=new Set([...g4,...h4]),ape=new Set([..._g,...E4]),lpe=new Set([..._g,..._4]);function $i(l){for(let A=0;A<l.length;A++){let L=l.charCodeAt(A);if(L<32&&L!==9||L>=127&&L<=159||L===8232||L===8233)return!0}return!1}var S4=/[\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029\u2800\uFFF9-\uFFFB\u{1D173}-\u{1D17A}]/u;function Vi(l){return S4.test(l)}function Eg(l){if(l.includes("<settings_")||m4.some((A)=>l.includes(`<${A}`)||l.includes(`</${A}`)))return"template_token";if(l.includes("<cc_automode")||l.includes("</cc_automode"))return"region_tag";return null}function hg(l){return l.trim().length>0&&!$i(l)&&!Vi(l)&&Eg(l)===null}import{posix as wE,win32 as PE}from"path";import*as ae from"zod/v4";import{isAbsolute as Sg}from"path";import*as lt from"zod/v4";var Il="When managed settings or a --settings file set allowUnsandboxedCommands: false, or managed settings set network.allowManagedDomainsOnly: true",y4="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",O4="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",A4="When managed settings or a --settings file set filesystem.denyRead, a Read(…) deny rule "+"or a credentials.files entry (deny or mask)",qn="project settings (.claude/settings.json and .claude/settings.local.json)",br=`${Il}, values from ${qn} are ignored.`,Yi=`${Il}, true from ${qn} is ignored (false there still applies).`,yg=`${Il}, and managed, --settings or user settings set true, false from ${qn} is ignored (true there still applies).`,Og=`${y4}, values from ${qn} are ignored. With network.allowManagedDomainsOnly, only managed settings may set it.`,C4=`${O4}, a value from ${qn} 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.`,b4=`${br} ${A4}, a value from ${qn} 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.`,R4=Ke(()=>lt.object({allowedDomains:lt.array(lt.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. "+br+" With network.allowManagedDomainsOnly, only managed settings supply it."),deniedDomains:lt.array(lt.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:lt.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 — "+`${qn} are ignored, and while it is on their allowedDomains `+"and WebFetch(domain:…) allow rules are left out of the allowlist."),allowManagedDomainsOnly:lt.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:lt.array(lt.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path). Merged across settings sources. "+br),allowAllUnixSockets:lt.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms). "+Yi),allowLocalBinding:lt.boolean().optional().describe("macOS only: If true, sandboxed commands can bind to localhost ports. "+Yi),allowMachLookup:lt.array(lt.string().refine((l)=>!(l.endsWith("*")?l.slice(0,-1):l).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.CoreSimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright. 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. '+br),httpProxyPort:lt.number().optional().describe("Local TCP port of your own HTTP proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Og),socksProxyPort:lt.number().optional().describe("Local TCP port of your own SOCKS5 proxy for sandboxed traffic, used instead of the proxy Claude Code runs. "+Og),tlsTerminate:lt.object({caCertPath:lt.string().min(1).optional(),caKeyPath:lt.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()),T4=Ke(()=>lt.object({allowWrite:lt.array(lt.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules. "+b4),denyWrite:lt.array(lt.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:lt.array(lt.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:lt.array(lt.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths. "+C4),allowManagedReadPathsOnly:lt.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:lt.boolean().optional().describe("macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would "+"withhold every access grant rather than loosen them — filesystem isolation stays on there. "+"Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files deny entries for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.files mask entries (sentinel binds) and credentials.envVars deny/mask are unaffected. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable file. (sandbox.credentials.envVars and credentials.files mask entries "+"do not pin it — env scrubbing and sentinel binds are independent of the filesystem "+"layer and survive this setting.) When unset, filesystem isolation stays on.")}).optional());function Ag(l,A,L){if(l.length===0||l.some((x)=>x.length===0))L.addIssue({code:lt.ZodIssueCode.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(A===void 0)L.addIssue({code:lt.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 Cg(l,A){let L;try{L=new RegExp(l)}catch(z){A.addIssue({code:lt.ZodIssueCode.custom,path:["extract"],message:`extract is not a valid regular expression: ${u(z)}`});return}if(new RegExp(L.source+"|").exec("").length-1<1)A.addIssue({code:lt.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 bg(l){if(typeof l!=="object"||l===null)return l;let A=l;if(A.mode!=="deny")return l;let L={...A};if("extract"in L&&typeof L.extract!=="string")delete L.extract;if("onExtractNoMatch"in L&&L.onExtractNoMatch!=="warn"&&L.onExtractNoMatch!=="deny"&&L.onExtractNoMatch!=="error")delete L.onExtractNoMatch;if("decode"in L&&L.decode!=="jwt")delete L.decode;if("maskClaims"in L&&!(Array.isArray(L.maskClaims)&&L.maskClaims.every((x)=>typeof x==="string")))delete L.maskClaims;if("maskDuplicates"in L&&typeof L.maskDuplicates!=="boolean")delete L.maskDuplicates;if("injectHosts"in L&&!(Array.isArray(L.injectHosts)&&L.injectHosts.every((x)=>typeof x==="string")))delete L.injectHosts;return L}var Xi=Ke(()=>lt.preprocess(bg,lt.object({path:lt.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:lt.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:lt.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:lt.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:lt.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:lt.array(lt.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:lt.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:lt.array(lt.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((l,A)=>{if(l.mode==="mask"&&l.path.endsWith("/"))A.addIssue({code:lt.ZodIssueCode.custom,path:["path"],message:'Credential mode "mask" applies to a single file, not a directory. List the specific credential file(s), or use "deny" for the directory.'});if(l.mode==="mask"&&l.extract!==void 0)Cg(l.extract,A);if(l.mode==="mask"&&l.maskClaims!==void 0)Ag(l.maskClaims,l.decode,A)}))),Rr=()=>lt.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"),Ji=Ke(()=>lt.preprocess(bg,lt.object({name:Rr().describe("Environment variable name."),mode:lt.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:lt.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:lt.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:lt.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:lt.array(lt.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:lt.array(lt.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((l,A)=>{if(l.mode==="mask"&&l.extract!==void 0)Cg(l.extract,A);if(l.mode==="mask"&&l.maskClaims!==void 0)Ag(l.maskClaims,l.decode,A);if(l.mode==="mask"&&l.decode!==void 0&&l.extract!==void 0)A.addIssue({code:lt.ZodIssueCode.custom,path:["extract"],message:"extract cannot be combined with decode on an env entry — the runtime takes the decode path (whole-value JWT verification) and never consults extract, silently disabling the structured masking. Remove one of the two."});if(l.mode==="mask"&&l.decode!==void 0&&(l.onExtractNoMatch==="deny"||l.onExtractNoMatch==="error"))A.addIssue({code:lt.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)."})}))),Eo=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var wl="_INVALID_PAIR_",Zi="_PARENT_PAIR_SUPPRESSOR_";var qi=Ke(()=>lt.object({accessKeyIdVar:Rr().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:Rr().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:Rr().optional().describe("Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.")}).superRefine((l,A)=>{let L=new Map;for(let[x,z]of[["accessKeyIdVar",l.accessKeyIdVar],["secretAccessKeyVar",l.secretAccessKeyVar],["sessionTokenVar",l.sessionTokenVar]]){if(z===void 0)continue;let W=L.get(z);if(W!==void 0)A.addIssue({code:lt.ZodIssueCode.custom,path:[x],message:`${x} names the same env var ('${z}') as ${W} — each pair member must be a distinct variable.`});else L.set(z,x)}})),D4=Ke(()=>{let l=lt.enum(["deny","passthrough"]);return lt.object({streaming:l.optional().describe("Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature)."),presigned:l.optional().describe("Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`."),sigv4a:l.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),L4=Ke(()=>lt.object({files:lt.array(Xi()).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:lt.array(Ji()).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:lt.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:lt.array(qi()).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:D4().optional().describe("Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored.")}).superRefine((l,A)=>{let L=new Set;for(let[x,z]of(l?.awsPairs??[]).entries()){let W=[["accessKeyIdVar",z.accessKeyIdVar],["secretAccessKeyVar",z.secretAccessKeyVar],["sessionTokenVar",z.sessionTokenVar]],Z=new Set;for(let[ne,ce]of W){if(ce===void 0)continue;if(L.has(ce))A.addIssue({code:lt.ZodIssueCode.custom,path:["awsPairs",x,ne],message:`"${ce}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});Z.add(ce)}for(let ne of Z)L.add(ne)}}).optional()),Pl=Ke(()=>lt.object({enabled:lt.boolean().optional().describe("Run Bash commands inside the sandbox. Default: false. "+yg),failIfUnavailable:lt.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. "+yg),autoAllowBashIfSandboxed:lt.boolean().optional(),allowUnsandboxedCommands:lt.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 ${qn} say (false there still applies).`),network:R4(),filesystem:T4(),credentials:L4(),ignoreViolations:lt.record(lt.string(),lt.array(lt.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. '+br),enableWeakerNestedSandbox:lt.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. "+Yi),allowNestedUserNamespaces:lt.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 ${qn} is ignored (false there still applies).`),enableWeakerNetworkIsolation:lt.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. "+Yi),allowAppleEvents:lt.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:lt.array(lt.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. "+br),ripgrep:lt.object({command:lt.string(),args:lt.array(lt.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:lt.preprocess((l)=>typeof l==="string"&&Sg(l)?l:void 0,lt.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:lt.preprocess((l)=>typeof l==="string"&&Sg(l)?l:void 0,lt.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());import*as Es from"zod/v4";var No=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],w4=[...No],Rg=w4;function Tr(l){return l==="manual"?"default":l}var Epe=`Cannot set permission mode: must be one of ${No.join(", ")}`;var hpe={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},unfinishedCheck:{bypassImmune:!0,waivableInBypass:!1,classifierRouted:!1,autoModeDeny:!1,hostPersonOnly:!0,localProjectionOnly:!1,servedUnplaceable:!1},...{},...{}};var Tg=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var Dg=["normal","vim"];var Lg=["auto","12-hour","24-hour","24-hour-utc"],Ig=["auto","tmux","iterm2","in-process"],P4=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],wg=["auto",...P4],Pg=["auto","alwaysAsk","disabled"],xg=1e5,Ng=1e6;import*as kg from"zod/v4";import*as Ln from"zod/v4/core";var x4=Ln.$ZodType,N4=kg.ZodType,xl=Ln.$constructor("ZodDeferredOptional",(l,A)=>{x4.init(l,A),N4.init(l,A),l._zod.optin="optional",l._zod.optout="optional",Object.defineProperty(l._zod,"innerType",{get:A.built,configurable:!0}),l._zod.processJSONSchema=(L,x,z)=>{let W=A.getter();Ln.process(W,L,z),L.seen.get(l).ref=W},Ln.util.defineLazy(l._zod,"values",()=>{let L=A.getter()._zod.values;return L?new Set([...L,void 0]):void 0}),Ln.util.defineLazy(l._zod,"pattern",()=>{let L=A.getter()._zod.pattern;return L?new RegExp(`^(${Ln.util.cleanRegex(L.source)})?$`):void 0}),Ln.util.defineLazy(l._zod,"propValues",()=>A.getter()._zod.propValues),l._zod.parse=(L,x)=>{if(L.value===void 0)return L;return A.getter()._zod.run(L,x)},l.unwrap=A.getter});function yn(l){let A;return new xl({type:"lazy",getter:()=>{if(A===void 0){let x=l();if(x._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.");A=x}return A},built:()=>A})}import*as at from"zod/v4";var k4=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function vg(l){return new RegExp(k4).test(l)}var Mg=/(?<![^\s\p{P}])\p{M}+/gu;function v4(l){return Pt(H4(Ae(l))).replace(/ {2,}/g," ").trim()}var M4=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,U4=4;function H4(l){let A=l;for(let L=0;L<U4;L++){let x=A.replace(M4,"");if(x===A)break;A=x}return A}function Nl(l,A=160){return F4(v4(B4(l,A)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(Mg,""),A)}var Npe=new RegExp(`[^\\S ]|[${I}]`,"u");function F4(l,A=2000){return l.length>A?`${ee(l,A)}…`:l}function B4(l,A){let L=ee(l,A*8);if(L.length===l.length)return L;let x=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(L);if(x===null)return L;let z=l.slice(x.index);return(z[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(z):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(z))?L.slice(0,x.index):L}var Ug=Re;function kl(l){return Object.hasOwn(Ug,l)?Ug[l]:l}var Hg="workspace",Hpe=`mcp__${Hg}__bash`,Fpe=`mcp__${Hg}__web_fetch`;function hs(l){return l.includes("*")}function G4(l){return l.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function W4(l){return j4(l).replaceAll("\\\\","\\")}function j4(l){return l.replaceAll("\\(","(").replaceAll("\\)",")")}function vl(l){if(typeof l==="string"&&!l.includes("(")&&!l.includes(")"))return{kind:"bare"};let A=K4(l,"("),L=$4(l,")");if(A===-1&&L===-1)return{kind:"bare"};let x=l.substring(0,A);if(A===-1||L<=A||L!==l.length-1||/[()]/.test(x))return{kind:"malformed"};return{kind:"call",toolName:x,rawContent:l.substring(A+1,L)}}function Fg(l){let A=vl(l);if(A.kind!=="call"||!A.toolName)return{toolName:kl(l)};if(A.rawContent===""||A.rawContent==="*")return{toolName:kl(A.toolName)};let L=W4(A.rawContent);return{toolName:kl(A.toolName),ruleContent:L}}function On(l){if(!l.ruleContent)return l.toolName;let A=G4(l.ruleContent);return`${l.toolName}(${A})`}function K4(l,A){for(let L=0;L<l.length;L++)if(l[L]===A){let x=0,z=L-1;while(z>=0&&l[z]==="\\")x++,z--;if(x%2===0)return L}return-1}function $4(l,A){for(let L=l.length-1;L>=0;L--)if(l[L]===A){let x=0,z=L-1;while(z>=0&&l[z]==="\\")x++,z--;if(x%2===0)return L}return-1}function Ss(l){let A=l.replace(/[^a-zA-Z0-9_-]/g,"_");if(l.startsWith("claude.ai "))A=A.replace(/_+/g,"_").replace(/^_|_$/g,"");return A}function Bg(){return{active:!1,readLegacyKeyOwner:()=>{return},claimLegacyKeyOwner:async()=>{return},legacyKeyOwners:new Map,unsavedLegacyKeys:new Set,refusedLegacyKeys:new Map,needsRebuild:!1,servers:new Map,tools:new Map,wireByInternal:new Map,internalByWire:new Map,wireKeyByInternalKey:new Map,internalKeyByWireKey:new Map,keptLegacyNames:0,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 pfe=new X(Bg),ffe=new s(()=>({used:!1})),mfe=Bg();var V4="mcp__";function Dr(l){let A=l.split("__"),[L,x,...z]=A;if(L!=="mcp"||!x)return null;let W=z.length>0?z.join("__"):void 0;return{serverName:x,toolName:W}}function Ml(l){return`${V4}${Ss(l)}__`}function zg(l){return Dr(`${Ml(l)}t`)===null}function Gg(l){return l in Object.prototype&&zg(l)}var Qi="server names may only contain letters, numbers, hyphens and underscores, and may not be constructor, prototype, __proto__, __defineGetter__, __defineSetter__, __lookupGetter__ or __lookupSetter__";var Ufe=Ke(()=>at.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"]));var Hfe=Ke(()=>at.enum(["stdio","sse","sse-ide","http","ws","sdk"]));var Y4=/^[A-Za-z0-9_-]+$/;var Lr=Ke(()=>at.literal("comms").optional().catch(void 0)),ho=Ke(()=>at.number().int().positive()),X4=300000,Wg=Ke(()=>at.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function jg({request_timeout_ms:l,...A}){return{...A,...A.timeout===void 0&&l!==void 0&&{timeout:Math.min(l,X4)}}}var J4=Ke(()=>at.object({type:at.literal("stdio").optional(),command:at.string().min(1,"Command cannot be empty"),args:at.array(at.string()).default([]),env:at.record(at.string(),at.string()).optional(),timeout:ho().optional(),alwaysLoad:at.boolean().optional(),bareElicitationCapability:at.boolean().optional(),role:Lr()})),Z4=Ke(()=>at.boolean()),Kg=Ke(()=>at.object({clientId:at.string().optional(),callbackPort:at.number().int().positive().optional(),authServerMetadataUrl:at.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:at.string().min(1).optional(),xaa:Z4().optional()})),Ul=Ke(()=>at.object({name:at.string(),permission_policy:at.enum(["always_allow","always_ask","always_deny"]).optional()})),$g=Ke(()=>at.object({type:at.literal("sse"),url:at.string(),headers:at.record(at.string(),at.string()).optional(),headersHelper:at.string().optional(),oauth:Kg().optional(),timeout:ho().optional(),request_timeout_ms:Wg(),tools:at.array(Ul()).optional(),alwaysLoad:at.boolean().optional(),bareElicitationCapability:at.boolean().optional(),discoveryCache:at.boolean().optional(),role:Lr(),toolPermissions:at.record(at.string(),zl()).optional()}).transform(jg)),q4=Ke(()=>at.object({type:at.literal("sse-ide"),url:at.string(),ideName:at.string(),ideRunningInWindows:at.boolean().optional(),timeout:ho().optional(),alwaysLoad:at.boolean().optional(),role:Lr()})),Q4=Ke(()=>at.object({type:at.literal("ws-ide"),url:at.string(),ideName:at.string(),authToken:at.string().optional(),ideRunningInWindows:at.boolean().optional(),timeout:ho().optional(),alwaysLoad:at.boolean().optional(),role:Lr()})),Vg=Ke(()=>at.object({type:at.enum(["http","streamable-http"]).transform(()=>"http"),url:at.string(),headers:at.record(at.string(),at.string()).optional(),headersHelper:at.string().optional(),oauth:Kg().optional(),timeout:ho().optional(),request_timeout_ms:Wg(),tools:at.array(Ul()).optional(),alwaysLoad:at.boolean().optional(),bareElicitationCapability:at.boolean().optional(),discoveryCache:at.boolean().optional(),role:Lr(),toolPermissions:at.record(at.string(),zl()).optional()}).transform(jg)),e3=["command","args","env","headersHelper"],t3=new Set(["http","streamable-http","sse"]),n3=/[\p{Cc}\p{Cf}\u2028\u2029]/u,o3=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function Hl(l){return/^[A-Za-z0-9_-]+$/.test(l)&&!Gg(l)&&l!=="constructor"&&l!=="prototype"}function r3(l){try{let A=new URL(l);return A.protocol==="https:"&&A.hostname!==""}catch{return!1}}function Yg(l,A="",L=0){if(typeof l==="string")return[[A,l,!1]];if(L>4||l===null||typeof l!=="object")return[];return Object.entries(l).flatMap(([x,z])=>{let W=x.replace(o3,(ne)=>`\\u${ne.codePointAt(0).toString(16).padStart(4,"0")}`),Z=A?`${A}.${W}`:W;return[[Z,x,!0],...Yg(z,Z,L+1)]})}var Fl=Ke(()=>at.record(at.string(),at.unknown()).check((l)=>{let A=(x,z)=>{l.issues.push({code:"custom",path:x,message:z,input:l.value})};for(let x of e3)if(Object.hasOwn(l.value,x))A([x],`"${x}" 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(!t3.has(l.value.type))A(["type"],'managed settings can only deliver "http" or "sse" servers');let L=l.value.url;if(typeof L==="string"&&!r3(L))A(["url"],"managed settings servers must use a valid https:// url");for(let[x,z,W]of Yg(l.value))if(n3.test(z))A(x.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(!W&&vg(z))A(x.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(at.union([Vg(),$g()]))),Bl=`"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 ea(l,A){if(l===void 0)return;if(l===null||typeof l!=="object"||Array.isArray(l)){A("",Bl);return}let L=Object.create(null);for(let[x,z]of Object.entries(l)){if(!Hl(x)){A("<invalid name>",Qi);continue}let W=Fl().safeParse(z);if(W.success){L[x]=W.data;continue}let Z=W.error.issues[0];A(x,Z?[Z.path.join("."),Z.message].filter(Boolean).join(": "):"failed validation")}return L}var s3=Ke(()=>at.object({type:at.literal("ws"),url:at.string(),headers:at.record(at.string(),at.string()).optional(),headersHelper:at.string().optional(),timeout:ho().optional(),alwaysLoad:at.boolean().optional(),bareElicitationCapability:at.boolean().optional(),role:Lr()})),i3=Ke(()=>at.object({type:at.literal("sdk"),name:at.string(),timeout:ho().optional(),alwaysLoad:at.boolean().optional(),disableAutoBackground:at.boolean().optional().catch(void 0),tools:at.array(Ul()).optional().catch(void 0),connectorId:at.string().min(1).optional().catch(void 0)})),zl=Ke(()=>at.enum(["allow","ask","blocked"])),a3=Ke(()=>at.object({type:at.literal("claudeai-proxy"),url:at.string(),id:at.string().regex(Y4),displayName:at.string().optional(),iconUrl:at.string().optional(),timeout:ho().optional(),alwaysLoad:at.boolean().optional(),toolPermissions:at.record(at.string(),zl()).optional(),stateless:at.boolean().optional(),cachedInitResponse:at.record(at.string(),at.unknown()).nullish(),discoverSupport:at.enum(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:at.record(at.string(),at.unknown()).nullish(),eligible:at.boolean().nullish(),ineligibleReason:at.string().nullish(),enterpriseManaged:at.boolean().optional()})),ta=Ke(()=>at.union([J4(),$g(),q4(),Q4(),Vg(),s3(),i3(),a3()]));var Ffe=Ke(()=>at.object({mcpServers:at.record(at.string(),ta())}));import*as Ir from"zod/v4";var ys=["anthropic","customEndpoint","bedrock","vertex","foundry","anthropicAws","mantle","gateway"],l3=/^anthropic[A-Z][A-Za-z0-9]*$/,c3=new Set(ys);function Gl(l){return typeof l==="string"&&c3.has(l)}function Wl(l){return Gl(l)||typeof l==="string"&&l3.test(l)}import*as wr from"zod/v4";var jfe=E()==="macos"?"⏺":"●";var d3=new Set(["Claude Preview","Claude Browser"]),u3=new Set(["claude-in-chrome","Claude in Chrome"]),rme=new Set([...u3,...d3]);var p3=["Claude_Browser__"],f3=["claude-in-chrome__","Claude_in_Chrome__"],sme=[...p3,...f3];var gme=Ke(()=>wr.preprocess(Tr,wr.enum(Rg))),_me=Ke(()=>wr.preprocess(Tr,wr.enum(No)));import{posix as k3,win32 as v3}from"path";import*as Ee from"zod/v4";var Xg={".ts":"ts",".tsx":"tsx",".jsx":"jsx",".js":"js",".mjs":"js",".cjs":"js",".mts":"ts",".cts":"ts"};var jl=Object.keys(Xg);var _3=`${jl.slice(0,-1).join(", ")} or `+String(jl.at(-1));import{isIPv4 as E3,isIPv6 as h3}from"net";var S3=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"]),Zg=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function qg(l,A,L,x){return l===127||l===169&&A===254||l===0}function y3(l){let A=l.indexOf("%"),x=(A>=0?l.slice(0,A):l).toLowerCase().split("::");if(x.length>2)return;let z=x[0]?x[0].split(":"):[],W=x.length===2&&x[1]?x[1].split(":"):[],Z=x.length===2?W:z,ne=[],ce=Z.at(-1);if(ce!==void 0&&ce.includes(".")){let Be=ce.split(".").map(Number);if(Be.length!==4||Be.some((ke)=>!Number.isInteger(ke)||ke<0||ke>255))return;ne=Be,Z.pop()}let Te=(Be)=>{let ke=[];for(let qe of Be){if(!/^[0-9a-f]{1,4}$/.test(qe))return;let He=parseInt(qe,16);ke.push(He>>8,He&255)}return ke},Le=Te(x.length===2?z:[]),we=Te(Z);if(Le===void 0||we===void 0)return;let Ie=Le.length+we.length+ne.length;if(Ie>16||x.length===1&&Ie!==16)return;return[...Le,...Array(16-Ie).fill(0),...we,...ne]}function O3(l){return Qg(l)&&l[4]===0&&l[5]===1}function Qg(l){return l[0]===0&&l[1]===100&&l[2]===255&&l[3]===155}function A3(l){let A=[];if(l[0]===32&&l[1]===2)A.push(l.slice(2,6));let L=l.slice(0,10).every((ne)=>ne===0),x=L&&l[10]===255&&l[11]===255,z=L&&l[10]===0&&l[11]===0,W=Qg(l)&&l.slice(4,12).every((ne)=>ne===0),Z=(l[8]===0||l[8]===2)&&l[9]===0&&l[10]===94&&l[11]===254;if(x||z||W||Z)A.push(l.slice(12,16));return A}function e_(l){let A=l.toLowerCase().replace(/^\[|\]$/g,"");if(A.endsWith("."))A=A.slice(0,-1);if(A===""||A==="localhost"||A.endsWith(".localhost"))return!0;if(S3.has(A))return!0;if(A.startsWith("instance-data.")&&A.endsWith(".compute.internal"))return!0;if(E3(A)){if(Zg.has(A))return!0;let[x=0,z=0,W=0,Z=0]=A.split(".").map(Number);return qg(x,z,W,Z)}if(!h3(A))return!1;let L=y3(A);if(L===void 0)return!0;if(O3(L))return!0;if(L.every((x)=>x===0))return!0;if(L.slice(0,15).every((x)=>x===0)&&L[15]===1)return!0;if(A==="fd00:ec2::254")return!0;if(L[0]===254&&(L[1]??0)>=128&&(L[1]??0)<=191)return!0;return A3(L).some((x)=>{let[z=0,W=0,Z=0,ne=0]=x;return qg(z,W,Z,ne)||Zg.has(`${z}.${W}.${Z}.${ne}`)})}var C3=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]|[\uDC00-\uDFFF]/g;function b3(l){return l.replace(C3,(A)=>A.length===2?A:"")}var R3=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}\p{Default_Ignorable_Code_Point}\u2800]|(?!\u0020)\p{Zs}/gu;function t_(l){if(typeof l!=="string")return"";let A=l;for(let L=0;L<64;L++){let x=b3(A).replace(R3,"");if(x===A)return x;A=x}return""}import*as Ot from"zod/v4";var n_=["bash","powershell"];var Os=Ke(()=>Ot.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.')),o_=Ke(()=>Ot.enum(["continue","block"]).optional().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 T3(){let l=Ot.object({type:Ot.literal("command").describe("Shell command hook type"),command:Ot.string().describe("Shell command to execute"),args:Ot.array(Ot.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:Os(),shell:Ot.enum(n_).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:Ot.number().positive().optional().describe("Timeout in seconds for this specific command"),onFailure:o_(),statusMessage:Ot.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Ot.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:Ot.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:Ot.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:Ot.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:Ot.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:Ot.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).")}),A=Ot.object({type:Ot.literal("prompt").describe("LLM prompt hook type"),prompt:Ot.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:Os(),timeout:Ot.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:Ot.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:Ot.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:Ot.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Ot.boolean().optional().describe("If true, hook runs once and is removed after execution")}),L=Ot.object({type:Ot.literal("mcp_tool").describe("MCP tool hook type"),server:Ot.string().describe("Name of an already-configured MCP server to invoke"),tool:Ot.string().describe("Name of the tool on that server to call"),input:Ot.record(Ot.string(),Ot.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:Os(),timeout:Ot.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:Ot.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Ot.boolean().optional().describe("If true, hook runs once and is removed after execution")}),x=Ot.object({type:Ot.literal("http").describe("HTTP hook type"),url:Ot.string().url().describe("URL to POST the hook input JSON to"),if:Os(),timeout:Ot.number().positive().optional().describe("Timeout in seconds for this specific request"),onFailure:o_(),headers:Ot.record(Ot.string(),Ot.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:Ot.array(Ot.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:Ot.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Ot.boolean().optional().describe("If true, hook runs once and is removed after execution"),cloud:Ot.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).")}),z=Ot.object({type:Ot.literal("agent").describe("Agentic verifier hook type"),prompt:Ot.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:Os(),timeout:Ot.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:Ot.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:Ot.string().optional().describe("Custom status message to display in spinner while hook runs"),once:Ot.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:l,PromptHookSchema:A,HttpHookSchema:x,AgentHookSchema:z,McpToolHookSchema:L}}var na=Ke(()=>{let{BashCommandHookSchema:l,PromptHookSchema:A,AgentHookSchema:L,HttpHookSchema:x,McpToolHookSchema:z}=T3();return Ot.discriminatedUnion("type",[...[l,A,L,x,z]])}),Kl=Ke(()=>Ot.object({matcher:Ot.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:Ot.array(na()).describe("List of hooks to execute when the matcher matches")})),Mo=Ke(()=>Ot.partialRecord(Ot.enum(N),Ot.array(Kl())));function oa(){return new Set(na().options.map((l)=>l.shape.type.value))}function D3(l,A){if(!l||typeof l!=="object"||Array.isArray(l)){let z=ko(l);return{problem:`Hook entry must be an object; received ${z}`,received:z,aboutType:!1}}let L=l.type;if(typeof L!=="string"){let z=ko(L);return{problem:L===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${z}`,received:z,aboutType:!0}}if(!A.has(L)){let z=Pe(L);return{problem:`Unknown hook type "${z}"`,received:z,aboutType:!0}}let x=na().safeParse(l);if(!x.success)return{problem:`Invalid ${L} hook (${r_(x.error)})`,received:L,aboutType:!1};return}function r_(l){return l.issues.map((A)=>A.path.length>0?`${A.path.join(".")}: ${A.message}`:A.message).join("; ")}function ra(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;if(!("matcher"in l)&&Object.keys(l).some((L)=>N.includes(L)))return!1;let A=l.hooks;if(Array.isArray(A))return A.length>0;return!!A&&typeof A==="object"&&(("matcher"in l)||typeof A.type==="string")}function vo(l,A=3,{matchersCount:L=!0,unscannedKeys:x=L3,inHooksList:z=!1}={}){if(a_(l))return!0;if(L&&ra(l))return!0;if(A===0||!l||typeof l!=="object")return!1;if(Array.isArray(l))return l.some((W)=>vo(W,A-1,{matchersCount:L,unscannedKeys:x,inHooksList:z}));if(z&&typeof l.type==="string")return!1;return Object.entries(l).some(([W,Z])=>!x.has(W)&&vo(Z,A-1,{unscannedKeys:x,matchersCount:L&&!N.includes(W),inHooksList:W==="hooks"&&Array.isArray(Z)}))}function s_(l,A){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return a_(l)||Object.entries(l).some(([L,x])=>L!=="hooks"&&!A.has(L)&&vo(x,3,{unscannedKeys:A,matchersCount:!N.includes(L)}))}var L3=new Set,i_=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),I3=new Set(["metadata","mcpServers","lspServers"]),Mme=new Set([...I3,"experimental"]);function a_(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;return Object.entries(l).some(([A,L])=>As.has(A)&&L!==null&&L!==void 0&&!(Array.isArray(L)&&L.length===0))}function $l(l){if(ra(l))return!0;if(Array.isArray(l))return l.some($l);if(!l||typeof l!=="object")return!1;return Object.entries(l).some(([A,L])=>As.has(A)&&L!==null&&L!==void 0&&!(Array.isArray(L)&&L.length===0))}var As=new Set(["PreToolUse","PermissionRequest"]);function l_(l,A){if(!Array.isArray(l))return{stripped:[],unloadableGuards:[]};let L=As.has(A),x=oa(),z=Kl(),W=[],Z=[];for(let ne=l.length-1;ne>=0;ne--){let ce=l[ne],Te=(Be,ke)=>{if(!L)l.splice(ne,1);W.push({matcherIndex:ne,hookIndex:void 0,path:`${ne}`,problem:Be,received:ke,aboutType:!1})};if(vo(ce,3,{matchersCount:!1})){(L?W:Z).push({matcherIndex:ne,hookIndex:void 0,path:`${ne}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:ko(ce),aboutType:!1});continue}if(!ce||typeof ce!=="object"||Array.isArray(ce)){Te(`Hook matcher must be an object; received ${ko(ce)}`,ko(ce));continue}let Le=ce.hooks;if(!Array.isArray(Le)){Te(`Hook matcher "hooks" must be an array of hook entries; received ${ko(Le)}`,ko(Le));continue}let we=[];for(let Be=Le.length-1;Be>=0;Be--){let ke=D3(Le[Be],x);if(ke!==void 0){if(!L)Le.splice(Be,1);we.push({matcherIndex:ne,hookIndex:Be,path:`${ne}.hooks.${Be}`,...ke})}}let Ie=z.safeParse(L?{...ce,hooks:[]}:ce);if(!Ie.success){Te(`Invalid hook matcher (${r_(Ie.error)})`,"matcher");continue}W.push(...we)}return W.reverse(),Z.reverse(),L?{stripped:[],unloadableGuards:W}:{stripped:W,unloadableGuards:Z}}var Qn="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 ko(l){if(l===null||l===void 0)return String(l);if(Array.isArray(l))return"an array";let A=typeof l;return`${A==="object"?"an":"a"} ${A}`}var c_=new Set(["http","https","ws","wss","ftp"]);function Uo(l){l=l.replace(/^[\x00-\x20]+/,"").replace(/[\t\n\r]/g,"");let A=l.indexOf("://");if(A===-1)return!1;let L=l.slice(A+3),x=l.slice(0,A).toLowerCase();if(c_.has(x)){let Z=L.match(/^[/\\]+/)?.[0]??"";if(Z.includes("\\"))return!0;L=L.slice(Z.length)}let z=L.search(/[/?#]/);return(z===-1?L:L.slice(0,z)).includes("\\")}var dn="github.com",Gme=[`git@${dn}:`,`ssh://git@${dn}/`],Wme=[`https://${dn}`,`https://${dn}/`,dn],jme=`users.noreply.${dn}`;var w3=/[:/\\?#@\s]/;function Cs(l){let A=u_(l.replace(/[\t\n\r]/g,"").toLowerCase());if(A===""||w3.test(A))return A;try{let L=new URL(`https://${A}`);if(L.username!==""||L.password!==""||L.port!==""||L.pathname!=="/"||L.search!==""||L.hash!=="")return A;return u_(L.hostname)}catch{return A}}var p_=bi(function(A){let L=Cs(A);while(L.startsWith("www."))L=L.slice(4);return L},(l)=>l,50);function f_(l,A){return p_(l)===A}function So(l){return f_(l,dn)}function d_(l){return/[%\x00-\x1f\x7f-\u{10FFFF}]/u.test(l)}function Vl(l){if(me(l))return!0;if(l.includes("://")){if(Uo(l))return!0;try{let z=new URL(l);if(z.protocol==="http:"||z.protocol==="https:")return!1;return d_(z.hostname)}catch{return!0}}let A=l.indexOf(":"),L=l.indexOf("@");if(A>=0&&L>A)return!0;let x=l.match(/^(?:[^@]+@)?([^:]+):/)?.[1];return x?d_(x):!1}function u_(l){let A=l.length;while(A>0&&l[A-1]===".")A--;return l.slice(0,A)}function Yl(l){let A=Cs(l);return So(A)?dn:A}function m_(l){let A=l.trimStart(),L=/^([A-Za-z][A-Za-z0-9+.-]*):\/\//.exec(A);if(L===null||/^https?$/i.test(L[1]??""))return j(A);return j(L[0]+Oe(A.slice(L[0].length)))}function g_(l){let A=/^([^@:/[\]]+)@([^@:/[\]]+):(.*)$/s.exec(l);return A&&!me(l)?{user:A[1],host:A[2],path:A[3]}:null}import*as Pr from"zod/v4";var N3=64;class xr{fields;activeWhenAbsent;keys;built=new Map;byPresentKeys=new Map;wholeSchema;constructor(l,A=new Set){this.fields=l;this.activeWhenAbsent=A;this.keys=Object.keys(l).filter((L)=>l[L]!==void 0)}has(l){return Object.hasOwn(this.fields,l)&&this.fields[l]!==void 0}field(l){let A=this.built.get(l);if(A)return A;let L=this.has(l)?this.fields[l]:void 0;if(!L)return;let x=L();return this.built.set(l,x),x}carries(l,A){return this.activeWhenAbsent.has(A)||typeof l==="object"&&l!==null&&A in l}whole(){return this.wholeSchema??=Pr.object(this.shapeOf(this.keys)).passthrough(),this.wholeSchema}forDocument(l,A="passthrough"){let L=this.keys.filter((ne)=>this.carries(l,ne));if(L.length===this.keys.length&&A==="passthrough")return this.whole();let x=`${A}
${L.join(`
`)}`,z=this.byPresentKeys.get(x);if(z)return this.byPresentKeys.delete(x),this.byPresentKeys.set(x,z),z;let W=this.shapeOf(L),Z=A==="strip"?Pr.preprocess((ne,ce)=>{for(let Te of this.wrongDocumentIssues(ne,W))ce.addIssue(Te);return ne},Pr.object(W)):Pr.object(W).passthrough().check((ne)=>{ne.issues.push(...this.wrongDocumentIssues(ne.value,W))});if(this.byPresentKeys.size>=N3)for(let ne of this.byPresentKeys.keys()){this.byPresentKeys.delete(ne);break}return this.byPresentKeys.set(x,Z),Z}wrongDocumentIssues(l,A){if(typeof l!=="object"||l===null)return[];let L=[];for(let x of Object.keys(l))if(!Object.hasOwn(A,x)&&this.has(x))L.push({code:"custom",input:l[x],path:[x],message:"This settings schema was built for a document without this key"});return L}shapeOf(l){let A={};for(let L of l){let x=this.field(L);if(x)A[L]=x}return A}}var __=600;var tc=500,M3=32;function b_(){return{claudeaiPluginId:Ee.string().max(128).optional().catch(void 0),archiveSha256:rE().optional().catch(void 0)}}function R_(){return{directoryRepositoryKey:Ee.string().max(4096).optional().catch(void 0)}}function nc(l){if(!/^https?:\/\/[^/\\]/i.test(l))return!1;try{let{protocol:A}=new URL(l);return A==="https:"||A==="http:"}catch{return!1}}function T_(){return{npmVersionSpec:Ee.string().max(256).optional().catch(void 0),npmResolved:Ee.string().max(2048).optional().catch(void 0),npmIntegrity:Ee.string().max(256).optional().catch(void 0),npmRegistry:Ee.string().max(2048).refine(nc).optional().catch(void 0)}}function D_(){return{sourceCommand:Ee.string().max(tc+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:Ee.string().max(4096).refine(E_,{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:Ee.array(Ee.unknown()).transform((l)=>l.filter((A)=>typeof A==="string"&&A.length<=4096&&E_(A)).slice(-M3)).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 E_(l){return k3.isAbsolute(l)||v3.isAbsolute(l)}var L_=/[^\x20-\x7E]| {4,}/;function oc(){return Ee.string().max(tc,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((l)=>!L_.test(l),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var U3="anthropic-plugin-directory",H3=["healthcare"],I_=new Set(["claude-community","claude-plugins-community",...H3]),w_=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"]),F3=new Set([U3,"claude-plugin-directory"]),rc=new Set([...w_,...I_,...F3]);var P_=["marketplace","plugins","official"];function B3(){return P_}var x_="official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official",vge=new RegExp(x_,"i");function N_(l){return new RegExp(`(?:${x_}|^(?:anthropic|claude)[^a-z0-9]*(${l.join("|")}))`,"i")}var z3=N_(B3()),G3=N_(P_),W3=/[^\u0020-\u007E]/;function k_(l){if(rc.has(l.toLowerCase()))return!1;if(j3(l))return!0;if(z3.test(l))return!0;return!1}function j3(l){return!rc.has(l.toLowerCase())&&(W3.test(l)||G3.test(l))}var An=Ke(()=>Ee.string().startsWith("./")),Ho=Ke(()=>An().endsWith(".json")),h_=Ke(()=>Ee.union([Ee.literal("."),An()])),S_=Ke(()=>Ee.union([An().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),Ee.string().url().refine((l)=>l.endsWith(".mcpb")||l.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),Zl=Ke(()=>An().endsWith(".md")),ql=Ke(()=>Ee.union([Zl(),An()])),sc={inline:"--plugin-dir session plugins",builtin:"built-in plugins","skills-dir":"plugins auto-loaded from .claude/skills/",synced:"plugins synced from your claude.ai account","claude-plugin-test":"plugins loaded by claude plugin test",npm:"plugins installed from an npm registry (`<package>@npm`); remove this marketplace and add it again under another name",pip:"plugins installed from a Python package index (reserved; not yet available)",uv:"plugins installed from a Python package index through uv (reserved; not yet available)",cargo:"plugins installed from a Rust crate registry (reserved; not yet available)",github:"plugins installed straight from a GitHub repository (`<owner>/<repo>@github`; reserved; not yet available)",gh:"plugins installed straight from a GitHub repository (reserved; not yet available)"},ic="npm",K3=["pip","uv","cargo","github","gh"];function sa(l){return Object.hasOwn(sc,l)}var $3=[ic,...K3];function v_(l){return $3.includes(l.toLowerCase())}function V3(l,A){let L=l.toLowerCase();if(v_(L)&&sa(L))A.addIssue({code:"custom",message:`Marketplace name "${L}" is reserved for ${sc[L]}`})}var Y3="Marketplace name impersonates an official Anthropic/Claude marketplace",ac=(l)=>Ee.string().min(1,"Marketplace must have a name").refine((A)=>!A.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((A)=>!lE.test(A),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((A)=>!A.includes("/")&&!A.includes("\\")&&!A.includes("..")&&A!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((A)=>!l(A),{message:Y3}).superRefine((A,L)=>{let x=A.toLowerCase();if(!sa(x)||v_(x))return;L.addIssue({code:"custom",message:`Marketplace name "${x}" is reserved for ${sc[x]}`})}),X3=Ke(()=>ac(k_)),J3=Ke(()=>ac(()=>!1));function Z3(l){return ac(l).superRefine(V3)}var ia=Ke(()=>Ee.string().min(1,"Plugin name cannot be empty").refine((l)=>!l.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).refine((l)=>!lE.test(l),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),lc=Ke(()=>Ee.object({name:Ee.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:Ee.string().optional().describe("Contact email for support or feedback"),url:Ee.string().optional().describe("Website, GitHub profile, or organization URL")})),gn=Ke(()=>Ee.object({$schema:Ee.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:ia().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:Ee.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:Ee.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:Ee.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:lc().optional().describe("Information about the plugin creator or maintainer"),homepage:Ee.string().url().optional().describe("Plugin homepage or documentation URL"),repository:Ee.string().optional().describe("Source code repository URL"),license:Ee.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:Ee.array(Ee.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:Ee.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:Ee.array(Y5()).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:Ee.preprocess((l)=>t(l)?l:void 0,Ee.record(Ee.string(),Ee.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.")})),q3=1,Mge=Ke(()=>Ee.object({$schema:Ee.string().optional().catch(void 0).describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),description:Ee.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:Ee.lazy(()=>Mo()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:Ee.array(Ee.string()).max(q3,{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 (${_3}; 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:Ee.never({error:'hooks.json `surface` is gone: name the module in the Client element, `Client({ module: "./board.tsx", key })`, a path relative to the file that builds it'}).optional()}).refine((l)=>l.hooks!==void 0||(l.modules?.length??0)>0,{message:"hooks.json must have `hooks` (the hook matchers) or `modules` (hooks modules), or both"})),M_=Ke(()=>Ee.object({hooks:Ee.union([Ho().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Ee.lazy(()=>Mo()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),Ee.array(Ee.union([Ho().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Ee.lazy(()=>Mo()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),Q3=Ke(()=>Ee.object({source:ql().optional().describe("Path to command markdown file, relative to plugin root"),content:Ee.string().optional().describe("Inline markdown content for the command"),description:Ee.string().optional().describe("Command description override"),argumentHint:Ee.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:Ee.string().optional().describe("Default model for this command"),allowedTools:Ee.array(Ee.string()).optional().describe("Tools allowed when command runs")}).refine((l)=>l.source&&!l.content||!l.source&&l.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),U_=Ke(()=>Ee.object({commands:Ee.union([ql().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."),Ee.array(ql().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."),Ee.record(Ee.string(),Q3()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),H_=Ke(()=>Ee.object({agents:Ee.union([Zl().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."),Ee.array(Zl().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.")])})),F_=Ke(()=>Ee.object({skills:Ee.union([h_().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).'),Ee.array(h_().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).")])})),e5=Ke(()=>Ee.union([Ee.string(),Ee.array(Ee.string())])),cc=Ke(()=>Ee.object({outputStyles:Ee.union([An().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."),Ee.array(An().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.")])})),t5=Ke(()=>Ee.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),n5=16,o5=Ke(()=>Ee.object({id:t5(),remote:Ee.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:Ee.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),r5=Ke(()=>Ee.object({syntaxHighlighting:Ee.object({hljsLanguages:Ee.array(o5()).max(n5)}).strict()})),dc=Ke(()=>Ee.object({themes:Ee.union([An().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."),Ee.array(An().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.")])})),B_=Ke(()=>Ee.object({workflows:Ee.union([An().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."),Ee.array(An().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()})),y_=Ke(()=>Ee.string().min(1)),s5=Ke(()=>Ee.string().min(2).refine((l)=>l.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),z_=Ke(()=>Ee.object({mcpServers:Ee.union([Ho().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),S_().describe("Path or URL to MCPB file containing MCP server configuration"),Ee.record(Ee.string(),ta()).describe("MCP server configurations keyed by server name"),Ee.array(Ee.union([Ho().describe("Path to MCP servers configuration file"),S_().describe("Path or URL to MCPB file"),Ee.record(Ee.string(),ta()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),G_=Ke(()=>Ee.object({type:Ee.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:Ee.string().describe("Human-readable label shown in the config dialog"),description:Ee.string().describe("Help text shown beneath the field in the config dialog"),required:Ee.boolean().optional().describe("If true, validation fails when this field is empty"),default:Ee.union([Ee.string(),Ee.number(),Ee.boolean(),Ee.array(Ee.string())]).optional().describe("Default value used when the user provides nothing"),multiple:Ee.boolean().optional().describe("For string type: allow an array of strings"),sensitive:Ee.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:Ee.number().optional().describe("Minimum value (number type only)"),max:Ee.number().optional().describe("Maximum value (number type only)"),options:Ee.array(Ee.string().min(1,"An option cannot be empty").max(64,"An option can be at most 64 characters").refine((l)=>t_(l)===l,{message:"An option cannot contain control, invisible or bidirectional-formatting characters"}).refine((l)=>l.trim()===l,{message:"An option cannot start or end with a space"})).min(1,"options needs at least one value").refine((l)=>new Set(l.map((A)=>A.toLowerCase())).size===l.length,{message:"options cannot repeat a value (in any letter case)"}).readonly().optional().describe("For string type: the only values the field takes. /config shows the field as a picker over them, and a stored value outside them counts as unset")}).strict().superRefine((l,A)=>{if(l.options===void 0)return;if(l.type!=="string"||l.multiple===!0||l.sensitive===!0){A.addIssue({code:"custom",path:["options"],message:'options is only for a field of type "string" that is neither multiple nor sensitive'});return}if(l.default===void 0){if(l.required!==!0)A.addIssue({code:"custom",path:["default"],message:"a field with options needs a default among them, or required: true"});return}if(typeof l.default!=="string"||!l.options.includes(l.default))A.addIssue({code:"custom",path:["default"],message:`default must be one of the options: ${l.options.join(", ")}`})})),W_=Ke(()=>Ee.object({userConfig:Ee.record(Ee.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"),G_()).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.")})),j_=Ke(()=>Ee.object({channels:Ee.array(Ee.object({server:Ee.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:Ee.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:Ee.record(Ee.string(),G_()).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.")})),O_=Ke(()=>Ee.strictObject({command:Ee.string().min(1).refine((l)=>{if(l.includes(" ")&&!l.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:Ee.array(y_()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:Ee.record(s5(),y_()).refine((l)=>Object.keys(l).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:Ee.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:Ee.record(Ee.string(),Ee.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:Ee.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:Ee.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:Ee.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:Ee.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:Ee.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),requestTimeout:Ee.number().int().positive().max(2147483647).optional().describe("Maximum time to wait for the server to answer a request (milliseconds). Defaults to 60000."),restartOnCrash:Ee.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:Ee.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:Ee.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.")})),i5=Ke(()=>Ee.strictObject({name:Ee.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:Ee.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:Ee.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:Ee.union([Ee.literal("always"),Ee.string().startsWith("on-skill-invoke:").refine((l)=>l.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),a5=Ke(()=>Ee.array(i5()).refine((l)=>new Set(l.map((A)=>A.name)).size===l.length,{message:"Monitor names must be unique within a plugin"})),uc=Ke(()=>Ee.object({monitors:Ee.union([Ho().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),a5()]).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.")})),K_=Ke(()=>Ee.object({lspServers:Ee.union([Ho().describe("Path to .lsp.json configuration file relative to plugin root"),Ee.record(Ee.string(),O_()).describe("LSP server configurations keyed by server name"),Ee.array(Ee.union([Ho().describe("Path to LSP configuration file"),Ee.record(Ee.string(),O_()).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-._]*$/,c5=/^[a-z0-9][a-z0-9-._]*$/,d5=/^@[a-z0-9][a-z0-9-._]*\/\*$/;function pc(l){return!l.includes("..")&&!l.includes("//")&&(l5.test(l)||c5.test(l))}var $_=Ke(()=>Ee.string().refine((l)=>!l.includes("..")&&!l.includes("//"),"Package name cannot contain path traversal patterns").refine((l)=>pc(l),"Invalid npm package name format")),u5=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,p5=/^[0-9a-f]{64}$/;var f5=64;var m5=Ke(()=>Ee.object({sha256:Ee.string().regex(p5)}));function g5(l){let A=Ee.record(Ee.string(),Ee.unknown()).safeParse(l);if(!A.success)return;let L=Object.create(null),x=0;for(let[z,W]of Object.entries(A.data)){if(x>=f5)break;let Z=m5().safeParse(W);if(u5.test(z)&&Z.success)L[z]=Z.data,x++}return x>0?L:void 0}var V_=Ke(()=>Ee.object({binaries:Ee.unknown().transform(g5).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),Y_=Ke(()=>Ee.object({settings:Ee.record(Ee.string(),Ee.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),X_=Ke(()=>Ee.object({types:An().refine((l)=>l.endsWith(".d.ts"),{message:"types must name a TypeScript declaration file ending in '.d.ts'"}).refine((l)=>!l.split(/[\\/]/).includes(".."),{message:"types must stay inside the plugin directory (no '..' segment)"}).optional().describe("Path to the plugin's type contract, relative to the plugin root and starting with ./: a self-contained .d.ts (no import, export-from, require or reference) that exports the types of the noun the plugin's hooks module adds in engine.create at its top level and declares the noun in a `declare module 'claude-code' { interface EngineInterface { ... } }` block, nothing else. 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.")})),J_=Ke(()=>Ee.object({experimental:Ee.preprocess((l)=>t(l)?l:void 0,Ee.object({...dc().partial().shape,...r5().partial().shape,...uc().partial().shape,...cc().partial().shape,evals:e5().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 _5=Ke(()=>Ee.object({...gn().shape,...M_().partial().shape,...U_().partial().shape,...H_().partial().shape,...F_().partial().shape,...cc().partial().shape,...dc().partial().shape,...B_().shape,...j_().partial().shape,...z_().partial().shape,...K_().partial().shape,...uc().partial().shape,...Y_().partial().shape,...X_().partial().shape,...W_().partial().shape,...V_().partial().shape,...J_().partial().shape})),Uge=Ke(()=>new xr({$schema:()=>gn().shape.$schema,name:()=>gn().shape.name,displayName:()=>gn().shape.displayName,version:()=>gn().shape.version,description:()=>gn().shape.description,author:()=>gn().shape.author,homepage:()=>gn().shape.homepage,repository:()=>gn().shape.repository,license:()=>gn().shape.license,keywords:()=>gn().shape.keywords,defaultEnabled:()=>gn().shape.defaultEnabled,dependencies:()=>gn().shape.dependencies,metadata:()=>gn().shape.metadata,hooks:()=>M_().partial().shape.hooks,commands:()=>U_().partial().shape.commands,agents:()=>H_().partial().shape.agents,skills:()=>F_().partial().shape.skills,outputStyles:()=>cc().partial().shape.outputStyles,themes:()=>dc().partial().shape.themes,workflows:()=>B_().shape.workflows,channels:()=>j_().partial().shape.channels,mcpServers:()=>z_().partial().shape.mcpServers,lspServers:()=>K_().partial().shape.lspServers,monitors:()=>uc().partial().shape.monitors,settings:()=>Y_().partial().shape.settings,types:()=>X_().partial().shape.types,userConfig:()=>W_().partial().shape.userConfig,binaries:()=>V_().partial().shape.binaries,experimental:()=>J_().partial().shape.experimental},new Set(["name"])));var Z_=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]);function q_(l){try{return new RegExp(l),!0}catch{return!1}}function E5(l){return Uo(l)||me(l)}var Q_="ssh.github.com";function Xl(l){return So(l)||Cs(l)===Q_}var h5=/^[A-Za-z0-9._-]+$/;function S5(l){return h5.test(l)&&!l.startsWith("-")&&l!=="."&&l!==".."}function eE(l){if(!l.endsWith("/*"))return null;let A=l.slice(0,-2);return S5(A)?A:null}function y5(l){let A=[];for(let L of l.split("/")){if(L===".")continue;if(L===".."){A.pop();continue}A.push(L)}return A.filter((L)=>L!=="").join("/")}function O5(l){let A=l.length;for(;;){let L=A;while(L>0&&l.charCodeAt(L-1)===47)L--;if(L>=4&&l.startsWith(".git",L-4))L-=4;if(L===A)return A===l.length?l:l.slice(0,A);A=L}}function A_(l){let A=Yl(l);return A===Q_?dn:A}function A5(l,A){if(l.includes("://"))try{let x=m_(l);if(x===null)return l;x.hostname=A_(x.hostname),x.username="",x.password="",x.search="",x.hash="";try{x.pathname=decodeURIComponent(x.pathname)}catch{}let z=y5(x.pathname);return x.pathname=A?.stripDotGit?O5(z):z,x.toString()}catch{return l}let L=he(l);return L?`${A_(L.host)}:${L.path}`:l}var C5=new Set(["http:","https:","git:","git+http:","git+https:"]);function b5(l){if(Vl(l))return l;if(l.includes("://"))try{let x=new URL(l);if(x.hostname=Yl(x.hostname),C5.has(x.protocol)||So(x.hostname))x.username="",x.password="";return x.toString()}catch{return l}let A=g_(l);if(!A)return l;let L=A.host.toLowerCase().replace(/\.+$/,"");return So(L)?`${dn}:${A.path}`:`${A.user}@${L}:${A.path}`}function tE(l){if(l.includes("://")){if(E5(l))return!1;let W=he(l)?.host;if(W!==void 0&&Xl(W)&&A5(l,{stripDotGit:!0}).includes("*"))return!0;let Z=j(l)?.hostname;if(!Z||!Xl(Z))return!1;let ne=b5(l);try{let ce=new URL(ne);return ce.hostname.includes("*")||ce.pathname.includes("*")}catch{return ne.includes("*")}}let A=he(l),L=A?.host,x=A?.path;if(!L||x===void 0||!Xl(L))return!1;let z=x;try{z=decodeURIComponent(x)}catch{}return z.includes("*")}function nE(l){return Ee.discriminatedUnion("source",[Ee.object({source:Ee.literal("url"),url:Ee.string().url().describe("Direct URL to marketplace.json file"),headers:Ee.record(Ee.string(),Ee.string()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:oc().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.")}),Ee.object({source:Ee.literal("github"),repo:Ee.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:Ee.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Ee.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Ee.array(Ee.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:Ee.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/.")}),Ee.object({source:Ee.literal("git"),url:Ee.string().describe("Full git repository URL"),ref:Ee.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:Ee.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:Ee.array(Ee.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:Ee.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/.")}),Ee.object({source:Ee.literal("npm"),package:$_().or(Ee.string().regex(d5,"Invalid npm package name format")).describe('npm package containing marketplace.json (e.g. "@acme/claude-marketplace"). In strictKnownMarketplaces / blockedMarketplaces an entry also governs plugins installed straight from the npm marketplace (`<package>@npm`): an exact package name matches that package, and "@acme/*" matches every package under the scope.'),version:Ee.string().optional().describe('Version or range to fetch (e.g. "1.4.0", "^1.4"); defaults to the latest dist-tag'),registry:Ee.string().url().refine(nc,"Registry must be an http(s) URL").optional().describe(`Registry URL. When adding a marketplace: a one-off registry override (otherwise your npm configuration decides). In a policy entry: the origin and path prefix the package's RESOLVED tarball URL must fall under (e.g. "https://npm.example.com/api/npm/internal/"); under allowManagedPermissionRulesOnly, an npm marketplace keeps plugin allowed-tools only when both the entry and the registration pin this same registry.`)}),Ee.object({source:Ee.literal("file"),path:Ee.string().describe("Local file path to marketplace.json")}),Ee.object({source:Ee.literal("directory"),path:Ee.string().describe("Local directory containing .claude-plugin/marketplace.json")}),Ee.object({source:Ee.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."),Ee.object({source:Ee.literal("hostPattern"),hostPattern:Ee.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$").')}),Ee.object({source:Ee.literal("pathPattern"),pathPattern:Ee.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.')}),Ee.object({source:Ee.literal("settings"),name:l?J3().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)."):X3().refine((A)=>!rc.has(A.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:Ee.array(I5()).describe("Plugin entries declared inline in settings.json"),owner:lc().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 bs=Ke(()=>nE(!1));var fc=String.raw`[\w./+-]`,Hge=new RegExp(`^(?:#${fc}*)?$`),Fge=new RegExp(String.raw`^(?:(?:git\+)?ssh:\/\/)?[^@:/\\?#%]+@[^@:/\\?#]+:[^@?#]*(?:#${fc}*)?$`),Bge=new RegExp(String.raw`^(?:(?:github|gitlab|bitbucket):)?[^@:/\\?#%]+(?:\/[^@:/\\?#%]+)+(?:#${fc}*)?$`);var R5=Ke(()=>nE(!0));function oE(){return bs()}var mc=Ke(()=>oE()),aa=Ke(()=>oE()),Jl=Ke(()=>Ee.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),rE=Ke(()=>Ee.string().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),T5="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function D5(l){try{let A=new URL(l);return A.protocol==="https:"&&!e_(A.hostname)}catch{return!1}}var L5=Ke(()=>Ee.object({source:Ee.literal("archive"),url:Ee.string().url().refine(D5,{message:T5}).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=Ke(()=>Ee.union([Ee.preprocess((l)=>l==="."?"./":l,An()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),Ee.object({source:Ee.literal("npm"),package:$_().or(Ee.string().refine((l)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(l)||!l.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:Ee.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:Ee.string().url().refine(nc,"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"),Ee.object({source:Ee.literal("url"),url:Ee.string().describe("Full git repository URL (https:// or git@)"),ref:Ee.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Jl().optional().describe("Specific commit SHA to use")}),Ee.object({source:Ee.literal("github"),repo:Ee.string().describe("GitHub repository in owner/repo format"),ref:Ee.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Jl().optional().describe("Specific commit SHA to use")}),Ee.object({source:Ee.literal("git-subdir"),url:Ee.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:Ee.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:Ee.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Jl().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."),L5(),Ee.object({source:Ee.literal("command"),command:Ee.string().min(1).max(tc,{message:"command must not be longer than the install consent UI can display"}).refine((l)=>!L_.test(l),{message:"command must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"}).describe("Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment."),timeout:Ee.number().int().positive().max(__).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:Ee.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."),Ee.object({source:Ee.literal("unsupported"),error:Ee.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.")])),I5=Ke(()=>Ee.object({name:ia().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:Ee.string().optional(),version:Ee.string().optional(),strict:Ee.boolean().optional(),headers:Ee.record(Ee.string(),Ee.string()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:oc().optional().describe("Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.")}).refine((l)=>typeof l.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, archive, command). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine((l)=>typeof l.source==="string"||l.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url, archive, command)."}));var w5=Ke(()=>Ee.object({cli:Ee.array(Ee.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:Ee.array(Ee.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:Ee.array(Ee.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:Ee.array(Ee.object({file:Ee.string().max(256),pattern:Ee.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:Ee.array(Ee.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.`)})),P5=Ke(()=>Ee.object({topic:Ee.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:w5().optional().describe("Matchers that determine when the plugin is relevant.")})),x5=Ke(()=>_5().partial().extend({name:ia().describe("Unique identifier matching the plugin name"),source:sE().describe("Where to fetch the plugin from"),headers:Ee.record(Ee.string(),Ee.string()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:oc().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:Ee.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:Ee.array(Ee.string()).optional().describe("Tags for searchability and discovery"),strict:Ee.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:Ee.preprocess((l)=>t(l)?l:void 0,P5().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.`)})),N5=Ke(()=>Ee.object({name:ia()}));function k5(l){let A=x5();return l.flatMap((L,x)=>{let z=A.safeParse(L);if(z.success){let ne=z.data.source;if(typeof ne==="object"&&ne.source==="unsupported"&&ne.error!==void 0)return[{...z.data,source:{source:"unsupported"}}];return[z.data]}let W=N5().safeParse(L).data?.name,Z=z.error.issues.map((ne)=>`${ne.path.join(".")}: ${ne.message}`).join(", ");if(W){e(`Stubbing unparseable marketplace plugin entry (${W}): ${Z}`,{level:"warn"});let ne=iE(t(L)?L.source:void 0)?z5:gc(L)?void 0:M5(z.error.issues)??la(z.error.issues);return[{name:W,source:{source:"unsupported",...ne&&{error:ne}},strict:!0}]}return e(`Dropping unparseable marketplace plugin entry (index ${x}): ${Z}`,{level:"warn"}),[]})}var v5=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function gc(l){if(!l||typeof l!=="object")return!1;let A=l.source;if(!A||typeof A!=="object")return!1;let L=A.source;return typeof L==="string"&&!v5.has(L)}function M5(l){let A=l.find((x)=>x.path.length===1&&x.path[0]==="source");if(!A||A.code!=="invalid_union")return;let L=A.errors.find((x)=>!x.some((z)=>z.path.length===0||z.code==="invalid_value"&&z.path[0]==="source"));if(!L||L.length===0)return;return la(L.map((x)=>({...x,path:["source",...x.path]})))}var U5=/^[A-Za-z0-9_$.-]{1,40}$/;function Gn(l){return U5.test(l)?l:"<key>"}var H5=3,F5=160;function la(l){let A=l.slice(0,H5).map((x)=>{let z=x.path.map(String).map((Z)=>Gn(Z)).join("."),W=x.code==="unrecognized_keys"?`Unrecognized ${x.keys.length===1?"field":"fields"}: ${x.keys.map(Gn).join(", ")}`:Nl(x.message,F5);return z?`${z}: ${W}`:W}),L=l.length-A.length;return L>0?`${A.join(", ")} (+${L} more)`:A.join(", ")}var B5=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,z5='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(l){return typeof l==="string"&&B5.test(l)&&!l.includes("..")}function G5(l){if(typeof l!=="string"||l===""||l.startsWith("/")||l.includes("\\")||l.includes(":"))return;let A=l.replace(/^\.\//,"").replace(/\/+$/,"");if(A===""||A===".")return".";if(A.split("/").some((L)=>L===""||L==="."||L===".."))return;return A}function W5(l,A){if(A===void 0||!t(l)||!iE(l.source))return l;let L=A==="."?`./${l.source}`:`./${A}/${l.source}`;return{...l,source:L}}function j5(l){if(!t(l)||!Array.isArray(l.plugins))return l;let A=t(l.metadata)?G5(l.metadata.pluginRoot):void 0;if(A===void 0)return l;return{...l,plugins:l.plugins.map((L)=>W5(L,A))}}var K5=Ke(()=>Ee.object({$schema:Ee.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Z3(k_),version:Ee.string().optional().describe("Marketplace manifest version"),description:Ee.string().optional().describe("Human-readable description of this marketplace"),owner:lc().describe("Marketplace maintainer or curator information"),plugins:Ee.array(Ee.unknown()).transform(k5).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:Ee.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:Ee.object({pluginRoot:Ee.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:Ee.string().optional().describe("Marketplace version"),description:Ee.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:Ee.array(Ee.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:Ee.record(Ee.string(),Ee.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.")})),zge=Ke(()=>Ee.preprocess(j5,K5()));var Ql="[A-Za-z0-9][-A-Za-z0-9._]*",Gge=new RegExp(`^${Ql}$`);var $5=new RegExp(`^${Ql}@${Ql}$`),C_=`@${ic}`;function aE(l){return l.endsWith(C_)&&pc(l.slice(0,-C_.length))}var Nr=Ke(()=>Ee.string().refine((l)=>$5.test(l)||aE(l),"Plugin ID must be in format: plugin@marketplace")),Wge=new RegExp(`[@:\\s/\\\\${I}]`,"u"),jge=new RegExp(`[${I}]`,"u"),lE=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,V5=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,Y5=Ke(()=>Ee.union([Ee.string().regex(V5,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((l)=>l.replace(/@\^[^@]*$/,"")),Ee.object({name:Ee.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:Ee.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((l)=>l.marketplace?`${l.name}@${l.marketplace}`:l.name)])),X5=Ke(()=>Ee.object({version:Ee.string().describe("Currently installed version"),installedAt:Ee.string().describe("ISO 8601 timestamp of installation"),lastUpdated:Ee.string().optional().describe("ISO 8601 timestamp of last update"),installPath:Ee.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:Ee.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:Ee.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:Ee.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)."),...b_(),...R_(),...D_(),...T_()})),Kge=Ke(()=>Ee.object({version:Ee.literal(1).describe("Schema version 1"),plugins:Ee.record(Nr(),X5()).describe("Map of plugin IDs to their installation metadata")})),J5=Ke(()=>Ee.enum(["managed","user","project","local"])),Z5=Ke(()=>Ee.object({scope:J5().describe("Installation scope"),projectPath:Ee.string().optional().describe("Project path (required for project/local scopes)"),installPath:Ee.string().describe("Absolute path to the versioned plugin directory"),version:Ee.string().optional().describe("Currently installed version"),installedAt:Ee.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:Ee.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:Ee.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:Ee.string().optional().describe("Tag-derived semver this install resolved to"),auto:Ee.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...b_(),...R_(),...D_(),...T_()})),$ge=Ke(()=>Ee.object({version:Ee.literal(2).describe("Schema version 2"),plugins:Ee.record(Nr(),Ee.array(Z5())).describe("Map of plugin IDs to arrays of installation entries")})),Vge=Ke(()=>Ee.object({version:Ee.literal(2),plugins:Ee.record(Ee.string(),Ee.unknown())}));var q5=Ke(()=>Ee.object({source:R5().describe("Where to fetch the marketplace from"),installLocation:Ee.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:Ee.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:Ee.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Yge=Ke(()=>Ee.record(Ee.string(),q5()));import*as cE from"zod/v4";function kr(l){return l==="true"?!0:l==="false"?!1:l}var ca=["aspell","hunspell","ispell"];import*as Xt from"zod/v4";var Q5=["autoMode","deepLink","voice","briefView","screenReader"],e6={},Ec={autoMode:{buildGate:()=>!0,shape:()=>({skipAutoPermissionPrompt:Xt.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:Xt.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:Xt.object({allow:Xt.array(Xt.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:Xt.array(Xt.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:Xt.array(Xt.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:Xt.array(Xt.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:Xt.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:Xt.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:Xt.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:Xt.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>e6}};function vr(){return Q5.filter((l)=>Ec[l].buildGate())}function dE(l){let A={};for(let L of l)A={...A,...Ec[L].shape()};return A}function hc(l){let A=[];for(let L of l)A.push(...Ec[L].permissionModes?.()??[]);return A}import*as ua from"zod/v4";var n_e=new RegExp("\x00ESCAPED_STAR\x00","g"),o_e=new RegExp("\x00ESCAPED_BACKSLASH\x00","g");var r_e=new RegExp("\x00GLOBSTAR\x00","g");function uE(l){return l.match(/^(.+):\*$/)?.[1]??null}function pE(l){let A=l.trimEnd();if(!A.endsWith("*"))return!1;let L=0,x=A.length-2;while(x>=0&&A[x]==="\\")L++,x--;return L%2===0}var da={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(l)=>{if(l.includes("*")||l.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(l)=>{if(l.includes("://")||l.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!l.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function Sc(l){return da.filePatternTools.includes(l)}function fE(l){return da.bashPrefixTools.includes(l)}function mE(l){return Object.hasOwn(da.customValidation,l)?da.customValidation[l]:void 0}function EE(l,A){let L=0,x=A-1;while(x>=0&&l[x]==="\\")L++,x--;return L%2!==0}function gE(l,A){let L=0;for(let x=0;x<l.length;x++)if(l[x]===A&&!EE(l,x))L++;return L}var t6=/(?:^|[^\\])\\[()]/;function n6(l){return t6.test(l)&&gE(l,"(")!==gE(l,")")}var o6=/^(?:[|&;<>]|\d+[<>])/;function r6(l){return o6.test(l)}function yc(l){for(let A=0;A<l.length;A++)if(l[A]==="*"&&!EE(l,A))return!0;return!1}function s6(l){if(l.endsWith(":*"))return;let A=l.trim().split(/\s+/).filter(Boolean),L=A[0];if(A.length<3||L===void 0||yc(L))return;let x=!1;for(let z of A.slice(1)){if(r6(z))return;if(yc(z)){x=!0;continue}if(z.startsWith("-"))continue;return x?L:void 0}return}function _E(l){if(!hs(l))return null;let A=Dr(l);if(A&&!hs(A.serverName))return null;return{valid:!1,error:`Wildcard tool name "${l}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens — globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function Oc(l,A){if(!l||l.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let L=vl(l);if(L.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(L.kind==="call"&&L.rawContent===""){if(!L.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 "${L.toolName}" without parentheses`,examples:[`${L.toolName}`,`${L.toolName}(some-pattern)`]}}let x=Fg(l),z=Dr(x.toolName);if(z){if(L.kind==="call"){let Z=z.toolName&&!hs(z.toolName)?`${x.toolName}__*`:void 0;return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:Z===void 0?`Use "${x.toolName}" without parentheses, or use "mcp__${z.serverName}__*" for all tools`:`Use "${x.toolName}" without parentheses. For all tools of a server, use "mcp__${z.serverName}__*" for the server "${z.serverName}", or "${Z}" for a server named "${z.serverName}__${z.toolName}"`,examples:[`mcp__${z.serverName}`,`mcp__${z.serverName}__*`,z.toolName&&z.toolName!=="*"?`mcp__${z.serverName}__${z.toolName}`:void 0,Z].filter(Boolean)}}if(A==="allow"){let Z=_E(x.toolName);if(Z)return Z}return{valid:!0}}if(!x.toolName||x.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(A==="allow"){let Z=_E(x.toolName);if(Z)return Z}if(!x.toolName.includes("_")&&x.toolName[0]!==x.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Ce(String(x.toolName))}"`};if(L.kind==="call"&&n6(L.rawContent)){let Z=Sc(x.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:Z?"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:Z?[`${x.toolName}(C:/Projects/(drafts)/**)`,`${x.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${x.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let W=mE(x.toolName);if(W&&x.ruleContent!==void 0){let Z=W(x.ruleContent);if(!Z.valid)return Z}if(fE(x.toolName)&&x.ruleContent!==void 0){let Z=x.ruleContent;if(Z===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(A==="allow"){let ce=s6(Z);if(ce!==void 0){let Te=ce==="git",Le=Te?" For git, options such as -c and --exec-path can run arbitrary commands.":"",we=Te?" (for example Bash(git status *))":"";return{valid:!0,warning:`${On(x)} 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.${Le} Replace that * with the exact value you mean, or only use * after the subcommand${we}.`,securityNotice:`${On(x)} allows any option at its * · use an exact value`}}}let ne=uE(Z)?.trimEnd();if(ne!==void 0){if(yc(ne)){let ce=pE(ne),Te=ce?"matches only commands containing a literal * at that position":"will likely never match",Le=ce?ne:`${ne}*`,we=A==="allow"?" Replace that * with the exact value you mean.":Le.endsWith(":*")?"":` Use ${On({toolName:x.toolName,ruleContent:Le})} for wildcard matching.`;return{valid:!0,warning:`${On(x)} mixes * with the trailing :* prefix syntax, so it is matched as a literal prefix (the * is not expanded) and ${Te}.${we}`,...A!=="allow"&&{securityNotice:`${On(x)} reads its * literally${Le.endsWith(":*")?"":` · use ${On({toolName:x.toolName,ruleContent:Le})}`}`}}}}else if(Z.includes(":*")&&!Z.endsWith(":*")){let ce=A==="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:`${On(x)} has a :* that is not at the end, so it is matched as a * wildcard (the : is literal), not as the trailing :* prefix syntax. ${ce}`,...A==="allow"&&{securityNotice:`${On(x)} reads its :* as a wildcard · use an exact value`}}}}if(Sc(x.toolName)&&x.ruleContent!==void 0){if(x.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${x.toolName}(*.ts) - matches .ts files`,`${x.toolName}(src/**) - matches all files in src`,`${x.toolName}(**/*.test.ts) - matches test files`]}}if(x.ruleContent!==void 0){let Z=x.toolName==="Write"||x.toolName==="NotebookEdit"||x.toolName==="MultiEdit"?"Edit":x.toolName==="Glob"?"Read":void 0;if(Z!==void 0&&!x.ruleContent.includes(":*"))return{valid:!0,warning:`${On(x)} is not matched by file permission checks — only ${Z}(path) rules are. Use ${On({toolName:Z,ruleContent:x.ruleContent})} instead (${Z} rules cover all file-${Z==="Edit"?"editing":"reading"} tools).`,...A!=="allow"&&{securityNotice:`${On(x)} never matches · use ${On({toolName:Z,ruleContent:x.ruleContent})}`}}}return{valid:!0}}var Ac=Ke(()=>SE()),hE=Ke(()=>SE("allow"));function SE(l){return ua.string().superRefine((A,L)=>{let x=Oc(A,l);if(!x.valid){let z=x.error;if(x.suggestion)z+=`. ${x.suggestion}`;if(x.examples&&x.examples.length>0)z+=`. Examples: ${x.examples.join(", ")}`;L.addIssue({code:ua.ZodIssueCode.custom,message:z,params:{received:A}})}})}var Ls=["accept","hold","refuse"],_a=["off","basic","full"],i6=Ke(()=>ae.record(ae.string(),ae.coerce.string()));function xE(l){return ae.object({allow:ae.array(hE()).optional().describe("List of permission rules for allowed operations"),deny:ae.array(Ac()).optional().describe("List of permission rules for denied operations"),ask:ae.array(Ac()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:ae.preprocess(Tr,ae.enum([...No,...hc(l)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:ae.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:ae.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 set when the user picks "block" on the one-time auto-mode prompt for a read outside the working directories.'),blockWritesOutsideWorkingDirectories:ae.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 the CLAUDE_COWORK_MEMORY_PATH_OVERRIDE environment variable or a repository settings file points it elsewhere. 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. 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."),disableAutoMode:ae.enum(["disable"]).optional().describe("Disable auto mode"),additionalDirectories:ae.array(ae.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var Y_e=Ke(()=>xE(vr())),a6=Ke(()=>ae.union([ae.string(),ae.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) }')])),l6=Ke(()=>ae.preprocess((l)=>Array.isArray(l)?l.filter((A)=>typeof A==="string"||!!A&&typeof A==="object"&&!Array.isArray(A)):[],ae.array(a6()))),Dc=Ke(()=>ae.object({source:bs().describe("Where to fetch the marketplace from"),installLocation:ae.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:ae.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup"),pluginDigests:ae.record(ae.string(),ae.array(ae.string()).catch([])).optional().catch(void 0).describe('Managed settings only: the plugins of this marketplace that an organization delivers with its own tier, by plugin name, each with the digests of its releases. A plugin also enabled and listed in prependPlugins or appendPlugins by managed settings the session vouches for loads its hooks module only from a folder that proves one of them, and is then seated in that tier; any other copy does not load. A digest is sha256- and the base64 SHA-256 of, for every regular file in the folder in UTF-16 code unit order of its path, not normalized, "f PATH" NUL BYTE-LENGTH NUL BYTES, with / in paths; .git, .in_use, .orphaned_at, .claude-plugin-link and .links_materialized at the root are left out. The plugin keeps its manifest at .claude-plugin/plugin.json and names one module in hooks/hooks.json. A string of any other form, or a list that is empty or of any other shape, matches no folder. A symbolic link, or a surface module, proves nothing. A proved plugin ships bundled with no install step: the digest covers the whole folder, node_modules included. A checkout whose line endings were converted proves nothing.')})),Lc=Ke(()=>{let l=()=>ae.number().min(0).max(1e4);return ae.object({input:l(),output:l(),cacheRead:l(),cacheWrite:l()})}),Ic=Ke(()=>ae.number().gt(0).lte(10).optional()),wc=Ke(()=>ae.object({model:ae.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:ae.string().optional().describe("Row title. Defaults to the model name."),description:ae.string().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:ae.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.")})),Ea=Ke(()=>ae.object({serverName:ae.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:ae.array(ae.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:ae.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((l)=>le([l.serverName!==void 0,l.serverCommand!==void 0,l.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),ha=Ke(()=>ae.object({serverName:ae.string().min(1,"Server name must be non-empty").refine((l)=>l.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((l)=>l===l.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:ae.array(ae.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:ae.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((l)=>le([l.serverName!==void 0,l.serverCommand!==void 0,l.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),NE=Ke(()=>ae.object({marketplace:ae.string(),plugin:ae.string()})),c6=Ke(()=>ae.preprocess((l)=>{if(typeof l!=="string"||!Nr().safeParse(l).success)return l;let A=l.indexOf("@");return{marketplace:l.slice(A+1),plugin:l.slice(0,A)}},NE())),d6=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function u6(l){let A=l.replaceAll("/","\\");if(H(A))return!1;return/^\\{2}[^\\]/.test(A)}function p6(l){return J(l)||/^\/network\/servers(\/|$)/i.test(l)||q(l)}function f6(l){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(l)}function m6(l,A,L={}){if(A==="win32"){let x=l.replaceAll("/","\\");if(H(x))return!1;let z=u6(x);if(L.rejectUnc&&z)return!1;if(L.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(x)&&!z&&/^(\\|[A-Za-z]:)/.test(x))return!1}if(PE.normalize(x)!==x)return!1;let W=x.split("\\");if(W.some((ne)=>ne==="."||ne===".."))return!1;if(W.some((ne,ce)=>/[. ]$/.test(ne)||ne.includes(":")&&!(ce===0&&/^[A-Za-z]:$/.test(ne))))return!1;let Z=x.startsWith("\\\\")?x.slice(2):x;if(/\\{2}/.test(Z))return!1;return!x.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(x)}if(L.rejectNetworkRoot&&p6(l))return!1;if(L.rejectMagicLinkRoot&&f6(l))return!1;if(wE.normalize(l)!==l)return!1;if(l.split("/").some((x)=>x==="."||x===".."))return!1;if(/\/{2}/.test(l))return!1;return!l.endsWith("/")||l==="/"}var g6=/\.(exe|ps1)$/i;function _6(l){return/\.ps1$/i.test(l)}function E6(l){return _6(l)&&/[[\]`*?]/.test(l)}var h6='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',S6=()=>ae.string().describe("Absolute path to the helper executable"),yo=(l)=>ae.preprocess((A)=>A===null?void 0:A,l.optional()).optional(),y6=oe,yE=(l)=>ae.number().int().min(l).transform((A)=>Math.min(A,y6)),OE=["path","script","defaultSettings"];function kE(l){if(!l||typeof l!=="object"||Array.isArray(l))return!1;let A=l;return OE.some((L)=>A[L]===null)&&OE.every((L)=>A[L]===null||A[L]===void 0)}var AE=64,ma=Ke(()=>ae.object({path:S6(),timeoutMs:yo(yE(1000)),refreshIntervalMs:yo(ae.union([ae.literal(0),yE(60000)]))})),vE=()=>ae.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(l){return l==="continue"||l==="refuse"}var O6=()=>ae.preprocess((l)=>l===void 0||ME(l)?l:"refuse",ae.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`)),A6=5,C6=()=>ae.number().int().min(0).transform((l)=>Math.min(l,A6)).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"),b6=(l)=>(l==="windows"?ae.literal("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):ae.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"),R6="exactly one of path/script must be configured",T6='"script" and "interpreter" must be configured together',D6="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",L6=(l)=>ae.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((A)=>!A.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((A)=>de(A),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((A)=>l!=="windows"||!/[\u0080-\uffff]/.test(A),{message:D6}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var an=["macos","linux","windows","wsl"];function Pc(l){return l==="wsl"?["wsl","linux"]:[l]}function I6(l){return l==="windows"?"win32":"posix"}function w6(l){return{rejectDriveRelative:l==="windows",rejectUnc:l==="windows",rejectNetworkRoot:l!=="windows",rejectMagicLinkRoot:l!=="windows",requireWin32ExecutableSuffix:l==="windows"}}function P6(l){let A=I6(l),L=w6(l);return ae.string().max(1024,{message:"path must be at most 1024 characters"}).refine((x)=>!d6.test(x),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((x)=>(A==="win32"?PE:wE).isAbsolute(x),{message:"path must be absolute"}).refine((x)=>!(A==="win32"&&L.requireWin32ExecutableSuffix)||g6.test(x),{message:"path must end in .exe or .ps1 on Windows"}).refine((x)=>A!=="win32"||!E6(x),{message:h6}).refine((x)=>m6(x,A,L),{message:A==="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 xc=[...an,"default"],Cc=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],fa=["managedSettings","appendSystemPrompt"],Fo=Ke(()=>ae.record(ae.string(),ae.unknown()).superRefine((l,A)=>{for(let L of["policyHelper","policyHelpers"])if(l[L]!==void 0&&l[L]!==null)A.addIssue({code:"custom",message:`must not contain "${L}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let L of Cc)if(l[L]!==void 0&&l[L]!==null)A.addIssue({code:"custom",message:`must not contain "${L}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${Cc.join("/")}) belong on the per-OS entries (policyHelpers.${an.join("/")})`});for(let L of fa)if(l[L]!==void 0&&l[L]!==null)A.addIssue({code:"custom",message:`must not contain "${L}" — 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 L of xc)if(l[L]!==void 0&&l[L]!==null)A.addIssue({code:"custom",message:`must not contain "${L}" — 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 "${L}" line inside the slot`})})),x6='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function N6(l){let{path:A,script:L,interpreter:x,defaultSettings:z}=l;if(A!==void 0&&L!==void 0)return R6;if(L===void 0!==(x===void 0))return T6;if(A===void 0&&L===void 0&&z===void 0)return x6;return null}function UE(l,A){return ma().omit({path:!0}).extend({path:yo(P6(l)),script:yo(L6(l)),interpreter:yo(b6(l)),outputBehavior:yo(vE()),onFailure:yo(O6()),retries:yo(C6()),defaultSettings:ae.preprocess((L)=>L===null?void 0:L,A.optional()).optional()}).check((L)=>{if(L.issues.length>0)return;let x=N6(L.value);if(x!==null)L.issues.push({code:"custom",message:x,input:L.value})})}var X_e=Ke(()=>UE("linux",Fo()));function bc(l,A=Fo()){return l==="default"?Fo():UE(l,A)}var k6=Ke(()=>ae.object(Object.fromEntries(xc.map((l)=>[l,ae.preprocess((A)=>{if(A===null)return;if(l!=="default"&&kE(A))return;return A},bc(l).optional()).optional()])))),Ds=["skills","agents","hooks","mcp"];function HE(l){return ae.preprocess((A)=>{if(!Array.isArray(A))return A;let L=A.filter((x)=>Ds.includes(x));if(L.length<A.length)l?.(A.length-L.length);return L},ae.union([ae.boolean(),ae.array(ae.enum(Ds))]))}function FE(){return ae.union([ae.array(ae.string()),ae.boolean(),ae.undefined()])}var CE=Object.freeze({type:"invalid-entry-stripped"}),v6=Ke(()=>ae.union([ae.object({type:ae.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:ae.string().describe("Regex matched against turn output (tool results and assistant text)"),url:ae.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:ae.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),ae.object({type:ae.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),bE=()=>ae.number().int().min(xg).max(Ng).optional().catch(void 0);function BE(l,{strictPolicyHelperKeys:A=!1}={}){function L(z){return ae.record(ae.string(),Dc()).check((W)=>{for(let[Z,ne]of Object.entries(W.value))if(ne.source.source==="settings"&&ne.source.name!==Z)W.issues.push({code:"custom",input:ne.source.name,path:[Z,"source","name"],message:`Settings-sourced marketplace name must match its ${z} key (got key "${Z}" but source.name "${ne.source.name}")`})})}let x=(z,W)=>A?ae.preprocess((Z)=>{if(Z===null)return;return W?W(Z):Z},z):z.catch(void 0);return{$schema:()=>ae.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:()=>ae.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:()=>ae.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:()=>ae.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:()=>ae.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:()=>ae.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:()=>ae.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:()=>x(ma().optional(),(z)=>z&&typeof z==="object"&&!Array.isArray(z)&&z.path===null?void 0:z).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:()=>x(k6().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).`),...en.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:()=>ae.object({issuer:ae.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:ae.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:ae.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:()=>ae.object({type:ae.literal("command"),command:ae.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:()=>ae.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:()=>ae.object({enabled:ae.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:ae.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:ae.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:ae.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:()=>ae.object({enabled:ae.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:ae.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:ae.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:()=>ae.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),desktopSessionCleanupPeriodDays:()=>ae.number().int().nonnegative().optional().describe("Retention ceiling in days for session transcripts created or last written by a desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed because this setting never disables writes — it only bounds an exemption from deletion. The ceiling is a hard cap: it also bounds an active archive grace, so the grace window of a release marker never keeps files past the ceiling. Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below cleanupPeriodDays effectively disables the exemption: those transcripts age out on the regular cleanupPeriodDays schedule, so the effective retention is whichever of the two periods is longer."),syncClaudeAiSkills:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.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:()=>yn(()=>i6()).describe("Environment variables to set for Claude Code sessions"),attribution:()=>{let z=ae.object({commit:ae.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:ae.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:ae.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 ae.union([ae.boolean(),z],{error:(W)=>{let Z=(W.errors??[]).flat().filter((ce)=>ce.path.length>0);if(Z.length>0)return Z.map((ce)=>`${ce.path.join(".")}: ${ce.message.replace(/^Invalid input: /,"")}`).join("; ");return`Expected false, true, or an object such as { "commit": "", "pr": "" }, but received ${Array.isArray(W.input)?"array":W.input===null?"null":typeof W.input}`}}).transform((W)=>{if(typeof W!=="boolean")return W;return W?{}:{commit:"",pr:"",sessionUrl:!1}}).pipe(z).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:()=>ae.string().optional().describe(`The claude.ai Project this session names for your organization's usage reports: the Project's UUID, or its ID starting with "claude_proj_". An empty string names none and stops lower-precedence files from naming one; the organization default still applies. 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.`),attributionProjectPolicy:()=>ae.object({default:ae.string().optional().describe('The Project used when neither CLAUDE_CODE_ATTRIBUTION_PROJECT nor attributionProject names one: its UUID, or its ID starting with "claude_proj_".')}).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:()=>ae.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:()=>ae.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:()=>yn(()=>xE(l)).describe("Tool usage permissions configuration"),model:()=>ae.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:()=>ae.array(ae.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:()=>ae.array(ae.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:()=>ae.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:()=>ae.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:()=>ae.array(ae.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:()=>ae.record(ae.string(),ae.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:()=>ae.object({options:ae.array(wc()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:ae.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:()=>ae.object({multiplier:Ic(),overrides:ae.record(ae.string(),Lc()).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:()=>ae.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:()=>ae.array(ae.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:()=>ae.array(ae.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:()=>ae.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. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:()=>ae.record(ae.string(),ae.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:()=>ae.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:()=>yn(()=>ae.record(ae.string().refine(Hl,{error:Qi}),Fl(),{error:Bl})).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:()=>yn(()=>ae.array(Ea())).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:()=>yn(()=>ae.array(ha())).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:()=>yn(()=>Mo()).describe("Custom commands to run before/after tool executions"),worktree:()=>ae.object({symlinkDirectories:ae.array(ae.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:ae.array(ae.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:ae.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:ae.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:ae.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:()=>ae.boolean().optional().describe("Disable all hooks and statusLine execution: the hooks defined in settings files and by installed plugins. Features built into Claude Code are not hooks in this sense and keep working; each has its own switch."),disableAgentView:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.boolean().optional().describe("Deprecated: use enableArtifact: false. Still honored — true disables the Artifact tool; false is ignored."),enableArtifact:()=>ae.boolean().optional().describe("Turn the Artifact tool on or off. Off in any of managed, --settings, or user settings wins; project and local settings can only turn it off. Unset defaults to on once the feature is available."),enableWorkflows:()=>ae.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:()=>ae.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:()=>ae.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:()=>ae.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:()=>ae.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashEditDiffEnabled:()=>ae.boolean().optional().describe("Whether the Bash tool shows a diff of the files a Bash command changed (PostToolUse Bash hooks get the changed-file list in tool_response). Set to false to turn that off. Default: on when the Bash tool handles file edits. Only user, flag or policy settings can turn it on outside auto and bypassPermissions modes."),bashOutputMaxChars:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.array(ae.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:()=>ae.array(ae.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:()=>ae.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), and npm-direct (package@npm) plugins whose recorded resolution a registry-pinned managed npm strictKnownMarketplaces entry names (host and path patterns and enabledPlugins ids do not vouch); managed and bundled skills keep theirs. "+"--disallowedTools, skill disallowed-tools, and other deny and ask rules from the command line or the current session still apply."),allowManagedMcpServersOnly:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.object({type:ae.literal("command"),command:ae.string(),padding:ae.number().optional(),refreshInterval:ae.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:ae.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:()=>ae.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:()=>ae.array(v6().catch(CE)).transform((z)=>z.filter((W)=>W!==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:()=>ae.object({type:ae.literal("command"),command:ae.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:()=>ae.record(ae.string(),FE()).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json — setting false in ~/.claude/settings.json is overridden by the project.'),prependPlugins:()=>ae.array(ae.string()).optional().catch(void 0).describe("Managed plugins (plugin@marketplace ids that managed enabledPlugins sets true) whose hooks run first, outermost, in the listed order: the first id listed sees every event before any other plugin and every result after it. Managed plugins not listed here or in appendPlugins follow the listed ones; user, project and marketplace plugins come after those; then appendPlugins; then the built-in plugins. The bundled 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:()=>ae.array(ae.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:()=>yn(()=>L("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:()=>yn(()=>L("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:()=>yn(()=>ae.array(aa())).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:()=>yn(()=>ae.array(aa())).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:()=>yn(()=>ae.array(mc())).describe('Enterprise blocklist of marketplace sources. When set in managed settings, these sources are blocked from being added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to block every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem.'),disableCommandPluginSources:()=>ae.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:()=>ae.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:()=>ae.array(ae.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source."),forceLoginMethod:()=>ae.enum(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:()=>ae.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:()=>ae.array(ae.string()).optional().catch([GE]).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:()=>ae.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:()=>ae.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, 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:()=>ae.union([ae.string(),ae.array(ae.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."),allowedProviders:()=>ae.preprocess((z)=>Array.isArray(z)?z.filter(Gl):z,ae.array(ae.enum(ys))).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 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:()=>ae.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:()=>ae.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:()=>ae.string().optional().describe("Controls the output style for assistant responses"),viewMode:()=>ae.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:()=>ae.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:()=>ae.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:()=>yn(()=>Pl()),...!1,feedbackSurveyRate:()=>ae.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:()=>ae.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:()=>ae.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:()=>ae.object({mode:ae.enum(["append","replace"]),verbs:ae.array(ae.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:()=>ae.object({excludeDefault:ae.boolean().optional().catch(void 0),tips:l6().optional(),tipsFile:ae.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:ae.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:()=>ae.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),maxProseWidth:()=>ae.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:()=>ae.object({enabled:ae.boolean().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:ae.string().optional().catch(void 0).describe(`Which spell checker to run: ${ca.map((z)=>`"${z}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:ae.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:ae.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 ${ca.slice(0,-1).join(", ")} or ${ca.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:()=>ae.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:()=>ae.enum(Er).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:()=>ae.enum(Er).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:()=>ae.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:()=>ae.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),maxEffortLevel:()=>ae.enum(ls).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:()=>ae.preprocess((z)=>typeof z==="object"&&z!==null&&!Array.isArray(z)?xo(z,(W,Z)=>Object.hasOwn(Object.prototype,Z)):z,ae.record(ae.string(),ae.object({effortLevel:ae.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model."),maxEffortLevel:ae.enum(ls).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:ae.union([ae.literal("auto"),bE()]).describe('Auto-compact window for this model, in tokens (100000 to 1000000), 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:()=>ae.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:()=>ae.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:()=>ae.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:()=>ae.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:()=>ae.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:()=>ae.enum(["60s","5m","10m","never"]).optional().catch(void 0).describe("Idle time before Claude's questions auto-continue with any answers "+"selected so far. Defaults to never — auto-continue only runs "+"when explicitly set to 60s/5m/10m."),dialogExpiry:()=>ae.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:()=>ae.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:()=>ae.enum(Pg).optional().catch(void 0).describe("@internal Controls the ProposeGoal tool (model-proposed session goals). 'auto' (the default when absent) lets the model choose per proposal whether to ask for approval via its ask_user parameter; 'alwaysAsk' routes every model-proposed goal through the approval dialog; 'disabled' turns the tool off. A typed /goal is unaffected. Consent-affecting, so it is read "+"from trusted sources only (user/policy/flag) — "+"workspace-resident project and local settings are ignored."),companyAnnouncements:()=>ae.array(ae.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:()=>ae.record(ae.string(),ae.object({mcpServers:ae.record(ae.string(),ae.record(ae.string(),ae.union([ae.string(),ae.number(),ae.boolean(),ae.array(ae.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:ae.record(ae.string(),ae.union([ae.string(),ae.number(),ae.boolean(),ae.array(ae.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(ae.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:()=>ae.object({defaultEnvironmentId:ae.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:()=>ae.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:()=>ae.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:()=>ae.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:()=>ae.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:()=>ae.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:()=>ae.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:()=>ae.object({enabled:ae.boolean().optional(),mode:ae.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:ae.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:()=>ae.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:()=>ae.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:()=>ae.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:()=>ae.union([ae.enum(Lg),ae.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:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.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:()=>ae.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:()=>ae.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:()=>ae.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:()=>ae.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:()=>ae.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:()=>ae.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:()=>ae.enum(["disable"]).optional().describe("Disable auto mode"),remoteTools:()=>ae.object({allowUnattendedServing:ae.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:()=>ae.array(ae.object({id:ae.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:ae.string().describe("Display name for the SSH connection"),sshHost:ae.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:ae.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:ae.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:ae.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:()=>ae.unknown().meta({type:"array"}).optional().describe("SSH connections in Claude Desktop on macOS and Linux whose host comes from a command. A list of entries, each with `id`, `name` and `command`, and optionally `sshIdentityFile` and `startDirectory`. When you ask Desktop to create or replace an entry's host, it runs `command` on this computer: a program name or absolute path, followed by plain arguments. There is no shell, so quotes, pipes, variables and a leading `~` do not work. 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:()=>ae.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:()=>ae.array(ae.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:()=>ae.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:()=>ae.union([ae.enum(wg),ae.string().startsWith("custom:").transform((z)=>z)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:()=>ae.enum(Dg).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:()=>ae.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:()=>ae.record(ae.string(),ae.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:()=>ae.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:()=>ae.enum(Tg).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:()=>ae.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:()=>ae.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),idleCompaction:()=>ae.boolean().optional().describe("Set to false to stop Claude Code from compacting a long conversation while the session is idle. Defaults to true."),switchModelsOnFlag:()=>ae.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:()=>ae.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:()=>ae.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:()=>ae.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:()=>ae.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:()=>ae.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:()=>ae.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:()=>ae.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:()=>ae.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:()=>ae.enum(Ig).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:()=>ae.boolean().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:()=>ae.object({shareHostProfile:ae.enum(_a).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:()=>ae.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:()=>ae.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:()=>ae.enum(Ls).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:()=>ae.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:()=>ae.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:()=>ae.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...Pi(dE(l),(z)=>()=>z)}}function Nc(l,A={}){let L=BE(l,A);return new xr(L).whole()}var M6=new Set,U6=new Set,Sa=Ke(()=>new xr(BE(vr()),M6)),H6=Ke(()=>Sa().whole());function ya(l){return Sa().forDocument(l)}var RE=Object.freeze({serverName:"invalid-entry-stripped"});function zE(l){for(let A of l){let L=A.path.length>0?`${A.path.map(String).join(".")}: `:"";if(A.code==="invalid_union"){for(let x of A.errors){let z=zE(x);if(z!==null)return`${L}${z}`}if("note"in A&&typeof A.note==="string"&&A.note!=="")return`${L}${A.note}`}if(A.message!=="")return`${L}${A.message}`}return null}var kc=Ke(()=>{let l=Sa();return zn().flatMap(({path:A,restrictive:L})=>{if(A.length!==1||A[0]==="strictPluginOnlyCustomization"||A[0]==="disableAllHooks"||typeof L!=="boolean"&&typeof L!=="string")return[];let x=A[0],z=l.field(x);if(z===void 0||z instanceof ae.ZodCatch)return[];return[{key:x,restrictive:L,field:z}]})}),Oa=Ke(()=>["strictKnownMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization",...kc().map((l)=>l.key)]),Oo=["managedSourcesBehavior","wslInheritsWindowsSettings"];function Is(l){return t(l)&&Object.values(l).every(Is)}function vc(l){let A=l.wslInheritsWindowsSettings;if(A===void 0||A===null)return"disarmed";let L=kr(A);return L===!0?"armed":L===!1?"disarmed":"unreadable"}function Mc(l){let A=l.source==="hostPattern"?l.hostPattern:l.source==="pathPattern"?l.pathPattern:null;if(A!==null&&!q_(A))return`${l.source}: regex does not compile; the entry cannot be enforced`;if(l.source==="github"&&l.repo.includes("*")&&eE(l.repo)===null)return'github: an owner wildcard must be exactly "<owner>/*"; the entry cannot be enforced';if(l.source==="git"&&tE(l.url))return'git: wildcards are only supported in github-form entries, as "<owner>/*"; the entry cannot be enforced';if((l.source==="github"||l.source==="git")&&l.ref!==void 0&&l.ref.includes("*"))return`${l.source}: ref contains "*", which git does not allow in ref names; the entry cannot be enforced`;return null}function TE(l,A){return ae.union([ae.null().transform(()=>{return}),ae.array(ae.unknown()).transform((L)=>{let x=[];for(let[z,W]of L.entries()){let Z=(l==="blockedMarketplaces"?mc():aa()).safeParse(W);if(Z.success){let ne=Mc(Z.data);if(ne!==null){if(l==="blockedMarketplaces")A({path:`${l}[${z}]`,message:`Unenforceable entry was kept: ${ne}; it can never match a marketplace source, but marketplace restrictions stay active`}),x.push(Z.data);else A({path:`${l}[${z}]`,message:`Invalid entry was ignored: ${ne}`});continue}x.push(Z.data)}else A({path:`${l}[${z}]`,message:`Invalid entry was ignored: ${zE(Z.error.issues)??"failed validation"}`})}if(l==="blockedMarketplaces"&&L.length>0&&x.length===0)A({path:l,message:'Every entry of "blockedMarketplaces" was invalid; none of them can be enforced until it is fixed.'});return x})]).optional()}function DE(l,A,L){return ae.array(A.catch((x)=>(L({path:`${l}[]`,message:`Invalid entry was ignored: ${x.issues[0]?.message??"failed validation"}`}),RE))).transform((x)=>x.filter((z)=>z!==RE)).optional()}var GE="(unreadable)";function pa(l,A,L,x,z,W){return ae.array(ae.unknown()).transform((Z)=>{let ne=[];for(let[ce,Te]of Z.entries()){let Le=A.safeParse(Te);if(Le.success){ne.push(Le.data);let we=z?.(Te,Le.data);if(we!==void 0)L({path:`${l}[${ce}]`,message:we,statusOnly:!0})}else{let we=Le.error.issues[0],Ie=we===void 0?"failed validation":we.path.length?`${we.path.join(".")}: ${we.message}`:we.message;L({path:`${l}[${ce}]`,message:`Invalid entry was ignored: ${Ie}`,...W?.invalidEntryIsStatusOnly&&{statusOnly:!0}})}}if(Z.length>0&&ne.length===0)L({path:l,message:`Every entry of "${l}" was invalid; enforcing an empty allowlist (${x}) until it is fixed.`});return ne}).optional().catch(()=>(L({path:l,message:`"${l}" was present but invalid; enforcing an empty allowlist (${x}) until it is fixed.`}),[]))}var Mr=Ke(()=>new Map(zn().flatMap(({path:l,restrictive:A})=>l.length>1?[[l.join("."),Po(A)[0]]]:[]))),Ur=["soft_deny","hard_deny","deny"],F6=new Map([["permissions",{restrictions:["deny","ask"],grants:["allow","additionalDirectories","defaultMode"]}],["autoMode",{restrictions:Ur,grants:["allow","environment"],withholdOnEntryDrop:!0}],["sandbox.network",{restrictions:["deniedDomains"],grants:["allowedDomains"],withholdOnEntryDrop:!0}],["sandbox.filesystem",{restrictions:["denyWrite","denyRead"],grants:["allowWrite","allowRead"],withholdOnEntryDrop:!0}]]),Aa=new Map([["permissions.defaultMode",{read:(l)=>{let A=Tr(l);return[...No,...hc(vr())].find((L)=>L===A)},inert:new Set(["default","dontAsk","plan"]),floor:"default"}]]);function Uc(l,A,L,x){let z=[],W=F6.get(l);if(W===void 0)return z;let Z=W.restrictions.flatMap((ce)=>{switch(L(ce)){case"unreadable":return[`"${ce}"`];case"trimmed":return W.withholdOnEntryDrop?[`an entry of "${ce}"`]:[];case void 0:return[]}});if(Z.length===0)return z;let ne=Z.join(" and ");for(let ce of W.grants){let Te=Aa.get(`${l}.${ce}`),Le=Te===void 0?A[ce]:Te.read(A[ce]);if(Le===void 0||Te?.inert.has(Le)===!0)continue;if(Te===void 0)delete A[ce];else A[ce]=Te.floor,z.push(ce);x({path:`${l}.${ce}`,message:Te===void 0?`"${ce}" was withheld because ${ne} in the same block could not be read; it takes effect again once that is fixed.`:`"${ce}" was withheld because ${ne} in the same block could not be read; treating it as ${Ts(Te.floor)} until that is fixed.`,...Te!==void 0&&{substituted:!0}})}return z}function ga(l){for(let A of Mr().keys())if(A.startsWith(`${l}.`))return!0;return!1}function Ca(l){return l!=="sandbox.credentials"&&!l.startsWith("sandbox.credentials.")&&ga(l)}function Hc(l){let A=l;while(A instanceof ae.ZodOptional||A instanceof xl||A instanceof ae.ZodPipe)A=A instanceof ae.ZodPipe?A.out:A.unwrap();return A instanceof ae.ZodObject?A:void 0}var LE=new Set(["remoteTools","remoteControl"]);function WE(l,A){return typeof A==="object"&&A!==null&&l.has(A)}function jE(l,A,L){let x={};for(let[z,W]of Object.entries(A.shape)){let Z=`${l}.${z}`;if(L?.has(Z))continue;let ne=Mr().get(Z),ce=Hc(W);if(ne!==void 0)x[z]=ne;else if(ce!==void 0&&ga(Z))x[z]=jE(Z,ce,L)}return x}function IE(l,A){return{path:l,message:`"${A}" was null, which is read as key removal; this source does not set it.`,statusOnly:!0,removal:!0}}function Ts(l){return typeof l==="string"?`"${l}"`:String(l)}function Rs(l,A=0){let L=l===void 0||l.input===void 0?"failed validation":l.code==="custom"&&l.message!==void 0?l.message:("expected"in l)&&typeof l.expected==="string"?`expected ${l.expected}`:("values"in l)&&Array.isArray(l.values)?`expected ${l.values.map(Ts).join(" or ")}`:"failed validation",x=(l?.path??[]).slice(A);if(x.length===0)return L;return x.every((z)=>typeof z==="number")?`${x.join(".")}: ${L}`:`nested value: ${L}`}function KE(l){return l===!1||l==="false"}function Fc(l,A){if(A===null)return!0;return(l.includes(".")?Mr().get(l):kc().find((x)=>x.key===l)?.restrictive)==="disable"&&KE(A)}function Rc(l,A,L,x){let z=l.slice(l.lastIndexOf(".")+1);if(typeof A==="boolean")return ae.preprocess((W)=>{let Z=kr(W);if(Z!==W)x({path:l,message:`"${z}" holds the string "${String(Z)}" where a boolean belongs; reading it as ${String(Z)}. Write it without quotes.`,statusOnly:!0});return Z},L);if(A==="disable")return ae.preprocess((W)=>{if(KE(W)){x({path:l,message:`"${z}" 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 W},L);return L}function B6(l,A,L,x,z,W,Z){let ne=l.slice(l.lastIndexOf(".")+1),ce=Mr().get(l),Te=Z?void 0:ce,Le=Aa.get(l),we=A instanceof ae.ZodCatch?A.unwrap():void 0,Ie=we instanceof ae.ZodType?we:A;return Rc(l,ce,Ie,L).catch((ke)=>{if(Te!==void 0)return L({path:l,message:`"${ne}" was present but invalid (${Rs(ke.issues[0])}); treating it as ${Ts(Te)}, its restrictive value, until it is fixed.`,substituted:!0}),x.add(ne),Te;if(Le!==void 0)return L({path:l,message:`"${ne}" was present but invalid (${Rs(ke.issues[0])}); treating it as ${Ts(Le.floor)} until it is fixed.`,substituted:!0}),x.add(ne),Le.floor;if(Ie.safeParse([]).success){let qe=ke.value;if(Array.isArray(qe)){let He=new Map;for(let We of ke.issues){let nt=We.path?.[0];if(typeof nt==="number"&&!He.has(nt))He.set(nt,Rs(We,1))}let rt=Ie.safeParse(qe.filter((We,nt)=>!He.has(nt)));if(He.size>0&&He.size<qe.length&&rt.success){for(let[We,nt]of He)L({path:`${l}[${We}]`,message:`Invalid entry was ignored (${nt}); it cannot take effect until it is fixed.`});return W.add(ne),rt.data}}}L({path:l,message:ce===void 0?`"${ne}" was present but invalid (${Rs(ke.issues[0])}) and was ignored; it cannot take effect until it is fixed.`:`"${ne}" was present but invalid (${Rs(ke.issues[0])}) and was ignored, not treated as ${Ts(ce)}; it cannot take effect until it is fixed.`}),z.add(ne);return})}function Tc(l,A,L,x={}){let z=l.slice(l.lastIndexOf(".")+1),W=new Set,Z=new Set,ne=new Set,ce={};for(let[we,Ie]of Object.entries(A.shape)){let Be=`${l}.${we}`,ke=Hc(Ie);ce[we]=x.override?.[Be]??(ke!==void 0&&ga(Be)?Tc(Be,ke,L,{...x,strictField:Ie}):B6(Be,Ie,L,W,Z,ne,x.neverSubstitute?.has(Be)===!0))}let Te=new Set([...x.skeletonExclude??[],...x.neverSubstitute??[]]),Le=A.safeExtend(ce);return ae.unknown().transform((we)=>{if(we===null){L(IE(l,z));return}W.clear(),Z.clear(),ne.clear();let Ie=t(we)||x.strictField===void 0?void 0:x.strictField.safeParse(we),Be=Ie?.success===!0&&t(Ie.data)?Ie.data:we,ke=t(Be)?Le.safeParse(xo(Be,(We)=>We===null||We===void 0)):void 0;if(!t(Be)||ke?.success!==!0){let We=jE(l,A,Te),nt=Object.keys(We);if(L({path:l,message:nt.length>0?`"${z}" was present but not an object; treating its locks as their restrictive values (${nt.join(", ")}) until it is fixed.`:`"${z}" was present but not an object and was ignored; it cannot take effect until it is fixed.`,...nt.length>0&&{substituted:!0}}),nt.length===0)return;if(!LE.has(l))x.synthesized?.add(We);return We}for(let[We,nt]of Object.entries(Be)){let it=`${l}.${We}`;if(nt===null&&(Mr().has(it)||ga(it)))L(IE(it,We))}let qe={...ke.data};for(let We of Uc(l,qe,(nt)=>Z.has(nt)?"unreadable":ne.has(nt)?"trimmed":void 0,L))W.add(We);let He=xo(qe,(We)=>We===void 0);if(Object.keys(He).length===0)return Object.entries(Be).some(([We,nt])=>nt!==void 0&&Object.hasOwn(A.shape,We))?void 0:He;let rt=x.synthesized;if(rt!==void 0&&!LE.has(l)&&Object.entries(He).every(([We,nt])=>W.has(We)||WE(rt,nt)||Is(nt)))rt.add(He);return He}).optional()}function Bc(l,A,L){let x=Sa(),z=(je)=>U6.has(je)||x.carries(L,je),W=(je)=>{let ze=x.field(je);if(!ze)throw Error("policyTolerantSettingsSchema: not a settings field of this build");return ze},Z=new Map,ne=(je,ze)=>{Z.set(je,ze)};for(let je of["prependPlugins","appendPlugins"])if(x.has(je))ne(je,()=>ae.array(ae.string()).optional().catch((ze)=>{l({path:je,message:`${ze.issues[0]?.message??"Failed schema validation"}. This field was ignored; read as unset.`});return}));ne("wslInheritsWindowsSettings",()=>ae.union([ae.null().transform(()=>{return}),ae.preprocess((je)=>{let ze=kr(je);if(ze!==je)l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" holds the string "${String(ze)}" where a boolean belongs; reading it as ${String(ze)}. Write it without quotes.`,statusOnly:!0});return ze},W("wslInheritsWindowsSettings"))]).optional().catch(()=>{l({path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" was present but invalid (it takes true or false), so this source's WSL opt-in cannot be read until it is fixed. WSL fails it closed: in an administrator source it arms the Windows policy chain with no user-writable source (/etc/claude-code, HKCU) read beneath it; in HKCU it leaves HKCU unapplied.`});return})),ne("strictKnownMarketplaces",()=>TE("strictKnownMarketplaces",l).catch(()=>(l({path:"strictKnownMarketplaces",message:'"strictKnownMarketplaces" was present but invalid; enforcing an empty allowlist (no marketplaces admitted) until it is fixed.'}),[]))),ne("blockedMarketplaces",()=>TE("blockedMarketplaces",l).catch(()=>{l({path:"blockedMarketplaces",message:'"blockedMarketplaces" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),ne("allowedMcpServers",()=>DE("allowedMcpServers",Ea(),l).catch(()=>(l({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[]))),ne("deniedMcpServers",()=>DE("deniedMcpServers",ha(),l).catch(()=>{l({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return})),ne("managedMcpServers",()=>ae.unknown().transform((je)=>ea(je,(ze,st)=>l({path:ze?`managedMcpServers.${ze}`:"managedMcpServers",message:ze?`Managed MCP server was ignored: ${st}`:st,statusOnly:!0}))).optional());let ce=new Set;for(let{key:je,restrictive:ze,field:st}of kc()){let ct=typeof ze==="string"?`"${ze}"`:String(ze);ne(je,()=>ae.union([ae.null().transform(()=>{return}),Rc(je,ze,st,l)]).optional().catch(()=>(l({path:je,message:`"${je}" was present but invalid; treating it as ${ct} (its restrictive value) until it is fixed.`,substituted:!0}),ce.add(je),ze)))}ne("strictPluginOnlyCustomization",()=>ae.union([ae.null().transform(()=>{return}),HE((je)=>l({path:"strictPluginOnlyCustomization",message:`"strictPluginOnlyCustomization" lists ${je} ${K(je,"entry","entries")} this version does not recognize as a surface (known: ${Ds.join(", ")}); an unrecognized entry locks nothing, so check it for a typo.`,statusOnly:!0}))]).optional().catch(()=>(l({path:"strictPluginOnlyCustomization",message:'"strictPluginOnlyCustomization" was present but invalid; treating it as true (skills, agents, hooks and MCP servers load from managed settings and plugins only) until it is fixed.',substituted:!0}),ce.add("strictPluginOnlyCustomization"),!0))),ne("enabledPlugins",()=>{let je=FE();return ae.record(ae.string(),ae.unknown()).transform((ze)=>{let st=[],ct=0;for(let[Tt,wt]of Object.entries(ze)){let At=je.safeParse(wt);if(At.success){st.push([Tt,At.data]);continue}ct++,l({path:Nr().safeParse(Tt).success?`enabledPlugins.${Tt}`:"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(ct>0&&st.length===0){l({path:"enabledPlugins",message:'Every entry of "enabledPlugins" was invalid; no plugin is force-enabled or blocked by it until it is fixed.'});return}return Object.fromEntries(st)}).optional().catch(()=>{l({path:"enabledPlugins",message:'"enabledPlugins" was present but invalid (not a map of plugin ids) and was ignored; no plugin is force-enabled or blocked by it until it is fixed.'});return})}),ne("availableModels",()=>ae.array(ae.unknown()).transform((je,ze)=>{let st=[];for(let ct of je)if(typeof ct==="string")st.push(ct);else l({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(ct)}); the entry was ignored.`});return st}).optional().catch(()=>(l({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[]))),ne("deniedModels",()=>ae.array(ae.unknown()).transform((je)=>{let ze=[];for(let st of je)if(typeof st==="string")ze.push(st);else l({path:"deniedModels",message:`"deniedModels" contained a non-string entry (${st===null?"null":typeof st}); the entry was ignored.`});return ze}).optional().catch(()=>{l({path:"deniedModels",message:'"deniedModels" was present but is not a list of model names, so it was ignored and blocks no models until it is fixed.'});return})),ne("allowedHttpHookUrls",()=>pa("allowedHttpHookUrls",ae.string(),l,"no HTTP hooks may run")),ne("httpHookAllowedEnvVars",()=>pa("httpHookAllowedEnvVars",ae.string(),l,"no environment variables may be interpolated into HTTP hook headers")),ne("allowedChannelPlugins",()=>pa("allowedChannelPlugins",c6(),l,"no channel plugins admitted",(je,ze)=>typeof je==="string"?`"allowedChannelPlugins" entry "${je}" was accepted; prefer the documented object form {"plugin": "${ze.plugin}", "marketplace": "${ze.marketplace}"}.`:void 0)),ne("gatewayInternalNetworks",()=>ae.array(ae.string()).optional().catch(()=>(l({path:"gatewayInternalNetworks",message:'"gatewayInternalNetworks" was present but invalid; gateway sign-in governed by this source is refused until it is fixed.'}),[GE]))),ne("forceLoginOrgUUID",()=>W("forceLoginOrgUUID").catch(()=>(l({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]))),ne("allowedProviders",()=>pa("allowedProviders",ae.custom(Wl,{message:`not a known provider name (${ys.join(", ")})`}),l,"no API provider may be used, so Claude Code will not start on this machine",void 0,{invalidEntryIsStatusOnly:!0}));let Te=!1,Le=(je,ze)=>{let st=je.safeParse(ze);if(st.success)return;return st.error.issues.slice(0,3).map((ct)=>ct.path.length?`${ct.path.join(".")}: ${ct.message}`:ct.message).join("; ")},we;ne("policyHelper",()=>ae.preprocess((je)=>{if(Te=!1,we=je,je&&typeof je==="object"&&!Array.isArray(je)){let ze=je;for(let st of["defaultSettings","default",...fa])if(ze[st]!==void 0&&ze[st]!==null)l({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(ze[st]!==void 0&&ze[st]!==null)l({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 an)if(ze[st]!==void 0&&ze[st]!==null)l({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(ze.claudeMd!==void 0&&ze.claudeMd!==null)l({path:"policyHelper",message:`"claudeMd" on the singular policyHelper is ignored — "claudeMd" is a managed-settings key: put it at the settings top level or inside a static payload, or emit it from the helper's stdout envelope. The intended instructions will NOT apply from here.`,statusOnly:!0});if(ze.outputBehavior!==void 0&&ze.outputBehavior!==null)l({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${an.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(ze.onFailure!==void 0&&ze.onFailure!==null)l({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${an.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(ze.retries!==void 0&&ze.retries!==null)l({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${an.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(ze.path===null||ze.path===void 0)Te=!0}return je===null?void 0:je},ma().optional()).catch((je)=>{l({path:"policyHelper",message:`${je.issues[0]?.message??Le(ma(),we)??"Failed schema validation"}. This field was ignored.`,...Te&&{statusOnly:!0}});return}));let Ie=(je,ze)=>{l({path:je,message:`"${je}" is not a valid static settings payload: ${ze??"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})},Be=[],ke=(je)=>{let ze=!1,st,ct=bc(je,Fo().optional().catch((Tt)=>{ze=!0,Ie(`policyHelpers.${je}.defaultSettings`,Tt.issues[0]?.message??Le(Fo(),st&&typeof st==="object"&&!Array.isArray(st)?st.defaultSettings:void 0));return}));return ae.preprocess((Tt)=>{if(ze=!1,st=Tt,je!=="default"&&Tt&&typeof Tt==="object"&&!Array.isArray(Tt)){let wt=Tt;for(let xt of[...fa,"claudeMd"])if(wt[xt]!==void 0&&wt[xt]!==null)l({path:`policyHelpers.${je}`,message:`"${xt}" on the policyHelpers.${je} 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 xt of["policyHelper","policyHelpers"])if(wt[xt]!==void 0&&wt[xt]!==null)l({path:`policyHelpers.${je}`,message:`"${xt}" on the policyHelpers.${je} 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 xt of an)if(wt[xt]!==void 0&&wt[xt]!==null)l({path:`policyHelpers.${je}`,message:`"${xt}" on the policyHelpers.${je} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${xt} config will NOT apply from here.`,statusOnly:!0});if(wt.default!==void 0&&wt.default!==null)l({path:`policyHelpers.${je}`,message:`"default" on the policyHelpers.${je} 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 At=wt.onFailure;if(At!==void 0&&At!==null&&!ME(At)){let xt;if(typeof At==="string"){let En=At.replace(/[^\x20-\x7e]/gu,"?");xt=JSON.stringify(En.length>AE?`${En.slice(0,AE-1)}…`:En)}else if(typeof At==="number"||typeof At==="boolean")xt=String(At);else xt=`a non-string value (${Array.isArray(At)?"array":typeof At})`;l({path:`policyHelpers.${je}.onFailure`,message:`"onFailure": ${xt} on the policyHelpers.${je} 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(kE(Tt))return}return Tt===null?void 0:Tt},ct.optional()).catch((Tt)=>{if(je==="default"){Ie("policyHelpers.default",Tt.issues[0]?.message??Le(Fo(),st));return}if(ze)return;let wt=Le(bc(je),st)??"failed validation",At=st,xt=At&&typeof At==="object"&&!Array.isArray(At)?At:null,En=xt?.onFailure,jn=En!==void 0&&En!==null&&En!=="continue",Zt=(nn)=>{let wn=`policyHelpers.${je}`;if(jn)Be.push({entryKey:je,message:nn});else l({path:wn,message:nn,statusOnly:!0})};if(xt){let nn=xt.defaultSettings;if(nn!==void 0&&nn!==null){let wn=Fo().safeParse(nn);if(wn.success){let Pn=xt.outputBehavior,fn=Pn===void 0||Pn===null?null:vE().safeParse(Pn);if(fn&&!fn.success){Zt(`Invalid entry was ignored: ${wt}. 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 ${je} from this entry.`);return}return l({path:`policyHelpers.${je}`,message:`Invalid entry: its helper fields were ignored (${wt}), but its "defaultSettings" static payload was kept. No policy helper runs on ${je} from this entry.`,statusOnly:!0}),{defaultSettings:wn.data,...fn&&{outputBehavior:fn.data}}}}}Zt(`Invalid entry was ignored: ${wt}. No policy helper runs on ${je} from this entry.`);return})};ne("policyHelpers",()=>ae.preprocess((je)=>{if(Be=[],je&&typeof je==="object"&&!Array.isArray(je)){let ze=je;for(let st of["defaultSettings",...fa,"claudeMd"])if(ze[st]!==void 0&&ze[st]!==null)l({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(ze[st]!==void 0&&ze[st]!==null)l({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 Cc.filter((ct)=>ct!=="defaultSettings"))if(ze[st]!==void 0&&ze[st]!==null){let ct=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";l({path:"policyHelpers",message:`"${st}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${an.join("/")})${ct}. No helper runs from this field here.`,statusOnly:!0})}}return je===null?void 0:je},ae.object(Object.fromEntries(xc.map((je)=>[je,ke(je)]))).transform((je)=>{for(let ze of Object.keys(je))if(je[ze]===void 0)delete je[ze];for(let{entryKey:ze,message:st}of Be){let ct=`policyHelpers.${ze}`,Tt=Pc(ze).find((At)=>je[At]?.defaultSettings!==void 0&&je[At]?.defaultSettings!==null),wt=Tt!==void 0?`${Tt}.defaultSettings`:je.default!==void 0?"default":null;l(wt!==null?{path:ct,message:`${st} Its "onFailure" requires the helper; the "policyHelpers.${wt}" static payload serves in its place.`,statusOnly:!0}:{path:ct,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 Be=[],je}).optional().catch((je)=>(l({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${an.join(", ")}) to helper entries, plus an optional "default" settings payload (${je.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 qe=new WeakSet;for(let je of x.keys){if(je==="sandbox"||!Ca(je))continue;ne(je,()=>{let ze=W(je),st=Hc(ze);if(st===void 0)return ze.catch((ct)=>{l({path:je,message:`${ct.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});return Tc(je,st,l,{synthesized:qe,strictField:ze})})}let He=Object.freeze({mode:"deny"}),rt=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),We=0,nt=[],it=new Set,mt=new Set,Lt=A===void 0?"":`${[...A].reduce((je,ze)=>Math.imul(je^ze.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,kt=(je,ze)=>{if(typeof je!=="object"||je===null)return;let st=(Nt)=>ze.some((xn)=>xn.path?.includes(Nt)),ct=(Nt)=>{let xn=je[Nt];if(typeof xn==="string")return xn;return st(Nt)?"":void 0},Tt=ct("accessKeyIdVar"),wt=ct("secretAccessKeyVar"),At=ct("sessionTokenVar"),xt=Eo;if(![Tt,wt,At].some((Nt)=>Nt!==void 0&&xt.includes(Nt)))return;let En=(Nt)=>Nt!==void 0&&Rr().safeParse(Nt).success;We+=1;let jn=(Nt)=>`${wl}${Nt}_${Lt}${We}_`,Zt=En(Tt)?Tt:jn("ACCESS_KEY_ID"),nn=En(wt)&&wt!==Zt?wt:jn("SECRET_ACCESS_KEY"),wn=At===void 0?void 0:En(At)&&At!==Zt&&At!==nn?At:jn("SESSION_TOKEN"),Pn=(Nt)=>Nt.startsWith(wl);if(!Pn(Zt)&&!Pn(nn)){let Nt=xt.includes(nn)?nn:void 0;if(nn=jn("SECRET_ACCESS_KEY"),Nt!==void 0){let xn=kt({accessKeyIdVar:Nt},[]);if(xn!==void 0)nt.push(xn)}}let fn=qi().safeParse({accessKeyIdVar:Zt,secretAccessKeyVar:nn,...wn!==void 0&&{sessionTokenVar:wn}});return fn.success?fn.data:void 0},Jt=(je,ze,st)=>ae.array(ze.catch((ct)=>{let Tt=st(ct.value);if(Tt!==void 0)return l({path:`sandbox.credentials.${je}[]`,message:`Invalid entry was degraded to mode "deny": ${ct.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${je==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`,substituted:!0}),Tt;return l({path:`sandbox.credentials.${je}[]`,message:`Invalid entry was ignored: ${ct.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),He})).transform((ct)=>{let Tt=ct.filter((wt)=>wt!==He);if(ct.length>0&&Tt.length===0)it.add(je);return Tt}).optional().catch((ct)=>{if(typeof ct.value==="object"&&ct.value!==null&&!Array.isArray(ct.value)){let Tt=ze.safeParse(ct.value);if(Tt.success)return l({path:`sandbox.credentials.${je}`,message:`"${je}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[Tt.data];let wt=st(ct.value);if(wt!==void 0)return l({path:`sandbox.credentials.${je}`,message:`"${je}" 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}),[wt]}return l({path:`sandbox.credentials.${je}`,message:`${ct.issues[0]?.message??"Invalid value"}. "${je}" was ignored; these credential entries are NOT protected until it is fixed.`}),it.add(je),[]});ne("sandbox",()=>{let je=ae.object({files:Jt("files",Xi(),(ze)=>{if(typeof ze!=="object"||ze===null||!("mode"in ze)||ze.mode!=="mask"&&ze.mode!=="deny"||!("path"in ze)||typeof ze.path!=="string")return;let st=Xi().safeParse({path:ze.path,mode:"deny"});return st.success?st.data:void 0}),envVars:Jt("envVars",Ji(),(ze)=>{if(typeof ze!=="object"||ze===null||!("mode"in ze)||ze.mode!=="mask"&&ze.mode!=="deny"||!("name"in ze)||typeof ze.name!=="string")return;let st=Ji().safeParse({name:ze.name,mode:"deny"});return st.success?st.data:void 0}),allowPlaintextInject:Rc("sandbox.credentials.allowPlaintextInject",Mr().get("sandbox.credentials.allowPlaintextInject"),ae.boolean().optional(),l).catch((ze)=>(l({path:"sandbox.credentials.allowPlaintextInject",message:`${ze.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}),it.add("allowPlaintextInject"),!1)),awsPairs:ae.array(qi().catch((ze)=>{let st=kt(ze.value,ze.issues);if(st!==void 0)return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${ze.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`,substituted:!0}),st;return l({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${ze.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),rt})).transform((ze)=>{let st=ze.filter((ct)=>ct!==rt);if(nt.length>0)st.push(...nt),nt.length=0;if(ze.length>0&&st.length===0)it.add("awsPairs");return st}).optional().catch((ze)=>{let st=typeof ze.value==="object"&&ze.value!==null?kt(ze.value,[]):void 0,ct=typeof ze.value==="object"&&ze.value!==null&&(("accessKeyIdVar"in ze.value)||("secretAccessKeyVar"in ze.value)||("sessionTokenVar"in ze.value));if(st===void 0&&ct)return nt.length=0,l({path:"sandbox.credentials.awsPairs",message:`${ze.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.`}),it.add("awsPairs"),[];let Tt=st!==void 0?[st]:Eo.flatMap((wt)=>{let At=kt({accessKeyIdVar:wt},[]);return At!==void 0?[At]:[]});if(nt.length>0)Tt.push(...nt),nt.length=0;if(st===void 0)it.add("awsPairs");return l({path:"sandbox.credentials.awsPairs",message:`${ze.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}),Tt}),sigv4:ae.object(Object.fromEntries(["streaming","presigned","sigv4a"].map((ze)=>[ze,ae.enum(["deny","passthrough"]).optional().catch((st)=>(l({path:`sandbox.credentials.sigv4.${ze}`,message:`${st.issues[0]?.message??"Invalid value"}. "${ze}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`,substituted:!0}),mt.add(ze),"deny"))]))).transform((ze)=>{let st=Object.entries(ze).filter(([,ct])=>ct!==void 0);if(st.length>0&&st.every(([ct])=>mt.has(ct)))it.add("sigv4");return mt.clear(),ze}).optional().catch((ze)=>(l({path:"sandbox.credentials.sigv4",message:`${ze.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}),mt.clear(),it.add("sigv4"),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).transform((ze)=>{let st=Object.entries(ze).filter(([,ct])=>ct!==void 0);if(st.length>0&&st.every(([ct])=>it.has(ct)))qe.add(ze);return it.clear(),ze}).optional().catch((ze)=>{l({path:"sandbox.credentials",message:`${ze.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=Eo.flatMap((Tt)=>{let wt=kt({accessKeyIdVar:Tt},[]);return wt!==void 0?[wt]:[]});nt.length=0,it.clear(),mt.clear();let ct={allowPlaintextInject:!1,awsPairs:st,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}};return qe.add(ct),ct});return Tc("sandbox",Pl(),l,{override:{"sandbox.credentials":je},skeletonExclude:new Set(["sandbox.enabled"]),neverSubstitute:new Set(["sandbox.failIfUnavailable"]),synthesized:qe})});let _n={};for(let je of x.keys){if(!z(je))continue;let ze=Z.get(je);_n[je]=ze?ze():W(je).catch((st)=>{l({path:je,message:`${st.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return})}for(let[je,ze]of Z)if(!(je in _n)&&z(je))_n[je]=ze();return ae.object(_n).passthrough().check((je)=>{je.issues.push(...x.wrongDocumentIssues(je.value,_n))}).transform((je)=>{for(let ct of Object.keys(je))if(je[ct]===void 0)delete je[ct];let ze=Object.keys(je).filter((ct)=>!Oo.some((Tt)=>Tt===ct)&&!Is(je[ct])),st=ze.length>0&&ze.every((ct)=>ce.has(ct)||WE(qe,je[ct]));if(ce.clear(),st)for(let ct of ze)l({path:ct,message:`"${ct}" 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 je})}var z6=65536,$E=new RegExp(`[${gg("<")}]`,"gu");function G6(l){return hg(l)&&l.search($E)===-1}function VE(l){let A={},L=z6,x=0,z=0;for(let W of Ur.toSorted((Z,ne)=>Number(ne==="hard_deny")-Number(Z==="hard_deny"))){let Z=t(l)?l[W]:void 0;if(Z!==void 0&&Z!==null&&!Array.isArray(Z))x++;let ne=[_s];for(let ce of Array.isArray(Z)?Z:[]){if(typeof ce!=="string"){x++;continue}if(["",_s].includes(ce.trim()))continue;let Te=ce.length>2*L?1/0:Ye(ce);if(Te>L){x++;continue}L-=Te;let we=Array.from(Ct(ce),(Be)=>$i(Be)||Vi(Be)?" ":Be).join("").replace($E,"&lt;");if(we.trim()===_s)continue;let Ie=Ye(we)-Te;if(!G6(we)||Ie>L){x++;continue}if(L-=Ie,ne.push(we),we!==ce)z++}if(ne.length>1)A[W]=ne}return{lists:A,leftOut:x,mended:z}}var YE=new Set(["disableAllHooks"]),XE=["accessKeyIdVar","secretAccessKeyVar","sessionTokenVar"];function zc(l){let A={};for(let ke of zn()){let{path:qe,restrictive:He}=ke;if(YE.has(qe[0]))continue;let rt=Ri(ke,l);if((typeof rt==="boolean"||typeof rt==="string")&&Po(He).includes(rt))Yt(A,qe,rt)}if(Wt(l,["attribution"])===!1)Yt(A,["attribution","sessionUrl"],!1);let L=ba(l.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(L)A.permissions={...A.permissions,...L};for(let ke of W6)if(l[ke]!==void 0)A[ke]=l[ke];for(let[ke,qe]of Object.entries(l))if((ke.startsWith("disable")&&(qe===!0||qe==="disable")||ke.startsWith("enable")&&qe===!1)&&!YE.has(ke))A[ke]=qe;if(l.disableAllHooks===!0)A.allowManagedHooksOnly=!0;if(Array.isArray(l.httpHookAllowedEnvVars)&&l.httpHookAllowedEnvVars.length===0)A.httpHookAllowedEnvVars=[];let x=ba(l.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),z=ba(l.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),W=ba(l.sandbox?.credentials,["files","envVars"])??{},Z=l.sandbox?.credentials?.awsPairs,ne=t(Z)&&XE.some((ke)=>(ke in Z)),Te=(Array.isArray(Z)?Z:ne?[Z]:[]).flatMap((ke)=>t(ke)?XE.map((qe)=>ke[qe]):[]),Le=Z!==void 0&&!Array.isArray(Z)&&!ne,we=Eo.filter((ke)=>Le||Te.includes(ke));if(we.length>0)W.awsPairs=we.map((ke,qe)=>({accessKeyIdVar:ke,secretAccessKeyVar:`${Zi}${qe+1}_`}));let Ie=l.sandbox?.credentials?.sigv4;if(Ie){let ke={};for(let[qe,He]of Object.entries(Ie))if(He==="deny")ke[qe]="deny";if(Object.keys(ke).length>0)W.sigv4=ke}let Be=Object.keys(W).length>0;if(x||z||Be){let ke=A.sandbox??{};A.sandbox={...ke,...x&&{filesystem:{...ke.filesystem,...x}},...z&&{network:{...ke.network,...z}},...Be&&{credentials:{...ke.credentials,...W}}}}return Object.keys(A).length>0?A:null}function ba(l,A){if(!l)return;let L={};for(let x of A)if(l[x]!==void 0)L[x]=l[x];return Object.keys(L).length>0?L:void 0}var W6=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels","availableModelsMatch","deniedModels","allowedProviders"];var j6=["SSL_CERT_FILE","NODE_EXTRA_CA_CERTS","REQUESTS_CA_BUNDLE","CURL_CA_BUNDLE","CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE","HTTPLIB2_CA_CERTS"],K6=["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"],JE=[...j6,...K6],ZE={UV_NATIVE_TLS:"true",DENO_TLS_CA_STORE:"system,mozilla"};var $6=Object.freeze(["-c","core.hooksPath=/dev/null","-c","core.fsmonitor="]);var dEe=Object.freeze(["--no-optional-locks","status","--porcelain","--untracked-files=normal","--ignore-submodules=dirty"]),V6=Object.freeze({GIT_LFS_SKIP_SMUDGE:"1"});var Y6=["'alias.remote-none=version'","'alias.remote-none.command=version'","'alias.remote-/.command=version'","'fetch.bundleURI='","'help.autocorrect=0'"],X6=Y6.join(" "),uEe=Object.freeze({GIT_ALLOW_PROTOCOL:"/",GIT_CONFIG_PARAMETERS:X6,GIT_NO_LAZY_FETCH:"1",GIT_NO_REPLACE_OBJECTS:"1",GIT_TERMINAL_PROMPT:"0",...V6}),pEe=Object.freeze({LC_ALL:"C",LANGUAGE:"C"}),fEe=Object.freeze({GIT_SSH_COMMAND:"false"});var mEe=Object.freeze([...$6,"-c","safe.bareRepository=explicit","-c","protocol.file.allow=never"]),Gc=["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"],Wc=[...Gc,"GIT_CONFIG_COUNT","GIT_CONFIG_PARAMETERS","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","GIT_CONFIG"],J6=/^GIT_CONFIG_(KEY|VALUE)_\d+$/,Z6=new RegExp(J6.source,"i");var gEe=new Set(Wc);function QE(l){let A=0,L=l.length;while(A<L&&qE(l.charCodeAt(A)))A++;while(L>A&&qE(l.charCodeAt(L-1)))L--;let x=q6(l.slice(A,L));if(x!==-1)return{kind:"line_break",index:jc(l,A+x)};for(let z=A;z<L;z++){let W=l.charCodeAt(z);if(W===0)return{kind:"nul",index:jc(l,z)};if(W>255)return{kind:"non_ascii",index:jc(l,z),codePoint:Q6(l,z)}}return null}function q6(l){let A=l.indexOf(`
`),L=l.indexOf("\r");if(A===-1)return L;return L===-1?A:Math.min(A,L)}function qE(l){return l===9||l===32||l===10||l===13}function Q6(l,A){return l.codePointAt(A)??l.charCodeAt(A)}function jc(l,A){let L=0;for(let x=0;x<A;x++){let z=l.charCodeAt(x);if(z>=55296&&z<=56319&&x+1<l.length&&(l.charCodeAt(x+1)&64512)===56320)x++;L++}return L}var Kc=["NODE_TLS_REJECT_UNAUTHORIZED","BUN_TLS_REFUSE_DISTRUSTED_KEYS"];var eh=["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 $c=["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"],th=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var nh="OTEL_EXPORTER_OTLP_",Vc=["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"],oh=[nh,`ANT_${nh}`];var rh={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...th,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...th,"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"]},sh=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var ih=["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"],Yc=["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",...ih,...sh],eJ=[{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"]}],xEe=S(eJ.flatMap((l)=>[l.endpoint,...l.companions])),Xc=["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 Jc=["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"],Zc=["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"],qc=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],tJ=["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"],NEe=[...ih,...sh,"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"],kEe=["CLAUDE_CODE_OAUTH_TOKEN","CLAUDE_CODE_SESSIONS_OAUTH_TOKEN",...tJ,"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"],nJ=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],Qc=[...nJ,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var ws=["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"],ed=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],vEe=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...$c,...Yc,...Xc,...Jc,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...Qc,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...ed,...ws,"AWS_REGION","AWS_DEFAULT_REGION",...Zc,"ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_BEDROCK_REGION_PREFIX","CLAUDE_CODE_CERT_STORE","DISABLE_GROWTHBOOK","CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE",...qc]);var ah=["SSL_CERT_FILE","SSL_CERT_DIR","ALL_PROXY"],oJ=["NPM_CONFIG_HTTPS_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_PROXY"],rJ=new Set(Gc),sJ=new Set(["HTTP_PROXY","HTTPS_PROXY","ALL_PROXY","NO_PROXY","CLAUDE_CODE_HTTP_PROXY","CLAUDE_CODE_HTTPS_PROXY","NPM_CONFIG_PROXY","NPM_CONFIG_HTTP_PROXY","NPM_CONFIG_HTTPS_PROXY"]);var iJ=S([...JE,...Object.keys(ZE),...eh.map((l)=>l.toUpperCase()),...ah,...Wc.filter((l)=>!rJ.has(l))]).filter((l)=>l!=="NODE_EXTRA_CA_CERTS"&&l!=="JAVA_TOOL_OPTIONS"&&!sJ.has(l));var MEe=new Set(["CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","NODE_EXTRA_CA_CERTS",...Kc,"CLAUDE_CODE_OAUTH_SCOPES",...iJ]);var lh=["HTTPS_PROXY","HTTP_PROXY","NO_PROXY",...ah,...oJ,"NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE",...Kc];var ch=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],td=["bwrapPath","ripgrep","socatPath"],dh=["allowAppleEvents","allowNestedUserNamespaces","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],uh=["required","egress"],aJ=new Set(["ANTHROPIC_BEDROCK_REGION_PREFIX","ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_AUTO_MODE","CLAUDE_CODE_ENABLE_DESIGN_SYNC","CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_GATEWAY","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_POWERSHELL_TOOL","CLAUDE_CODE_USE_VERTEX","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_SERVICE_NAME","OTEL_TRACES_EXPORT_INTERVAL","OTEL_TRACES_EXPORTER","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_4_5_OPUS","VERTEX_REGION_CLAUDE_4_6_OPUS","VERTEX_REGION_CLAUDE_4_7_OPUS","VERTEX_REGION_CLAUDE_4_8_OPUS","VERTEX_REGION_CLAUDE_5_OPUS","VERTEX_REGION_CLAUDE_5_5_OPUS","VERTEX_REGION_CLAUDE_FABLE_5","VERTEX_REGION_CLAUDE_FABLE_5_1","VERTEX_REGION_CLAUDE_4_5_SONNET","VERTEX_REGION_CLAUDE_4_6_SONNET","VERTEX_REGION_CLAUDE_5_SONNET","VERTEX_REGION_CLAUDE_5_5_SONNET","VERTEX_REGION_CLAUDE_HAIKU_4_5","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_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"]),lJ=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","CLAUDE_CODE_DISABLE_RESPONSE_COMPARISON","CLAUDE_CODE_DISABLE_WEB_FETCH","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),cJ=new Set([...[],"ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),dJ=/auth|key|token|cookie|secret|credential|session|signature|passw|jwt|assertion|cert|oidc|org|tenant|account|project|workspace|user|email|identity|principal|consumer|client|host|url|base|target|upstream|endpoint|proxy|forward|route|fallback|override|apigw|x-goog-|l5d-|bypass|guardrail|amz|x-ms-|azureml|extra-parameters|envoy|helicone|litellm|cf-aig|cf-access|beta|version/;function uJ(l){if(/\r(?!\n)/.test(l))return!0;return l.split(/\n|\r\n/).some((A)=>{let L=A.indexOf(":");if(L===-1)return!1;let x=A.slice(0,L).trim();return!pJ.test(x)||QE(A.slice(L+1))!==null||dJ.test(x.toLowerCase())})}var pJ=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function ph(l,A){let L=l.toUpperCase();return aJ.has(L)||fJ(L,A)||L==="ANTHROPIC_CUSTOM_HEADERS"&&!uJ(A)}function fJ(l,A){return lJ.has(l)&&o(A)||cJ.has(l)&&U(A)}function nd(){let l=Fe();return l!==void 0&&Se(l)}function fh(){let l=E(),A=l==="wsl"&&!nd()?"linux":l;switch(A){case"unknown":return{platform:A,chain:[]};default:return{platform:A,chain:Pc(A)}}}var mh="anthropic-skills";var mJ=[/^agent-a[0-9a-f]{16}$/,/^agent-a[0-9a-f]{7}$/,/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/];var phe=[...mJ,/^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 Eh=/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/,Ahe=new RegExp(Eh,"g");var hh=String.raw`[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*\.?`,Ra="[A-Za-z0-9._-]+",od="[A-Za-z0-9._~-]",gJ=`${od}+(?::${od}*)?@`,_J=":[1-9][0-9]{0,4}",EJ=`(?:/(?:${od}|%[0-9A-Fa-f]{2})*)*`,Phe=new RegExp(`^${Ra}/${Ra}$`),xhe=new RegExp(`^git@(${hh}):(${Ra}(?:/${Ra})*)/?$`),Sh=`(?:${gJ})?(${hh})(?:${_J})?(${EJ})$`,Nhe=new RegExp(`^https://${Sh}`),khe=new RegExp(`^https?://${Sh}`),vhe=`ssh.${dn}`;var hJ="inline",$he=`${mh}@${hJ}`;var yh="builtin";function Oh(l){let A=l.toLowerCase();return sa(A)?A:l}function rd(l){return l.normalize("NFC").toLowerCase()}var Hr=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function Ah(l,A,L){if(!t(l))return[];let x=[];for(let{alias:z,canonical:W}of Hr){if(!(z in l))continue;if(l[z]===null){if(!(W in l)&&L?.loneNullAlias==="rename")l[W]=null;delete l[z];continue}if(W in l&&l[W]!==null)x.push({file:A,path:z,message:`"${z}" is an alias for "${W}" and this file sets both; the "${z}" value was ignored. Use only "${W}".`,severity:"warning",alias:z,canonical:W});else l[W]=l[z];delete l[z]}return x}var OJ=["enabled","enabledPlatforms"],Ps="network.allowedDomains",AJ=new Set(["OTEL_LOG_MANAGED_SETTINGS"]);function Rh(l){if(!l)return{shellSettings:{},envVars:{},sandboxSettings:{},isolationSettings:{},hasHooks:!1,payloadSlots:{}};let A=[["top",l],...xs(l),...xs(l).map(([ne])=>[ne,{slotPresent:!0}]),...an.map((ne)=>[`policyHelpers.${ne}`,{outputBehavior:Bo(l,`policyHelpers.${ne}.outputBehavior`)}])],L=Th(l,A),x=CJ(l,A);bJ([L,...x.map(([,ne])=>ne)]);let z={};for(let[ne,ce]of x){let Te={shellSettings:ce.hasHooks?{...ce.shellSettings,hooks:eo(ce.hooks)}:ce.shellSettings,envVars:ce.envVars,sandboxSettings:ce.sandboxSettings,isolationSettings:ce.isolationSettings};if(Ih(Te))z[ne]=Te}let{sandboxSwitches:W,...Z}=L;return{...Z,payloadSlots:z}}function Th(l,A){let L={},x;for(let Ie of ch){let Be=l[Ie];if(Ie==="policyHelpers"){if(Be!==null&&typeof Be==="object")for(let qe of an){let He=xJ(Be[qe]);if(He){if(L[`policyHelpers.${qe}`]=He.command,He.scriptSize)x??={},x[`policyHelpers.${qe}`]=He.scriptSize}}continue}let ke;if(typeof Be==="string")ke=Be;else if(Be!==null&&typeof Be==="object"&&"command"in Be&&typeof Be.command==="string")ke=Be.command;if(ke!==void 0&&ke.length>0)L[Ie]=ke}let z=FJ(l);if(z&&typeof z==="object")for(let[Ie,Be]of Object.entries(z)){let ke=Be?.pluginDigests;if(ke!==void 0&&ke!==null&&Object.keys(ke).length>0)L[`extraKnownMarketplaces[${n(Ie)}].pluginDigests`]=eo({pluginDigests:ke,arming:UJ(A,Ie,ke)});let qe=Be?.source;if(!qe||typeof qe!=="object")continue;if(qe.source==="url"&&typeof qe.headersHelper==="string"&&qe.headersHelper.length>0)L[`extraKnownMarketplaces[${n(Ie)}].source.headersHelper`]=bh(qe.headersHelper,"url",qe.url);if(qe.source==="settings"&&Array.isArray(qe.plugins)){let He=new Map;for(let rt of qe.plugins){let We=n(rt?.name),nt=He.get(We)??0;He.set(We,nt+1);let it=rt?.source;if(it!==null&&typeof it==="object"&&"source"in it&&it.source==="command"&&"command"in it&&typeof it.command==="string"&&it.command.length>0)L[`extraKnownMarketplaces[${n(Ie)}].plugins[${n(rt.name)}][${nt}].source.command`]=it.command;if(typeof rt?.headersHelper==="string"&&rt.headersHelper.length>0){let mt=rt.source,Lt=mt!==null&&typeof mt==="object";L[`extraKnownMarketplaces[${n(Ie)}].plugins[${n(rt.name)}][${nt}].headersHelper`]=bh(rt.headersHelper,Lt&&"source"in mt?mt.source:void 0,Lt&&"url"in mt?mt.url:void 0)}}}}let W=l.sandbox,Z={},ne={enabled:Bo(W,"enabled"),enabledPlatforms:Bo(W,"enabledPlatforms"),[Ps]:Bo(W,Ps)};if(W!==null&&typeof W==="object"){let Ie={enabled:ne.enabled,enabledPlatforms:ne.enabledPlatforms};for(let Be of td){let ke=vJ(W[Be]);if(ke)L[`sandbox.${Be}`]=eo({value:ke,...Ie})}for(let Be of dh){let ke=Bo(W,Be);if(RJ(Be,ke))Z[`sandbox.${Be}`]=eo({value:ke,...Ie,...wh.has(Be)&&{allowedDomains:Ph(ne[Ps])}})}}let ce=l.isolation,Te={};for(let Ie of uh){let Be=Bo(ce,Ie);if(TJ(Ie,Be))Te[`isolation.${Ie}`]=eo({value:Be})}let Le={};if(l.env&&typeof l.env==="object")for(let[Ie,Be]of Object.entries(l.env)){if(Be===void 0)continue;let ke=String(Be);if(ke.length>0&&!AJ.has(Ie.toUpperCase())&&!ph(Ie,ke))Le[Ie]=ke}let we=l.hooks!==void 0&&l.hooks!==null&&typeof l.hooks==="object"&&Object.keys(l.hooks).length>0;return{shellSettings:L,inlineHelperScriptSizes:x,envVars:Le,sandboxSettings:Z,isolationSettings:Te,hasHooks:we,hooks:we?l.hooks:void 0,sandboxSwitches:ne}}function CJ(l,A){return xs(l).map(([L,x])=>[L,Th(x,A)])}function xs(l){let A=[];for(let L of Lh){let x=`policyHelpers.${L}`,z=Bo(l,x);if(!O(z))continue;let{policyHelper:W,policyHelpers:Z,...ne}=z;A.push([x,ne])}return A}function Dh(l){return an.find((A)=>l===`policyHelpers.${A}.defaultSettings`)}function bJ(l){let A=l.map((x)=>Object.keys(x.sandboxSettings).length>0||td.some((z)=>x.shellSettings[`sandbox.${z}`]!==void 0)),L=l.map((x)=>[...wh].some((z)=>x.sandboxSettings[`sandbox.${z}`]!==void 0));l.forEach((x,z)=>{if(A.some((W,Z)=>W&&Z!==z))for(let W of OJ){let Z=x.sandboxSwitches[W];if(Z!==void 0)x.sandboxSettings[`sandbox.${W}`]=eo({value:Z})}if(L.some((W,Z)=>W&&Z!==z)){let W=x.sandboxSwitches[Ps];if(W!==void 0)x.sandboxSettings[`sandbox.${Ps}`]=eo({value:Ph(W)??W})}})}var Lh=[...an.map((l)=>`${l}.defaultSettings`),"default"];function sd(l){let A=[];for(let L of Lh){let x=`policyHelpers.${L}`,z=l.payloadSlots[x];if(z!==void 0&&Ih(z))A.push([x,z])}return A}function Ih(l){return Object.keys(l.shellSettings).length>0||Object.keys(l.envVars).length>0||Object.keys(l.sandboxSettings).length>0||Object.keys(l.isolationSettings).length>0}var wh=new Set(["credentials","network.tlsTerminate"]);function Ph(l){return Array.isArray(l)?S(l.filter((A)=>typeof A==="string")).sort():void 0}function Bo(l,A){let L=l;for(let x of A.split(".")){if(L===null||typeof L!=="object")return;L=L[x]}return L}function RJ(l,A){if(A===void 0||A===null||A===!1)return!1;if(Array.isArray(A)&&A.length===0)return!1;return!(l==="credentials"&&LJ(A))}function TJ(l,A){if(A===void 0||A===null)return!1;switch(l){case"required":return A!==!1;case"egress":return!O(A)||Object.entries(A).some(([L,x])=>DJ.has(L)?x!==void 0&&x!==null&&!(Array.isArray(x)&&x.length===0):x!==void 0)}}var DJ=new Set(["allowedHosts","deniedHosts"]);function LJ(l){if(typeof l!=="object"||l===null)return!1;return Object.entries(l).every(([A,L])=>{if(L===void 0)return!0;if(A==="files"||A==="envVars")return Array.isArray(L)&&L.every((x)=>typeof x==="object"&&x!==null&&x.mode==="deny");if(A==="sigv4")return typeof L==="object"&&L!==null&&Object.values(L).every((x)=>x===void 0||x==="deny");return A==="allowPlaintextInject"&&L===!1})}function IJ(l){return Object.keys(l.shellSettings).some(wJ)}function wJ(l){return an.some((A)=>l===`policyHelpers.${A}`)}function xh(l){return IJ(l)||Object.keys(l.shellSettings).some((A)=>A.startsWith("extraKnownMarketplaces["))||sd(l).length>0}function PJ(l){return l==="sh"||l==="pwsh"}function xJ(l){if(l===null||typeof l!=="object")return;let{path:A,script:L,interpreter:x,timeoutMs:z,refreshIntervalMs:W}=l,Z,ne;if(typeof A==="string"&&A)Z=A;else if(typeof L==="string"&&L&&PJ(x))Z={interpreter:x,script:kJ(L)},ne=NJ(L);else return;return{command:n([Z,z??null,W??null]),scriptSize:ne}}function NJ(l){return{bytes:Buffer.byteLength(l,"utf8"),lines:Rt(l,`
`)+(l.endsWith(`
`)?0:1)}}function kJ(l){return _e(n(l))}function vJ(l){if(typeof l==="string")return l||void 0;if(l===null||typeof l!=="object"||!("command"in l)||typeof l.command!=="string"||!l.command)return;let A="args"in l&&Array.isArray(l.args)?l.args.map(String):[];return n([l.command,...A])}function MJ(l){return eo(Nh(l))}function Nh(l){return{shellSettings:l.shellSettings,envVars:l.envVars,sandboxSettings:Object.keys(l.sandboxSettings).length>0?l.sandboxSettings:void 0,...Ch(l),hooks:l.hooks,payloadSlots:sd(l).length>0?Object.fromEntries(sd(l).map(([A,L])=>{let{isolationSettings:x,...z}=L;return[A,{...z,...Ch(L)}]})):void 0}}function Ch(l){return Object.keys(l.isolationSettings).length>0?{isolationSettings:l.isolationSettings}:{}}function UJ(l,A,L){let x=new Set(Object.keys(L).map((z)=>rd(`${z}@${A}`)));return l.flatMap(([z,W])=>["enabledPlugins","prependPlugins","appendPlugins","managedSourcesBehavior","outputBehavior","slotPresent"].flatMap((Z)=>{let ne=W[Z],ce=Z==="enabledPlugins"?O(ne):Array.isArray(ne);if(ne===void 0)return[];if(!ce)return[[z,`${Z}:whole`,ne]];return(O(ne)?Object.entries(ne).toSorted():[ne].flat().map((Le)=>[Le])).filter(([Le])=>typeof Le!=="string"||x.has(rd(Le))).map((Le)=>[z,Z,...Le])}))}function eo(l){return n(ms(l))}function kh(l){return _e(MJ(l))}function vh(l,A,L){if(kh(A)===l)return!0;return typeof L==="string"&&L.length>0&&_e(eo({...Nh(A),claudeMd:L}))===l}function bh(l,A,L){return n([l,typeof A==="string"?A:null,typeof L==="string"?L:null])}var HJ=new Set(["dns","unix","ipv4","ipv6"]),OSe=new Set([...HJ,"http","https","ws","wss","ftp","file","grpc","grpcs","otlp","xds","tcp","udp","tls","h2","h2c","http2"]);function Mh(l){return l.replace(/[^\x20-\x7e]/gu,"?")}function FJ(l){let A=l.extraKnownMarketplaces;if(A!==void 0&&A!==null)return A;let L=l;for(let{alias:x,canonical:z}of Hr){if(z!=="extraKnownMarketplaces")continue;let W=L[x];if(W!==void 0&&W!==null&&typeof W==="object")return W}return}var GJ="remote-settings.json",WJ=5000;var Wh="remote-settings-helper-consent";function jJ(){return Gh(y(),Wh)}function KJ(l){let A=Rh(l);return xh(A)?A:void 0}function $J(l){let A=xo(l,(L,x)=>x.startsWith("$")&&x!=="$schema");if(Object.keys(A).length!==Object.keys(l).length)jh.set(A,l);return A}function Uh(l){return jh.get(l)??l}var jh=new WeakMap;class Kh{sessionCache=null;storedAccountReader=null;storedCopyGateCovers=!0;storedCopyOrgPin={kind:"unreadable"};mayHideDialog=()=>!1;writesForHiddenDialog=()=>!1;seededUnjudged=null;storedCopyTrust="not_asked";storedCopyRefusal=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;hybridLeftOut=null;lastLoadStatus=void 0;loadCycleEnded=!1;loadCycleBegun=!1;loadBackstopReleased=!1;lastLoadStatusChanged=a();policySettingsNotified=!1;verifiedPayload=null;verifiedByGateway=void 0;unverifiedView=null;projectedView=null;projectedParse=null;consentedPayload=null;deferredPayload=null;resetEpoch=0;backendView=void 0;coworkCloudHolds={};heldSoFar(l){let A=Object.keys(this.coworkCloudHolds).length>0;if(!A&&!Jn())return l;if(l!==null){let L=bl(this.coworkCloudHolds,l);return this.coworkCloudHolds=Di(L),L}return A?this.coworkCloudHolds:null}replaceSessionCache(l,A){let L=A?.verified===!0||!Jn();if(!L&&l!==null&&l===this.sessionCache)return;let x=this.heldSoFar(L?qJ(l):null);if(this.sessionCache=x,A?.verified){if(this.seededUnjudged=null,this.verifiedPayload=x,this.verifiedByGateway=bt()?.url,this.projectedView=null,this.projectedParse=null,A.consentDeferred)this.deferredPayload=x}}seedFromDisk(l){let A=Object.keys(this.coworkCloudHolds).length>0?bl(this.coworkCloudHolds,l):l;this.sessionCache=A,this.seedConsentBaseline(A)}seedConsentBaseline(l){let A=KJ(l);if(A!==void 0){let L=n9();if(L===void 0||!vh(L,A,l.claudeMd))return}this.consentedPayload??=l}markConsented(l){this.consentedPayload=l}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(l,A){if(this.eligible=l,A.memoize)this.eligibilityMemo=l,this.ineligibleReason=l?void 0:A.ineligibleReason}resetListener=null;registerResetListener(l){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=l}reset(){this.sessionCache=null,this.storedCopyTrust="not_asked",this.storedCopyRefusal=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.hybridLeftOut=null,this.lastLoadStatus=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.deferredPayload=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(l){try{this.lastLoadStatusChanged.emit(l)}catch(A){e(`Remote settings: load-status listener threw: ${u(A)}`,{level:"error"})}}}var VJ=new s(()=>new Kh);function Cn(){return VJ.of(C().host)}function Ta(){return Ym()||(!Et()&&!yt()||$m())&&Cn().mayHideDialog()}function $h(){return Cn().lastLoadStatus}function Fr(){return}function YJ(){return Cn().evalPolicySnapshotOnly}var yye=new s(()=>new Map);var Oye=new s(()=>({value:!0}));function id(){return f()||YJ()}function Vh(l){let{projectedView:A,projectedParse:L}=Cn();return l!==null&&(A?.view===l||L?.view===l||XJ(l))}function XJ(l){return Jn()&&Object.keys(l).length>0&&Dn(Di(l),l)}var JJ=[["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["isolation","required"]],Yh=[{path:["sandbox","credentials","files"],names:"path"},{path:["sandbox","credentials","envVars"],names:"name"}];function Xh(l){for(let L of JJ)Yt(l,L,void 0);for(let{path:L,names:x}of Yh){let z=Wt(l,L),W=(Array.isArray(z)?z:[z]).flatMap((Z)=>t(Z)&&typeof Z[x]==="string"?[{[x]:Z[x],mode:"deny"}]:[]);Yt(l,L,W.length>0?W:void 0)}for(let L of[["permissions","deny"],["permissions","ask"]]){let x=Wt(l,L);if(Array.isArray(x)){let z=x.filter((W)=>typeof W!=="string"||!cs.test(W));Yt(l,L,z)}}for(let{path:L,restrictive:x}of zn()){let z=Wt(l,L),W=L[0]==="strictPluginOnlyCustomization"?z:kr(z);if(x===!0&&W===!1)Yt(l,L,void 0)}let A=l.strictPluginOnlyCustomization;if(Array.isArray(A)&&!A.some((L)=>Ds.includes(L)))delete l.strictPluginOnlyCustomization;if(l.availableModelsMatch==="prefix")delete l.availableModelsMatch}function Jh(l){let A={...zc(l)};if(Xh(A),l.parentSettingsBehavior==="merge")A.parentSettingsBehavior="merge";let L=Object.fromEntries([...Tf,yr].flatMap((W)=>Object.entries(l.pluginConfigs?.[W]?.options??{}))),x=Cl({pluginConfigs:{[yr]:{options:L}}});if(x!==void 0)A.pluginConfigs=x;let z=Object.entries(l.enabledPlugins??{}).filter(([W,Z])=>Z===!1&&!(W.includes("@")&&Oh(W.slice(W.lastIndexOf("@")+1))===yh));return z.length===0?A:{...A,enabledPlugins:Object.fromEntries(z)}}function Hh(l){if(!l||!id())return l;let A={...zc(l)};if(f()){if(Xh(A),l.fastMode===!1)A.fastMode=!1;if(l.fastModePerSessionOptIn===!0)A.fastModePerSessionOptIn=!0;let L=Object.entries(t(l.skillOverrides)?l.skillOverrides:{}).flatMap(([x,z])=>z==="off"?[[x,"off"]]:[]);if(L.length>0)A.skillOverrides=Object.fromEntries(L);if(l===Cn().verifiedPayload){if(typeof l.claudeMd==="string"&&l.claudeMd!=="")A.claudeMd=l.claudeMd;for(let[x,z]of Object.entries(VE(l.autoMode).lists))Yt(A,["autoMode",x],z)}}return{...A,managedSourcesBehavior:"merge"}}function ZJ(){return mg(()=>Jn()||en.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST&&Sf.has(en.CLAUDE_CODE_ENTRYPOINT??"")||as())}function Zh(){return Fr()??Gh(y(),GJ)}var qh=8388608;function qJ(l){if(l===null||!Jn())return l;let A=Di(l);return Dn(A,l)?l:A}function QJ(){if(ZJ())return null;let l=Cn(),A=l.storedCopyRefusal;if(A!==null&&Ta()&&Date.now()-A.atMs<WJ)return l.storedCopyTrust={trusted:!1,reason:A.reason},null;l.storedCopyTrust="not_asked",l.storedCopyRefusal=null;try{let L=o9();if(L===null)return null;let x=_(se(L));if(!x||typeof x!=="object"||Array.isArray(x))return null;let z=$J(x);return e9(z)?z:null}catch(L){if(Fp(L))e(`Remote settings: Disk cache exceeds ${qh} bytes; ignoring it as if absent`);return null}}function e9(l){let A=Cn();if(!Ta()||!A.storedCopyGateCovers||Fr()!==void 0||A.evalPolicySnapshotOnly)return A.storedCopyTrust="not_asked",!0;let L=A.storedCopyOrgPin;if(L.kind==="read"){let z=Fh(l,L.orgs);if(z.trusted)return A.storedCopyTrust=z,!0;return Bh(l,z.reason,Ll(z.reason)),!1}let x=l.forceRemoteSettingsRefresh===!0?Fh(l,void 0):void 0;return Bh(l,"org_pin_unknown",x!==void 0&&(x.trusted||Ll(x.reason))),!1}function Fh(l,A){try{return lg({kind:"managed-settings",cachePath:Zh(),body:Uh(l),bodySha:Xm(Uh(l)),account:Cn().storedAccountReader?.(),pinnedOrgs:A,nowMs:Date.now(),roots:pg()})}catch(L){return e(`Remote settings: the gate on a stored copy failed: ${u(L)}`,{level:"error"}),{trusted:!1,reason:"error"}}}function Bh(l,A,L){let x=Cn();x.storedCopyTrust={trusted:!1,reason:A},x.storedCopyRefusal={atMs:Date.now(),reason:A,forcesRefresh:L&&l.forceRemoteSettingsRefresh===!0},x.seedConsentBaseline(l),e(`Remote settings: the stored copy is not trusted at rest (${A}); treating it as absent`)}var t9=4096;function n9(){let l=ad();if(l!==void 0)return l.attestation;if(f())return;try{return fo(jJ(),t9).trim()||void 0}catch{return}}function o9(){let l=ad();if(l!==void 0)return l.content;if(f()&&Fr()===void 0)return null;return fo(Zh(),qh)}function ad(){let l=Cn().backendView;if(!c()||l===void 0||!l.ready||l.stoodDown||Fr()!==void 0)return;if(!vt(l.configHome)){l.standDown("config home changed");return}return l}var Aye=ie.state("remote-settings"),Cye=ie.state(Wh);var r9=new Set([...lh,"CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","NODE_OPTIONS",...$c,...Yc,"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",...Qc,...ws,...ed,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...Xc,"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((l)=>l.toUpperCase()));function s9(l){if(!l||!l.env&&!("managedMcpServers"in l))return l;let{managedMcpServers:A,...L}=l;return l.env?{...L,env:xo(l.env,(x,z)=>r9.has(z.toUpperCase()))}:L}function Qh(){let l=tS();if(l===null||id()||eS(Cn(),l))return!1;if(zh(l))return!0;let A=xs(l);if(A.length===0)return!1;let{chain:L}=fh();return A.some(([x,z])=>{let W=Dh(x);return(W===void 0||L.includes(W))&&zh(z)})}function zh(l){let A=l.managedMcpServers;return t(A)&&Object.keys(A).length>0}function eS(l,A){return A===l.verifiedPayload||Boolean(Fr())}function tS(){let l=Cn();if(!Fr()&&l.eligible!==!0)return l.heldSoFar(null);if(l.sessionCache){if(l.sessionCache!==l.seededUnjudged||!Ta())return l.sessionCache;l.sessionCache=null,l.seededUnjudged=null,dt()}let A=ad()!==void 0,L=QJ();if(L){if(l.seedFromDisk(L),l.seededUnjudged=Ta()?null:l.sessionCache,A)V().invalidatePolicyLayer();else dt();return l.sessionCache}return l.heldSoFar(null)}function nS(l){let A=tS(),L=Cn(),x=eS(L,A)?A:i9(L,A);if(x===null||!id())return x;if(L.projectedView?.raw!==x)L.projectedView={raw:x,view:Hh(x)};let z=L.projectedView.view;if(!l)return z;if(L.projectedParse?.raw!==x){let W={...z};if(oS(W,Hh(l(x))??{}),f())for(let{path:Z,names:ne}of Yh){let ce=[z,W].flatMap((Te)=>Wt(Te,Z)??[]);if(ce.length>0)Yt(W,Z,Km(ce,ne))}L.projectedParse={raw:x,view:W}}return L.projectedParse.view}function oS(l,A){for(let[L,x]of Object.entries(A)){let z=l[L];if(z!==x&&t(z)&&t(x)){let W={...z};oS(W,x),l[L]=W}else l[L]=x}}function i9(l,A){if(A===null)return null;if(l.unverifiedView?.raw!==A)l.unverifiedView={raw:A,view:s9(A)};return l.unverifiedView.view}var a9=d(new Set,(l)=>l.clear());function rS(l){a9.add(l)}import{constants as l9}from"fs";var c9=process.platform==="darwin"?16777216:process.platform==="linux"||process.platform==="android"?524288:0,Lye=process.platform==="darwin"?536870912:0,Iye=process.platform==="linux"||process.platform==="android"?2097152:0,wye=process.platform==="linux"||process.platform==="android"?l9.O_NOATIME??0:0;var Wye=d({noFollowAny:"untried",localVolumes:void 0},(l)=>{l.noFollowAny="untried",l.localVolumes=void 0});var jye=Symbol("no procfs"),Kye=Symbol("descriptor path unreadable");var $ye=Symbol("boundRead.linkToNothing");var Br=["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 d9={opus:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnet:"ANTHROPIC_DEFAULT_SONNET_MODEL",haiku:"ANTHROPIC_DEFAULT_HAIKU_MODEL",fable:"ANTHROPIC_DEFAULT_FABLE_MODEL"},u9=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL"],sS=[...Br,"AWS_REGION","AWS_PROFILE",...u9,"AWS_BEARER_TOKEN_BEDROCK",...Jc,"ANTHROPIC_VERTEX_PROJECT_ID","CLOUD_ML_REGION","ANTHROPIC_FOUNDRY_RESOURCE"],qye=[...sS,"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",...ws],iS=[...Br,"AWS_BEARER_TOKEN_BEDROCK","AWS_REGION","AWS_DEFAULT_REGION","AWS_PROFILE","CLOUD_ML_REGION","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_BEDROCK_SERVICE_TIER"],aS=[...sS,"ANTHROPIC_BEDROCK_SERVICE_TIER",...Object.values(d9),"ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_CUSTOM_HEADERS"];var p9=["ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_FOUNDRY_RESOURCE","AWS_ENDPOINT_URL_BEDROCK_RUNTIME","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL"],f9=new Set(["AWS_ENDPOINT_URL_BEDROCK_RUNTIME","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL"]);function lS(l,A){let L=new Set([...Br,"CLAUDE_CODE_USE_GATEWAY"]),x=new Set([...p9,"ANTHROPIC_BASE_URL"]),z=A?.CLAUDE_CODE_USE_BEDROCK==="1";return Object.entries(l??{}).some(([W,Z])=>{let ne=W.toUpperCase();return L.has(ne)&&o(Z)||x.has(ne)&&Z.trim()!==""&&(z||!f9.has(ne))})}function cS(l,A,L){if(l===A)return 0;let x=l.length,z=A.length,W=L+1;if(Math.abs(x-z)>L)return W;let Z=new Int32Array(z+2).fill(W),ne=new Int32Array(z+2).fill(W),ce=new Int32Array(z+2).fill(W);for(let Te=0;Te<=Math.min(z,L);Te++)ne[Te]=Te;for(let Te=1;Te<=x;Te++){let Le=Math.max(1,Te-L),we=Math.min(z,Te+L);ce[Le-1]=Le===1?Math.min(Te,W):W;let Ie=ce[Le-1];for(let Be=Le;Be<=we;Be++){let ke=Math.min(ne[Be]+1,ce[Be-1]+1,ne[Be-1]+(l[Te-1]===A[Be-1]?0:1),W);if(Te>1&&Be>1&&l[Te-1]===A[Be-2]&&l[Te-2]===A[Be-1])ke=Math.min(ke,Z[Be-2]+1);ce[Be]=ke,Ie=Math.min(Ie,ke)}if(ce[we+1]=W,Ie>L)return W;[Z,ne,ce]=[ne,ce,Z]}return ne[z]}var dS=["claude-3-5-haiku","claude-3-5-sonnet","claude-3-7-sonnet","claude-fable-5","claude-fable-5-1","claude-haiku-4-5","claude-haiku-5-5","claude-mythos-5","claude-mythos-5-1","claude-opus-4-0","claude-opus-4-1","claude-opus-4-5","claude-opus-4-6","claude-opus-4-7","claude-opus-4-8","claude-opus-5","claude-opus-5-5","claude-sonnet-4-0","claude-sonnet-4-5","claude-sonnet-4-6","claude-sonnet-5","claude-sonnet-5-5"],uS=["sonnet","opus","haiku","fable","best","sonnet[1m]","opus[1m]","fable[1m]","opusplan"],Ao=["sonnet","opus","haiku","fable"];function Da(l){return uS.includes(l)}function ld(l){return l.replace(/\[1m\]$/i,"")}function pS(l){return l.replace(/\[(1|2)m\]/gi,"")}function zo(l){return Ao.includes(l)}function to(l){let A=l.trim().toLowerCase();if(A===""||/\s/.test(A))return null;A=A.replace(/\[[12]m\]$/,"");let L=A.lastIndexOf("/");if(L!==-1)A=A.slice(L+1);let x=/^(?:([a-z-]+)\.)?anthropic\.(claude-.*)$/.exec(A);if(x){let[,ne,ce=""]=x;if(ne!==void 0&&!Np.includes(ne))return null;A=ce}let z=g9(A);if(!z)return null;let W=A.slice(z.base.length);if(W!==""&&!/^[-@]/.test(W))return null;let Z={family:z.family,major:z.major,legacyVersionFirst:z.legacyVersionFirst,base:z.base};if(z.minor!==void 0)Z.minor=z.minor;if(!m9(W))Z.trailer=W;else{let ne=/(?:-v\d+@|[-@])(\d{8})/.exec(W)?.[1];if(ne!==void 0)Z.date=ne}return Z}function m9(l){return/^(?:-fast|-latest)?(?:-v\d{1,3}@\d{8}|[-@]\d{8})?(?:-v\d{1,3}(?::\d{1,3})?)?$/.test(l)}function fS(l,A){return l.major-A.major||(l.minor??0)-(A.minor??0)}function g9(l){let A=/^claude-([a-z]+)-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?/.exec(l);if(A){let[x,z="",W="",Z]=A;return{family:z,major:Number(W),minor:Z===void 0?void 0:Number(Z),legacyVersionFirst:!1,base:x}}let L=/^claude-(\d{1,2})(?!\d)(?:-(\d{1,2})(?!\d))?-([a-z]+)/.exec(l);if(L){let[x,z="",W,Z=""]=L;return{family:Z,major:Number(z),minor:W===void 0?void 0:Number(W),legacyVersionFirst:!0,base:x}}return null}function bn(l){let A=l.replace(/[\u0000-\u001f\u007f-\u009f]/g,"?");return A.length>128?`${A.slice(0,128)}…`:A}function _9(){let l=[...Ao],A=l.pop();return l.length===0?A??"":`${l.join(", ")} or ${A}`}function La(l){return l.charAt(0).toUpperCase()+l.slice(1)}function mS(l){let A=l.trim().toLowerCase(),L=pS(A).trim(),x=L!==A?" Context-size tags such as [1m] are ignored: the entry blocks the model at every context size.":"";if(L==="")return{entry:null,warning:"An empty deniedModels entry was ignored."};if(zo(L))return{entry:{kind:"family",family:L},...x!==""&&{warning:`"${bn(l)}" blocks every ${La(L)} model.${x}`}};if(Da(L)||L==="default")return{entry:null,warning:`"${bn(l)}" was ignored: it names a different model depending on the release and settings. Name the model instead, for example "claude-opus-5-5".`};let z=to(L),W=z!==null||L.startsWith("claude-")?L:`claude-${L}`,Z=z??(W!==L?to(W):null);if(Z){let ne=W.lastIndexOf(Z.base),ce=ne===-1?"":W.slice(ne+Z.base.length),Te=Z.trailer===void 0&&ce!==""?` "${bn(ce)}" is ignored.`:"";return{entry:{kind:"model",id:Z},...(x!==""||Te!=="")&&{warning:`"${bn(l)}" blocks ${E9(Z)}.${Te}${x}`}}}return{entry:{kind:"literal",value:L},warning:h9(l,L)}}function E9(l){let A=La(l.family);return l.minor===void 0?`every ${A} ${l.major}.x model`:`${A} ${l.major}.${l.minor} in every spelling and snapshot`}function h9(l,A){let L=`"${bn(l)}" blocks only the exact model name "${bn(A)}"; other spellings of the same model are not blocked.`,x=A.replace(/(\d)\.(\d)/g,"$1-$2");if(x!==A){let W=x.startsWith("claude-")?x:`claude-${x}`;if(to(W)!==null)return`${L} To block a version, write it with a hyphen: "${bn(W)}".`}let z=new RegExp(`^(${Ao.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(A);if(z){let[,W,Z,ne]=z;return ne!==void 0?`${L} To block a version, write its model ID, for example "claude-${W}-${Z}-${ne}".`:`${L} To block only version ${Z}, write "claude-${W}-${Z}-0"; "claude-${W}-${Z}" blocks every ${La(W)} ${Z}.x model.`}if(/^[a-z]+$/.test(A)){let W=Ao.find((Z)=>cS(A,Z,1)===1);return W!==void 0?`${L} If you meant the ${La(W)} family, write "${W}".`:`${L} To block a model family other than ${_9()}, list its versioned IDs.`}return L}function gS(l){let A=ld(l.trim().toLowerCase());if(A==="")return{kind:"ignored"};if(zo(A))return{kind:"family",family:A};let L=A.startsWith("claude-")?A.slice(7):"";if(zo(L))return{kind:"family",family:L};if(Da(A)||A==="default")return{kind:"ignored"};let x=to(A)!==null||A.startsWith("claude-")?A:`claude-${A}`,z=to(x);return z!==null?{kind:"model",id:z,latest:y9(x,z),spelling:x}:{kind:"literal",value:A}}function S9(l,A){let L=l.toLowerCase(),x=L.lastIndexOf(A.base);return x===-1?"":L.slice(x+A.base.length)}function y9(l,A){return A.trailer===void 0&&S9(l,A).startsWith("-latest")}function O9(l,A){for(let L of A){if(zo(L))continue;let x=L.indexOf(l);if(x===-1)continue;let z=x+l.length;if(z===L.length||L[z]==="-")return!0}return!1}function A9(l){return l.charAt(0).toUpperCase()+l.slice(1)}function _S(l){let A;for(let L of dS){let x=to(L);if(x!==null&&x.family===l&&!x.legacyVersionFirst&&(A===void 0||fS(x,A)>0))A=x}return A?.base}function ES(l,A){let L=gS(l);switch(L.kind){case"ignored":{if(l.trim()==="")return"An empty availableModels entry was ignored.";let x=_S("opus");return`"${bn(l)}" in availableModels was ignored, because "availableModelsMatch" is "exact" and this name means a different model depending on the release and settings. List the model IDs you want to allow instead${x===void 0?"":`, for example "${x}"`}.`}case"family":{let x=A.filter((W)=>gS(W).kind!=="ignored").map((W)=>ld(W.trim().toLowerCase()));if(zo(l.trim().toLowerCase())&&O9(L.family,x))return;let z=_S(L.family);return`"${bn(l)}" in availableModels allows every ${A9(L.family)} model, including future releases, even though "availableModelsMatch" is "exact". To allow only some versions, list their model IDs instead${z===void 0?"":`, for example "${z}"`}.`}case"model":return;case"literal":return C9(l,L.value)}}function C9(l,A){let L=`"${bn(l)}" in availableModels allows only a model named exactly "${bn(A)}".`,x=A.replace(/(\d)\.(\d)/g,"$1-$2");if(x!==A){let W=x.startsWith("claude-")?x:`claude-${x}`;if(to(W)!==null)return`${L} To allow a version, write it with a hyphen: "${bn(W)}".`}let z=new RegExp(`^(${Ao.join("|")})\\s+(\\d+)(?:\\.(\\d+))?$`).exec(A);if(z){let[,W,Z,ne]=z;return`${L} To allow a version, write its model ID, for example "claude-${W}-${Z}${ne!==void 0?`-${ne}`:""}".`}return}function b9(l){return l!==void 0&&(l.commit!==void 0||l.pr!==void 0)}function hS(l,A){let L=l?.commitTrailers;if(typeof L==="boolean")return L?"explicit-enabled":"disabled";if(l!==void 0&&b9(l))return l.commit===""?"disabled":"implicit-enabled";if(A!==void 0)return A?"implicit-enabled":"disabled";return}var R9=["allowManagedMcpServersOnly","allowedMcpServers","deniedMcpServers","disabledMcpjsonServers","enabledMcpjsonServers","enableAllProjectMcpServers","disableClaudeAiConnectors","managedMcpServers"];function Ia({slot:l,adminTiers:A}){return l?.allowManagedMcpServersOnly===!0||A.some((L)=>L.allowManagedMcpServersOnly===!0)}function cd({slot:l,adminTiers:A}){return l?.allowedMcpServers??A.find((L)=>L.allowedMcpServers!==void 0)?.allowedMcpServers}function SS(l,A){return R9.filter((L)=>l[L]!==void 0&&!T9(L,l,A))}function T9(l,A,L){let x=L.slot??{};switch(l){case"deniedMcpServers":return!0;case"allowManagedMcpServersOnly":return A.allowManagedMcpServersOnly===Ia(L);case"disableClaudeAiConnectors":return A.disableClaudeAiConnectors===(x.disableClaudeAiConnectors===!0||L.adminTiers.some((z)=>z.disableClaudeAiConnectors===!0));case"allowedMcpServers":return Dn(A.allowedMcpServers,Ia(L)?cd(L):x.allowedMcpServers);case"disabledMcpjsonServers":return(A.disabledMcpjsonServers??[]).every((z)=>x.disabledMcpjsonServers?.includes(z)===!0);case"enabledMcpjsonServers":return(A.enabledMcpjsonServers??[]).every((z)=>x.enabledMcpjsonServers?.includes(z)===!0);case"enableAllProjectMcpServers":return(A.enableAllProjectMcpServers??!1)===(x.enableAllProjectMcpServers??!1);case"managedMcpServers":{let z=x.managedMcpServers??{};return Object.entries(A.managedMcpServers??{}).every(([W,Z])=>Object.hasOwn(z,W)&&Dn(z[W],Z))}}}import{userInfo as D9}from"os";var yS="com.anthropic.claudecode",wa="HKLM\\SOFTWARE\\Policies\\ClaudeCode",Pa="HKCU\\SOFTWARE\\Policies\\ClaudeCode",Ns="Settings",ud="/usr/bin/plutil",OS=["-convert","json","-o","-","--"],AS=["-lint","-s","--"],CS=5000,xa=2097152,Co="/mnt/c/Windows/System32/reg.exe",bS="unable to find the specified registry key or value",un="/mnt/c/Program Files/ClaudeCode",dd=d({isCoworkCloud:void 0},(l)=>{l.isCoworkCloud=void 0});function pd(){if(dd.isCoworkCloud===void 0){let l=process.env.CLAUDE_CODE_ENTRYPOINT;dd.isCoworkCloud=is.some((A)=>A===l)}return dd.isCoworkCloud}function ks(){if(process.platform!=="linux")return!1;let l=pd();if(process.env.WSL_DISTRO_NAME&&!l)return!0;try{let A=Gt("fs").readFileSync("/proc/version","utf8").toLowerCase();return Se(A)}catch{return!1}}function RS(){let l="";try{l=D9().username}catch{}let A=[];if(l)A.push({path:`/Library/Managed Preferences/${l}/${yS}.plist`,label:"per-user managed preferences"});return A.push({path:`/Library/Managed Preferences/${yS}.plist`,label:"device-level managed preferences"}),A}var TS=512;function fd(l){return l.map(L9)}function L9(l){let{file:A,severity:L,docLink:x,statusOnly:z,startupFatal:W,loadedWithoutGuardHook:Z,errorClass:ne,errno:ce,preserveOnWrite:Te,mcpErrorMetadata:Le,userWritable:we,wslIgnored:Ie,substituted:Be,onlySubstitutes:ke,removal:qe,path:He,message:rt,expected:We,suggestion:nt,invalidValue:it,...mt}=l,Lt=mt;return{file:A,severity:L,docLink:x,statusOnly:z,startupFatal:W,loadedWithoutGuardHook:Z,errorClass:ne,errno:ce,preserveOnWrite:Te,mcpErrorMetadata:Le,userWritable:we,wslIgnored:Ie,substituted:Be,onlySubstitutes:ke,removal:qe,path:vs(He),message:vs(rt),expected:We===void 0?void 0:vs(We),suggestion:nt===void 0?void 0:vs(nt),invalidValue:typeof it==="string"?vs(it):void 0}}function vs(l){let A=Mh(l.replace(/\s+/gu," "));return A.length>TS?`${A.slice(0,TS-1)}…`:A}function DS(l,A){if(A===null)return l;let L=[...A.values];return{settings:rn(cn(l.settings,L.filter(([,x])=>x===void 0).map(([x])=>x)),w(Object.fromEntries(L.filter(([,x])=>x!==void 0))),(x,z)=>z),errors:[...l.errors,...A.errors]}}import{globalRegistry as xOe,toJSONSchema as NOe}from"zod/v4";import{$ZodCheck as vOe,$ZodLazy as MOe}from"zod/v4/core";var no="https://code.claude.com/docs/en",I9=[{matches:(l)=>l.path==="permissions.defaultMode"&&l.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${no}/iam#permission-modes`}},{matches:(l)=>l.path==="apiKeyHelper"&&l.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(l)=>l.path==="cleanupPeriodDays"&&l.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:(l)=>l.path.startsWith("env.")&&l.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${no}/settings#environment-variables`}},{matches:(l)=>(l.path==="permissions.allow"||l.path==="permissions.deny")&&l.code==="invalid_type"&&l.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(l)=>l.path==="hooks"&&l.code==="unrecognized_keys",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${no}/hooks`}},{matches:(l)=>/\.hooks\.\d+\.command$/.test(l.path)&&l.code==="invalid_type"&&l.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${no}/hooks#exec-form-and-shell-form`}},{matches:(l)=>l.path.includes("hooks")&&l.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(l)=>l.code==="invalid_type"&&l.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(l)=>l.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${no}/settings`}},{matches:(l)=>l.code==="invalid_value"&&l.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(l)=>l.code==="invalid_type"&&l.expected==="object"&&l.received===null&&l.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(l)=>l.path==="permissions.additionalDirectories"&&l.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${no}/iam#working-directories`}}],w9={permissions:`${no}/iam#configuring-permissions`,env:`${no}/settings#environment-variables`,hooks:`${no}/hooks`};function LS(l){let A=I9.find((x)=>x.matches(l));if(!A)return null;let L={...A.tip};if(l.code==="invalid_value"&&l.enumValues&&!L.suggestion)L.suggestion=`Valid values: ${l.enumValues.map((x)=>`"${x}"`).join(", ")}`;if(!L.docLink&&l.path)L.docLink=w9[De(l.path,".")];return L}var mAe=Ke(()=>Nc(vr(),{strictPolicyHelperKeys:!0}).strict());function IS(l){return l.code==="invalid_type"}function wS(l){return l.code==="invalid_value"}function P9(l){return l.code==="unrecognized_keys"}function PS(l){return l.code==="too_small"}var x9='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 kS(l){return l.map((A)=>A.severity!=="warning"&&A.message.includes(Qn)?{...A,message:A.message.replace(Qn,()=>x9),loadedWithoutGuardHook:!0}:A)}function pn(l){if(l===null)return"null";if(l===void 0)return"undefined";if(Array.isArray(l))return"array";return typeof l}function xS(l){let A=l.match(/received (\w+)/);return A?A[1]:void 0}function Ms(l,A){return l.issues.flatMap((x)=>{if(x.code!=="invalid_union"||x.path.join(".")!=="attribution")return[x];let z=x.errors.flat().filter((W)=>W.path.length>0);return z.length>0?z.map((W)=>({...W,path:[...x.path,...W.path]})):[x]}).map((x)=>{let z=x.path.map(String).join("."),W=x.message,Z,ne,ce,Te,Le;if(wS(x))ne=x.values.map((Ie)=>String(Ie)),ce=ne.join(" | "),Te=void 0,Le=void 0;else if(IS(x)){ce=x.expected;let Ie=xS(x.message);Te=Ie??pn(x.input),Le=Ie??pn(x.input)}else if(PS(x))ce=String(x.minimum);else if(x.code==="custom"&&"params"in x)Te=x.params.received,Le=Te;let we=LS({path:z,code:x.code,expected:ce,received:Te,enumValues:ne,message:x.message,value:Te});if(wS(x))Z=ne?.map((Ie)=>`"${Ie}"`).join(", "),W=`Invalid value. Expected one of: ${Z}`;else if(IS(x)){let Ie=xS(x.message)??pn(x.input);if(x.expected==="object"&&Ie==="null"&&z==="")W="Invalid or malformed JSON";else W=`Expected ${x.expected}, but received ${Ie}`}else if(P9(x)){let Ie=x.keys.join(", ");W=`Unrecognized ${K(x.keys.length,"field")}: ${Ie}`}else if(PS(x))W=`Number must be greater than or equal to ${x.minimum}`,Z=String(x.minimum);return{file:A,path:z,message:W,expected:Z,invalidValue:Le,suggestion:we?.suggestion,docLink:we?.docLink}})}function N9(l,A,L){if(!l||typeof l!=="object")return[];let x=l;if(!x.permissions||typeof x.permissions!=="object")return[];let z=x.permissions,W=[],Z=new Map;for(let ne of["allow","deny","ask"]){let ce=z[ne];if(!Array.isArray(ce))continue;let Te=ce.filter((Le)=>{if(typeof Le!=="string")return W.push({file:A,path:`permissions.${ne}`,message:`Non-string value in ${ne} array was removed`,severity:"warning",invalidValue:Le}),!1;let we=Oc(Le,ne);if(!we.valid){let Ie=`Invalid permission rule "${Le}" was skipped: ${we.error}`;if(we.suggestion)Ie+=`. ${we.suggestion}`;return W.push({file:A,path:`permissions.${ne}`,message:Ie,severity:"warning",invalidValue:Le}),!1}return!0});if(L?.policySource&&ne!=="allow"&&ce.length>0&&Te.length===0){if(!L.strictParseFollows)continue;Z.set(ne,"unreadable")}else if(Te.length<ce.length)Z.set(ne,"trimmed");z[ne]=Te}return Uc("permissions",z,(ne)=>Z.get(ne),(ne)=>W.push({file:A,path:ne.path,message:ne.message,severity:"warning",...ne.substituted&&{substituted:ne.substituted}})),W}var k9=new Set(N);function v9(l,A){if(!l||typeof l!=="object")return[];return[...s_(l,i_)?[{file:A,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${Qn}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...M9(l,A)]}function M9(l,A){if(!("hooks"in l))return[];if(l.hooks===null||typeof l.hooks!=="object"||Array.isArray(l.hooks)){let z=pn(l.hooks);if(Array.isArray(l.hooks)&&(l.hooks.some(t)||$l(l.hooks)))return[{file:A,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${z} — ${Qn}.`,invalidValue:z,docLink:"https://code.claude.com/docs/en/hooks"}];return delete l.hooks,[{file:A,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${z}. This field was ignored.`,severity:"warning",invalidValue:z,docLink:"https://code.claude.com/docs/en/hooks"}]}let L=l.hooks;if(ra(L))return[{file:A,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${Qn}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let x=[];for(let z of Object.keys(L)){let W=Pe(z);if(!k9.has(z)){if(vo(L[z],3,{matchersCount:!Array.isArray(L[z])})){x.push({file:A,path:`hooks.${W}`,message:`"${W}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${Qn}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete L[z],x.push({file:A,path:`hooks.${W}`,message:`Unknown hook event "${W}" was ignored. Valid events: ${N.join(", ")}`,severity:"warning",invalidValue:W,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(L[z])){let Z=L[z],ne=pn(Z);if(As.has(z)&&Z!==null||vo(Z,3,{matchersCount:!1})){x.push({file:A,path:`hooks.${W}`,message:`Hook event "${W}" must be an array of matchers; received ${ne} — ${Qn}.`,invalidValue:ne,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete L[z],x.push({file:A,path:`hooks.${W}`,message:`Hook event "${W}" must be an array of matchers; received ${ne}. This entry was ignored.`,severity:"warning",invalidValue:ne,docLink:"https://code.claude.com/docs/en/hooks",...Z!==null&&{preserveOnWrite:!0}})}}for(let[z,W]of Object.entries(L)){let{stripped:Z,unloadableGuards:ne}=l_(W,z);for(let ce of ne)x.push({file:A,path:ce.aboutType?`hooks.${z}.${ce.path}.type`:`hooks.${z}.${ce.path}`,message:`${ce.problem} — ${Qn}.${ce.aboutType?` Valid types: ${[...oa()].join(", ")}`:""}`,severity:"fatal",invalidValue:ce.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let ce of Z)x.push({file:A,path:ce.aboutType?`hooks.${z}.${ce.path}.type`:`hooks.${z}.${ce.path}`,message:ce.aboutType?`${ce.problem}; entry ignored. Valid types: ${[...oa()].join(", ")}`:`${ce.problem}; ${ce.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:ce.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(x.length>0&&Object.keys(L).length===0)delete l.hooks;return x}var U9=[{key:"allowedMcpServers",schema:Ea},{key:"deniedMcpServers",schema:ha}];function H9(l,A,L){if(!l||typeof l!=="object")return[];let x=l,z=[];for(let{key:W,schema:Z}of U9){if(!(W in x))continue;if(!Array.isArray(x[W])){if(L?.keepWholeFieldInvalid)continue;let Te=x[W];delete x[W],z.push({file:A,path:W,message:`"${W}" must be an array; received ${pn(Te)}. This field was ignored.`,severity:"warning",invalidValue:Te});continue}let ne=x[W],ce=[];for(let Te=0;Te<ne.length;Te++){let Le=Z().safeParse(ne[Te]);if(Le.success)ce.push(ne[Te]);else z.push({file:A,path:`${W}[${Te}]`,message:`Invalid entry was ignored: ${Le.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:ne[Te]})}if(ce.length<ne.length)x[W]=ce}return z}var F9=["strictKnownMarketplaces","blockedMarketplaces"];function B9(l){if(!t(l))return;for(let A of Oa())if(l[A]===null)delete l[A]}function z9(l,A,L){if(!t(l))return[];let x=[];for(let z of F9){let W=l[z];if(!Array.isArray(W))continue;let Z=[],ne=[];for(let ce=0;ce<W.length;ce++){let Te=bs().safeParse(W[ce]);if(!Te.success){Z.push(W[ce]),ne.push(ce);continue}let Le=Mc(Te.data);if(Le===null){Z.push(W[ce]),ne.push(ce);continue}if(z==="blockedMarketplaces"){Z.push(W[ce]),ne.push(ce),x.push({file:A,path:`${z}[${ce}]`,message:`Unenforceable entry was kept: ${Le}; it can never match a marketplace source, but marketplace restrictions stay active`,severity:"warning"});continue}x.push({file:A,path:`${z}[${ce}]`,message:`Invalid entry was ignored: ${Le}`,severity:"warning"})}if(Z.length<W.length)l[z]=Z,L?.set(z,ne)}return x}function G9(l,A){if(!t(l)||l.managedMcpServers===void 0)return[];let x=[],z=ea(l.managedMcpServers,(W,Z)=>x.push({file:A,path:W?`managedMcpServers.${W}`:"managedMcpServers",message:W?`Managed MCP server was ignored: ${Z}`:Z,severity:"warning"}));if(z===void 0)delete l.managedMcpServers;else l.managedMcpServers=z;return x}function W9(l){if(!l||typeof l!=="object")return;let A=l.source;if(!A||typeof A!=="object")return;let L=A.source;return typeof L==="string"?L:void 0}function j9(l){if(!l||typeof l!=="object")return!1;let A=l.source;if(!A||typeof A!=="object")return!1;let L=A.plugins;return Array.isArray(L)&&L.some(gc)}function K9(l,A){if(!l||typeof l!=="object")return[];let L=l,x="extraKnownMarketplaces";if(!(x in L))return[];let z=L[x];if(!z||typeof z!=="object"||Array.isArray(z)){let ne=pn(z);return delete L[x],[{file:A,path:x,message:`"${x}" must be an object mapping marketplace names to declarations; received ${ne}. This field was ignored.`,severity:"warning",invalidValue:ne}]}let W=z,Z=[];for(let ne of Object.keys(W)){let ce=Dc().safeParse(W[ne]),Te,Le=!1;if(!ce.success){let we=W9(W[ne]);if(we!==void 0&&!Z_.has(we)||j9(W[ne]))continue;Te=la(ce.error.issues)}else if(ce.data.source.source==="settings"&&ce.data.source.name!==ne)Te=`key "${Gn(ne)}" must match the settings source name "${Gn(ce.data.source.name)}"`;if(Te!==void 0)Z.push({file:A,path:`${x}.${Gn(ne)}`,message:Le?"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: ${Te}`,severity:"warning",...Le&&{preserveOnWrite:!0}}),delete W[ne]}return Z}function $9(l,A){if(!l||typeof l!=="object")return[];let L=l,x="modelPicker";if(!(x in L))return[];let z=L[x];if(!t(z)||!Array.isArray(z.options)){let ce=t(z)?`options: ${pn(z.options)}`:pn(z);return delete L[x],[{file:A,path:x,message:`"${x}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${ce}. This field was ignored.`,severity:"warning",invalidValue:ce}]}let W=[];if("replaceBuiltInOptions"in z&&typeof z.replaceBuiltInOptions!=="boolean"){let ce=pn(z.replaceBuiltInOptions);delete z.replaceBuiltInOptions,W.push({file:A,path:`${x}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${ce}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:ce})}let Z=z.options,ne=[];for(let ce=0;ce<Z.length;ce++){let Te=wc().safeParse(Z[ce]);if(Te.success){ne.push(Z[ce]);continue}W.push({file:A,path:`${x}.options.${ce}`,message:`${Y9(Te.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:pn(Z[ce])})}if(ne.length!==Z.length)z.options=ne;return W}function V9(l,A){if(!l||typeof l!=="object"||Array.isArray(l))return[];let L=l;if(!("modelPricing"in L)||L.modelPricing===void 0)return[];let x=L.modelPricing;if(!x||typeof x!=="object"||Array.isArray(x))return delete L.modelPricing,[{file:A,path:"modelPricing",message:`"modelPricing" must be an object; received ${pn(x)}. It was ignored.`,severity:"warning"}];let z=x,W=[];if(z.multiplier!==void 0&&!Ic().safeParse(z.multiplier).success)W.push({file:A,path:"modelPricing.multiplier",message:'"multiplier" must be a number greater than 0 and at most 10. It was ignored.',severity:"warning",invalidValue:z.multiplier}),delete z.multiplier;if(z.overrides!==void 0){let Z=z.overrides;if(!Z||typeof Z!=="object"||Array.isArray(Z))W.push({file:A,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${pn(Z)}. It was ignored.`,severity:"warning"}),delete z.overrides;else{let ne=Z;for(let ce of Object.keys(ne)){let Te=Lc().safeParse(ne[ce]);if(Te.success&&ce!=="constructor"&&ce!=="__proto__")continue;let Le=Te.success?void 0:Te.error.issues[0];W.push({file:A,path:`modelPricing.overrides.${Gn(ce)}`,message:`Invalid pricing row was ignored (${Le?`${Le.path.join(".")||"row"}: ${Le.message}`:"not a model ID"}).`,severity:"warning",invalidValue:ne[ce]}),delete ne[ce]}}}return W}function Y9(l){if(!l)return"Invalid modelPicker row";return`modelPicker row ${l.path.length>0?`"${l.path.join(".")}" `:""}${l.message}`.trim()}function X9(l,A,L){if(!l||typeof l!=="object"||Array.isArray(l))return[];let x=l,z=x.crossSessionInbound;if(z===void 0||J9(z))return[];if(L?.policySource)x.crossSessionInbound="refuse";else delete x.crossSessionInbound;return[Q9(z,A,L?.policySource===!0)]}function J9(l){return typeof l==="string"&&Ls.includes(l)}var Z9="crossSessionInbound";function q9(l){let A=Ls.map((x)=>`"${x}"`).join(", "),L=typeof l==="string"?`"${Gn(l).replace(/^<key>$/,"<value>")}"`:pn(l);return`must be one of ${A}; received ${L}`}function Q9(l,A,L=!1){let x=Ls.map((W)=>`"${W}"`).join(", "),z=L?'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:A,path:Z9,message:`"crossSessionInbound" ${q9(l)}. ${z}`,severity:"warning",expected:x,...L&&{statusOnly:!0}}}var NS="remoteControl.shareHostProfile";function e8(l,A,L){if(!t(l)||l.remoteControl===void 0)return[];let x=L?.policySource===!0,z=_a.map((Ie)=>`"${Ie}"`).join(", "),W=x?'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.",Z=(Ie)=>({file:A,path:NS,message:`${Ie}. ${W}`,severity:"warning",expected:z,...x?{statusOnly:!0}:{preserveOnWrite:!0}}),ne=(Ie)=>typeof Ie==="string"?`"${Gn(Ie).replace(/^<key>$/,"<value>")}"`:pn(Ie),ce=l.remoteControl;if(!t(ce)){if(x)l.remoteControl={shareHostProfile:"off"};else delete l.remoteControl;return[Z(`"remoteControl" must be an object like { "shareHostProfile": ${z.replace(/, /g," | ")} }; received ${ne(ce)}`)]}let Te=[],Le=Object.keys(ce).filter((Ie)=>Ie!=="shareHostProfile");if(Le.length>0){if(x)ce.shareHostProfile="off";Te.push(Z(`"remoteControl" has an unrecognized key ${Le.map((Ie)=>`"${Gn(Ie)}"`).join(", ")} (its only key is "shareHostProfile")`))}let we=ce.shareHostProfile;if(we!==void 0&&!(typeof we==="string"&&_a.includes(we))){if(x)ce.shareHostProfile="off";else delete ce.shareHostProfile;Te.push(Z(`"${NS}" must be one of ${z}; received ${ne(we)}`))}return Te}var t8=["enabledMcpjsonServers","disabledMcpjsonServers"],n8=/^[A-Za-z0-9_-]+$/;function o8(l){if(!t(l))return;for(let A of t8){let L=l[A];if(typeof L==="string"&&n8.test(L))l[A]=[L]}}function Us(l,A,L){let x=[...Ah(l,A)];if(B9(l),!L?.policySource)o8(l);return x.push(...N9(l,A,{policySource:L?.policySource,strictParseFollows:L?.mcpServerEntrySalvageOnly}),...v9(l,A),...K9(l,A),...$9(l,A),...V9(l,A),...X9(l,A,{policySource:L?.policySource}),...e8(l,A,{policySource:L?.policySource}),...L?.skipMcpServerEntryFilter?[]:H9(l,A,{keepWholeFieldInvalid:L?.mcpServerEntrySalvageOnly}),...L?.mcpServerEntrySalvageOnly?G9(l,A):[],...L?.mcpServerEntrySalvageOnly?z9(l,A,L.marketplacePatternIndexMapOut):[]),x}function Sd(l){let A=new Set(l.allowedSources);return A.add("flagSettings"),A.add("policySettings"),Bt.filter((L)=>A.has(L))}function a8(){return tn(go(),"managed-settings.json")}function MS(l){return l.map((A)=>{let{invalidValue:L}=A,x=L!==void 0&&L!==null,z=x?Je(L):void 0,W=z===void 0?void 0:R(z);return{...A,path:R(A.path),message:R(A.message),...A.expected!==void 0&&{expected:R(A.expected)},...A.suggestion!==void 0&&{suggestion:R(A.suggestion)},...x&&(z===void 0||typeof L==="string"||W!==z)&&{invalidValue:W}}})}function yd(l){if(l.diskless)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};let A,L=(We)=>{if(We===oy)return!0;return A??=l.asksOrganization?.()===!0,A&&We()},x=!1,z={},W=new Set,Z=HS(l,(We,nt,it)=>{if(We.settings===null){if(!L(it))return We;return Ge.forEach((mt)=>W.add(mt)),{...We,errors:MS(We.errors)}}if(!L(it))return Object.assign(z,_o(We.settings,Oo)),We;return x=!0,{...We,settings:{},errors:MS(We.errors)}});if(!x)return W.size===0?Z:{...Z,lostSignInPins:[...W]};let ne=[],ce=[],Te=HS(l,(We,nt,it)=>{if(We.settings===null||!L(it))return{...We,settings:We.settings&&{},errors:[]};let mt=l8(We,We.settings,nt);for(let Lt of Ge)if(We.settings[Lt]!==void 0&&mt.settings?.[Lt]===void 0)W.add(Lt);return ne.push([nt,Object.keys(mt.settings??{})]),ce.push(...mt.errors.slice(We.errors.length)),mt}),Le=[...Z.errors,...ce],we=Z.settings??{},Ie=Te.settings??{},Be=!Gr({...Z,settings:we})&&{heldOnly:!0};if(Object.keys(Ie).length===0)return{...Z,errors:Le,...Be,lostSignInPins:[...W]};let ke=Object.keys(we).length===0,qe={...ke?Ie:cn(va([we,Ie],"merge",!1,0).admin,"parentSettingsBehavior"),..._o(we,"parentSettingsBehavior"),...z},He=qe,rt=we;for(let[We,nt]of ne)for(let it of nt)if(it in rt&&Dn(He[it],rt[it]))Le.push({file:We,path:R(it),message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${R(it)}" was ignored in ${R(We)}, since another managed settings document sets it and this one adds nothing to it.`,severity:"warning",statusOnly:!0,userWritable:!0});return{...ke?Te:Z,settings:qe,errors:Le,...Be,lostSignInPins:[...W],...!Yr(we)&&{onlyHeldContent:!0},settingsNotHeld:we,heldOffPlugins:Object.keys(Ie.enabledPlugins??{}).filter((We)=>we.enabledPlugins?.[We]===void 0),heldAllowLists:Td.filter((We)=>Ie[We]!==void 0&&we[We]===void 0)}}function l8(l,A,L){let x=Jh(A),z=c8(A,x).map((W)=>({...W,key:R(W.key)}));if(z.length===0)return l;if(!US.has(L))US.add(L),e(`${R(L)}: not taken as written: ${z.map(({key:W})=>W).join(", ")}: this session takes its managed settings from its organization, and a managed settings file may only restrict there`,{level:"warn"});return{...l,settings:x,errors:[...l.errors,...z.filter(({key:W})=>!Ro(W)).map(({key:W,became:Z})=>({file:L,path:W,message:`In a cloud session that takes its managed settings from your organization, a managed settings file may only restrict: "${W}" ${Z} in ${R(L)}.`,severity:"warning",statusOnly:!0,userWritable:!0}))]}}function c8(l,A){let L=(x,z)=>z==="disableAllHooks"&&l.disableAllHooks===!0&&A.allowManagedHooksOnly===!0?'was taken as "allowManagedHooksOnly"':z==="allowManagedHooksOnly"&&x===!0?'was set by "disableAllHooks"':x===void 0?"was ignored":"was kept in part";return Object.keys(l).flatMap((x)=>{let z=l[x],W=A[x];if(Dn(z,W))return[];if(!t(z)||!t(W))return[{key:x,became:L(W,x)}];return Object.keys(z).filter((Z)=>!Dn(z[Z],W[Z])).map((Z)=>({key:`${x}.${Z}`,became:L(W[Z],x)}))})}function ny(l){return E()==="wsl"&&(!l||nd())}var US=d(new Set,(l)=>l.clear());function HS(l,A){let L=l.mdm?.()?.heldDocuments??[];if(ny(l.asksOrganization?.()===!0)){let x=jo(Cd({...l,file:()=>({settings:null,errors:[]})}));if(l.wslInherits?.()){let z=L.length===0?void 0:x||jo(Hs(un,l.store)),W=Hs(un,l.store,A,z?L:[]);if(z??(jo(W)||x))return W;let Z=Hs(go(),l.store,A,L);return{...Z,errors:[...W.errors,...Z.errors],loadState:Wn(W.loadState,Z.loadState)}}if(x)return Hs(null,l.store,A,L)}return Hs(go(),l.store,A,L)}var oy=()=>!0;function md(l,A,L){L.push(...A.errors);let{settings:x}=A;if(!x||Object.keys(x).length===0)return;for(let[z,W]of Aa){let Z=z.split(".");if(Wt(x,Z)===void 0)continue;let ne=A.errors.find((Le)=>Le.substituted&&Le.path===z),ce=ne!==void 0,Te=Wt(l.merged,Z);if(ce&&Te!==void 0&&!l.floors.has(z)){let Le=Z.at(-1);if(W.inert.has(W.read(Te))){km(x,Z),L.push({file:ne.file,path:z,message:`That substitute is not applied: "${Le}" keeps the value an earlier managed-settings document of this folder wrote.`,severity:"warning",statusOnly:!0});continue}L.push({file:ne.file,path:z,message:`That substitute also displaces the wider "${Le}" an earlier managed-settings document of this folder wrote, until this document is fixed.`,severity:"warning",statusOnly:!0})}if(ce)l.floors.add(z);else l.floors.delete(z)}if(l.merged=rn(l.merged,x,In),l.found=!0,Yr(x)&&!A.errors.some((z)=>z.onlySubstitutes))l.authored=!0}function Od(l){return l.endsWith(".json")&&!l.startsWith(".")}function d8(l){return(l.isFile()||l.isSymbolicLink())&&Od(l.name)}function FS(l,A,L,x){let z=l.managedFileProtections,W={file:x,folder:l.managedDocumentLinks.folderIsLink.get(A)===!1?z.folderOwners.get(A):void 0,posix:E()!=="windows"&&!L.startsWith(un)};return z.note(L,pt({...W,linked:l.managedDocumentLinks.isLinked(L)})),()=>Ad(l,L,W.file,W.folder)}function Ad(l,A,L,x){let z=process.geteuid?.(),W=process.getuid?.();if(ny(!0)&&(A===Co||A.startsWith(`${un}${i8}`)))return BS;if(z===0||W===0)return!0;if(E()==="windows"||z===void 0)return BS;let ne=l.managedDocumentLinks.linkOf(A),ce={uids:W===void 0||W===z?[z]:[z,W],groups:()=>[...process.getgroups?.()??[],...process.getegid?[process.getegid()]:[],...process.getgid?[process.getgid()]:[]]};if(yl(ce,L,ne===null?x:L)!==!1||ne?.kind==="unverified")return!0;let Le=l.policy.writableNow??=new Map,we=Le.get(A)??Sl(A);if(Le.set(A,we),we!=="no")return!0;let Ie=l.policy.walkedDocuments??=new Map,Be=Ie.get(A)??gf(A,ce,l.policy.certainDirectories??=new Map);return Ie.set(A,Be),Be}var BS=!1;function zS(l,A,L,x){let z=l.managedDocumentLinks;z.noteWalked(tn(A,...L),()=>cf(A,L,x,z.folderIsLink,l.managedFileProtections.folderOwners))}function Hs(l,A,L=(z)=>z,x=[]){let z=[],W={merged:{},found:!1,authored:!1,floors:new Set},Z=!1,ne="absent";for(let{path:we,parsed:Ie}of x)md(W,L(Ie,we,oy),z),Z||=Wr(Ie),ne=Wn(ne,bo(Ie));if(l===null)return GS(W,z,Z,ne,A);let ce=jr(tn(l,"managed-settings.json"),A,void 0,!0),Te=()=>!1;if(bo(ce)!=="absent")zS(A,l,["managed-settings.json"]),Te=FS(A,$t(l),tn(l,"managed-settings.json"),ce.fileOwner);md(W,L(ce,tn(l,"managed-settings.json"),Te),z),Z||=Wr(ce),ne=Wn(ne,bo(ce));let Le=tn(l,"managed-settings.d");try{let we=A.folderListingForPolicyWalk(Le),Ie,Be;if(we!==void 0)Ie=we;else{let ke=i().readdirSync(Le).filter(d8);Ie=ke.map((qe)=>qe.name).sort(),Be=new Set(ke.filter((qe)=>!qe.isFile()).map((qe)=>qe.name)),A.noteWalkListing(Le,Ie)}for(let ke of Ie){let qe=jr(tn(Le,ke),A,void 0,!0),He=()=>!1;if(bo(qe)!=="absent")zS(A,l,["managed-settings.d",ke],Be?.has(ke)),He=FS(A,Le,tn(Le,ke),qe.fileOwner);md(W,L(qe,tn(Le,ke),He),z),Z||=Wr(qe),ne=Wn(ne,bo(qe))}}catch(we){let Ie=r(we);if(Ie!=="ENOENT"&&Ie!=="ENOTDIR")e(`managed-settings.d read failed: ${we}`,{level:"error"}),z.push(Gs(Le,we,"directory")),ne="didNotLoad",L({settings:null,errors:[]},Le,()=>!0)}return GS(W,z,Z,ne,A)}function GS(l,A,L,x,z){let W=l.found&&Vr(l.merged)?l.merged:null;if(W?.forceLoginOrgUUID!==void 0)z.managedFileProtections.setsOrgPin=!0;return{settings:W,errors:A,documentHasPolicyContent:L,loadState:x,...W!==null&&!l.authored&&Yr(W)&&{onlySubstitutes:!0}}}function u8(l,A){if(g(l))y8(A);else e(R(`settings file read failed at ${A}: ${l}`),{level:"error"})}function jr(l,A,L,x){let z=L!==void 0?`${l}\x00pinned`:l,W=A.parsedFiles.get(z);if(W)return{...W,settings:W.settings?w(W.settings):null};let Z=E8(l,L,x);return A.parsedFiles.set(z,Z),{...Z,settings:Z.settings?w(Z.settings):null}}function Cd(l){let A=l.mdm?.();if(!A)return{settings:null,errors:[],documentHasPolicyContent:!1,loadState:"absent"};return{settings:A.settings&&Object.keys(A.settings).length>0?A.settings:null,errors:C8(A,()=>bd(l),()=>l.file?.()??yd(l)),documentHasPolicyContent:Wr(A),loadState:bo(A),...A.onlySubstitutes&&{onlySubstitutes:A.onlySubstitutes}}}function Bs(l,A){let L=jS.get(l),x=L?.get(A);if(x)return WS(x);let z=p8(l,A);if(L)L.set(A,z);else jS.set(l,new Map([[A,z]]));return WS(z)}function WS(l){return{settings:l.settings&&w(l.settings),errors:l.errors.map((A)=>({...A})),documentHasPolicyContent:l.documentHasPolicyContent,loadState:l.loadState,removed:l.removed,...l.onlySubstitutes&&{onlySubstitutes:l.onlySubstitutes}}}var jS=new WeakMap;function p8(l,A){let L=w(l),x=Us(L,A,{skipMcpServerEntryFilter:!0,policySource:!0}),z=[],W=Bc(ay(A,z),A,L).safeParse(L);if(!W.success)return{settings:null,errors:[...x,...Ms(W.error,A)],documentHasPolicyContent:!1,loadState:"didNotLoad",removed:[]};let Z=[...hy(x,W.data,z),...z],ne=l,ce=Object.keys(W.data).length>0?W.data:null;return{settings:ce,errors:Z,documentHasPolicyContent:yy(l,W.data),loadState:"loaded",removed:Object.keys(ne).filter((Te)=>ry(Te,ne[Te])&&W.data[Te]===void 0&&Z.every((Le)=>Le.statusOnly||Le.path!==Te&&!Le.path.startsWith(`${Te}.`))),...ce!==null&&z.some((Te)=>Te.onlySubstitutes)&&{onlySubstitutes:!0}}}function ry(l,A){let L=Oa();return L.includes(l)||Hr.some(({alias:x,canonical:z})=>x===l&&L.includes(z))?Fc(l,A):Ca(l)&&sy(l,A)}function sy(l,A){return A===null||t(A)&&Object.keys(A).length>0&&Object.entries(A).every(([L,x])=>{let z=`${l}.${L}`;return Fc(z,x)||Ca(z)&&sy(z,x)})}function Ro(l){return Ol()&&(l==="managedMcpServers"||l.startsWith("managedMcpServers."))}var Ba=["managedMcpServers","isolation","attributionProjectPolicy"],f8=[...Ba,"deniedModels","availableModelsMatch"];function iy(l,A){if(!t(l))return[];let L=[];for(let x of f8){if(!(x in l))continue;if(delete l[x],!Ro(x))L.push({file:A,path:x,message:`"${x}" is only honored from managed settings and was ignored here.`,severity:"warning",preserveOnWrite:!0})}return L}function ay(l,A){return(L)=>{if(Ro(L.path))return;if(A.push({file:l,path:L.path,message:L.message,severity:"warning",...L.statusOnly&&{statusOnly:L.statusOnly},...L.startupFatal&&{startupFatal:L.startupFatal},...L.substituted&&{substituted:L.substituted},...L.onlySubstitutes&&{onlySubstitutes:L.onlySubstitutes},...L.removal&&{removal:L.removal}}),L.statusOnly||L.startupFatal)e(R(`${l}: ${L.path}: ${L.message}`),{level:L.startupFatal?"error":"warn"})}}function bd(l){let A=l?.remote?l.remote():nS((Te)=>Bs(Te,"remote managed settings").settings),L=!l?.remote&&!Ro("managedMcpServers")&&Qh()?[{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}]:[],x=l?.remote?void 0:$h(),z=(x?.state==="stale_cache"||x?.state==="failed")&&x.failure.errorKind==="ruled_empty"?fd(x.failure.rulings??[]):[];if(!A||Object.keys(A).length===0)return{settings:null,errors:[...L,...z],servedSnapshot:!1,documentHasPolicyContent:!1};let{settings:W,errors:Z,documentHasPolicyContent:ne,onlySubstitutes:ce}=Bs(A,"remote managed settings");return{settings:W,errors:[...L,...z,...fd(Z)],servedSnapshot:Vh(A),documentHasPolicyContent:ne,...ce&&{onlySubstitutes:ce}}}var KS="parent managed settings";function m8(l){let A=l.parentManaged;if(!A||Object.keys(A).length===0)return{settings:null,errors:[]};let L=Bs(A,KS);for(let x of Ba)if(L.settings?.[x]!==void 0&&!Ro(x))L.errors.push({file:KS,path:x,message:`"${x}" 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 L}function g8(l){return null}function ly(l){let A=l.flagInline;if(!A)return{settings:null,errors:[]};let L=Ol(),x=l.store.inlineFlagParse;if(x?.inline!==A||x.desktopSupplied!==L)x={inline:A,desktopSupplied:L,parsed:_8(A)},l.store.inlineFlagParse=x;let{settings:z,errors:W}=x.parsed;return{settings:z&&w(z),errors:W.map((Z)=>({...Z}))}}function _8(l){let A=w(l),L=[...iy(A,"SDK inline settings"),...Us(A,"SDK inline settings")],x=ya(A).safeParse(A);if(!x.success)return{settings:null,errors:[...L,...Ms(x.error,"SDK inline settings")]};if(L.some((z)=>z.severity==="fatal"))return{settings:null,errors:L};return{settings:x.data,errors:L}}var zs=2097152;function E8(l,A,L){try{let x;if(A!==void 0)x=A;else{let z=L||h8(l)?ge(i(),l):Dt(i(),l);if(L){let W={};x=fo(z.resolvedPath,zs,(ne)=>{W.owner={uid:ne.uid,gid:ne.gid,mode:ne.mode}});let Z=Ua(x,l,L);return W.owner?{...Z,fileOwner:W.owner}:Z}x=fo(z.resolvedPath,zs)}return Ua(x,l,L)}catch(x){return A8(x,l)}}function Ua(l,A,L){if(l.trim()==="")return{settings:{},errors:[],loadState:"loaded"};let x=wo(l,!1);if(L){if(!t(x))return{settings:null,errors:[za(A)],loadState:"didNotLoad"};let ne=w(x),ce=Us(ne,A,{skipMcpServerEntryFilter:!0,policySource:!0}),Te=[],Le=Bc(ay(A,Te),A,ne).safeParse(ne);if(!Le.success)return{settings:null,errors:[...ce,...Ms(Le.error,A)],documentHasPolicyContent:!1,loadState:"didNotLoad"};return{settings:Le.data,errors:[...hy(ce,Le.data,Te),...Te],documentHasPolicyContent:yy(x,Le.data),loadState:"loaded"}}let z=w(x),W=[...iy(z,A),...Us(z,A)],Z=ya(z).safeParse(z);if(!Z.success){let ne=Ms(Z.error,A);return{settings:null,errors:[...W,...ne]}}if(W.some((ne)=>ne.severity==="fatal"))return{settings:null,errors:W};return{settings:Z.data,errors:W}}function za(l,{userWritable:A=!1}={}){return A?{file:l,path:"",message:`Managed settings document (${l}) could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.`,severity:"warning",statusOnly:!0,userWritable:!0}:{file:l,path:"",message:"Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",startupFatal:!0}}function h8(l){let A=pe();if(A===null)return!1;let L=p(Fa($t(l))),x=$t(A);return L===p(x)||L===S8(x)}var gd;function S8(l){if(gd?.lexical!==l){let A=Fa(l);gd={lexical:l,physical:p(tn(xe(A)??A,s8(l)))}}return gd.physical}function y8(l){e(R(`Broken symlink or missing file encountered for settings.json at path: ${l}`))}function O8(){return{settings:null,errors:[],loadState:"absent"}}function A8(l,A){if(St(l))throw l;if(u8(l,A),g(l))return O8();return{settings:null,errors:[Gs(A,l)],loadState:"didNotLoad"}}function Gs(l,A,L="file"){return{file:l,path:"",message:`${L==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${A instanceof Error?A.message:String(A)}`,severity:"fatal",errorClass:"unreadable",...r(A)!==void 0&&{errno:r(A)}}}function cy(l){return{file:l,path:"wslInheritsWindowsSettings",message:`"wslInheritsWindowsSettings" in ${l} holds a value that cannot be read (it takes true or false) and no Windows administrator policy is deployed beside it (HKLM or ${un}), 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 $S(l){return l.path==="wslInheritsWindowsSettings"&&l.severity==="fatal"}function C8(l,A,L){let x=l.withheldFlagRecord&&L().heldOnly===!0?[...l.errors,l.withheldFlagRecord]:l.errors;if(!x.some($S))return x;if(!Gr(A()))return x;return x.map((z)=>$S(z)?{...z,severity:"warning"}:z)}function VS(l,A){switch(l){case"userSettings":return $t(y());case"policySettings":return $t(Na(A));case"projectSettings":return $t(A.projectConfigDir??Na(A));case"localSettings":{if(A.projectConfigDir!==void 0)return $t(A.projectConfigDir);return dy(Na(A),A.canonicalGitRoot)}case"flagSettings":return A.flagPath?Fa($t(A.flagPath)):$t(Na(A))}}function Na(l){if(l.cwd===null)throw new be;return l.cwd}function dy(l,A){let L=b8(l,A);if(L.decided!==void 0)return L.decided;if(!L8(L.root))return L.cwdResolved;return L.root}function b8(l,A){let L=A?.(l);if(!L)return{decided:$t(l)};let x=$t(L),z=$t(l);if(x===z)return{decided:x};let W;try{W=I8()}catch{return{decided:z}}if(x===W)return{decided:z};return{decided:void 0,root:x,cwdResolved:z}}function R8(l){return V().localStoreProbes.canonicalRootOwnerUids(l,T8)}function T8(l){let A=i(),L=null;try{L=A.lstatSync(tn(l,".claude")).uid}catch(x){if(!g(x))throw x}return{rootUid:A.statSync(l).uid,gitEntryUid:D8(l),claudeEntryUid:L}}function D8(l){let A=i();try{return A.lstatSync(tn(l,".git")).uid}catch(L){throw L}}function L8(l){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return e(`localSettings: not canonicalizing the consent store to ${l} — this platform has no uid semantics to verify directory ownership with, so the store stays at the session cwd (canonicalization is POSIX-only)`,{level:"warn"}),!1;let A=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:L,gitEntryUid:x,claudeEntryUid:z}=R8(l);if(L===A&&x===A&&(z===null||z===A))return!0;return e(`localSettings: not canonicalizing the consent store to ${l} — it (uid ${L}), its .git entry (uid ${x}), or its .claude entry (uid ${z??"absent"}) is not owned by the current user (uid ${A}); 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(L){return e(`localSettings: not canonicalizing the consent store to ${l} — its ownership could not be verified (${L instanceof Error?L.message:String(L)}); the store stays at the session cwd`,{level:"warn"}),!1}}function I8(){return V().localStoreProbes.normalizedRealHomeDir(w8)}function w8(){let l=xe(r8());if(l===null)throw Error("home directory realpath unavailable");return p(l)}var YS={default:"settings.json",cowork:"cowork_settings.json"};function P8(l){if(l.coworkPlugins||en.CLAUDE_CODE_USE_COWORK_PLUGINS)return YS.cowork;return YS.default}function Kr(l,A){switch(l){case"userSettings":return tn(VS(l,A),P8(A));case"projectSettings":case"localSettings":{if(A.diskless||A.cwd===null&&A.projectConfigDir===void 0)return;return tn(VS(l,A),uy(l))}case"policySettings":return a8();case"flagSettings":return A.flagPath}}function uy(l){switch(l){case"projectSettings":return tn(".claude","settings.json");case"localSettings":return tn(".claude","settings.local.json")}}function py(l){if(l.diskless)return;if(l.cwd===null||dy(l.cwd,l.canonicalGitRoot)===$t(l.cwd))return;if(l.projectConfigDir!==void 0)return;return tn($t(l.cwd),uy("localSettings"))}function x8(l,A){let L=A.repoTierFreeze.tier(l);if(L!==void 0)return L.settings;return A.perSource.get(l)}function fy(l,A){let L=x8(l,A.store);if(L!==void 0)return L;let x=c7(l,A),z=x&&Fs(l,x,A);return A.store.perSource.set(l,z),z}function my(l){return(l.parentSettingsBehavior??(as()?"merge":"first-wins"))==="merge"}function N8(l,A=!1){return!l||my(l)||A}var k8=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function v8(l){let A={};for(let{path:L,restrictive:x}of zn()){let z=Wt(l,L);if(L[0]==="sandbox"&&Po(x).includes(z))Yt(A,L,z)}return A.sandbox??{}}function gy(l){let A=l?.disableAllHooks;return A!==void 0&&A!==null&&A!==!1&&A!=="false"}function Ed(l,A,L,x){let z={};if(l.allowManagedHooksOnly===!0||l.disableAllHooks===!0||gy(L))z.allowManagedHooksOnly=!0;if(l.disableSkillShellExecution===!0)z.disableSkillShellExecution=!0;if(A.hooks===void 0&&!Object.values(A.enabledPlugins??{}).some((ne)=>ne!==!1&&ne!==void 0)){if(l.allowedHttpHookUrls?.length===0)z.allowedHttpHookUrls=[];if(l.httpHookAllowedEnvVars?.length===0)z.httpHookAllowedEnvVars=[]}if(l.disableCommandPluginSources===!0)z.disableCommandPluginSources=!0;if(l.disableSideloadFlags===!0)z.disableSideloadFlags=!0;if(l.allowManagedMcpServersOnly===!0)z.allowManagedMcpServersOnly=!0;if(l.disableClaudeAiConnectors===!0)z.disableClaudeAiConnectors=!0;if(l.syncClaudeAiSkills===!1)z.syncClaudeAiSkills=!1;if(l.syncClaudeAiPlugins===!1)z.syncClaudeAiPlugins=!1;if(l.remoteTools?.allowUnattendedServing===!1)z.remoteTools={...z.remoteTools,allowUnattendedServing:!1};if(l.allowManagedPermissionRulesOnly===!0)z.allowManagedPermissionRulesOnly=!0;if(l.disableAutoMode==="disable")z.disableAutoMode="disable";let W=l.remoteControl?.shareHostProfile;if(W==="off"||W==="basic")z.remoteControl={...z.remoteControl,shareHostProfile:W};if(hS(l.attribution,l.includeCoAuthoredBy)==="disabled")z.attribution={...z.attribution,commitTrailers:!1};if(l.attribution?.sessionUrl===!1)z.attribution={...z.attribution,sessionUrl:!1};let Z=l.strictPluginOnlyCustomization;if(Z===!0||Array.isArray(Z)&&Z.length>0)z.strictPluginOnlyCustomization=Z;if(l.deniedMcpServers)z.deniedMcpServers=l.deniedMcpServers;if(l.blockedMarketplaces?.length)z.blockedMarketplaces=l.blockedMarketplaces;if(l.deniedModels&&l.deniedModels.length>0)z.deniedModels=l.deniedModels;if(A.forceLoginOrgUUID===void 0&&l.forceLoginOrgUUID)z.forceLoginOrgUUID=l.forceLoginOrgUUID;for(let ne of zr)if(A[ne]===void 0&&l[ne])Object.assign(z,{[ne]:l[ne]});if(l.enforceAvailableModels===!0)z.enforceAvailableModels=!0;if(l.availableModelsMatch==="exact")z.availableModelsMatch="exact";if(l.permissions){let ne=_o(l.permissions,["deny","ask"]);for(let ce of["deny","ask"]){let Te=ne[ce];if(Te!==void 0)ne[ce]=Te.filter((Le)=>{if(!cs.test(Le))return!0;return e(`Ignoring ${ce} rule "${Le}" from the parent process's managed settings: a rule starting with "!" removes paths from the rules listed before it instead of restricting anything, so it is not merged into the policy rules. Spell the deny without the exception instead.`,{level:"warn"}),!1})}if(l.permissions.disableBypassPermissionsMode==="disable")ne.disableBypassPermissionsMode="disable";if(l.permissions.disableAutoMode==="disable")ne.disableAutoMode="disable";if(l.permissions.blockReadsOutsideWorkingDirectories===!0)ne.blockReadsOutsideWorkingDirectories=!0;if(l.permissions.blockWritesOutsideWorkingDirectories===!0)ne.blockWritesOutsideWorkingDirectories=!0;if(A.allowManagedPermissionRulesOnly!==!0){let{allow:ce,additionalDirectories:Te}=l.permissions;if(ce&&A.sandbox?.network?.allowManagedDomainsOnly!==!0)ne.allow=ce;if(Te)ne.additionalDirectories=Te}if(Object.keys(ne).length>0)z.permissions=ne}if(l.sandbox){let{network:ne,filesystem:ce,credentials:Te}=l.sandbox,Le={},we=ne?_o(ne,["deniedDomains"]):{},Ie=ce?_o(ce,["denyRead","denyWrite"]):{};if(ne){if(A.sandbox?.network?.allowManagedDomainsOnly!==!0&&ne.allowedDomains)we.allowedDomains=ne.allowedDomains}if(Object.keys(we).length>0)Le.network=we;if(ce){if(A.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&ce.allowRead)Ie.allowRead=ce.allowRead}if(Object.keys(Ie).length>0)Le.filesystem=Ie;if(Te){let Be=(Te.files??[]).map((He)=>He.mode==="deny"?{path:He.path,mode:"deny"}:{path:He.path,mode:"mask",injectHosts:[]}),ke=(Te.envVars??[]).filter((He)=>He.mode==="deny").map((He)=>({name:He.name,mode:"deny"})),qe={...Be.length>0&&{files:Be},...ke.length>0&&{envVars:ke}};if(Te.sigv4){let He={};for(let rt of["streaming","presigned","sigv4a"])if(Te.sigv4[rt]==="deny")He[rt]="deny";qe.sigv4=He}{let He=_y(Te.awsPairs??[],[]);if(He.length>0)qe.awsPairs=He}if(Object.keys(qe).length>0)Le.credentials=qe}if(rn(Le,v8(l)),Object.keys(Le).length>0)z.sandbox=Le}return z}function _y(l,A){let L=Eo,x=new Set(A.flatMap(XS));return S(l.flatMap(XS)).filter((z)=>L.includes(z)&&!x.has(z)).map((z,W)=>({accessKeyIdVar:z,secretAccessKeyVar:`${Zi}${W+1}_`}))}function XS(l){if(!t(l))return[];return[l.accessKeyIdVar,l.secretAccessKeyVar,l.sessionTokenVar].filter((A)=>typeof A==="string")}var M8=new Set([...[...Zc].filter((l)=>l!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...qc,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function U8(l,A){if(!A||!l)return null;let L={};if(l.model!==void 0)L.model=l.model;if(l.availableModels!==void 0)L.availableModels=l.availableModels;if(l.availableModelsMatch==="exact"||l.availableModelsMatch!==void 0&&l.availableModels!==void 0)L.availableModelsMatch=l.availableModelsMatch;if(l.enforceAvailableModels!==void 0)L.enforceAvailableModels=l.enforceAvailableModels;if(l.deniedModels!==void 0&&l.deniedModels.length>0)L.deniedModels=l.deniedModels;if(l.fallbackModel!==void 0)L.fallbackModel=l.fallbackModel;if(l.modelPicker!==void 0)L.modelPicker=l.modelPicker;return Object.keys(L).length>0?L:null}function H8(l){let A=[];for(let L of l?.deniedModels??[]){let{warning:x}=mS(L);if(x!==void 0)A.push({file:"managed settings",path:"deniedModels",message:x,severity:"warning",statusOnly:!0})}return A}function F8(l){if(l?.availableModelsMatch!=="exact")return[];let A=l.availableModels??[];return A.flatMap((L)=>{let x=ES(L,A);return x===void 0?[]:[{file:"managed settings",path:"availableModels",message:x,severity:"warning",statusOnly:!0}]})}function JS(l,A){let L=l.deniedModels;if(Object.assign(l,A),L!==void 0&&A.deniedModels!==void 0)l.deniedModels=S([...L,...A.deniedModels])}function ka(l){if(delete l.model,delete l.fallbackModel,delete l.modelPicker,delete l.modelOverrides,l.env){let A={};for(let[L,x]of Object.entries(l.env))if(!M8.has(L.toUpperCase()))A[L]=x;l.env=A}}function B8(l){let A=l.store.policy.allTiers;if(A!==void 0)return A;let L=Z8(l);return l.store.policy.allTiers=L,L}function Wo(){return E()==="macos"?"plist":"hklm"}function Ey(l){let A=Ws(l);if(A.composes==="tier")return"helper";let L=$r(l);if(A.composes==="remoteSlot"||L.present.remote)return"remote";if(L.present.mdm)return Wo();if(L.present.file)return"file";if(L.parentSlice||L.hostModelOverlay)return"parent";let x=l.hkcu?.();return x&&Object.keys(x.settings).length>0?"hkcu":null}function $r(l){let A=[],L=bd(l),{settings:x,servedSnapshot:z}=L;A.push(...L.errors);let W=Ws(l),Z=W.composes==="remoteSlot"?W.helper:Ma(x),ne=Cd(l),ce=ne.settings;A.push(...ne.errors);let Te=Ma(ce),Le=l.file?.()??yd(l),we=Le.settings;A.push(...Le.errors);let Ie=Ma(we),Be=Gr(ne),ke=Gr(Le),qe=ke&&Le.heldOnly===!0,He=l.policyOnlyServerTier?.()==="unconfirmed"&&(Be&&l.mdm?.().userWritable!==!0||ke),rt=He&&Z?j8(Z):Z,We=!He&&(W.composes==="remoteSlot"?rt!==null:Gr(L)),nt=_d(rt,We),it=_d(Te,Be),mt=Le.onlyHeldContent?Sy:_d(Ie,ke),Lt=!He&&rt!==null&&nt>=Math.max(it,mt),kt=Te!==null&&it>=mt,Jt=[[He?null:x,Lt],[ce,kt],[we,Ie!==null]],To=(W.composes==="remoteSlot"?W.helper:Jt.find(([It,qt])=>It!==null&&(It===x&&z?qt:It.managedSourcesBehavior!==void 0||qt))?.[0])?.managedSourcesBehavior,je=He?rt:null,ze=rt!==null&&!Lt,st=ze?null:rt,ct=Te!==null&&!kt&&st===null,Tt=ct?null:Te,wt=[],At=[[ze,"remote",rt],[ct,Wo(),Te]];for(let[It,qt,ln]of At){if(!It||ln===null)continue;if(wt.push([ln,qt]),!Yr(ln)||ln===je)continue;let oo=qt==="remote"&&Be?Wo():"file";A.push({file:Go[qt],path:Object.keys(ln).find((Ys)=>!Oo.includes(Ys))??"",message:`${Go[qt]} holds only values that could not be applied as written, so ${Go[oo]} 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:xt,errors:En}=m8(l);A.push(...En);let jn=g8(l);A.push(...jn?.errors??[]);let Zt=jn?.settings??xt,nn=st!==null&&z&&W.composes!=="remoteSlot",wn=!(st!==null&&We&&!nn)&&!(Tt!==null&&Be),Pn=wn&&(!ke||qe),fn=Pn&&qe,Nt=fn&&Zt&&Ie?cn(Ie,zr.filter((It)=>Zt[It]!==void 0)):Ie,xn=(Be?Tt:null)??(ke?Ie:null),Zy=Zt!==null&&(xn===null||my(xn)||fn),sn=[K8(st,z&&W.composes!=="remoteSlot",[Tt,Nt&&cn(Nt,Le.heldAllowLists??[]),...Zy?[_o(Zt,zr)]:[]]),Tt,Nt,...wt.map(([It])=>It)].filter((It)=>It!==null),qy=[...st!==null?["remote"]:[],...Tt!==null?[Wo()]:[],...Ie!==null?["file"]:[],...wt.map(([,It])=>It)],Ud=(It)=>sn.some((qt)=>qt!==Nt&&qt[It]!==void 0),Wa=Nt!==null&&Le.onlyHeldContent===!0&&wn&&To!=="merge"&&sn[0]!==Nt,ja=st!==null&&l.policyOnlyServerTier?.()!==void 0,{admin:$o,merged:$s}=va(Wa?sn.filter((It)=>It!==Nt):sn,To,nn,Wa?sn.length-2:wt.length,ja),Hd=(It)=>Ia({slot:It,adminTiers:sn})||Zt?.allowManagedMcpServersOnly===!0&&It?.allowManagedMcpServersOnly!==!1,Fd=(It,qt)=>$s?Ud(It):sn[0]!==Nt&&sn[0]?.[It]!==void 0||It==="allowedMcpServers"&&Ud(It)&&Hd(qt),Vo=$o&&Nt&&Wa?va([$o,cn(Nt,Td.filter((It)=>Fd(It,$o)))],"merge",!1,0).admin:$o&&je&&!$s?va([$o,je],"merge",!1,0).admin:$o;if(ja&&Vo!==null){let{kept:It}=wy(l);for(let qt of Iy){let ln=Wt(It,qt),oo=Wt(Vo,qt);if(ln!==void 0)Yt(Vo,qt,o7.includes(qt.join("."))&&Array.isArray(ln)&&Array.isArray(oo)?S([...oo,...ln]):ln)}}let Jr=Vo===null?[L,ne,Le].find(Wr):void 0,Kn=Vo??(Jr?{}:null),Ka={remote:st!==null||Jr===L,mdm:Tt!==null||Jr===ne,file:Ie!==null||Jr===Le},Bd=[];if($s){let It=Ka.remote?"remote":Ka.mdm?Wo():"file",qt=[[Tt,Wo()],[Nt,"file"]];for(let[ln,oo]of qt){if(ln===null||ln===sn[0]||nn&&ln===sn[1])continue;let Ys=Rd.filter((Xa)=>Object.values(ln[Xa]??{}).some((Wd)=>Wd!==void 0&&Wd!==null)),[Gd]=Ys;if(Gd===void 0)continue;Bd.push(oo),A.push({file:Go[oo],path:Gd,message:`${Ys.map((Xa)=>`"${Xa}"`).join(" and ")} in ${Go[oo]} ignored: policy helper configuration is read from the highest managed settings source only (${Go[It]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let $a=(It)=>It!==null&&(It===sn[0]||Object.keys(cn(It,Py())).length>0),Qy={remote:$a(st),mdm:$a(Tt),file:$a(Nt)},Zr={allowManagedPermissionRulesOnly:sn.some((It)=>It.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:Kn?.forceLoginOrgUUID,..._o(Kn??{},zr),hooks:Kn?.hooks,enabledPlugins:Kn?.enabledPlugins,allowedMcpServers:Hd(Kn)?cd({slot:Kn,adminTiers:sn}):Kn?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:sn.some((It)=>It.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:sn.some((It)=>It.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},Va=N8(Vo,Pn),Vs=fn&&Zt?ZS(Zt,Zr):Zt,zd=Va&&Zt&&!fn?zr.filter((It)=>Zt[It]!==void 0&&Le.heldAllowLists?.includes(It)===!0&&Dn(Zr[It],Ie?.[It])&&!Fd(It,Kn)):[],Ya=(Vs||gy(l.parentManaged))&&Va?fn?Ed(Vs??{},{...Zr,allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}},l.parentManaged,l.parentOrganizationSettings?.own):Ed(Vs??{},cn(Zr,zd),l.parentManaged,l.parentOrganizationSettings?.own):null,eO=Ya&&Object.keys(Ya).length>0?Ya:null,tO=U8(Zt===xt?Vs:fn&&xt?ZS(xt,Zr):xt,l.hostManagedProvider);return{tiers:sn,tierSources:qy,admin:Kn,parentSlice:eO,hostModelOverlay:tO,errors:A,present:Ka,mode:To,merged:$s,composed:Qy,snapshotFirst:nn,parentNeverShutOut:Pn,shadowedHelperSources:Bd,parentIncluded:Va,heldEmpty:Jr!==void 0,fileNotHeld:Le.settingsNotHeld,heldInTheHostsPlace:zd,policyOnlyLeads:ja}}function va(l,A,L,x,z=!1){let W=l[0];if(!W)return{admin:null,merged:!1};let{managedSourcesBehavior:Z,...ne}=W,ce=A==="merge"&&l.length>=2;if(!ce&&x===0&&!z)return{admin:Z===void 0?W:ne,merged:!1};let Te=l.slice(ce||z?1:l.length-x).map((we,Ie)=>{let Be=ce&&L&&Ie===0,ke=Be?{...we}:cn(we,Py());if(!Be){for(let He of k8)if(Wt(ke,He)!==void 0)Yt(ke,He,void 0)}let qe=Wt(ke.sandbox,["enabledPlatforms"]);if(Array.isArray(qe)&&qe.includes(E()))Yt(ke,["sandbox","enabledPlatforms"],void 0);else if(qe!==void 0)delete ke.sandbox;return ke});if(!ce)return qS(ne,[W,...Te]),{admin:ne,merged:!1};let Le={};for(let we of[...Te].reverse())rn(Le,we,hd);return rn(Le,ne,L?$8:hd),qS(Le,[W,...Te]),z8(Le,[W,...Te],L),{admin:Le,merged:!0}}var Rd=["policyHelper","policyHelpers"],Go={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function Vr(l){return Object.keys(l).some((A)=>!Oo.includes(A))}function Yr(l){return Object.entries(l).some(([A,L])=>!Oo.includes(A)&&!Is(L))}function Ma(l){return l&&Vr(l)?l:null}function Gr(l){return l.settings!==null&&Yr(l.settings)&&!l.onlySubstitutes}function hy(l,A,L){return Gr({settings:A})&&!L.some((x)=>x.onlySubstitutes)?kS(l):l}var Sy=0;function _d(l,A){if(l===null)return-1;if(A)return 2;return Yr(l)?1:Sy}function yy(l,A){return Object.entries(l).some(([L,x])=>x!==null&&!ry(L,x)&&!Oo.includes(L))||A!==null&&Vr(A)}function Wr(l){return l.documentHasPolicyContent??(l.settings!==null&&Vr(l.settings))}function bo(l){return l.loadState??(l.settings!==null?"loaded":"absent")}function Wn(l,A){if(l==="didNotLoad"||A==="didNotLoad")return"didNotLoad";return l==="loaded"||A==="loaded"?"loaded":"absent"}function jo(l){return l.userWritable!==!0&&(Wr(l)||l.loadState==="didNotLoad")}function z8(l,A,L){let x=A.findIndex((W)=>W.availableModels!==void 0),z=A.findIndex((W)=>W.modelOverrides!==void 0);if(z!==-1&&(x===-1||z<=x||L&&x===0))l.modelOverrides={...A[z].modelOverrides};else delete l.modelOverrides}var Oy=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders"],G8=["awsPairs","ripgrep"];function Ay(l,A,L){if(A===void 0)return l;if(Array.isArray(A))return L==="awsPairs"&&Array.isArray(l)?[...A,..._y(l,A)]:[...A];if(!t(A))return A;return Pi(A,(x)=>Array.isArray(x)?[...x]:x)}var Td=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedProviders","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],zr=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedProviders"],Cy=[["allowManagedMcpServersOnly","allowedMcpServers"],["enforceAvailableModels","availableModels"]];function ZS(l,A){return cn(l,Cy.filter(([,L])=>l[L]===void 0&&A[L]===void 0).map(([L])=>L))}var W8=[...Cy.map(([l])=>l),"allowManagedPermissionRulesOnly","allowManagedHooksOnly","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars","strictPluginOnlyCustomization","sandbox.network.allowManagedDomainsOnly","sandbox.filesystem.allowManagedReadPathsOnly","sandbox.enabled"];function j8(l){return Ma(Ed(cn(l,W8),{...Object.fromEntries(zr.map((A)=>[A,[]])),forceLoginOrgUUID:[],allowManagedPermissionRulesOnly:!0,sandbox:{network:{allowManagedDomainsOnly:!0},filesystem:{allowManagedReadPathsOnly:!0}}}))}function K8(l,A,L){if(l===null||!A)return l;let x=Td.filter((z)=>L.some((W)=>W?.[z]!==void 0));return x.length===0?l:cn(l,x)}function hd(l,A,L){if(L!==void 0&&(Oy.includes(L)||G8.includes(L)))return Ay(l,A,L);return by(l,A,L)}function $8(l,A,L){if(L!==void 0&&Oy.includes(L))return Ay(l,A,L);return by(l,A,L)}function by(l,A,L){if(Array.isArray(l)&&Array.isArray(A)&&L!=="fallbackModel")return S([...A,...l]);return In(l,A,L)}function qS(l,A){let L=A[0],x=l;for(let z of zn()){let{path:W,restrictive:Z}=z,ne=Po(Z),ce=Math.min(...A.map((Te)=>ne.indexOf(Ri(z,Te))).filter((Te)=>Te!==-1));if(Number.isFinite(ce))Yt(x,W,ne[ce]);else if(Wt(L,W)===void 0&&Wt(l,W)!==void 0)Yt(x,W,void 0)}if(l.strictPluginOnlyCustomization!==!0){let z=S(A.flatMap((W)=>Array.isArray(W.strictPluginOnlyCustomization)?W.strictPluginOnlyCustomization:[]));if(z.length>0)l.strictPluginOnlyCustomization=z;else if(L?.strictPluginOnlyCustomization===void 0)delete l.strictPluginOnlyCustomization}}function Ws(l){let A=l.helper?.()??null;if(!A)return{composes:"none"};let L=l.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(l.helperMergesOutput?.()!==!0)return{composes:L,helper:A,mergedOver:null};if(!l.store.policy.mergedHelper){let{base:x,mergedOver:z}=L==="remoteSlot"?{base:bd(l).settings,mergedOver:"remote"}:Ry(l);l.store.policy.mergedHelper={helper:J8(x,A),mergedOver:Object.keys(Ty(x)).length>0?z:null}}return{composes:L,...l.store.policy.mergedHelper}}function Ry(l){let A=Cd(l);if($r({...l,helper:void 0}).present.mdm)return{base:A.settings,mergedOver:Wo(),errors:A.errors};let L=l.file?.()??yd(l);return{base:L.settings,mergedOver:"file",errors:[...A.errors,...L.errors]}}function Ty(l){return cn(l??{},Rd)}function V8(l,A){let L=new Map;for(let[z,W]of Object.entries(A)){let Z=z.toUpperCase();if(!L.has(Z))L.set(Z,W)}let x={};for(let[z,W]of Object.entries(l))x[z]=L.get(z.toUpperCase())??W;return Object.assign(x,A)}var Y8=["forceLoginOrgUUID","gatewayInternalNetworks","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function X8(l,A,L){let x=L!==void 0&&A!==void 0&&Y8.includes(L)?A:hd(l,A,L);return x===A&&Array.isArray(x)?[...x]:x}function J8(l,A){let L=Ty(l),x=rn({},L,A,X8);if(L.env&&A.env)x.env=V8(L.env,A.env);return x}function Z8(l){let A=Ws(l);if(A.composes==="tier")return[A.helper];let{tiers:L,parentSlice:x}=$r(l);return x?[...L,x]:L}function q8(l,A,L){let x={slot:L,adminTiers:l};return l.flatMap((z,W)=>{let Z=A[W],ne=SS(z,x);return Z!==void 0&&ne.length>0?[{source:Z,keys:ne}]:[]})}var Dy=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var Ha=[...Dy,"otelHeadersHelper","proxyAuthHelper"],QS=["disableAllHooks","enabledPlugins","extraKnownMarketplaces","agent","allowedHttpHookUrls","httpHookAllowedEnvVars","autoMemoryDirectory","modelOverrides","allowedMcpServers","skipWebFetchPreflight","autoUploadSessions","xaaIdp","claudeMdExcludes","enableAllProjectMcpServers","enabledMcpjsonServers"];function Q8(l,A,L){if(!QS.some((z)=>A[z]!==void 0)||(L.launchFolderKeysFrom?.(l)??"as_read")==="as_read")return A;let x={...A};for(let z of QS)delete x[z];return rS("keys"),x}function Fs(l,A,L){return e7(l,Q8(l,A,L),L)}function e7(l,A,L){let x=Ha.some((ne)=>A[ne]!==void 0);if(!x&&l!=="policySettings")return A;let z=L.credentialHelperKeysFrom(l);if(z==="as_read")return A;let W=l==="policySettings"&&z==="machine_admin"?t7(L):{};if(!x&&Object.keys(W).length===0)return A;let Z={...A};for(let ne of Ha)delete Z[ne];return Object.assign(Z,W)}function t7(l){let A=Dd(l),L={};for(let x of Ha){let z=A?.[x];if(z!==void 0)L[x]=z}return L}function Dd(l){let A=Ly(l),L=Ws(A);return L.composes==="tier"?L.helper:$r(A).admin}function Ly(l){let A=l.helperArmedFromRemote?.()===!1&&l.helperArmedFromUserWritableBase?.()===!1;return{...l,store:new Y,remote:()=>null,helper:A?l.helper:()=>null,...l.mdm?.().userWritable===!0&&{mdm:()=>({settings:{},errors:[]})}}}function n7(l){return l.helperArmedFromUserWritableBase?.()!==!1||l.helperMergesOutput?.()===!0&&l.mdm?.().userWritable===!0}function ey(l,A){if(A.store.policy.machineLoginPins===void 0){let z=Dd(A);A.store.policy.machineLoginPins={value:{forceLoginOrgUUID:z?.forceLoginOrgUUID,forceLoginMethod:z?.forceLoginMethod}}}let{forceLoginOrgUUID:L,forceLoginMethod:x}=A.store.policy.machineLoginPins.value;if(L!==void 0)l.forceLoginOrgUUID=L;if(x==="claudeai"||x==="console")l.forceLoginMethod=x}var Iy=[["model"],["fallbackModel"],["advisorModel"],["modelOverrides"],["modelPricing"],["modelPicker"],["processWrapper"],["sandbox","credentials","files"],["sandbox","credentials","envVars"],["sandbox","credentials","awsPairs"],["availableModels"],["requiredMinimumVersion"],["requiredMaximumVersion"],["strictKnownMarketplaces"],["allowedMarketplaces"],["allowedChannelPlugins"],["deniedModels"],["blockedMarketplaces"],...Ur.map((l)=>["autoMode",l]),["hooks"],["allowedHttpHookUrls"],["httpHookAllowedEnvVars"],["managedMcpServers"],["extraKnownMarketplaces"],["additionalMarketplaces"],["enabledPlugins"],["pluginConfigs"],["pluginTrustMessage"],["pluginSuggestionMarketplaces"],["claudeMd"],["cleanupPeriodDays"],["desktopSessionCleanupPeriodDays"]],o7=["deniedModels","blockedMarketplaces",...Ur.map((l)=>`autoMode.${l}`)];function wy(l){if(l.store.policy.machineBeneathPolicyOnly===void 0){let A=Dd(l),L={};for(let x of Iy){let z=Wt(A,x);if(z!==void 0)Yt(L,x,z)}l.store.policy.machineBeneathPolicyOnly={kept:L,env:r7(l)}}return l.store.policy.machineBeneathPolicyOnly}function r7(l){return Ld({...Ly(l),helper:()=>null,hkcu:void 0,parentManaged:null}).settings?.env}var s7=[...Ha,"forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","gatewayInternalNetworks","parentSettingsBehavior","env","modelPicker",...Rd,...Oo];function Py(){return s7}function xy(l){return oh.some((A)=>l.startsWith(A))||Vc.includes(l)}function i7(l,A,L,x=0){let z=new Map,W=new Map,Z=!1;for(let[ne,ce]of l.entries()){let Te=new Set,Le=A?.[ne]===!0;for(let[we,Ie]of Object.entries(ce??{})){let Be=we.toUpperCase(),ke=xy(Be);if(ke&&Ie.trim()==="")continue;if(ke&&Z)continue;if(ke&&ne>x&&A?.[ne]===!0)continue;let qe=z.get(Be);if(qe!==void 0){if(Te.has(Be))W.set(we,Ie);else if(!W.has(we))W.set(we,qe);continue}if(ne>x&&L?.[ne]?.has(Be))continue;if(W.set(we,Ie),Te.add(Be),z.set(Be,Ie),ke)Le=!0}if(Le)Z=!0}return Object.fromEntries(W)}var a7="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function ty(l){if(!l)return;let A={};for(let[L,x]of Object.entries(l))if(L.toUpperCase()!==a7)A[L]=x;return A}function l7(l,A){let L=Object.entries(l??{}),x=A??{};return L.length===Object.keys(x).length&&L.every(([z,W])=>x[z]===W)}function Ld(l){let A=Ws(l),L=(l.helperWarnings?.()??[]).filter((We)=>!Ro(We.path));if(A.composes==="tier"){let{helper:We}=A;l.store.lastPolicyEnvComposition=null;let nt=n7(l),it=l.hostManagedProvider||nt?{...We}:We;if(l.hostManagedProvider)ka(it);if(nt)ey(it,l);l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&We.availableModels!==void 0?We.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?We.modelOverrides:void 0};let mt=l.store.policy.helperBaseStatusNotices??=[...l.helperMergesOutput?.()===!0?Ry(l).errors.filter((Lt)=>!Lt.statusOnly):[],...$r(l).errors.filter((Lt)=>Lt.statusOnly)];return{settings:it,errors:[...mt,...L]}}let{tiers:x,tierSources:z,admin:W,parentSlice:Z,hostModelOverlay:ne,errors:ce,present:Te,snapshotFirst:Le,heldInTheHostsPlace:we,policyOnlyLeads:Ie}=$r(l);if(ce.push(...L),!W&&!Z){l.store.lastPolicyEnvComposition=null,l.store.policy.pairedModelOverrides={value:void 0},l.store.policy.deniedModelsOverrides={value:void 0};let We=l.hkcu?.();if(We&&Object.keys(We.settings).length>0){let nt=l.hostManagedProvider?{...We.settings}:We.settings;if(l.hostManagedProvider){if(ka(nt),ne)JS(nt,ne)}return{settings:nt,errors:[...ce,...We.errors]}}if(ne)return{settings:{...ne},errors:[...ce,...We?.errors??[]]};return{settings:null,errors:[...ce,...We?.errors??[]]}}let Be=rn({},Z??{},cn(W??{},we),In);if(Z?.availableModelsMatch==="exact")Be.availableModelsMatch="exact";if(Z?.allowManagedHooksOnly===!0)Be.allowManagedHooksOnly=!0;if(Z?.disableSkillShellExecution===!0)Be.disableSkillShellExecution=!0;if(x.some((We)=>We.forceRemoteSettingsRefresh===!0))Be.forceRemoteSettingsRefresh=!0;if(z.includes("remote")||l.mdm?.().userWritable===!0)ey(Be,l);let ke=en.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0&&!Ie,qe=Be.env;if(!ke){let We=x;if(Ie){let it=wy(l).env,mt=new Map(Object.entries(it??{}).filter(([,ze])=>ze.trim()!=="").map(([ze,st])=>[ze.toUpperCase(),st])),Lt=new Set(mt.keys()),kt=lS(it,x[0]?.env)||Object.entries(x[0]?.env??{}).some(([ze,st])=>st==="1"&&Br.some((ct)=>ct===ze.toUpperCase())&&Lt.has(ze.toUpperCase())),Jt=Lt.has("AWS_REGION")?void 0:mt.get("AWS_DEFAULT_REGION"),_n=Object.entries(x[0]?.env??{}).filter(([ze])=>{let st=ze.toUpperCase();return kt?!aS.includes(st):!(iS.includes(st)&&Lt.has(st))}).map(([ze,st])=>Jt!==void 0&&ze.toUpperCase()==="AWS_REGION"?[ze,Jt]:[ze,st]),[To,je]=xm(_n,([ze,st])=>Vc.includes(ze.toUpperCase())&&U(st));We=[{...x[0],env:Object.fromEntries(je.some(([ze])=>xy(ze.toUpperCase()))?_n:je)},{env:{...it,...Object.fromEntries(To)}}]}let nt=i7(We.map((it)=>it.env),We.map((it)=>(it.otelHeadersHelper??"").trim()!==""),We.map((it)=>{let mt=new Set;for(let Lt of Dy){let kt=it[Lt];if(typeof kt==="string"&&kt.trim()!=="")for(let Jt of rh[Lt])mt.add(Jt)}return mt.size>0?mt:void 0}),Le||Ie?1:0);if(Object.keys(nt).length>0)Be.env=nt;else delete Be.env}if(Be.env){let We=ty(Be.env);if(We&&Object.keys(We).length>0)Be.env=We;else delete Be.env}if(l.hostManagedProvider){if(ka(Be),ne)JS(Be,ne)}let He={env:ty(qe)};if(l.hostManagedProvider)ka(He);let rt=!ke&&!l7(Be.env,He.env);l.store.lastPolicyEnvComposition={unionOptedOut:ke,unionChangedEnv:rt,remoteTierPresent:Te.remote,mdmTierPresent:Te.mdm,fileTierPresent:Te.file,adminTierCount:x.length,tiersWithEnv:le(x,(We)=>Object.keys(We.env??{}).length>0)},l.store.policy.pairedModelOverrides={value:l.hostManagedProvider&&W?.availableModels!==void 0&&W.modelOverrides!==void 0&&ne?.availableModels===void 0?W.modelOverrides:void 0},l.store.policy.deniedModelsOverrides={value:l.hostManagedProvider?W?.modelOverrides:void 0};for(let{source:We,keys:nt}of q8(x,z,Be)){let[it]=nt;if(it===void 0)continue;let mt=Go[We],Lt=nt.length===1;ce.push({file:mt,path:it,message:`${nt.map((kt)=>`"${kt}"`).join(" and ")} in ${mt} ${Lt?"is":"are"} not applied: ${mt} is not the managed settings source that applies for ${Lt?"this key":"these keys"} (/status lists the setting sources). Remove ${Lt?"it":"them"} from ${mt}, or set ${Lt?"it":"them"} in the source that applies.`,severity:"warning",statusOnly:!0})}return{settings:Be,errors:ce}}function c7(l,A,{includeLegacyLocalSettings:L=!0}={}){if(l==="policySettings")return Ld(A).settings;let x=Kr(l,A),{settings:z}=x?jr(x,A.store,l==="flagSettings"?A.flagExpectedContent:void 0):{settings:null};if(l==="flagSettings"){let{settings:W}=ly(A);if(W)return rn(z||{},W,In)}if(l==="localSettings"&&L){let W=py(A);if(W){let{settings:Z}=jr(W,A.store);if(Z)return A.onLegacyLocalSettingsRead?.("per_source"),rn(Z,z||{},In)}}return z}function d7(l,A){return{...l,...A}}function In(l,A,L){if(L==="modelPicker"&&A!==void 0)return Ny(A);if(Array.isArray(l)&&Array.isArray(A)){if(L==="fallbackModel")return A;return S([...l,...A])}if((L==="extraKnownMarketplaces"||L==="managedMcpServers")&&t(l)&&t(A))return d7(l,A);return}function Ny(l){if(!t(l))return l;let A=l.options;return{...l,...Array.isArray(A)&&{options:A.map((L)=>t(L)?{...L}:L)}}}function u7(l){if(l.store.isLoadingFromDisk)return{settings:{},errors:[]};let A=Date.now();rs("info","settings_load_started"),l.store.isLoadingFromDisk=!0;try{let L=l.store.pluginBase,x={};if(L)x=rn(x,L,In);let z=[],W=new Set,Z=new Set,ne=(He)=>{for(let rt of He){let We=`${rt.file}:${rt.path}:${rt.message}`;if(!W.has(We))W.add(We),z.push(rt)}},ce=[],Te=[go()];if(E()==="wsl"&&l.wslInherits?.())Te.push(un);let Le=new Set(Te.map((He)=>$t(tn(He,"managed-settings.json")))),we=new Set(Te.map((He)=>$t(tn(He,"managed-settings.d")))),Ie=(He)=>{let rt=$t(He);return Le.has(rt)||we.has(Fa(rt))},Be=(He,rt,We)=>{if(We?.channelLabel!==!0&&Ie(He))return;let nt=rt.sandbox?.filesystem?.allowRead?.length??0,it=rt.sandbox?.network?.allowedDomains?.length??0;if(nt>0||it>0)ce.push({file:He,allowReadCount:nt,allowedDomainsCount:it})},ke=null;for(let He of Sd(l)){if(He==="policySettings"){let{settings:nt,errors:it}=Ld(l);if(ke=nt,ne(H8(nt)),ne(F8(nt)),nt)x=rn(x,Fs(He,nt,l),In);ne(it);continue}let rt=l.store.repoTierFreeze.tier(He);if(rt!==void 0){let nt=Kr(He,l);if(nt)Z.add($t(nt));if(ne([...rt.errors]),rt.settings)x=rn(x,rt.settings,In);continue}if(He==="localSettings"){let nt=py(l);if(nt&&!Z.has($t(nt))){Z.add($t(nt));let{settings:it,errors:mt}=jr(nt,l.store);if(ne(mt),it)l.onLegacyLocalSettingsRead?.("cascade"),Be(nt,it),x=rn(x,Fs(He,it,l),In)}}let We=Kr(He,l);if(We){let nt=$t(We),it=He==="flagSettings"&&l.flagExpectedContent!==void 0;if(!Z.has(nt)||it){Z.add(nt);let{settings:mt,errors:Lt}=jr(We,l.store,He==="flagSettings"?l.flagExpectedContent:void 0);if(ne(Lt),mt){if(He==="flagSettings"&&l.flagInlineJson===!0)Be(Kt,mt,{channelLabel:!0});else Be(We,mt);x=rn(x,Fs(He,mt,l),In)}}}if(He==="flagSettings"){let{settings:nt,errors:it}=ly(l);if(ne(it),nt)Be("SDK inline settings",nt,{channelLabel:!0}),x=rn(x,Fs(He,nt,l),In)}}if(ke){if(ke.availableModels!==void 0)x.availableModels=[...ke.availableModels];if(ke.enforceAvailableModels!==void 0)x.enforceAvailableModels=ke.enforceAvailableModels;if(ke.modelPicker!==void 0)x.modelPicker=Ny(ke.modelPicker)}let qe=ke?.deniedModels;if(qe!==void 0)x.deniedModels=[...qe];else delete x.deniedModels;if(ce.length>0){let He=B8(l),rt=(We,nt,it,mt,Lt)=>({file:We,path:nt,severity:"warning",statusOnly:!0,message:`${nt} is ignored — managed settings set ${it}, so only ${mt} from managed settings are honored. The ${Lt===1?"entry":`${Lt} entries`} in ${We} will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).`});if(He.some((We)=>We.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)){for(let We of ce)if(We.allowReadCount>0)ne([rt(We.file,"sandbox.filesystem.allowRead","allowManagedReadPathsOnly","allowRead paths",We.allowReadCount)])}if(He.some((We)=>We.sandbox?.network?.allowManagedDomainsOnly===!0)){for(let We of ce)if(We.allowedDomainsCount>0)ne([rt(We.file,"sandbox.network.allowedDomains","allowManagedDomainsOnly","allowed domains (and WebFetch domain rules)",We.allowedDomainsCount)])}}return rs("info","settings_load_completed",{duration_ms:Date.now()-A,source_count:Z.size,error_count:z.length}),l.store.hookedMerge.computed=x,DS({settings:x,errors:z},l.store.hookedMerge.answers)}finally{l.store.isLoadingFromDisk=!1}}function p7(l){let A=l.store.mergedSettings;if(A!==null)return A;let L=u7(l);return l.store.mergedSettings=L,L}function f7(l){let{settings:A}=p7(l);return A||{}}function ky(l){l.store.invalidateAll();let A=[];for(let L of Sd(l)){let x=fy(L,l);if(x&&Object.keys(x).length>0)A.push({source:L,settings:x})}return{effective:f7(l),sources:A}}function vy(l,A){let L=Sd(A);for(let x=L.length-1;x>=0;x--){let z=L[x];if(fy(z,A)?.[l]!==void 0)return z}return null}import{execFile as m7}from"child_process";import{accessSync as g7,closeSync as _7,constants as E7,openSync as h7,readSync as S7}from"fs";class Fy{promise=null;start(){if(this.promise)return;this.promise=wd()}reset(){this.promise=null}}var y7=new Fy;function O7(l){if(!l)return{status:"ok",exitCode:0,errno:null,signal:null};let A=l,L=typeof A.signal==="string"&&A.signal?A.signal:null;if(typeof A.code==="string")return{status:"spawn_error",exitCode:null,errno:A.code,signal:null};if(A.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:L};if(L)return{status:"killed",exitCode:null,errno:null,signal:L};return{status:"exited",exitCode:typeof A.code==="number"?A.code:null,errno:null,signal:null}}function Id(l,A,L){let x=Date.now();return new Promise((z)=>{try{m7(l,A,{encoding:"utf-8",timeout:CS,windowsHide:!0,...L!==void 0&&{maxBuffer:L}},(W,Z,ne)=>{z({stdout:Z??"",stderr:ne??"",...O7(W),durationMs:Date.now()-x})})}catch(W){let Z=W.code;z({stdout:"",stderr:"",status:"spawn_error",exitCode:null,errno:typeof Z==="string"?Z:null,signal:null,durationMs:Date.now()-x})}})}function My(l){return{status:l.status,exitCode:l.exitCode,errno:l.errno,signal:l.signal,durationMs:l.durationMs,answered:l.status==="ok"||l.status==="exited"&&l.exitCode===1&&l.stderr.includes(bS)}}function Uy(l){return l.status==="ok"||l.status==="exited"&&l.exitCode!==null}function A7(l){return l.status==="spawn_error"&&l.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function C7(l){let A;try{return A=h7(l,"r"),S7(A,Buffer.alloc(1),0,1,0),null}catch(L){return{code:L&&typeof L==="object"&&"code"in L?L.code:void 0,message:L instanceof Error?L.message:String(L)}}finally{if(A!==void 0)try{_7(A)}catch{}}}function wd(){return(async()=>{if(process.platform==="darwin"){let l=RS(),L=(await Promise.all(l.map(async({path:z,...W})=>{try{g7(z,E7.R_OK)}catch(Te){let Le=Te&&typeof Te==="object"&&"code"in Te?Te.code:void 0;if(Le==="ENOENT"||Le==="ENOTDIR")return null;return{stdout:null,unreadReason:Te instanceof Error?Te.message:String(Te),...typeof Le==="string"&&{unreadErrno:Le},...W}}let Z=await Id(ud,[...OS,z],xa);if(!Uy(Z))return{stdout:null,unreadReason:"plutil did not finish converting it",...W};if(Z.status==="ok")return{stdout:Z.stdout,...W};let ne=await Id(ud,[...AS,z]);if(!Uy(ne))return{stdout:null,unreadReason:"plutil did not finish checking it",...W};if(ne.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",...W};let ce=C7(z);if(ce!==null){if(ce.code==="ENOENT"||ce.code==="ENOTDIR")return null;return{stdout:null,unreadReason:ce.message,...typeof ce.code==="string"&&{unreadErrno:ce.code},...W}}return{stdout:"",...W}}))).filter((z)=>z!==null),x=L.findIndex((z)=>z.stdout!==null);return{plistStdouts:x===-1?L:L.slice(0,x+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let A=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`;return Hy(A)}if(ks())return Hy(Co);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function Hy(l){let A=(z)=>Id(l,["query",z,"/v",Ns],xa),[L,x]=await Promise.all([A(wa),A(Pa)]);return{plistStdouts:null,hklmStdout:L.status==="ok"?L.stdout:null,...A7(L)&&{hklmUnreadReason:`the value exceeds ${xa/1048576} MiB`},hkcuStdout:x.status==="ok"?x.stdout:null,outcomes:{hklm:My(L),hkcu:My(x)}}}function By(){return y7.promise}var T7=Object.freeze({settings:{},errors:[],loadState:"absent"}),Xr=Object.freeze({settings:{},errors:[]});class jy{mdm=null;hkcu=null;wslInherits=!1;whereAsked=void 0;readOutcomes=null;loadPromise=null;startLoad(l){if(this.loadPromise)return;this.loadPromise=(async()=>{let A=Date.now(),x=await(By()??wd()),{mdm:z,hkcu:W,wslInherits:Z,whereAsked:ne}=await xd(x,l);this.replace(z,W,Z,ne),this.readOutcomes=x.outcomes;let ce=Date.now()-A;e(`MDM settings load completed in ${ce}ms`);try{G("tengu_managed_settings_os_read",M7(x,ce))}catch{}let Te=vd();if(Object.keys(Te.settings).length>0){e(`MDM settings found: ${Object.keys(Te.settings).join(", ")}`);try{rs("info","mdm_settings_loaded",{duration_ms:ce,key_count:Object.keys(z.settings).length,error_count:z.errors.length})}catch{}}})()}replace(l,A,L,x){this.mdm=l,this.hkcu=A,this.wslInherits=L,this.whereAsked=x}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.whereAsked=void 0,this.readOutcomes=null,this.loadPromise=null}}var zy="@builtin",D7=["prependPlugins","appendPlugins"];function L7(l){return typeof l==="object"&&l!==null&&!Array.isArray(l)}var I7=new s(()=>new jy);function Ks(){return I7.of(C().host)}function w7(l){Ks().startLoad(l)}async function Ky(){let l=Ks();if(!l.loadPromise)w7();await l.loadPromise}function vd(){return Md(Ks()).mdm??T7}function Md(l){return l.whereAsked!==void 0&&Li()?l.whereAsked:l}function $y(){return Md(Ks()).hkcu??Xr}function Vy(){return Md(Ks()).wslInherits}function js(l,A,{userWritable:L=!1}={}){let x=wo(l,!1);if(!t(x))return{settings:{},errors:[za(A,{userWritable:L})],documentHasPolicyContent:!1,loadState:"didNotLoad"};let z=[],W=x;for(let Ie of L?Ba:[]){if(!(Ie in W))continue;if(W=W===x?{...x}:W,delete W[Ie],!Ro(Ie))z.push({file:A,path:Ie,message:`"${Ie}" is only honored from administrator-controlled managed settings and was ignored in ${A}, which the user account can write.`,severity:"warning",statusOnly:!0})}if(L){for(let Be of D7){if(!(Be in W))continue;W=W===x?{...x}:W,delete W[Be],z.push({file:A,path:Be,message:`"${Be}" is only honored from administrator-controlled managed settings and was ignored in ${A}, which the user account can write.`,severity:"warning",statusOnly:!0})}let Ie=W.enabledPlugins;if(L7(Ie)){if(Object.entries(Ie).filter(([ke,qe])=>ke.endsWith(zy)||qe!==!1).length>0){W=W===x?{...x}:W;let ke=hi(Ie,(qe,He)=>!He.endsWith(zy)&&qe===!1);if(Object.keys(ke).length>0)W.enabledPlugins=ke;else delete W.enabledPlugins;z.push({file:A,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 ${A}, which the user account can write.`,severity:"warning",statusOnly:!0})}}}let{settings:Z,errors:ne,documentHasPolicyContent:ce,loadState:Te,onlySubstitutes:Le}=Bs(W,A),we=[...z,...ne];return{settings:Z??{},errors:L?we.map((Ie)=>({...Ie.severity==="warning"&&!Ie.startupFatal?Ie:{...P7(Ie),severity:"warning",statusOnly:!0},userWritable:!0})):we,documentHasPolicyContent:ce,loadState:Te,...Le&&{onlySubstitutes:Le}}}function P7({startupFatal:l,loadedWithoutGuardHook:A,...L}){return L}function Pd(l,A,L,x){return{file:l,path:"",message:`Managed settings document (${l}) could not be read: ${A}; none of its settings are in effect.`,severity:L?"warning":"fatal",statusOnly:!0,errorClass:"unreadable",...x!==void 0&&{errno:x},...L&&{userWritable:!0}}}function Ga(l,A="Settings"){let L=A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),x=new RegExp(`^[ \\t]+${L}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),z=l.match(x)?.[1]?.trimEnd();return z?z:null}var x7=new Map([["ENOENT",b("ENOENT")],["EACCES",b("EACCES")],["EPERM",b("EPERM")],["ENOEXEC",b("ENOEXEC")],["EAGAIN",b("EAGAIN")],["EMFILE",b("EMFILE")],["ENOMEM",b("ENOMEM")],["ETIMEDOUT",b("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",b("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),N7=new Map([["SIGTERM",b("SIGTERM")],["SIGKILL",b("SIGKILL")],["SIGINT",b("SIGINT")]]);function k7(l){if(!l)return;return x7.get(l)??b("other")}function v7(l){if(!l)return;return N7.get(l)??b("other")}function Gy(l,A){if(!A)return{};return{[`${l}_status`]:F(A.status),[`${l}_exit_code`]:A.exitCode??void 0,[`${l}_errno`]:k7(A.errno),[`${l}_signal`]:v7(A.signal),[`${l}_duration_ms`]:A.durationMs}}function M7(l,A){return{is_wsl:ks(),await_ms:A,...Gy("hklm",l.outcomes.hklm),...Gy("hkcu",l.outcomes.hkcu)}}async function xd(l,A,L=!1){let x=[],z=!1,W="absent";for(let rt of l.plistStdouts??[]){let{label:We,userWritable:nt}=rt;if(nt&&z)continue;let it=rt.stdout===null?{settings:{},errors:[Pd(We,rt.unreadReason,nt,rt.unreadErrno)],documentHasPolicyContent:!1,loadState:"didNotLoad",...nt&&{userWritable:nt}}:{...js(rt.stdout,We,{userWritable:nt}),...nt&&{userWritable:nt}};if(nt?Vr(it.settings):it.documentHasPolicyContent)return{mdm:{...it,errors:[...x,...it.errors],documentHasPolicyContent:!0},hkcu:Xr,wslInherits:!1};if(z||=jo(it),x.push(...it.errors),!nt)W=Wn(W,it.loadState)}let Z=`Registry: ${wa}\\${Ns}`,ne=null,ce="disarmed",Te=`Registry: ${Pa}\\${Ns}`;if(!L&&(l.hklmStdout!==null||l.hklmUnreadReason!==void 0||l.hkcuStdout!==null)&&process.platform!=="win32"&&pd()){let[rt,We]=await Promise.all([Co,R7(Co)].map((it)=>b7(it).then(({uid:mt,gid:Lt,mode:kt})=>({uid:mt,gid:Lt,mode:kt}),()=>{return}))),nt=!0;try{nt=Ad(new Y,Co,rt,We)}catch(it){e(`registry tool: could not be asked about, held: ${it}`,{level:"error"})}if(nt){let it=[];if(l.hklmStdout!==null)it.push([Z,js(Ga(l.hklmStdout)??"",Z)]);else if(l.hklmUnreadReason!==void 0)it.push([Z,{settings:{},errors:[Pd(Z,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"}]);if(l.hkcuStdout!==null)it.push([Te,js(Ga(l.hkcuStdout)??"",Te,{userWritable:!0})]);let mt=await xd(l,A,!0),Lt=await xd({...l,hklmStdout:null,hklmUnreadReason:void 0,hkcuStdout:null},A,!0);return{...mt,whereAsked:{...Lt,mdm:{...Lt.mdm,heldDocuments:it.map(([kt,Jt])=>({path:kt,parsed:{...Jt,settings:Jt.loadState==="loaded"?Jt.settings:null}}))}}}}}if(l.hklmStdout!==null){let rt=Ga(l.hklmStdout)??"";ne=js(rt,Z);let We=wo(rt,!1);if(t(We))ce=vc(We)}else if(l.hklmUnreadReason!==void 0)ne={settings:{},errors:[Pd(Z,l.hklmUnreadReason,!1)],documentHasPolicyContent:!1,loadState:"didNotLoad"};let Le=ne!==null&&jo(ne);if(ne)x.push(...ne.errors),W=Wn(W,ne.loadState);let we=ks(),Ie="disarmed",Be=Z,ke=[];if(we){if(Ie=ce,Ie!=="armed"){let rt=await H7(A);if(ke=rt.links,rt.flag==="armed"||Ie==="disarmed")Ie=rt.flag,Be=rt.unreadableFlagPath??un;if(Ie==="disarmed")x.push(...rt.records),W=Wn(W,rt.loadState)}}let qe=Ie!=="disarmed",He={settings:{},errors:x,loadState:W};if(we&&!qe){let rt=new Set(ne?.errors.filter((We)=>We.severity==="warning"));return{mdm:{...He,errors:He.errors.map((We)=>rt.has(We)?{...We,wslIgnored:!0}:We),...ke.length>0&&{managedDocumentLinks:ke}},hkcu:Xr,wslInherits:!1}}if(ne&&Le)return{mdm:ne,hkcu:Xr,wslInherits:qe};if(Ie==="unreadable"){let rt=await kd(un,A),We=cy(Be);return{mdm:{...He,errors:rt?He.errors:[...He.errors,We],...rt&&{withheldFlagRecord:We},documentHasPolicyContent:!0,loadState:Wn(He.loadState,"loaded")},hkcu:Xr,wslInherits:qe}}if(l.hkcuStdout!==null&&!f()&&!await U7(qe,A)){let rt=js(Ga(l.hkcuStdout)??"",Te,{userWritable:!0});if(!we||rt.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:We,managedSourcesBehavior:nt,...it}=rt.settings;return{mdm:He,hkcu:{settings:it,errors:rt.errors},wslInherits:qe}}if(rt.errors.length>0)return{mdm:He,hkcu:{settings:{},errors:rt.errors},wslInherits:qe}}return{mdm:He,hkcu:Xr,wslInherits:qe}}async function Yy(l,A){if(c()&&A!==void 0)return(await Wp(l,zs)).content;return fo(l,zs)}async function U7(l,A){if(l&&await kd(un,A))return!0;return kd(go(),A)}async function Wy(l,A){let L;try{L=await Yy(l,A)}catch(x){return!g(x)}try{let x=Ua(L,l,!0);return jo({...x,loadState:bo(x)})}catch{return!0}}function Nd(l){let A=r(l);return A==="ENOENT"||A==="ENOTDIR"}async function H7(l){let A=[],L="absent",x=[],z=new Map;async function W(we,Ie){let Be=Ko(un,...we),ke;try{ke=await Yy(Be,l)}catch(rt){if(Nd(rt))return"disarmed";A.push(Gs(Be,rt)),L="didNotLoad"}let qe=await df(un,we,Ie,z);if(qe!==null)x.push(qe);if(ke===void 0)return"disarmed";let He=ke.trim()===""?{}:wo(ke,!1);if(!t(He))return A.push(za(Be)),L="didNotLoad","disarmed";return L=Wn(L,"loaded"),vc(He)}let Z=Ko(un,"managed-settings.json"),ne=await W(["managed-settings.json"]);if(ne==="armed")return{flag:ne,records:A,loadState:L,links:x};let ce=ne==="unreadable"?Z:void 0,Te=Ko(un,"managed-settings.d"),Le;try{Le=await i().readdir(Te)}catch(we){if(!Nd(we))A.push(Gs(Te,we,"directory")),L="didNotLoad";return{flag:ne,unreadableFlagPath:ce,records:A,loadState:L,links:x}}for(let we of Le){if(!(we.isFile()||we.isSymbolicLink())||!we.name.endsWith(".json")||we.name.startsWith("."))continue;let Ie=await W(["managed-settings.d",we.name],we.isSymbolicLink());if(Ie==="armed")return{flag:Ie,records:A,loadState:L,links:x};if(Ie==="unreadable")ne=Ie,ce??=Ko(Te,we.name)}return{flag:ne,unreadableFlagPath:ce,records:A,loadState:L,links:x}}async function kd(l,A){if(await Wy(Ko(l,"managed-settings.json"),A))return!0;let L=Ko(l,"managed-settings.d"),x;try{x=await i().readdir(L)}catch(z){return!Nd(z)}for(let z of x)if((z.isFile()||z.isSymbolicLink())&&Od(z.name)&&await Wy(Ko(L,z.name),A))return!0;return!1}function Xy(l){if(!Object.hasOwn(l,ut))return{tier:l,organization:null,memberLost:!1};let{[ut]:A,...L}=l;return{tier:L,organization:null,memberLost:!1}}var B7={user:"userSettings",project:"projectSettings",local:"localSettings"},Jy={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},z7=["user","project","local"];async function ube(l={}){await Ky();let A=l.managedSettings&&Xy(l.managedSettings),L={store:new Y,cwd:F7(l.cwd??i().cwd()),allowedSources:(l.settingSources??z7).map((ce)=>B7[ce]),diskless:f(),parentManaged:A?.tier??null,parentOrganizationSettings:A?.organization,flagInline:null,flagPath:void 0,mdm:vd,hkcu:$y,wslInherits:Vy,credentialHelperKeysFrom:()=>"as_read",asksOrganization:()=>Li(),...l.serverManagedSettings!==void 0&&{remote:()=>l.serverManagedSettings}},{effective:x,sources:z}=ky(L),W=Ey(L)??void 0,Z=z.map(({source:ce,settings:Te})=>({source:Jy[ce],settings:Te,path:ce==="policySettings"?void 0:Kr(ce,L),...ce==="policySettings"&&{policyOrigin:W}})),ne={};for(let ce of Object.keys(x)){let Te=vy(ce,L);if(Te)ne[ce]={source:Jy[Te],path:Te==="policySettings"?void 0:Kr(Te,L),...Te==="policySettings"&&{policyOrigin:W}}}return{effective:x,provenance:ne,sources:Z}}export{ube as resolveSettingsForSdk};